Search in sources :

Example 1 with NoPathVector

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.result.failure._case.no.path.tlvs.NoPathVector in project bgpcep by opendaylight.

the class NoPathVectorTlvParser method serializeTlv.

@Override
public void serializeTlv(final Tlv tlv, final ByteBuf buffer) {
    Preconditions.checkArgument(tlv instanceof NoPathVector, "NoPathVectorTlv is mandatory.");
    final NoPathVector noPath = (NoPathVector) tlv;
    final ByteBuf body = Unpooled.buffer();
    final BitArray flags = new BitArray(FLAGS_SIZE);
    final Flags f = noPath.getFlags();
    flags.set(REACHABLITY_PROBLEM, f.getP2mpUnreachable());
    flags.set(NO_GCO_SOLUTION, f.getNoGcoSolution());
    flags.set(NO_GCO_MIGRATION_PATH, f.getNoGcoMigration());
    flags.set(PATH_KEY, f.getPathKey());
    flags.set(CHAIN_UNAVAILABLE, f.getChainUnavailable());
    flags.set(UNKNOWN_SRC, f.getUnknownSource());
    flags.set(UNKNOWN_DEST, f.getUnknownDestination());
    flags.set(PCE_UNAVAILABLE, f.getPceUnavailable());
    flags.toByteBuf(body);
    TlvUtil.formatTlv(TYPE, body, buffer);
}
Also used : NoPathVector(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.result.failure._case.no.path.tlvs.NoPathVector) BitArray(org.opendaylight.protocol.util.BitArray) Flags(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.NoPathVectorTlv.Flags) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 BitArray (org.opendaylight.protocol.util.BitArray)1 Flags (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.NoPathVectorTlv.Flags)1 NoPathVector (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.result.failure._case.no.path.tlvs.NoPathVector)1