| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#ifndef _NETINFO_PRIVATE_H |
| 18 |
#define _NETINFO_PRIVATE_H |
| 19 |
|
| 20 |
#include <regex.h> |
| 21 |
#include "netinfo.h" |
| 22 |
|
| 23 |
#ifdef __cplusplus |
| 24 |
extern "C" |
| 25 |
{ |
| 26 |
#endif |
| 27 |
|
| 28 |
typedef struct ifstats |
| 29 |
{ |
| 30 |
unsigned int tx_packets; |
| 31 |
unsigned int rx_packets; |
| 32 |
unsigned int tx_bytes; |
| 33 |
unsigned int rx_bytes; |
| 34 |
unsigned int tx_errors; |
| 35 |
unsigned int rx_errors; |
| 36 |
unsigned int tx_dropped; |
| 37 |
unsigned int rx_dropped; |
| 38 |
unsigned int collisions; |
| 39 |
unsigned int multicast; |
| 40 |
} ifstats_t; |
| 41 |
|
| 42 |
typedef struct iflist |
| 43 |
{ |
| 44 |
char *ifname; |
| 45 |
uint8_t duplex; |
| 46 |
uint32_t speed; |
| 47 |
unsigned int flags; |
| 48 |
struct ifstats *stats; |
| 49 |
struct iflist *next; |
| 50 |
} iflist_t; |
| 51 |
|
| 52 |
struct iflist *get_netinfo_snapshot (unsigned int options, |
| 53 |
const regex_t *iface_regex); |
| 54 |
|
| 55 |
#ifdef __cplusplus |
| 56 |
} |
| 57 |
#endif |
| 58 |
|
| 59 |
#endif |