Path: sran124!katsu From: katsu@sra.co.jp (WATANABE Katsuhiro) Message-ID: Date: 21 Aug 90 13:22:18 Organization: Software Research Associates, Inc.,Japan Newsgroups: comp.bugs.4bsd Subject: Netstat's printing form of packet traffic Distribution: comp # Sorry for my poor English. Index: ucb/netstat/if.c 4.3BSD Description: "netstat 10" prints a banner each 21 lines. It shows accumlated statistics from system start up time(not periodic status) after every banner, and then sleeps 10sec(in this case). So, you cannot get 21th statistics (one between 200sec and 210sec). I don't know whether it is a bug or not. But I think it is improper. For your reference..... "vmstat 10", "iostat 10" and "netstat 10" all print system internal statistics continuously, and print banner each 19/19/21 lines. However only netstat prints accumlative information after each banner. Vmstat and iostat print system status from init only once at the very first. Fix: *IF* you agree with me that it is improper, here is a patch. *** if.c.orig Tue Aug 21 02:27:57 1990 --- if.c Tue Aug 21 03:03:31 1990 *************** *** 207,216 **** off = (off_t) ifnet.if_next; } lastif = ip; - banner: - printf(" input %-6.6s output ", interesting->ift_name); - if (lastif - iftot > 0) - printf(" input (Total) output "); for (ip = iftot; ip < iftot + MAXIF; ip++) { ip->ift_ip = 0; ip->ift_ie = 0; --- 207,212 ---- *************** *** 218,223 **** --- 214,223 ---- ip->ift_oe = 0; ip->ift_co = 0; } + banner: + printf(" input %-6.6s output ", interesting->ift_name); + if (lastif - iftot > 0) + printf(" input (Total) output "); putchar('\n'); printf("%-7.7s %-5.5s %-7.7s %-5.5s %-5.5s ", "packets", "errs", "packets", "errs", "colls"); -- ----____----____ WATANABE Katsuhiro Software Research Associates, Inc. Japan. Not execute, but evaluate.