aboutsummaryrefslogtreecommitdiffstats
path: root/com32/samples/resolv.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/samples/resolv.c')
-rw-r--r--com32/samples/resolv.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/com32/samples/resolv.c b/com32/samples/resolv.c
index bd49d9f9..3446bd61 100644
--- a/com32/samples/resolv.c
+++ b/com32/samples/resolv.c
@@ -22,23 +22,11 @@
#include <stdlib.h>
#include <com32.h>
-uint32_t resolv(const char *name)
-{
- com32sys_t reg;
-
- strcpy((char *)__com32.cs_bounce, name);
-
- memset(&reg, 0, sizeof reg);
- reg.eax.w[0] = 0x0010;
- reg.ebx.w[0] = OFFS(__com32.cs_bounce);
- reg.es = SEG(__com32.cs_bounce);
+#include <syslinux/pxe.h>
- __intcall(0x22, &reg, &reg);
-
- if (reg.eflags.l & EFLAGS_CF)
- return 0;
- else
- return reg.eax.l;
+static inline uint32_t resolv(const char *name)
+{
+ return pxe_dns_resolv(name);
}
int main(int argc, char *argv[])
@@ -53,7 +41,6 @@ int main(int argc, char *argv[])
}
ip = resolv(argv[1]);
-
if (ip) {
printf("%s = %u.%u.%u.%u\n", argv[1],
(ip & 0xff), (ip >> 8) & 0xff,