diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-04-12 18:15:39 +0200 |
---|---|---|
committer | Jiri Pirko <jiri@resnulli.us> | 2013-04-17 17:17:48 +0200 |
commit | 70540ef693a54785ff7696ff938943a4b272ec3f (patch) | |
tree | 51d3eff040fa531f7c7d53ebb8243f1b1c093a8e /utils/ndptool.c | |
parent | 266a76d719ed860972563b28645280a14eb53dcf (diff) | |
download | libndp-70540ef693a54785ff7696ff938943a4b272ec3f.tar.gz |
add support for DNS Search List (rfc6106)
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Diffstat (limited to 'utils/ndptool.c')
-rw-r--r-- | utils/ndptool.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/utils/ndptool.c b/utils/ndptool.c index 283d55b..6d45097 100644 --- a/utils/ndptool.c +++ b/utils/ndptool.c @@ -288,6 +288,25 @@ static int msgrcv_handler_func(struct ndp *ndp, struct ndp_msg *msg, void *priv) pr_out("%us", lifetime); pr_out("\n"); } + ndp_msg_opt_for_each_offset(offset, msg, NDP_MSG_OPT_DNSSL) { + char *domain; + int domain_index; + uint32_t lifetime; + + lifetime = ndp_msg_opt_rdnss_lifetime(msg, offset); + pr_out(" DNS Search List: "); + ndp_msg_opt_dnssl_for_each_domain(domain, domain_index, msg, offset) { + if (domain_index != 0) + pr_out(" "); + pr_out("%s", domain); + } + pr_out(", lifetime: "); + if (lifetime == (uint32_t) -1) + pr_out("infinity"); + else + pr_out("%us", lifetime); + pr_out("\n"); + } } else if (msg_type == NDP_MSG_NS) { pr_out(" Type: NS\n"); } else if (msg_type == NDP_MSG_NA) { |