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 (10 years, 10 months ago) by misho
Branches: miniupnpd, elwix, MAIN
CVS tags: v1_8p0, v1_8, HEAD
1.8

/* $Id: testgetifstats.c,v 1.1.1.3 2013/07/22 00:32:35 misho Exp $ */
/*
 * MiniUPnP project
 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
 * (c) 2009 Jardel Weyrich
 * This software is subject to the conditions detailed
 * in the LICENCE file provided within the distribution
 */

#include <stdio.h>
#include "../getifstats.h"

int main(int argc, char * * argv) {
	int r;
	struct ifdata data;
	printf("usage: %s if_name\n", argv[0]);
	if (argc < 2)
		return -1;
	r = getifstats(argv[1], &data);
	if (r < 0)
		printf("getifstats() failed\n");
	else {
		printf("ipackets = %10lu   opackets = %10lu\n", data.ipackets, data.opackets);
		printf("ibytes   = %10lu   obytes   = %10lu\n", data.ibytes, data.obytes);
		printf("baudrate = %10lu\n", data.baudrate);
	}
	return 0;
}


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