Search in sources :

Example 26 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 StateSynchronizationAvoidanceProcedureTest method testStateSynchronizationSkipped.

@Test
public void testStateSynchronizationSkipped() throws Exception {
    // session up - sync skipped (LSP-DBs match)
    final LspDbVersion lspDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.ONE).build();
    final PCEPSession session = getPCEPSession(getOpen(lspDbVersion), getOpen(lspDbVersion));
    this.listener.onSessionUp(session);
    // check node - synchronized
    readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
        assertEquals(PccSyncState.Synchronized, pcc.getStateSync());
        return pcc;
    });
}
Also used : PCEPSession(org.opendaylight.protocol.pcep.PCEPSession) LspDbVersion(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.lsp.db.version.tlv.LspDbVersion) LspDbVersionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.lsp.db.version.tlv.LspDbVersionBuilder) Test(org.junit.Test)

Example 27 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 Stateful07TopologySessionListenerTest method testAddAlreadyExistingLsp.

@Test
public void testAddAlreadyExistingLsp() throws UnknownHostException, InterruptedException, ExecutionException {
    this.listener.onSessionUp(this.session);
    this.topologyRpcs.addLsp(createAddLspInput());
    assertEquals(1, this.receivedMsgs.size());
    assertTrue(this.receivedMsgs.get(0) instanceof Pcinitiate);
    final Pcinitiate pcinitiate = (Pcinitiate) this.receivedMsgs.get(0);
    final Requests req = pcinitiate.getPcinitiateMessage().getRequests().get(0);
    final long srpId = req.getSrp().getOperationId().getValue();
    final Tlvs tlvs = createLspTlvs(req.getLsp().getPlspId().getValue(), true, this.testAddress, this.testAddress, this.testAddress, Optional.absent());
    final Pcrpt pcRpt = MsgBuilderUtil.createPcRtpMessage(new LspBuilder(req.getLsp()).setTlvs(tlvs).setPlspId(new PlspId(1L)).setSync(false).setRemove(false).setOperational(OperationalStatus.Active).build(), Optional.of(MsgBuilderUtil.createSrp(srpId)), MsgBuilderUtil.createPath(req.getEro().getSubobject()));
    this.listener.onMessage(this.session, pcRpt);
    // try to add already existing LSP
    final AddLspOutput result = this.topologyRpcs.addLsp(createAddLspInput()).get().getResult();
    assertEquals(FailureType.Unsent, result.getFailure());
    assertEquals(1, result.getError().size());
    final ErrorObject errorObject = result.getError().get(0).getErrorObject();
    assertNotNull(errorObject);
    assertEquals(PCEPErrors.USED_SYMBOLIC_PATH_NAME, PCEPErrors.forValue(errorObject.getType(), errorObject.getValue()));
}
Also used : AddLspOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.AddLspOutput) Tlvs(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.lsp.Tlvs) MsgBuilderUtil.createLspTlvs(org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil.createLspTlvs) Pcrpt(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Pcrpt) ErrorObject(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcep.error.object.ErrorObject) LspBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.LspBuilder) Requests(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev171025.pcinitiate.message.pcinitiate.message.Requests) Pcinitiate(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev171025.Pcinitiate) PlspId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.PlspId) Test(org.junit.Test)

Example 28 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 Stateful07TopologySessionListenerTest method testStateful07TopologySessionListener.

