Search in sources :

Example 51 with Lsp

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp in project bgpcep by opendaylight.

the class PCCTriggeredFullDBResyncTest method createTriggerLspResync.

private static Message createTriggerLspResync() {
    final SrpBuilder srpBuilder = new SrpBuilder();
    srpBuilder.setOperationId(new SrpIdNumber(1L));
    srpBuilder.setProcessingRule(Boolean.TRUE);
    final Srp srp = srpBuilder.build();
    final Lsp lsp = new LspBuilder().setPlspId(new PlspId(0L)).setSync(Boolean.TRUE).build();
    final UpdatesBuilder rb = new UpdatesBuilder();
    rb.setSrp(srp);
    rb.setLsp(lsp);
    final PathBuilder pb = new PathBuilder();
    rb.setPath(pb.build());
    final PcupdMessageBuilder ub = new PcupdMessageBuilder();
    ub.setUpdates(Collections.singletonList(rb.build()));
    return new PcupdBuilder().setPcupdMessage(ub.build()).build();
}
Also used : Srp(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.Srp) PathBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.updates.PathBuilder) SrpBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.SrpBuilder) SrpIdNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.SrpIdNumber) Lsp(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp) PcupdMessageBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.PcupdMessageBuilder) LspBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.LspBuilder) UpdatesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.UpdatesBuilder) PcupdBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.PcupdBuilder) PlspId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.PlspId)

Example 52 with Lsp

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp in project bgpcep by opendaylight.

the class PCCTriggeredLspResyncTest method createTriggerLspResync.

private static Message createTriggerLspResync() {
    final SrpBuilder srpBuilder = new SrpBuilder();
    srpBuilder.setOperationId(new SrpIdNumber(1L));
    srpBuilder.setProcessingRule(Boolean.TRUE);
    final Srp srp = srpBuilder.build();
    final Lsp lsp = new LspBuilder().setPlspId(new PlspId(2L)).setSync(Boolean.TRUE).build();
    final UpdatesBuilder rb = new UpdatesBuilder();
    rb.setSrp(srp);
    rb.setLsp(lsp);
    final PathBuilder pb = new PathBuilder();
    rb.setPath(pb.build());
    final PcupdMessageBuilder ub = new PcupdMessageBuilder();
    ub.setUpdates(Collections.singletonList(rb.build()));
    return new PcupdBuilder().setPcupdMessage(ub.build()).build();
}
Also used : Srp(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.Srp) PathBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.updates.PathBuilder) SrpBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.SrpBuilder) SrpIdNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.SrpIdNumber) Lsp(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp) PcupdMessageBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.PcupdMessageBuilder) LspBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.LspBuilder) UpdatesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.UpdatesBuilder) PcupdBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.PcupdBuilder) PlspId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.PlspId)

Example 53 with Lsp

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp in project bgpcep by opendaylight.

the class PCCTriggeredSyncTest method createTriggerMsg.

private static Message createTriggerMsg() {
    final UpdatesBuilder rb = new UpdatesBuilder();
    // create PCUpd with mandatory objects and LSP object set to 1
    final SrpBuilder srpBuilder = new SrpBuilder();
    srpBuilder.setIgnore(false);
    srpBuilder.setProcessingRule(false);
    srpBuilder.setOperationId(new SrpIdNumber(1L));
    final Srp srp = srpBuilder.build();
    rb.setSrp(srp);
    final Lsp lsp = new LspBuilder().setPlspId(new PlspId(0L)).setSync(Boolean.TRUE).build();
    rb.setLsp(lsp);
    final PathBuilder pb = new PathBuilder();
    rb.setPath(pb.build());
    final PcupdMessageBuilder ub = new PcupdMessageBuilder();
    ub.setUpdates(Collections.singletonList(rb.build()));
    return new PcupdBuilder().setPcupdMessage(ub.build()).build();
}
Also used : Srp(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.Srp) PathBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.updates.PathBuilder) SrpBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.SrpBuilder) SrpIdNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.SrpIdNumber) Lsp(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp) PcupdMessageBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.PcupdMessageBuilder) LspBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.LspBuilder) UpdatesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.UpdatesBuilder) PcupdBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.PcupdBuilder) PlspId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.PlspId)

Example 54 with Lsp

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp in project bgpcep by opendaylight.

the class TopologyProviderTest method testOnReportMessage.

