|
|
| version 1.4, 2003/10/04 20:36:51 | version 1.5, 2004/04/07 21:40:19 |
|---|---|
| Line 56 | Line 56 |
| #include "extern.h" | #include "extern.h" |
| #include "mode.h" | #include "mode.h" |
| static struct tcpstat curstat, initstat, oldstat; | static struct tcp_stats curstat, initstat, oldstat; |
| /*- | /*- |
| --0 1 2 3 4 5 6 7 | --0 1 2 3 4 5 6 7 |
| Line 130 labeltcp(void) | Line 130 labeltcp(void) |
| } | } |
| static void | static void |
| domode(struct tcpstat *ret) | domode(struct tcp_stats *ret) |
| { | { |
| const struct tcpstat *sub; | const struct tcp_stats *sub; |
| double divisor = 1.0; | double divisor = 1.0; |
| switch(currentmode) { | switch(currentmode) { |
| Line 219 domode(struct tcpstat *ret) | Line 219 domode(struct tcpstat *ret) |
| void | void |
| showtcp(void) | showtcp(void) |
| { | { |
| struct tcpstat stats; | struct tcp_stats stats; |
| memset(&stats, 0, sizeof stats); | memset(&stats, 0, sizeof stats); |
| domode(&stats); | domode(&stats); |
| Line 264 inittcp(void) | Line 264 inittcp(void) |
| len = 0; | len = 0; |
| if (sysctl(name, 4, 0, &len, 0, 0) < 0) { | if (sysctl(name, 4, 0, &len, 0, 0) < 0) { |
| error("sysctl getting tcpstat size failed"); | error("sysctl getting tcp_stats size failed"); |
| return 0; | return 0; |
| } | } |
| if (len > sizeof curstat) { | if (len > sizeof curstat) { |
| error("tcpstat structure has grown--recompile systat!"); | error("tcp_stats structure has grown--recompile systat!"); |
| return 0; | return 0; |
| } | } |
| if (sysctl(name, 4, &initstat, &len, 0, 0) < 0) { | if (sysctl(name, 4, &initstat, &len, 0, 0) < 0) { |
| error("sysctl getting tcpstat failed"); | error("sysctl getting tcp_stats failed"); |
| return 0; | return 0; |
| } | } |
| oldstat = initstat; | oldstat = initstat; |
| Line 292 resettcp(void) | Line 292 resettcp(void) |
| len = sizeof initstat; | len = sizeof initstat; |
| if (sysctl(name, 4, &initstat, &len, 0, 0) < 0) { | if (sysctl(name, 4, &initstat, &len, 0, 0) < 0) { |
| error("sysctl getting tcpstat failed"); | error("sysctl getting tcp_stats failed"); |
| } | } |
| oldstat = initstat; | oldstat = initstat; |
| } | } |