@Test
public void testStateful07TopologySessionListener() throws Exception {
    this.listener.onSessionUp(this.session);
    final PcepSessionState listenerState = this.listener.listenerState;
    assertEquals(this.testAddress, listenerState.getPeerPref().getIpAddress());
    final LocalPref state = this.listener.listenerState.getLocalPref();
    assertNotNull(state);
    assertEquals(DEAD_TIMER, state.getDeadtimer().shortValue());
    assertEquals(KEEP_ALIVE, state.getKeepalive().shortValue());
    assertEquals(0, state.getSessionId().intValue());
    assertEquals(this.testAddress, state.getIpAddress());
    final PeerPref peerState = listenerState.getPeerPref();
    assertEquals(DEAD_TIMER, peerState.getDeadtimer().shortValue());
    assertEquals(KEEP_ALIVE, peerState.getKeepalive().shortValue());
    assertEquals(0, peerState.getSessionId().intValue());
    assertEquals(this.testAddress, peerState.getIpAddress());
    // add-lsp
    this.topologyRpcs.addLsp(createAddLspInput());
    assertEquals(1, this.receivedMsgs.size());
    assertTrue(this.receivedMsgs.get(0) instanceof Pcinitiate);
    final Pcinitiate pcinitiate = (Pcinitiate) this.receivedMsgs.get(0);
    final Requests req = pcinitiate.getPcinitiateMessage().getRequests().get(0);
    final long srpId = req.getSrp().getOperationId().getValue();
    final Tlvs tlvs = createLspTlvs(req.getLsp().getPlspId().getValue(), true, this.testAddress, this.testAddress, this.testAddress, Optional.absent());
    final Pcrpt pcRpt = MsgBuilderUtil.createPcRtpMessage(new LspBuilder(req.getLsp()).setTlvs(tlvs).setPlspId(new PlspId(1L)).setSync(false).setRemove(false).setOperational(OperationalStatus.Active).build(), Optional.of(MsgBuilderUtil.createSrp(srpId)), MsgBuilderUtil.createPath(req.getEro().getSubobject()));
    final Pcrpt esm = MsgBuilderUtil.createPcRtpMessage(new LspBuilder().setSync(false).build(), Optional.of(MsgBuilderUtil.createSrp(0L)), null);
    this.listener.onMessage(this.session, esm);
    readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
        assertEquals(this.testAddress, pcc.getIpAddress().getIpv4Address().getValue());
        // reported lsp so far empty, has not received response (PcRpt) yet
        assertTrue(pcc.getReportedLsp().isEmpty());
        return pcc;
    });
    this.listener.onMessage(this.session, pcRpt);
    // check created lsp
    readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
        assertEquals(1, pcc.getReportedLsp().size());
        final ReportedLsp reportedLsp = pcc.getReportedLsp().get(0);
        assertEquals(this.tunnelName, reportedLsp.getName());
        assertEquals(1, reportedLsp.getPath().size());
        final Path path = reportedLsp.getPath().get(0);
        assertEquals(1, path.getEro().getSubobject().size());
        assertEquals(this.eroIpPrefix, getLastEroIpPrefix(path.getEro()));
        return pcc;
    });
    // check stats
    checkEquals(() -> assertEquals(1, listenerState.getDelegatedLspsCount().intValue()));
    checkEquals(() -> assertTrue(this.listener.isSessionSynchronized()));
    checkEquals(() -> assertTrue(listenerState.getMessages().getAugmentation(StatefulMessagesStatsAug.class).getLastReceivedRptMsgTimestamp() > 0));
    checkEquals(() -> assertEquals(2, listenerState.getMessages().getAugmentation(StatefulMessagesStatsAug.class).getReceivedRptMsgCount().intValue()));
    checkEquals(() -> assertEquals(1, listenerState.getMessages().getAugmentation(StatefulMessagesStatsAug.class).getSentInitMsgCount().intValue()));
    checkEquals(() -> assertEquals(0, listenerState.getMessages().getAugmentation(StatefulMessagesStatsAug.class).getSentUpdMsgCount().intValue()));
    // update-lsp
    final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.update.lsp.args.ArgumentsBuilder updArgsBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.update.lsp.args.ArgumentsBuilder();
    updArgsBuilder.setEro(createEroWithIpPrefixes(Lists.newArrayList(this.eroIpPrefix, this.dstIpPrefix)));
    updArgsBuilder.addAugmentation(Arguments3.class, new Arguments3Builder().setLsp(new LspBuilder().setDelegate(true).setAdministrative(true).build()).build());
    final UpdateLspInput update = new UpdateLspInputBuilder().setArguments(updArgsBuilder.build()).setName(this.tunnelName).setNetworkTopologyRef(new NetworkTopologyRef(TOPO_IID)).setNode(this.nodeId).build();
    this.topologyRpcs.updateLsp(update);
    assertEquals(2, this.receivedMsgs.size());
    assertTrue(this.receivedMsgs.get(1) instanceof Pcupd);
    final Pcupd updateMsg = (Pcupd) this.receivedMsgs.get(1);
    final Updates upd = updateMsg.getPcupdMessage().getUpdates().get(0);
    final long srpId2 = upd.getSrp().getOperationId().getValue();
    final Tlvs tlvs2 = createLspTlvs(upd.getLsp().getPlspId().getValue(), false, this.newDestinationAddress, this.testAddress, this.testAddress, Optional.absent());
    final Pcrpt pcRpt2 = MsgBuilderUtil.createPcRtpMessage(new LspBuilder(upd.getLsp()).setTlvs(tlvs2).setSync(true).setRemove(false).setOperational(OperationalStatus.Active).build(), Optional.of(MsgBuilderUtil.createSrp(srpId2)), MsgBuilderUtil.createPath(upd.getPath().getEro().getSubobject()));
    this.listener.onMessage(this.session, pcRpt2);
    // check updated lsp
    readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
        assertEquals(1, pcc.getReportedLsp().size());
        final ReportedLsp reportedLsp = pcc.getReportedLsp().get(0);
        assertEquals(this.tunnelName, reportedLsp.getName());
        assertEquals(1, reportedLsp.getPath().size());
        final Path path = reportedLsp.getPath().get(0);
        assertEquals(2, path.getEro().getSubobject().size());
        assertEquals(this.dstIpPrefix, getLastEroIpPrefix(path.getEro()));
        assertEquals(1, listenerState.getDelegatedLspsCount().intValue());
        assertTrue(this.listener.isSessionSynchronized());
        final StatefulMessagesStatsAug statefulstate = listenerState.getMessages().getAugmentation(StatefulMessagesStatsAug.class);
        assertTrue(statefulstate.getLastReceivedRptMsgTimestamp() > 0);
        assertEquals(3, statefulstate.getReceivedRptMsgCount().intValue());
        assertEquals(1, statefulstate.getSentInitMsgCount().intValue());
        assertEquals(1, statefulstate.getSentUpdMsgCount().intValue());
        final ReplyTime replyTime = listenerState.getMessages().getReplyTime();
        assertTrue(replyTime.getAverageTime() > 0);
        assertTrue(replyTime.getMaxTime() > 0);
        final StatefulCapabilitiesStatsAug statefulCapabilities = listenerState.getPeerCapabilities().getAugmentation(StatefulCapabilitiesStatsAug.class);
        assertFalse(statefulCapabilities.isActive());
        assertTrue(statefulCapabilities.isInstantiation());
        assertTrue(statefulCapabilities.isStateful());
        return pcc;
    });
    // ensure-operational
    final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.ensure.lsp.operational.args.ArgumentsBuilder ensureArgs = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.ensure.lsp.operational.args.ArgumentsBuilder();
    ensureArgs.addAugmentation(Arguments1.class, new Arguments1Builder().setOperational(OperationalStatus.Active).build());
    final EnsureLspOperationalInput ensure = new EnsureLspOperationalInputBuilder().setArguments(ensureArgs.build()).setName(this.tunnelName).setNetworkTopologyRef(new NetworkTopologyRef(TOPO_IID)).setNode(this.nodeId).build();
    final OperationResult result = this.topologyRpcs.ensureLspOperational(ensure).get().getResult();
    // check result
    assertNull(result.getFailure());
    // remove-lsp
    final RemoveLspInput remove = new RemoveLspInputBuilder().setName(this.tunnelName).setNetworkTopologyRef(new NetworkTopologyRef(TOPO_IID)).setNode(this.nodeId).build();
    this.topologyRpcs.removeLsp(remove);
    assertEquals(3, this.receivedMsgs.size());
    assertTrue(this.receivedMsgs.get(2) instanceof Pcinitiate);
    final Pcinitiate pcinitiate2 = (Pcinitiate) this.receivedMsgs.get(2);
    final Requests req2 = pcinitiate2.getPcinitiateMessage().getRequests().get(0);
    final long srpId3 = req2.getSrp().getOperationId().getValue();
    final Tlvs tlvs3 = createLspTlvs(req2.getLsp().getPlspId().getValue(), false, this.testAddress, this.testAddress, this.testAddress, Optional.absent());
    final Pcrpt pcRpt3 = MsgBuilderUtil.createPcRtpMessage(new LspBuilder(req2.getLsp()).setTlvs(tlvs3).setRemove(true).setSync(true).setOperational(OperationalStatus.Down).build(), Optional.of(MsgBuilderUtil.createSrp(srpId3)), MsgBuilderUtil.createPath(Collections.emptyList()));
    this.listener.onMessage(this.session, pcRpt3);
    // check if lsp was removed
    readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
        assertEquals(0, pcc.getReportedLsp().size());
        return pcc;
    });
    // check stats
    checkEquals(() -> assertEquals(0, listenerState.getDelegatedLspsCount().intValue()));
    checkEquals(() -> assertTrue(this.listener.isSessionSynchronized()));
    checkEquals(() -> assertTrue(listenerState.getMessages().getAugmentation(StatefulMessagesStatsAug.class).getLastReceivedRptMsgTimestamp() > 0));
    checkEquals(() -> assertEquals(4, listenerState.getMessages().getAugmentation(StatefulMessagesStatsAug.class).getReceivedRptMsgCount().intValue()));
    checkEquals(() -> assertEquals(2, listenerState.getMessages().getAugmentation(StatefulMessagesStatsAug.class).getSentInitMsgCount().intValue()));
    checkEquals(() -> assertEquals(1, listenerState.getMessages().getAugmentation(StatefulMessagesStatsAug.class).getSentUpdMsgCount().intValue()));
}
Also used : NetworkTopologyRef(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.topology.rev140113.NetworkTopologyRef) StatefulCapabilitiesStatsAug(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stateful.stats.rev171113.StatefulCapabilitiesStatsAug) PcepSessionState(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.PcepSessionState) Collections(java.util.Collections) RemoveLspInput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.RemoveLspInput) OperationResult(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.OperationResult) EnsureLspOperationalInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.EnsureLspOperationalInputBuilder) Requests(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev171025.pcinitiate.message.pcinitiate.message.Requests) ReportedLsp(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.pcep.client.attributes.path.computation.client.ReportedLsp) UpdateLspInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.UpdateLspInputBuilder) LocalPref(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.LocalPref) Pcrpt(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Pcrpt) Updates(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.Updates) EnsureLspOperationalInput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.EnsureLspOperationalInput) Arguments1Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Arguments1Builder) Pcinitiate(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev171025.Pcinitiate) PlspId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.PlspId) Path(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.pcep.client.attributes.path.computation.client.reported.lsp.Path) Pcupd(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Pcupd) Arguments3Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Arguments3Builder) ArgumentsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.add.lsp.args.ArgumentsBuilder) UpdateLspInput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.UpdateLspInput) ReplyTime(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.reply.time.grouping.ReplyTime) Tlvs(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.lsp.Tlvs) MsgBuilderUtil.createLspTlvs(org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil.createLspTlvs) LspBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.LspBuilder) RemoveLspInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.RemoveLspInputBuilder) PeerPref(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.PeerPref) StatefulMessagesStatsAug(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stateful.stats.rev171113.StatefulMessagesStatsAug) Test(org.junit.Test)

