2 * SPDX-License-Identifier: BSD-3-Clause
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
35 #include <sys/cdefs.h>
39 extern struct cmdtab *curcmd;
40 extern struct cmdtab cmdtab[];
41 extern struct text *xtext;
43 extern char **dr_name;
44 extern char c, *namp, hostname[];
45 extern double avenrun[3];
46 extern float *dk_mspw;
48 extern long ntext, textp;
49 extern int *dk_select;
52 extern int hz, stathz;
53 extern double hertz; /* sampling frequency for cp_time and dk_time */
59 extern unsigned int delay;
62 extern char *matchline;
68 extern struct device_selection *dev_select;
69 extern long generation;
70 extern int num_devices;
71 extern int num_selected;
72 extern int num_selections;
73 extern long select_generation;
75 extern struct nlist namelist[];
77 int checkhost(struct in_conninfo *);
78 int checkport(struct in_conninfo *);
79 void closeicmp(WINDOW *);
80 void closeicmp6(WINDOW *);
81 void closeifstat(WINDOW *);
82 void closeiostat(WINDOW *);
83 void closeip(WINDOW *);
84 void closeip6(WINDOW *);
85 void closekre(WINDOW *);
86 void closenetstat(WINDOW *);
87 void closepigs(WINDOW *);
88 void closeswap(WINDOW *);
89 void closetcp(WINDOW *);
90 int cmdifstat(const char *, const char *);
91 int cmdiolat(const char *, const char *);
92 int cmdiostat(const char *, const char *);
93 int cmdkre(const char *, const char *);
94 int cmdnetstat(const char *, const char *);
95 struct cmdtab *lookup(const char *);
96 void command(const char *);
100 int dkcmd(char *, char *);
101 void error(const char *fmt, ...) __printflike(1, 2);
102 void fetchicmp(void);
103 void fetchicmp6(void);
104 void fetchifstat(void);
107 void fetchiostat(void);
109 void fetchnetstat(void);
110 void fetchpigs(void);
111 void fetchswap(void);
113 void getsysctl(const char *, void *, size_t);
114 int ifcmd(const char *cmd, const char *args);
117 int initifstat(void);
120 int initiostat(void);
122 int initnetstat(void);
127 int kvm_ckread(void *, void *, int);
128 void labelicmp(void);
129 void labelicmp6(void);
130 void labelifstat(void);
133 void labeliostat(void);
135 void labelnetstat(void);
136 void labelpigs(void);
138 void labelswap(void);
141 int netcmd(const char *, const char *);
142 void nlisterr(struct nlist []);
143 WINDOW *openicmp(void);
144 WINDOW *openicmp6(void);
145 WINDOW *openifstat(void);
146 WINDOW *openip(void);
147 WINDOW *openip6(void);
148 WINDOW *openiostat(void);
149 WINDOW *openkre(void);
150 WINDOW *opennetstat(void);
151 WINDOW *openpigs(void);
152 WINDOW *openswap(void);
153 WINDOW *opentcp(void);
154 int prefix(const char *, const char *);
155 void reseticmp(void);
156 void reseticmp6(void);
161 void showicmp6(void);
162 void showifstat(void);
165 void showiostat(void);
167 void shownetstat(void);
173 char *sysctl_dynread(const char *, size_t *);
174 void sysputpage(WINDOW* , int, int, int, uint64_t, int);
175 void sysputspaces(WINDOW* , int, int, int);
176 void sysputstrs(WINDOW* , int, int, int);
177 void sysputXs(WINDOW* , int, int, int);
178 void sysputuint64(WINDOW* , int, int, int, uint64_t, int);
179 void sysputwuint64(WINDOW* , int, int, int, uint64_t, int);
181 #define SYSTAT_CMD(name) \
182 void close ## name(WINDOW *); \
183 void fetch ## name(void); \
184 int init ## name(void); \
185 void label ## name(void); \
186 WINDOW *open ## name(void); \
187 void reset ## name(void); \
188 void show ## name(void)