(SIGAR-199) add arp decls

This commit is contained in:
Doug MacEachern 2010-01-18 14:56:00 -08:00
parent 9c37813c57
commit b5cf0dbef4
2 changed files with 31 additions and 0 deletions

View File

@ -846,6 +846,26 @@ sigar_net_listen_address_get(sigar_t *sigar,
unsigned long port, unsigned long port,
sigar_net_address_t *address); sigar_net_address_t *address);
typedef struct {
char ifname[16];
char type[64];
sigar_net_address_t hwaddr;
sigar_net_address_t address;
sigar_uint64_t flags;
} sigar_arp_t;
typedef struct {
unsigned long number;
unsigned long size;
sigar_arp_t *data;
} sigar_arp_list_t;
SIGAR_DECLARE(int) sigar_arp_list_get(sigar_t *sigar,
sigar_arp_list_t *arplist);
SIGAR_DECLARE(int) sigar_arp_list_destroy(sigar_t *sigar,
sigar_arp_list_t *arplist);
typedef struct { typedef struct {
char user[32]; char user[32];
char device[32]; char device[32];

View File

@ -168,6 +168,8 @@
#define SIGAR_NET_CONNLIST_MAX 20 #define SIGAR_NET_CONNLIST_MAX 20
#define SIGAR_ARP_LIST_MAX 12
#define SIGAR_WHO_LIST_MAX 12 #define SIGAR_WHO_LIST_MAX 12
int sigar_os_open(sigar_t **sigar); int sigar_os_open(sigar_t **sigar);
@ -317,6 +319,15 @@ int sigar_net_interface_ipv6_config_get(sigar_t *sigar, const char *name,
int sigar_tcp_curr_estab(sigar_t *sigar, sigar_tcp_t *tcp); int sigar_tcp_curr_estab(sigar_t *sigar, sigar_tcp_t *tcp);
int sigar_arp_list_create(sigar_arp_list_t *arplist);
int sigar_arp_list_grow(sigar_arp_list_t *arplist);
#define SIGAR_ARP_LIST_GROW(arplist) \
if (arplist->number >= arplist->size) { \
sigar_arp_list_grow(arplist); \
}
int sigar_who_list_create(sigar_who_list_t *wholist); int sigar_who_list_create(sigar_who_list_t *wholist);
int sigar_who_list_grow(sigar_who_list_t *wholist); int sigar_who_list_grow(sigar_who_list_t *wholist);