1 #ifndef __LINUX_IF_LINK_WRAPPER_H
2 #define __LINUX_IF_LINK_WRAPPER_H 1
4 #include <linux/version.h>
6 #ifdef HAVE_RTNL_LINK_STATS64
7 #include_next <linux/if_link.h>
8 #else /* !HAVE_RTNL_LINK_STATS64 */
10 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
11 #include_next <linux/if_link.h>
13 /* Before 2.6.19 there was no <linux/if_link.h>. Instead all of the types now
14 * declared there were in <linux/if.h>. Unfortunately <linux/if.h> from 2.6.18
15 * conflicts badly enough with <net/if.h> to break the userspace build. All
16 * we really need from <linux/if_link.h> is struct rtnl_link_stats64, which in
17 * turn only really needs __u64. */
18 #include <linux/types.h>
19 #include <linux/netlink.h>
20 #endif /* kernel < 2.6.19 */
22 /* The main device statistics structure */
23 struct rtnl_link_stats64 {
24 __u64 rx_packets; /* total packets received */
25 __u64 tx_packets; /* total packets transmitted */
26 __u64 rx_bytes; /* total bytes received */
27 __u64 tx_bytes; /* total bytes transmitted */
28 __u64 rx_errors; /* bad packets received */
29 __u64 tx_errors; /* packet transmit problems */
30 __u64 rx_dropped; /* no space in linux buffers */
31 __u64 tx_dropped; /* no space available in linux */
32 __u64 multicast; /* multicast packets received */
35 /* detailed rx_errors: */
36 __u64 rx_length_errors;
37 __u64 rx_over_errors; /* receiver ring buff overflow */
38 __u64 rx_crc_errors; /* recved pkt with crc error */
39 __u64 rx_frame_errors; /* recv'd frame alignment error */
40 __u64 rx_fifo_errors; /* recv'r fifo overrun */
41 __u64 rx_missed_errors; /* receiver missed packet */
43 /* detailed tx_errors */
44 __u64 tx_aborted_errors;
45 __u64 tx_carrier_errors;
47 __u64 tx_heartbeat_errors;
48 __u64 tx_window_errors;
54 #endif /* !HAVE_RTNL_LINK_STATS64 */