Search in sources :

Example 1 with EthernetADRouteCaseBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.evpn.evpn.choice.EthernetADRouteCaseBuilder in project bgpcep by opendaylight.

the class EthADRParser method serializeEvpnModel.

@Override
public EvpnChoice serializeEvpnModel(final ContainerNode evpn) {
    final EthernetADRouteBuilder builder = serializeKeyModel(evpn);
    builder.setMplsLabel(extractMplsLabel(evpn, MPLS_NID));
    return new EthernetADRouteCaseBuilder().setEthernetADRoute(builder.build()).build();
}
Also used : EthernetADRouteCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.evpn.evpn.choice.EthernetADRouteCaseBuilder) EthernetADRouteBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.ethernet.a.d.route.EthernetADRouteBuilder)

Example 2 with EthernetADRouteCaseBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.evpn.evpn.choice.EthernetADRouteCaseBuilder in project bgpcep by opendaylight.

the class EthADRParser method parseEvpn.

@Override
public EvpnChoice parseEvpn(final ByteBuf buffer) {
    Preconditions.checkArgument(buffer.readableBytes() == CONTENT_LENGTH, "Wrong length of array of bytes. Passed: %s ;", buffer);
    final Esi esi = SimpleEsiTypeRegistry.getInstance().parseEsi(buffer.readSlice(ESI_SIZE));
    final EthernetTagId eti = new EthernetTagIdBuilder().setVlanId(buffer.readUnsignedInt()).build();
    final MplsLabel label = mplsLabelForByteBuf(buffer);
    final EthernetADRouteBuilder builder = new EthernetADRouteBuilder().setEsi(esi).setEthernetTagId(eti).setMplsLabel(label);
    return new EthernetADRouteCaseBuilder().setEthernetADRoute(builder.build()).build();
}
Also used : EthernetTagIdBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.ethernet.tag.id.EthernetTagIdBuilder) 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) EthernetADRouteCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.evpn.evpn.choice.EthernetADRouteCaseBuilder) Esi(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.Esi) EthernetTagId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.ethernet.tag.id.EthernetTagId) EthernetADRouteBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.ethernet.a.d.route.EthernetADRouteBuilder)

Aggregations

EthernetADRouteBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.ethernet.a.d.route.EthernetADRouteBuilder)2 EthernetADRouteCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.evpn.evpn.choice.EthernetADRouteCaseBuilder)2 NlriModelUtil.extractMplsLabel (org.opendaylight.protocol.bgp.evpn.impl.nlri.NlriModelUtil.extractMplsLabel)1 MplsLabelUtil.byteBufForMplsLabel (org.opendaylight.protocol.util.MplsLabelUtil.byteBufForMplsLabel)1 Esi (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.Esi)1 EthernetTagId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.ethernet.tag.id.EthernetTagId)1 EthernetTagIdBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.ethernet.tag.id.EthernetTagIdBuilder)1 MplsLabel (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel)1