extern.h revision 1.30
1/* $NetBSD: extern.h,v 1.30 2003/08/03 11:56:57 jdolecek 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 44extern struct command global_commands[]; 45extern struct mode *curmode; 46extern struct mode modes[]; 47extern struct text *xtext; 48extern WINDOW *wnd; 49extern char c, *namp, hostname[]; 50extern double avenrun[3]; 51extern float *dk_mspw; 52extern kvm_t *kd; 53extern long ntext, textp; 54extern int CMDLINE; 55extern int hz, stathz, maxslp; 56extern int naptime, col; 57extern int nhosts; 58extern int nports; 59extern int protos; 60extern int verbose; 61extern int nflag; 62extern char *memf; 63extern int allflag; 64extern int turns; 65extern gid_t egid; 66 67struct inpcb; 68#ifdef INET6 69struct in6pcb; 70#endif 71 72int checkhost(struct inpcb *); 73int checkport(struct inpcb *); 74#ifdef INET6 75int checkhost6(struct in6pcb *); 76int checkport6(struct in6pcb *); 77#endif 78void closebufcache(WINDOW *); 79void closeicmp(WINDOW *); 80void closeiostat(WINDOW *); 81void closeip(WINDOW *); 82void closevmstat(WINDOW *); 83void closembufs(WINDOW *); 84void closenetstat(WINDOW *); 85void closepigs(WINDOW *); 86void closeswap(WINDOW *); 87void closetcp(WINDOW *); 88void command(char *); 89void die(int); 90void disks_add(char *); 91void disks_delete(char *); 92void disks_drives(char *); 93void display(int); 94void error(const char *, ...) 95 __attribute__((__format__(__printf__, 1, 2))); 96void fetchbufcache(void); 97void fetchicmp(void); 98void fetchiostat(void); 99void fetchip(void); 100void fetchvmstat(void); 101void fetchmbufs(void); 102void fetchnetstat(void); 103void fetchpigs(void); 104void fetchswap(void); 105void fetchtcp(void); 106int fetch_cptime(u_int64_t *); 107void global_help(char *); 108void global_interval(char *); 109void global_load(char *); 110void global_quit(char *); 111void global_stop(char *); 112void icmp_boot(char *); 113void icmp_run(char *); 114void icmp_time(char *); 115void icmp_zero(char *); 116int initbufcache(void); 117int initicmp(void); 118int initiostat(void); 119int initip(void); 120int initvmstat(void); 121int initmbufs(void); 122int initnetstat(void); 123int initpigs(void); 124int initswap(void); 125int inittcp(void); 126void iostat_bars(char *); 127void iostat_numbers(char *); 128void iostat_secs(char *); 129void iostat_rw(char *); 130void iostat_all(char *); 131void ip_boot(char *); 132void ip_run(char *); 133void ip_time(char *); 134void ip_zero(char *); 135int keyboard(void) __attribute__((__noreturn__)); 136ssize_t kvm_ckread(const void *, void *, size_t); 137void labelbufcache(void); 138void labelicmp(void); 139void labeliostat(void); 140void labelip(void); 141void labelvmstat(void); 142void labelmbufs(void); 143void labelnetstat(void); 144void labelpigs(void); 145void labelps(void); 146void labels(void); 147void labelswap(void); 148void labeltcp(void); 149void labeltcpsyn(void); 150void netstat_all(char *); 151void netstat_display(char *); 152void netstat_ignore(char *); 153void netstat_names(char *); 154void netstat_numbers(char *); 155void netstat_reset(char *); 156void netstat_show(char *); 157void netstat_tcp(char *); 158void netstat_udp(char *); 159void nlisterr(struct nlist []) __attribute__((__noreturn__)); 160WINDOW *openbufcache(void); 161WINDOW *openicmp(void); 162WINDOW *openiostat(void); 163WINDOW *openip(void); 164WINDOW *openvmstat(void); 165WINDOW *openmbufs(void); 166WINDOW *opennetstat(void); 167WINDOW *openpigs(void); 168WINDOW *openswap(void); 169WINDOW *opentcp(void); 170void ps_user(char *); 171void redraw(int); 172void showbufcache(void); 173void showicmp(void); 174void showiostat(void); 175void showip(void); 176void showvmstat(void); 177void showmbufs(void); 178void shownetstat(void); 179void showpigs(void); 180void showps(void); 181void showswap(void); 182void showtcp(void); 183void showtcpsyn(void); 184void status(void); 185void switch_mode(struct mode *); 186void tcp_boot(char *); 187void tcp_run(char *); 188void tcp_time(char *); 189void tcp_zero(char *); 190void vmstat_boot(char *); 191void vmstat_run(char *); 192void vmstat_time(char *); 193void vmstat_zero(char *); 194 195#ifdef INET6 196void closeip6(WINDOW *); 197void fetchip6(void); 198int initip6(void); 199void labelip6(void); 200WINDOW *openip6(void); 201void showip6(void); 202void ip6_boot(char *); 203void ip6_run(char *); 204void ip6_time(char *); 205void ip6_zero(char *); 206#endif 207 208#ifdef IPSEC 209void closeipsec(WINDOW *); 210void fetchipsec(void); 211int initipsec(void); 212void labelipsec(void); 213WINDOW *openipsec(void); 214void showipsec(void); 215void ipsec_boot(char *); 216void ipsec_run(char *); 217void ipsec_time(char *); 218void ipsec_zero(char *); 219#endif 220