Search in sources :

Example 1 with EthernetADRoute

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.ethernet.a.d.route.EthernetADRoute in project bgpcep by opendaylight.

the class EthADRParser method serializeBody.

@Override
public ByteBuf serializeBody(final EvpnChoice evpnChoice) {
    Preconditions.checkArgument(evpnChoice instanceof EthernetADRouteCase, "Unknown evpn instance. Passed %s. Needed EthernetADRouteCase.", evpnChoice.getClass());
    final EthernetADRoute evpn = ((EthernetADRouteCase) evpnChoice).getEthernetADRoute();
    final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
    SimpleEsiTypeRegistry.getInstance().serializeEsi(evpn.getEsi(), body);
    ByteBufWriteUtil.writeUnsignedInt(evpn.getEthernetTagId().getVlanId(), body);
    final MplsLabel mpls = evpn.getMplsLabel();
    if (mpls != null) {
        body.writeBytes(byteBufForMplsLabel(evpn.getMplsLabel()));
    }
    return body;
}
Also used : EthernetADRoute(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.ethernet.a.d.route.EthernetADRoute) MplsLabel(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel) NlriModelUtil.extractMplsLabel(org.opendaylight.protocol.bgp.evpn.impl.nlri.NlriModelUtil.extractMplsLabel) MplsLabelUtil.byteBufForMplsLabel(org.opendaylight.protocol.util.MplsLabelUtil.byteBufForMplsLabel) EthernetADRouteCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.evpn.evpn.choice.EthernetADRouteCase) MplsLabelUtil.mplsLabelForByteBuf(org.opendaylight.protocol.util.MplsLabelUtil.mplsLabelForByteBuf) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 NlriModelUtil.extractMplsLabel (org.opendaylight.protocol.bgp.evpn.impl.nlri.NlriModelUtil.extractMplsLabel)1 MplsLabelUtil.byteBufForMplsLabel (org.opendaylight.protocol.util.MplsLabelUtil.byteBufForMplsLabel)1 MplsLabelUtil.mplsLabelForByteBuf (org.opendaylight.protocol.util.MplsLabelUtil.mplsLabelForByteBuf)1 EthernetADRoute (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.ethernet.a.d.route.EthernetADRoute)1 EthernetADRouteCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.evpn.evpn.choice.EthernetADRouteCase)1 MplsLabel (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel)1