Changes in uspace/app/dnsres/dnsres.c [5a6cc679:a35b458] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/dnsres/dnsres.c
r5a6cc679 ra35b458 38 38 #include <stdio.h> 39 39 #include <stdlib.h> 40 #include <str.h> 40 41 41 42 #define NAME "dnsres" … … 52 53 return 1; 53 54 } 54 55 55 56 uint16_t ver; 56 57 char *hname; 57 58 58 59 if (str_cmp(argv[1], "-4") == 0) { 59 60 if (argc < 3) { … … 61 62 return 1; 62 63 } 63 64 64 65 ver = ip_v4; 65 66 hname = argv[2]; … … 69 70 return 1; 70 71 } 71 72 72 73 ver = ip_v6; 73 74 hname = argv[2]; … … 76 77 hname = argv[1]; 77 78 } 78 79 79 80 dnsr_hostinfo_t *hinfo; 80 81 errno_t rc = dnsr_name2host(hname, &hinfo, ver); … … 83 84 return rc; 84 85 } 85 86 86 87 char *saddr; 87 88 rc = inet_addr_format(&hinfo->addr, &saddr); … … 91 92 return rc; 92 93 } 93 94 94 95 printf("Host name: %s\n", hname); 95 96 96 97 if (str_cmp(hname, hinfo->cname) != 0) 97 98 printf("Canonical name: %s\n", hinfo->cname); 98 99 99 100 printf("Address: %s\n", saddr); 100 101 101 102 dnsr_hostinfo_destroy(hinfo); 102 103 free(saddr); 103 104 104 105 return 0; 105 106 }
Note:
See TracChangeset
for help on using the changeset viewer.