From: Alkorin Date: Wed, 5 Oct 2016 18:00:33 +0000 (+0200) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;hp=65d89de5956fcc53017719eddc3f4a6a1c38a2c2;p=ngadmin Merge remote-tracking branch 'upstream/master' --- diff --git a/README b/README index e69de29..b6d0da5 100644 --- a/README +++ b/README @@ -0,0 +1,7 @@ +./autogen.sh +./configure +make +sudo make install +sudo ldconfig +man ngcli +ngcli diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..427394a --- /dev/null +++ b/autogen.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +autoreconf -fiv +rm -Rf autom4te.cache diff --git a/cli/src/admin.c b/cli/src/admin.c index 62e366f..d017aca 100644 --- a/cli/src/admin.c +++ b/cli/src/admin.c @@ -208,7 +208,7 @@ int main (int argc, char **argv) {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; @@ -287,13 +287,18 @@ int main (int argc, char **argv) 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; } diff --git a/cli/src/com_ports.c b/cli/src/com_ports.c index fc49772..b82cf58 100644 --- a/cli/src/com_ports.c +++ b/cli/src/com_ports.c @@ -91,9 +91,9 @@ int do_ports_statistics_show (int argc, const char **argv UNUSED, struct ngadmin 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);