diff options
-rw-r--r-- | networking/nslookup.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/networking/nslookup.c b/networking/nslookup.c index a7dd823f0..c43e60558 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c | |||
@@ -283,6 +283,7 @@ static const struct { | |||
283 | { ns_t_cname, "CNAME" }, | 283 | { ns_t_cname, "CNAME" }, |
284 | { ns_t_mx, "MX" }, | 284 | { ns_t_mx, "MX" }, |
285 | { ns_t_txt, "TXT" }, | 285 | { ns_t_txt, "TXT" }, |
286 | { ns_t_srv, "SRV" }, | ||
286 | { ns_t_ptr, "PTR" }, | 287 | { ns_t_ptr, "PTR" }, |
287 | { ns_t_any, "ANY" }, | 288 | { ns_t_any, "ANY" }, |
288 | }; | 289 | }; |
@@ -435,6 +436,25 @@ static int parse_reply(const unsigned char *msg, size_t len) | |||
435 | } | 436 | } |
436 | break; | 437 | break; |
437 | 438 | ||
439 | case ns_t_srv: | ||
440 | if (rdlen < 6) { | ||
441 | //printf("SRV record too short\n"); | ||
442 | return -1; | ||
443 | } | ||
444 | |||
445 | cp = ns_rr_rdata(rr); | ||
446 | n = ns_name_uncompress(ns_msg_base(handle), ns_msg_end(handle), | ||
447 | cp + 6, dname, sizeof(dname)); | ||
448 | |||
449 | if (n < 0) { | ||
450 | //printf("Unable to uncompress domain: %s\n", strerror(errno)); | ||
451 | return -1; | ||
452 | } | ||
453 | |||
454 | printf("%s\tservice = %u %u %u %s\n", ns_rr_name(rr), | ||
455 | ns_get16(cp), ns_get16(cp + 2), ns_get16(cp + 4), dname); | ||
456 | break; | ||
457 | |||
438 | case ns_t_soa: | 458 | case ns_t_soa: |
439 | if (rdlen < 20) { | 459 | if (rdlen < 20) { |
440 | dbg("SOA record too short:%d\n", rdlen); | 460 | dbg("SOA record too short:%d\n", rdlen); |