prefix|scope .= 6

This commit is contained in:
Doug MacEachern 2009-07-25 08:09:53 -07:00
parent 8411da271e
commit 0da8e9d95f
7 changed files with 18 additions and 18 deletions

View File

@ -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 => '',
},
{

View File

@ -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" +

View File

@ -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());

View File

@ -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,

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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;