Subject: SIOCGPPPSTATS for all network i/f
To: None <tech-kern@NetBSD.ORG>
From: Martin Husemann <>
List: tech-kern
Date: 05/23/2002 09:25:47
Would someone mind me implementing ioctl(SIOCGPPPSTATS, ...) for all network

It fills in a 

struct ppp_stats {
    struct pppstat p;           /* basic PPP statistics */
    struct vjstat vj;           /* VJ header compression statistics */

where the vj part is meaningless for non-VJ-compressing interfaces, but
the struct pppstat part is completely independent of PPP:

struct pppstat  { 
    unsigned int ppp_ibytes;    /* bytes received */
    unsigned int ppp_ipackets;  /* packets received */
    unsigned int ppp_ierrors;   /* receive errors */
    unsigned int ppp_obytes;    /* bytes sent */
    unsigned int ppp_opackets;  /* packets sent */
    unsigned int ppp_oerrors;   /* transmit errors */

This would allow utilities like pkgsrc/net/{wm}pload to work on anything
(including in-kernel PPPoE, which is how I came around this)