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 * 3. 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 */ 31 32 #include <fcntl.h> 33 #include <kvm.h> 34 35 extern struct cmdtab *curcmd; 36 extern struct cmdtab cmdtab[]; 37 extern WINDOW *wnd; 38 extern char c, *namp, hostname[]; 39 extern double avenrun[3]; 40 extern kvm_t *kd; 41 extern long ntext, textp; 42 extern int CMDLINE; 43 extern int hz, stathz; 44 extern double hertz; /* sampling frequency for cp_time and dk_time */ 45 extern double naptime; 46 extern int col; 47 extern int nhosts; 48 extern int nports; 49 extern int protos; 50 extern int verbose; 51 52 struct inpcb; 53 54 extern struct device_selection *dev_select; 55 extern long generation; 56 extern int num_devices; 57 extern int num_selected; 58 extern int num_selections; 59 extern long select_generation; 60 extern struct statinfo cur, last; 61 extern struct kinfo_cputime old_cp_time; 62 63 int checkhost(struct inpcb *); 64 int checkport(struct inpcb *); 65 void closeiostat(WINDOW *); 66 void closeifstat(WINDOW *); 67 void closealtqs(WINDOW *); 68 void closeicmp(WINDOW *); 69 void closeicmp6(WINDOW *); 70 void closeip(WINDOW *); 71 void closeip6(WINDOW *); 72 void closekre(WINDOW *); 73 void closembufs(WINDOW *); 74 void closenetstat(WINDOW *); 75 void closenetbw(WINDOW *); 76 void closepftop(WINDOW *); 77 void closepigs(WINDOW *); 78 void closesensors(WINDOW *); 79 void closeswap(WINDOW *); 80 void closetcp(WINDOW *); 81 void closevmm(WINDOW *); 82 int cmdiostat(const char *, char *); 83 int cmdifstat(const char *, char *); 84 int cmdaltqs(const char *, char *); 85 int cmdkre(const char *, char *); 86 int cmdnetstat(const char *, char *); 87 int cmdnetbw(const char *, char *); 88 int cmdpftop(const char *, char *); 89 int cmdsensors(const char *, char *); 90 struct cmdtab *lookup(const char *); 91 void command(const char *); 92 void die(int) __dead2; 93 void display(int); 94 int dkinit(void); 95 int dkcmd(char *, char *); 96 void error(const char *fmt, ...) __printflike(1, 2); 97 void fetchicmp(void); 98 void fetchicmp6(void); 99 void fetchifstat(void); 100 void fetchaltqs(void); 101 void fetchip(void); 102 void fetchip6(void); 103 void fetchiostat(void); 104 void fetchkre(void); 105 void fetchmbufs(void); 106 void fetchnetstat(void); 107 void fetchnetbw(void); 108 void fetchpftop(void); 109 void fetchpigs(void); 110 void fetchsensors(void); 111 void fetchswap(void); 112 void fetchtcp(void); 113 void fetchvmm(void); 114 int ifcmd(const char *, const char *); 115 int initicmp(void); 116 int initicmp6(void); 117 int initifstat(void); 118 int initaltqs(void); 119 int initip(void); 120 int initip6(void); 121 int initiostat(void); 122 int initkre(void); 123 int initmbufs(void); 124 int initnetstat(void); 125 int initnetbw(void); 126 int initpftop(void); 127 int initpigs(void); 128 int initsensors(void); 129 int initswap(void); 130 int inittcp(void); 131 int initvmm(void); 132 int keyboard(void) __dead2; 133 int kvm_ckread(void *, void *, int); 134 void labelicmp(void); 135 void labelicmp6(void); 136 void labelifstat(void); 137 void labelaltqs(void); 138 void labelip(void); 139 void labelip6(void); 140 void labeliostat(void); 141 void labelkre(void); 142 void labelmbufs(void); 143 void labelnetstat(void); 144 void labelnetbw(void); 145 void labelpftop(void); 146 void labelpigs(void); 147 void labels(void); 148 void labelsensors(void); 149 void labelswap(void); 150 void labeltcp(void); 151 void labelvmm(void); 152 void load(void); 153 int netcmd(const char *, char *); 154 void nlisterr(struct nlist []) __dead2; 155 WINDOW *openicmp(void); 156 WINDOW *openicmp6(void); 157 WINDOW *openifstat(void); 158 WINDOW *openaltqs(void); 159 WINDOW *openip(void); 160 WINDOW *openip6(void); 161 WINDOW *openiostat(void); 162 WINDOW *openkre(void); 163 WINDOW *openmbufs(void); 164 WINDOW *opennetstat(void); 165 WINDOW *opennetbw(void); 166 WINDOW *openpftop(void); 167 WINDOW *openpigs(void); 168 WINDOW *opensensors(void); 169 WINDOW *openswap(void); 170 WINDOW *opentcp(void); 171 WINDOW *openvmm(void); 172 int prefix(const char *, const char *); 173 void reseticmp(void); 174 void reseticmp6(void); 175 void resetip(void); 176 void resetip6(void); 177 void resettcp(void); 178 void showicmp(void); 179 void showicmp6(void); 180 void showifstat(void); 181 void showaltqs(void); 182 void showip(void); 183 void showip6(void); 184 void showiostat(void); 185 void showkre(void); 186 void showmbufs(void); 187 void shownetstat(void); 188 void shownetbw(void); 189 void showpftop(void); 190 void showpigs(void); 191 void showsensors(void); 192 void showswap(void); 193 void showtcp(void); 194 void showvmm(void); 195 void status(void); 196 void suspend(int); 197