import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.protocol.rsvp.parser.spi.RSVPTeObjectRegistry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.Attributes1;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.Attributes1Builder;
}
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder) throws BGPParsingException {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) throws BGPParsingException {
+ // FIXME: BGPCEP-359: what is the handling here?
final CLinkstateDestination lsDestination = getNlriType(builder);
if (lsDestination == null) {
LOG.warn("No Linkstate NLRI found, not parsing Linkstate attribute");
public class LinkstateAttributeParserTest {
- private static final byte[] TE_LSP_ATTR = {0x00, (byte) 0x63, 0x00, (byte) 0x30, // TE LSP Attribute Type, lenght, value
- 0x00, (byte) 0x20, (byte) 0x0c, 0x02, // Lenght, Class, Ctype
+ private static final byte[] TE_LSP_ATTR = {0x00, (byte) 0x63, 0x00, (byte) 0x30, // TE LSP Attribute Type, length, value
+ 0x00, (byte) 0x20, (byte) 0x0c, 0x02, // Length, Class, Ctype
0x00, 0x00, 0x00, 0x07,
0x01, 0x00, 0x00, 0x06,
(byte) 0x7f, 0x00, 0x00, 0x05,
0x00, 0x00, 0x00, 0x03, //Peak Data Rate
0x00, 0x00, 0x00, 0x04, //Minimum Policed Unit
0x00, 0x00, 0x00, 0x05, //Maximum Packet Size
- 0x00, (byte) 0x08, (byte) 0xc7, 0x01, // Lenght, Class, Ctype
+ 0x00, (byte) 0x08, (byte) 0xc7, 0x01, // Length, Class, Ctype
0x00, 0x01, 0x00, 0x02,
0x01, 0x02, 0x03, 0x04,};
public void testGetNlriType() throws BGPParsingException {
final ByteBuf b = Unpooled.buffer();
AttributesBuilder builder = new AttributesBuilder();
- this.parser.parseAttribute(b, builder);
+ this.parser.parseAttribute(b, builder, null);
assertEquals(0, b.readableBytes());
builder = new AttributesBuilder();
final Attributes1Builder builder1 = new Attributes1Builder();
builder.addAugmentation(Attributes1.class, builder1.build());
- this.parser.parseAttribute(b, builder);
+ this.parser.parseAttribute(b, builder, null);
assertEquals(0, b.readableBytes());
builder = new AttributesBuilder();
builder.addAugmentation(Attributes1.class, builder1.setMpReachNlri(
- new MpReachNlriBuilder().setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(new DestinationIpv4CaseBuilder().build()).build()).build()).build());
- this.parser.parseAttribute(b, builder);
+ new MpReachNlriBuilder().setAdvertizedRoutes(new AdvertizedRoutesBuilder()
+ .setDestinationType(new DestinationIpv4CaseBuilder().build()).build()).build()).build());
+ this.parser.parseAttribute(b, builder, null);
assertEquals(0, b.readableBytes());
builder = new AttributesBuilder();
final Attributes2Builder builder2 = new Attributes2Builder();
builder.addAugmentation(Attributes2.class, builder2.build());
- this.parser.parseAttribute(b, builder);
+ this.parser.parseAttribute(b, builder, null);
assertEquals(0, b.readableBytes());
builder = new AttributesBuilder();
builder.addAugmentation(Attributes2.class, builder2.setMpUnreachNlri(
- new MpUnreachNlriBuilder().setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationIpv6CaseBuilder().build()).build()).build()).build());
- this.parser.parseAttribute(b, builder);
+ new MpUnreachNlriBuilder().setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329
+ .update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationIpv6CaseBuilder()
+ .build()).build()).build()).build());
+ this.parser.parseAttribute(b, builder, null);
assertEquals(0, b.readableBytes());
}
@Test
public void testPositiveLinks() throws BGPParsingException {
final AttributesBuilder builder = createBuilder(new LinkCaseBuilder().build());
- this.parser.parseAttribute(Unpooled.copiedBuffer(LINK_ATTR), builder);
+ this.parser.parseAttribute(Unpooled.copiedBuffer(LINK_ATTR), builder, null);
final Attributes1 attrs = builder.augmentation(Attributes1.class);
final LinkAttributes ls = ((LinkAttributesCase) attrs.getLinkStateAttribute()).getLinkAttributes();
assertNotNull(ls);
assertEquals("42.42.42.42", ls.getLocalIpv4RouterId().getValue());
assertEquals("43.43.43.43", ls.getRemoteIpv4RouterId().getValue());
assertEquals(Long.valueOf(0L), ls.getAdminGroup().getValue());
- assertArrayEquals(new byte[] { (byte) 0x49, (byte) 0x98, (byte) 0x96, (byte) 0x80 }, ls.getMaxLinkBandwidth().getValue());
- assertArrayEquals(new byte[] { (byte) 0x46, (byte) 0x43, (byte) 0x50, (byte) 0x00 }, ls.getMaxReservableBandwidth().getValue());
+ assertArrayEquals(new byte[] { (byte) 0x49, (byte) 0x98, (byte) 0x96, (byte) 0x80 },
+ ls.getMaxLinkBandwidth().getValue());
+ assertArrayEquals(new byte[] { (byte) 0x46, (byte) 0x43, (byte) 0x50, (byte) 0x00 },
+ ls.getMaxReservableBandwidth().getValue());
assertNotNull(ls.getUnreservedBandwidth());
assertEquals(8, ls.getUnreservedBandwidth().size());
assertEquals(LinkProtectionType.Dedicated1to1, ls.getLinkProtection());
assertEquals(2, ls.getSharedRiskLinkGroups().size());
assertEquals(305419896, ls.getSharedRiskLinkGroups().get(0).getValue().intValue());
assertEquals("12K-2", ls.getLinkName());
- final IsisAdjFlagsCase flags = new IsisAdjFlagsCaseBuilder().setAddressFamily(Boolean.TRUE).setBackup(Boolean.FALSE).setSet(Boolean.FALSE).build();
+ final IsisAdjFlagsCase flags = new IsisAdjFlagsCaseBuilder().setAddressFamily(Boolean.TRUE)
+ .setBackup(Boolean.FALSE).setSet(Boolean.FALSE).build();
assertEquals(flags, ls.getSrAdjIds().get(0).getFlags());
assertEquals(flags, ls.getSrAdjIds().get(1).getFlags());
- assertEquals(new Long(1048575L), ((LocalLabelCase)ls.getSrAdjIds().get(0).getSidLabelIndex()).getLocalLabel().getValue());
- assertEquals(new Long(1048559L), ((LocalLabelCase)ls.getSrAdjIds().get(1).getSidLabelIndex()).getLocalLabel().getValue());
+ assertEquals(new Long(1048575L), ((LocalLabelCase)ls.getSrAdjIds().get(0).getSidLabelIndex()).getLocalLabel()
+ .getValue());
+ assertEquals(new Long(1048559L), ((LocalLabelCase)ls.getSrAdjIds().get(1).getSidLabelIndex()).getLocalLabel()
+ .getValue());
assertEquals(new Long(168496141L), ((SidCase) ls.getPeerNodeSid().getSidLabelIndex()).getSid());
assertEquals(new Short("5"), ls.getPeerNodeSid().getWeight().getValue());
assertEquals(new Long(168496142L), ((SidCase) ls.getPeerSetSids().get(0).getSidLabelIndex()).getSid());
@Test
public void testPositiveNodes() throws BGPParsingException {
final AttributesBuilder builder = createBuilder(new NodeCaseBuilder().build());
- this.parser.parseAttribute(Unpooled.copiedBuffer(NODE_ATTR), builder);
+ this.parser.parseAttribute(Unpooled.copiedBuffer(NODE_ATTR), builder, null);
final Attributes1 attrs = builder.augmentation(Attributes1.class);
final NodeAttributes ls = ((NodeAttributesCase) attrs.getLinkStateAttribute()).getNodeAttributes();
@Test
public void testPositiveV4Prefixes() throws BGPParsingException {
final AttributesBuilder builder = createUnreachBuilder(new PrefixCaseBuilder().setPrefixDescriptors(
- new PrefixDescriptorsBuilder().setIpReachabilityInformation(new IpPrefix(new Ipv4Prefix("127.0.0.1/32"))).build()).build());
- this.parser.parseAttribute(Unpooled.copiedBuffer(P4_ATTR), builder);
+ new PrefixDescriptorsBuilder().setIpReachabilityInformation(new IpPrefix(new Ipv4Prefix("127.0.0.1/32")))
+ .build()).build());
+ this.parser.parseAttribute(Unpooled.copiedBuffer(P4_ATTR), builder, null);
final Attributes1 attrs = builder.augmentation(Attributes1.class);
final PrefixAttributes ls = ((PrefixAttributesCase) attrs.getLinkStateAttribute()).getPrefixAttributes();
assertTrue(ispBits.isOspfLocalAddress());
assertTrue(ispBits.isOspfPropagateNssa());
assertEquals(2, ls.getRouteTags().size());
- assertArrayEquals(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78 }, ls.getRouteTags().get(0).getValue());
+ assertArrayEquals(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78 }, ls.getRouteTags().get(0)
+ .getValue());
assertEquals(1, ls.getExtendedTags().size());
- assertArrayEquals(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x10, (byte) 0x30, (byte) 0x50,
- (byte) 0x70 }, ls.getExtendedTags().get(0).getValue());
+ assertArrayEquals(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x10, (byte) 0x30,
+ (byte) 0x50, (byte) 0x70 }, ls.getExtendedTags().get(0).getValue());
assertEquals(10, ls.getPrefixMetric().getValue().intValue());
assertEquals("10.25.2.27", ls.getOspfForwardingAddress().getIpv4Address().getValue());
@Test
public void testPositiveTELspAttribute() throws BGPParsingException {
final AttributesBuilder builder = createBuilder(new TeLspCaseBuilder().build());
- this.parser.parseAttribute(Unpooled.copiedBuffer(TE_LSP_ATTR), builder);
+ this.parser.parseAttribute(Unpooled.copiedBuffer(TE_LSP_ATTR), builder, null);
final Attributes1 attrs = builder.augmentation(Attributes1.class);
- final TeLspAttributes teLspAttributes = ((TeLspAttributesCase) attrs.getLinkStateAttribute()).getTeLspAttributes();
+ final TeLspAttributes teLspAttributes = ((TeLspAttributesCase) attrs.getLinkStateAttribute())
+ .getTeLspAttributes();
assertNotNull(teLspAttributes);
final TspecObject tSpec = teLspAttributes.getTspecObject();
assertNotNull(tSpec);
- assertEquals(new Float32(new byte[]{(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01}), tSpec.getTokenBucketRate());
- assertEquals(new Float32(new byte[]{(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x02}), teLspAttributes.getTspecObject().getTokenBucketSize());
- assertEquals(new Float32(new byte[]{(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x03}), tSpec.getPeakDataRate());
+ assertEquals(new Float32(new byte[]{(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01}),
+ tSpec.getTokenBucketRate());
+ assertEquals(new Float32(new byte[]{(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x02}),
+ teLspAttributes.getTspecObject().getTokenBucketSize());
+ assertEquals(new Float32(new byte[]{(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x03}),
+ tSpec.getPeakDataRate());
assertEquals(new Long("4"), tSpec.getMinimumPolicedUnit());
assertEquals(new Long("5"), tSpec.getMaximumPacketSize());
final AssociationObject associationObject = teLspAttributes.getAssociationObject();
assertEquals(AssociationType.Recovery, associationObject.getAssociationType());
- final IpAddressNoZone ipv4 = new IpAddressNoZone(Ipv4Util.noZoneAddressForByteBuf(Unpooled.copiedBuffer(new byte[]{0x01, 0x02, 0x03, 0x04})));
+ final IpAddressNoZone ipv4 = new IpAddressNoZone(Ipv4Util.noZoneAddressForByteBuf(Unpooled.copiedBuffer(
+ new byte[]{0x01, 0x02, 0x03, 0x04})));
assertEquals(ipv4, associationObject.getIpAddress());
final short associationId = 2;
assertEquals(associationId, associationObject.getAssociationId().shortValue());
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.protocol.bgp.mvpn.impl.attributes;
+import static com.google.common.base.Preconditions.checkArgument;
import static org.opendaylight.protocol.bgp.parser.spi.AttributeUtil.formatAttribute;
-import com.google.common.base.Preconditions;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.util.ArrayList;
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.protocol.util.Ipv4Util;
import org.opendaylight.protocol.util.Ipv6Util;
import org.opendaylight.protocol.util.MplsLabelUtil;
}
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder) {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) {
if (!buffer.isReadable()) {
return;
}
final boolean isIpv4 = buffer.readableBytes() % 7 == 0;
final boolean isIpv6 = buffer.readableBytes() % 19 == 0;
- Preconditions.checkArgument(isIpv4 || isIpv6,
- "Length of byte array should be multiple of 7 or multiple of 19");
+
+ // FIXME: BGPCEP-359: what is the handling here?
+ checkArgument(isIpv4 || isIpv6, "Length of byte array should be multiple of 7 or multiple of 19");
final List<PeDistinguisherLabelAttribute> list = new ArrayList<>();
while (buffer.isReadable()) {
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.protocol.util.MplsLabelUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
}
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder) {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) {
+ // FIXME: BGPCEP-359: what is the error handling here?
if (!buffer.isReadable()) {
return;
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.protocol.bgp.mvpn.impl.attributes;
import static org.junit.Assert.assertArrayEquals;
assertEquals(22, pmsiHandler.getType());
final AttributesBuilder builder = new AttributesBuilder();
final ByteBuf emptyBuffer = Unpooled.buffer();
- pmsiHandler.parseAttribute(emptyBuffer, builder);
+ pmsiHandler.parseAttribute(emptyBuffer, builder, null);
final Attributes emptyAttributes = new AttributesBuilder().build();
assertEquals(emptyAttributes, builder.build());
pmsiHandler.serializeAttribute(emptyAttributes, emptyBuffer);
import io.netty.buffer.ByteBuf;
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
public static final int TYPE = 17;
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder) {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) {
// AS4 Aggregator is ignored
}
import io.netty.buffer.ByteBuf;
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
public static final int TYPE = 18;
@Override
- public void parseAttribute(final ByteBuf bytes, final AttributesBuilder builder) {
+ public void parseAttribute(final ByteBuf bytes, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) {
// AS4 Path is ignored
}
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.protocol.util.Ipv4Util;
import org.opendaylight.protocol.util.ReferenceCache;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
* @param builder AttributesBuilder into which parsed {@link Aggregator} will be set
*/
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder) {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) {
+ // FIXME: BGPCEP-359: attribute-discard if:
+ // o Its length is not 6 (when the 4-octet AS number capability is not
+ // advertised to or not received from the peer [RFC6793]).
+ //
+ // o Its length is not 8 (when the 4-octet AS number capability is both
+ // advertised to and received from the peer).
+
final AsNumber asNumber = this.refCache.getSharedReference(new AsNumber(buffer.readUnsignedInt()));
final Ipv4Address address = Ipv4Util.addressForByteBuf(buffer);
builder.setAggregator(new AggregatorBuilder().setAsNumber(asNumber).setNetworkAddress(address).build());
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.Aigp;
public static final int TYPE = 26;
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder)
- throws BGPDocumentedException, BGPParsingException {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ PeerSpecificParserConstraint constraint) throws BGPDocumentedException, BGPParsingException {
if(!buffer.isReadable()) {
return;
}
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.protocol.util.ReferenceCache;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
*
* @param refCache ReferenceCache shared reference of object
* @param buffer bytes to be parsed
+ * @param constraint
* @return new ASPath object
* @throws BGPDocumentedException if there is no AS_SEQUENCE present (mandatory)
*/
- private static AsPath parseAsPath(final ReferenceCache refCache, final ByteBuf buffer)
- throws BGPDocumentedException, BGPParsingException {
+ private static AsPath parseAsPath(final ReferenceCache refCache, final ByteBuf buffer,
+ final PeerSpecificParserConstraint constraint) throws BGPDocumentedException, BGPParsingException {
if (!buffer.isReadable()) {
return EMPTY;
}
final int type = buffer.readUnsignedByte();
final SegmentType segmentType = AsPathSegmentParser.parseType(type);
if (segmentType == null) {
+ // FIXME: BGPCEP-359: treat-as-withdraw
throw new BGPParsingException("AS Path segment type unknown : " + type);
}
+
+ // FIXME: BGPCEP-359: treat-as-withdraw if no data is available
final int count = buffer.readUnsignedByte();
+ // FIXME: BGPCEP-359: treat-as-withdraw if count == 0
+ final int segmentLength = count * AsPathSegmentParser.AS_NUMBER_LENGTH;
+ // FIXME: BGPCEP-359: treat-as-withdraw if there is a buffer overrun
final List<AsNumber> asList = AsPathSegmentParser.parseAsSegment(refCache, count,
- buffer.readSlice(count * AsPathSegmentParser.AS_NUMBER_LENGTH));
+ buffer.readSlice(segmentLength));
if (segmentType == SegmentType.AS_SEQUENCE) {
ases.add(new SegmentsBuilder().setAsSequence(asList).build());
isSequence = true;
}
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder)
- throws BGPDocumentedException, BGPParsingException {
- builder.setAsPath(parseAsPath(this.refCache, buffer));
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) throws BGPDocumentedException, BGPParsingException {
+ builder.setAsPath(parseAsPath(this.refCache, buffer, constraint));
}
@Override
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.AtomicAggregateBuilder;
public static final int TYPE = 6;
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder) {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) {
+ // FIXME: BGPCEP-359: attribute discard if length != 0
builder.setAtomicAggregate(new AtomicAggregateBuilder().build());
}
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.BgpPrefixSidTlvRegistry;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.BgpPrefixSid;
}
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder)
- throws BGPDocumentedException, BGPParsingException {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) throws BGPDocumentedException, BGPParsingException {
final BgpPrefixSidBuilder sid = new BgpPrefixSidBuilder();
final List<BgpPrefixSidTlvs> tlvList = new ArrayList<>();
while (buffer.isReadable()) {
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.protocol.util.Ipv4Util;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
public static final int TYPE = 10;
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder) {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) {
+ // FIXME: BGPCEP-359:
+ // - external peer: discard attribute (always?)
+ // - internal peer: treat-as-withdraw if length == 0 or not a multiple of four
+ // FIXME: once do the above check, optimize list allocation
final List<ClusterIdentifier> list = new ArrayList<>();
while (buffer.isReadable()) {
list.add(new ClusterIdentifier(Ipv4Util.addressForByteBuf(buffer)));
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.protocol.util.ReferenceCache;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
}
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder) throws BGPDocumentedException {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) throws BGPDocumentedException {
+ // FIXME: BGPCEP-359: treat-as-withdraw if buffer.readableBytes() is 0 or not a multiple of COMMUNITY_LENGTH
+ // FIXME: optimize allocation once we have done the above check
final List<Communities> set = new ArrayList<>();
while (buffer.isReadable()) {
set.add((Communities) parseCommunity(this.refCache, buffer.readSlice(COMMUNITY_LENGTH)));
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunityRegistry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
}
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder)
- throws BGPDocumentedException, BGPParsingException {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) throws BGPDocumentedException, BGPParsingException {
+ // FIXME: BGPCEP-359: treat-as-withdraw if length == 0 or not a multiple of 8
+ // FIXME: once we do the above check, optimize list allocation here
final List<ExtendedCommunities> set = new ArrayList<>();
while (buffer.isReadable()) {
+ // FIXME: BGPCEP-359: malformed communities need to trigger treat-as-withdraw
final ExtendedCommunities exComm = this.ecReg.parseExtendedCommunity(buffer);
if (exComm != null) {
set.add(exComm);
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.LocalPref;
public static final int TYPE = 5;
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder) {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) {
+ // FIXME: BGPCEP-359:
+ // - if peer is external: attribute discard
+ // - if peer is internal: treat-as-withdraw if length != 4
builder.setLocalPref(new LocalPrefBuilder().setPref(buffer.readUnsignedInt()).build());
}
}
@Override
- public void parseAttribute(
- final ByteBuf buffer,
- final AttributesBuilder builder,
- final PeerSpecificParserConstraint constraint)
- throws BGPDocumentedException {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) throws BGPDocumentedException {
try {
final MpReachNlri mpReachNlri = this.reg.parseMpReach(buffer, constraint);
final Attributes1 a = new Attributes1Builder().setMpReachNlri(mpReachNlri).build();
builder.addAugmentation(Attributes1.class, a);
} catch (final BGPParsingException e) {
+ // FIXME: BGPCEP-359: revise handling
throw new BGPDocumentedException("Could not parse MP_REACH_NLRI", BGPError.OPT_ATTR_ERROR, e);
}
}
}
@Override
- public void parseAttribute(
- final ByteBuf buffer,
- final AttributesBuilder builder,
- final PeerSpecificParserConstraint constraint)
- throws BGPDocumentedException {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) throws BGPDocumentedException {
try {
final MpUnreachNlri mpUnreachNlri = this.reg.parseMpUnreach(buffer, constraint);
final Attributes2 a = new Attributes2Builder().setMpUnreachNlri(mpUnreachNlri).build();
builder.addAugmentation(Attributes2.class, a);
} catch (final BGPParsingException e) {
+ // FIXME: BGPCEP-359: revise handling
throw new BGPDocumentedException("Could not parse MP_UNREACH_NLRI", BGPError.OPT_ATTR_ERROR, e);
}
}
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.MultiExitDisc;
public static final int TYPE = 4;
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder) {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) {
+ // FIXME: BGPCEP-359: check if length == 4, if not treat-as-withdraw
builder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(buffer.readUnsignedInt()).build());
}
*/
package org.opendaylight.protocol.bgp.parser.impl.message.update;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.opendaylight.bgp.concepts.NextHopUtil;
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.protocol.util.Ipv4Util;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
public static final int TYPE = 3;
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder) {
- Preconditions.checkArgument(buffer.readableBytes() == Ipv4Util.IP4_LENGTH,
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) {
+ // FIXME: BGPCEP-359: treat-as-withdraw
+ checkArgument(buffer.readableBytes() == Ipv4Util.IP4_LENGTH,
"Length of byte array for NEXT_HOP should be %s, but is %s",
buffer.readableBytes(), Ipv4Util.IP4_LENGTH);
builder.setCNextHop(NextHopUtil.parseNextHop(buffer));
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.Origin;
private static final Origin INC = new OriginBuilder().setValue(BgpOrigin.Incomplete).build();
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder) throws BGPDocumentedException {
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) throws BGPDocumentedException {
+ // FIXME: BGPCEP-359: check if a byte is available, treat-as-withdraw
final byte rawOrigin = buffer.readByte();
final BgpOrigin borigin = BgpOrigin.forValue(UnsignedBytes.toInt(rawOrigin));
if (borigin == null) {
+ // FIXME: BGPCEP-359: treat-as-withdraw
throw new BGPDocumentedException("Unknown Origin type.", BGPError.ORIGIN_ATTR_NOT_VALID,
new byte[]{(byte) 0x01, (byte) 0x01, rawOrigin});
}
*/
package org.opendaylight.protocol.bgp.parser.impl.message.update;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
import org.opendaylight.protocol.bgp.parser.spi.AttributeUtil;
+import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
import org.opendaylight.protocol.util.Ipv4Util;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.OriginatorId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
public static final int TYPE = 9;
@Override
- public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder) {
- Preconditions.checkArgument(buffer.readableBytes() == Ipv4Util.IP4_LENGTH,
+ public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder,
+ final PeerSpecificParserConstraint constraint) {
+ // FIXME: BGPCEP-359:
+ // - external peers: attribute-discard (always?)
+ // - internal peers: treat-as-withdraw
+ checkArgument(buffer.readableBytes() == Ipv4Util.IP4_LENGTH,
"Length of byte array for ORIGINATOR_ID should be %s, but is %s",
Ipv4Util.IP4_LENGTH, buffer.readableBytes());
builder.setOriginatorId(new OriginatorIdBuilder().setOriginator(Ipv4Util.addressForByteBuf(buffer)).build());
*/
package org.opendaylight.protocol.bgp.parser.impl.message.update;
-import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
-import org.opendaylight.protocol.bgp.parser.BGPParsingException;
import org.opendaylight.protocol.bgp.parser.spi.AttributeParser;
import org.opendaylight.protocol.bgp.parser.spi.AttributeSerializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
public abstract class ReachAttributeParser implements AttributeParser, AttributeSerializer {
- @Override
- public final void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder)
- throws BGPDocumentedException, BGPParsingException {
- parseAttribute(buffer, builder, null);
- }
}
package org.opendaylight.protocol.bgp.parser.impl.message.update;
import static org.junit.Assert.assertEquals;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Mockito;
import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
import org.opendaylight.protocol.bgp.parser.BGPParsingException;
import org.opendaylight.protocol.bgp.parser.spi.BgpPrefixSidTlvRegistry;
public final class BgpPrefixSidAttributeParserTest {
- private final BgpPrefixSidTlvRegistry reg = Mockito.mock(BgpPrefixSidTlvRegistry.class);
- private final BgpPrefixSidTlv tlv = Mockito.mock(BgpPrefixSidTlv.class);
+ private final BgpPrefixSidTlvRegistry reg = mock(BgpPrefixSidTlvRegistry.class);
+ private final BgpPrefixSidTlv tlv = mock(BgpPrefixSidTlv.class);
private final BgpPrefixSidAttributeParser parser = new BgpPrefixSidAttributeParser(this.reg);
private final byte[] bytes = new byte[] {1, 2, 3};
@Before
public void setUp() {
- Mockito.doReturn(this.tlv).when(this.reg).parseBgpPrefixSidTlv(Mockito.anyInt(), Mockito.any(ByteBuf.class));
- Mockito.doNothing().when(this.reg).serializeBgpPrefixSidTlv(Mockito.any(BgpPrefixSidTlv.class), Mockito.any(ByteBuf.class));
+ doReturn(this.tlv).when(this.reg).parseBgpPrefixSidTlv(anyInt(), any(ByteBuf.class));
+ doNothing().when(this.reg).serializeBgpPrefixSidTlv(any(BgpPrefixSidTlv.class), any(ByteBuf.class));
}
@Test
public void testHandling() throws BGPDocumentedException, BGPParsingException {
final AttributesBuilder builder = new AttributesBuilder();
- this.parser.parseAttribute(Unpooled.copiedBuffer(this.bytes), builder);
+ this.parser.parseAttribute(Unpooled.copiedBuffer(this.bytes), builder, null);
assertEquals(3, builder.getBgpPrefixSid().getBgpPrefixSidTlvs().size());
this.parser.serializeAttribute(builder.build(), Unpooled.EMPTY_BUFFER);
- Mockito.verify(this.reg, Mockito.times(3)).serializeBgpPrefixSidTlv(Mockito.any(BgpPrefixSidTlv.class), Mockito.any(ByteBuf.class));
+ verify(this.reg, times(3)).serializeBgpPrefixSidTlv(any(BgpPrefixSidTlv.class), any(ByteBuf.class));
}
}
assertArrayEquals(clusterIdBytes, ByteArray.getAllBytes(output));
AttributesBuilder clusterIdOutput = new AttributesBuilder();
- this.parser.parseAttribute(Unpooled.wrappedBuffer(ByteArray.cutBytes(clusterIdBytes, 3)), clusterIdOutput);
+ this.parser.parseAttribute(Unpooled.wrappedBuffer(ByteArray.cutBytes(clusterIdBytes, 3)), clusterIdOutput,
+ null);
assertEquals(clusterId, clusterIdOutput.build());
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.protocol.bgp.parser.impl.message.update;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import com.google.common.primitives.Bytes;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.util.ArrayList;
import java.util.List;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setTransitive(false).setExtendedCommunity(routeOrigin).build();
final AttributesBuilder attBuilder = new AttributesBuilder();
- this.handler.parseAttribute(Unpooled.copiedBuffer(INPUT), attBuilder);
+ this.handler.parseAttribute(Unpooled.copiedBuffer(INPUT), attBuilder, null);
final ExtendedCommunities parsed = attBuilder.getExtendedCommunities().get(0);
- Assert.assertEquals(expected, parsed);
+ assertEquals(expected, parsed);
final ByteBuf output = Unpooled.buffer(INPUT.length);
this.handler.serializeAttribute(attBuilder.build(), output);
- Assert.assertArrayEquals(Bytes.concat(new byte[] {(byte)192, 16, 8}, INPUT), ByteArray.readAllBytes(output));
+ assertArrayEquals(Bytes.concat(new byte[] {(byte)192, 16, 8}, INPUT), ByteArray.readAllBytes(output));
}
@Test
final ByteBuf output = Unpooled.buffer();
this.handler.serializeAttribute(attBuilder.build(), output);
- Assert.assertEquals(output, output);
+ assertEquals(output, output);
}
@Test
public void testEmptyExtendedCommunityAttributeParser() throws BGPDocumentedException, BGPParsingException {
final ByteBuf output = Unpooled.buffer();
this.handler.serializeAttribute(new AttributesBuilder().build(), output);
- Assert.assertEquals( Unpooled.buffer(), output);
+ assertEquals( Unpooled.buffer(), output);
}
@Test
public void testExtendedCommunityAttributeParserUnknown() throws BGPDocumentedException, BGPParsingException {
final AttributesBuilder attBuilder = new AttributesBuilder();
- this.handler.parseAttribute(Unpooled.copiedBuffer(UNKOWN), attBuilder);
- Assert.assertTrue(attBuilder.getExtendedCommunities().isEmpty());
+ this.handler.parseAttribute(Unpooled.copiedBuffer(UNKOWN), attBuilder, null);
+ assertTrue(attBuilder.getExtendedCommunities().isEmpty());
}
-
}
* @param buffer Encoded attribute body in ByteBuf.
* @param builder Path attributes builder. Guaranteed to contain all valid attributes whose type is numerically
* lower than this attribute's type.
+ * @param constraint Peer specific constraints, may be null
*/
- void parseAttribute(@Nonnull ByteBuf buffer, @Nonnull AttributesBuilder builder)
- throws BGPDocumentedException, BGPParsingException;
-
- /**
- * Invokes {@link #parseAttribute(ByteBuf, AttributesBuilder)}, so the constraint is omitted. Override for specific parser behavior.
- *
- * @param buffer Encoded attribute body in ByteBuf.
- * @param builder Path attributes builder. Guaranteed to contain all valid attributes whose type is numerically
- * lower than this attribute's type.
- * @param constraint Peer specific constraints.
- * @throws BGPDocumentedException exception.
- * @throws BGPParsingException exception.
- */
- default void parseAttribute(
- @Nonnull final ByteBuf buffer,
- @Nonnull final AttributesBuilder builder,
- @Nullable final PeerSpecificParserConstraint constraint)
- throws BGPDocumentedException, BGPParsingException {
- parseAttribute(buffer, builder);
- }
+ void parseAttribute(@Nonnull ByteBuf buffer, @Nonnull AttributesBuilder builder,
+ @Nullable PeerSpecificParserConstraint constraint) throws BGPDocumentedException, BGPParsingException;
}