From 756361c57e76deae895429266625b448186a62b8 Mon Sep 17 00:00:00 2001 From: ume Date: Thu, 5 Feb 2004 12:08:35 +0000 Subject: printed statistics about source address selection rules. Obtained from: KAME --- usr.bin/netstat/inet6.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'usr.bin') diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c index 4eb898d..6b90b75 100644 --- a/usr.bin/netstat/inet6.c +++ b/usr.bin/netstat/inet6.c @@ -335,6 +335,25 @@ static const char *ip6nh[] = { "#255", }; +static char *srcrule_str[] = { + "first candidate", + "same address", + "appropriate scope", + "deprecated address", + "home address", + "outgoing interface", + "matching label", + "public/temporary address", + "alive interface", + "preferred interface", + "rule #10", + "rule #11", + "rule #12", + "rule #13", + "longest match", + "rule #15", +}; + /* * Dump IP6 statistics structure. */ @@ -489,6 +508,12 @@ ip6_stats(u_long off __unused, const char *name, int af1 __unused) p1a(ip6s_forward_cachehit, "\t%llu forward cache hit\n"); p1a(ip6s_forward_cachemiss, "\t%llu forward cache miss\n"); + printf("\tSource addresses selection rule applied:\n"); + for (i = 0; i < 16; i++) { + if (ip6stat.ip6s_sources_rule[i]) + printf("\t\t%llu %s\n", ip6stat.ip6s_sources_rule[i], + srcrule_str[i]); + } #undef p #undef p1a } -- cgit v1.1