2fc8b8b5d75fbdf061cbdc13e53dc9b7694c3e31
[bgpcep.git] / bgp / evpn / src / main / java / org / opendaylight / protocol / bgp / evpn / spi / EsiRegistry.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.rev171213.esi.Esi;
14 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
15
16 public interface EsiRegistry {
17     /**
18      * Parse Esi
19      *
20      * @param buffer encoded ESI body in Bytebuf
21      * @return Ethernet Segment Identifier
22      */
23     @Nonnull
24     Esi parseEsi(@Nonnull ByteBuf buffer);
25
26     /**
27      * Parse Esi Model
28      *
29      * @param esi ChoiceNode containing ESI
30      * @return Ethernet Segment Identifier
31      */
32     @Nonnull
33     Esi parseEsiModel(@Nonnull ChoiceNode esi);
34
35     /**
36      * Serialize Esi
37      *
38      * @param esi    Ethernet Segment Identifier
39      * @param buffer write in Bytebuf encoded ESI body
40      */
41     void serializeEsi(@Nonnull Esi esi, @Nonnull ByteBuf buffer);
42 }