use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.es.route.EsRoute in project bgpcep by opendaylight.
the class EthSegRParser method serializeBody.
@Override
public ByteBuf serializeBody(final EvpnChoice evpnInput) {
checkArgument(evpnInput instanceof EsRouteCase, "Unknown evpn instance. Passed %s. Needed EsRouteCase.", evpnInput.getClass());
final EsRoute evpn = ((EsRouteCase) evpnInput).getEsRoute();
final ByteBuf body = Unpooled.buffer();
SimpleEsiTypeRegistry.getInstance().serializeEsi(evpn.getEsi(), body);
final ByteBuf orig = IpAddressUtil.bytesFor(evpn.getOrigRouteIp());
checkArgument(orig.readableBytes() > 0);
body.writeBytes(orig);
return body;
}
Aggregations