2 * Copyright (c) 2015 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.extended.community;
10 import io.netty.buffer.ByteBuf;
11 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
12 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.attributes.ExtendedCommunities;
16 * The Extended Communities registry.
18 public interface ExtendedCommunityRegistry {
20 * Parses the Extended Community.
22 * @param buffer ByteBuf
23 * @return Decoded ExtendedCommunity or null if the parser for such Extended Community type/sub-type is not present.
25 ExtendedCommunities parseExtendedCommunity(ByteBuf buffer) throws BGPDocumentedException, BGPParsingException;
28 * Serializes the Extended Community.
30 * @param extendedCommunity ExtendedCommunity to be encoded.
31 * @param byteAggregator ByteBuf, where the Extended Community is serialized, if a serialized is not present for
32 * such Extended Community type, no bytes are written into output buffer.
34 void serializeExtendedCommunity(ExtendedCommunities extendedCommunity, ByteBuf byteAggregator);