Add IFF_DYNAMIC support for Linux.
Support in the ruby binding.
This commit is contained in:
parent
c007175b21
commit
cfae297d9b
|
@ -684,6 +684,7 @@ static void Init_rbsigar_constants(VALUE rclass)
|
||||||
RB_SIGAR_CONST_INT(IFF_MULTICAST);
|
RB_SIGAR_CONST_INT(IFF_MULTICAST);
|
||||||
RB_SIGAR_CONST_INT(IFF_SLAVE);
|
RB_SIGAR_CONST_INT(IFF_SLAVE);
|
||||||
RB_SIGAR_CONST_INT(IFF_MASTER);
|
RB_SIGAR_CONST_INT(IFF_MASTER);
|
||||||
|
RB_SIGAR_CONST_INT(IFF_DYNAMIC);
|
||||||
|
|
||||||
RB_SIGAR_CONST_INT(NETCONN_CLIENT);
|
RB_SIGAR_CONST_INT(NETCONN_CLIENT);
|
||||||
RB_SIGAR_CONST_INT(NETCONN_SERVER);
|
RB_SIGAR_CONST_INT(NETCONN_SERVER);
|
||||||
|
|
|
@ -585,6 +585,7 @@ SIGAR_DECLARE(int) sigar_net_route_list_destroy(sigar_t *sigar,
|
||||||
#define SIGAR_IFF_MULTICAST 0x800
|
#define SIGAR_IFF_MULTICAST 0x800
|
||||||
#define SIGAR_IFF_SLAVE 0x1000
|
#define SIGAR_IFF_SLAVE 0x1000
|
||||||
#define SIGAR_IFF_MASTER 0x2000
|
#define SIGAR_IFF_MASTER 0x2000
|
||||||
|
#define SIGAR_IFF_DYNAMIC 0x4000
|
||||||
|
|
||||||
#define SIGAR_NULL_HWADDR "00:00:00:00:00:00"
|
#define SIGAR_NULL_HWADDR "00:00:00:00:00:00"
|
||||||
|
|
||||||
|
|
|
@ -1551,6 +1551,7 @@ int sigar_net_interface_config_get(sigar_t *sigar, const char *name,
|
||||||
int is_mcast = flags & IFF_MULTICAST;
|
int is_mcast = flags & IFF_MULTICAST;
|
||||||
int is_slave = flags & IFF_SLAVE;
|
int is_slave = flags & IFF_SLAVE;
|
||||||
int is_master = flags & IFF_MASTER;
|
int is_master = flags & IFF_MASTER;
|
||||||
|
int is_dynamic = flags & IFF_DYNAMIC;
|
||||||
/*
|
/*
|
||||||
* XXX: should just define SIGAR_IFF_*
|
* XXX: should just define SIGAR_IFF_*
|
||||||
* and test IFF_* bits on given platform.
|
* and test IFF_* bits on given platform.
|
||||||
|
@ -1568,6 +1569,9 @@ int sigar_net_interface_config_get(sigar_t *sigar, const char *name,
|
||||||
if (is_master) {
|
if (is_master) {
|
||||||
flags |= SIGAR_IFF_MASTER;
|
flags |= SIGAR_IFF_MASTER;
|
||||||
}
|
}
|
||||||
|
if (is_dynamic) {
|
||||||
|
flags |= SIGAR_IFF_DYNAMIC;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
ifconfig->flags = flags;
|
ifconfig->flags = flags;
|
||||||
}
|
}
|
||||||
|
|
|
@ -559,6 +559,9 @@ SIGAR_DECLARE(char *) sigar_net_interface_flags_to_string(sigar_uint64_t flags,
|
||||||
if (flags & SIGAR_IFF_MASTER) {
|
if (flags & SIGAR_IFF_MASTER) {
|
||||||
strcat(buf, "MASTER ");
|
strcat(buf, "MASTER ");
|
||||||
}
|
}
|
||||||
|
if (flags & SIGAR_IFF_DYNAMIC) {
|
||||||
|
strcat(buf, "DYNAMIC ");
|
||||||
|
}
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue