extern.h revision 1.37 1 /* $NetBSD: extern.h,v 1.37 2007/02/18 17:00:08 dsl 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. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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
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
29 * SUCH DAMAGE.
30 *
31 * @(#)extern.h 8.1 (Berkeley) 6/6/93
32 */
33
34 #include <sys/cdefs.h>
35 #include <fcntl.h>
36 #include <kvm.h>
37
38 #define ADJINETCTR(c, o, n, e) (c.e = n.e - o.e)
39
40 extern struct command global_commands[];
41 extern struct mode *curmode;
42 extern struct mode modes[];
43 extern struct text *xtext;
44 extern WINDOW *wnd;
45 extern char *namp, hostname[];
46 extern double avenrun[3];
47 extern float *dk_mspw;
48 extern kvm_t *kd;
49 extern long ntext, textp;
50 extern int CMDLINE;
51 extern int hz, stathz, maxslp;
52 extern int naptime;
53 extern int nhosts;
54 extern int nports;
55 extern int protos;
56 extern int verbose;
57 extern int nflag;
58 extern char *memf;
59 extern int allflag;
60 extern int turns;
61 extern gid_t egid;
62
63 struct inpcb;
64 #ifdef INET6
65 struct in6pcb;
66 #endif
67
68 int checkhost(struct inpcb *);
69 int checkport(struct inpcb *);
70 #ifdef INET6
71 int checkhost6(struct in6pcb *);
72 int checkport6(struct in6pcb *);
73 #endif
74 void closebufcache(WINDOW *);
75 void closedf(WINDOW *);
76 void closeicmp(WINDOW *);
77 void closeiostat(WINDOW *);
78 void closeip(WINDOW *);
79 void closevmstat(WINDOW *);
80 void closesyscall(WINDOW *);
81 void closembufs(WINDOW *);
82 void closenetstat(WINDOW *);
83 void closepigs(WINDOW *);
84 void closeswap(WINDOW *);
85 void closetcp(WINDOW *);
86 void command(char *);
87 void df_all(char *);
88 void df_some(char *);
89 void die(int);
90 void disks_add(char *);
91 void disks_remove(char *);
92 void disks_drives(char *);
93 void display(int);
94 void error(const char *, ...)
95 __attribute__((__format__(__printf__, 1, 2)));
96 void fetchbufcache(void);
97 void fetchdf(void);
98 void fetchicmp(void);
99 void fetchiostat(void);
100 void fetchip(void);
101 void fetchvmstat(void);
102 void fetchsyscall(void);
103 void fetchmbufs(void);
104 void fetchnetstat(void);
105 void fetchpigs(void);
106 void fetchswap(void);
107 void fetchtcp(void);
108 int fetch_cptime(u_int64_t *);
109 void global_help(char *);
110 void global_interval(char *);
111 void global_load(char *);
112 void global_quit(char *);
113 void global_stop(char *);
114 void icmp_boot(char *);
115 void icmp_run(char *);
116 void icmp_time(char *);
117 void icmp_zero(char *);
118 int initbufcache(void);
119 int initdf(void);
120 int initicmp(void);
121 int initiostat(void);
122 int initip(void);
123 int initvmstat(void);
124 int initsyscall(void);
125 int initmbufs(void);
126 int initnetstat(void);
127 int initpigs(void);
128 int initswap(void);
129 int inittcp(void);
130 void iostat_bars(char *);
131 void iostat_numbers(char *);
132 void iostat_secs(char *);
133 void iostat_rw(char *);
134 void iostat_all(char *);
135 void ip_boot(char *);
136 void ip_run(char *);
137 void ip_time(char *);
138 void ip_zero(char *);
139 void keyboard(void) __attribute__((__noreturn__));
140 ssize_t kvm_ckread(const void *, void *, size_t, const char *);
141 void labelbufcache(void);
142 void labeldf(void);
143 void labelicmp(void);
144 void labeliostat(void);
145 void labelip(void);
146 void labelvmstat(void);
147 void labelsyscall(void);
148 void labelmbufs(void);
149 void labelnetstat(void);
150 void labelpigs(void);
151 void labelps(void);
152 void labels(void);
153 void labelswap(void);
154 void labeltcp(void);
155 void labeltcpsyn(void);
156 void netstat_all(char *);
157 void netstat_display(char *);
158 void netstat_ignore(char *);
159 void netstat_names(char *);
160 void netstat_numbers(char *);
161 void netstat_reset(char *);
162 void netstat_show(char *);
163 void netstat_tcp(char *);
164 void netstat_udp(char *);
165 void nlisterr(struct nlist []) __attribute__((__noreturn__));
166 WINDOW *openbufcache(void);
167 WINDOW *opendf(void);
168 WINDOW *openicmp(void);
169 WINDOW *openiostat(void);
170 WINDOW *openip(void);
171 WINDOW *openvmstat(void);
172 WINDOW *opensyscall(void);
173 WINDOW *openmbufs(void);
174 WINDOW *opennetstat(void);
175 WINDOW *openpigs(void);
176 WINDOW *openswap(void);
177 WINDOW *opentcp(void);
178 void ps_user(char *);
179 void redraw(int);
180 void showbufcache(void);
181 void showdf(void);
182 void showicmp(void);
183 void showiostat(void);
184 void showip(void);
185 void showvmstat(void);
186 void showsyscall(void);
187 void showmbufs(void);
188 void shownetstat(void);
189 void showpigs(void);
190 void showps(void);
191 void showswap(void);
192 void showtcp(void);
193 void showtcpsyn(void);
194 void status(void);
195 void switch_mode(struct mode *);
196 void tcp_boot(char *);
197 void tcp_run(char *);
198 void tcp_time(char *);
199 void tcp_zero(char *);
200 void vmstat_boot(char *);
201 void vmstat_run(char *);
202 void vmstat_time(char *);
203 void vmstat_zero(char *);
204 void syscall_boot(char *);
205 void syscall_run(char *);
206 void syscall_time(char *);
207 void syscall_zero(char *);
208 void syscall_order(char *);
209 void syscall_show(char *);
210
211 #ifdef INET6
212 void closeip6(WINDOW *);
213 void fetchip6(void);
214 int initip6(void);
215 void labelip6(void);
216 WINDOW *openip6(void);
217 void showip6(void);
218 void ip6_boot(char *);
219 void ip6_run(char *);
220 void ip6_time(char *);
221 void ip6_zero(char *);
222 #endif
223
224 #ifdef IPSEC
225 void closeipsec(WINDOW *);
226 void fetchipsec(void);
227 int initipsec(void);
228 void labelipsec(void);
229 WINDOW *openipsec(void);
230 void showipsec(void);
231 void ipsec_boot(char *);
232 void ipsec_run(char *);
233 void ipsec_time(char *);
234 void ipsec_zero(char *);
235 #endif
236