use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.open.message.bgp.parameters.optional.capabilities.c.parameters.As4BytesCapability in project bgpcep by opendaylight.
the class StrictBGPPeerRegistry method getAs4BytesCapability.
@Nullable
private static As4BytesCapability getAs4BytesCapability(final List<BgpParameters> prefs) {
for (final BgpParameters param : prefs) {
for (final OptionalCapabilities capa : param.nonnullOptionalCapabilities()) {
final CParameters cParam = capa.getCParameters();
final As4BytesCapability asCapa = cParam.getAs4BytesCapability();
if (asCapa != null) {
return asCapa;
}
}
}
return null;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.open.message.bgp.parameters.optional.capabilities.c.parameters.As4BytesCapability in project bgpcep by opendaylight.
the class StrictBGPPeerRegistry method serializeAs4BytesCapability.
private static byte[] serializeAs4BytesCapability(final As4BytesCapability as4Capability) {
final ByteBuf buffer = Unpooled.buffer(1 + /*CODE*/
1 + /*LENGTH*/
Integer.BYTES);
final As4CapabilityHandler serializer = new As4CapabilityHandler();
serializer.serializeCapability(new CParametersBuilder().setAs4BytesCapability(as4Capability).build(), buffer);
return buffer.array();
}
Aggregations