{0, 0, 0, 0}
};
char *line, *com[MAXCOM];
- const char *iface = "eth0", *password = NULL;
+ const char *iface = NULL, *password = NULL;
float timeout = 0.f;
bool kb = false, force = false, global = true;
struct timeval tv;
printf("unknown trailing options\n");
goto end;
}
-
+
+ if (iface == NULL)
+ {
+ fprintf(stderr, "no interface specified (-i), defaulting to eth0\n");
+ iface = "eth0";
+ }
memset(com, 0, MAXCOM * sizeof(char*));
nga = ngadmin_init(iface);
if (nga == NULL) {
- fprintf(stderr, "initialization error\n");
+ fprintf(stderr, "initialization error (bad interface ?)\n");
goto end;
}
goto end;
}
- printf("Port\tReceived\tSent\tCRC errors\n");
+ printf("Port Received Sent CRC errors\n");
for (i = 0; i < sa->ports; i++)
- printf("% 4i%12llu%12llu%14llu\n", i + 1, ps[i].recv, ps[i].sent, ps[i].crc);
+ printf("% 4i%21llu%21llu%21llu\n", i + 1, ps[i].recv, ps[i].sent, ps[i].crc);
end:
free(ps);