You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3 KiB

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