Search in sources :

Example 1 with EsRoute

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;
}
Also used : EsRouteCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.evpn.evpn.choice.EsRouteCase) EsRoute(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.es.route.EsRoute) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 EsRoute (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.es.route.EsRoute)1 EsRouteCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.evpn.evpn.choice.EsRouteCase)1