use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.LspId in project bgpcep by opendaylight.
the class TeLspIpv6NlriParser method parseObjectType.
@Override
protected ObjectType parseObjectType(final ByteBuf buffer) {
final TeLspCaseBuilder builder = new TeLspCaseBuilder();
final Ipv6CaseBuilder ipv6CaseBuilder = new Ipv6CaseBuilder();
ipv6CaseBuilder.setIpv6TunnelSenderAddress(Ipv6Util.addressForByteBuf(buffer));
builder.setTunnelId(new TunnelId(buffer.readUnsignedShort()));
builder.setLspId(new LspId((long) buffer.readUnsignedShort()));
ipv6CaseBuilder.setIpv6TunnelEndpointAddress(Ipv6Util.addressForByteBuf(buffer));
return builder.setAddressFamily(ipv6CaseBuilder.build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.LspId in project bgpcep by opendaylight.
the class AbstractTeLspNlriCodec method serializeTeLsp.
public static TeLspCase serializeTeLsp(final ChoiceNode objectType) {
final TeLspCaseBuilder teLsp = new TeLspCaseBuilder();
teLsp.setLspId(new LspId((Long) objectType.getChild(LSP_ID).get().getValue()));
teLsp.setTunnelId(new TunnelId((Integer) objectType.getChild(TUNNEL_ID).get().getValue()));
final ChoiceNode addressFamily = (ChoiceNode) objectType.getChild(ADDRESS_FAMILY).get();
teLsp.setAddressFamily(serializeAddressFamily(addressFamily, addressFamily.getChild(IPV4_TUNNEL_SENDER_ADDRESS).isPresent()));
return teLsp.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.LspId in project bgpcep by opendaylight.
the class Stateful07TopologySessionListener method validateReportedLsp.
@Override
protected Lsp validateReportedLsp(final Optional<ReportedLsp> rep, final LspId input) {
if (!rep.isPresent()) {
LOG.debug("Node {} does not contain LSP {}", input.getNode(), input.getName());
return null;
}
// it doesn't matter how many lsps there are in the path list, we only need data that is the same in each path
final Path1 ra = rep.get().getPath().get(0).getAugmentation(Path1.class);
Preconditions.checkState(ra != null, "Reported LSP reported null from data-store.");
final Lsp reportedLsp = ra.getLsp();
Preconditions.checkState(reportedLsp != null, "Reported LSP does not contain LSP object.");
return reportedLsp;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.LspId in project bgpcep by opendaylight.
the class Stateful07TopologySessionListener method buildPath.
private Path buildPath(final Reports report, final Srp srp, final Lsp lsp) {
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.pcep.client.attributes.path.computation.client.reported.lsp.PathBuilder pb = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.pcep.client.attributes.path.computation.client.reported.lsp.PathBuilder();
if (report.getPath() != null) {
pb.fieldsFrom(report.getPath());
}
// LSP is mandatory (if there is none, parser will throw an exception)
// this is to ensure a path will be created at any rate
final Path1Builder p1Builder = new Path1Builder();
p1Builder.setLsp(report.getLsp());
final PathSetupType pst;
if (srp != null && srp.getTlvs() != null && srp.getTlvs().getPathSetupType() != null) {
pst = srp.getTlvs().getPathSetupType();
p1Builder.setPathSetupType(pst);
} else {
pst = null;
}
pb.addAugmentation(Path1.class, p1Builder.build());
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.lsp.Tlvs tlvs = report.getLsp().getTlvs();
if (tlvs != null) {
if (tlvs.getLspIdentifiers() != null) {
pb.setLspId(tlvs.getLspIdentifiers().getLspId());
} else if (!PSTUtil.isDefaultPST(pst)) {
pb.setLspId(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.LspId(lsp.getPlspId().getValue()));
}
}
return pb.build();
}
Aggregations