Home | History | Annotate | Line # | Download | only in systat
extern.h revision 1.26
      1 /*	$NetBSD: extern.h,v 1.26 2000/12/01 02:19:43 simonb Exp $	*/
      2 
      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. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *	This product includes software developed by the University of
     18  *	California, Berkeley and its contributors.
     19  * 4. Neither the name of the University nor the names of its contributors
     20  *    may be used to endorse or promote products derived from this software
     21  *    without specific prior written permission.
     22  *
     23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33  * SUCH DAMAGE.
     34  *
     35  *      @(#)extern.h	8.1 (Berkeley) 6/6/93
     36  */
     37 
     38 #include <sys/cdefs.h>
     39 #include <fcntl.h>
     40 #include <kvm.h>
     41 
     42 #define ADJINETCTR(c, o, n, e)	(c.e = n.e - o.e)
     43 
     44 extern struct	command global_commands[];
     45 extern struct	mode *curmode;
     46 extern struct	mode modes[];
     47 extern struct	text *xtext;
     48 extern WINDOW	*wnd;
     49 extern char	c, *namp, hostname[];
     50 extern double	avenrun[3];
     51 extern float	*dk_mspw;
     52 extern kvm_t	*kd;
     53 extern long	ntext, textp;
     54 extern int	CMDLINE;
     55 extern int	hz, stathz;
     56 extern int	naptime, col;
     57 extern int	nhosts;
     58 extern int	nports;
     59 extern int	protos;
     60 extern int	verbose;
     61 extern int	nflag;
     62 extern char	*memf;
     63 extern int	allflag;
     64 extern int	turns;
     65 extern gid_t	egid;
     66 
     67 struct inpcb;
     68 #ifdef INET6
     69 struct in6pcb;
     70 #endif
     71 
     72 int	 checkhost(struct inpcb *);
     73 int	 checkport(struct inpcb *);
     74 #ifdef INET6
     75 int	 checkhost6(struct in6pcb *);
     76 int	 checkport6(struct in6pcb *);
     77 #endif
     78 void	 closebufcache(WINDOW *);
     79 void	 closeicmp(WINDOW *);
     80 void	 closeiostat(WINDOW *);
     81 void	 closeip(WINDOW *);
     82 void	 closevmstat(WINDOW *);
     83 void	 closembufs(WINDOW *);
     84 void	 closenetstat(WINDOW *);
     85 void	 closepigs(WINDOW *);
     86 void	 closeswap(WINDOW *);
     87 void	 closetcp(WINDOW *);
     88 void	 command(char *);
     89 void	 die(int);
     90 void	 disks_add(char *);
     91 void	 disks_delete(char *);
     92 void	 disks_drives(char *);
     93 void	 display(int);
     94 void	 error(const char *, ...)
     95      __attribute__((__format__(__printf__, 1, 2)));
     96 void	 fetchbufcache(void);
     97 void	 fetchicmp(void);
     98 void	 fetchiostat(void);
     99 void	 fetchip(void);
    100 void	 fetchvmstat(void);
    101 void	 fetchmbufs(void);
    102 void	 fetchnetstat(void);
    103 void	 fetchpigs(void);
    104 void	 fetchswap(void);
    105 void	 fetchtcp(void);
    106 int	 fetch_cptime(u_int64_t *);
    107 void	 global_help(char *);
    108 void	 global_interval(char *);
    109 void	 global_load(char *);
    110 void	 global_quit(char *);
    111 void	 global_stop(char *);
    112 void	 icmp_boot(char *);
    113 void	 icmp_run(char *);
    114 void	 icmp_time(char *);
    115 void	 icmp_zero(char *);
    116 int	 initbufcache(void);
    117 int	 initicmp(void);
    118 int	 initiostat(void);
    119 int	 initip(void);
    120 int	 initvmstat(void);
    121 int	 initmbufs(void);
    122 int	 initnetstat(void);
    123 int	 initpigs(void);
    124 int	 initswap(void);
    125 int	 inittcp(void);
    126 void	 iostat_bars(char *);
    127 void	 iostat_numbers(char *);
    128 void	 iostat_secs(char *);
    129 void	 ip_boot(char *);
    130 void	 ip_run(char *);
    131 void	 ip_time(char *);
    132 void	 ip_zero(char *);
    133 int	 keyboard(void) __attribute__((__noreturn__));
    134 ssize_t	 kvm_ckread(void *, void *, size_t);
    135 void	 labelbufcache(void);
    136 void	 labelicmp(void);
    137 void	 labeliostat(void);
    138 void	 labelip(void);
    139 void	 labelvmstat(void);
    140 void	 labelmbufs(void);
    141 void	 labelnetstat(void);
    142 void	 labelpigs(void);
    143 void	 labelps(void);
    144 void	 labels(void);
    145 void	 labelswap(void);
    146 void	 labeltcp(void);
    147 void	 labeltcpsyn(void);
    148 void	 netstat_all(char *);
    149 void	 netstat_display(char *);
    150 void	 netstat_ignore(char *);
    151 void	 netstat_names(char *);
    152 void	 netstat_numbers(char *);
    153 void	 netstat_reset(char *);
    154 void	 netstat_show(char *);
    155 void	 netstat_tcp(char *);
    156 void	 netstat_udp(char *);
    157 void	 nlisterr(struct nlist []);
    158 WINDOW	*openbufcache(void);
    159 WINDOW	*openicmp(void);
    160 WINDOW	*openiostat(void);
    161 WINDOW	*openip(void);
    162 WINDOW	*openvmstat(void);
    163 WINDOW	*openmbufs(void);
    164 WINDOW	*opennetstat(void);
    165 WINDOW	*openpigs(void);
    166 WINDOW	*openswap(void);
    167 WINDOW	*opentcp(void);
    168 void	 ps_user(char *);
    169 void	 redraw(int);
    170 void	 showbufcache(void);
    171 void	 showicmp(void);
    172 void	 showiostat(void);
    173 void	 showip(void);
    174 void	 showvmstat(void);
    175 void	 showmbufs(void);
    176 void	 shownetstat(void);
    177 void	 showpigs(void);
    178 void	 showps(void);
    179 void	 showswap(void);
    180 void	 showtcp(void);
    181 void	 showtcpsyn(void);
    182 void	 status(void);
    183 void	 switch_mode(struct mode *);
    184 void	 tcp_boot(char *);
    185 void	 tcp_run(char *);
    186 void	 tcp_time(char *);
    187 void	 tcp_zero(char *);
    188 void	 vmstat_boot(char *);
    189 void	 vmstat_run(char *);
    190 void	 vmstat_time(char *);
    191 void	 vmstat_zero(char *);
    192 
    193 #ifdef INET6
    194 void	 closeip6(WINDOW *);
    195 void	 fetchip6(void);
    196 int	 initip6(void);
    197 void	 labelip6(void);
    198 WINDOW	*openip6(void);
    199 void	 showip6(void);
    200 void	 ip6_boot(char *);
    201 void	 ip6_run(char *);
    202 void	 ip6_time(char *);
    203 void	 ip6_zero(char *);
    204 #endif
    205 
    206 #ifdef IPSEC
    207 void	 closeipsec(WINDOW *);
    208 void	 fetchipsec(void);
    209 int	 initipsec(void);
    210 void	 labelipsec(void);
    211 WINDOW	*openipsec(void);
    212 void	 showipsec(void);
    213 void	 ipsec_boot(char *);
    214 void	 ipsec_run(char *);
    215 void	 ipsec_time(char *);
    216 void	 ipsec_zero(char *);
    217 #endif
    218