Annotation of embedaddon/miniupnpd/mac/testgetifstats.c, revision 1.1.1.1

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

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