Search in sources :

Example 16 with Esi

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

the class LanParser method serializeBody.

@Override
public void serializeBody(final Esi esi, final ByteBuf body) {
    Preconditions.checkArgument(esi instanceof LanAutoGeneratedCase, "Unknown esi instance. Passed %s. Needed LanAutoGeneratedCase.", esi.getClass());
    final LanAutoGenerated lan = ((LanAutoGeneratedCase) esi).getLanAutoGenerated();
    body.writeBytes(IetfYangUtil.INSTANCE.bytesFor(lan.getRootBridgeMacAddress()));
    ByteBufWriteUtil.writeUnsignedShort(lan.getRootBridgePriority(), body);
    body.writeZero(ZERO_BYTE);
}
Also used : LanAutoGeneratedCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.LanAutoGeneratedCase) LanAutoGenerated(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.lan.auto.generated._case.LanAutoGenerated)

Example 17 with Esi

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

the class MacParser method serializeBody.

@Override
public void serializeBody(final Esi esi, final ByteBuf body) {
    Preconditions.checkArgument(esi instanceof MacAutoGeneratedCase, "Unknown esi instance. Passed %s. Needed MacAutoGeneratedCase.", esi.getClass());
    final MacAutoGenerated macAuto = ((MacAutoGeneratedCase) esi).getMacAutoGenerated();
    body.writeBytes(IetfYangUtil.INSTANCE.bytesFor(macAuto.getSystemMacAddress()));
    ByteBufWriteUtil.writeMedium(macAuto.getLocalDiscriminator().getValue().intValue(), body);
}
Also used : MacAutoGenerated(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.mac.auto.generated._case.MacAutoGenerated) MacAutoGeneratedCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.MacAutoGeneratedCase)

Example 18 with Esi

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

the class RouterIdParser method serializeBody.

@Override
public void serializeBody(final Esi esi, final ByteBuf body) {
    Preconditions.checkArgument(esi instanceof RouterIdGeneratedCase, "Unknown esi instance. Passed %s. Needed RouterIdGeneratedCase.", esi.getClass());
    final RouterIdGenerated routerID = ((RouterIdGeneratedCase) esi).getRouterIdGenerated();
    ByteBufWriteUtil.writeIpv4Address(routerID.getRouterId(), body);
    ByteBufWriteUtil.writeUnsignedInt(routerID.getLocalDiscriminator(), body);
    body.writeZero(ZERO_BYTE);
}
Also used : RouterIdGenerated(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.router.id.generated._case.RouterIdGenerated) RouterIdGeneratedCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.RouterIdGeneratedCase)

Example 19 with Esi

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

the class RouterIdParser method serializeEsi.

@Override
public Esi serializeEsi(final ContainerNode esi) {
    final RouterIdGeneratedBuilder builder = new RouterIdGeneratedBuilder();
    builder.setLocalDiscriminator(extractLD(esi));
    builder.setRouterId(extractRD(esi));
    return new RouterIdGeneratedCaseBuilder().setRouterIdGenerated(builder.build()).build();
}
Also used : RouterIdGeneratedCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.RouterIdGeneratedCaseBuilder) RouterIdGeneratedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.router.id.generated._case.RouterIdGeneratedBuilder)

Example 20 with Esi

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

the class ASGenParser method serializeBody.

@Override
public void serializeBody(final Esi esi, final ByteBuf body) {
    Preconditions.checkArgument(esi instanceof AsGeneratedCase, "Unknown esi instance. Passed %s. Needed AsGeneratedCase.", esi.getClass());
    final AsGenerated asGen = ((AsGeneratedCase) esi).getAsGenerated();
    writeUnsignedInt(asGen.getAs().getValue(), body);
    writeUnsignedInt(asGen.getLocalDiscriminator(), body);
    body.writeZero(ZERO_BYTE);
}
Also used : AsGeneratedCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.AsGeneratedCase) AsGenerated(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.as.generated._case.AsGenerated)

Aggregations

Esi (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.Esi)10 ByteBuf (io.netty.buffer.ByteBuf)7 Test (org.junit.Test)6 NlriModelUtil.extractMplsLabel (org.opendaylight.protocol.bgp.evpn.impl.nlri.NlriModelUtil.extractMplsLabel)3 MplsLabelUtil.byteBufForMplsLabel (org.opendaylight.protocol.util.MplsLabelUtil.byteBufForMplsLabel)3 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)3 MplsLabel (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel)3 NodeIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier)3 ContainerNode (org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)3 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)2 AsGeneratedCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.AsGeneratedCase)2 AsGeneratedCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.AsGeneratedCaseBuilder)2 LacpAutoGeneratedCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.LacpAutoGeneratedCase)2 LacpAutoGeneratedCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.LacpAutoGeneratedCaseBuilder)2 MacAutoGeneratedCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.MacAutoGeneratedCase)2 MacAutoGeneratedCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.MacAutoGeneratedCaseBuilder)2 AsGeneratedBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.as.generated._case.AsGeneratedBuilder)2 MacAutoGeneratedBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.mac.auto.generated._case.MacAutoGeneratedBuilder)2 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1