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 javax.annotation.Nonnull;
12 import javax.annotation.Nullable;
13 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
14 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes;
16 import org.opendaylight.yangtools.yang.binding.DataObject;
21 public interface AttributeRegistry {
23 * Parse BGP Attribute from buffer.
24 * @param buffer Input buffer.
25 * @param constraints Peer specific constraint.
26 * @return Decoded BGP Attribute.
27 * @throws BGPDocumentedException
28 * @throws BGPParsingException
30 @Nonnull Attributes parseAttributes(@Nonnull ByteBuf buffer, @Nullable PeerSpecificParserConstraint constraints)
31 throws BGPDocumentedException, BGPParsingException;
34 * Serialize BGP Attribute to buffer.
35 * @param attribute Input BGP Attribute.
36 * @param byteAggregator Output buffer.
38 void serializeAttribute(@Nonnull DataObject attribute, @Nonnull ByteBuf byteAggregator);