Patrick Venture | d26fff4 | 2018-09-18 15:37:59 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <cstdint> |
| 4 | |
| 5 | namespace ethstats |
| 6 | { |
| 7 | |
| 8 | /** |
| 9 | * @brief Ethstat Request structure. |
| 10 | */ |
| 11 | struct EthStatRequest |
| 12 | { |
| 13 | uint8_t statId; |
| 14 | uint8_t if_name_len; |
| 15 | uint8_t if_name[0]; |
| 16 | } __attribute__((packed)); |
| 17 | |
| 18 | /** |
| 19 | * @brief Ethstat Reply structure. |
| 20 | */ |
| 21 | struct EthStatReply |
| 22 | { |
| 23 | uint8_t statId; |
| 24 | uint64_t value; |
| 25 | } __attribute__((packed)); |
| 26 | |
| 27 | enum EthernetStatisticsIds |
| 28 | { |
| 29 | RX_BYTES = 0, |
| 30 | RX_COMPRESSED = 1, |
| 31 | RX_CRC_ERRORS = 2, |
| 32 | RX_DROPPED = 3, |
| 33 | RX_ERRORS = 4, |
| 34 | RX_FIFO_ERRORS = 5, |
| 35 | RX_FRAME_ERRORS = 6, |
| 36 | RX_LENGTH_ERRORS = 7, |
| 37 | RX_MISSED_ERRORS = 8, |
| 38 | RX_NOHANDLER = 9, |
| 39 | RX_OVER_ERRORS = 10, |
| 40 | RX_PACKETS = 11, |
| 41 | TX_ABORTED_ERRORS = 12, |
| 42 | TX_BYTES = 13, |
| 43 | TX_CARRIER_ERRORS = 14, |
| 44 | TX_COMPRESSED = 15, |
| 45 | TX_DROPPED = 16, |
| 46 | TX_ERRORS = 17, |
| 47 | TX_FIFO_ERRORS = 18, |
| 48 | TX_HEARTBEAT_ERRORS = 19, |
| 49 | TX_PACKETS = 20, |
| 50 | TX_WINDOW_ERRORS = 21, |
| 51 | }; |
| 52 | |
| 53 | } // namespace ethstats |