extern.h revision 1.23
1/* $NetBSD: extern.h,v 1.23 2000/07/05 11:03:23 ad 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 **dr_name; 50extern char c, *namp, hostname[]; 51extern double avenrun[3]; 52extern float *dk_mspw; 53extern kvm_t *kd; 54extern long ntext, textp; 55extern int *dk_select; 56extern int CMDLINE; 57extern int dk_ndrive; 58extern int hz, stathz; 59extern int naptime, col; 60extern int nhosts; 61extern int nports; 62extern int protos; 63extern int verbose; 64extern int nflag; 65extern char *memf; 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); 94int dkinit(int, gid_t); 95void error(const char *, ...); 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 ip_boot(char *); 130void ip_run(char *); 131void ip_time(char *); 132void ip_zero(char *); 133int keyboard(void) __attribute__((__noreturn__)); 134ssize_t kvm_ckread(void *, void *, size_t); 135void labelbufcache(void); 136void labelicmp(void); 137void labeliostat(void); 138void labelip(void); 139void labelvmstat(void); 140void labelmbufs(void); 141void labelnetstat(void); 142void labelpigs(void); 143void labelps(void); 144void labels(void); 145void labelswap(void); 146void labeltcp(void); 147void labeltcpsyn(void); 148void netstat_all(char *); 149void netstat_display(char *); 150void netstat_ignore(char *); 151void netstat_names(char *); 152void netstat_numbers(char *); 153void netstat_reset(char *); 154void netstat_show(char *); 155void netstat_tcp(char *); 156void netstat_udp(char *); 157void nlisterr(struct nlist []); 158WINDOW *openbufcache(void); 159WINDOW *openicmp(void); 160WINDOW *openiostat(void); 161WINDOW *openip(void); 162WINDOW *openvmstat(void); 163WINDOW *openmbufs(void); 164WINDOW *opennetstat(void); 165WINDOW *openpigs(void); 166WINDOW *openswap(void); 167WINDOW *opentcp(void); 168void ps_user(char *); 169void redraw(int); 170void showbufcache(void); 171void showicmp(void); 172void showiostat(void); 173void showip(void); 174void showvmstat(void); 175void showmbufs(void); 176void shownetstat(void); 177void showpigs(void); 178void showps(void); 179void showswap(void); 180void showtcp(void); 181void showtcpsyn(void); 182void status(void); 183void tcp_boot(char *); 184void tcp_run(char *); 185void tcp_time(char *); 186void tcp_zero(char *); 187void vmstat_boot(char *); 188void vmstat_run(char *); 189void vmstat_time(char *); 190void vmstat_zero(char *); 191 192#ifdef INET6 193void closeip6(WINDOW *); 194void fetchip6(void); 195int initip6(void); 196void labelip6(void); 197WINDOW *openip6(void); 198void showip6(void); 199void ip6_boot(char *); 200void ip6_run(char *); 201void ip6_time(char *); 202void ip6_zero(char *); 203#endif 204 205#ifdef IPSEC 206void closeipsec(WINDOW *); 207void fetchipsec(void); 208int initipsec(void); 209void labelipsec(void); 210WINDOW *openipsec(void); 211void showipsec(void); 212void ipsec_boot(char *); 213void ipsec_run(char *); 214void ipsec_time(char *); 215void ipsec_zero(char *); 216#endif 217