Home | History | Annotate | Line # | Download | only in systat
extern.h revision 1.41.2.1
      1  1.41.2.1      yamt /*	$NetBSD: extern.h,v 1.41.2.1 2012/04/17 00:09:39 yamt 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.39   thorpej #define xADJINETCTR(c, o, n, e)	(c[e] = n[e] - o[e])
     40      1.23        ad 
     41      1.12     jwise extern struct	command global_commands[];
     42      1.12     jwise extern struct	mode *curmode;
     43      1.12     jwise extern struct	mode modes[];
     44       1.1       jtc extern struct	text *xtext;
     45       1.1       jtc extern WINDOW	*wnd;
     46      1.36       dsl extern char	*namp, hostname[];
     47       1.1       jtc extern double	avenrun[3];
     48       1.1       jtc extern float	*dk_mspw;
     49       1.1       jtc extern kvm_t	*kd;
     50       1.1       jtc extern long	ntext, textp;
     51       1.1       jtc extern int	CMDLINE;
     52      1.27      matt extern int	hz, stathz, maxslp;
     53      1.36       dsl extern int	naptime;
     54       1.1       jtc extern int	nhosts;
     55       1.1       jtc extern int	nports;
     56       1.1       jtc extern int	protos;
     57       1.1       jtc extern int	verbose;
     58      1.20    itojun extern int	nflag;
     59      1.22   thorpej extern char	*memf;
     60      1.24   hubertf extern int	allflag;
     61      1.24   hubertf extern int	turns;
     62      1.26    simonb extern gid_t	egid;
     63      1.40   thorpej extern int	use_sysctl;
     64       1.1       jtc 
     65       1.1       jtc struct inpcb;
     66      1.19    itojun #ifdef INET6
     67      1.19    itojun struct in6pcb;
     68      1.19    itojun #endif
     69       1.1       jtc 
     70      1.23        ad int	 checkhost(struct inpcb *);
     71      1.23        ad int	 checkport(struct inpcb *);
     72      1.19    itojun #ifdef INET6
     73      1.23        ad int	 checkhost6(struct in6pcb *);
     74      1.23        ad int	 checkport6(struct in6pcb *);
     75      1.19    itojun #endif
     76      1.23        ad void	 closebufcache(WINDOW *);
     77      1.35   hubertf void	 closedf(WINDOW *);
     78      1.23        ad void	 closeicmp(WINDOW *);
     79      1.23        ad void	 closeiostat(WINDOW *);
     80      1.23        ad void	 closeip(WINDOW *);
     81      1.23        ad void	 closevmstat(WINDOW *);
     82      1.37       dsl void	 closesyscall(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.35   hubertf void	 df_all(char *);
     90      1.35   hubertf void	 df_some(char *);
     91      1.41     joerg void	 die(int) __dead;
     92      1.23        ad void	 disks_add(char *);
     93      1.32   mycroft void	 disks_remove(char *);
     94      1.23        ad void	 disks_drives(char *);
     95      1.23        ad void	 display(int);
     96      1.41     joerg void	 error(const char *, ...) __printflike(1, 2);
     97      1.23        ad void	 fetchbufcache(void);
     98      1.35   hubertf void	 fetchdf(void);
     99      1.23        ad void	 fetchicmp(void);
    100      1.23        ad void	 fetchiostat(void);
    101      1.23        ad void	 fetchip(void);
    102      1.23        ad void	 fetchvmstat(void);
    103      1.37       dsl void	 fetchsyscall(void);
    104      1.23        ad void	 fetchmbufs(void);
    105      1.23        ad void	 fetchnetstat(void);
    106      1.23        ad void	 fetchpigs(void);
    107      1.23        ad void	 fetchswap(void);
    108      1.23        ad void	 fetchtcp(void);
    109      1.23        ad int	 fetch_cptime(u_int64_t *);
    110      1.23        ad void	 global_help(char *);
    111      1.23        ad void	 global_interval(char *);
    112      1.23        ad void	 global_load(char *);
    113      1.41     joerg void	 global_quit(char *) __dead;
    114      1.23        ad void	 global_stop(char *);
    115      1.23        ad void	 icmp_boot(char *);
    116      1.23        ad void	 icmp_run(char *);
    117      1.23        ad void	 icmp_time(char *);
    118      1.23        ad void	 icmp_zero(char *);
    119      1.23        ad int	 initbufcache(void);
    120      1.35   hubertf int	 initdf(void);
    121      1.23        ad int	 initicmp(void);
    122      1.23        ad int	 initiostat(void);
    123      1.23        ad int	 initip(void);
    124      1.23        ad int	 initvmstat(void);
    125      1.37       dsl int	 initsyscall(void);
    126      1.23        ad int	 initmbufs(void);
    127      1.23        ad int	 initnetstat(void);
    128      1.23        ad int	 initpigs(void);
    129      1.23        ad int	 initswap(void);
    130      1.23        ad int	 inittcp(void);
    131      1.23        ad void	 iostat_bars(char *);
    132      1.23        ad void	 iostat_numbers(char *);
    133      1.23        ad void	 iostat_secs(char *);
    134      1.28       mrg void	 iostat_rw(char *);
    135      1.28       mrg void	 iostat_all(char *);
    136      1.23        ad void	 ip_boot(char *);
    137      1.23        ad void	 ip_run(char *);
    138      1.23        ad void	 ip_time(char *);
    139      1.23        ad void	 ip_zero(char *);
    140      1.41     joerg void	 keyboard(void) __dead;
    141      1.33  christos ssize_t	 kvm_ckread(const void *, void *, size_t, const char *);
    142      1.23        ad void	 labelbufcache(void);
    143      1.35   hubertf void	 labeldf(void);
    144      1.23        ad void	 labelicmp(void);
    145      1.23        ad void	 labeliostat(void);
    146      1.23        ad void	 labelip(void);
    147      1.23        ad void	 labelvmstat(void);
    148      1.37       dsl void	 labelsyscall(void);
    149      1.23        ad void	 labelmbufs(void);
    150      1.23        ad void	 labelnetstat(void);
    151      1.23        ad void	 labelpigs(void);
    152      1.23        ad void	 labelps(void);
    153      1.23        ad void	 labels(void);
    154      1.23        ad void	 labelswap(void);
    155      1.23        ad void	 labeltcp(void);
    156      1.23        ad void	 labeltcpsyn(void);
    157      1.23        ad void	 netstat_all(char *);
    158      1.23        ad void	 netstat_display(char *);
    159      1.23        ad void	 netstat_ignore(char *);
    160      1.23        ad void	 netstat_names(char *);
    161      1.23        ad void	 netstat_numbers(char *);
    162      1.23        ad void	 netstat_reset(char *);
    163      1.23        ad void	 netstat_show(char *);
    164      1.23        ad void	 netstat_tcp(char *);
    165      1.23        ad void	 netstat_udp(char *);
    166      1.41     joerg void	 nlisterr(struct nlist []) __dead;
    167      1.23        ad WINDOW	*openbufcache(void);
    168      1.35   hubertf WINDOW	*opendf(void);
    169      1.23        ad WINDOW	*openicmp(void);
    170      1.23        ad WINDOW	*openiostat(void);
    171      1.23        ad WINDOW	*openip(void);
    172      1.23        ad WINDOW	*openvmstat(void);
    173      1.37       dsl WINDOW	*opensyscall(void);
    174      1.23        ad WINDOW	*openmbufs(void);
    175      1.23        ad WINDOW	*opennetstat(void);
    176      1.23        ad WINDOW	*openpigs(void);
    177      1.23        ad WINDOW	*openswap(void);
    178      1.23        ad WINDOW	*opentcp(void);
    179      1.23        ad void	 ps_user(char *);
    180      1.38  christos void	 redraw(void);
    181      1.23        ad void	 showbufcache(void);
    182      1.35   hubertf void	 showdf(void);
    183      1.23        ad void	 showicmp(void);
    184      1.23        ad void	 showiostat(void);
    185      1.23        ad void	 showip(void);
    186      1.23        ad void	 showvmstat(void);
    187      1.37       dsl void	 showsyscall(void);
    188      1.23        ad void	 showmbufs(void);
    189      1.23        ad void	 shownetstat(void);
    190      1.23        ad void	 showpigs(void);
    191      1.23        ad void	 showps(void);
    192      1.23        ad void	 showswap(void);
    193      1.23        ad void	 showtcp(void);
    194      1.23        ad void	 showtcpsyn(void);
    195      1.23        ad void	 status(void);
    196      1.24   hubertf void	 switch_mode(struct mode *);
    197      1.23        ad void	 tcp_boot(char *);
    198      1.23        ad void	 tcp_run(char *);
    199      1.23        ad void	 tcp_time(char *);
    200      1.23        ad void	 tcp_zero(char *);
    201      1.23        ad void	 vmstat_boot(char *);
    202      1.23        ad void	 vmstat_run(char *);
    203      1.23        ad void	 vmstat_time(char *);
    204      1.23        ad void	 vmstat_zero(char *);
    205      1.37       dsl void	 syscall_boot(char *);
    206      1.37       dsl void	 syscall_run(char *);
    207      1.37       dsl void	 syscall_time(char *);
    208      1.37       dsl void	 syscall_zero(char *);
    209      1.37       dsl void	 syscall_order(char *);
    210      1.37       dsl void	 syscall_show(char *);
    211      1.23        ad 
    212      1.21    itojun #ifdef INET6
    213      1.23        ad void	 closeip6(WINDOW *);
    214      1.23        ad void	 fetchip6(void);
    215      1.23        ad int	 initip6(void);
    216      1.23        ad void	 labelip6(void);
    217      1.23        ad WINDOW	*openip6(void);
    218      1.23        ad void	 showip6(void);
    219      1.23        ad void	 ip6_boot(char *);
    220      1.23        ad void	 ip6_run(char *);
    221      1.23        ad void	 ip6_time(char *);
    222      1.23        ad void	 ip6_zero(char *);
    223      1.21    itojun #endif
    224