use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.prefix.state.SrBindingSidLabels in project bgpcep by opendaylight.
the class PrefixAttributesParser method serializeSrBindingLabel.
private static void serializeSrBindingLabel(final List<SrBindingSidLabels> srBindingSidLabels, final ByteBuf byteAggregator) {
if (srBindingSidLabels != null) {
for (final SrBindingSidLabels bindingSid : srBindingSidLabels) {
final ByteBuf sidBuffer = Unpooled.buffer();
BindingSidLabelParser.serializeBindingSidAttributes(bindingSid.getWeight(), bindingSid.getFlags(), bindingSid.getBindingSubTlvs(), sidBuffer);
TlvUtil.writeTLV(PrefixAttributesParser.BINDING_SID, sidBuffer, byteAggregator);
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.prefix.state.SrBindingSidLabels in project bgpcep by opendaylight.
the class BindingSidLabelParser method parseBindingSidLabel.
public static SrBindingSidLabels parseBindingSidLabel(final ByteBuf buffer, final ProtocolId protocolId) {
final SrBindingSidLabelsBuilder bindingSid = new SrBindingSidLabelsBuilder();
bindingSid.setWeight(new Weight(buffer.readUnsignedByte()));
final BitArray flags = BitArray.valueOf(buffer, FLAGS_SIZE);
bindingSid.setFlags(parseBindingSidFlags(flags, protocolId));
buffer.skipBytes(RESERVED_BINDING_SID);
bindingSid.setBindingSubTlvs(SimpleBindingSubTlvsRegistry.getInstance().parseBindingSubTlvs(buffer, protocolId));
return bindingSid.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.prefix.state.SrBindingSidLabels in project bgpcep by opendaylight.
the class PrefixAttributesParser method parseBindingSid.
private static void parseBindingSid(final PrefixAttributesBuilder builder, final ByteBuf value, final ProtocolId protocolId) {
final List<SrBindingSidLabels> labels;
if (builder.getSrBindingSidLabels() != null) {
labels = builder.getSrBindingSidLabels();
} else {
labels = new ArrayList<>();
builder.setSrBindingSidLabels(labels);
}
final SrBindingSidLabels label = BindingSidLabelParser.parseBindingSidLabel(value, protocolId);
labels.add(label);
LOG.debug("Parsed SR Binding SID {}", label);
}
Aggregations