use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address in project bgpcep by opendaylight.
the class AttributesEqualTests method testNextHopIn.
@Test
public void testNextHopIn() {
Statement statement = this.basicStatements.stream().filter(st -> st.getName().equals("nexthop-in-test")).findFirst().get();
RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().setCNextHop(new Ipv6NextHopCaseBuilder().setIpv6NextHop(new Ipv6NextHopBuilder().setGlobal(new Ipv6Address("2001:db8::1")).build()).build()).build());
RouteAttributeContainer result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertNotNull(result.getAttributes());
attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().setCNextHop(new Ipv4NextHopCaseBuilder().setIpv4NextHop(new Ipv4NextHopBuilder().setGlobal(new Ipv4Address("42.42.42.42")).build()).build()).build());
result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertNull(result.getAttributes());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address in project bgpcep by opendaylight.
the class PCEPObjectParserTest method testPceIdIPv6Object.
@Test
public void testPceIdIPv6Object() throws PCEPDeserializerException {
final byte[] pccIdReqBytes = { /* object header */
0x19, 0x20, 0x00, 0x14, /* ipv6 header */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
final PCEPPceIdIPv6ObjectParser parser = new PCEPPceIdIPv6ObjectParser();
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pce.id.object.PceId pccIdReq = new PceIdBuilder().setIpAddress(new IpAddress(new Ipv6Address("::1"))).build();
final ByteBuf result = Unpooled.wrappedBuffer(pccIdReqBytes);
assertEquals(pccIdReq, parser.parseObject(new ObjectHeaderImpl(false, false), result.slice(4, result.readableBytes() - 4)));
final ByteBuf buf = Unpooled.buffer(pccIdReqBytes.length);
parser.serializeObject(pccIdReq, buf);
assertArrayEquals(pccIdReqBytes, buf.array());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address in project bgpcep by opendaylight.
the class IPAddressesAndPrefixesTest method testInetAddressToIpAddress.
@Test
public void testInetAddressToIpAddress() {
final IpAddress ipAddress = Ipv4Util.getIpAddress(InetAddresses.forString("123.42.13.8"));
Assert.assertNotNull(ipAddress.getIpv4Address());
Assert.assertEquals(new Ipv4Address("123.42.13.8"), ipAddress.getIpv4Address());
final IpAddress ipAddress2 = Ipv4Util.getIpAddress(InetAddresses.forString("2001:db8:1:2::"));
Assert.assertNotNull(ipAddress2.getIpv6Address());
Assert.assertEquals(new Ipv6Address("2001:db8:1:2::"), ipAddress2.getIpv6Address());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address in project lispflowmapping by opendaylight.
the class LispSimpleAddressStringifierTest method getStringTest_asIpv6.
/**
* Tests {@link LispSimpleAddressStringifier#getString} with Ipv6Address.
*/
@Test
public void getStringTest_asIpv6() {
SimpleAddress simpleAddress = new SimpleAddress(IP_ADDRESS_USING_IPV6);
String result = LispSimpleAddressStringifier.getString(simpleAddress);
assertEquals(IPV6_ADDRESS_STRING, result);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address in project lispflowmapping by opendaylight.
the class LispAddressUtil method toRloc.
public static Rloc toRloc(Ipv6Address address) {
RlocBuilder builder = new RlocBuilder();
builder.setAddressType(Ipv6Afi.class);
builder.setVirtualNetworkId(null);
builder.setAddress((Address) new Ipv6Builder().setIpv6(address).build());
return builder.build();
}
Aggregations