Search in sources :

Example 1 with OspfPrefixFlagsCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.prefix.sid.tlv.flags.OspfPrefixFlagsCase in project bgpcep by opendaylight.

the class SrPrefixAttributesParser method serializePrefixFlags.

private static BitArray serializePrefixFlags(final Flags flags, final SidLabelIndex sidLabelIndex) {
    final BitArray bitFlags = new BitArray(FLAGS_SIZE);
    SidLabelIndexParser.setFlags(sidLabelIndex, bitFlags, VALUE, LOCAL);
    if (flags instanceof OspfPrefixFlagsCase) {
        final OspfPrefixFlagsCase ospfFlags = (OspfPrefixFlagsCase) flags;
        bitFlags.set(NO_PHP_OSPF, ospfFlags.isNoPhp());
        bitFlags.set(MAPPING_SERVER, ospfFlags.isMappingServer());
        bitFlags.set(EXPLICIT_NULL, ospfFlags.isExplicitNull());
    } else if (flags instanceof IsisPrefixFlagsCase) {
        final IsisPrefixFlagsCase isisFlags = (IsisPrefixFlagsCase) flags;
        bitFlags.set(RE_ADVERTISEMENT, isisFlags.isReadvertisement());
        bitFlags.set(NODE_SID, isisFlags.isNodeSid());
        bitFlags.set(NO_PHP, isisFlags.isNoPhp());
        bitFlags.set(EXPLICIT_NULL, isisFlags.isExplicitNull());
    }
    return bitFlags;
}
Also used : IsisPrefixFlagsCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.prefix.sid.tlv.flags.IsisPrefixFlagsCase) OspfPrefixFlagsCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.prefix.sid.tlv.flags.OspfPrefixFlagsCase) BitArray(org.opendaylight.protocol.util.BitArray)

Aggregations

BitArray (org.opendaylight.protocol.util.BitArray)1 IsisPrefixFlagsCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.prefix.sid.tlv.flags.IsisPrefixFlagsCase)1 OspfPrefixFlagsCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segment.routing.ext.rev151014.prefix.sid.tlv.flags.OspfPrefixFlagsCase)1