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