Changeset 7262f89 in mainline for uspace/srv/net/dnsres/query.c
- Timestamp:
- 2013-04-20T10:42:13Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dc95342
- Parents:
- f1dcf6d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/dnsres/query.c
rf1dcf6d r7262f89 36 36 #include <errno.h> 37 37 #include <mem.h> 38 #include <str.h> 38 39 40 #include "dns_msg.h" 39 41 #include "dns_std.h" 40 42 #include "dns_type.h" … … 44 46 static uint16_t msg_id; 45 47 48 #include <stdio.h> 46 49 int dns_name2host(const char *name, dns_host_info_t *info) 47 50 { … … 72 75 return rc; 73 76 74 return EOK; 77 list_foreach(amsg->answer, link) { 78 dns_rr_t *rr = list_get_instance(link, dns_rr_t, msg); 79 80 printf(" - '%s' %u/%u, dsize %u\n", 81 rr->name, rr->rtype, rr->rclass, rr->rdata_size); 82 83 if (rr->rtype == DTYPE_A && rr->rclass == DC_IN) { 84 if (rr->rdata_size != sizeof(uint32_t)) { 85 printf("rdata_size = %u - fail\n", rr->rdata_size); 86 return EIO; 87 } 88 89 info->name = str_dup(rr->name); 90 info->addr.ipv4 = dns_uint32_t_decode(rr->rdata, rr->rdata_size); 91 printf("info->addr = %x\n", info->addr.ipv4); 92 return EOK; 93 } 94 } 95 96 printf("no A/IN found, fail\n"); 97 98 return EIO; 75 99 } 76 100
Note:
See TracChangeset
for help on using the changeset viewer.