summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-04-11 17:11:02 +0200
committerJiri Pirko <jiri@resnulli.us>2013-04-12 16:58:49 +0200
commit2cc9aea1d36fcc1ad66b5e77d56431a51ea8d8ea (patch)
tree0dc181bed5bc6ca3701f79bf512f9d8559b85436 /utils
parent936550245e9168fe11dd027c47dc3fecb2625c18 (diff)
downloadlibndp-2cc9aea1d36fcc1ad66b5e77d56431a51ea8d8ea.tar.gz
add support for Recursive DNS Server (rfc6106)
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Diffstat (limited to 'utils')
-rw-r--r--utils/ndptool.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/utils/ndptool.c b/utils/ndptool.c
index 8bc775b..283d55b 100644
--- a/utils/ndptool.c
+++ b/utils/ndptool.c
@@ -269,6 +269,25 @@ static int msgrcv_handler_func(struct ndp *ndp, struct ndp_msg *msg, void *priv)
pr_out_route_preference(ndp_msg_opt_route_preference(msg, offset));
pr_out("\n");
}
+ ndp_msg_opt_for_each_offset(offset, msg, NDP_MSG_OPT_RDNSS) {
+ static struct in6_addr *addr;
+ int addr_index;
+ uint32_t lifetime;
+
+ lifetime = ndp_msg_opt_rdnss_lifetime(msg, offset);
+ pr_out(" Recursive DNS Servers: ");
+ ndp_msg_opt_rdnss_for_each_addr(addr, addr_index, msg, offset) {
+ if (addr_index != 0)
+ pr_out(", ");
+ pr_out("%s", str_in6_addr(addr));
+ }
+ 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) {