dmi: check both the AC and ID flags at the same time
[syslinux.git] / com32 / modules / host.c
blobbe7f6cef68ca01781cfa5f41d78012170dd039aa
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 void usage(const char *s)
11 fprintf(stderr, "Usage: %s hostname [, hostname_1, hostname_2, ...]\n", s);
14 int main(int argc, char *argv[])
16 int i;
17 uint32_t ip;
19 openconsole(&dev_null_r, &dev_stdcon_w);
21 if (argc < 2) {
22 usage(argv[0]);
23 return 1;
26 for (i = 1; i < argc; i++) {
27 ip = pxe_dns(argv[i]);
28 if (!ip) {
29 printf("%s not found.\n", argv[i]);
30 } else {
31 printf("%-39s %08X %u.%u.%u.%u\n", argv[i], ntohl(ip), ip & 0xFF,
32 (ip >> 8) & 0xFF, (ip >> 16) & 0xFF, (ip >> 24) & 0xFF);
36 return 0;