icmp6.c (158160) | icmp6.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/icmp6.c 158160 2006-04-30 04:26:46Z bde $"); | 36__FBSDID("$FreeBSD: head/usr.bin/systat/icmp6.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*/ --- 121 unchanged lines hidden (view full) --- 166 DO(icp6s_checksum); 167 DO(icp6s_badlen); 168 DO(icp6s_reflect); 169 for (i = 0; i <= ICMP6_MAXTYPE; i++) { 170 DO(icp6s_inhist[i]); 171 } 172#undef DO 173} | 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*/ --- 121 unchanged lines hidden (view full) --- 166 DO(icp6s_checksum); 167 DO(icp6s_badlen); 168 DO(icp6s_reflect); 169 for (i = 0; i <= ICMP6_MAXTYPE; i++) { 170 DO(icp6s_inhist[i]); 171 } 172#undef DO 173} |
174 | 174 |
175void 176showicmp6(void) 177{ 178 struct icmp6stat stats; 179 u_long totalin, totalout; 180 int i; 181 182 memset(&stats, 0, sizeof stats); 183 domode(&stats); 184 for (i = totalin = totalout = 0; i <= ICMP6_MAXTYPE; i++) { 185 totalin += stats.icp6s_inhist[i]; 186 totalout += stats.icp6s_outhist[i]; 187 } | 175void 176showicmp6(void) 177{ 178 struct icmp6stat stats; 179 u_long totalin, totalout; 180 int i; 181 182 memset(&stats, 0, sizeof stats); 183 domode(&stats); 184 for (i = totalin = totalout = 0; i <= ICMP6_MAXTYPE; i++) { 185 totalin += stats.icp6s_inhist[i]; 186 totalout += stats.icp6s_outhist[i]; 187 } |
188 totalin += stats.icp6s_badcode + stats.icp6s_badlen + | 188 totalin += stats.icp6s_badcode + stats.icp6s_badlen + |
189 stats.icp6s_checksum + stats.icp6s_tooshort; 190 mvwprintw(wnd, 1, 0, "%9lu", totalin); 191 mvwprintw(wnd, 1, 35, "%9lu", totalout); 192 193#define DO(stat, row, col) \ 194 mvwprintw(wnd, row, col, "%9lu", stats.stat) 195 196 DO(icp6s_badcode, 2, 0); --- 87 unchanged lines hidden --- | 189 stats.icp6s_checksum + stats.icp6s_tooshort; 190 mvwprintw(wnd, 1, 0, "%9lu", totalin); 191 mvwprintw(wnd, 1, 35, "%9lu", totalout); 192 193#define DO(stat, row, col) \ 194 mvwprintw(wnd, row, col, "%9lu", stats.stat) 195 196 DO(icp6s_badcode, 2, 0); --- 87 unchanged lines hidden --- |