extern.h revision 1.35 1 /* $NetBSD: extern.h,v 1.35 2005/02/16 03:45:41 hubertf 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 c, *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, col;
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 closembufs(WINDOW *);
81 void closenetstat(WINDOW *);
82 void closepigs(WINDOW *);
83 void closeswap(WINDOW *);
84 void closetcp(WINDOW *);
85 void command(char *);
86 void df_all(char *);
87 void df_some(char *);
88 void die(int);
89 void disks_add(char *);
90 void disks_remove(char *);
91 void disks_drives(char *);
92 void display(int);
93 void error(const char *, ...)
94 __attribute__((__format__(__printf__, 1, 2)));
95 void fetchbufcache(void);
96 void fetchdf(void);
97 void fetchicmp(void);
98 void fetchiostat(void);
99 void fetchip(void);
100 void fetchvmstat(void);
101 void fetchmbufs(void);
102 void fetchnetstat(void);
103 void fetchpigs(void);
104 void fetchswap(void);
105 void fetchtcp(void);
106 int fetch_cptime(u_int64_t *);
107 void global_help(char *);
108 void global_interval(char *);
109 void global_load(char *);
110 void global_quit(char *);
111 void global_stop(char *);
112 void icmp_boot(char *);
113 void icmp_run(char *);
114 void icmp_time(char *);
115 void icmp_zero(char *);
116 int initbufcache(void);
117 int initdf(void);
118 int initicmp(void);
119 int initiostat(void);
120 int initip(void);
121 int initvmstat(void);
122 int initmbufs(void);
123 int initnetstat(void);
124 int initpigs(void);
125 int initswap(void);
126 int inittcp(void);
127 void iostat_bars(char *);
128 void iostat_numbers(char *);
129 void iostat_secs(char *);
130 void iostat_rw(char *);
131 void iostat_all(char *);
132 void ip_boot(char *);
133 void ip_run(char *);
134 void ip_time(char *);
135 void ip_zero(char *);
136 void keyboard(void) __attribute__((__noreturn__));
137 ssize_t kvm_ckread(const void *, void *, size_t, const char *);
138 void labelbufcache(void);
139 void labeldf(void);
140 void labelicmp(void);
141 void labeliostat(void);
142 void labelip(void);
143 void labelvmstat(void);
144 void labelmbufs(void);
145 void labelnetstat(void);
146 void labelpigs(void);
147 void labelps(void);
148 void labels(void);
149 void labelswap(void);
150 void labeltcp(void);
151 void labeltcpsyn(void);
152 void netstat_all(char *);
153 void netstat_display(char *);
154 void netstat_ignore(char *);
155 void netstat_names(char *);
156 void netstat_numbers(char *);
157 void netstat_reset(char *);
158 void netstat_show(char *);
159 void netstat_tcp(char *);
160 void netstat_udp(char *);
161 void nlisterr(struct nlist []) __attribute__((__noreturn__));
162 WINDOW *openbufcache(void);
163 WINDOW *opendf(void);
164 WINDOW *openicmp(void);
165 WINDOW *openiostat(void);
166 WINDOW *openip(void);
167 WINDOW *openvmstat(void);
168 WINDOW *openmbufs(void);
169 WINDOW *opennetstat(void);
170 WINDOW *openpigs(void);
171 WINDOW *openswap(void);
172 WINDOW *opentcp(void);
173 void ps_user(char *);
174 void redraw(int);
175 void showbufcache(void);
176 void showdf(void);
177 void showicmp(void);
178 void showiostat(void);
179 void showip(void);
180 void showvmstat(void);
181 void showmbufs(void);
182 void shownetstat(void);
183 void showpigs(void);
184 void showps(void);
185 void showswap(void);
186 void showtcp(void);
187 void showtcpsyn(void);
188 void status(void);
189 void switch_mode(struct mode *);
190 void tcp_boot(char *);
191 void tcp_run(char *);
192 void tcp_time(char *);
193 void tcp_zero(char *);
194 void vmstat_boot(char *);
195 void vmstat_run(char *);
196 void vmstat_time(char *);
197 void vmstat_zero(char *);
198
199 #ifdef INET6
200 void closeip6(WINDOW *);
201 void fetchip6(void);
202 int initip6(void);
203 void labelip6(void);
204 WINDOW *openip6(void);
205 void showip6(void);
206 void ip6_boot(char *);
207 void ip6_run(char *);
208 void ip6_time(char *);
209 void ip6_zero(char *);
210 #endif
211
212 #ifdef IPSEC
213 void closeipsec(WINDOW *);
214 void fetchipsec(void);
215 int initipsec(void);
216 void labelipsec(void);
217 WINDOW *openipsec(void);
218 void showipsec(void);
219 void ipsec_boot(char *);
220 void ipsec_run(char *);
221 void ipsec_time(char *);
222 void ipsec_zero(char *);
223 #endif
224