2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 4. Neither the name of the University nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * @(#)extern.h 8.1 (Berkeley) 6/6/93
33 #include <sys/cdefs.h>
37 extern struct cmdtab *curcmd;
38 extern struct cmdtab cmdtab[];
39 extern struct text *xtext;
41 extern char **dr_name;
42 extern char c, *namp, hostname[];
43 extern double avenrun[3];
44 extern float *dk_mspw;
46 extern long ntext, textp;
47 extern int *dk_select;
50 extern int hz, stathz;
51 extern double hertz; /* sampling frequency for cp_time and dk_time */
57 extern unsigned int delay;
61 extern struct device_selection *dev_select;
62 extern long generation;
63 extern int num_devices;
64 extern int num_selected;
65 extern int num_selections;
66 extern long select_generation;
68 extern struct nlist namelist[];
70 int checkhost(struct inpcb *);
71 int checkport(struct inpcb *);
72 void closeicmp(WINDOW *);
73 void closeicmp6(WINDOW *);
74 void closeifstat(WINDOW *);
75 void closeiostat(WINDOW *);
76 void closeip(WINDOW *);
77 void closeip6(WINDOW *);
78 void closekre(WINDOW *);
79 void closenetstat(WINDOW *);
80 void closepigs(WINDOW *);
81 void closeswap(WINDOW *);
82 void closetcp(WINDOW *);
83 int cmdifstat(const char *, const char *);
84 int cmdiostat(const char *, const char *);
85 int cmdkre(const char *, const char *);
86 int cmdnetstat(const char *, const char *);
87 struct cmdtab *lookup(const char *);
88 void command(const char *);
92 int dkcmd(char *, char *);
93 void error(const char *fmt, ...) __printflike(1, 2);
95 void fetchicmp6(void);
96 void fetchifstat(void);
99 void fetchiostat(void);
101 void fetchnetstat(void);
102 void fetchpigs(void);
103 void fetchswap(void);
105 void getsysctl(const char *, void *, size_t);
106 int ifcmd(const char *cmd, const char *args);
109 int initifstat(void);
112 int initiostat(void);
114 int initnetstat(void);
119 int kvm_ckread(void *, void *, int);
120 void labelicmp(void);
121 void labelicmp6(void);
122 void labelifstat(void);
125 void labeliostat(void);
127 void labelnetstat(void);
128 void labelpigs(void);
130 void labelswap(void);
133 int netcmd(const char *, const char *);
134 void nlisterr(struct nlist []);
135 WINDOW *openicmp(void);
136 WINDOW *openicmp6(void);
137 WINDOW *openifstat(void);
138 WINDOW *openip(void);
139 WINDOW *openip6(void);
140 WINDOW *openiostat(void);
141 WINDOW *openkre(void);
142 WINDOW *opennetstat(void);
143 WINDOW *openpigs(void);
144 WINDOW *openswap(void);
145 WINDOW *opentcp(void);
146 int prefix(const char *, const char *);
147 void reseticmp(void);
148 void reseticmp6(void);
153 void showicmp6(void);
154 void showifstat(void);
157 void showiostat(void);
159 void shownetstat(void);
165 char *sysctl_dynread(const char *, size_t *);
167 #define SYSTAT_CMD(name) \
168 void close ## name(WINDOW *); \
169 void fetch ## name(void); \
170 int init ## name(void); \
171 void label ## name(void); \
172 WINDOW *open ## name(void); \
173 void reset ## name(void); \
174 void show ## name(void)