extern.h revision 92922
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 92922 2002-03-22 01:42:45Z imp $
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	 closeiostat(WINDOW *);
76void	 closeicmp(WINDOW *);
77void	 closeip(WINDOW *);
78void	 closekre(WINDOW *);
79void	 closembufs(WINDOW *);
80void	 closenetstat(WINDOW *);
81void	 closepigs(WINDOW *);
82void	 closeswap(WINDOW *);
83void	 closetcp(WINDOW *);
84int	 cmdiostat(const char *, const char *);
85int	 cmdkre(const char *, const char *);
86int	 cmdnetstat(const char *, const char *);
87struct	 cmdtab *lookup(const char *);
88void	 command(const char *);
89void	 die(int);
90void	 display(int);
91int	 dkinit(void);
92int	 dkcmd(char *, char *);
93void	 error(const char *fmt, ...) __printflike(1, 2);
94void	 fetchicmp(void);
95void	 fetchip(void);
96void	 fetchiostat(void);
97void	 fetchkre(void);
98void	 fetchmbufs(void);
99void	 fetchnetstat(void);
100void	 fetchpigs(void);
101void	 fetchswap(void);
102void	 fetchtcp(void);
103void	 getsysctl(const char *, void *, size_t);
104int	 initicmp(void);
105int	 initip(void);
106int	 initiostat(void);
107int	 initkre(void);
108int	 initmbufs(void);
109int	 initnetstat(void);
110int	 initpigs(void);
111int	 initswap(void);
112int	 inittcp(void);
113int	 keyboard(void);
114int	 kvm_ckread(void *, void *, int);
115void	 labelicmp(void);
116void	 labelip(void);
117void	 labeliostat(void);
118void	 labelkre(void);
119void	 labelmbufs(void);
120void	 labelnetstat(void);
121void	 labelpigs(void);
122void	 labels(void);
123void	 labelswap(void);
124void	 labeltcp(void);
125void	 load(void);
126int	 netcmd(const char *, const char *);
127void	 nlisterr(struct nlist []);
128WINDOW	*openicmp(void);
129WINDOW	*openip(void);
130WINDOW	*openiostat(void);
131WINDOW	*openkre(void);
132WINDOW	*openmbufs(void);
133WINDOW	*opennetstat(void);
134WINDOW	*openpigs(void);
135WINDOW	*openswap(void);
136WINDOW	*opentcp(void);
137int	 prefix(const char *, const char *);
138void	 reseticmp(void);
139void	 resetip(void);
140void	 resettcp(void);
141void	 showicmp(void);
142void	 showip(void);
143void	 showiostat(void);
144void	 showkre(void);
145void	 showmbufs(void);
146void	 shownetstat(void);
147void	 showpigs(void);
148void	 showswap(void);
149void	 showtcp(void);
150void	 status(void);
151void	 suspend(int);
152char	*sysctl_dynread(const char *, size_t *);
153