diff options
| author | Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> | 2003-07-25 00:28:37 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2003-07-25 00:28:37 -0700 |
| commit | 3335c2bae5aba76d177ee82192ad91e10213f72a (patch) | |
| tree | 088f1a3e0645e7a90ba48d9fc7cbb959141c2801 /include | |
| parent | 458ad9d232c86ccea4fb310e6c1fb5d6133b42ec (diff) | |
[NET]: Make IFLA_STATS arch independent.
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/rtnetlink.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index fe336b23e5cb..3e3a26916a12 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -459,6 +459,40 @@ struct ifinfomsg unsigned ifi_change; /* IFF_* change mask */ }; +/* The struct should be in sync with struct net_device_stats */ +struct rtnl_link_stats +{ + __u32 rx_packets; /* total packets received */ + __u32 tx_packets; /* total packets transmitted */ + __u32 rx_bytes; /* total bytes received */ + __u32 tx_bytes; /* total bytes transmitted */ + __u32 rx_errors; /* bad packets received */ + __u32 tx_errors; /* packet transmit problems */ + __u32 rx_dropped; /* no space in linux buffers */ + __u32 tx_dropped; /* no space available in linux */ + __u32 multicast; /* multicast packets received */ + __u32 collisions; + + /* detailed rx_errors: */ + __u32 rx_length_errors; + __u32 rx_over_errors; /* receiver ring buff overflow */ + __u32 rx_crc_errors; /* recved pkt with crc error */ + __u32 rx_frame_errors; /* recv'd frame alignment error */ + __u32 rx_fifo_errors; /* recv'r fifo overrun */ + __u32 rx_missed_errors; /* receiver missed packet */ + + /* detailed tx_errors */ + __u32 tx_aborted_errors; + __u32 tx_carrier_errors; + __u32 tx_fifo_errors; + __u32 tx_heartbeat_errors; + __u32 tx_window_errors; + + /* for cslip etc */ + __u32 rx_compressed; + __u32 tx_compressed; +}; + enum { IFLA_UNSPEC, @@ -600,6 +634,22 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi ({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \ __rta_fill(skb, attrtype, attrlen, data); }) +static inline struct rtattr * +__rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) +{ + struct rtattr *rta; + int size = RTA_LENGTH(attrlen); + + rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size)); + rta->rta_type = attrtype; + rta->rta_len = size; + return rta; +} + +#define __RTA_PUT(skb, attrtype, attrlen) \ +({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \ + __rta_reserve(skb, attrtype, attrlen); }) + extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); extern struct semaphore rtnl_sem; |
