extern.h revision 1.25 1 /* $NetBSD: extern.h,v 1.25 2000/10/11 14:46:18 is 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
44 extern struct command global_commands[];
45 extern struct mode *curmode;
46 extern struct mode modes[];
47 extern struct text *xtext;
48 extern WINDOW *wnd;
49 extern char **dr_name;
50 extern char c, *namp, hostname[];
51 extern double avenrun[3];
52 extern float *dk_mspw;
53 extern kvm_t *kd;
54 extern long ntext, textp;
55 extern int *dk_select;
56 extern int CMDLINE;
57 extern int dk_ndrive;
58 extern int hz, stathz;
59 extern int naptime, col;
60 extern int nhosts;
61 extern int nports;
62 extern int protos;
63 extern int verbose;
64 extern int nflag;
65 extern char *memf;
66 extern int allflag;
67 extern int turns;
68
69 struct inpcb;
70 #ifdef INET6
71 struct in6pcb;
72 #endif
73
74 int checkhost(struct inpcb *);
75 int checkport(struct inpcb *);
76 #ifdef INET6
77 int checkhost6(struct in6pcb *);
78 int checkport6(struct in6pcb *);
79 #endif
80 void closebufcache(WINDOW *);
81 void closeicmp(WINDOW *);
82 void closeiostat(WINDOW *);
83 void closeip(WINDOW *);
84 void closevmstat(WINDOW *);
85 void closembufs(WINDOW *);
86 void closenetstat(WINDOW *);
87 void closepigs(WINDOW *);
88 void closeswap(WINDOW *);
89 void closetcp(WINDOW *);
90 void command(char *);
91 void die(int);
92 void disks_add(char *);
93 void disks_delete(char *);
94 void disks_drives(char *);
95 void display(int);
96 int dkinit(int, gid_t);
97 void error(const char *, ...)
98 __attribute__((__format__(__printf__, 1, 2)));
99 void fetchbufcache(void);
100 void fetchicmp(void);
101 void fetchiostat(void);
102 void fetchip(void);
103 void fetchvmstat(void);
104 void fetchmbufs(void);
105 void fetchnetstat(void);
106 void fetchpigs(void);
107 void fetchswap(void);
108 void fetchtcp(void);
109 int fetch_cptime(u_int64_t *);
110 void global_help(char *);
111 void global_interval(char *);
112 void global_load(char *);
113 void global_quit(char *);
114 void global_stop(char *);
115 void icmp_boot(char *);
116 void icmp_run(char *);
117 void icmp_time(char *);
118 void icmp_zero(char *);
119 int initbufcache(void);
120 int initicmp(void);
121 int initiostat(void);
122 int initip(void);
123 int initvmstat(void);
124 int initmbufs(void);
125 int initnetstat(void);
126 int initpigs(void);
127 int initswap(void);
128 int inittcp(void);
129 void iostat_bars(char *);
130 void iostat_numbers(char *);
131 void iostat_secs(char *);
132 void ip_boot(char *);
133 void ip_run(char *);
134 void ip_time(char *);
135 void ip_zero(char *);
136 int keyboard(void) __attribute__((__noreturn__));
137 ssize_t kvm_ckread(void *, void *, size_t);
138 void labelbufcache(void);
139 void labelicmp(void);
140 void labeliostat(void);
141 void labelip(void);
142 void labelvmstat(void);
143 void labelmbufs(void);
144 void labelnetstat(void);
145 void labelpigs(void);
146 void labelps(void);
147 void labels(void);
148 void labelswap(void);
149 void labeltcp(void);
150 void labeltcpsyn(void);
151 void netstat_all(char *);
152 void netstat_display(char *);
153 void netstat_ignore(char *);
154 void netstat_names(char *);
155 void netstat_numbers(char *);
156 void netstat_reset(char *);
157 void netstat_show(char *);
158 void netstat_tcp(char *);
159 void netstat_udp(char *);
160 void nlisterr(struct nlist []);
161 WINDOW *openbufcache(void);
162 WINDOW *openicmp(void);
163 WINDOW *openiostat(void);
164 WINDOW *openip(void);
165 WINDOW *openvmstat(void);
166 WINDOW *openmbufs(void);
167 WINDOW *opennetstat(void);
168 WINDOW *openpigs(void);
169 WINDOW *openswap(void);
170 WINDOW *opentcp(void);
171 void ps_user(char *);
172 void redraw(int);
173 void showbufcache(void);
174 void showicmp(void);
175 void showiostat(void);
176 void showip(void);
177 void showvmstat(void);
178 void showmbufs(void);
179 void shownetstat(void);
180 void showpigs(void);
181 void showps(void);
182 void showswap(void);
183 void showtcp(void);
184 void showtcpsyn(void);
185 void status(void);
186 void switch_mode(struct mode *);
187 void tcp_boot(char *);
188 void tcp_run(char *);
189 void tcp_time(char *);
190 void tcp_zero(char *);
191 void vmstat_boot(char *);
192 void vmstat_run(char *);
193 void vmstat_time(char *);
194 void vmstat_zero(char *);
195
196 #ifdef INET6
197 void closeip6(WINDOW *);
198 void fetchip6(void);
199 int initip6(void);
200 void labelip6(void);
201 WINDOW *openip6(void);
202 void showip6(void);
203 void ip6_boot(char *);
204 void ip6_run(char *);
205 void ip6_time(char *);
206 void ip6_zero(char *);
207 #endif
208
209 #ifdef IPSEC
210 void closeipsec(WINDOW *);
211 void fetchipsec(void);
212 int initipsec(void);
213 void labelipsec(void);
214 WINDOW *openipsec(void);
215 void showipsec(void);
216 void ipsec_boot(char *);
217 void ipsec_run(char *);
218 void ipsec_time(char *);
219 void ipsec_zero(char *);
220 #endif
221