19b50d902SRodney W. Grimes /*- 29b50d902SRodney W. Grimes * Copyright (c) 1991, 1993 39b50d902SRodney W. Grimes * The Regents of the University of California. All rights reserved. 49b50d902SRodney W. Grimes * 59b50d902SRodney W. Grimes * Redistribution and use in source and binary forms, with or without 69b50d902SRodney W. Grimes * modification, are permitted provided that the following conditions 79b50d902SRodney W. Grimes * are met: 89b50d902SRodney W. Grimes * 1. Redistributions of source code must retain the above copyright 99b50d902SRodney W. Grimes * notice, this list of conditions and the following disclaimer. 109b50d902SRodney W. Grimes * 2. Redistributions in binary form must reproduce the above copyright 119b50d902SRodney W. Grimes * notice, this list of conditions and the following disclaimer in the 129b50d902SRodney W. Grimes * documentation and/or other materials provided with the distribution. 139b50d902SRodney W. Grimes * 3. All advertising materials mentioning features or use of this software 149b50d902SRodney W. Grimes * must display the following acknowledgement: 159b50d902SRodney W. Grimes * This product includes software developed by the University of 169b50d902SRodney W. Grimes * California, Berkeley and its contributors. 179b50d902SRodney W. Grimes * 4. Neither the name of the University nor the names of its contributors 189b50d902SRodney W. Grimes * may be used to endorse or promote products derived from this software 199b50d902SRodney W. Grimes * without specific prior written permission. 209b50d902SRodney W. Grimes * 219b50d902SRodney W. Grimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 229b50d902SRodney W. Grimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 239b50d902SRodney W. Grimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 249b50d902SRodney W. Grimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 259b50d902SRodney W. Grimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 269b50d902SRodney W. Grimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 279b50d902SRodney W. Grimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 289b50d902SRodney W. Grimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 299b50d902SRodney W. Grimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 309b50d902SRodney W. Grimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 319b50d902SRodney W. Grimes * SUCH DAMAGE. 329b50d902SRodney W. Grimes * 339b50d902SRodney W. Grimes * @(#)extern.h 8.1 (Berkeley) 6/6/93 34342e2faaSThomas Moestl * $FreeBSD$ 359b50d902SRodney W. Grimes */ 369b50d902SRodney W. Grimes 379b50d902SRodney W. Grimes #include <sys/cdefs.h> 389b50d902SRodney W. Grimes #include <fcntl.h> 399b50d902SRodney W. Grimes #include <kvm.h> 409b50d902SRodney W. Grimes 419b50d902SRodney W. Grimes extern struct cmdtab *curcmd; 429b50d902SRodney W. Grimes extern struct cmdtab cmdtab[]; 439b50d902SRodney W. Grimes extern struct text *xtext; 449b50d902SRodney W. Grimes extern WINDOW *wnd; 459b50d902SRodney W. Grimes extern char **dr_name; 469b50d902SRodney W. Grimes extern char c, *namp, hostname[]; 479b50d902SRodney W. Grimes extern double avenrun[3]; 489b50d902SRodney W. Grimes extern float *dk_mspw; 499b50d902SRodney W. Grimes extern kvm_t *kd; 509b50d902SRodney W. Grimes extern long ntext, textp; 519b50d902SRodney W. Grimes extern int *dk_select; 529b50d902SRodney W. Grimes extern int CMDLINE; 539b50d902SRodney W. Grimes extern int dk_ndrive; 549b50d902SRodney W. Grimes extern int hz, stathz; 553544ae54SBruce Evans extern double hertz; /* sampling frequency for cp_time and dk_time */ 569b50d902SRodney W. Grimes extern int naptime, col; 579b50d902SRodney W. Grimes extern int nhosts; 589b50d902SRodney W. Grimes extern int nports; 599b50d902SRodney W. Grimes extern int protos; 609b50d902SRodney W. Grimes extern int verbose; 619b50d902SRodney W. Grimes 629b50d902SRodney W. Grimes struct inpcb; 639b50d902SRodney W. Grimes 648d2fbde5SJustin T. Gibbs extern struct device_selection *dev_select; 65bcc6a3daSKenneth D. Merry extern long generation; 668d2fbde5SJustin T. Gibbs extern int num_devices; 678d2fbde5SJustin T. Gibbs extern int num_selected; 688d2fbde5SJustin T. Gibbs extern int num_selections; 69bcc6a3daSKenneth D. Merry extern long select_generation; 708d2fbde5SJustin T. Gibbs 71342e2faaSThomas Moestl extern struct nlist namelist[]; 72342e2faaSThomas Moestl 733f330d7dSWarner Losh int checkhost(struct inpcb *); 743f330d7dSWarner Losh int checkport(struct inpcb *); 753f330d7dSWarner Losh void closeicmp(WINDOW *); 76b59ba7dfSPoul-Henning Kamp void closeifstat(WINDOW *); 77b59ba7dfSPoul-Henning Kamp void closeiostat(WINDOW *); 783f330d7dSWarner Losh void closeip(WINDOW *); 793f330d7dSWarner Losh void closekre(WINDOW *); 803f330d7dSWarner Losh void closembufs(WINDOW *); 813f330d7dSWarner Losh void closenetstat(WINDOW *); 823f330d7dSWarner Losh void closepigs(WINDOW *); 833f330d7dSWarner Losh void closeswap(WINDOW *); 843f330d7dSWarner Losh void closetcp(WINDOW *); 85b59ba7dfSPoul-Henning Kamp int cmdifstat(const char *, const char *); 863f330d7dSWarner Losh int cmdiostat(const char *, const char *); 873f330d7dSWarner Losh int cmdkre(const char *, const char *); 883f330d7dSWarner Losh int cmdnetstat(const char *, const char *); 893f330d7dSWarner Losh struct cmdtab *lookup(const char *); 903f330d7dSWarner Losh void command(const char *); 913f330d7dSWarner Losh void die(int); 923f330d7dSWarner Losh void display(int); 933f330d7dSWarner Losh int dkinit(void); 943f330d7dSWarner Losh int dkcmd(char *, char *); 953f330d7dSWarner Losh void error(const char *fmt, ...) __printflike(1, 2); 963f330d7dSWarner Losh void fetchicmp(void); 97b59ba7dfSPoul-Henning Kamp void fetchifstat(void); 983f330d7dSWarner Losh void fetchip(void); 993f330d7dSWarner Losh void fetchiostat(void); 1003f330d7dSWarner Losh void fetchkre(void); 1013f330d7dSWarner Losh void fetchmbufs(void); 1023f330d7dSWarner Losh void fetchnetstat(void); 1033f330d7dSWarner Losh void fetchpigs(void); 1043f330d7dSWarner Losh void fetchswap(void); 1053f330d7dSWarner Losh void fetchtcp(void); 1063f330d7dSWarner Losh void getsysctl(const char *, void *, size_t); 1073f330d7dSWarner Losh int initicmp(void); 108b59ba7dfSPoul-Henning Kamp int initifstat(void); 1093f330d7dSWarner Losh int initip(void); 1103f330d7dSWarner Losh int initiostat(void); 1113f330d7dSWarner Losh int initkre(void); 1123f330d7dSWarner Losh int initmbufs(void); 1133f330d7dSWarner Losh int initnetstat(void); 1143f330d7dSWarner Losh int initpigs(void); 1153f330d7dSWarner Losh int initswap(void); 1163f330d7dSWarner Losh int inittcp(void); 1173f330d7dSWarner Losh int keyboard(void); 1183f330d7dSWarner Losh int kvm_ckread(void *, void *, int); 1193f330d7dSWarner Losh void labelicmp(void); 120b59ba7dfSPoul-Henning Kamp void labelifstat(void); 1213f330d7dSWarner Losh void labelip(void); 1223f330d7dSWarner Losh void labeliostat(void); 1233f330d7dSWarner Losh void labelkre(void); 1243f330d7dSWarner Losh void labelmbufs(void); 1253f330d7dSWarner Losh void labelnetstat(void); 1263f330d7dSWarner Losh void labelpigs(void); 1273f330d7dSWarner Losh void labels(void); 1283f330d7dSWarner Losh void labelswap(void); 1293f330d7dSWarner Losh void labeltcp(void); 1303f330d7dSWarner Losh void load(void); 1313f330d7dSWarner Losh int netcmd(const char *, const char *); 1323f330d7dSWarner Losh void nlisterr(struct nlist []); 1333f330d7dSWarner Losh WINDOW *openicmp(void); 134b59ba7dfSPoul-Henning Kamp WINDOW *openifstat(void); 1353f330d7dSWarner Losh WINDOW *openip(void); 1363f330d7dSWarner Losh WINDOW *openiostat(void); 1373f330d7dSWarner Losh WINDOW *openkre(void); 1383f330d7dSWarner Losh WINDOW *openmbufs(void); 1393f330d7dSWarner Losh WINDOW *opennetstat(void); 1403f330d7dSWarner Losh WINDOW *openpigs(void); 1413f330d7dSWarner Losh WINDOW *openswap(void); 1423f330d7dSWarner Losh WINDOW *opentcp(void); 1433f330d7dSWarner Losh int prefix(const char *, const char *); 1443f330d7dSWarner Losh void reseticmp(void); 1453f330d7dSWarner Losh void resetip(void); 1463f330d7dSWarner Losh void resettcp(void); 1473f330d7dSWarner Losh void showicmp(void); 148b59ba7dfSPoul-Henning Kamp void showifstat(void); 1493f330d7dSWarner Losh void showip(void); 1503f330d7dSWarner Losh void showiostat(void); 1513f330d7dSWarner Losh void showkre(void); 1523f330d7dSWarner Losh void showmbufs(void); 1533f330d7dSWarner Losh void shownetstat(void); 1543f330d7dSWarner Losh void showpigs(void); 1553f330d7dSWarner Losh void showswap(void); 1563f330d7dSWarner Losh void showtcp(void); 1573f330d7dSWarner Losh void status(void); 1583f330d7dSWarner Losh void suspend(int); 1593f330d7dSWarner Losh char *sysctl_dynread(const char *, size_t *); 160