diff options
author | Mitsuru Chinen <mitch@linux.vnet.ibm.com> | 2007-05-14 06:07:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-05-14 06:07:30 -0400 |
commit | d831666e98b4f1e19ebdd2349735f47bf37cd293 (patch) | |
tree | 5e4777090c6c2189b6fe945de174f4b3d82091d9 /net/ipv4 | |
parent | ae7bf20a6316272acfcaef5d265b18aaa54b41e4 (diff) |
[IPV4] SNMP: Display new statistics at /proc/net/netstat
This displays the statistics specified in the updated IP-MIB RFC
(RFC4293) in /proc/net/netstat. The reason why these are not displayed
in /proc/net/snmp is that some existing utilities are developed under
the assumption which ipstat items in /proc/net/snmp is unchanged.
Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/proc.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c index 37ab5802ca08..cdbc6c135849 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c | |||
@@ -109,6 +109,17 @@ static const struct snmp_mib snmp4_ipstats_list[] = { | |||
109 | SNMP_MIB_SENTINEL | 109 | SNMP_MIB_SENTINEL |
110 | }; | 110 | }; |
111 | 111 | ||
112 | /* Following RFC4293 items are displayed in /proc/net/netstat */ | ||
113 | static const struct snmp_mib snmp4_ipextstats_list[] = { | ||
114 | SNMP_MIB_ITEM("InNoRoutes", IPSTATS_MIB_INNOROUTES), | ||
115 | SNMP_MIB_ITEM("InTruncatedPkts", IPSTATS_MIB_INTRUNCATEDPKTS), | ||
116 | SNMP_MIB_ITEM("InMcastPkts", IPSTATS_MIB_INMCASTPKTS), | ||
117 | SNMP_MIB_ITEM("OutMcastPkts", IPSTATS_MIB_OUTMCASTPKTS), | ||
118 | SNMP_MIB_ITEM("InBcastPkts", IPSTATS_MIB_INBCASTPKTS), | ||
119 | SNMP_MIB_ITEM("OutBcastPkts", IPSTATS_MIB_OUTBCASTPKTS), | ||
120 | SNMP_MIB_SENTINEL | ||
121 | }; | ||
122 | |||
112 | static const struct snmp_mib snmp4_icmp_list[] = { | 123 | static const struct snmp_mib snmp4_icmp_list[] = { |
113 | SNMP_MIB_ITEM("InMsgs", ICMP_MIB_INMSGS), | 124 | SNMP_MIB_ITEM("InMsgs", ICMP_MIB_INMSGS), |
114 | SNMP_MIB_ITEM("InErrors", ICMP_MIB_INERRORS), | 125 | SNMP_MIB_ITEM("InErrors", ICMP_MIB_INERRORS), |
@@ -338,6 +349,16 @@ static int netstat_seq_show(struct seq_file *seq, void *v) | |||
338 | snmp_fold_field((void **)net_statistics, | 349 | snmp_fold_field((void **)net_statistics, |
339 | snmp4_net_list[i].entry)); | 350 | snmp4_net_list[i].entry)); |
340 | 351 | ||
352 | seq_puts(seq, "\nIpExt:"); | ||
353 | for (i = 0; snmp4_ipextstats_list[i].name != NULL; i++) | ||
354 | seq_printf(seq, " %s", snmp4_ipextstats_list[i].name); | ||
355 | |||
356 | seq_puts(seq, "\nIpExt:"); | ||
357 | for (i = 0; snmp4_ipextstats_list[i].name != NULL; i++) | ||
358 | seq_printf(seq, " %lu", | ||
359 | snmp_fold_field((void **)ip_statistics, | ||
360 | snmp4_ipextstats_list[i].entry)); | ||
361 | |||
341 | seq_putc(seq, '\n'); | 362 | seq_putc(seq, '\n'); |
342 | return 0; | 363 | return 0; |
343 | } | 364 | } |