File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / miniupnpd / mac / testgetifstats.c
Revision 1.1.1.3 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 00:32:35 2013 UTC (11 years, 5 months ago) by misho
Branches: miniupnpd, elwix, MAIN
CVS tags: v1_8p0, v1_8, HEAD
1.8

    1: /* $Id: testgetifstats.c,v 1.1.1.3 2013/07/22 00:32:35 misho Exp $ */
    2: /*
    3:  * MiniUPnP project
    4:  * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
    5:  * (c) 2009 Jardel Weyrich
    6:  * This software is subject to the conditions detailed
    7:  * in the LICENCE file provided within the distribution
    8:  */
    9: 
   10: #include <stdio.h>
   11: #include "../getifstats.h"
   12: 
   13: int main(int argc, char * * argv) {
   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: 		printf("ipackets = %10lu   opackets = %10lu\n", data.ipackets, data.opackets);
   24: 		printf("ibytes   = %10lu   obytes   = %10lu\n", data.ibytes, data.obytes);
   25: 		printf("baudrate = %10lu\n", data.baudrate);
   26: 	}
   27: 	return 0;
   28: }
   29: 

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