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.5 (Berkeley) 02/04/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/types.h> 17 #include <sys/file.h> 18 #include <sys/dkstat.h> 19 20 #include <netinet/in.h> 21 #include <arpa/inet.h> 22 23 struct p_times { 24 short pt_pid; 25 float pt_pctcpu; 26 int pt_uid; 27 int pt_paddr; 28 struct proc *pt_pp; 29 } *pt; 30 long nproc, procp; 31 struct proc *kprocp; 32 33 struct procs { 34 int pid; 35 char cmd[16]; 36 } procs[200]; 37 int numprocs; 38 39 struct users { 40 int k_uid; 41 char k_name[16]; 42 } known[30]; 43 int numknown; 44 45 struct cmdtab { 46 char *c_name; /* command name */ 47 int (*c_refresh)(); /* display refresh */ 48 int (*c_fetch)(); /* sets up data structures */ 49 int (*c_label)(); /* label display */ 50 int (*c_init)(); /* initialize namelist, etc. */ 51 WINDOW *(*c_open)(); /* open display */ 52 int (*c_close)(); /* close display */ 53 int (*c_cmd)(); /* display command interpreter */ 54 char c_flags; /* see below */ 55 }; 56 57 #define CF_INIT 0x1 /* been initialized */ 58 #define CF_LOADAV 0x2 /* display w/ load average */ 59 60 struct cmdtab *curcmd; 61 struct cmdtab cmdtab[]; 62 struct cmdtab *lookup(); 63 64 int kmem, mem, swap; 65 int naptime, col; 66 67 long ntext, textp; 68 struct text *xtext; 69 70 int fscale; 71 double lccpu; 72 double avenrun[3]; 73 74 char *kmemf, *memf, *swapf; 75 int hz, phz; 76 char **dr_name; 77 int dk_ndrive; 78 int *dk_select; 79 float *dk_mspw; 80 char c, *namp, hostname[MAXHOSTNAMELEN]; 81 82 int nports; 83 int nhosts; 84 int protos; 85 #define TCP 0x1 86 #define UDP 0x2 87 88 struct pte *usrpt; 89 struct pte *Usrptma; 90 91 WINDOW *wnd; 92 int CMDLINE; 93 94 char *malloc(), *calloc(), *strncpy(); 95 long getword(); 96