Commit | Line | Data |
---|---|---|
07ed1e09 KM |
1 | /* |
2 | * Copyright (c) 1980 Regents of the University of California. | |
3 | * All rights reserved. The Berkeley software License Agreement | |
4 | * specifies the terms and conditions for redistribution. | |
5 | * | |
e2d0fe21 | 6 | * @(#)systat.h 5.2 (Berkeley) %G% |
07ed1e09 | 7 | */ |
b50325b5 | 8 | |
833d578b SL |
9 | #include <netdb.h> |
10 | #include <nlist.h> | |
11 | #include <signal.h> | |
b50325b5 | 12 | #include <curses.h> |
b50325b5 | 13 | |
833d578b SL |
14 | #include <sys/param.h> |
15 | #include <sys/file.h> | |
e2d0fe21 | 16 | #include <sys/dkstat.h> |
833d578b SL |
17 | |
18 | #include <netinet/in.h> | |
19 | #include <arpa/inet.h> | |
20 | ||
b50325b5 SL |
21 | struct p_times { |
22 | short pt_pid; | |
23 | float pt_pctcpu; | |
24 | int pt_uid; | |
25 | int pt_paddr; | |
26 | struct proc *pt_pp; | |
27 | } *pt; | |
855ff304 KM |
28 | long nproc, procp; |
29 | struct proc *kprocp; | |
b50325b5 SL |
30 | |
31 | struct procs { | |
32 | int pid; | |
33 | char cmd[16]; | |
34 | } procs[200]; | |
35 | int numprocs; | |
36 | ||
37 | struct users { | |
38 | int k_uid; | |
39 | char k_name[16]; | |
40 | } known[30]; | |
855ff304 | 41 | int numknown; |
b50325b5 | 42 | |
d830bff6 SL |
43 | struct cmdtab { |
44 | char *c_name; /* command name */ | |
45 | int (*c_refresh)(); /* display refresh */ | |
46 | int (*c_fetch)(); /* sets up data structures */ | |
47 | int (*c_label)(); /* label display */ | |
48 | int (*c_init)(); /* initialize namelist, etc. */ | |
49 | WINDOW *(*c_open)(); /* open display */ | |
50 | int (*c_close)(); /* close display */ | |
855ff304 | 51 | int (*c_cmd)(); /* display command interpreter */ |
9c0c7319 | 52 | char c_flags; /* see below */ |
d830bff6 SL |
53 | }; |
54 | ||
9c0c7319 SL |
55 | #define CF_INIT 0x1 /* been initialized */ |
56 | #define CF_LOADAV 0x2 /* display w/ load average */ | |
57 | ||
d830bff6 SL |
58 | struct cmdtab *curcmd; |
59 | struct cmdtab cmdtab[]; | |
4fefc2e5 | 60 | struct cmdtab *lookup(); |
d830bff6 | 61 | |
855ff304 KM |
62 | int kmem, mem, swap; |
63 | int naptime, col; | |
64 | ||
65 | long ntext, textp; | |
d830bff6 | 66 | struct text *xtext; |
855ff304 | 67 | |
b50325b5 | 68 | double lccpu; |
9c0c7319 | 69 | double avenrun[3]; |
855ff304 KM |
70 | |
71 | char *kmemf, *memf, *swapf; | |
833d578b SL |
72 | int hz, phz; |
73 | char **dr_name; | |
74 | int dk_ndrive; | |
75 | int *dk_select; | |
76 | float *dk_mspw; | |
855ff304 KM |
77 | char c, *namp, hostname[32]; |
78 | ||
833d578b SL |
79 | int nports; |
80 | int nhosts; | |
81 | int protos; | |
82 | #define TCP 0x1 | |
83 | #define UDP 0x2 | |
84 | ||
b50325b5 SL |
85 | struct pte *usrpt; |
86 | struct pte *Usrptma; | |
87 | ||
88 | WINDOW *wnd; | |
855ff304 KM |
89 | int CMDLINE; |
90 | ||
91 | char *malloc(), *calloc(), *strncpy(); | |
92 | long getw(); |