Subject: Re: interface byte/packet counter size
To: None <netbsd-users@netbsd.org>
From: None <xs@kittenz.org>
List: netbsd-users
Date: 02/05/2002 20:55:14
on Tue, Feb 05, 2002 at 09:42:31PM +0100, Wojciech Puchar wrote:
> are they int or long?

Neither.

/sys/net/if.h:
...
/*
 * Structure defining statistics and other data kept regarding a network
 * interface.
 */
struct if_data {
...
        /* volatile statistics */
        u_quad_t ifi_ipackets;          /* packets received on interface */
        u_quad_t ifi_ierrors;           /* input errors on interface */
        u_quad_t ifi_opackets;          /* packets sent on interface */
        u_quad_t ifi_oerrors;           /* output errors on interface */
        u_quad_t ifi_collisions;        /* collisions on csma interfaces */
        u_quad_t ifi_ibytes;            /* total number of octets received */
        u_quad_t ifi_obytes;            /* total number of octets sent */
        u_quad_t ifi_imcasts;           /* packets received via multicast */
        u_quad_t ifi_omcasts;           /* packets sent via multicast */
        u_quad_t ifi_iqdrops;           /* dropped on input, this interface */
        u_quad_t ifi_noproto;           /* destined for unsupported protocol */
...

/usr/include/sys/types.h:
typedef        u_quad_t        u_longlong_t;   /* ANSI unsigned long long type */