Search in sources :

Example 6 with Lsp1Builder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.initiated.rev200720.Lsp1Builder in project bgpcep by opendaylight.

the class InitiatedLspObjectParser method parseFlags.

@Override
protected void parseFlags(final LspBuilder builder, final ByteBuf bytes) {
    final BitArray flags = BitArray.valueOf(bytes, FLAGS_SIZE);
    builder.setDelegate(flags.get(DELEGATE));
    builder.setSync(flags.get(SYNC));
    builder.setRemove(flags.get(REMOVE));
    builder.setAdministrative(flags.get(ADMINISTRATIVE));
    builder.addAugmentation(new Lsp1Builder().setCreate(flags.get(CREATE_FLAG_OFFSET)).build());
    short oper = 0;
    oper |= flags.get(OPERATIONAL + 2) ? 1 : 0;
    oper |= (flags.get(OPERATIONAL + 1) ? 1 : 0) << 1;
    oper |= (flags.get(OPERATIONAL) ? 1 : 0) << 2;
    builder.setOperational(OperationalStatus.forValue(oper));
}
Also used : Lsp1Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.initiated.rev200720.Lsp1Builder) BitArray(org.opendaylight.protocol.util.BitArray)

Aggregations

Lsp1Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.initiated.rev200720.Lsp1Builder)5 LspBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.object.LspBuilder)4 PlspId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.PlspId)3 BitArray (org.opendaylight.protocol.util.BitArray)2 ByteBuf (io.netty.buffer.ByteBuf)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 Before (org.junit.Before)1 Test (org.junit.Test)1 StatefulActivator (org.opendaylight.protocol.pcep.ietf.stateful.StatefulActivator)1 BaseParserExtensionActivator (org.opendaylight.protocol.pcep.parser.BaseParserExtensionActivator)1 PCCSession (org.opendaylight.protocol.pcep.pcc.mock.api.PCCSession)1 MsgBuilderUtil.createLspTlvs (org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil.createLspTlvs)1 ObjectHeaderImpl (org.opendaylight.protocol.pcep.spi.ObjectHeaderImpl)1 SimplePCEPExtensionProviderContext (org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext)1 SyncOptimizationsActivator (org.opendaylight.protocol.pcep.sync.optimizations.SyncOptimizationsActivator)1 SyncOptimizationsLspObjectParser (org.opendaylight.protocol.pcep.sync.optimizations.SyncOptimizationsLspObjectParser)1 Ipv4AddressNoZone (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone)1 LspDbVersion (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.lsp.db.version.tlv.LspDbVersion)1 LspDbVersionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.lsp.db.version.tlv.LspDbVersionBuilder)1