| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: netstat.h,v 1.51 2014/11/06 21:30:09 christos Exp $ */ | | 1 | /* $NetBSD: netstat.h,v 1.52 2020/04/23 00:24:50 joerg Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1992, 1993 | | 4 | * Copyright (c) 1992, 1993 |
5 | * Regents of the University of California. All rights reserved. | | 5 | * Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -24,57 +24,57 @@ | | | @@ -24,57 +24,57 @@ |
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
29 | * SUCH DAMAGE. | | 29 | * SUCH DAMAGE. |
30 | * | | 30 | * |
31 | * from: @(#)netstat.h 8.2 (Berkeley) 1/4/94 | | 31 | * from: @(#)netstat.h 8.2 (Berkeley) 1/4/94 |
32 | */ | | 32 | */ |
33 | | | 33 | |
34 | #include <sys/cdefs.h> | | 34 | #include <sys/cdefs.h> |
35 | #include <kvm.h> | | 35 | #include <kvm.h> |
36 | | | 36 | |
37 | int Aflag; /* show addresses of protocol control block */ | | 37 | extern int Aflag; /* show addresses of protocol control block */ |
38 | int aflag; /* show all sockets (including servers) */ | | 38 | extern int aflag; /* show all sockets (including servers) */ |
39 | int Bflag; /* show Berkeley Packet Filter information */ | | 39 | extern int Bflag; /* show Berkeley Packet Filter information */ |
40 | int bflag; /* show i/f byte stats */ | | 40 | extern int bflag; /* show i/f byte stats */ |
41 | int dflag; /* show i/f dropped packets */ | | 41 | extern int dflag; /* show i/f dropped packets */ |
42 | #ifndef SMALL | | 42 | #ifndef SMALL |
43 | int gflag; /* show group (multicast) routing or stats */ | | 43 | extern int gflag; /* show group (multicast) routing or stats */ |
44 | #endif | | 44 | #endif |
45 | int hflag; /* humanize byte counts */ | | 45 | extern int hflag; /* humanize byte counts */ |
46 | int iflag; /* show interfaces */ | | 46 | extern int iflag; /* show interfaces */ |
47 | int Lflag; /* don't show LLINFO entries */ | | 47 | extern int Lflag; /* don't show LLINFO entries */ |
48 | int lflag; /* show routing table with use and ref */ | | 48 | extern int lflag; /* show routing table with use and ref */ |
49 | int mflag; /* show memory stats */ | | 49 | extern int mflag; /* show memory stats */ |
50 | int numeric_addr; /* show addresses numerically */ | | 50 | extern int numeric_addr; /* show addresses numerically */ |
51 | int numeric_port; /* show ports numerically */ | | 51 | extern int numeric_port; /* show ports numerically */ |
52 | int nflag; /* same as above, for show.c compat */ | | 52 | extern int nflag; /* same as above, for show.c compat */ |
53 | int Pflag; /* dump a PCB */ | | 53 | extern int Pflag; /* dump a PCB */ |
54 | int pflag; /* show given protocol */ | | 54 | extern int pflag; /* show given protocol */ |
55 | int qflag; /* show softintrq */ | | 55 | extern int qflag; /* show softintrq */ |
56 | int rflag; /* show routing tables (or routing stats) */ | | 56 | extern int rflag; /* show routing tables (or routing stats) */ |
57 | int sflag; /* show protocol statistics */ | | 57 | extern int sflag; /* show protocol statistics */ |
58 | int tagflag; /* show route tags */ | | 58 | extern int tagflag; /* show route tags */ |
59 | int tflag; /* show i/f watchdog timers */ | | 59 | extern int tflag; /* show i/f watchdog timers */ |
60 | int Vflag; /* show Vestigial TIME_WAIT (VTW) information */ | | 60 | extern int Vflag; /* show Vestigial TIME_WAIT (VTW) information */ |
61 | int vflag; /* verbose route information or don't truncate names */ | | 61 | extern int vflag; /* verbose route information or don't truncate names */ |
62 | | | 62 | |
63 | char *interface; /* desired i/f for stats, or NULL for all i/fs */ | | 63 | extern char *interface; /* desired i/f for stats, or NULL for all i/fs */ |
64 | | | 64 | |
65 | int af; /* address family */ | | 65 | extern int af; /* address family */ |
66 | int use_sysctl; /* use sysctl instead of kmem */ | | 66 | extern int use_sysctl; /* use sysctl instead of kmem */ |
67 | int force_sysctl; /* force use of sysctl (or exit) - for testing */ | | 67 | extern int force_sysctl; /* force use of sysctl (or exit) - for testing */ |
68 | | | 68 | |
69 | | | 69 | |
70 | int kread(u_long addr, char *buf, int size); | | 70 | int kread(u_long addr, char *buf, int size); |
71 | const char *plural(int); | | 71 | const char *plural(int); |
72 | const char *plurales(int); | | 72 | const char *plurales(int); |
73 | int get_hardticks(void); | | 73 | int get_hardticks(void); |
74 | | | 74 | |
75 | void protopr(u_long, const char *); | | 75 | void protopr(u_long, const char *); |
76 | void tcp_stats(u_long, const char *); | | 76 | void tcp_stats(u_long, const char *); |
77 | void tcp_dump(u_long, const char *, u_long); | | 77 | void tcp_dump(u_long, const char *, u_long); |
78 | void udp_stats(u_long, const char *); | | 78 | void udp_stats(u_long, const char *); |
79 | void ip_stats(u_long, const char *); | | 79 | void ip_stats(u_long, const char *); |
80 | void icmp_stats(u_long, const char *); | | 80 | void icmp_stats(u_long, const char *); |