dba457f2d637e39093aacabf9ad8a2258028e15a
[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 javax.annotation.Nullable;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.NlriType;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.evpn.EvpnChoice;
16 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
17
18 public interface EvpnRegistry {
19     /**
20      * Decode input buffer to BGP Evpn.
21      *
22      * @param type Nlri Type
23      * @param buffer encoded EvpnChoice body in Bytebuf
24      * @return EvpnChoice
25      */
26     @Nullable EvpnChoice parseEvpn(@Nonnull NlriType type, @Nonnull ByteBuf buffer);
27
28     /**
29      * Encode input BGP Evpn to output buffer
30      *
31      * @param evpn EvpnChoice
32      * @param common encoded common Evpn
33      * @return encoded EvpnChoice body in Bytebuf
34      */
35     @Nonnull ByteBuf serializeEvpn(@Nonnull EvpnChoice evpn, @Nonnull ByteBuf common);
36
37     /**
38      * Decode Evpn Model to Evpn.
39      *
40      * @param evpnChoice ChoiceNode containing Evpn
41      * @return EvpnChoice
42      */
43     @Nonnull EvpnChoice serializeEvpnModel(@Nonnull ChoiceNode evpnChoice);
44
45     /**
46      * Create Route key from Evpn model
47      *
48      * @param evpnChoice ChoiceNode containing Evpn
49      * @return EvpnChoice
50      */
51     @Nonnull EvpnChoice serializeEvpnRouteKey(@Nonnull ChoiceNode evpnChoice);
52 }