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 */
52 extern int naptime, col;
60 extern struct device_selection *dev_select;
61 extern long generation;
62 extern int num_devices;
63 extern int num_selected;
64 extern int num_selections;
65 extern long select_generation;
67 extern struct nlist namelist[];
69 int checkhost(struct inpcb *);
70 int checkport(struct inpcb *);
71 void closeicmp(WINDOW *);
72 void closeicmp6(WINDOW *);
73 void closeifstat(WINDOW *);
74 void closeiostat(WINDOW *);
75 void closeip(WINDOW *);
76 void closeip6(WINDOW *);
77 void closekre(WINDOW *);
78 void closembufs(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 fetchmbufs(void);
102 void fetchnetstat(void);
103 void fetchpigs(void);
104 void fetchswap(void);
106 void getsysctl(const char *, void *, size_t);
107 int ifcmd(const char *cmd, const char *args);
110 int initifstat(void);
113 int initiostat(void);
116 int initnetstat(void);
121 int kvm_ckread(void *, void *, int);
122 void labelicmp(void);
123 void labelicmp6(void);
124 void labelifstat(void);
127 void labeliostat(void);
129 void labelmbufs(void);
130 void labelnetstat(void);
131 void labelpigs(void);
133 void labelswap(void);
136 int netcmd(const char *, const char *);
137 void nlisterr(struct nlist []);
138 WINDOW *openicmp(void);
139 WINDOW *openicmp6(void);
140 WINDOW *openifstat(void);
141 WINDOW *openip(void);
142 WINDOW *openip6(void);
143 WINDOW *openiostat(void);
144 WINDOW *openkre(void);
145 WINDOW *openmbufs(void);
146 WINDOW *opennetstat(void);
147 WINDOW *openpigs(void);
148 WINDOW *openswap(void);
149 WINDOW *opentcp(void);
150 int prefix(const char *, const char *);
151 void reseticmp(void);
152 void reseticmp6(void);
157 void showicmp6(void);
158 void showifstat(void);
161 void showiostat(void);
163 void showmbufs(void);
164 void shownetstat(void);
170 char *sysctl_dynread(const char *, size_t *);