From owner-freebsd-net@FreeBSD.ORG Fri Nov 26 13:57:04 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A8F3016A4CE for ; Fri, 26 Nov 2004 13:57:04 +0000 (GMT) Received: from mail.otel.net (gw3.OTEL.net [212.36.8.151]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5BB6743D2F for ; Fri, 26 Nov 2004 13:57:04 +0000 (GMT) (envelope-from tbyte@OTEL.net) Received: from dragon.otel.net ([212.36.8.135]) by mail.otel.net with esmtp (Exim 4.30; FreeBSD) id 1CXgas-000GBm-Ah; Fri, 26 Nov 2004 15:57:02 +0200 Message-ID: <41A7363A.2000201@OTEL.net> Date: Fri, 26 Nov 2004 15:57:14 +0200 From: Iasen Kostov User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.3) Gecko/20041117 X-Accept-Language: bg, en-us, en MIME-Version: 1.0 To: Iasen Kostov References: <41A61434.3000700@OTEL.net> In-Reply-To: <41A61434.3000700@OTEL.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-net@freebsd.org Subject: Re: netstat patch for bridge stats X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Nov 2004 13:57:04 -0000 Iasen Kostov wrote: > Hi, > this is a small patch which will make bridge stats > look nicer (or at least look some way :) ), because > this is current situation: > > -- Bridging statistics (bdg) -- > Name In Out Forward Drop Bcast Mcast > Local Unknown > vlan5:1 709303965749269168687899969 123884 13908828 3236774 > 10765 4123745 > vlan904:1 759386539711221922749370414 447736 6319135 177242 > 49244 3022768 > > It is really a mess :) and does not looks like other protocol stats do. > And this is how it looks after the patch: > > -- Bridging statistics (bdg) -- > vlan5:1: > 721198379 total packets recieved > 762906756 total packets sent > 699495544 forwarded > 124082 dropped > 14073971 broadcasts > 3251664 multicasts > 10784 for local interface > 4242334 unknown packets > vlan904:1: > 773320391 total packets recieved > 723117599 total packets sent > 763146879 forwarded > 447736 dropped > 6424601 broadcasts > 179482 multicasts > 49248 for local interface > 3072445 unknown packets > > I'll be happy to see comments about this. > > regards. > >------------------------------------------------------------------------ > >--- usr.bin/netstat/if.org.c Thu Nov 25 18:13:34 2004 >+++ usr.bin/netstat/if.c Thu Nov 25 18:59:29 2004 >@@ -101,11 +101,12 @@ > bdg_done = 1; > #endif > printf("-- Bridging statistics (%s) --\n", name) ; >- printf( >-"Name In Out Forward Drop Bcast Mcast Local Unknown\n"); > for (i = 0 ; i < 16 ; i++) { > if (s.s[i].name[0]) >- printf("%-6s %9ld%9ld%9ld%9ld%9ld%9ld%9ld%9ld\n", >+ printf("%-6s:\n\t%ld total packets recieved\n\t%ld total packets sent\n\t" \ >+ "%ld forwarded\n\t%ld dropped\n\t" \ >+ "%ld broadcasts\n\t%ld multicasts\n\t%ld for local interface\n\t" \ >+ "%ld unknown packets\n", > s.s[i].name, > s.s[i].p_in[(int)BDG_IN], > s.s[i].p_in[(int)BDG_OUT], > > >------------------------------------------------------------------------ > >_______________________________________________ >freebsd-net@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-net >To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > > OK I sorry to replying my self but this: vlan5:1: 1002610279 total packets received 1070806491 total packets sent could not be formated by "%9ld" :) and thus current output of "netstat -pbdg" it tottaly mean less. And the worst thing is that this are stats for 3 days ...