}
}
+ grouping sr-description {
+ description "Segment Routing path description";
+ leaf sid {
+ description "Segment Routing Identifier as an Index or MPLS label";
+ when "path-constraints/address-family = 2 or path-constraints/address-family = 3";
+ type uint32;
+ }
+ leaf local-ipv4 {
+ description "Local IPv4 address";
+ when "path-constraints/address-family = 2";
+ type inet:ipv4-address;
+ }
+ leaf remote-ipv4 {
+ description "Remote IPv4 address";
+ when "path-constraints/address-family = 2";
+ type inet:ipv4-address;
+ }
+ leaf local-ipv6 {
+ description "Local IPv4 address";
+ when "path-constraints/address-family = 3";
+ type inet:ipv6-address;
+ }
+ leaf remote-ipv6 {
+ description "Remote IPv4 address";
+ when "path-constraints/address-family = 3";
+ type inet:ipv6-address;
+ }
+ }
+
grouping path-descriptions {
description
- "Computed Path description as a list of IPv4, IPv6 or MPLS Label";
+ "Computed Path description as a list of IPv4, IPv6 or Segment Routing subobject";
list path-description {
leaf ipv4 {
when "path-constraints/address-family = 0";
when "path-constraints/address-family = 1";
type inet:ipv6-address;
}
- leaf label {
- when "path-constraints/address-family = 2 or path-constraints/address-family = 3";
- type netc:mpls-label;
- }
+ uses sr-description;
}
}
break;
case SrIpv4:
if (getIpv4NodeSid(edge.getDestination()) == null) {
- LOG.debug("No SR-Ipv4 SID");
+ LOG.debug("No Node-SID for IPv4");
+ return true;
+ }
+ if (attributes.getAdjSid() == null) {
+ LOG.debug("No Adjacency-SID");
return true;
}
break;
case SrIpv6:
if (getIpv6NodeSid(edge.getDestination()) == null) {
- LOG.debug("No SR-Ipv6 SID");
+ LOG.debug("No Node-SID for IPv6");
+ return true;
+ }
+ if (attributes.getAdjSid() == null) {
+ LOG.debug("No SR Adjacency-SID");
return true;
}
break;
break;
case SrIpv4:
pathDesc = new PathDescriptionBuilder()
- .setIpv4(edge.getDestination().getVertex().getRouterId().getIpv4Address())
- .setLabel(getIpv4NodeSid(edge.getDestination()))
+ .setLocalIpv4(edge.getEdge().getEdgeAttributes().getLocalAddress().getIpv4Address())
+ .setRemoteIpv4(edge.getEdge().getEdgeAttributes().getRemoteAddress().getIpv4Address())
+ .setSid(edge.getEdge().getEdgeAttributes().getAdjSid())
.build();
break;
case SrIpv6:
pathDesc = new PathDescriptionBuilder()
- .setIpv6(edge.getDestination().getVertex().getRouterId().getIpv6Address())
- .setLabel(getIpv6NodeSid(edge.getDestination()))
+ .setLocalIpv6(edge.getEdge().getEdgeAttributes().getLocalAddress().getIpv6Address())
+ .setRemoteIpv6(edge.getEdge().getEdgeAttributes().getRemoteAddress().getIpv6Address())
+ .setSid(edge.getEdge().getEdgeAttributes().getAdjSid())
.build();
break;
default:
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.SidType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.pcrep.pcrep.message.replies.result.success._case.success.paths.ero.subobject.subobject.type.SrEroType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.pcrep.pcrep.message.replies.result.success._case.success.paths.ero.subobject.subobject.type.SrEroTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.subobject.nai.IpNodeIdBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.subobject.nai.IpAdjacencyBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.NoPathVectorTlv.Flags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.RequestId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.bandwidth.object.BandwidthBuilder;
/* Fulfill ERO sublist */
for (PathDescription path : pathDescriptions) {
Subobject sb = null;
- if (path.getLabel() == null) {
+ if (path.getSid() == null) {
IpPrefix ipPref = null;
/* Prepare SubObject for IPv4 or IPv6 address */
if (path.getIpv4() != null) {
} else {
/* Prepare SubObject for Segment Routing */
SrEroType srEro = null;
- if (path.getIpv4() != null) {
+ if ((path.getLocalIpv4() != null) && (path.getRemoteIpv4() != null)) {
srEro = new SrEroTypeBuilder()
- .setSidType(SidType.Ipv4NodeId)
- .setSid(path.getLabel().getValue())
+ .setSidType(SidType.Ipv4Adjacency)
+ .setSid(path.getSid())
.setCFlag(false)
- .setMFlag(false)
- .setNai(new IpNodeIdBuilder()
- .setIpAddress(new IpAddressNoZone(new Ipv4AddressNoZone(path.getIpv4().getValue())))
+ .setMFlag(true)
+ .setNai(new IpAdjacencyBuilder()
+ .setLocalIpAddress(
+ new IpAddressNoZone(new Ipv4AddressNoZone(path.getLocalIpv4().getValue())))
+ .setRemoteIpAddress(
+ new IpAddressNoZone(new Ipv4AddressNoZone(path.getRemoteIpv4().getValue())))
.build())
.build();
}
- if (path.getIpv6() != null) {
+ if ((path.getLocalIpv6() != null) && (path.getRemoteIpv6() != null)) {
srEro = new SrEroTypeBuilder()
- .setSidType(SidType.Ipv6NodeId)
- .setSid(path.getLabel().getValue())
+ .setSidType(SidType.Ipv6Adjacency)
+ .setSid(path.getSid())
.setCFlag(false)
- .setMFlag(false)
- .setNai(new IpNodeIdBuilder()
- .setIpAddress(new IpAddressNoZone(new Ipv6AddressNoZone(path.getIpv6().getValue())))
+ .setMFlag(true)
+ .setNai(new IpAdjacencyBuilder()
+ .setLocalIpAddress(
+ new IpAddressNoZone(new Ipv6AddressNoZone(path.getLocalIpv6().getValue())))
+ .setRemoteIpAddress(
+ new IpAddressNoZone(new Ipv6AddressNoZone(path.getRemoteIpv6().getValue())))
.build())
.build();
}