summaryrefslogtreecommitdiff
path: root/com32
diff options
context:
space:
mode:
Diffstat (limited to 'com32')
-rw-r--r--com32/include/syslinux/pxe_api.h2
-rw-r--r--com32/lib/Makefile1
-rw-r--r--com32/lib/syslinux/pxe_dns.c67
-rw-r--r--com32/libupload/upload_tftp.c2
-rw-r--r--com32/modules/host.c7
-rw-r--r--com32/samples/resolv.c2
6 files changed, 4 insertions, 77 deletions
diff --git a/com32/include/syslinux/pxe_api.h b/com32/include/syslinux/pxe_api.h
index d1fea37e..40794e74 100644
--- a/com32/include/syslinux/pxe_api.h
+++ b/com32/include/syslinux/pxe_api.h
@@ -587,7 +587,7 @@ typedef struct s_PXENV_UNLOAD_STACK {
int pxe_call(int, void *);
void unload_pxe(uint16_t flags);
-uint32_t dns_resolv(const char *);
+uint32_t pxe_dns(const char *);
extern uint32_t SendCookies;
void http_bake_cookies(void);
diff --git a/com32/lib/Makefile b/com32/lib/Makefile
index 8865224e..74fff149 100644
--- a/com32/lib/Makefile
+++ b/com32/lib/Makefile
@@ -46,7 +46,6 @@ LIBSYSLINUX_OBJS = \
syslinux/reboot.o syslinux/keyboard.o \
syslinux/version.o \
syslinux/pxe_get_cached.o syslinux/pxe_get_nic.o \
- syslinux/pxe_dns.o \
syslinux/video/fontquery.o syslinux/video/reportmode.o
DYNENTRY_OBJS = \
diff --git a/com32/lib/syslinux/pxe_dns.c b/com32/lib/syslinux/pxe_dns.c
deleted file mode 100644
index b813b543..00000000
--- a/com32/lib/syslinux/pxe_dns.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ----------------------------------------------------------------------- *
- *
- * Copyright 2010 Intel Corporation; author: H. Peter Anvin
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following
- * conditions:
- *
- * The above copyright notice and this permission notice shall
- * be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * ----------------------------------------------------------------------- */
-
-/*
- * pxe_dns.c
- *
- * Resolve a hostname via DNS
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-#include <com32.h>
-
-#include <syslinux/pxe.h>
-
-/* Returns the status code from PXE (0 on success),
- or -1 on invocation failure */
-uint32_t pxe_dns(const char *hostname)
-{
- union {
- unsigned char b[4];
- uint32_t ip;
- } q;
- char *lm_hostname;
- uint32_t status;
-
- /* Is this a dot-quad? */
- if (sscanf(hostname, "%hhu.%hhu.%hhu.%hhu",
- &q.b[0], &q.b[1], &q.b[2], &q.b[3]) == 4)
- return q.ip;
-
- lm_hostname = lstrdup(hostname);
- if (!lm_hostname)
- return 0;
-
- status = dns_resolv(lm_hostname);
-
- lfree(lm_hostname);
-
- return status;
-}
diff --git a/com32/libupload/upload_tftp.c b/com32/libupload/upload_tftp.c
index 80fe0bfb..e8ead2c7 100644
--- a/com32/libupload/upload_tftp.c
+++ b/com32/libupload/upload_tftp.c
@@ -117,7 +117,7 @@ static bool have_real_network(void)
return tftp_put != _dummy_tftp_put;
}
-__weak uint32_t dns_resolv(const char *host)
+__weak uint32_t pxe_dns(const char *host)
{
(void)host;
diff --git a/com32/modules/host.c b/com32/modules/host.c
index d70efffd..be7f6cef 100644
--- a/com32/modules/host.c
+++ b/com32/modules/host.c
@@ -6,11 +6,6 @@
#include <com32.h>
#include <syslinux/pxe.h>
-static inline uint32_t dns_resolve(const char *hostname)
-{
- return pxe_dns(hostname);
-}
-
static inline void usage(const char *s)
{
fprintf(stderr, "Usage: %s hostname [, hostname_1, hostname_2, ...]\n", s);
@@ -29,7 +24,7 @@ int main(int argc, char *argv[])
}
for (i = 1; i < argc; i++) {
- ip = dns_resolve(argv[i]);
+ ip = pxe_dns(argv[i]);
if (!ip) {
printf("%s not found.\n", argv[i]);
} else {
diff --git a/com32/samples/resolv.c b/com32/samples/resolv.c
index 8f062d19..a6757b7d 100644
--- a/com32/samples/resolv.c
+++ b/com32/samples/resolv.c
@@ -25,7 +25,7 @@
uint32_t resolv(const char *name)
{
- return dns_resolv(name);
+ return pxe_dns(name);
}
int main(int argc, char *argv[])