use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix in project lispflowmapping by opendaylight.
the class Ipv6PrefixSerializer method serializeData.
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
Ipv6Prefix prefix = (Ipv6Prefix) lispAddress.getAddress();
String address = MaskUtil.getAddressStringForIpv6Prefix(prefix);
buffer.put(InetAddresses.forString(address).getAddress());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix in project lispflowmapping by opendaylight.
the class Ipv6PrefixSerializer method deserializeData.
private static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix deserializeData(ByteBuffer buffer, LispAddressSerializerContext ctx) {
byte[] ipBuffer = new byte[16];
InetAddress address = null;
buffer.get(ipBuffer);
try {
address = InetAddress.getByAddress(ipBuffer);
} catch (UnknownHostException e) {
LOG.debug("Unknown host {}", ipBuffer, e);
}
return new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix(address.getHostAddress() + "/" + ctx.getMaskLen());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix in project lispflowmapping by opendaylight.
the class MappingMergeUtil method getIpPrefix.
private static IpPrefix getIpPrefix(Address address) {
IpPrefix ipPrefix = null;
if (address instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Prefix) {
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Prefix lispPrefix = (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Prefix) address;
Ipv4Prefix inetPrefix = new Ipv4Prefix(lispPrefix.getIpv4Prefix());
ipPrefix = new IpPrefix(inetPrefix);
} else if (address instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Prefix) {
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Prefix lispPrefix = (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Prefix) address;
Ipv6Prefix inetPrefix = new Ipv6Prefix(lispPrefix.getIpv6Prefix());
ipPrefix = new IpPrefix(inetPrefix);
} else {
LOG.warn("Southbound mapping address is not an IpPrefix");
}
return ipPrefix;
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix in project lispflowmapping by opendaylight.
the class MappingServiceShell method addDefaultKeyIPv6.
@Override
public void addDefaultKeyIPv6() {
Eid eid = LispAddressUtil.toEid(new Ipv6Prefix("::0/0"), null);
MappingAuthkey key = new MappingAuthkeyBuilder().setKeyType(1).setKeyString("password").build();
mappingService.addAuthenticationKey(eid, key);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix in project genius by opendaylight.
the class ActionSetSourceIpv6Test method actionInfoTest.
@Test
public void actionInfoTest() {
verifyAction(new ActionSetSourceIpv6(IP_ADDRESS).buildAction());
verifyAction(new ActionSetSourceIpv6(IP_ADDRESS, IP_MASK).buildAction());
verifyAction(new ActionSetSourceIpv6(new Ipv6Prefix(IP_ADDRESS + "/" + IP_MASK)).buildAction());
}
Aggregations