Example 29 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 AttributesObjectParser method localParseObject.

@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
    final LspAttributesObjectBuilder builder = new LspAttributesObjectBuilder();
    final List<SubobjectContainer> subObjectList = new ArrayList<>();
    while (byteBuf.isReadable()) {
        final int type = byteBuf.readUnsignedShort();
        final int length = byteBuf.readUnsignedShort();
        final ByteBuf value = byteBuf.readSlice(length);
        final SubobjectContainerBuilder subObj = new SubobjectContainerBuilder();
        if (type == FLAG_TLV_TYPE) {
            subObj.setLspSubobject(new FlagsTlvBuilder().setFlagContainer(parseFlag(value)).build());
        } else {
            LOG.warn("Lsp Attributes Subobject type {} not supported", type);
        }
        subObjectList.add(subObj.build());
    }
    return builder.setSubobjectContainer(subObjectList).build();
}
Also used : SubobjectContainer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.lsp.attributes.object.lsp.attributes.object.SubobjectContainer) SubobjectContainerBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.lsp.attributes.object.lsp.attributes.object.SubobjectContainerBuilder) ArrayList(java.util.ArrayList) LspAttributesObjectBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.lsp.attributes.object.LspAttributesObjectBuilder) ByteBuf(io.netty.buffer.ByteBuf) FlagsTlvBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.lsp.att.subobject.lsp.subobject.FlagsTlvBuilder)

