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;
}
Aggregations