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