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, 17 insertions, 4 deletions
diff --git a/com32/samples/resolv.c b/com32/samples/resolv.c
index 3446bd61..bd49d9f9 100644
--- a/com32/samples/resolv.c
+++ b/com32/samples/resolv.c
@@ -22,11 +22,23 @@
#include <stdlib.h>
#include <com32.h>
-#include <syslinux/pxe.h>
-
-static inline uint32_t resolv(const char *name)
+uint32_t resolv(const char *name)
{
- return pxe_dns_resolv(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);
+
+ __intcall(0x22, &reg, &reg);
+
+ if (reg.eflags.l & EFLAGS_CF)
+ return 0;
+ else
+ return reg.eax.l;
}
int main(int argc, char *argv[])
@@ -41,6 +53,7 @@ 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,