ip6.c (118318) | ip6.c (158160) |
---|---|
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/ip6.c 118318 2003-08-01 20:28:20Z dwmalone $"); | 36__FBSDID("$FreeBSD: head/usr.bin/systat/ip6.c 158160 2006-04-30 04:26:46Z bde $"); |
37 38#ifdef lint 39static const 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*/ --- 17 unchanged lines hidden (view full) --- 62#include "extern.h" 63#include "mode.h" 64 65static struct ip6stat curstat, initstat, oldstat; 66 67/*- 68--0 1 2 3 4 5 6 7 69--0123456789012345678901234567890123456789012345678901234567890123456789012345 | 37 38#ifdef lint 39static const 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*/ --- 17 unchanged lines hidden (view full) --- 62#include "extern.h" 63#include "mode.h" 64 65static struct ip6stat curstat, initstat, oldstat; 66 67/*- 68--0 1 2 3 4 5 6 7 69--0123456789012345678901234567890123456789012345678901234567890123456789012345 |
7001 IPv6 Input IPv6 Output 71029999999 total packets received 999999999 total packets sent 72039999999 - too short for header 999999999 - generated locally 73049999999 - too short for data 999999999 - output drops 74059999999 - with invalid version 999999999 output fragments generated 75069999999 total fragments received 999999999 - fragmentation failed 76079999999 - fragments dropped 999999999 destinations unreachable 77089999999 - fragments timed out 999999999 packets output via raw IP 78099999999 - fragments overflown Input next-header histogram 79109999999 - packets reassembled ok 999999999 - destination options 80119999999 packets forwarded 999999999 - hop-by-hop options 81129999999 - unreachable dests 999999999 - IPv4 82139999999 - redirects generated 999999999 - TCP 83149999999 option errors 999999999 - UDP 84159999999 unwanted multicasts 999999999 - IPv6 85169999999 delivered to upper layer 999999999 - routing header 8617 999999999 - fragmentation header 87189999999 bad scope packets 999999999 - ICMP6 88199999999 address selection failed 999999999 - none | 7000 IPv6 Input IPv6 Output 71019999999 total packets received 999999999 total packets sent 72029999999 - too short for header 999999999 - generated locally 73039999999 - too short for data 999999999 - output drops 74049999999 - with invalid version 999999999 output fragments generated 75059999999 total fragments received 999999999 - fragmentation failed 76069999999 - fragments dropped 999999999 destinations unreachable 77079999999 - fragments timed out 999999999 packets output via raw IP 78089999999 - fragments overflown 79099999999 - packets reassembled ok Input next-header histogram 80109999999 packets forwarded 999999999 - destination options 81119999999 - unreachable dests 999999999 - hop-by-hop options 82129999999 - redirects generated 999999999 - IPv4 83139999999 option errors 999999999 - TCP 84149999999 unwanted multicasts 999999999 - UDP 85159999999 delivered to upper layer 999999999 - IPv6 86169999999 bad scope packets 999999999 - routing header 87179999999 address selection failed 999999999 - fragmentation header 8818 999999999 - ICMP6 8919 999999999 - none |
89--0123456789012345678901234567890123456789012345678901234567890123456789012345 90--0 1 2 3 4 5 6 7 91*/ 92 93WINDOW * 94openip6(void) 95{ | 90--0123456789012345678901234567890123456789012345678901234567890123456789012345 91--0 1 2 3 4 5 6 7 92*/ 93 94WINDOW * 95openip6(void) 96{ |
96 return (subwin(stdscr, LINES-4-1, 0, 4, 0)); | 97 return (subwin(stdscr, LINES-3-1, 0, MAINWIN_ROW, 0)); |
97} 98 99void 100closeip6(w) 101 WINDOW *w; 102{ 103 if (w == NULL) 104 return; 105 wclear(w); 106 wrefresh(w); 107 delwin(w); 108} 109 110void 111labelip6(void) 112{ 113 wmove(wnd, 0, 0); wclrtoeol(wnd); 114#define L(row, str) mvwprintw(wnd, row, 10, str) 115#define R(row, str) mvwprintw(wnd, row, 45, str); | 98} 99 100void 101closeip6(w) 102 WINDOW *w; 103{ 104 if (w == NULL) 105 return; 106 wclear(w); 107 wrefresh(w); 108 delwin(w); 109} 110 111void 112labelip6(void) 113{ 114 wmove(wnd, 0, 0); wclrtoeol(wnd); 115#define L(row, str) mvwprintw(wnd, row, 10, str) 116#define R(row, str) mvwprintw(wnd, row, 45, str); |
116 L(1, "IPv6 Input"); R(1, "IPv6 Output"); 117 L(2, "total packets received"); R(2, "total packets sent"); 118 L(3, "- too short for header"); R(3, "- generated locally"); 119 L(4, "- too short for data"); R(4, "- output drops"); 120 L(5, "- with invalid version"); R(5, "output fragments generated"); 121 L(6, "total fragments received"); R(6, "- fragmentation failed"); 122 L(7, "- fragments dropped"); R(7, "destinations unreachable"); 123 L(8, "- fragments timed out"); R(8, "packets output via raw IP"); 124 L(9, "- fragments overflown"); R(9, "Input next-header histogram"); 125 L(10, "- packets reassembled ok"); R(10, " - destination options"); 126 L(11, "packets forwarded"); R(11, " - hop-by-hop options"); 127 L(12, "- unreachable dests"); R(12, " - IPv4"); 128 L(13, "- redirects generated"); R(13, " - TCP"); 129 L(14, "option errors"); R(14, " - UDP"); 130 L(15, "unwanted multicasts"); R(15, " - IPv6"); 131 L(16, "delivered to upper layer"); R(16, " - routing header"); 132 R(17, " - fragmentation header"); 133 L(18, "bad scope packets"); R(18, " - ICMP6"); 134 L(19, "address selection failed"); R(19, " - none"); | 117 L(0, "IPv6 Input"); R(0, "IPv6 Output"); 118 L(1, "total packets received"); R(1, "total packets sent"); 119 L(2, "- too short for header"); R(2, "- generated locally"); 120 L(3, "- too short for data"); R(3, "- output drops"); 121 L(4, "- with invalid version"); R(4, "output fragments generated"); 122 L(5, "total fragments received"); R(5, "- fragmentation failed"); 123 L(6, "- fragments dropped"); R(6, "destinations unreachable"); 124 L(7, "- fragments timed out"); R(7, "packets output via raw IP"); 125 L(8, "- fragments overflown"); 126 L(9, "- packets reassembled ok"); R(9, "Input next-header histogram"); 127 L(10, "packets forwarded"); R(10, " - destination options"); 128 L(11, "- unreachable dests"); R(11, " - hop-by-hop options"); 129 L(12, "- redirects generated"); R(12, " - IPv4"); 130 L(13, "option errors"); R(13, " - TCP"); 131 L(14, "unwanted multicasts"); R(14, " - UDP"); 132 L(15, "delivered to upper layer"); R(15, " - IPv6"); 133 L(16, "bad scope packets"); R(16, " - routing header"); 134 L(17, "address selection failed"); R(17, " - fragmentation header"); 135 R(18, " - ICMP6"); 136 R(19, " - none"); |
135#undef L 136#undef R 137} 138 139static void 140domode(struct ip6stat *ret) 141{ 142 const struct ip6stat *sub; --- 51 unchanged lines hidden (view full) --- 194 u_long totalout; 195 196 domode(&stats); 197 totalout = stats.ip6s_forward + stats.ip6s_localout; 198 199#define DO(stat, row, col) \ 200 mvwprintw(wnd, row, col, "%9lu", stats.stat) 201 | 137#undef L 138#undef R 139} 140 141static void 142domode(struct ip6stat *ret) 143{ 144 const struct ip6stat *sub; --- 51 unchanged lines hidden (view full) --- 196 u_long totalout; 197 198 domode(&stats); 199 totalout = stats.ip6s_forward + stats.ip6s_localout; 200 201#define DO(stat, row, col) \ 202 mvwprintw(wnd, row, col, "%9lu", stats.stat) 203 |
202 DO(ip6s_total, 2, 0); 203 mvwprintw(wnd, 2, 35, "%9lu", totalout); 204 DO(ip6s_localout, 3, 35); 205 DO(ip6s_tooshort, 3, 0); 206 DO(ip6s_odropped, 4, 35); 207 DO(ip6s_toosmall, 4, 0); 208 DO(ip6s_ofragments, 5, 35); 209 DO(ip6s_badvers, 5, 0); 210 DO(ip6s_cantfrag, 6, 35); 211 DO(ip6s_fragments, 6, 0); 212 DO(ip6s_noroute, 7, 35); 213 DO(ip6s_fragdropped, 7, 0); 214 DO(ip6s_rawout, 8, 35); 215 DO(ip6s_fragtimeout, 8, 0); 216 DO(ip6s_fragoverflow, 9, 0); | 204 DO(ip6s_total, 1, 0); 205 mvwprintw(wnd, 1, 35, "%9lu", totalout); 206 DO(ip6s_tooshort, 2, 0); 207 DO(ip6s_localout, 2, 35); 208 DO(ip6s_toosmall, 3, 0); 209 DO(ip6s_odropped, 3, 35); 210 DO(ip6s_badvers, 4, 0); 211 DO(ip6s_ofragments, 4, 35); 212 DO(ip6s_fragments, 5, 0); 213 DO(ip6s_cantfrag, 5, 35); 214 DO(ip6s_fragdropped, 6, 0); 215 DO(ip6s_noroute, 6, 35); 216 DO(ip6s_fragtimeout, 7, 0); 217 DO(ip6s_rawout, 7, 35); 218 DO(ip6s_fragoverflow, 8, 0); 219 DO(ip6s_reassembled, 9, 0); 220 DO(ip6s_forward, 10, 0); |
217 DO(ip6s_nxthist[IPPROTO_DSTOPTS], 10, 35); | 221 DO(ip6s_nxthist[IPPROTO_DSTOPTS], 10, 35); |
218 DO(ip6s_reassembled, 10, 0); | 222 DO(ip6s_cantforward, 11, 0); |
219 DO(ip6s_nxthist[IPPROTO_HOPOPTS], 11, 35); | 223 DO(ip6s_nxthist[IPPROTO_HOPOPTS], 11, 35); |
220 DO(ip6s_forward, 11, 0); | 224 DO(ip6s_redirectsent, 12, 0); |
221 DO(ip6s_nxthist[IPPROTO_IPV4], 12, 35); | 225 DO(ip6s_nxthist[IPPROTO_IPV4], 12, 35); |
222 DO(ip6s_cantforward, 12, 0); | 226 DO(ip6s_badoptions, 13, 0); |
223 DO(ip6s_nxthist[IPPROTO_TCP], 13, 35); | 227 DO(ip6s_nxthist[IPPROTO_TCP], 13, 35); |
224 DO(ip6s_redirectsent, 13, 0); | 228 DO(ip6s_notmember, 14, 0); |
225 DO(ip6s_nxthist[IPPROTO_UDP], 14, 35); | 229 DO(ip6s_nxthist[IPPROTO_UDP], 14, 35); |
226 DO(ip6s_badoptions, 14, 0); | 230 DO(ip6s_delivered, 15, 0); |
227 DO(ip6s_nxthist[IPPROTO_IPV6], 15, 35); | 231 DO(ip6s_nxthist[IPPROTO_IPV6], 15, 35); |
228 DO(ip6s_notmember, 15, 0); | 232 DO(ip6s_badscope, 16, 0); |
229 DO(ip6s_nxthist[IPPROTO_ROUTING], 16, 35); | 233 DO(ip6s_nxthist[IPPROTO_ROUTING], 16, 35); |
230 DO(ip6s_delivered, 16, 0); | 234 DO(ip6s_sources_none, 17, 0); |
231 DO(ip6s_nxthist[IPPROTO_FRAGMENT], 17, 35); 232 DO(ip6s_nxthist[IPPROTO_ICMPV6], 18, 35); | 235 DO(ip6s_nxthist[IPPROTO_FRAGMENT], 17, 35); 236 DO(ip6s_nxthist[IPPROTO_ICMPV6], 18, 35); |
233 DO(ip6s_badscope, 18, 0); | |
234 DO(ip6s_nxthist[IPPROTO_NONE], 19, 35); | 237 DO(ip6s_nxthist[IPPROTO_NONE], 19, 35); |
235 DO(ip6s_sources_none, 19, 0); | |
236#undef DO 237} 238 239int 240initip6(void) 241{ 242 size_t len; 243 int name[4]; --- 60 unchanged lines hidden --- | 238#undef DO 239} 240 241int 242initip6(void) 243{ 244 size_t len; 245 int name[4]; --- 60 unchanged lines hidden --- |