netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 6/6] [IPV4] SNMP: Display new statistics at /proc/net/snmp
Date: Sat, 12 May 2007 01:10:04 +0900	[thread overview]
Message-ID: <20070512011004.e2e3fc7b.mitch@linux.vnet.ibm.com> (raw)
In-Reply-To: <20070507202905.e101d8cc.mitch@linux.vnet.ibm.com>

On Mon, 7 May 2007 20:29:05 +0900
Mitsuru Chinen <mitch@linux.vnet.ibm.com> wrote:

> On Thu, 03 May 2007 03:15:46 -0700 (PDT)
> David Miller <davem@davemloft.net> wrote:
> 
> > From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
> > Date: Wed, 2 May 2007 10:05:13 +0900
> > 
> > > [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 added
> > > to /proc/net/snmp is that some existing utilities are developed under
> > > the assumption that ipstat items in /proc/net/snmp is unchanged.
> > > 
> > > Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
> > 
> > Magic constant "17" is not the best, somebody will break this
> > next time this table it touched.
> > 
> > Why not use another sentinel, or something like that, to mark
> > the entry groups?
> 
> Excuse me, but I can't catch why this magic constant is not good.
> When we don't increase the number of entries in /proc/net/snmp,
> I think the start number of new entries which is displayed in
> /proc/net/netstat would be fixed value.

Thanks to Yoshifuji-san and USAGI guys, I'm able to remove
magic constant totally. How about this?


[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>


---

 net/ipv4/proc.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

fc11ca885424125a2add36ab6ff29aa8e4302d4b
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index 37ab580..cdbc6c1 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -109,6 +109,17 @@ static const struct snmp_mib snmp4_ipsta
 	SNMP_MIB_SENTINEL
 };
 
+/* Following RFC4293 items are displayed in /proc/net/netstat */
+static const struct snmp_mib snmp4_ipextstats_list[] = {
+	SNMP_MIB_ITEM("InNoRoutes", IPSTATS_MIB_INNOROUTES),
+	SNMP_MIB_ITEM("InTruncatedPkts", IPSTATS_MIB_INTRUNCATEDPKTS),
+	SNMP_MIB_ITEM("InMcastPkts", IPSTATS_MIB_INMCASTPKTS),
+	SNMP_MIB_ITEM("OutMcastPkts", IPSTATS_MIB_OUTMCASTPKTS),
+	SNMP_MIB_ITEM("InBcastPkts", IPSTATS_MIB_INBCASTPKTS),
+	SNMP_MIB_ITEM("OutBcastPkts", IPSTATS_MIB_OUTBCASTPKTS),
+	SNMP_MIB_SENTINEL
+};
+
 static const struct snmp_mib snmp4_icmp_list[] = {
 	SNMP_MIB_ITEM("InMsgs", ICMP_MIB_INMSGS),
 	SNMP_MIB_ITEM("InErrors", ICMP_MIB_INERRORS),
@@ -338,6 +349,16 @@ static int netstat_seq_show(struct seq_f
 			   snmp_fold_field((void **)net_statistics,
 					   snmp4_net_list[i].entry));
 
+	seq_puts(seq, "\nIpExt:");
+	for (i = 0; snmp4_ipextstats_list[i].name != NULL; i++)
+		seq_printf(seq, " %s", snmp4_ipextstats_list[i].name);
+
+	seq_puts(seq, "\nIpExt:");
+	for (i = 0; snmp4_ipextstats_list[i].name != NULL; i++)
+		seq_printf(seq, " %lu",
+			   snmp_fold_field((void **)ip_statistics,
+					   snmp4_ipextstats_list[i].entry));
+
 	seq_putc(seq, '\n');
 	return 0;
 }
-- 
1.3.3



  reply	other threads:[~2007-05-11 16:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-17 11:09 [PATCH 0/6] SNMP: new statistics specified in RFC4293 Mitsuru Chinen
2007-04-17 11:12 ` [PATCH 1/6] SNMP: Add definitions for {In,Out}BcastPkts Mitsuru Chinen
2007-04-30  7:48   ` David Miller
2007-04-17 11:13 ` [PATCH 2/6] [IPV4] SNMP: Support InNoRoutes Mitsuru Chinen
2007-04-30  7:49   ` David Miller
2007-04-17 11:13 ` [PATCH 3/6] [IPV4] SNMP: Support InTruncatedPkts Mitsuru Chinen
2007-04-30  7:49   ` David Miller
2007-04-17 11:13 ` [PATCH 4/6] [IPV4] SNMP: Support InMcastPkts and InBcastPkts Mitsuru Chinen
2007-04-30  7:49   ` David Miller
2007-04-17 11:14 ` [PATCH 5/6] [IPV4] SNMP: Support OutMcastPkts and OutBcastPkts Mitsuru Chinen
2007-04-30  7:49   ` David Miller
2007-04-17 11:14 ` [PATCH 6/6] [IPV4] SNMP: Display new statistics at /proc/net/snmp Mitsuru Chinen
2007-04-27  7:46   ` Mitsuru Chinen
2007-04-30  7:50     ` David Miller
2007-05-02  1:05       ` Mitsuru Chinen
2007-05-03 10:15         ` David Miller
2007-05-07 11:29           ` Mitsuru Chinen
2007-05-11 16:10             ` Mitsuru Chinen [this message]
2007-05-11 16:19               ` YOSHIFUJI Hideaki / 吉藤英明
2007-05-14 10:07                 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070512011004.e2e3fc7b.mitch@linux.vnet.ibm.com \
    --to=mitch@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).