Add memtest support.
[syslinux-debian/hramrach.git] / com32 / modules / host.c
blobd70efffd06add9d58f0f7d52c926cb75474b8756
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <console.h>
5 #include <netinet/in.h>
6 #include <com32.h>
7 #include <syslinux/pxe.h>
9 static inline uint32_t dns_resolve(const char *hostname)
11 return pxe_dns(hostname);
14 static inline void usage(const char *s)
16 fprintf(stderr, "Usage: %s hostname [, hostname_1, hostname_2, ...]\n", s);
19 int main(int argc, char *argv[])
21 int i;
22 uint32_t ip;
24 openconsole(&dev_null_r, &dev_stdcon_w);
26 if (argc < 2) {
27 usage(argv[0]);
28 return 1;
31 for (i = 1; i < argc; i++) {
32 ip = dns_resolve(argv[i]);
33 if (!ip) {
34 printf("%s not found.\n", argv[i]);
35 } else {
36 printf("%-39s %08X %u.%u.%u.%u\n", argv[i], ntohl(ip), ip & 0xFF,
37 (ip >> 8) & 0xFF, (ip >> 16) & 0xFF, (ip >> 24) & 0xFF);
41 return 0;