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
9 package org.opendaylight.protocol.bgp.parser.spi.extended.community;
11 import io.netty.buffer.ByteBuf;
12 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
13 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.ExtendedCommunities;
17 * The Extended Communities registry.
20 public interface ExtendedCommunityRegistry {
23 * Parses the Extended Community.
24 * @param buffer ByteBuf
25 * @return Decoded ExtendedCommunity or null if the parser for such Extended Community type/sub-type is not present.
26 * @throws BGPDocumentedException
27 * @throws BGPParsingException
29 ExtendedCommunities parseExtendedCommunity(ByteBuf buffer) throws BGPDocumentedException, BGPParsingException;
32 * Serializes the Extended Community.
33 * @param extendedCommunity ExtendedCommunity to be encoded.
34 * @param byteAggregator ByteBuf, where the Extended Community is serialized,
35 * if a serialized is not present for such Extended Community type, no bytes are written into output buffer.
37 void serializeExtendedCommunity(ExtendedCommunities extendedCommunity, ByteBuf byteAggregator);