extern.h revision 1.26
1/*	$NetBSD: extern.h,v 1.26 2000/12/01 02:19:43 simonb Exp $	*/
2
3/*-
4 * Copyright (c) 1991, 1993
5 *	The Regents of the University of California.  All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 *    must display the following acknowledgement:
17 *	This product includes software developed by the University of
18 *	California, Berkeley and its contributors.
19 * 4. Neither the name of the University nor the names of its contributors
20 *    may be used to endorse or promote products derived from this software
21 *    without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 *      @(#)extern.h	8.1 (Berkeley) 6/6/93
36 */
37
38#include <sys/cdefs.h>
39#include <fcntl.h>
40#include <kvm.h>
41
42#define ADJINETCTR(c, o, n, e)	(c.e = n.e - o.e)
43
44extern struct	command global_commands[];
45extern struct	mode *curmode;
46extern struct	mode modes[];
47extern struct	text *xtext;
48extern WINDOW	*wnd;
49extern char	c, *namp, hostname[];
50extern double	avenrun[3];
51extern float	*dk_mspw;
52extern kvm_t	*kd;
53extern long	ntext, textp;
54extern int	CMDLINE;
55extern int	hz, stathz;
56extern int	naptime, col;
57extern int	nhosts;
58extern int	nports;
59extern int	protos;
60extern int	verbose;
61extern int	nflag;
62extern char	*memf;
63extern int	allflag;
64extern int	turns;
65extern gid_t	egid;
66
67struct inpcb;
68#ifdef INET6
69struct in6pcb;
70#endif
71
72int	 checkhost(struct inpcb *);
73int	 checkport(struct inpcb *);
74#ifdef INET6
75int	 checkhost6(struct in6pcb *);
76int	 checkport6(struct in6pcb *);
77#endif
78void	 closebufcache(WINDOW *);
79void	 closeicmp(WINDOW *);
80void	 closeiostat(WINDOW *);
81void	 closeip(WINDOW *);
82void	 closevmstat(WINDOW *);
83void	 closembufs(WINDOW *);
84void	 closenetstat(WINDOW *);
85void	 closepigs(WINDOW *);
86void	 closeswap(WINDOW *);
87void	 closetcp(WINDOW *);
88void	 command(char *);
89void	 die(int);
90void	 disks_add(char *);
91void	 disks_delete(char *);
92void	 disks_drives(char *);
93void	 display(int);
94void	 error(const char *, ...)
95     __attribute__((__format__(__printf__, 1, 2)));
96void	 fetchbufcache(void);
97void	 fetchicmp(void);
98void	 fetchiostat(void);
99void	 fetchip(void);
100void	 fetchvmstat(void);
101void	 fetchmbufs(void);
102void	 fetchnetstat(void);
103void	 fetchpigs(void);
104void	 fetchswap(void);
105void	 fetchtcp(void);
106int	 fetch_cptime(u_int64_t *);
107void	 global_help(char *);
108void	 global_interval(char *);
109void	 global_load(char *);
110void	 global_quit(char *);
111void	 global_stop(char *);
112void	 icmp_boot(char *);
113void	 icmp_run(char *);
114void	 icmp_time(char *);
115void	 icmp_zero(char *);
116int	 initbufcache(void);
117int	 initicmp(void);
118int	 initiostat(void);
119int	 initip(void);
120int	 initvmstat(void);
121int	 initmbufs(void);
122int	 initnetstat(void);
123int	 initpigs(void);
124int	 initswap(void);
125int	 inittcp(void);
126void	 iostat_bars(char *);
127void	 iostat_numbers(char *);
128void	 iostat_secs(char *);
129void	 ip_boot(char *);
130void	 ip_run(char *);
131void	 ip_time(char *);
132void	 ip_zero(char *);
133int	 keyboard(void) __attribute__((__noreturn__));
134ssize_t	 kvm_ckread(void *, void *, size_t);
135void	 labelbufcache(void);
136void	 labelicmp(void);
137void	 labeliostat(void);
138void	 labelip(void);
139void	 labelvmstat(void);
140void	 labelmbufs(void);
141void	 labelnetstat(void);
142void	 labelpigs(void);
143void	 labelps(void);
144void	 labels(void);
145void	 labelswap(void);
146void	 labeltcp(void);
147void	 labeltcpsyn(void);
148void	 netstat_all(char *);
149void	 netstat_display(char *);
150void	 netstat_ignore(char *);
151void	 netstat_names(char *);
152void	 netstat_numbers(char *);
153void	 netstat_reset(char *);
154void	 netstat_show(char *);
155void	 netstat_tcp(char *);
156void	 netstat_udp(char *);
157void	 nlisterr(struct nlist []);
158WINDOW	*openbufcache(void);
159WINDOW	*openicmp(void);
160WINDOW	*openiostat(void);
161WINDOW	*openip(void);
162WINDOW	*openvmstat(void);
163WINDOW	*openmbufs(void);
164WINDOW	*opennetstat(void);
165WINDOW	*openpigs(void);
166WINDOW	*openswap(void);
167WINDOW	*opentcp(void);
168void	 ps_user(char *);
169void	 redraw(int);
170void	 showbufcache(void);
171void	 showicmp(void);
172void	 showiostat(void);
173void	 showip(void);
174void	 showvmstat(void);
175void	 showmbufs(void);
176void	 shownetstat(void);
177void	 showpigs(void);
178void	 showps(void);
179void	 showswap(void);
180void	 showtcp(void);
181void	 showtcpsyn(void);
182void	 status(void);
183void	 switch_mode(struct mode *);
184void	 tcp_boot(char *);
185void	 tcp_run(char *);
186void	 tcp_time(char *);
187void	 tcp_zero(char *);
188void	 vmstat_boot(char *);
189void	 vmstat_run(char *);
190void	 vmstat_time(char *);
191void	 vmstat_zero(char *);
192
193#ifdef INET6
194void	 closeip6(WINDOW *);
195void	 fetchip6(void);
196int	 initip6(void);
197void	 labelip6(void);
198WINDOW	*openip6(void);
199void	 showip6(void);
200void	 ip6_boot(char *);
201void	 ip6_run(char *);
202void	 ip6_time(char *);
203void	 ip6_zero(char *);
204#endif
205
206#ifdef IPSEC
207void	 closeipsec(WINDOW *);
208void	 fetchipsec(void);
209int	 initipsec(void);
210void	 labelipsec(void);
211WINDOW	*openipsec(void);
212void	 showipsec(void);
213void	 ipsec_boot(char *);
214void	 ipsec_run(char *);
215void	 ipsec_time(char *);
216void	 ipsec_zero(char *);
217#endif
218