363 |
|
"net", name, "tx", NULL); |
364 |
|
add_stat(LONG_LONG, &net[i].rx, |
365 |
|
"net", name, "rx", NULL); |
366 |
+ |
add_stat(LONG_LONG, &net[i].ipackets, |
367 |
+ |
"net", name, "ipackets", NULL); |
368 |
+ |
add_stat(LONG_LONG, &net[i].opackets, |
369 |
+ |
"net", name, "opackets", NULL); |
370 |
+ |
add_stat(LONG_LONG, &net[i].ierrors, |
371 |
+ |
"net", name, "ierrors", NULL); |
372 |
+ |
add_stat(LONG_LONG, &net[i].oerrors, |
373 |
+ |
"net", name, "oerrors", NULL); |
374 |
+ |
add_stat(LONG_LONG, &net[i].collisions, |
375 |
+ |
"net", name, "collisions", NULL); |
376 |
|
add_stat(TIME_T, &net[i].systime, |
377 |
|
"net", name, "systime", NULL); |
378 |
|
} |
466 |
|
/* Print the value of a stat. */ |
467 |
|
void print_stat_value(const stat *s) { |
468 |
|
void *v = s->stat; |
469 |
+ |
long l; |
470 |
|
|
471 |
|
switch (s->type) { |
472 |
|
case LONG_LONG: |
474 |
|
break; |
475 |
|
case TIME_T: |
476 |
|
/* FIXME option for formatted time? */ |
477 |
< |
printf("%ld", *(time_t *)v); |
477 |
> |
l = *(time_t *)v; |
478 |
> |
printf("%ld", l); |
479 |
|
break; |
480 |
|
case FLOAT: |
481 |
|
printf("%f", *(float *)v); |