1 /* $NetBSD: extern.h,v 1.39 2008/04/07 05:18:25 thorpej Exp $ */
4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
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.
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
31 * @(#)extern.h 8.1 (Berkeley) 6/6/93
34 #include <sys/cdefs.h>
38 #define ADJINETCTR(c, o, n, e) (c.e = n.e - o.e)
39 #define xADJINETCTR(c, o, n, e) (c[e] = n[e] - o[e])
41 extern struct command global_commands
[];
42 extern struct mode
*curmode
;
43 extern struct mode modes
[];
44 extern struct text
*xtext
;
46 extern char *namp
, hostname
[];
47 extern double avenrun
[3];
48 extern float *dk_mspw
;
50 extern long ntext
, textp
;
52 extern int hz
, stathz
, maxslp
;
63 extern int use_sysctl
;
70 int checkhost(struct inpcb
*);
71 int checkport(struct inpcb
*);
73 int checkhost6(struct in6pcb
*);
74 int checkport6(struct in6pcb
*);
76 void closebufcache(WINDOW
*);
77 void closedf(WINDOW
*);
78 void closeicmp(WINDOW
*);
79 void closeiostat(WINDOW
*);
80 void closeip(WINDOW
*);
81 void closevmstat(WINDOW
*);
82 void closesyscall(WINDOW
*);
83 void closembufs(WINDOW
*);
84 void closenetstat(WINDOW
*);
85 void closepigs(WINDOW
*);
86 void closeswap(WINDOW
*);
87 void closetcp(WINDOW
*);
92 void disks_add(char *);
93 void disks_remove(char *);
94 void disks_drives(char *);
96 void error(const char *, ...)
97 __attribute__((__format__(__printf__
, 1, 2)));
98 void fetchbufcache(void);
100 void fetchicmp(void);
101 void fetchiostat(void);
103 void fetchvmstat(void);
104 void fetchsyscall(void);
105 void fetchmbufs(void);
106 void fetchnetstat(void);
107 void fetchpigs(void);
108 void fetchswap(void);
110 int fetch_cptime(u_int64_t
*);
111 void global_help(char *);
112 void global_interval(char *);
113 void global_load(char *);
114 void global_quit(char *);
115 void global_stop(char *);
116 void icmp_boot(char *);
117 void icmp_run(char *);
118 void icmp_time(char *);
119 void icmp_zero(char *);
120 int initbufcache(void);
123 int initiostat(void);
125 int initvmstat(void);
126 int initsyscall(void);
128 int initnetstat(void);
132 void iostat_bars(char *);
133 void iostat_numbers(char *);
134 void iostat_secs(char *);
135 void iostat_rw(char *);
136 void iostat_all(char *);
137 void ip_boot(char *);
139 void ip_time(char *);
140 void ip_zero(char *);
141 void keyboard(void) __attribute__((__noreturn__
));
142 ssize_t
kvm_ckread(const void *, void *, size_t, const char *);
143 void labelbufcache(void);
145 void labelicmp(void);
146 void labeliostat(void);
148 void labelvmstat(void);
149 void labelsyscall(void);
150 void labelmbufs(void);
151 void labelnetstat(void);
152 void labelpigs(void);
155 void labelswap(void);
157 void labeltcpsyn(void);
158 void netstat_all(char *);
159 void netstat_display(char *);
160 void netstat_ignore(char *);
161 void netstat_names(char *);
162 void netstat_numbers(char *);
163 void netstat_reset(char *);
164 void netstat_show(char *);
165 void netstat_tcp(char *);
166 void netstat_udp(char *);
167 void nlisterr(struct nlist
[]) __attribute__((__noreturn__
));
168 WINDOW
*openbufcache(void);
169 WINDOW
*opendf(void);
170 WINDOW
*openicmp(void);
171 WINDOW
*openiostat(void);
172 WINDOW
*openip(void);
173 WINDOW
*openvmstat(void);
174 WINDOW
*opensyscall(void);
175 WINDOW
*openmbufs(void);
176 WINDOW
*opennetstat(void);
177 WINDOW
*openpigs(void);
178 WINDOW
*openswap(void);
179 WINDOW
*opentcp(void);
180 void ps_user(char *);
182 void showbufcache(void);
185 void showiostat(void);
187 void showvmstat(void);
188 void showsyscall(void);
189 void showmbufs(void);
190 void shownetstat(void);
195 void showtcpsyn(void);
197 void switch_mode(struct mode
*);
198 void tcp_boot(char *);
199 void tcp_run(char *);
200 void tcp_time(char *);
201 void tcp_zero(char *);
202 void vmstat_boot(char *);
203 void vmstat_run(char *);
204 void vmstat_time(char *);
205 void vmstat_zero(char *);
206 void syscall_boot(char *);
207 void syscall_run(char *);
208 void syscall_time(char *);
209 void syscall_zero(char *);
210 void syscall_order(char *);
211 void syscall_show(char *);
214 void closeip6(WINDOW
*);
218 WINDOW
*openip6(void);
220 void ip6_boot(char *);
221 void ip6_run(char *);
222 void ip6_time(char *);
223 void ip6_zero(char *);
227 void closeipsec(WINDOW
*);
228 void fetchipsec(void);
230 void labelipsec(void);
231 WINDOW
*openipsec(void);
232 void showipsec(void);
233 void ipsec_boot(char *);
234 void ipsec_run(char *);
235 void ipsec_time(char *);
236 void ipsec_zero(char *);