prefix|scope .= 6
This commit is contained in:
parent
8411da271e
commit
0da8e9d95f
|
@ -1044,11 +1044,11 @@ use vars qw(%classes %cmds);
|
|||
desc => '',
|
||||
},
|
||||
{
|
||||
name => 'prefix_length', type => 'Int',
|
||||
name => 'prefix6_length', type => 'Int',
|
||||
desc => '',
|
||||
},
|
||||
{
|
||||
name => 'scope', type => 'Int',
|
||||
name => 'scope6', type => 'Int',
|
||||
desc => '',
|
||||
},
|
||||
{
|
||||
|
|
|
@ -117,11 +117,11 @@ public class Ifconfig extends SigarCommandBase {
|
|||
bcast +
|
||||
" Mask:" + ifconfig.getNetmask());
|
||||
|
||||
if (ifconfig.getPrefixLength() != 0) {
|
||||
if (ifconfig.getPrefix6Length() != 0) {
|
||||
println("\t" +
|
||||
"inet6 addr: " + ifconfig.getAddress6() + "/" +
|
||||
ifconfig.getPrefixLength() +
|
||||
" Scope:" + ifconfig.getScope());
|
||||
ifconfig.getPrefix6Length() +
|
||||
" Scope:" + ifconfig.getScope6());
|
||||
}
|
||||
|
||||
println("\t" +
|
||||
|
|
|
@ -47,7 +47,7 @@ public class TestNetIf extends SigarTestCase {
|
|||
assertTrueTrace("Address", ifconfig.getAddress());
|
||||
assertTrueTrace("Netmask", ifconfig.getNetmask());
|
||||
|
||||
if (ifconfig.getPrefixLength() != 0) {
|
||||
if (ifconfig.getPrefix6Length() != 0) {
|
||||
assertTrueTrace("Address6", ifconfig.getAddress6());
|
||||
InetAddress in6 =
|
||||
InetAddress.getByName(ifconfig.getAddress6());
|
||||
|
|
|
@ -606,8 +606,8 @@ typedef struct {
|
|||
sigar_net_address_t broadcast;
|
||||
sigar_net_address_t netmask;
|
||||
sigar_net_address_t address6;
|
||||
int prefix_length;
|
||||
int scope;
|
||||
int prefix6_length;
|
||||
int scope6;
|
||||
sigar_uint64_t
|
||||
flags,
|
||||
mtu,
|
||||
|
|
|
@ -296,8 +296,8 @@ int sigar_net_interface_ipv6_config_get(sigar_t *sigar, const char *name,
|
|||
|
||||
#define sigar_net_interface_ipv6_config_init(ifconfig) \
|
||||
ifconfig->address6.family = SIGAR_AF_INET6; \
|
||||
ifconfig->prefix_length = 0; \
|
||||
ifconfig->scope = 0
|
||||
ifconfig->prefix6_length = 0; \
|
||||
ifconfig->scope6 = 0
|
||||
|
||||
int sigar_tcp_curr_estab(sigar_t *sigar, sigar_tcp_t *tcp);
|
||||
|
||||
|
|
|
@ -2656,22 +2656,22 @@ int sigar_net_interface_ipv6_config_get(sigar_t *sigar, const char *name,
|
|||
|
||||
sigar_net_address6_set(ifconfig->address6, addr);
|
||||
|
||||
ifconfig->prefix_length = sigar_in6_prefixlen(ifa->ifa_netmask);
|
||||
ifconfig->prefix6_length = sigar_in6_prefixlen(ifa->ifa_netmask);
|
||||
|
||||
if (IN6_IS_ADDR_LINKLOCAL(addr)) {
|
||||
ifconfig->scope = SIGAR_IPV6_ADDR_LINKLOCAL;
|
||||
ifconfig->scope6 = SIGAR_IPV6_ADDR_LINKLOCAL;
|
||||
}
|
||||
else if (IN6_IS_ADDR_SITELOCAL(addr)) {
|
||||
ifconfig->scope = SIGAR_IPV6_ADDR_SITELOCAL;
|
||||
ifconfig->scope6 = SIGAR_IPV6_ADDR_SITELOCAL;
|
||||
}
|
||||
else if (IN6_IS_ADDR_V4COMPAT(addr)) {
|
||||
ifconfig->scope = SIGAR_IPV6_ADDR_COMPATv4;
|
||||
ifconfig->scope6 = SIGAR_IPV6_ADDR_COMPATv4;
|
||||
}
|
||||
else if (IN6_IS_ADDR_LOOPBACK(addr)) {
|
||||
ifconfig->scope = SIGAR_IPV6_ADDR_LOOPBACK;
|
||||
ifconfig->scope6 = SIGAR_IPV6_ADDR_LOOPBACK;
|
||||
}
|
||||
else {
|
||||
ifconfig->scope = SIGAR_IPV6_ADDR_ANY;
|
||||
ifconfig->scope6 = SIGAR_IPV6_ADDR_ANY;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2124,8 +2124,8 @@ int sigar_net_interface_ipv6_config_get(sigar_t *sigar, const char *name,
|
|||
addr6[i] = (unsigned char)hex2int(ptr, 2);
|
||||
}
|
||||
|
||||
ifconfig->prefix_length = prefix;
|
||||
ifconfig->scope = scope;
|
||||
ifconfig->prefix6_length = prefix;
|
||||
ifconfig->scope6 = scope;
|
||||
}
|
||||
|
||||
return status;
|
||||
|
|
Loading…
Reference in New Issue