core: pxe: remove vestigial dnsresolv.inc
authorH. Peter Anvin <hpa@zytor.com>
Wed, 2 Sep 2009 00:08:52 +0000 (17:08 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 2 Sep 2009 00:10:07 +0000 (17:10 -0700)
Remove dnsresolv.inc, which was already unused except for a couple of
buffer declarations.  Move those buffers to regular C variables.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/dnsresolv.inc [deleted file]
core/fs/pxe/dhcp_option.c
core/fs/pxe/dnsresolv.c
core/fs/pxe/pxe.h
core/pxelinux.asm

diff --git a/core/dnsresolv.inc b/core/dnsresolv.inc
deleted file mode 100644 (file)
index 6d6c67a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-; -*- fundamental -*-
-; -----------------------------------------------------------------------
-;
-;   Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
-;
-;   This program is free software; you can redistribute it and/or modify
-;   it under the terms of the GNU General Public License as published by
-;   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
-;   Bostom MA 02111-1307, USA; either version 2 of the License, or
-;   (at your option) any later version; incorporated herein by reference.
-;
-; -----------------------------------------------------------------------
-
-;
-; dnsresolv.inc
-;              
-DNS_MAX_PACKET equ     512                     ;Defined by protocol
-                
-                section .bss16
-                global LocalDomain
-                global DNSSendBuf, DNSRecvBuf
-               alignb 2
-DNSSendBuf     resb DNS_MAX_PACKET
-DNSRecvBuf     resb DNS_MAX_PACKET
-LocalDomain    resb 256                ; Max possible length
-
-                section .text16
\ No newline at end of file
index ebe8eb4..7935f8b 100644 (file)
@@ -4,9 +4,12 @@
 #include <sys/cpu.h>
 #include "pxe.h"
 
+char LocalDomain[256];
+
 int over_load;
 uint8_t uuid_type;
 char uuid[17];
+
 void parse_dhcp_options(void *, int, int);
 
 static void subnet_mask(void *data, int opt_len)
index dbabbb6..d019514 100644 (file)
@@ -171,6 +171,8 @@ static char *dns_skiplabel(char *label)
  */
 uint32_t dns_resolv(const char *name)
 {
+    static char __lowmem DNSSendBuf[PKTBUF_SIZE];
+    static char __lowmem DNSRecvBuf[PKTBUF_SIZE];
     char *p;
     int err;
     int dots;
@@ -225,8 +227,8 @@ uint32_t dns_resolv(const char *name)
         udp_write.src_port    = DNS_LOCAL_PORT;
         udp_write.dst_port    = DNS_PORT;
         udp_write.buffer_size = p - DNSSendBuf;
-        udp_write.buffer.offs = OFFS_WRT(DNSSendBuf, 0);
-        udp_write.buffer.seg  = 0;
+        udp_write.buffer.offs = OFFS(DNSSendBuf);
+        udp_write.buffer.seg  = SEG(DNSSendBuf);
         err = pxe_call(PXENV_UDP_WRITE, &udp_write);
         if (err || udp_write.status != 0)
             continue;
@@ -239,8 +241,8 @@ uint32_t dns_resolv(const char *name)
             udp_read.s_port      = DNS_PORT;
             udp_read.d_port      = DNS_LOCAL_PORT;
             udp_read.buffer_size = DNS_MAX_PACKET;
-            udp_read.buffer.offs = OFFS_WRT(DNSRecvBuf, 0);
-            udp_read.buffer.seg  = 0;
+            udp_read.buffer.offs = OFFS(DNSRecvBuf);
+            udp_read.buffer.seg  = SEG(DNSRecvBuf);
             err = pxe_call(PXENV_UDP_READ, &udp_read);
             if (err || udp_read.status)
                 continue;
index 07a6b6e..8a2b190 100644 (file)
@@ -20,6 +20,7 @@
 #define PXE_H
 
 #include <syslinux/pxe_api.h>
+#include "fs.h"                        /* For MAX_OPEN, should go away */
 
 /*
  * Some basic defines...
@@ -184,8 +185,6 @@ extern char IPOption[];
 extern char dot_quad_buf[];
 
 extern uint32_t dns_server[];
-extern char DNSSendBuf[];
-extern char DNSRecvBuf[];
 
 extern uint16_t real_base_mem;
 extern uint16_t APIVer;
index 876d06f..5512e84 100644 (file)
@@ -366,7 +366,6 @@ pxe_int1a:
 writestr_early equ writestr
 %include "writehex.inc"                ; Hexadecimal output
 %include "rawcon.inc"          ; Console I/O w/o using the console functions
-%include "dnsresolv.inc"       ; DNS resolver
 
 ; -----------------------------------------------------------------------------
 ;  Begin data section