printed statistics about source address selection rules.

Obtained from:	KAME
This commit is contained in:
ume 2004-02-05 12:08:35 +00:00
parent fcc30a957c
commit c13262dcf1

View File

@ -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
}