use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.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);
ByteBufUtils.writeOrZero(body, evpn.getEthernetTagId().getVlanId());
final MplsLabel mpls = evpn.getMplsLabel();
if (mpls != null) {
body.writeBytes(byteBufForMplsLabel(mpls));
}
return body;
}
Aggregations