use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.createevpn.input.Evpn in project bgpcep by opendaylight.
the class EvpnRibSupport method createRouteKey.
private NodeIdentifierWithPredicates createRouteKey(final UnkeyedListEntryNode evpn) {
final ByteBuf buffer = Unpooled.buffer();
final EvpnDestination dest = EvpnNlriParser.extractRouteKeyDestination(evpn);
EvpnNlriParser.serializeNlri(Collections.singletonList(dest), buffer);
return new NodeIdentifierWithPredicates(routeQName(), ROUTE_KEY_QNAME, ByteArray.encodeBase64(buffer));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.createevpn.input.Evpn in project bgpcep by opendaylight.
the class EthADRParser method serializeKeyModel.
private static EthernetADRouteBuilder serializeKeyModel(final ContainerNode evpn) {
final EthernetADRouteBuilder builder = new EthernetADRouteBuilder();
builder.setEsi(serializeEsi(evpn));
builder.setEthernetTagId(extractETI(evpn));
return builder;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.createevpn.input.Evpn 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;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.createevpn.input.Evpn in project bgpcep by opendaylight.
the class IncMultEthTagRParser method serializeModel.
private static EvpnChoice serializeModel(final ContainerNode evpn) {
final IncMultiEthernetTagResBuilder builder = new IncMultiEthernetTagResBuilder();
builder.setEthernetTagId(extractETI(evpn));
builder.setOrigRouteIp(extractOrigRouteIp(evpn));
return new IncMultiEthernetTagResCaseBuilder().setIncMultiEthernetTagRes(builder.build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.createevpn.input.Evpn in project bgpcep by opendaylight.
the class MACIpAdvRParser method serializeBody.
@Override
public ByteBuf serializeBody(final EvpnChoice evpnChoice) {
Preconditions.checkArgument(evpnChoice instanceof MacIpAdvRouteCase, "Unknown evpn instance. Passed %s. Needed MacIpAdvRouteCase.", evpnChoice.getClass());
final ByteBuf body = Unpooled.buffer();
final MacIpAdvRoute evpn = ((MacIpAdvRouteCase) evpnChoice).getMacIpAdvRoute();
final Esi esi = evpn.getEsi();
if (esi != null) {
SimpleEsiTypeRegistry.getInstance().serializeEsi(evpn.getEsi(), body);
}
ByteBufWriteUtil.writeUnsignedInt(evpn.getEthernetTagId().getVlanId(), body);
final MacAddress mac = evpn.getMacAddress();
body.writeByte(MAC_ADDRESS_LENGTH * BITS_SIZE);
body.writeBytes(IetfYangUtil.INSTANCE.bytesFor(mac));
final ByteBuf ipAddress = serializeIp(evpn.getIpAddress());
Preconditions.checkArgument(ipAddress.readableBytes() > 0);
body.writeBytes(ipAddress);
final MplsLabel mpls1 = evpn.getMplsLabel1();
if (mpls1 != null) {
body.writeBytes(byteBufForMplsLabel(mpls1));
}
final MplsLabel mpls2 = evpn.getMplsLabel2();
if (mpls2 != null) {
body.writeBytes(byteBufForMplsLabel(mpls2));
}
return body;
}
Aggregations