1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
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 * $FreeBSD$
33 */
34
35#include <sys/cdefs.h>
36#include <fcntl.h>
37#include <kvm.h>
38
39extern struct	cmdtab *curcmd;
40extern struct	cmdtab cmdtab[];
41extern struct	text *xtext;
42extern WINDOW	*wnd;
43extern char	**dr_name;
44extern char	c, *namp, hostname[];
45extern double	avenrun[3];
46extern float	*dk_mspw;
47extern kvm_t	*kd;
48extern long	ntext, textp;
49extern int	*dk_select;
50extern int	CMDLINE;
51extern int	dk_ndrive;
52extern int	hz, stathz;
53extern double	hertz;		/* sampling frequency for cp_time and dk_time */
54extern int	col;
55extern int	nhosts;
56extern int	nports;
57extern int	protos;
58extern int	verbose;
59extern unsigned int	delay;
60
61struct in_conninfo;
62
63extern struct device_selection *dev_select;
64extern long			generation;
65extern int			num_devices;
66extern int			num_selected;
67extern int			num_selections;
68extern long			select_generation;
69
70extern struct nlist		namelist[];
71
72int	 checkhost(struct in_conninfo *);
73int	 checkport(struct in_conninfo *);
74void	 closeicmp(WINDOW *);
75void	 closeicmp6(WINDOW *);
76void	 closeifstat(WINDOW *);
77void	 closeiostat(WINDOW *);
78void	 closeip(WINDOW *);
79void	 closeip6(WINDOW *);
80void	 closekre(WINDOW *);
81void	 closenetstat(WINDOW *);
82void	 closepigs(WINDOW *);
83void	 closeswap(WINDOW *);
84void	 closetcp(WINDOW *);
85int	 cmdifstat(const char *, const char *);
86int	 cmdiostat(const char *, const char *);
87int	 cmdkre(const char *, const char *);
88int	 cmdnetstat(const char *, const char *);
89struct	 cmdtab *lookup(const char *);
90void	 command(const char *);
91void	 die(int);
92void	 display(void);
93int	 dkinit(void);
94int	 dkcmd(char *, char *);
95void	 error(const char *fmt, ...) __printflike(1, 2);
96void	 fetchicmp(void);
97void	 fetchicmp6(void);
98void	 fetchifstat(void);
99void	 fetchip(void);
100void	 fetchip6(void);
101void	 fetchiostat(void);
102void	 fetchkre(void);
103void	 fetchnetstat(void);
104void	 fetchpigs(void);
105void	 fetchswap(void);
106void	 fetchtcp(void);
107void	 getsysctl(const char *, void *, size_t);
108int	 ifcmd(const char *cmd, const char *args);
109int	 initicmp(void);
110int	 initicmp6(void);
111int	 initifstat(void);
112int	 initip(void);
113int	 initip6(void);
114int	 initiostat(void);
115int	 initkre(void);
116int	 initnetstat(void);
117int	 initpigs(void);
118int	 initswap(void);
119int	 inittcp(void);
120int	 keyboard(void);
121int	 kvm_ckread(void *, void *, int);
122void	 labelicmp(void);
123void	 labelicmp6(void);
124void	 labelifstat(void);
125void	 labelip(void);
126void	 labelip6(void);
127void	 labeliostat(void);
128void	 labelkre(void);
129void	 labelnetstat(void);
130void	 labelpigs(void);
131void	 labels(void);
132void	 labelswap(void);
133void	 labeltcp(void);
134void	 load(void);
135int	 netcmd(const char *, const char *);
136void	 nlisterr(struct nlist []);
137WINDOW	*openicmp(void);
138WINDOW	*openicmp6(void);
139WINDOW	*openifstat(void);
140WINDOW	*openip(void);
141WINDOW	*openip6(void);
142WINDOW	*openiostat(void);
143WINDOW	*openkre(void);
144WINDOW	*opennetstat(void);
145WINDOW	*openpigs(void);
146WINDOW	*openswap(void);
147WINDOW	*opentcp(void);
148int	 prefix(const char *, const char *);
149void	 reseticmp(void);
150void	 reseticmp6(void);
151void	 resetip(void);
152void	 resetip6(void);
153void	 resettcp(void);
154void	 showicmp(void);
155void	 showicmp6(void);
156void	 showifstat(void);
157void	 showip(void);
158void	 showip6(void);
159void	 showiostat(void);
160void	 showkre(void);
161void	 shownetstat(void);
162void	 showpigs(void);
163void	 showswap(void);
164void	 showtcp(void);
165void	 status(void);
166void	 suspend(int);
167char	*sysctl_dynread(const char *, size_t *);
168void	 sysputpage(WINDOW* , int, int, int, uint64_t, int);
169void	 sysputspaces(WINDOW* , int, int, int);
170void	 sysputstrs(WINDOW* , int, int, int);
171void	 sysputuint64(WINDOW* , int, int, int, uint64_t, int);
172void	 sysputwuint64(WINDOW* , int, int, int, uint64_t, int);
173
174#define SYSTAT_CMD(name)	\
175	void	 close ## name(WINDOW *); \
176	void	 fetch ## name(void); \
177	int	 init ## name(void); \
178	void	 label ## name(void); \
179	WINDOW	*open ## name(void); \
180	void	 reset ## name(void); \
181	void	 show ## name(void)
182
183SYSTAT_CMD( zarc );
184SYSTAT_CMD( sctp );
185