decls for sigar_who

This commit is contained in:
Doug MacEachern 2005-02-22 01:50:16 +00:00
parent 4b309f0088
commit 182bd26065
2 changed files with 30 additions and 0 deletions

View File

@ -493,6 +493,25 @@ sigar_net_connection_list_destroy(sigar_t *sigar,
SIGAR_DECLARE(const char *)sigar_net_connection_type_get(int type);
typedef struct {
char user[32];
char device[32];
char host[256];
sigar_uint64_t time;
} sigar_who_t;
typedef struct {
unsigned long number;
unsigned long size;
sigar_who_t *data;
} sigar_who_list_t;
SIGAR_DECLARE(int) sigar_who_list_get(sigar_t *sigar,
sigar_who_list_t *wholist);
SIGAR_DECLARE(int) sigar_who_list_destroy(sigar_t *sigar,
sigar_who_list_t *wholist);
SIGAR_DECLARE(int) sigar_proc_port_get(sigar_t *sigar, unsigned long port,
sigar_pid_t *pid);

View File

@ -81,6 +81,8 @@
#define SIGAR_NET_CONNLIST_MAX 20
#define SIGAR_WHO_LIST_MAX 12
int sigar_os_open(sigar_t **sigar);
int sigar_os_close(sigar_t *sigar);
@ -168,6 +170,15 @@ int sigar_net_connection_list_grow(sigar_net_connection_list_t *connlist);
sigar_net_connection_list_grow(connlist); \
}
int sigar_who_list_create(sigar_who_list_t *wholist);
int sigar_who_list_grow(sigar_who_list_t *wholist);
#define SIGAR_WHO_LIST_GROW(wholist) \
if (wholist->number >= wholist->size) { \
sigar_who_list_grow(wholist); \
}
void sigar_hwaddr_format(char *buff, unsigned char *ptr);
#define sigar_hwaddr_set_null(ifconfig) \