1 /*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 4. Neither the name of the University nor the names of its contributors 14 * may be used to endorse or promote products derived from this software 15 * without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)extern.h 8.1 (Berkeley) 6/6/93 30 * $FreeBSD$ 31 */ 32 33 #include <sys/cdefs.h> 34 #include <fcntl.h> 35 #include <kvm.h> 36 37 extern struct cmdtab *curcmd; 38 extern struct cmdtab cmdtab[]; 39 extern struct text *xtext; 40 extern WINDOW *wnd; 41 extern char **dr_name; 42 extern char c, *namp, hostname[]; 43 extern double avenrun[3]; 44 extern float *dk_mspw; 45 extern kvm_t *kd; 46 extern long ntext, textp; 47 extern int *dk_select; 48 extern int CMDLINE; 49 extern int dk_ndrive; 50 extern int hz, stathz; 51 extern double hertz; /* sampling frequency for cp_time and dk_time */ 52 extern int naptime, col; 53 extern int nhosts; 54 extern int nports; 55 extern int protos; 56 extern int verbose; 57 58 struct inpcb; 59 60 extern struct device_selection *dev_select; 61 extern long generation; 62 extern int num_devices; 63 extern int num_selected; 64 extern int num_selections; 65 extern long select_generation; 66 67 extern struct nlist namelist[]; 68 69 int checkhost(struct inpcb *); 70 int checkport(struct inpcb *); 71 void closeicmp(WINDOW *); 72 void closeicmp6(WINDOW *); 73 void closeifstat(WINDOW *); 74 void closeiostat(WINDOW *); 75 void closeip(WINDOW *); 76 void closeip6(WINDOW *); 77 void closekre(WINDOW *); 78 void closembufs(WINDOW *); 79 void closenetstat(WINDOW *); 80 void closepigs(WINDOW *); 81 void closeswap(WINDOW *); 82 void closetcp(WINDOW *); 83 int cmdifstat(const char *, const char *); 84 int cmdiostat(const char *, const char *); 85 int cmdkre(const char *, const char *); 86 int cmdnetstat(const char *, const char *); 87 struct cmdtab *lookup(const char *); 88 void command(const char *); 89 void die(int); 90 void display(int); 91 int dkinit(void); 92 int dkcmd(char *, char *); 93 void error(const char *fmt, ...) __printflike(1, 2); 94 void fetchicmp(void); 95 void fetchicmp6(void); 96 void fetchifstat(void); 97 void fetchip(void); 98 void fetchip6(void); 99 void fetchiostat(void); 100 void fetchkre(void); 101 void fetchmbufs(void); 102 void fetchnetstat(void); 103 void fetchpigs(void); 104 void fetchswap(void); 105 void fetchtcp(void); 106 void getsysctl(const char *, void *, size_t); 107 int ifcmd(const char *cmd, const char *args); 108 int initicmp(void); 109 int initicmp6(void); 110 int initifstat(void); 111 int initip(void); 112 int initip6(void); 113 int initiostat(void); 114 int initkre(void); 115 int initmbufs(void); 116 int initnetstat(void); 117 int initpigs(void); 118 int initswap(void); 119 int inittcp(void); 120 int keyboard(void); 121 int kvm_ckread(void *, void *, int); 122 void labelicmp(void); 123 void labelicmp6(void); 124 void labelifstat(void); 125 void labelip(void); 126 void labelip6(void); 127 void labeliostat(void); 128 void labelkre(void); 129 void labelmbufs(void); 130 void labelnetstat(void); 131 void labelpigs(void); 132 void labels(void); 133 void labelswap(void); 134 void labeltcp(void); 135 void load(void); 136 int netcmd(const char *, const char *); 137 void nlisterr(struct nlist []); 138 WINDOW *openicmp(void); 139 WINDOW *openicmp6(void); 140 WINDOW *openifstat(void); 141 WINDOW *openip(void); 142 WINDOW *openip6(void); 143 WINDOW *openiostat(void); 144 WINDOW *openkre(void); 145 WINDOW *openmbufs(void); 146 WINDOW *opennetstat(void); 147 WINDOW *openpigs(void); 148 WINDOW *openswap(void); 149 WINDOW *opentcp(void); 150 int prefix(const char *, const char *); 151 void reseticmp(void); 152 void reseticmp6(void); 153 void resetip(void); 154 void resetip6(void); 155 void resettcp(void); 156 void showicmp(void); 157 void showicmp6(void); 158 void showifstat(void); 159 void showip(void); 160 void showip6(void); 161 void showiostat(void); 162 void showkre(void); 163 void showmbufs(void); 164 void shownetstat(void); 165 void showpigs(void); 166 void showswap(void); 167 void showtcp(void); 168 void status(void); 169 void suspend(int); 170 char *sysctl_dynread(const char *, size_t *); 171