File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / miniupnpd / bsd / testgetifstats.c
Revision 1.1.1.2 (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: /* MiniUPnP project
    2:  * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
    3:  * (c) 2006 Thomas Bernard
    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>