Update to RFC 8664 (PCEP Segment Routing) 07/91507/5
authorOlivier Dugeon <olivier.dugeon@orange.com>
Tue, 21 Jul 2020 13:48:15 +0000 (15:48 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 3 Aug 2020 08:56:44 +0000 (10:56 +0200)
As per RFC 8664, this commit introduces following changes:
 - Add Flags N & X to SR PCE Capability
 - Add Ipv6 Local Nai Type and rename SID Type to NAI Type (NT) in
   odl-pcep-segment-routing-yang
 - Change IANA type (=36) for SR-ERO and SR-RRO to be the default value in
   pcep-segment-routing-app-config.yang instead of Legacy Type values
 - Update yang model revision
 - Turn IANA Type as the defaut for Segement Routing parser registration
 - Mark deprecated all IANA Type configuration (this will be removed in next
   release after Aluminium)
 - Add extra verifications to AbstractSrSubobjectParser Java Class and support
   for Ipv6Local NAI
 - Update accordingly Segment Routing Junit Tests

JIRA: BGPCEP-882
Change-Id: Ic6dc01329af87a317154f742d7e698cc9d752df0
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 files changed:
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/AbstractSrSubobjectParser.java
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/PCEPSegmentRoutingCapability.java
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/PcepOpenObjectWithSpcTlvParser.java
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/SegmentRoutingActivator.java
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/SrEroSubobjectParser.java
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/SrPceCapabilityTlvParser.java
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/SrRroSubobjectParser.java
pcep/segment-routing/src/main/yang/odl-pcep-segment-routing.yang
pcep/segment-routing/src/main/yang/pcep-segment-routing-app-config.yang
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/PCEPSegmentRoutingCapabilityTest.java
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrEroSubobjectParserTest.java
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrObjectParserTest.java
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrRroSubobjectParserTest.java
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrTlvParserTest.java
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/TopologyProviderTest.java
pcep/server/server-provider/src/main/java/org/opendaylight/bgpcep/pcep/server/provider/MessagesUtil.java

index 291d974bba324b6b5c54ffa9a84d83cc5bae9bf4..3e6358f23573bbbfffb003ceb5d0bd3a85b8e25f 100644 (file)
@@ -16,15 +16,17 @@ import org.opendaylight.protocol.util.BitArray;
 import org.opendaylight.protocol.util.Ipv4Util;
 import org.opendaylight.protocol.util.Ipv6Util;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
-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.SrSubobject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.subobject.Nai;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.subobject.nai.IpAdjacency;
-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.segment.routing.rev181109.sr.subobject.nai.IpNodeId;
-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.UnnumberedAdjacency;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.subobject.nai.UnnumberedAdjacencyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.NaiType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.SrSubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.Nai;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpAdjacency;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpAdjacencyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpNodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpNodeIdBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.Ipv6Local;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.Ipv6LocalBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.UnnumberedAdjacency;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.UnnumberedAdjacencyBuilder;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.netty.ByteBufUtils;
 
@@ -37,20 +39,20 @@ public abstract class AbstractSrSubobjectParser {
     protected static final int F_FLAG_POSITION = 4;
     protected static final int MPLS_LABEL_OFFSET = 12;
 
-    private static final int SID_TYPE_BITS_OFFSET = 4;
+    private static final int NAI_TYPE_BITS_OFFSET = 4;
 
     private static class SrSubobjectImpl implements SrSubobject {
         private final boolean mflag;
         private final boolean cflag;
-        private final SidType sidType;
+        private final NaiType naiType;
         private final Uint32 sid;
         private final Nai nai;
 
-        SrSubobjectImpl(final boolean mflag, final boolean cflag, final SidType sidType, final Uint32 sid,
+        SrSubobjectImpl(final boolean mflag, final boolean cflag, final NaiType naiType, final Uint32 sid,
                 final Nai nai) {
             this.mflag = mflag;
             this.cflag = cflag;
-            this.sidType = sidType;
+            this.naiType = naiType;
             this.sid = sid;
             this.nai = nai;
         }
@@ -71,8 +73,8 @@ public abstract class AbstractSrSubobjectParser {
         }
 
         @Override
-        public SidType getSidType() {
-            return this.sidType;
+        public NaiType getNaiType() {
+            return this.naiType;
         }
 
         @Override
@@ -87,24 +89,37 @@ public abstract class AbstractSrSubobjectParser {
     }
 
     public ByteBuf serializeSubobject(final SrSubobject srSubobject) {
+        checkArgument(srSubobject.getNai() != null || srSubobject.getSid() != null,
+                "Both SID and NAI are absent in SR subobject.");
+
         final ByteBuf buffer = Unpooled.buffer(MINIMAL_LENGTH);
-        // sid type
-        buffer.writeByte(srSubobject.getSidType().getIntValue() << SID_TYPE_BITS_OFFSET);
 
+        /* Write NAI Type */
+        buffer.writeByte(srSubobject.getNaiType().getIntValue() << NAI_TYPE_BITS_OFFSET);
+
+        /* Flags set according to RFC8664#section 4.3.1 */
         final BitArray bits = new BitArray(BITSET_LENGTH);
         bits.set(M_FLAG_POSITION, srSubobject.isMFlag());
-        bits.set(C_FLAG_POSITION, srSubobject.isCFlag());
+        /* C flag MUST be set to 0 if M flag is set to 0 */
+        if (!srSubobject.isMFlag()) {
+            bits.set(C_FLAG_POSITION, Boolean.FALSE);
+        } else {
+            bits.set(C_FLAG_POSITION, srSubobject.isCFlag());
+        }
+        /* M & C flags MUST be set to 0 if S flag is set to 1 */
         if (srSubobject.getSid() == null) {
+            bits.set(M_FLAG_POSITION, Boolean.FALSE);
+            bits.set(C_FLAG_POSITION, Boolean.FALSE);
             bits.set(S_FLAG_POSITION, Boolean.TRUE);
         }
-        if (srSubobject.getNai() == null) {
+        /* F flag MUST be set if NT=0 or NAI is absent */
+        if ((srSubobject.getNai() == null) || (srSubobject.getNaiType().getIntValue() == 0)) {
             bits.set(F_FLAG_POSITION, Boolean.TRUE);
         }
-        // bits
+        /* Write Flags */
         bits.toByteBuf(buffer);
-        // sid
-        checkArgument(srSubobject.getNai() != null || srSubobject.getSid() != null,
-                "Both SID and NAI are absent in SR subobject.");
+
+        /* Write SID */
         if (srSubobject.getSid() != null) {
             if (srSubobject.isMFlag()) {
                 buffer.writeInt(srSubobject.getSid().intValue() << MPLS_LABEL_OFFSET);
@@ -112,16 +127,17 @@ public abstract class AbstractSrSubobjectParser {
                 ByteBufUtils.writeOrZero(buffer, srSubobject.getSid());
             }
         }
-        // nai
+
+        /* Write NAI */
         final Nai nai = srSubobject.getNai();
         if (nai != null) {
-            serializeNai(nai, srSubobject.getSidType() ,buffer);
+            serializeNai(nai, srSubobject.getNaiType(), buffer);
         }
         return buffer;
     }
 
-    private static void serializeNai(final Nai nai, final SidType sidType, final ByteBuf buffer) {
-        switch (sidType) {
+    private static void serializeNai(final Nai nai, final NaiType naiType, final ByteBuf buffer) {
+        switch (naiType) {
             case Ipv4NodeId:
                 Ipv4Util.writeIpv4Address(((IpNodeId) nai).getIpAddress().getIpv4AddressNoZone(), buffer);
                 break;
@@ -143,13 +159,20 @@ public abstract class AbstractSrSubobjectParser {
                 ByteBufUtils.writeOrZero(buffer, unnumbered.getRemoteNodeId());
                 ByteBufUtils.writeOrZero(buffer, unnumbered.getRemoteInterfaceId());
                 break;
+            case Ipv6Local:
+                final Ipv6Local ipv6Local = (Ipv6Local) nai;
+                Ipv6Util.writeIpv6Address(ipv6Local.getLocalIpv6Address(), buffer);
+                ByteBufUtils.writeOrZero(buffer, ipv6Local.getLocalId());
+                Ipv6Util.writeIpv6Address(ipv6Local.getRemoteIpv6Address(), buffer);
+                ByteBufUtils.writeOrZero(buffer, ipv6Local.getRemoteId());
+                break;
             default:
                 break;
         }
     }
 
-    private static Nai parseNai(final SidType sidType, final ByteBuf buffer) {
-        switch (sidType) {
+    private static Nai parseNai(final NaiType naiType, final ByteBuf buffer) {
+        switch (naiType) {
             case Ipv4NodeId:
                 return new IpNodeIdBuilder().setIpAddress(new IpAddressNoZone(Ipv4Util.addressForByteBuf(buffer)))
                         .build();
@@ -170,14 +193,20 @@ public abstract class AbstractSrSubobjectParser {
                         .setLocalInterfaceId(ByteBufUtils.readUint32(buffer))
                         .setRemoteNodeId(ByteBufUtils.readUint32(buffer))
                         .setRemoteInterfaceId(ByteBufUtils.readUint32(buffer)).build();
+            case Ipv6Local:
+                return new Ipv6LocalBuilder()
+                        .setLocalIpv6Address(Ipv6Util.addressForByteBuf(buffer))
+                        .setLocalId(ByteBufUtils.readUint32(buffer))
+                        .setRemoteIpv6Address(Ipv6Util.addressForByteBuf(buffer))
+                        .setRemoteId(ByteBufUtils.readUint32(buffer)).build();
             default:
                 return null;
         }
     }
 
     protected static SrSubobject parseSrSubobject(final ByteBuf buffer) throws PCEPDeserializerException {
-        final int sidTypeByte = buffer.readByte() >> SID_TYPE_BITS_OFFSET;
-        final SidType sidType = SidType.forValue(sidTypeByte);
+        final int naiTypeByte = buffer.readByte() >> NAI_TYPE_BITS_OFFSET;
+        final NaiType naiType = NaiType.forValue(naiTypeByte);
         final BitArray bitSet = BitArray.valueOf(buffer.readByte());
         final boolean f = bitSet.get(F_FLAG_POSITION);
         final boolean s = bitSet.get(S_FLAG_POSITION);
@@ -196,11 +225,11 @@ public abstract class AbstractSrSubobjectParser {
             sid = null;
         }
         final Nai nai;
-        if (sidType != null && !f) {
-            nai = parseNai(sidType, buffer);
+        if (naiType != null && naiType.getIntValue() != 0 && !f) {
+            nai = parseNai(naiType, buffer);
         } else {
             nai = null;
         }
-        return new SrSubobjectImpl(m, c, sidType, sid, nai);
+        return new SrSubobjectImpl(m, c, naiType, sid, nai);
     }
 }
index c7f97f778484a7cf5c32226d6ef37943e412e743..a749a51d949076f407f7b8dfc56f9fbd8b41ac9e 100644 (file)
@@ -9,8 +9,8 @@ package org.opendaylight.protocol.pcep.segment.routing;
 
 import java.net.InetSocketAddress;
 import org.opendaylight.protocol.pcep.PCEPCapability;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.Tlvs1Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.pce.capability.tlv.SrPceCapabilityBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.Tlvs1Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.pce.capability.tlv.SrPceCapabilityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder;
 import org.opendaylight.yangtools.yang.common.Uint8;
 
@@ -26,7 +26,8 @@ public class PCEPSegmentRoutingCapability implements PCEPCapability {
     public void setCapabilityProposal(final InetSocketAddress address, final TlvsBuilder builder) {
         if (this.isSegmentRoutingCapable) {
             builder.addAugmentation(new Tlvs1Builder()
-                .setSrPceCapability(new SrPceCapabilityBuilder().setMsd(Uint8.ZERO).build())
+                .setSrPceCapability(new SrPceCapabilityBuilder().setNFlag(Boolean.FALSE).setXFlag(Boolean.FALSE)
+                    .setMsd(Uint8.ZERO).build())
                 .build());
         }
     }
index 7d13040d681ac0140ac3b9114efa1f163af5d57d..1c66fda68789c8bc57925f883161fb38ece2b320 100644 (file)
@@ -11,9 +11,9 @@ import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.protocol.pcep.sync.optimizations.SyncOptimizationsOpenObjectParser;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.Tlvs1;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.Tlvs1Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.pce.capability.tlv.SrPceCapability;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.Tlvs1;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.Tlvs1Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.pce.capability.tlv.SrPceCapability;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Tlv;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.Tlvs;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder;
index 79dcdc5c28655c35b0700088251024edae7f397c..528472f1e25d528c64d3460e9104293350f2b79a 100644 (file)
@@ -13,21 +13,23 @@ import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.protocol.pcep.spi.pojo.AbstractPCEPExtensionProviderActivator;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.add.lsp.input.arguments.ero.subobject.subobject.type.SrEroType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.pce.capability.tlv.SrPceCapability;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.ero.subobject.subobject.type.SrEroType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.pce.capability.tlv.SrPceCapability;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Open;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.path.setup.type.tlv.PathSetupType;
 import org.opendaylight.yangtools.concepts.Registration;
 
 public class SegmentRoutingActivator extends AbstractPCEPExtensionProviderActivator {
 
+    @Deprecated
     private final boolean ianaSrSubobjectsType;
 
     public SegmentRoutingActivator() {
-        this.ianaSrSubobjectsType = false;
+        this.ianaSrSubobjectsType = true;
     }
 
+    @Deprecated
     public SegmentRoutingActivator(final boolean ianaSrSubobjectsType) {
         this.ianaSrSubobjectsType = ianaSrSubobjectsType;
     }
@@ -47,53 +49,53 @@ public class SegmentRoutingActivator extends AbstractPCEPExtensionProviderActiva
         final SrEroSubobjectParser srEroSubobjectParser = new SrEroSubobjectParser(this.ianaSrSubobjectsType);
         regs.add(context.registerEROSubobjectParser(srEroSubobjectParser.getCodePoint(), srEroSubobjectParser));
         regs.add(context.registerEROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.network.topology.topology.node.path.computation.client.reported.lsp.path.ero
+            .pcep.segment.routing.rev200720.network.topology.topology.node.path.computation.client.reported.lsp.path.ero
             .subobject.subobject.type.SrEroType.class,srEroSubobjectParser));
         regs.add(context.registerEROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.pcinitiate.pcinitiate.message.requests.ero.subobject.subobject.type
+            .pcep.segment.routing.rev200720.pcinitiate.pcinitiate.message.requests.ero.subobject.subobject.type
             .SrEroType.class, srEroSubobjectParser));
         regs.add(context.registerEROSubobjectSerializer(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
+            .pcep.segment.routing.rev200720.pcrep.pcrep.message.replies.result.success._case.success.paths.ero.subobject
             .subobject.type.SrEroType.class, srEroSubobjectParser));
         regs.add(context.registerEROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.pcrpt.pcrpt.message.reports.path.ero.subobject.subobject.type
+            .pcep.segment.routing.rev200720.pcrpt.pcrpt.message.reports.path.ero.subobject.subobject.type
             .SrEroType.class, srEroSubobjectParser));
         regs.add(context.registerEROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.pcupd.pcupd.message.updates.path.ero.subobject.subobject.type
+            .pcep.segment.routing.rev200720.pcupd.pcupd.message.updates.path.ero.subobject.subobject.type
             .SrEroType.class, srEroSubobjectParser));
         regs.add(context.registerEROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.update.lsp.input.arguments.ero.subobject.subobject.type.SrEroType.class,
+            .pcep.segment.routing.rev200720.update.lsp.input.arguments.ero.subobject.subobject.type.SrEroType.class,
             srEroSubobjectParser));
         regs.add(context.registerEROSubobjectSerializer(SrEroType.class, srEroSubobjectParser));
 
         final SrRroSubobjectParser srRroSubobjectParser = new SrRroSubobjectParser(this.ianaSrSubobjectsType);
         regs.add(context.registerRROSubobjectParser(srRroSubobjectParser.getCodePoint(), srRroSubobjectParser));
         regs.add(context.registerRROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.network.topology.topology.node.path.computation.client.reported.lsp.path.rro
+            .pcep.segment.routing.rev200720.network.topology.topology.node.path.computation.client.reported.lsp.path.rro
             .subobject.subobject.type.SrRroType.class, srRroSubobjectParser));
         regs.add(context.registerRROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.pcinitiate.pcinitiate.message.requests.rro.subobject.subobject.type
+            .pcep.segment.routing.rev200720.pcinitiate.pcinitiate.message.requests.rro.subobject.subobject.type
             .SrRroType.class, srRroSubobjectParser));
         regs.add(context.registerRROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.pcrep.pcrep.message.replies.result.failure._case.rro.subobject.subobject
+            .pcep.segment.routing.rev200720.pcrep.pcrep.message.replies.result.failure._case.rro.subobject.subobject
             .type.SrRroType.class, srRroSubobjectParser));
         regs.add(context.registerRROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.pcreq.pcreq.message.requests.segment.computation.p2p.reported.route.rro
+            .pcep.segment.routing.rev200720.pcreq.pcreq.message.requests.segment.computation.p2p.reported.route.rro
             .subobject.subobject.type.SrRroType.class, srRroSubobjectParser));
         regs.add(context.registerRROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.pcrpt.pcrpt.message.reports.path.rro.subobject.subobject.type
+            .pcep.segment.routing.rev200720.pcrpt.pcrpt.message.reports.path.rro.subobject.subobject.type
             .SrRroType.class, srRroSubobjectParser));
         regs.add(context.registerRROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.pcupd.pcupd.message.updates.path.rro.subobject.subobject.type
+            .pcep.segment.routing.rev200720.pcupd.pcupd.message.updates.path.rro.subobject.subobject.type
             .SrRroType.class, srRroSubobjectParser));
         regs.add(context.registerRROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.update.lsp.input.arguments.rro.subobject.subobject.type.SrRroType.class,
+            .pcep.segment.routing.rev200720.update.lsp.input.arguments.rro.subobject.subobject.type.SrRroType.class,
             srRroSubobjectParser));
         regs.add(context.registerRROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.pcrep.pcrep.message.replies.result.success._case.success.paths.rro.subobject
+            .pcep.segment.routing.rev200720.pcrep.pcrep.message.replies.result.success._case.success.paths.rro.subobject
             .subobject.type.SrRroType.class, srRroSubobjectParser));
         regs.add(context.registerRROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .pcep.segment.routing.rev181109.pcreq.pcreq.message.requests.segment.computation.p2p.rro.subobject.subobject
+            .pcep.segment.routing.rev200720.pcreq.pcreq.message.requests.segment.computation.p2p.rro.subobject.subobject
             .type.SrRroType.class, srRroSubobjectParser));
         regs.add(context.registerRROSubobjectSerializer(SrRroType.class, srRroSubobjectParser));
 
index 320c8ab50fb3893e3c58ed5ab38c1423b77f4217..c7ee5d50427898df5a6d72e65932f0bdee6775dc 100644 (file)
@@ -13,21 +13,28 @@ import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectUtil;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.SrSubobject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.add.lsp.input.arguments.ero.subobject.subobject.type.SrEroTypeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.SrSubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.ero.subobject.subobject.type.SrEroTypeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.SubobjectBuilder;
 
 public class SrEroSubobjectParser extends AbstractSrSubobjectParser implements EROSubobjectParser,
         EROSubobjectSerializer {
 
+    @Deprecated
     private static final int LEGACY_TYPE = 5;
-    private static final int PROPOSED_TYPE = 36;
+    private static final int IANA_TYPE = 36;
 
+    @Deprecated
     private final int type;
 
+    SrEroSubobjectParser() {
+        this.type = IANA_TYPE;
+    }
+
+    @Deprecated
     SrEroSubobjectParser(final boolean isIanaAssignedType) {
-        this.type = isIanaAssignedType ? PROPOSED_TYPE : LEGACY_TYPE;
+        this.type = isIanaAssignedType ? IANA_TYPE : LEGACY_TYPE;
     }
 
     @Override
@@ -50,6 +57,7 @@ public class SrEroSubobjectParser extends AbstractSrSubobjectParser implements E
         return subobjectBuilder.build();
     }
 
+    @Deprecated
     public int getCodePoint() {
         return this.type;
     }
index f30b5f7d9eda01ea6875045d7fa515693fad0dd0..4d3d83722cec1336be45a4db2a18e34397e73cf8 100644 (file)
@@ -15,24 +15,39 @@ import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.pce.capability.tlv.SrPceCapability;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.pce.capability.tlv.SrPceCapabilityBuilder;
+import org.opendaylight.protocol.util.BitArray;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.pce.capability.tlv.SrPceCapability;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.pce.capability.tlv.SrPceCapabilityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Tlv;
 import org.opendaylight.yangtools.yang.common.netty.ByteBufUtils;
 
 public class SrPceCapabilityTlvParser implements TlvParser, TlvSerializer {
     public static final int TYPE = 26;
 
-    private static final int MSD_LENGTH = 1;
+    private static final int BITSET_LENGTH = 8;
+    private static final int N_FLAG_POSITION = 7;
+    private static final int X_FLAG_POSITION = 6;
     private static final int CONTENT_LENGTH = 4;
-    private static final int OFFSET = CONTENT_LENGTH - MSD_LENGTH;
+    private static final int OFFSET = 2;
 
     @Override
     public void serializeTlv(final Tlv tlv, final ByteBuf buffer) {
         checkArgument(tlv instanceof SrPceCapability, "SrPceCapability is mandatory.");
         final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
+
+        /* Reserved 2 bytes */
         body.writerIndex(OFFSET);
-        ByteBufUtils.writeOrZero(body, ((SrPceCapability) tlv).getMsd());
+
+        /* Flags */
+        final SrPceCapability srPceCapability = (SrPceCapability) tlv;
+        final BitArray bits = new BitArray(BITSET_LENGTH);
+        bits.set(N_FLAG_POSITION, srPceCapability.isNFlag());
+        bits.set(X_FLAG_POSITION, srPceCapability.isXFlag());
+        bits.toByteBuf(body);
+
+        /* MSD */
+        ByteBufUtils.writeOrZero(body, srPceCapability.getMsd());
+
         TlvUtil.formatTlv(TYPE, body, buffer);
     }
 
@@ -41,8 +56,14 @@ public class SrPceCapabilityTlvParser implements TlvParser, TlvSerializer {
         if (buffer == null) {
             return null;
         }
+        final BitArray bitSet = BitArray.valueOf(buffer.readerIndex(OFFSET).readByte());
+        final boolean n = bitSet.get(N_FLAG_POSITION);
+        final boolean x = bitSet.get(X_FLAG_POSITION);
+
         return new SrPceCapabilityBuilder()
-                .setMsd(ByteBufUtils.readUint8(buffer.readerIndex(OFFSET)))
+                .setNFlag(n)
+                .setXFlag(x)
+                .setMsd(ByteBufUtils.readUint8(buffer))
                 .build();
     }
 }
index e192292cd9f336949a910e556fb6b7376eb21725..81212599cf6faf93e1e7fe754725dd61fcacef69 100644 (file)
@@ -14,8 +14,8 @@ import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectUtil;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.SrSubobject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.SrSubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.Subobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.SubobjectBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.SubobjectType;
@@ -23,13 +23,20 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 public class SrRroSubobjectParser extends AbstractSrSubobjectParser implements RROSubobjectParser,
         RROSubobjectSerializer {
 
+    @Deprecated
     private static final int LEGACY_TYPE = 6;
-    private static final int PROPOSED_TYPE = 36;
+    private static final int IANA_TYPE = 36;
 
+    @Deprecated
     private final int type;
 
+    SrRroSubobjectParser() {
+        this.type = IANA_TYPE;
+    }
+
+    @Deprecated
     SrRroSubobjectParser(final boolean isIanaAssignedType) {
-        this.type = isIanaAssignedType ? PROPOSED_TYPE : LEGACY_TYPE;
+        this.type = isIanaAssignedType ? IANA_TYPE : LEGACY_TYPE;
     }
 
     @Override
@@ -50,6 +57,7 @@ public class SrRroSubobjectParser extends AbstractSrSubobjectParser implements R
         return subobjectBuilder.build();
     }
 
+    @Deprecated
     public int getCodePoint() {
         return this.type;
     }
index 706851ea3b376bef63cba2c1c1e4551da29d47fe..f94750a19ea052c5e315a0fa868af86a7e2be8f9 100644 (file)
@@ -16,7 +16,7 @@ module odl-pcep-segment-routing {
 
     description
         "This module contains the data model of PCEP Extensions for Segment Routing,
-        draft-ietf-pce-segment-routing-01.
+        as defined in RFC 8664.
 
         Copyright (c)2015 Cisco Systems, Inc. All rights reserved.
 
@@ -25,6 +25,11 @@ module odl-pcep-segment-routing {
         accompanies this distribution, and is available at
         http://www.eclipse.org/legal/epl-v10.html";
 
+    revision "2020-07-20" {
+        description "Update to RFC 8664";
+        reference "RFC8664: https://tools.ietf.org/html/rfc8664";
+    }
+
     revision "2018-11-09" {
         description
             "P2MP extension.";
@@ -43,10 +48,20 @@ module odl-pcep-segment-routing {
 
     grouping sr-pce-capability-tlv {
         description "SR-PCE-CAPABILITY TLV";
-        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.1.1";
+        reference "http://tools.ietf.org/html/rfc8664#section-4.1.2";
 
         container sr-pce-capability {
             uses pcep:tlv;
+            leaf n-flag {
+                description "N flag used by a PCC to indicate that it is capable of resolving a NAI to a SID";
+                type boolean;
+                default false;
+            }
+            leaf x-flag {
+                description " X flag used by a PCC to indicate that it does not impose any limit to the MSD";
+                type boolean;
+                default false;
+            }
             leaf msd {
                 description "Maximum SID Depth";
                 type uint8;
@@ -56,17 +71,17 @@ module odl-pcep-segment-routing {
     }
 
     augment "/msg:open/msg:open-message/msg:open/msg:tlvs" {
-        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.1";
+        reference "http://tools.ietf.org/html/rfc4664#section-4.1";
         uses sr-pce-capability-tlv;
     }
 
     augment "/msg:pcerr/msg:pcerr-message/msg:error-type/msg:session-case/msg:session/msg:open/msg:tlvs" {
-        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.1";
+        reference "http://tools.ietf.org/html/rfc8664#section-5.1";
         uses sr-pce-capability-tlv;
     }
 
-    typedef sid-type {
-        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.3.1";
+    typedef nai-type {
+        reference "http://tools.ietf.org/html/rfc8664#section-4.3.1";
         type enumeration {
             enum ipv4-node-id {
                 value 1;
@@ -83,31 +98,39 @@ module odl-pcep-segment-routing {
             enum unnumbered {
                 value 5;
             }
+            enum ipv6-local {
+                value 6;
+            }
         }
     }
 
     grouping sr-subobject {
         description "Common grouping for both SR-ERO and SR-RRO subobjects as they share the same content representation.";
-        leaf c-flag {
-            type boolean;
-            default false;
+        leaf nai-type {
+            description "Node or Adjacency Identifier Type (NT)";
+            type nai-type;
         }
         leaf m-flag {
+            description "If this bit is set to 1, the SID value represents an MPLS label stack entry";
             type boolean;
             default false;
         }
-        leaf sid-type {
-            type sid-type;
+        leaf c-flag {
+            description "TC, S & TTL fields in the MPLS label are specified by the PCE if M & C are set to 1";
+            type boolean;
+            default false;
         }
+        /* S-Flag is represented by the presence of the SID TLV: isSflag() is equivalent to getSid() != null */
         leaf sid {
             description "Segment Identifier";
             type uint32;
         }
+        /* F-Flag is represented by the presence of the NAI TLV: isFflag() is equivalent to getNai() != null */
         choice nai {
-            reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.3.2";
+            reference "http://tools.ietf.org/html/rfc8664#section-4.3.2";
             description "Node or Adjacency Identifier";
             case ip-node-id {
-                when "../sid-type = 'ipv4-node-id' or ../sid-type = 'ipv6-node-id'";
+                when "../nai-type = 'ipv4-node-id' or ../nai-type = 'ipv6-node-id'";
                 description "IP Node ID";
                 leaf ip-address {
                     type inet:ip-address-no-zone;
@@ -115,7 +138,7 @@ module odl-pcep-segment-routing {
                 }
             }
             case ip-adjacency {
-                when "../sid-type = 'ipv4-adjacency' or ../sid-type = 'ipv6-adjacency'";
+                when "../nai-type = 'ipv4-adjacency' or ../nai-type = 'ipv6-adjacency'";
                 description "IP Adjacency";
                 leaf local-ip-address {
                     type inet:ip-address-no-zone;
@@ -127,7 +150,7 @@ module odl-pcep-segment-routing {
                 }
             }
             case unnumbered-adjacency {
-                when "../sid-type = 'unnumbered'";
+                when "../nai-type = 'unnumbered'";
                 description "Unnumbered Adjacency with IPv4 NodeIDs";
                 leaf local-node-id {
                     type uint32;
@@ -146,17 +169,38 @@ module odl-pcep-segment-routing {
                     mandatory true;
                 }
             }
+            case ipv6-local {
+                when "../nai-type = 'ipv6-local'";
+                description "IPv6 adjacency with link-local IPv6 addresses";
+                leaf local-ipv6-address {
+                    type inet:ipv6-address-no-zone;
+                    mandatory true;
+                }
+                leaf local-id {
+                    type uint32;
+                    mandatory true;
+                }
+                leaf remote-ipv6-address {
+                    type inet:ipv6-address-no-zone;
+                    mandatory true;
+                }
+                leaf remote-id {
+                    type uint32;
+                    mandatory true;
+                }
+            }
         }
     }
 
     // kept both groupings in case draft changes and they won't be equal
     grouping sr-ero-subobject {
-        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.3.1";
+        reference "http://tools.ietf.org/html/rfc8664#section-4.3";
+        /* L(oose)-flag is already present within the ERO subObject */
         uses sr-subobject;
     }
 
     grouping sr-rro-subobject {
-        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.4";
+        reference "http://tools.ietf.org/html/rfc8664#section-4.4";
         uses sr-subobject;
     }
 
index 52e9451a7d2d1e2d971f0da3014a14c5fa51d2ed..b8e111277b09d2241e44ccf97ac6bc62eef9daf0 100644 (file)
@@ -20,16 +20,16 @@ module pcep-segment-routing-app-config {
 
     container pcep-segment-routing-config {
         leaf iana-sr-subobjects-type {
-            description "If false (default) SR-ERO type (=5) and SR-RRO type (=6) is used,
-                    else proposed type (36) is used for parsing/serialization";
+            description "If true (default) IANA Types for SR-ERO type (=36) and SR-RRO type (=36) are used,
+                    else historical types (5 & 6) are used for parsing/serialization";
             type boolean;
-            default false;
+            default true;
         }
 
         leaf sr-capable {
-            description "Advertize segment-routing capability";
+            description "Advertize segment-routing capability with historical type values (SR-ERO = 5 & SR-RRO = 6)";
             type boolean;
-            default true;
+            default false;
         }
     }
 }
\ No newline at end of file
index 70d8bab993945da94994248c916260dc706bacc2..d863a187666e18b00240d80b6936590ecf79b82b 100644 (file)
@@ -9,7 +9,7 @@ package org.opendaylight.protocol.pcep.segment.routing;
 
 import org.junit.Assert;
 import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.pce.capability.tlv.SrPceCapabilityBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.pce.capability.tlv.SrPceCapabilityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.Tlvs;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder;
 import org.opendaylight.yangtools.yang.common.Uint8;
@@ -17,8 +17,8 @@ import org.opendaylight.yangtools.yang.common.Uint8;
 public class PCEPSegmentRoutingCapabilityTest {
     private static final Tlvs EXPECTED_TLVS =
         new TlvsBuilder().addAugmentation(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep
-                .segment.routing.rev181109.Tlvs1Builder().setSrPceCapability(new SrPceCapabilityBuilder()
-                    .setMsd(Uint8.ZERO).build()).build()).build();
+                .segment.routing.rev200720.Tlvs1Builder().setSrPceCapability(new SrPceCapabilityBuilder()
+                    .setNFlag(Boolean.FALSE).setXFlag(Boolean.FALSE).setMsd(Uint8.ZERO).build()).build()).build();
 
     @Test
     public void testSegmentRoutingCapability() {
index 61fc94847457837b622968ef03b5fcb537dab568..68bae5c1787f9bac9a75a69930735da9521e986b 100644 (file)
@@ -20,24 +20,24 @@ import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone;
-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.add.lsp.input.arguments.ero.subobject.subobject.type.SrEroTypeBuilder;
-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.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.UnnumberedAdjacencyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.NaiType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.ero.subobject.subobject.type.SrEroTypeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpAdjacencyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpNodeIdBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.UnnumberedAdjacencyBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.SubobjectBuilder;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class SrEroSubobjectParserTest {
 
     private static final byte[] SR_ERO_SUBOBJECT_WITH_IPV4_NODEID = {
-        0x05,0x0c,(byte) 0x10,0x00,
+        0x24,0x0c,(byte) 0x10,0x00,
         0x00,0x01,(byte) 0xe2,0x40,
         0x4A,0x7D,0x2b,0x63,
     };
 
     private static final byte[] SR_ERO_SUBOBJECT_WITH_IPV6_NODEID = {
-        0x05,0x18,(byte) 0x20,0x00,
+        0x24,0x18,(byte) 0x20,0x00,
         0x00,0x01,(byte) 0xe2,0x40,
         (byte) 0xFE,(byte) 0x80,(byte) 0xCD,0x00,
         0x00,0x00,0x00,0x00,
@@ -46,14 +46,14 @@ public class SrEroSubobjectParserTest {
     };
 
     private static final byte[] SR_ERO_SUBOBJECT_WITH_IPV4_ADJ = {
-        0x05,0x10,(byte) 0x30,0x00,
+        0x24,0x10,(byte) 0x30,0x00,
         0x00,0x01,(byte) 0xe2,0x40,
         0x4A,0x7D,0x2b,0x63,
         0x4A,0x7D,0x2b,0x64,
     };
 
     private static final byte[] SR_ERO_SUBOBJECT_WITH_IPV6_ADJ = {
-        0x05,0x28,(byte) 0x40,0x00,
+        0x24,0x28,(byte) 0x40,0x00,
         0x00,0x01,(byte) 0xe2,0x40,
         (byte) 0xFE,(byte) 0x80,(byte) 0xCD,0x00,
         0x00,0x00,0x00,0x00,
@@ -66,7 +66,7 @@ public class SrEroSubobjectParserTest {
     };
 
     private static final byte[] SR_ERO_SUBOBJECT_WITH_UNNUMBERED = {
-        0x05,0x18,(byte) 0x50,0x00,
+        0x24,0x18,(byte) 0x50,0x00,
         0x00,0x01,(byte) 0xe2,0x40,
         0x00,0x00,0x00,0x01,
         0x00,0x00,0x00,0x02,
@@ -75,22 +75,22 @@ public class SrEroSubobjectParserTest {
     };
 
     private static final byte[] SR_ERO_SUBOBJECT_WITHOUT_NAI = {
-        0x05,0x08,(byte) 0x10,0x08,
+        0x24,0x08,(byte) 0x10,0x08,
         0x00,0x01,(byte) 0xe2,0x40
     };
 
     private static final byte[] SR_ERO_SUBOBJECT_WITHOUT_SID = {
-        0x05,0x08,(byte) 0x10,0x04,
+        0x24,0x08,(byte) 0x10,0x04,
         0x4A,0x7D,0x2b,0x63,
     };
 
     private static final byte[] SR_ERO_SUBOBJECT_WITH_IPV4_NODEID_MFLAG = {
-        0x05,0x0c,(byte) 0x10,0x01,
+        0x24,0x0c,(byte) 0x10,0x01,
         0x07,0x5B,(byte) 0xCD,0x15,
         0x4A,0x7D,0x2b,0x63,
     };
     private static final byte[] SR_ERO_SUBOBJECT_WITH_IPV4_NODEID_MFLAG_AFTER = {
-        0x05,0x0c,(byte) 0x10,0x01,
+        0x24,0x0c,(byte) 0x10,0x01,
         0x07,0x5B,(byte) 0xC0,0x00,
         0x4A,0x7D,0x2b,0x63,
     };
@@ -104,14 +104,13 @@ public class SrEroSubobjectParserTest {
         this.ctx = new SimplePCEPExtensionProviderContext();
         this.act = new SegmentRoutingActivator();
         this.act.start(this.ctx);
-        final boolean isIanaAssignedType = false;
-        this.parser = new SrEroSubobjectParser(isIanaAssignedType);
+        this.parser = new SrEroSubobjectParser();
     }
 
     @Test
     public void testSrEroSubobjectIpv4NodeIdNAI() throws PCEPDeserializerException {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder()
-                .setSidType(SidType.Ipv4NodeId)
+                .setNaiType(NaiType.Ipv4NodeId)
                 .setSid(Uint32.valueOf(123456))
                 .setCFlag(false)
                 .setMFlag(false)
@@ -129,7 +128,7 @@ public class SrEroSubobjectParserTest {
     @Test
     public void testSrEroSubobjectIpv6NodeIdNAI() throws PCEPDeserializerException {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder()
-                .setSidType(SidType.Ipv6NodeId)
+                .setNaiType(NaiType.Ipv6NodeId)
                 .setSid(Uint32.valueOf(123456))
                 .setCFlag(false)
                 .setMFlag(false)
@@ -147,7 +146,7 @@ public class SrEroSubobjectParserTest {
     @Test
     public void testSrEroSubobjectIpv4AdjacencyNAI() throws PCEPDeserializerException {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder()
-                .setSidType(SidType.Ipv4Adjacency)
+                .setNaiType(NaiType.Ipv4Adjacency)
                 .setSid(Uint32.valueOf(123456))
                 .setCFlag(false)
                 .setMFlag(false)
@@ -166,7 +165,7 @@ public class SrEroSubobjectParserTest {
     @Test
     public void testSrEroSubobjectIpv6AdjacencyNAI() throws PCEPDeserializerException {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder()
-                .setSidType(SidType.Ipv6Adjacency)
+                .setNaiType(NaiType.Ipv6Adjacency)
                 .setSid(Uint32.valueOf(123456))
                 .setCFlag(false)
                 .setMFlag(false)
@@ -186,7 +185,7 @@ public class SrEroSubobjectParserTest {
     @Test
     public void testSrEroSubobjectUnnumberedNAI() throws PCEPDeserializerException {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder()
-                .setSidType(SidType.Unnumbered)
+                .setNaiType(NaiType.Unnumbered)
                 .setSid(Uint32.valueOf(123456))
                 .setCFlag(false)
                 .setMFlag(false)
@@ -206,7 +205,7 @@ public class SrEroSubobjectParserTest {
     @Test
     public void testSrEroSubobjectWithoutNAI() throws PCEPDeserializerException {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder()
-                .setSidType(SidType.Ipv4NodeId)
+                .setNaiType(NaiType.Ipv4NodeId)
                 .setSid(Uint32.valueOf(123456))
                 .setCFlag(false)
                 .setMFlag(false);
@@ -222,7 +221,7 @@ public class SrEroSubobjectParserTest {
     @Test
     public void testSrEroSubobjectWithoutBody() throws PCEPDeserializerException {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder()
-                .setSidType(SidType.Ipv4NodeId)
+                .setNaiType(NaiType.Ipv4NodeId)
                 .setCFlag(false)
                 .setMFlag(false)
                 .setNai(new IpNodeIdBuilder().setIpAddress(new IpAddressNoZone(
@@ -241,7 +240,7 @@ public class SrEroSubobjectParserTest {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder()
                 .setCFlag(false)
                 .setMFlag(true)
-                .setSidType(SidType.Ipv4NodeId)
+                .setNaiType(NaiType.Ipv4NodeId)
                 .setSid(Uint32.valueOf(30140))
                 .setNai(new IpNodeIdBuilder().setIpAddress(new IpAddressNoZone(new Ipv4AddressNoZone("74.125.43.99")))
                     .build());
index e84df2c1258941798306ae971cf25814b7a7430e..0605520055c2e08841e099adce9e6b1cb4dd8836 100644 (file)
@@ -27,11 +27,11 @@ import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev200720.Tlvs3Builder;
-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.Tlvs1Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.add.lsp.input.arguments.ero.subobject.subobject.type.SrEroTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.pce.capability.tlv.SrPceCapabilityBuilder;
-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.rev200720.NaiType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.Tlvs1Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.ero.subobject.subobject.type.SrEroTypeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.pce.capability.tlv.SrPceCapabilityBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpNodeIdBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ProtocolVersion;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.EroBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
@@ -48,12 +48,12 @@ public class SrObjectParserTest {
         0x20,0x1e,0x78,0x01,
         /* sr-capability-tlv */
         0x00,0x1a,0x00,0x04,
-        0x00,0x00,0x00,0x01};
+        0x00,0x00,0x03,0x01};
 
     private static final byte[] SR_ERO_OBJECT_BYTES = {
         0x07,0x10,0x00,0x10,
         /* ero-subobject */
-        0x05,0x0c,(byte) 0x10,0x00,
+        0x24,0x0c,(byte) 0x10,0x00,
         0x00,0x01,(byte)0xe2,0x40,
         0x4A,0x7D,0x2b,0x63,
     };
@@ -90,7 +90,8 @@ public class SrObjectParserTest {
                 .addAugmentation(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful
                     .rev200720.Tlvs1Builder().build())
                 .addAugmentation(new Tlvs1Builder()
-                    .setSrPceCapability(new SrPceCapabilityBuilder().setMsd(Uint8.ONE).build())
+                    .setSrPceCapability(new SrPceCapabilityBuilder().setNFlag(Boolean.TRUE).setXFlag(Boolean.TRUE)
+                        .setMsd(Uint8.ONE).build())
                     .build())
                 .addAugmentation(new Tlvs3Builder().build()).build());
 
@@ -117,7 +118,7 @@ public class SrObjectParserTest {
         final SrEroTypeBuilder srEroSubBuilder = new SrEroTypeBuilder()
                 .setCFlag(false)
                 .setMFlag(false)
-                .setSidType(SidType.Ipv4NodeId)
+                .setNaiType(NaiType.Ipv4NodeId)
                 .setSid(Uint32.valueOf(123456))
                 .setNai(new IpNodeIdBuilder().setIpAddress(new IpAddressNoZone(
                     new Ipv4AddressNoZone("74.125.43.99"))).build());
@@ -144,13 +145,13 @@ public class SrObjectParserTest {
         builder.setProcessingRule(false);
         builder.setIgnore(false);
 
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.update.lsp
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.update.lsp
             .input.arguments.ero.subobject.subobject.type.SrEroTypeBuilder srEroSubBuilder =
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720
                     .update.lsp.input.arguments.ero.subobject.subobject.type.SrEroTypeBuilder()
                     .setCFlag(false)
                     .setMFlag(false)
-                    .setSidType(SidType.Ipv4NodeId)
+                    .setNaiType(NaiType.Ipv4NodeId)
                     .setSid(Uint32.valueOf(123456))
                     .setNai(new IpNodeIdBuilder().setIpAddress(new IpAddressNoZone(
                         new Ipv4AddressNoZone("74.125.43.99"))).build());
index 1d6a15c8c83ab50d0b5b8561cc6f7625c7f5d2e5..e2b8b9457f5455c69feb79bb30a0347c7f8fb730 100644 (file)
@@ -20,24 +20,24 @@ import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone;
-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.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder;
-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.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.UnnumberedAdjacencyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.NaiType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpAdjacencyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpNodeIdBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.UnnumberedAdjacencyBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.SubobjectBuilder;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class SrRroSubobjectParserTest {
 
     private static final byte[] SR_RRO_SUBOBJECT_WITH_IPV4_NODEID  = {
-        0x06,0x0c,(byte) 0x10,0x00,
+        0x24,0x0c,(byte) 0x10,0x00,
         0x00,0x01,(byte) 0xe2,0x40,
         0x4A,0x7D,0x2b,0x63,
     };
 
     private static final byte[] SR_RROR_SUBOBJECT_WITH_IPV6_NODEID  = {
-        0x06,0x18,(byte) 0x20,0x00,
+        0x24,0x18,(byte) 0x20,0x00,
         0x00,0x01,(byte) 0xe2,0x40,
         (byte) 0xFE,(byte) 0x80,(byte) 0xCD,0x00,
         0x00,0x00,0x00,0x00,
@@ -46,14 +46,14 @@ public class SrRroSubobjectParserTest {
     };
 
     private static final byte[] SR_RRO_SUBOBJECT_WITH_IPV4_ADJ  = {
-        0x06,0x10,(byte) 0x30,0x00,
+        0x24,0x10,(byte) 0x30,0x00,
         0x00,0x01,(byte) 0xe2,0x40,
         0x4A,0x7D,0x2b,0x63,
         0x4A,0x7D,0x2b,0x64,
     };
 
     private static final byte[] SR_RRO_SUBOBJECT_WITH_IPV6_ADJ  = {
-        0x06,0x28,(byte) 0x40,0x00,
+        0x24,0x28,(byte) 0x40,0x00,
         0x00,0x01,(byte) 0xe2,0x40,
         (byte) 0xFE,(byte) 0x80,(byte) 0xCD,0x00,
         0x00,0x00,0x00,0x00,
@@ -66,7 +66,7 @@ public class SrRroSubobjectParserTest {
     };
 
     private static final byte[] SR_RRO_SUBOBJECT_WIT_UNNUMBERED  = {
-        0x06,0x18,(byte) 0x50,0x00,
+        0x24,0x18,(byte) 0x50,0x00,
         0x00,0x01,(byte) 0xe2,0x40,
         0x00,0x00,0x00,0x01,
         0x00,0x00,0x00,0x02,
@@ -75,18 +75,17 @@ public class SrRroSubobjectParserTest {
     };
 
     private static final byte[] SR_RRO_SUBOBJECT_WITHOUT_NAI  = {
-        0x06,0x08, (byte) 0x10,0xb,
+        0x24,0x08, (byte) 0x10,0xb,
         0x1e,0x24,(byte)-32, 0x00,
     };
 
     private static final byte[] SR_RRO_SUBOBJECT_WITHOUT_SID  = {
-        0x06,0x08,(byte) 0x10,0x04,
+        0x24,0x08,(byte) 0x10,0x04,
         0x4A,0x7D,0x2b,0x63,
     };
 
     private SimplePCEPExtensionProviderContext ctx;
     private SegmentRoutingActivator act;
-    private boolean isIanaAssignedType;
     private SrRroSubobjectParser parser;
 
     @Before
@@ -94,14 +93,13 @@ public class SrRroSubobjectParserTest {
         this.ctx = new SimplePCEPExtensionProviderContext();
         this.act = new SegmentRoutingActivator();
         this.act.start(this.ctx);
-        this.isIanaAssignedType = false;
-        this.parser = new SrRroSubobjectParser(this.isIanaAssignedType);
+        this.parser = new SrRroSubobjectParser();
     }
 
     @Test
     public void testSrRroSubobjectIpv4NodeIdNAI() throws PCEPDeserializerException {
         final SrRroTypeBuilder builder = new SrRroTypeBuilder()
-                .setSidType(SidType.Ipv4NodeId)
+                .setNaiType(NaiType.Ipv4NodeId)
                 .setSid(Uint32.valueOf(123456))
                 .setCFlag(false)
                 .setMFlag(false)
@@ -119,7 +117,7 @@ public class SrRroSubobjectParserTest {
     @Test
     public void testSrRroSubobjectIpv6NodeIdNAI() throws PCEPDeserializerException {
         final SrRroTypeBuilder builder = new SrRroTypeBuilder()
-                .setSidType(SidType.Ipv6NodeId)
+                .setNaiType(NaiType.Ipv6NodeId)
                 .setCFlag(false)
                 .setMFlag(false)
                 .setSid(Uint32.valueOf(123456))
@@ -137,7 +135,7 @@ public class SrRroSubobjectParserTest {
     @Test
     public void testSrRroSubobjectIpv4AdjacencyNAI() throws PCEPDeserializerException {
         final SrRroTypeBuilder builder = new SrRroTypeBuilder()
-                .setSidType(SidType.Ipv4Adjacency)
+                .setNaiType(NaiType.Ipv4Adjacency)
                 .setSid(Uint32.valueOf(123456))
                 .setCFlag(false)
                 .setMFlag(false)
@@ -156,7 +154,7 @@ public class SrRroSubobjectParserTest {
     @Test
     public void testSrRroSubobjectIpv6AdjacencyNAI() throws PCEPDeserializerException {
         final SrRroTypeBuilder builder = new SrRroTypeBuilder()
-                .setSidType(SidType.Ipv6Adjacency)
+                .setNaiType(NaiType.Ipv6Adjacency)
                 .setSid(Uint32.valueOf(123456))
                 .setCFlag(false)
                 .setMFlag(false)
@@ -175,7 +173,7 @@ public class SrRroSubobjectParserTest {
     @Test
     public void testSrRroSubobjectUnnumberedNAI() throws PCEPDeserializerException {
         final SrRroTypeBuilder builder = new SrRroTypeBuilder()
-                .setSidType(SidType.Unnumbered)
+                .setNaiType(NaiType.Unnumbered)
                 .setSid(Uint32.valueOf(123456))
                 .setCFlag(false)
                 .setMFlag(false)
@@ -195,7 +193,7 @@ public class SrRroSubobjectParserTest {
     @Test
     public void testSrRroSubobjectWithoutNAI() throws PCEPDeserializerException {
         final SrRroTypeBuilder builder = new SrRroTypeBuilder()
-                .setSidType(SidType.Ipv4NodeId)
+                .setNaiType(NaiType.Ipv4NodeId)
                 .setSid(Uint32.valueOf(123470))
                 .setCFlag(true)
                 .setMFlag(true);
@@ -211,7 +209,7 @@ public class SrRroSubobjectParserTest {
     @Test
     public void testSrRroSubobjectWithoutBody() throws PCEPDeserializerException {
         final SrRroTypeBuilder builder = new SrRroTypeBuilder()
-                .setSidType(SidType.Ipv4NodeId)
+                .setNaiType(NaiType.Ipv4NodeId)
                 .setCFlag(false)
                 .setMFlag(false)
                 .setNai(new IpNodeIdBuilder().setIpAddress(new IpAddressNoZone(new Ipv4AddressNoZone("74.125.43.99")))
index 6a10c5c1089d0fddf56e8e989291f61bcd7337b6..361094a69bd3b8688c81dc5ed60f6ea92e770538 100644 (file)
@@ -15,22 +15,23 @@ import io.netty.buffer.Unpooled;
 import org.junit.Test;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.pce.capability.tlv.SrPceCapability;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.pce.capability.tlv.SrPceCapabilityBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.pce.capability.tlv.SrPceCapability;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.pce.capability.tlv.SrPceCapabilityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.path.setup.type.tlv.PathSetupType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.path.setup.type.tlv.PathSetupTypeBuilder;
 import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class SrTlvParserTest {
 
-    private static final byte[] SPC_TLV_BYTES = { 0x0, 0x1a, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1 };
+    private static final byte[] SPC_TLV_BYTES = { 0x0, 0x1a, 0x0, 0x4, 0x0, 0x0, 0x3, 0x1 };
 
     private static final byte[] SR_TE_PST_BYTES = { 0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1 };
 
     @Test
     public void testSrPceCapabilityParser() throws PCEPDeserializerException {
         final SrPceCapabilityTlvParser parser = new SrPceCapabilityTlvParser();
-        final SrPceCapability spcTlv = new SrPceCapabilityBuilder().setMsd(Uint8.ONE).build();
+        final SrPceCapability spcTlv = new SrPceCapabilityBuilder().setNFlag(Boolean.TRUE).setXFlag(Boolean.TRUE)
+                .setMsd(Uint8.ONE).build();
         assertEquals(spcTlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(SPC_TLV_BYTES, 4))));
         final ByteBuf buff = Unpooled.buffer();
         parser.serializeTlv(spcTlv, buff);
index f27233613eeacd218e79aed5b3afd21f8b4e1320..345ebe9dd355bbb12d822d0d67672d60cb7a6f4e 100644 (file)
@@ -38,11 +38,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.iet
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcrpt.message.pcrpt.message.reports.PathBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.srp.object.SrpBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.symbolic.path.name.tlv.SymbolicPathNameBuilder;
-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.network.topology.topology.node.path.computation.client.reported.lsp.path.ero.subobject.subobject.type.SrEroType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.pcrpt.pcrpt.message.reports.path.ero.subobject.subobject.type.SrEroTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.subobject.nai.IpNodeId;
-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.rev200720.NaiType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.network.topology.topology.node.path.computation.client.reported.lsp.path.ero.subobject.subobject.type.SrEroType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.pcrpt.pcrpt.message.reports.path.ero.subobject.subobject.type.SrEroTypeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpNodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.IpNodeIdBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.Ero;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.EroBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
@@ -151,7 +151,7 @@ public class TopologyProviderTest extends AbstractPCEPSessionTest<PCEPTopologySe
         final SrEroTypeBuilder srEroBuilder = new SrEroTypeBuilder()
                 .setCFlag(false)
                 .setMFlag(false)
-                .setSidType(SidType.Ipv4NodeId)
+                .setNaiType(NaiType.Ipv4NodeId)
                 .setSid(Uint32.valueOf(123456))
                 .setNai(new IpNodeIdBuilder().setIpAddress(new IpAddressNoZone(new Ipv4AddressNoZone(nai)))
                     .build());
index 22e0a2eeded89ad7028420342aa722771046ead7..7ecfdf7c7f5b55fc39dfb0fecd339e35defa48dd 100644 (file)
@@ -28,10 +28,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.mes
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.PcerrBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.Pcrep;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.PcrepBuilder;
-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.IpAdjacencyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.NaiType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.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.rev200720.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.rev200720.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;
@@ -123,7 +123,7 @@ public final class MessagesUtil {
                 SrEroType srEro = null;
                 if ((path.getLocalIpv4() != null) && (path.getRemoteIpv4() != null)) {
                     srEro = new SrEroTypeBuilder()
-                            .setSidType(SidType.Ipv4Adjacency)
+                            .setNaiType(NaiType.Ipv4Adjacency)
                             .setSid(path.getSid())
                             .setCFlag(false)
                             .setMFlag(true)
@@ -137,7 +137,7 @@ public final class MessagesUtil {
                 }
                 if ((path.getLocalIpv6() != null) && (path.getRemoteIpv6() != null)) {
                     srEro = new SrEroTypeBuilder()
-                            .setSidType(SidType.Ipv6Adjacency)
+                            .setNaiType(NaiType.Ipv6Adjacency)
                             .setSid(path.getSid())
                             .setCFlag(false)
                             .setMFlag(true)