netstat.h revision 149862
1290001Sglebius/*
2290001Sglebius * Copyright (c) 1992, 1993
3290001Sglebius *	Regents of the University of California.  All rights reserved.
4290001Sglebius *
5290001Sglebius * Redistribution and use in source and binary forms, with or without
6290001Sglebius * modification, are permitted provided that the following conditions
7290001Sglebius * are met:
8290001Sglebius * 1. Redistributions of source code must retain the above copyright
9290001Sglebius *    notice, this list of conditions and the following disclaimer.
10290001Sglebius * 2. Redistributions in binary form must reproduce the above copyright
11290001Sglebius *    notice, this list of conditions and the following disclaimer in the
12290001Sglebius *    documentation and/or other materials provided with the distribution.
13290001Sglebius * 3. All advertising materials mentioning features or use of this software
14290001Sglebius *    must display the following acknowledgement:
15290001Sglebius *	This product includes software developed by the University of
16290001Sglebius *	California, Berkeley and its contributors.
17290001Sglebius * 4. Neither the name of the University nor the names of its contributors
18290001Sglebius *    may be used to endorse or promote products derived from this software
19290001Sglebius *    without specific prior written permission.
20290001Sglebius *
21290001Sglebius * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22290001Sglebius * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23290001Sglebius * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24290001Sglebius * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25290001Sglebius * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26290001Sglebius * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27290001Sglebius * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28290001Sglebius * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29290001Sglebius * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30290001Sglebius * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31290001Sglebius * SUCH DAMAGE.
32290001Sglebius *
33290001Sglebius *	@(#)netstat.h	8.2 (Berkeley) 1/4/94
34290001Sglebius * $FreeBSD: head/usr.bin/netstat/netstat.h 149862 2005-09-07 17:35:16Z csjp $
35290001Sglebius */
36290001Sglebius
37290001Sglebius#include <sys/cdefs.h>
38290001Sglebius
39290001Sglebiusextern int	Aflag;	/* show addresses of protocol control block */
40290001Sglebiusextern int	aflag;	/* show all sockets (including servers) */
41290001Sglebiusextern int	bflag;	/* show i/f total bytes in/out */
42290001Sglebiusextern int	dflag;	/* show i/f dropped packets */
43290001Sglebiusextern int	gflag;	/* show group (multicast) routing or stats */
44290001Sglebiusextern int	hflag;	/* show counters in human readable format */
45290001Sglebiusextern int	iflag;	/* show interfaces */
46290001Sglebiusextern int	Lflag;	/* show size of listen queues */
47290001Sglebiusextern int	mflag;	/* show memory stats */
48290001Sglebiusextern int	numeric_addr;	/* show addresses numerically */
49290001Sglebiusextern int	numeric_port;	/* show ports numerically */
50290001Sglebiusextern int	rflag;	/* show routing tables (or routing stats) */
51290001Sglebiusextern int	sflag;	/* show protocol statistics */
52290001Sglebiusextern int	tflag;	/* show i/f watchdog timers */
53290001Sglebiusextern int	Wflag;	/* wide display */
54290001Sglebiusextern int	zflag;	/* zero stats */
55290001Sglebius
56290001Sglebiusextern int	interval; /* repeat interval for i/f stats */
57290001Sglebius
58290001Sglebiusextern char	*interface; /* desired i/f for stats, or NULL for all i/fs */
59290001Sglebiusextern int	unit;	/* unit number for above */
60290001Sglebius
61290001Sglebiusextern int	af;	/* address family */
62290001Sglebius
63290001Sglebiusint	kread(u_long addr, char *buf, int size);
64290001Sglebiusconst char *plural(int);
65290001Sglebiusconst char *plurales(int);
66290001Sglebiusconst char *pluralies(int);
67290001Sglebius
68290001Sglebiusvoid	protopr(u_long, const char *, int);
69290001Sglebiusvoid	tcp_stats(u_long, const char *, int);
70290001Sglebiusvoid	udp_stats(u_long, const char *, int);
71290001Sglebiusvoid	ip_stats(u_long, const char *, int);
72290001Sglebiusvoid	icmp_stats(u_long, const char *, int);
73290001Sglebiusvoid	igmp_stats(u_long, const char *, int);
74290001Sglebiusvoid	pim_stats(u_long, const char *, int);
75290001Sglebiusvoid	carp_stats (u_long, const char *, int);
76290001Sglebiusvoid	pfsync_stats (u_long, const char *, int);
77290001Sglebius#ifdef IPSEC
78290001Sglebiusvoid	ipsec_stats(u_long, const char *, int);
79290001Sglebius#endif
80290001Sglebius
81290001Sglebius#ifdef INET6
82290001Sglebiusvoid	ip6_stats(u_long, const char *, int);
83290001Sglebiusvoid	ip6_ifstats(char *);
84290001Sglebiusvoid	icmp6_stats(u_long, const char *, int);
85290001Sglebiusvoid	icmp6_ifstats(char *);
86290001Sglebiusvoid	pim6_stats(u_long, const char *, int);
87290001Sglebiusvoid	rip6_stats(u_long, const char *, int);
88290001Sglebiusvoid	mroute6pr(u_long, u_long);
89290001Sglebiusvoid	mrt6_stats(u_long);
90290001Sglebius
91290001Sglebiusstruct sockaddr_in6;
92290001Sglebiusstruct in6_addr;
93290001Sglebiuschar *routename6(struct sockaddr_in6 *);
94290001Sglebiusconst char *netname6(struct sockaddr_in6 *, struct in6_addr *);
95290001Sglebiusvoid	inet6print(struct in6_addr *, int, const char *, int);
96290001Sglebius#endif /*INET6*/
97290001Sglebius
98290001Sglebius#ifdef IPSEC
99290001Sglebiusvoid	pfkey_stats(u_long, const char *, int);
100290001Sglebius#endif
101290001Sglebius
102290001Sglebiusvoid	bdg_stats(u_long, const char *, int);
103290001Sglebius
104290001Sglebiusvoid	mbpr(u_long, u_long, u_long, u_long, u_long, u_long,
105290001Sglebius	      u_long, u_long, u_long, u_long, u_long);
106290001Sglebius
107290001Sglebiusvoid	hostpr(u_long, u_long);
108290001Sglebiusvoid	impstats(u_long, u_long);
109290001Sglebius
110290001Sglebiusvoid	intpr(int, u_long, void (*)(char *));
111290001Sglebius
112290001Sglebiusvoid	pr_rthdr(int);
113290001Sglebiusvoid	pr_family(int);
114290001Sglebiusvoid	rt_stats(u_long, u_long);
115290001Sglebiuschar	*ipx_pnet(struct sockaddr *);
116290001Sglebiuschar	*ipx_phost(struct sockaddr *);
117290001Sglebiuschar	*ns_phost(struct sockaddr *);
118290001Sglebiusvoid	upHex(char *);
119290001Sglebius
120290001Sglebiuschar	*routename(u_long);
121290001Sglebiuschar	*netname(u_long, u_long);
122290001Sglebiuschar	*atalk_print(struct sockaddr *, int);
123290001Sglebiuschar	*atalk_print2(struct sockaddr *, struct sockaddr *, int);
124290001Sglebiuschar	*ipx_print(struct sockaddr *);
125290001Sglebiuschar	*ns_print(struct sockaddr *);
126290001Sglebiusvoid	routepr(u_long);
127290001Sglebius
128290001Sglebiusvoid	ipxprotopr(u_long, const char *, int);
129290001Sglebiusvoid	spx_stats(u_long, const char *, int);
130290001Sglebiusvoid	ipx_stats(u_long, const char *, int);
131290001Sglebiusvoid	ipxerr_stats(u_long, const char *, int);
132290001Sglebius
133290001Sglebiusvoid	nsprotopr(u_long, const char *, int);
134290001Sglebiusvoid	spp_stats(u_long, const char *, int);
135290001Sglebiusvoid	idp_stats(u_long, const char *, int);
136290001Sglebiusvoid	nserr_stats(u_long, const char *, int);
137290001Sglebius
138290001Sglebiusvoid	atalkprotopr(u_long, const char *, int);
139290001Sglebiusvoid	ddp_stats(u_long, const char *, int);
140290001Sglebius
141290001Sglebiusvoid	netgraphprotopr(u_long, const char *, int);
142290001Sglebius
143290001Sglebiusvoid	unixpr(void);
144290001Sglebius
145290001Sglebiusvoid	esis_stats(u_long, const char *, int);
146290001Sglebiusvoid	clnp_stats(u_long, const char *, int);
147290001Sglebiusvoid	cltp_stats(u_long, const char *, int);
148290001Sglebiusvoid	iso_protopr(u_long, const char *, int);
149290001Sglebiusvoid	iso_protopr1(u_long, int);
150290001Sglebiusvoid	tp_protopr(u_long, const char *, int);
151290001Sglebiusvoid	tp_inproto(u_long);
152290001Sglebiusvoid	tp_stats(caddr_t, caddr_t);
153290001Sglebius
154290001Sglebiusvoid	ifmalist_dump(void);
155290001Sglebiusvoid	mroutepr(u_long, u_long);
156290001Sglebiusvoid	mrt_stats(u_long);
157290001Sglebiusvoid	bpf_stats(char *);
158290001Sglebius