Bug-6562: Support add-path in base BGP NLRI
[bgpcep.git] / bgp / evpn / src / main / java / org / opendaylight / protocol / bgp / evpn / spi / EvpnRegistry.java
1 /*
2  * Copyright (c) 2016 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.evpn.spi;
10
11 import io.netty.buffer.ByteBuf;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171207.NlriType;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171207.evpn.EvpnChoice;
15 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
16
17 public interface EvpnRegistry {
18     /**
19      * Decode input buffer to BGP Evpn.
20      *
21      * @param type Nlri Type
22      * @param buffer encoded EvpnChoice body in Bytebuf
23      * @return EvpnChoice
24      */
25     EvpnChoice parseEvpn(@Nonnull NlriType type, @Nonnull ByteBuf buffer);
26
27     /**
28      * Encode input BGP Evpn to output buffer
29      *
30      * @param evpn EvpnChoice
31      * @param common encoded common Evpn
32      * @return encoded EvpnChoice body in Bytebuf
33      */
34     ByteBuf serializeEvpn(@Nonnull EvpnChoice evpn, @Nonnull ByteBuf common);
35
36     /**
37      * Decode Evpn Model to Evpn.
38      *
39      * @param evpnChoice ChoiceNode containing Evpn
40      * @return EvpnChoice
41      */
42     EvpnChoice serializeEvpnModel(@Nonnull ChoiceNode evpnChoice);
43
44     /**
45      * Create Route key from Evpn model
46      *
47      * @param evpnChoice ChoiceNode containing Evpn
48      * @return EvpnChoice
49      */
50     EvpnChoice serializeEvpnRouteKey(@Nonnull ChoiceNode evpnChoice);
51 }