Search in sources :

Example 1 with SrRroTypeBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder in project bgpcep by opendaylight.

the class SrRroSubobjectParserTest method testSrRroSubobjectIpv4AdjacencyNAI.

@Test
public void testSrRroSubobjectIpv4AdjacencyNAI() throws PCEPDeserializerException {
    final SrRroTypeBuilder builder = new SrRroTypeBuilder().setNaiType(NaiType.Ipv4Adjacency).setSid(Uint32.valueOf(123456)).setCFlag(false).setMFlag(false).setNai(new IpAdjacencyBuilder().setLocalIpAddress(new IpAddressNoZone(new Ipv4AddressNoZone("74.125.43.99"))).setRemoteIpAddress(new IpAddressNoZone(new Ipv4AddressNoZone("74.125.43.100"))).build());
    final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
    assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(SR_RRO_SUBOBJECT_WITH_IPV4_ADJ, 2))));
    final ByteBuf buffer = Unpooled.buffer();
    this.parser.serializeSubobject(subobjBuilder.build(), buffer);
    assertArrayEquals(SR_RRO_SUBOBJECT_WITH_IPV4_ADJ, ByteArray.getAllBytes(buffer));
}
Also used : Ipv4AddressNoZone(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone) IpAdjacencyBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpAdjacencyBuilder) IpAddressNoZone(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone) ByteBuf(io.netty.buffer.ByteBuf) SrRroTypeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder) SubobjectBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.SubobjectBuilder) Test(org.junit.Test)

Example 2 with SrRroTypeBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder in project bgpcep by opendaylight.

the class SrRroSubobjectParserTest method testSrRroSubobjectIpv6AdjacencyNAI.

@Test
public void testSrRroSubobjectIpv6AdjacencyNAI() throws PCEPDeserializerException {
    final SrRroTypeBuilder builder = new SrRroTypeBuilder().setNaiType(NaiType.Ipv6Adjacency).setSid(Uint32.valueOf(123456)).setCFlag(false).setMFlag(false).setNai(new IpAdjacencyBuilder().setLocalIpAddress(new IpAddressNoZone(new Ipv6AddressNoZone("fe80:cd00::211e:729c"))).setRemoteIpAddress(new IpAddressNoZone(new Ipv6AddressNoZone("fe80:cd00::211e:729d"))).build());
    final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
    assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(SR_RRO_SUBOBJECT_WITH_IPV6_ADJ, 2))));
    final ByteBuf buffer = Unpooled.buffer();
    this.parser.serializeSubobject(subobjBuilder.build(), buffer);
    assertArrayEquals(SR_RRO_SUBOBJECT_WITH_IPV6_ADJ, ByteArray.getAllBytes(buffer));
}
Also used : IpAdjacencyBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpAdjacencyBuilder) IpAddressNoZone(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone) ByteBuf(io.netty.buffer.ByteBuf) SrRroTypeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder) Ipv6AddressNoZone(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone) SubobjectBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.SubobjectBuilder) Test(org.junit.Test)

Example 3 with SrRroTypeBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder in project bgpcep by opendaylight.

the class SrRroSubobjectParserTest method testSrRroSubobjectIpv4NodeIdNAI.

@Test
public void testSrRroSubobjectIpv4NodeIdNAI() throws PCEPDeserializerException {
    final SrRroTypeBuilder builder = new SrRroTypeBuilder().setNaiType(NaiType.Ipv4NodeId).setSid(Uint32.valueOf(123456)).setCFlag(false).setMFlag(false).setNai(new IpNodeIdBuilder().setIpAddress(new IpAddressNoZone(new Ipv4AddressNoZone("74.125.43.99"))).build());
    final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
    assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(SR_RRO_SUBOBJECT_WITH_IPV4_NODEID, 2))));
    final ByteBuf buffer = Unpooled.buffer();
    this.parser.serializeSubobject(subobjBuilder.build(), buffer);
    assertArrayEquals(SR_RRO_SUBOBJECT_WITH_IPV4_NODEID, ByteArray.getAllBytes(buffer));
}
Also used : Ipv4AddressNoZone(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone) IpNodeIdBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpNodeIdBuilder) IpAddressNoZone(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone) ByteBuf(io.netty.buffer.ByteBuf) SrRroTypeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder) SubobjectBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.SubobjectBuilder) Test(org.junit.Test)

Example 4 with SrRroTypeBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder in project bgpcep by opendaylight.

the class SrRroSubobjectParserTest method testSrRroSubobjectUnnumberedNAI.

@Test
public void testSrRroSubobjectUnnumberedNAI() throws PCEPDeserializerException {
    final SrRroTypeBuilder builder = new SrRroTypeBuilder().setNaiType(NaiType.Unnumbered).setSid(Uint32.valueOf(123456)).setCFlag(false).setMFlag(false).setNai(new UnnumberedAdjacencyBuilder().setLocalNodeId(Uint32.ONE).setLocalInterfaceId(Uint32.TWO).setRemoteNodeId(Uint32.valueOf(3)).setRemoteInterfaceId(Uint32.valueOf(4)).build());
    final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
    assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(SR_RRO_SUBOBJECT_WIT_UNNUMBERED, 2))));
    final ByteBuf buffer = Unpooled.buffer();
    this.parser.serializeSubobject(subobjBuilder.build(), buffer);
    assertArrayEquals(SR_RRO_SUBOBJECT_WIT_UNNUMBERED, ByteArray.getAllBytes(buffer));
}
Also used : UnnumberedAdjacencyBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.UnnumberedAdjacencyBuilder) ByteBuf(io.netty.buffer.ByteBuf) SrRroTypeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder) SubobjectBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.SubobjectBuilder) Test(org.junit.Test)

Example 5 with SrRroTypeBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder in project bgpcep by opendaylight.

the class SrRroSubobjectParserTest method testSrRroSubobjectWithoutNAI.

@Test
public void testSrRroSubobjectWithoutNAI() throws PCEPDeserializerException {
    final SrRroTypeBuilder builder = new SrRroTypeBuilder().setNaiType(NaiType.Ipv4NodeId).setSid(Uint32.valueOf(123470)).setCFlag(true).setMFlag(true);
    final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
    assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(SR_RRO_SUBOBJECT_WITHOUT_NAI, 2))));
    final ByteBuf buffer = Unpooled.buffer();
    this.parser.serializeSubobject(subobjBuilder.build(), buffer);
    assertArrayEquals(SR_RRO_SUBOBJECT_WITHOUT_NAI, ByteArray.getAllBytes(buffer));
}
Also used : ByteBuf(io.netty.buffer.ByteBuf) SrRroTypeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder) SubobjectBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.SubobjectBuilder) Test(org.junit.Test)

Aggregations

SrRroTypeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder)8 SubobjectBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.SubobjectBuilder)8 ByteBuf (io.netty.buffer.ByteBuf)7 Test (org.junit.Test)7 IpAddressNoZone (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone)5 Ipv4AddressNoZone (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone)3 IpNodeIdBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpNodeIdBuilder)3 Ipv6AddressNoZone (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone)2 IpAdjacencyBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpAdjacencyBuilder)2 UnnumberedAdjacencyBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.UnnumberedAdjacencyBuilder)1