extern.h revision 118318
1/*-
2 * Copyright (c) 1991, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
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 * 3. All advertising materials mentioning features or use of this software
14 *    must display the following acknowledgement:
15 *	This product includes software developed by the University of
16 *	California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 *    may be used to endorse or promote products derived from this software
19 *    without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 *      @(#)extern.h	8.1 (Berkeley) 6/6/93
34 * $FreeBSD: head/usr.bin/systat/extern.h 118318 2003-08-01 20:28:20Z dwmalone $
35 */
36
37#include <sys/cdefs.h>
38#include <fcntl.h>
39#include <kvm.h>
40
41extern struct	cmdtab *curcmd;
42extern struct	cmdtab cmdtab[];
43extern struct	text *xtext;
44extern WINDOW	*wnd;
45extern char	**dr_name;
46extern char	c, *namp, hostname[];
47extern double	avenrun[3];
48extern float	*dk_mspw;
49extern kvm_t	*kd;
50extern long	ntext, textp;
51extern int	*dk_select;
52extern int	CMDLINE;
53extern int	dk_ndrive;
54extern int	hz, stathz;
55extern double	hertz;		/* sampling frequency for cp_time and dk_time */
56extern int	naptime, col;
57extern int	nhosts;
58extern int	nports;
59extern int	protos;
60extern int	verbose;
61
62struct inpcb;
63
64extern struct device_selection *dev_select;
65extern long			generation;
66extern int			num_devices;
67extern int			num_selected;
68extern int			num_selections;
69extern long			select_generation;
70
71extern struct nlist		namelist[];
72
73int	 checkhost(struct inpcb *);
74int	 checkport(struct inpcb *);
75void	 closeicmp(WINDOW *);
76void	 closeicmp6(WINDOW *);
77void	 closeifstat(WINDOW *);
78void	 closeiostat(WINDOW *);
79void	 closeip(WINDOW *);
80void	 closeip6(WINDOW *);
81void	 closekre(WINDOW *);
82void	 closembufs(WINDOW *);
83void	 closenetstat(WINDOW *);
84void	 closepigs(WINDOW *);
85void	 closeswap(WINDOW *);
86void	 closetcp(WINDOW *);
87int	 cmdifstat(const char *, const char *);
88int	 cmdiostat(const char *, const char *);
89int	 cmdkre(const char *, const char *);
90int	 cmdnetstat(const char *, const char *);
91struct	 cmdtab *lookup(const char *);
92void	 command(const char *);
93void	 die(int);
94void	 display(int);
95int	 dkinit(void);
96int	 dkcmd(char *, char *);
97void	 error(const char *fmt, ...) __printflike(1, 2);
98void	 fetchicmp(void);
99void	 fetchicmp6(void);
100void	 fetchifstat(void);
101void	 fetchip(void);
102void	 fetchip6(void);
103void	 fetchiostat(void);
104void	 fetchkre(void);
105void	 fetchmbufs(void);
106void	 fetchnetstat(void);
107void	 fetchpigs(void);
108void	 fetchswap(void);
109void	 fetchtcp(void);
110void	 getsysctl(const char *, void *, size_t);
111int	 initicmp(void);
112int	 initicmp6(void);
113int	 initifstat(void);
114int	 initip(void);
115int	 initip6(void);
116int	 initiostat(void);
117int	 initkre(void);
118int	 initmbufs(void);
119int	 initnetstat(void);
120int	 initpigs(void);
121int	 initswap(void);
122int	 inittcp(void);
123int	 keyboard(void);
124int	 kvm_ckread(void *, void *, int);
125void	 labelicmp(void);
126void	 labelicmp6(void);
127void	 labelifstat(void);
128void	 labelip(void);
129void	 labelip6(void);
130void	 labeliostat(void);
131void	 labelkre(void);
132void	 labelmbufs(void);
133void	 labelnetstat(void);
134void	 labelpigs(void);
135void	 labels(void);
136void	 labelswap(void);
137void	 labeltcp(void);
138void	 load(void);
139int	 netcmd(const char *, const char *);
140void	 nlisterr(struct nlist []);
141WINDOW	*openicmp(void);
142WINDOW	*openicmp6(void);
143WINDOW	*openifstat(void);
144WINDOW	*openip(void);
145WINDOW	*openip6(void);
146WINDOW	*openiostat(void);
147WINDOW	*openkre(void);
148WINDOW	*openmbufs(void);
149WINDOW	*opennetstat(void);
150WINDOW	*openpigs(void);
151WINDOW	*openswap(void);
152WINDOW	*opentcp(void);
153int	 prefix(const char *, const char *);
154void	 reseticmp(void);
155void	 reseticmp6(void);
156void	 resetip(void);
157void	 resetip6(void);
158void	 resettcp(void);
159void	 showicmp(void);
160void	 showicmp6(void);
161void	 showifstat(void);
162void	 showip(void);
163void	 showip6(void);
164void	 showiostat(void);
165void	 showkre(void);
166void	 showmbufs(void);
167void	 shownetstat(void);
168void	 showpigs(void);
169void	 showswap(void);
170void	 showtcp(void);
171void	 status(void);
172void	 suspend(int);
173char	*sysctl_dynread(const char *, size_t *);
174