]> git.sur5r.net Git - ngadmin/commitdiff
Merge remote-tracking branch 'upstream/master' master
authorAlkorin <github@alkorin.fr>
Wed, 5 Oct 2016 18:00:33 +0000 (20:00 +0200)
committerAlkorin <github@alkorin.fr>
Wed, 5 Oct 2016 18:00:33 +0000 (20:00 +0200)
README
autogen.sh [new file with mode: 0755]
cli/src/admin.c
cli/src/com_ports.c

diff --git a/README b/README
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b6d0da5ba1f5a6828d84058968070ff853dc2762 100644 (file)
--- 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 (executable)
index 0000000..427394a
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+autoreconf -fiv
+rm -Rf autom4te.cache
index 62e366f8a737695bb4218723871c0d0159660742..d017aca3bbf6fd714b1e8c61ca54fd313f0bd483 100644 (file)
@@ -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;
        }
        
index fc497721e53c1dfe98f56c7b101699bf88dbb588..b82cf5871c0df0a533de36f9939f160351ce3cb5 100644 (file)
@@ -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);