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