Create common parent for extensions families
[bgpcep.git] / bgp / extensions / mvpn / src / main / java / org / opendaylight / protocol / bgp / mvpn / spi / nlri / MvpnRegistry.java
1 /*
2  * Copyright (c) 2018 AT&T Intellectual Property. 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 package org.opendaylight.protocol.bgp.mvpn.spi.nlri;
9
10 import io.netty.buffer.ByteBuf;
11 import javax.annotation.Nonnull;
12 import javax.annotation.Nullable;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.NlriType;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.mvpn.MvpnChoice;
15
16 public interface MvpnRegistry {
17     /**
18      * Decode input buffer to BGP Mvpn.
19      *
20      * @param type   Nlri Type
21      * @param buffer encoded MvpnChoice body in Bytebuf
22      * @return MvpnChoice
23      */
24     @Nullable
25     MvpnChoice parseMvpn(@Nonnull NlriType type, @Nonnull ByteBuf buffer);
26
27     /**
28      * Encode input BGP mvpn to output buffer.
29      *
30      * @param mvpn   MvpnChoice
31      * @return encoded MvpnChoice body in Bytebuf
32      */
33     @Nonnull
34     ByteBuf serializeMvpn(@Nonnull MvpnChoice mvpn);
35 }