MVPN RFC6514 Extendend communities
[bgpcep.git] / bgp / parser-spi / src / main / java / org / opendaylight / protocol / bgp / parser / spi / extended / community / ExtendedCommunitySerializer.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.protocol.bgp.parser.spi.extended.community;
10
11 import io.netty.buffer.ByteBuf;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.ExtendedCommunity;
13
14 /**
15  * The Extended Community serializer (ExtendedCommunity to ByteBuf).
16  *
17  */
18 public interface ExtendedCommunitySerializer {
19
20     /**
21      * Serializes Extended Community value to the buffer.
22      * @param extendedCommunity ExtendedCommuity to be encoded.
23      * @param byteAggregator The output buffer where the extended community is written.
24      */
25     void serializeExtendedCommunity(ExtendedCommunity extendedCommunity, ByteBuf byteAggregator);
26
27     /**
28      * Provides a type of the extended community for which the serializer is registered.
29      * @param isTransitive Transitivity of the extended community.
30      * @return A type of the extended community.
31      */
32     int getType(boolean isTransitive);
33
34     /**
35      * Provides a sub-type of the extended community for which the serializer is registered.
36      * @return A sub-type of the extended community.
37      */
38     int getSubType();
39
40 }