@Test
public void testOnReportMessage() throws ReadFailedException {
    this.listener.onSessionUp(this.session);
    Pcrpt pcRptMsg = createSrPcRpt("1.1.1.1", "sr-path1", 1L, true);
    this.listener.onMessage(this.session, pcRptMsg);
    readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
        // check sr-path
        final List<ReportedLsp> reportedLsps = pcc.getReportedLsp();
        assertNotNull(reportedLsps);
        assertEquals(1, reportedLsps.size());
        final ReportedLsp lsp = reportedLsps.get(0);
        assertEquals("sr-path1", lsp.getName());
        assertEquals(1, lsp.getPath().get(0).getAugmentation(Path1.class).getPathSetupType().getPst().intValue());
        final List<Subobject> subobjects = lsp.getPath().get(0).getEro().getSubobject();
        assertEquals(1, subobjects.size());
        assertEquals("1.1.1.1", ((IpNodeId) ((SrEroType) subobjects.get(0).getSubobjectType()).getNai()).getIpAddress().getIpv4Address().getValue());
        return pcc;
    });
    pcRptMsg = createSrPcRpt("1.1.1.3", "sr-path2", 2L, false);
    this.listener.onMessage(this.session, pcRptMsg);
    readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
        // check second lsp sr-path
        final List<ReportedLsp> reportedLsps = pcc.getReportedLsp();
        assertNotNull(reportedLsps);
        assertEquals(2, reportedLsps.size());
        return pcc;
    });
    pcRptMsg = createSrPcRpt("1.1.1.2", "sr-path1", 1L, true);
    this.listener.onMessage(this.session, pcRptMsg);
    readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
        // check updated sr-path
        final List<ReportedLsp> reportedLsps = pcc.getReportedLsp();
        assertNotNull(reportedLsps);
        assertEquals(2, reportedLsps.size());
        for (final ReportedLsp rlsp : reportedLsps) {
            if (rlsp.getName().equals("sr-path1")) {
                final List<Subobject> subobjects = rlsp.getPath().get(0).getEro().getSubobject();
                assertEquals(1, subobjects.size());
                assertEquals("1.1.1.2", ((IpNodeId) ((SrEroType) subobjects.get(0).getSubobjectType()).getNai()).getIpAddress().getIpv4Address().getValue());
            }
        }
        return pcc;
    });
}
Also used : ReportedLsp(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.pcep.client.attributes.path.computation.client.ReportedLsp) Subobject(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject) Pcrpt(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Pcrpt) SrEroType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev171025.network.topology.topology.node.path.computation.client.reported.lsp.path.ero.subobject.subobject.type.SrEroType) AbstractPCEPSessionTest(org.opendaylight.bgpcep.pcep.topology.provider.AbstractPCEPSessionTest) Test(org.junit.Test)

Example 55 with Lsp

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp in project bgpcep by opendaylight.

the class MsgBuilderUtil method createLsp.

public static Lsp createLsp(final long plspId, final boolean sync, final Optional<Tlvs> tlvs, final boolean isDelegatedLsp, final boolean remove) {
    final LspBuilder lspBuilder = new LspBuilder();
    lspBuilder.setAdministrative(true);
    lspBuilder.setDelegate(isDelegatedLsp);
    lspBuilder.setIgnore(false);
    lspBuilder.setOperational(OperationalStatus.Up);
    lspBuilder.setPlspId(new PlspId(plspId));
    lspBuilder.setProcessingRule(false);
    lspBuilder.setRemove(remove);
    lspBuilder.setSync(sync);
    lspBuilder.setTlvs(tlvs.orNull());
    return lspBuilder.build();
}
Also used : LspBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.LspBuilder) PlspId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.PlspId)

Aggregations

PlspId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.PlspId)20 LspBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.LspBuilder)18 Test (org.junit.Test)14 Lsp (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.Lsp)14 Pcrpt (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Pcrpt)12 ReportedLsp (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.pcep.client.attributes.path.computation.client.ReportedLsp)11 ByteBuf (io.netty.buffer.ByteBuf)8 SrpBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.SrpBuilder)8 SrpIdNumber (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.SrpIdNumber)7 PathBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.updates.PathBuilder)7 UpdatesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.UpdatesBuilder)6 Srp (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.Srp)6 Collections (java.util.Collections)5 MsgBuilderUtil.createLspTlvs (org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil.createLspTlvs)5 LspDbVersion (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.lsp.db.version.tlv.LspDbVersion)5 Requests (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev171025.pcinitiate.message.pcinitiate.message.Requests)5 Tlvs (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.lsp.Tlvs)5 PCEPSession (org.opendaylight.protocol.pcep.PCEPSession)4 LspDbVersionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.lsp.db.version.tlv.LspDbVersionBuilder)4 RequestsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev171025.pcinitiate.message.pcinitiate.message.RequestsBuilder)4