/* transmitted bytes packets errs drop fifo colls carrier compressed */
uint64_t rx, tx, rxp, txp;
IFINFO firstinfo;
- int i, len;
char buffer[256];
/* less than 2 seconds doesn't produce good results */
uint64_t rxtotal, txtotal, rxptotal, txptotal;
uint64_t rxpmin, txpmin, rxpmax, txpmax;
uint64_t rxmin, txmin, rxmax, txmax;
- int i, len=0;
char buffer[256], buffer2[256];
IFINFO previnfo;
printf("Monitoring %s... (press CTRL-C to stop)\n\n", iface);
if (cfg.ostyle != 4) {
printf(" getting traffic...");
- len=21; /* length of previous print */
fflush(stdout);
}
}
strncat(buffer, buffer2, 127);
- if (len>1 && cfg.ostyle!=4) {
- if (debug) {
- printf("\nlinelen: %d\n", len);
- } else {
- cursortocolumn(1);
- eraseline();
- }
+ if (cfg.ostyle!=4 || !debug) {
+ cursortocolumn(1);
+ eraseline();
}
if (cfg.ostyle!=4) {
printf("%s", buffer);
} else {
printf("%s\n", buffer);
}
- len=strlen(buffer);
-
}
timespent = (uint64_t)time(NULL) - timespent - timeslept;