2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.bgp.parser.spi;
10 import io.netty.buffer.ByteBuf;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
14 import org.opendaylight.protocol.bgp.parser.BGPError;
15 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes;
19 * Attribute serializer/deserializer registry, exposing the capability to parse BGP attributes as a whole.
22 public interface AttributeRegistry {
24 * Parse BGP Attribute from buffer.
26 * @param buffer Input buffer.
27 * @param constraints Peer specific constraint.
28 * @return Decoded BGP Attribute.
29 * @throws BGPDocumentedException when an unrecoverable error occurs, which is documented via {@link BGPError}
30 * @throws BGPParsingException when a general unrecoverable parsing error occurs
32 ParsedAttributes parseAttributes(ByteBuf buffer, @Nullable PeerSpecificParserConstraint constraints)
33 throws BGPDocumentedException, BGPParsingException;
36 * Serialize BGP Attribute to buffer.
38 * @param attribute Input BGP Attribute.
39 * @param byteAggregator Output buffer.
41 void serializeAttribute(Attributes attribute, ByteBuf byteAggregator);