diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-04-05 14:37:35 +0200 |
---|---|---|
committer | Jiri Pirko <jiri@resnulli.us> | 2013-04-05 16:30:16 +0200 |
commit | 8296a5bf075543eef2167afdfecb222e70866744 (patch) | |
tree | 7a7818d470a192ff84583dde4f94ec86e7e6bdfa /utils | |
parent | 49739ab207af9b134dbc57fe613f7ae2cf45594b (diff) | |
download | libndp-8296a5bf075543eef2167afdfecb222e70866744.tar.gz |
add support for Route Information Option (rfc4191)
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/ndptool.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/utils/ndptool.c b/utils/ndptool.c index dddb402..2898d61 100644 --- a/utils/ndptool.c +++ b/utils/ndptool.c @@ -235,6 +235,32 @@ static int msgrcv_handler_func(struct ndp *ndp, struct ndp_msg *msg, void *priv) } ndp_msg_opt_for_each_offset(offset, msg, NDP_MSG_OPT_MTU) pr_out(" MTU: %u\n", ndp_msg_opt_mtu(msg, offset)); + ndp_msg_opt_for_each_offset(offset, msg, NDP_MSG_OPT_ROUTE) { + uint32_t lifetime; + + lifetime = ndp_msg_opt_route_lifetime(msg, offset); + pr_out(" Route: %s/%u", + str_in6_addr(ndp_msg_opt_route_prefix(msg, offset)), + ndp_msg_opt_route_prefix_len(msg, offset)); + pr_out(", lifetime: "); + if (lifetime == (uint32_t) -1) + pr_out("infinity"); + else + pr_out("%us", lifetime); + pr_out(", preference: "); + switch (ndp_msg_opt_route_preference(msg, offset)) { + case NDP_ROUTE_PREF_LOW: + pr_out("low"); + break; + case NDP_ROUTE_PREF_MEDIUM: + pr_out("medium"); + break; + case NDP_ROUTE_PREF_HIGH: + pr_out("high"); + break; + } + pr_out("\n"); + } } else if (msg_type == NDP_MSG_NS) { pr_out(" Type: NS\n"); } else if (msg_type == NDP_MSG_NA) { |