Search in sources :

Example 36 with RsvpTeObject

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.

the class TEObjectTest method testFlowSpecObjectParser_HEAD_5.

@Test
public void testFlowSpecObjectParser_HEAD_5() throws RSVPParsingException {
    final FlowSpecObjectParser parser = new FlowSpecObjectParser();
    final RsvpTeObject obj = parser.parseObject(Unpooled.copiedBuffer(ByteArray.subByte(TEObjectUtil.TE_LSP_FLOWSPEC_H5, 4, TEObjectUtil.TE_LSP_FLOWSPEC_H5.length - 4)));
    final ByteBuf output = Unpooled.buffer();
    parser.serializeObject(obj, output);
    assertArrayEquals(TEObjectUtil.TE_LSP_FLOWSPEC_H5, ByteArray.getAllBytes(output));
}
Also used : RsvpTeObject(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Example 37 with RsvpTeObject

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.

the class TEObjectTest method testBandwidthObjectParser2.

@Test
public void testBandwidthObjectParser2() throws RSVPParsingException {
    final ReoptimizationBandwidthObjectParser parser = new ReoptimizationBandwidthObjectParser();
    final RsvpTeObject obj = parser.parseObject(Unpooled.copiedBuffer(ByteArray.subByte(TEObjectUtil.TE_LSP_BANDWIDTH_2, 4, TEObjectUtil.TE_LSP_BANDWIDTH_2.length - 4)));
    final ByteBuf output = Unpooled.buffer();
    parser.serializeObject(obj, output);
    assertArrayEquals(TEObjectUtil.TE_LSP_BANDWIDTH_2, ByteArray.getAllBytes(output));
}
Also used : RsvpTeObject(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Example 38 with RsvpTeObject

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.

the class TEObjectTest method testSessionAttributeParser1.

@Test
public void testSessionAttributeParser1() throws RSVPParsingException {
    final SessionAttributeLspRaObjectParser parser = new SessionAttributeLspRaObjectParser();
    final RsvpTeObject obj = parser.parseObject(Unpooled.copiedBuffer(ByteArray.subByte(TEObjectUtil.TE_LSP_SESSION_C1, 4, TEObjectUtil.TE_LSP_SESSION_C1.length - 4)));
    final ByteBuf output = Unpooled.buffer();
    parser.serializeObject(obj, output);
    assertArrayEquals(TEObjectUtil.TE_LSP_SESSION_C1, ByteArray.getAllBytes(output));
}
Also used : RsvpTeObject(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Example 39 with RsvpTeObject

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.

the class TEObjectTest method testSecondaryExplicitRouteParser.

@Test
public void testSecondaryExplicitRouteParser() throws RSVPParsingException {
    final SecondaryExplicitRouteObjectParser parser = new SecondaryExplicitRouteObjectParser(this.context.getEROSubobjectHandlerRegistry());
    final RsvpTeObject obj = parser.parseObject(Unpooled.copiedBuffer(ByteArray.subByte(TEObjectUtil.TE_LSP_SECONDARY_EXPLICIT, 4, TEObjectUtil.TE_LSP_SECONDARY_EXPLICIT.length - 4)));
    final ByteBuf output = Unpooled.buffer();
    parser.serializeObject(obj, output);
    assertArrayEquals(TEObjectUtil.TE_LSP_SECONDARY_EXPLICIT, ByteArray.getAllBytes(output));
}
Also used : RsvpTeObject(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Example 40 with RsvpTeObject

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.

the class ProtectionObjectParser method localParseObject.

@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
    final BasicProtectionObjectBuilder builder = new BasicProtectionObjectBuilder();
    final ProtectionSubobject pSub = ProtectionCommonParser.parseCommonProtectionBodyType1(byteBuf);
    return builder.setProtectionSubobject(pSub).build();
}
Also used : BasicProtectionObjectBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.protection.object.protection.object.BasicProtectionObjectBuilder) ProtectionSubobject(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.protection.subobject.ProtectionSubobject)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)44 Test (org.junit.Test)25 RsvpTeObject (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject)25 BitArray (org.opendaylight.protocol.util.BitArray)8 Bandwidth (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.Bandwidth)6 ArrayList (java.util.ArrayList)4 SubobjectContainer (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.lsp.attributes.object.lsp.attributes.object.SubobjectContainer)4 ByteBufWriteUtil.writeFloat32 (org.opendaylight.protocol.util.ByteBufWriteUtil.writeFloat32)3 Float32 (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ieee754.rev130819.Float32)3 AttributeFilter (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter)3 FlagContainer (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.attribute.flags.FlagContainer)2 Plr (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.ipv4.detour.object.Plr)2 AvoidNode (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.ipv6.detour.object.AvoidNode)2 PlrId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.detour.object.detour.object.ipv6.detour.object.PlrId)2 ExplicitRouteObject (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route.object.ExplicitRouteObject)2 LspSubobject (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.lsp.att.subobject.LspSubobject)2 FlagsTlv (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.lsp.att.subobject.lsp.subobject.FlagsTlv)2 FlagsTlvBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.lsp.att.subobject.lsp.subobject.FlagsTlvBuilder)2 LspAttributesObjectBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.lsp.attributes.object.LspAttributesObjectBuilder)2 SubobjectContainerBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.lsp.attributes.object.lsp.attributes.object.SubobjectContainerBuilder)2