Search in sources :

Example 16 with Evpn

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));
}
Also used : EvpnDestination(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.evpn.destination.EvpnDestination) ByteBuf(io.netty.buffer.ByteBuf) NodeIdentifierWithPredicates(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates)

Example 17 with Evpn

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;
}
Also used : EthernetADRouteBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.ethernet.a.d.route.EthernetADRouteBuilder)

Example 18 with Evpn

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;
}
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)

Example 19 with Evpn

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();
}
Also used : IncMultiEthernetTagResBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.inc.multi.ethernet.tag.res.IncMultiEthernetTagResBuilder) IncMultiEthernetTagResCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.evpn.evpn.choice.IncMultiEthernetTagResCaseBuilder)

Example 20 with Evpn

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;
}
Also used : MacIpAdvRoute(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.mac.ip.adv.route.MacIpAdvRoute) MacIpAdvRouteCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.evpn.evpn.choice.MacIpAdvRouteCase) MplsLabelUtil.byteBufForMplsLabel(org.opendaylight.protocol.util.MplsLabelUtil.byteBufForMplsLabel) 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) Esi(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.Esi) MplsLabelUtil.mplsLabelForByteBuf(org.opendaylight.protocol.util.MplsLabelUtil.mplsLabelForByteBuf) ByteBuf(io.netty.buffer.ByteBuf) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)

Aggregations

ArrayList (java.util.ArrayList)8 ByteBuf (io.netty.buffer.ByteBuf)5 VpnInstance (org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.instances.VpnInstance)4 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)3 BigInteger (java.math.BigInteger)3 ReadFailedException (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)3 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)3 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)3 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)2 NlriModelUtil.extractMplsLabel (org.opendaylight.protocol.bgp.evpn.impl.nlri.NlriModelUtil.extractMplsLabel)2 MplsLabelUtil.byteBufForMplsLabel (org.opendaylight.protocol.util.MplsLabelUtil.byteBufForMplsLabel)2 MplsLabelUtil.mplsLabelForByteBuf (org.opendaylight.protocol.util.MplsLabelUtil.mplsLabelForByteBuf)2 ElanInstance (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance)2 RouterInterface (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.RouterInterface)2 SubnetRoute (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.SubnetRoute)2 VrfTablesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey)2 EvpnRdToNetworkBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.evpn.rd.to.networks.EvpnRdToNetworkBuilder)2 EvpnRdToNetworkKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.evpn.rd.to.networks.EvpnRdToNetworkKey)2 VpnInstanceOpDataEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.VpnInstanceOpDataEntry)2 VpnToDpnList (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.VpnToDpnList)2