summaryrefslogtreecommitdiff
path: root/agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h
blob: 98198955f102799fa47b103320bf87e5781ae5bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <linux/sockios.h>
#include <ifaddrs.h>

/* use kernel's ethtool.h  */

#include <linux/types.h>
typedef __u64 u64;
typedef __u32 u32;
typedef __u16 u16;
typedef __u8 u8;
#include <linux/ethtool.h>

/* structure for storing the interface names in the system */

struct ifname {
    struct ifname *ifn_next;
    char name [IF_NAMESIZE];
};

struct ifname *etherstats_interface_name_list_get (struct ifname *, int *);
int etherstats_interface_name_list_free (struct ifname *list_head);
int etherstats_interface_ioctl_ifindex_get (int fd, const char *name);
int _etherStats_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name);
int interface_ioctl_etherstats_get(etherStatsTable_rowreq_ctx *rowreq_ctx, int fd, const char* name);

/* for maintainability */

#define BROADCOM_RECEIVE_JABBERS                "rx_jabbers"

#define ETHERSTATSJABBERS(x)                    strstr(x, BROADCOM_RECEIVE_JABBERS)