Annotation of embedaddon/miniupnpd/bsd/testgetifstats.c, revision 1.1.1.2

1.1       misho       1: /* MiniUPnP project
                      2:  * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
1.1.1.2 ! misho       3:  * (c) 2006 Thomas Bernard
1.1       misho       4:  * This software is subject to the conditions detailed
                      5:  * in the LICENCE file provided within the distribution */
                      6: 
                      7: #include <stdio.h>
                      8: 
                      9: #include "../getifstats.h"
                     10: 
                     11: int
                     12: main(int argc, char * * argv)
                     13: {
                     14:        int r;
                     15:        struct ifdata data;
                     16:        printf("usage: %s if_name\n", argv[0]);
                     17:        if(argc<2)
                     18:                return -1;
                     19:        r = getifstats(argv[1], &data);
                     20:        if(r<0)
                     21:                printf("getifstats() failed\n");
                     22:        else
                     23:        {
                     24:                printf("ipackets = %10lu   opackets = %10lu\n",
                     25:                       data.ipackets, data.opackets);
                     26:                printf("ibytes =   %10lu   obytes =   %10lu\n",
                     27:                       data.ibytes, data.obytes);
                     28:                printf("baudrate = %10lu\n", data.baudrate);
                     29:        }
                     30:        return 0;
                     31: }
                     32: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>