1 /* 2 * Copyright (c) 1980, 1989 Regents of the University of California. 3 * All rights reserved. The Berkeley software License Agreement 4 * specifies the terms and conditions for redistribution. 5 * 6 * @(#)systat.h 5.6 (Berkeley) 06/26/91 7 */ 8 9 #include <netdb.h> 10 #include <nlist.h> 11 #include <signal.h> 12 #include <curses.h> 13 #include <math.h> 14 15 #include <sys/param.h> 16 #include <sys/file.h> 17 #include <sys/dkstat.h> 18 19 #include <netinet/in.h> 20 #include <arpa/inet.h> 21 22 struct cmdtab { 23 char *c_name; /* command name */ 24 int (*c_refresh)(); /* display refresh */ 25 int (*c_fetch)(); /* sets up data structures */ 26 int (*c_label)(); /* label display */ 27 int (*c_init)(); /* initialize namelist, etc. */ 28 WINDOW *(*c_open)(); /* open display */ 29 int (*c_close)(); /* close display */ 30 int (*c_cmd)(); /* display command interpreter */ 31 char c_flags; /* see below */ 32 }; 33 34 #define CF_INIT 0x1 /* been initialized */ 35 #define CF_LOADAV 0x2 /* display w/ load average */ 36 37 struct cmdtab *curcmd; 38 struct cmdtab cmdtab[]; 39 struct cmdtab *lookup(); 40 41 int naptime, col; 42 43 long ntext, textp; 44 struct text *xtext; 45 46 double avenrun[3]; 47 48 int hz, phz; 49 char **dr_name; 50 int dk_ndrive; 51 int *dk_select; 52 float *dk_mspw; 53 char c, *namp, hostname[MAXHOSTNAMELEN]; 54 55 int nports; 56 int nhosts; 57 int protos; 58 #define TCP 0x1 59 #define UDP 0x2 60 61 WINDOW *wnd; 62 int CMDLINE; 63 64 char *malloc(), *calloc(), *strncpy(); 65 66 #define KREAD(addr, buf, len) kvm_ckread((addr), (buf), (len)) 67 #define NVAL(indx) nlst[(indx)].n_value 68 #define NPTR(indx) (void *)NVAL((indx)) 69 #define NREAD(indx, buf, len) kvm_ckread(NPTR((indx)), (buf), (len)) 70 #define LONG (sizeof (long)) 71