Search in sources :

Example 1 with Esi

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

the class LacpParser method serializeEsi.

@Override
public Esi serializeEsi(final ContainerNode esi) {
    final LacpAutoGeneratedBuilder builder = new LacpAutoGeneratedBuilder();
    builder.setCeLacpMacAddress(extractLacpMac(esi));
    builder.setCeLacpPortKey(extractPK(esi));
    return new LacpAutoGeneratedCaseBuilder().setLacpAutoGenerated(builder.build()).build();
}
Also used : LacpAutoGeneratedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.lacp.auto.generated._case.LacpAutoGeneratedBuilder) LacpAutoGeneratedCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.LacpAutoGeneratedCaseBuilder)

Example 2 with Esi

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

the class LanParser method serializeEsi.

@Override
public Esi serializeEsi(final ContainerNode esi) {
    final LanAutoGeneratedBuilder lanBuilder = new LanAutoGeneratedBuilder();
    lanBuilder.setRootBridgeMacAddress(extractBrigeMac(esi));
    lanBuilder.setRootBridgePriority(extractBP(esi));
    return new LanAutoGeneratedCaseBuilder().setLanAutoGenerated(lanBuilder.build()).build();
}
Also used : LanAutoGeneratedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.lan.auto.generated._case.LanAutoGeneratedBuilder) LanAutoGeneratedCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.LanAutoGeneratedCaseBuilder)

Example 3 with Esi

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

the class MacParser method serializeEsi.

@Override
public Esi serializeEsi(final ContainerNode esi) {
    final MacAutoGeneratedBuilder builder = new MacAutoGeneratedBuilder();
    builder.setSystemMacAddress(extractSystmeMac(esi));
    builder.setLocalDiscriminator(extractUint24LD(esi));
    return new MacAutoGeneratedCaseBuilder().setMacAutoGenerated(builder.build()).build();
}
Also used : MacAutoGeneratedCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.MacAutoGeneratedCaseBuilder) MacAutoGeneratedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.mac.auto.generated._case.MacAutoGeneratedBuilder)

Example 4 with Esi

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

the class ASGenParser method serializeEsi.

@Override
public Esi serializeEsi(final ContainerNode esi) {
    final AsGeneratedBuilder builder = new AsGeneratedBuilder();
    builder.setLocalDiscriminator(extractLD(esi));
    builder.setAs(extractAS(esi));
    return new AsGeneratedCaseBuilder().setAsGenerated(builder.build()).build();
}
Also used : AsGeneratedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.as.generated._case.AsGeneratedBuilder) AsGeneratedCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.esi.AsGeneratedCaseBuilder)

Example 5 with Esi

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

the class ASGenParserTest method parserTest.

@Test
public void parserTest() {
    final ByteBuf buff = Unpooled.buffer(VALUE_SIZE);
    final AsGeneratedCase asGen = new AsGeneratedCaseBuilder().setAsGenerated(new AsGeneratedBuilder().setAs(AS_NUMBER).setLocalDiscriminator(LD).build()).build();
    this.parser.serializeEsi(asGen, buff);
    assertArrayEquals(RESULT, ByteArray.getAllBytes(buff));
    final Esi acResult = this.parser.parseEsi(Unpooled.wrappedBuffer(VALUE));
    assertEquals(asGen, acResult);
    final ContainerNode cont = createContBuilder(new NodeIdentifier(AsGenerated.QNAME)).addChild(createValueBuilder(AS_MODEL, AS_NID).build()).addChild(createValueBuilder(LD, LD_NID).build()).build();
    final Esi acmResult = this.parser.serializeEsi(cont);
    assertEquals(asGen, acmResult);
}
Also used : AsGeneratedCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.esi.esi.AsGeneratedCase) AsGeneratedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.esi.esi.as.generated._case.AsGeneratedBuilder) NodeIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier) AsGeneratedCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.esi.esi.AsGeneratedCaseBuilder) Esi(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.esi.Esi) ContainerNode(org.opendaylight.yangtools.yang.data.api.schema.ContainerNode) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Aggregations

Esi (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.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 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 IpAddressNoZone (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone)2 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 SocketException (java.net.SocketException)1 ExecutionException (java.util.concurrent.ExecutionException)1 TimeoutException (java.util.concurrent.TimeoutException)1 TApplicationException (org.apache.thrift.TApplicationException)1 TException (org.apache.thrift.TException)1 TransactionCommitFailedException (org.opendaylight.mdsal.common.api.TransactionCommitFailedException)1 CandidateAlreadyRegisteredException (org.opendaylight.mdsal.eos.common.api.CandidateAlreadyRegisteredException)1 BgpRouter (org.opendaylight.netvirt.bgpmanager.thrift.client.BgpRouter)1 BgpRouterException (org.opendaylight.netvirt.bgpmanager.thrift.client.BgpRouterException)1