packages/pcsc-lite: use new service functions
[packages.git] / utils / collectd / patches / 110-net-device-stats.patch
1 ---
2  src/interface.c |   33 ++++++++++++++++++++++++++++++++-
3  1 file changed, 32 insertions(+), 1 deletion(-)
4
5 --- a/src/interface.c
6 +++ b/src/interface.c
7 @@ -203,7 +203,38 @@ static int interface_read (void)
8  #  define IFA_RX_ERROR rx_errors
9  #  define IFA_TX_ERROR tx_errors
10  #else
11 -#  error "No suitable type for `struct ifaddrs->ifa_data' found."
12 +struct net_device_stats {
13 +       unsigned long   rx_packets;
14 +       unsigned long   tx_packets;
15 +       unsigned long   rx_bytes;
16 +       unsigned long   tx_bytes;
17 +       unsigned long   rx_errors;
18 +       unsigned long   tx_errors;
19 +       unsigned long   rx_dropped;
20 +       unsigned long   tx_dropped;
21 +       unsigned long   multicast;
22 +       unsigned long   collisions;
23 +       unsigned long   rx_length_errors;
24 +       unsigned long   rx_over_errors;
25 +       unsigned long   rx_crc_errors;
26 +       unsigned long   rx_frame_errors;
27 +       unsigned long   rx_fifo_errors;
28 +       unsigned long   rx_missed_errors;
29 +       unsigned long   tx_aborted_errors;
30 +       unsigned long   tx_carrier_errors;
31 +       unsigned long   tx_fifo_errors;
32 +       unsigned long   tx_heartbeat_errors;
33 +       unsigned long   tx_window_errors;
34 +       unsigned long   rx_compressed;
35 +       unsigned long   tx_compressed;
36 +};
37 +#  define IFA_DATA net_device_stats
38 +#  define IFA_RX_BYTES rx_bytes
39 +#  define IFA_TX_BYTES tx_bytes
40 +#  define IFA_RX_PACKT rx_packets
41 +#  define IFA_TX_PACKT tx_packets
42 +#  define IFA_RX_ERROR rx_errors
43 +#  define IFA_TX_ERROR tx_errors
44  #endif
45  
46         struct IFA_DATA *if_data;