Example 30 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 Stateful07LSPIdentifierIpv4TlvParser method serializeTlv.

@Override
public void serializeTlv(final Tlv tlv, final ByteBuf buffer) {
    Preconditions.checkArgument(tlv instanceof LspIdentifiers, "LspIdentifiersTlv is mandatory.");
    final LspIdentifiers lsp = (LspIdentifiers) tlv;
    final AddressFamily afi = lsp.getAddressFamily();
    final ByteBuf body = Unpooled.buffer();
    if (afi.getImplementedInterface().equals(Ipv6Case.class)) {
        new Stateful07LSPIdentifierIpv6TlvParser().serializeTlv(tlv, buffer);
    }
    final Ipv4 ipv4 = ((Ipv4Case) afi).getIpv4();
    Preconditions.checkArgument(ipv4.getIpv4TunnelSenderAddress() != null, "Ipv4TunnelSenderAddress is mandatory.");
    writeIpv4Address(ipv4.getIpv4TunnelSenderAddress(), body);
    Preconditions.checkArgument(lsp.getLspId() != null, "LspId is mandatory.");
    writeShort(lsp.getLspId().getValue().shortValue(), body);
    Preconditions.checkArgument(lsp.getTunnelId() != null, "TunnelId is mandatory.");
    writeUnsignedShort(lsp.getTunnelId().getValue(), body);
    Preconditions.checkArgument(ipv4.getIpv4ExtendedTunnelId() != null, "Ipv4ExtendedTunnelId is mandatory.");
    writeIpv4Address(ipv4.getIpv4ExtendedTunnelId(), body);
    Preconditions.checkArgument(ipv4.getIpv4TunnelEndpointAddress() != null, "Ipv4TunnelEndpointAddress is mandatory.");
    writeIpv4Address(ipv4.getIpv4TunnelEndpointAddress(), body);
    TlvUtil.formatTlv(TYPE, body, buffer);
}
Also used : LspIdentifiers(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.identifiers.tlv.LspIdentifiers) Ipv4(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv4._case.Ipv4) AddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.identifiers.tlv.lsp.identifiers.AddressFamily) ByteBuf(io.netty.buffer.ByteBuf) Ipv4Case(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.identifiers.tlv.lsp.identifiers.address.family.Ipv4Case)

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