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