use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.srp.Tlvs in project bgpcep by opendaylight.
the class InitiationHandler method serializeTlvs.
private void serializeTlvs(final Tlvs tlvs, final ByteBuf output) {
serializeTlv(tlvs.getNameTlv(), output);
serializeTlv(tlvs.getDescriptionTlv(), output);
if (tlvs.getStringInformation() != null) {
for (final StringInformation stringInfo : tlvs.getStringInformation()) {
if (stringInfo.getStringTlv() != null) {
serializeTlv(stringInfo.getStringTlv(), output);
}
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.srp.Tlvs in project bgpcep by opendaylight.
the class RouteMirroringMessageHandler method serializeTlvs.
protected void serializeTlvs(final Tlvs tlvs, final ByteBuf output) {
final ByteBuf tlvsBuffer = Unpooled.buffer();
if (tlvs.getMirrorInformationTlv() != null) {
serializeTlv(tlvs.getMirrorInformationTlv(), tlvsBuffer);
}
if (tlvs.getPduUpdateTlv() != null) {
getBgpMessageRegistry().serializeMessage(new UpdateBuilder(tlvs.getPduUpdateTlv()).build(), tlvsBuffer);
}
if (tlvs.getPduOpenTlv() != null) {
getBgpMessageRegistry().serializeMessage(new OpenBuilder(tlvs.getPduOpenTlv()).build(), tlvsBuffer);
}
output.writeBytes(tlvsBuffer);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.srp.Tlvs in project bgpcep by opendaylight.
the class AbstractObjectWithTlvsParser method serializeVendorInformationTlvs.
protected final void serializeVendorInformationTlvs(final List<VendorInformationTlv> tlvs, final ByteBuf buffer) {
if (tlvs != null) {
for (final VendorInformationTlv tlv : tlvs) {
LOG.trace("Serializing VENDOR-INFORMATION TLV {}", tlv);
this.viTlvReg.serializeVendorInformationTlv(tlv, buffer);
LOG.trace("Serialized VENDOR-INFORMATION TLV : {}.", ByteBufUtil.hexDump(buffer));
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.srp.Tlvs in project bgpcep by opendaylight.
the class PCCTunnelManagerImpl method sendEndOfSynchronization.
private void sendEndOfSynchronization(final PCCSession session, final Optional<SrpIdNumber> operationId) {
Srp srp = null;
if (operationId.isPresent()) {
srp = new SrpBuilder().setOperationId(operationId.get()).build();
}
Optional<Tlvs> tlv = Optional.absent();
if (this.syncOptimization.isSyncAvoidanceEnabled()) {
tlv = createLspTlvsEndofSync(this.syncOptimization.incrementLspDBVersion().get());
}
final Pcrpt pcrtp = createPcRtpMessage(createLsp(0, false, tlv, true, false), Optional.fromNullable(srp), createPath(Collections.emptyList()));
session.sendReport(pcrtp);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.srp.object.srp.Tlvs in project bgpcep by opendaylight.
the class PCCTunnelManagerImpl method takeDelegation.
protected void takeDelegation(final Requests request, final PCCSession session) {
final PlspId plspId = request.getLsp().getPlspId();
final PCCTunnel tunnel = this.tunnels.get(plspId);
final long srpId = request.getSrp().getOperationId().getValue();
if (tunnel != null) {
// check if tunnel has no delegation
if ((tunnel.getType() == LspType.PCE_LSP) && ((tunnel.getDelegationHolder() == -1) || (tunnel.getDelegationHolder() == session.getId()))) {
// set delegation
tunnel.cancelTimeouts();
setDelegation(plspId, session);
// send report
final Tlvs tlvs = buildTlvs(tunnel, plspId.getValue(), Optional.absent());
session.sendReport(createPcRtpMessage(new LspBuilder(request.getLsp()).setSync(true).setOperational(OperationalStatus.Up).setDelegate(true).setTlvs(tlvs).build(), Optional.of(createSrp(srpId)), tunnel.getLspState()));
} else {
session.sendError(MsgBuilderUtil.createErrorMsg(PCEPErrors.LSP_NOT_PCE_INITIATED, srpId));
}
} else {
session.sendError(MsgBuilderUtil.createErrorMsg(PCEPErrors.UNKNOWN_PLSP_ID, srpId));
}
}
Aggregations