version 1.4, 2006/01/10 23:29:41 |
version 1.5, 2006/03/31 04:10:59 |
|
|
#include <net/route.h> |
#include <net/route.h> |
|
|
#include <stdlib.h> |
#include <stdlib.h> |
|
#include <string.h> |
|
|
#include "systat.h" |
#include "systat.h" |
#include "extern.h" |
#include "extern.h" |
|
|
} *ifstats; |
} *ifstats; |
|
|
static int nifs = 0; |
static int nifs = 0; |
extern int naptime; |
extern u_int naptime; |
|
|
WINDOW * |
WINDOW * |
openifstat(void) |
openifstat(void) |
|
|
struct sockaddr *info[RTAX_MAX]; |
struct sockaddr *info[RTAX_MAX]; |
struct sockaddr_dl *sdl; |
struct sockaddr_dl *sdl; |
char *buf, *next, *lim; |
char *buf, *next, *lim; |
int mib[6], i; |
int mib[6]; |
size_t need; |
size_t need; |
|
|
mib[0] = CTL_NET; |
mib[0] = CTL_NET; |
|
|
labelifstat(void) |
labelifstat(void) |
{ |
{ |
|
|
wmove(wnd, 0, 0); wclrtobot(wnd); |
wmove(wnd, 0, 0); |
|
wclrtobot(wnd); |
|
|
mvwaddstr(wnd, 1, INSET, "Interfaces"); |
mvwaddstr(wnd, 1, INSET, "Interfaces"); |
mvwaddstr(wnd, 1, INSET+15, "Ibytes"); |
mvwaddstr(wnd, 1, INSET+15, "Ibytes"); |
|
|
struct ifstat *ifs; |
struct ifstat *ifs; |
|
|
row = 2; |
row = 2; |
wmove(wnd, 0, 0); wclrtoeol(wnd); |
wmove(wnd, 0, 0); |
|
wclrtoeol(wnd); |
for (ifs = ifstats; ifs < ifstats + nifs; ifs++) { |
for (ifs = ifstats; ifs < ifstats + nifs; ifs++) { |
if (ifs->ifs_name[0] == '\0') |
if (ifs->ifs_name[0] == '\0') |
continue; |
continue; |