Subject: Re: SIOCGPPPSTATS for all network i/f
To: None <tech-kern@NetBSD.ORG>
From: Matt Thomas <matt@3am-software.com>
List: tech-kern
Date: 05/23/2002 00:38:38
At 12:25 AM 5/23/2002, Martin Husemann wrote:
>Would someone mind me implementing ioctl(SIOCGPPPSTATS, ...) for all network
>interfaces?

I would rather have a different ioctl that returns the if_data
member of ifnet.  It is a much more useful item to return.

Privately, in my own sources, I have two ioctls:

#define SIOCGIFDATA _IOWR('i', xx, struct ifdatareq)
#define SIOCZIFDATA _IOWR('i', xx, struct ifdatareq)

where ifdatareq is:

struct ifdatareq {
         char ifdr_name[IFNAMSIZ];
         struct if_data ifdr_data;
};

The Z (zero) variants, resets the counters back to 0 after returning
the data.

-- 
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt/
Cupertino, CA             Disclaimer: I avow all knowledge of this message