icmp.c (158160) | icmp.c (158161) |
---|---|
1/*- 2 * Copyright (c) 1980, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> 35 | 1/*- 2 * Copyright (c) 1980, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> 35 |
36__FBSDID("$FreeBSD: head/usr.bin/systat/icmp.c 158160 2006-04-30 04:26:46Z bde $"); | 36__FBSDID("$FreeBSD: head/usr.bin/systat/icmp.c 158161 2006-04-30 04:47:23Z bde $"); |
37 38#ifdef lint 39static char sccsid[] = "@(#)mbufs.c 8.1 (Berkeley) 6/6/93"; 40#endif 41 42/* From: 43 "Id: mbufs.c,v 1.5 1997/02/24 20:59:03 wollman Exp" 44*/ --- 124 unchanged lines hidden (view full) --- 169 DO(icps_reflect); 170 for (i = 0; i <= ICMP_MAXTYPE; i++) { 171 DO(icps_inhist[i]); 172 } 173 DO(icps_bmcastecho); 174 DO(icps_bmcasttstamp); 175#undef DO 176} | 37 38#ifdef lint 39static char sccsid[] = "@(#)mbufs.c 8.1 (Berkeley) 6/6/93"; 40#endif 41 42/* From: 43 "Id: mbufs.c,v 1.5 1997/02/24 20:59:03 wollman Exp" 44*/ --- 124 unchanged lines hidden (view full) --- 169 DO(icps_reflect); 170 for (i = 0; i <= ICMP_MAXTYPE; i++) { 171 DO(icps_inhist[i]); 172 } 173 DO(icps_bmcastecho); 174 DO(icps_bmcasttstamp); 175#undef DO 176} |
177 | 177 |
178void 179showicmp(void) 180{ 181 struct icmpstat stats; 182 u_long totalin, totalout; 183 int i; 184 185 memset(&stats, 0, sizeof stats); 186 domode(&stats); 187 for (i = totalin = totalout = 0; i <= ICMP_MAXTYPE; i++) { 188 totalin += stats.icps_inhist[i]; 189 totalout += stats.icps_outhist[i]; 190 } | 178void 179showicmp(void) 180{ 181 struct icmpstat stats; 182 u_long totalin, totalout; 183 int i; 184 185 memset(&stats, 0, sizeof stats); 186 domode(&stats); 187 for (i = totalin = totalout = 0; i <= ICMP_MAXTYPE; i++) { 188 totalin += stats.icps_inhist[i]; 189 totalout += stats.icps_outhist[i]; 190 } |
191 totalin += stats.icps_badcode + stats.icps_badlen + | 191 totalin += stats.icps_badcode + stats.icps_badlen + |
192 stats.icps_checksum + stats.icps_tooshort; 193 mvwprintw(wnd, 1, 0, "%9lu", totalin); 194 mvwprintw(wnd, 1, 35, "%9lu", totalout); 195 196#define DO(stat, row, col) \ 197 mvwprintw(wnd, row, col, "%9lu", stats.stat) 198 199 DO(icps_badcode, 2, 0); --- 86 unchanged lines hidden --- | 192 stats.icps_checksum + stats.icps_tooshort; 193 mvwprintw(wnd, 1, 0, "%9lu", totalin); 194 mvwprintw(wnd, 1, 35, "%9lu", totalout); 195 196#define DO(stat, row, col) \ 197 mvwprintw(wnd, row, col, "%9lu", stats.stat) 198 199 DO(icps_badcode, 2, 0); --- 86 unchanged lines hidden --- |