aboutsummaryrefslogtreecommitdiffstats
path: root/com32/samples
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@zytor.com>2012-05-04 02:17:46 -0300
committerPaulo Alcantara <pcacjr@zytor.com>2012-05-12 00:56:22 -0300
commit6aba981cd9310bae94587d3e51106261bf0e27b9 (patch)
tree46359ec76905f68643122469d255f62e345d6289 /com32/samples
parent289cc36d32e57d28d5070e975101d37cd96580f2 (diff)
downloadsyslinux-6aba981cd9310bae94587d3e51106261bf0e27b9.tar.gz
syslinux-6aba981cd9310bae94587d3e51106261bf0e27b9.tar.xz
syslinux-6aba981cd9310bae94587d3e51106261bf0e27b9.zip
pxe: resolve names via DNS from protected-mode code
Syslinux used to call __intcall() for calling routines of the old COMBOOT API to resolve names via DNS (INT 22h, AX=0x0010) that seemed pointless, since INT 22h, AX=0x0010 does call the protected-mode function pm_pxe_resolv_dns() when calling INT 22h, AX=0x0010. So, for resolving names via DNS we must call pxe_dns_resolv() (a protected-mode function) instead for now. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
Diffstat (limited to 'com32/samples')
-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,