Bug 2803 - Update SR 29/16329/14
authorLadislav Borak <lborak@cisco.com>
Wed, 11 Mar 2015 15:02:13 +0000 (16:02 +0100)
committerDana Kutenicsova <dkutenic@cisco.com>
Tue, 24 Mar 2015 12:28:44 +0000 (13:28 +0100)
- updated API to confirm with
  https://tools.ietf.org/html/draft-ietf-pce-segment-routing-01

- added new error type

- added abstract class with parsing and serializing SrSubobject

Change-Id: Ic3b9d5a4b0f6bd8332211bfc670c2ff2c2dc9c95
Signed-off-by: Ladislav Borak <lborak@cisco.com>
Signed-off-by: Dana Kutenicsova <dkutenic@cisco.com>
12 files changed:
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/AbstractSrSubobjectParser.java [moved from pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/SrSubobjectParserUtil.java with 71% similarity]
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/SrEroUtil.java [deleted file]
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/test/java/org/opendaylight/protocol/pcep/segment/routing/SrEroSubobjectParserTest.java
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrEroUtilTest.java [deleted file]
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/SrSubobjectParserUtilTest.java [deleted file]
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/TopologyProviderTest.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPErrors.java

similarity index 71%
rename from pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/SrSubobjectParserUtil.java
rename to pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/AbstractSrSubobjectParser.java
index df604152e332bffcc1c136f2dbf2439c5c8c79e0..c35fbfa86307765ab48f6272883e85966c7a72d2 100644 (file)
@@ -1,10 +1,3 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
 package org.opendaylight.protocol.pcep.segment.routing;
 
 import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeIpv4Address;
@@ -12,7 +5,6 @@ import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeIpv6Address;
 import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeUnsignedByte;
 import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeUnsignedInt;
 
-import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -34,78 +26,96 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.seg
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev150112.sr.subobject.nai.UnnumberedAdjacencyBuilder;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
-final class SrSubobjectParserUtil {
+public abstract class AbstractSrSubobjectParser   {
 
-    public static final int MINIMAL_LENGTH = 4;
-    public static final int BITSET_LENGTH = 8;
+    protected static final int MINIMAL_LENGTH = 4;
+    protected static final int BITSET_LENGTH = 8;
+    protected static final int M_FLAG_POSITION = 7;
+    protected static final int C_FLAG_POSITION = 6;
+    protected static final int S_FLAG_POSITION = 5;
+    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 SrSubobjectParserUtil() {
-        throw new UnsupportedOperationException();
-    }
-
-    public static ByteBuf serializeSrSubobject(final SrSubobject srSubobject, final BitArray bits) {
-        Preconditions.checkArgument(srSubobject.getNai() != null || srSubobject.getSid() != null,
-                "Both SID and NAI are absent in SR subobject.");
-        final ByteBuf body = Unpooled.buffer(MINIMAL_LENGTH);
-        writeUnsignedByte((short)(srSubobject.getSidType().getIntValue() << SID_TYPE_BITS_OFFSET), body);
-        bits.toByteBuf(body);
+    public ByteBuf serializeSubobject(final SrSubobject srSubobject) {
+        final ByteBuf buffer = Unpooled.buffer(MINIMAL_LENGTH);
+        // sid type
+        writeUnsignedByte((short)(srSubobject.getSidType().getIntValue() << SID_TYPE_BITS_OFFSET), buffer);
 
+        final BitArray bits = new BitArray(BITSET_LENGTH);
+        bits.set(M_FLAG_POSITION, srSubobject.isMFlag());
+        bits.set(C_FLAG_POSITION, srSubobject.isCFlag());
+        if (srSubobject.getSid() == null) {
+            bits.set(S_FLAG_POSITION, Boolean.TRUE);
+        }
+        if (srSubobject.getNai() == null) {
+            bits.set(F_FLAG_POSITION, Boolean.TRUE);
+        }
+        // bits
+        bits.toByteBuf(buffer);
+        // sid
+        Preconditions.checkArgument(srSubobject.getNai() != null || srSubobject.getSid() != null, "Both SID and NAI are absent in SR subobject.");
         if (srSubobject.getSid() != null) {
-            writeUnsignedInt(srSubobject.getSid(), body);
+            if (srSubobject.isMFlag()) {
+                writeUnsignedInt(srSubobject.getSid() << MPLS_LABEL_OFFSET, buffer);
+            } else {
+                writeUnsignedInt(srSubobject.getSid(), buffer);
+            }
         }
+        // nai
         final Nai nai = srSubobject.getNai();
         if (nai != null) {
             switch (srSubobject.getSidType()) {
             case Ipv4NodeId:
-                writeIpv4Address(((IpNodeId) nai).getIpAddress().getIpv4Address(), body);
+                writeIpv4Address(((IpNodeId) nai).getIpAddress().getIpv4Address(), buffer);
                 break;
             case Ipv6NodeId:
-                writeIpv6Address(((IpNodeId) nai).getIpAddress().getIpv6Address(), body);
+                writeIpv6Address(((IpNodeId) nai).getIpAddress().getIpv6Address(), buffer);
                 break;
             case Ipv4Adjacency:
-                writeIpv4Address(((IpAdjacency) nai).getLocalIpAddress().getIpv4Address(), body);
-                writeIpv4Address(((IpAdjacency) nai).getRemoteIpAddress().getIpv4Address(), body);
+                writeIpv4Address(((IpAdjacency) nai).getLocalIpAddress().getIpv4Address(), buffer);
+                writeIpv4Address(((IpAdjacency) nai).getRemoteIpAddress().getIpv4Address(), buffer);
                 break;
             case Ipv6Adjacency:
-                writeIpv6Address(((IpAdjacency) nai).getLocalIpAddress().getIpv6Address(), body);
-                writeIpv6Address(((IpAdjacency) nai).getRemoteIpAddress().getIpv6Address(), body);
+                writeIpv6Address(((IpAdjacency) nai).getLocalIpAddress().getIpv6Address(), buffer);
+                writeIpv6Address(((IpAdjacency) nai).getRemoteIpAddress().getIpv6Address(), buffer);
                 break;
             case Unnumbered:
                 final UnnumberedAdjacency unnumbered = (UnnumberedAdjacency) nai;
-                ByteBufWriteUtil.writeUnsignedInt(unnumbered.getLocalNodeId(), body);
-                ByteBufWriteUtil.writeUnsignedInt(unnumbered.getLocalInterfaceId(), body);
-                ByteBufWriteUtil.writeUnsignedInt(unnumbered.getRemoteNodeId(), body);
-                ByteBufWriteUtil.writeUnsignedInt(unnumbered.getRemoteInterfaceId(), body);
+                ByteBufWriteUtil.writeUnsignedInt(unnumbered.getLocalNodeId(), buffer);
+                ByteBufWriteUtil.writeUnsignedInt(unnumbered.getLocalInterfaceId(), buffer);
+                ByteBufWriteUtil.writeUnsignedInt(unnumbered.getRemoteNodeId(), buffer);
+                ByteBufWriteUtil.writeUnsignedInt(unnumbered.getRemoteInterfaceId(), buffer);
                 break;
             default:
                 break;
             }
         }
-        return body;
+        return buffer;
     }
 
-    public static SrSubobject parseSrSubobject(final ByteBuf buffer, final Function<BitArray, Void> getFlags, final int fPosition, final int sPosition)
-            throws PCEPDeserializerException {
+    protected final SrSubobject parseSrSubobject(final ByteBuf buffer) throws PCEPDeserializerException {
         final int sidTypeByte = buffer.readByte() >> SID_TYPE_BITS_OFFSET;
         final SidType sidType = SidType.forValue(sidTypeByte);
-
         final BitArray bitSet = BitArray.valueOf(buffer.readByte());
-        getFlags.apply(bitSet);
-        final boolean f = bitSet.get(fPosition);
-        final boolean s = bitSet.get(sPosition);
+        final boolean f = bitSet.get(F_FLAG_POSITION);
+        final boolean s = bitSet.get(S_FLAG_POSITION);
+        final boolean c = bitSet.get(C_FLAG_POSITION);
+        final boolean m = bitSet.get(M_FLAG_POSITION);
 
         if (f && s) {
             throw new PCEPDeserializerException("Both SID and NAI are absent in SR subobject.");
         }
-        final Long sid;
+        Long tmp = null;
         if (!s) {
-            sid = buffer.readUnsignedInt();
-        } else {
-            sid = null;
+            if (m) {
+                tmp = buffer.readUnsignedInt() >>> MPLS_LABEL_OFFSET;
+            } else {
+                tmp = buffer.readUnsignedInt();
+            }
         }
-
+        final Long sid = tmp;
         final Nai nai;
 
         if (sidType != null && !f) {
@@ -140,24 +150,37 @@ final class SrSubobjectParserUtil {
         } else {
             nai = null;
         }
-
         return new SrSubobject() {
+
             @Override
             public Class<? extends DataContainer> getImplementedInterface() {
                 return SrSubobject.class;
             }
+
+            @Override
+            public Boolean isMFlag() {
+                return m;
+            }
+
+            @Override
+            public Boolean isCFlag() {
+                return c;
+            }
+
             @Override
             public SidType getSidType() {
                 return sidType;
             }
+
             @Override
             public Long getSid() {
                 return sid;
             }
+
             @Override
             public Nai getNai() {
                 return nai;
             }
         };
     }
-}
\ No newline at end of file
+}
index 717d865d0d072079b8c263dcb22988b292306573..0b7704d22b696d547aabe9084aca77c00e884e21 100644 (file)
@@ -7,82 +7,40 @@
  */
 package org.opendaylight.protocol.pcep.segment.routing;
 
-import static org.opendaylight.protocol.pcep.segment.routing.SrSubobjectParserUtil.BITSET_LENGTH;
-
-import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
+
 import io.netty.buffer.ByteBuf;
+
 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.protocol.util.BitArray;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev150112.SrEroSubobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev150112.SrSubobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev150112.add.lsp.input.arguments.ero.subobject.subobject.type.SrEroTypeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder;
 
-public class SrEroSubobjectParser implements EROSubobjectParser, EROSubobjectSerializer {
+public class SrEroSubobjectParser extends AbstractSrSubobjectParser implements EROSubobjectParser, EROSubobjectSerializer {
 
     public static final int TYPE = 5;
 
-    private static final int M_FLAG_POSITION = 7;
-    private static final int C_FLAG_POSITION = 6;
-    private static final int S_FLAG_POSITION = 5;
-    private static final int F_FLAG_POSITION = 4;
-    private static final int MPLS_LABEL_OFFSET = 12;
-
     @Override
     public void serializeSubobject(final Subobject subobject, final ByteBuf buffer) {
-        Preconditions.checkArgument(subobject.getSubobjectType() instanceof SrEroSubobject,
-                "Unknown subobject instance. Passed %s. Needed SrEroSubobject.", subobject.getSubobjectType()
+        Preconditions.checkArgument(subobject.getSubobjectType() instanceof SrSubobject,
+                "Unknown subobject instance. Passed %s. Needed SrSubobject.", subobject.getSubobjectType()
                         .getClass());
 
-        final SrEroSubobject srEroSubobject = (SrEroSubobject) subobject.getSubobjectType();
-        final SrEroTypeBuilder builder = new SrEroTypeBuilder(srEroSubobject);
-        if (srEroSubobject.isMFlag() != null && srEroSubobject.isMFlag() && srEroSubobject.getSid() != null) {
-            builder.setSid(srEroSubobject.getSid() << MPLS_LABEL_OFFSET);
-        }
-        final BitArray bits = new BitArray(BITSET_LENGTH);
-        bits.set(M_FLAG_POSITION, srEroSubobject.isMFlag());
-        bits.set(C_FLAG_POSITION, srEroSubobject.isCFlags());
-        if (srEroSubobject.getSid() == null) {
-            bits.set(S_FLAG_POSITION, Boolean.TRUE);
-        }
-        if (srEroSubobject.getNai() == null) {
-            bits.set(F_FLAG_POSITION, Boolean.TRUE);
-        }
-        final ByteBuf body = SrSubobjectParserUtil.serializeSrSubobject(builder.build(), bits);
+        final SrSubobject srSubobject = (SrSubobject) subobject.getSubobjectType();
+        final ByteBuf body = serializeSubobject(srSubobject);
         EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
     }
 
     @Override
     public Subobject parseSubobject(final ByteBuf buffer, final boolean loose) throws PCEPDeserializerException {
-        Preconditions.checkArgument(buffer != null && buffer.isReadable(),
-                "Array of bytes is mandatory. Can't be null or empty.");
-        if (buffer.readableBytes() <= SrSubobjectParserUtil.MINIMAL_LENGTH) {
-            throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + buffer.readableBytes() + ";");
-        }
-        final BitArray flags = new BitArray(BITSET_LENGTH);
-        final SrSubobject srSubobject = SrSubobjectParserUtil.parseSrSubobject(buffer, new Function<BitArray, Void>() {
-            @Override
-            public Void apply(final BitArray input) {
-                flags.set(C_FLAG_POSITION, input.get(C_FLAG_POSITION));
-                flags.set(M_FLAG_POSITION, input.get(M_FLAG_POSITION));
-                return null;
-            }
-        }, F_FLAG_POSITION, S_FLAG_POSITION);
-        final SrEroTypeBuilder srEroSubobjectBuilder = new SrEroTypeBuilder(srSubobject);
-        srEroSubobjectBuilder.setCFlags(flags.get(C_FLAG_POSITION));
-        srEroSubobjectBuilder.setMFlag(flags.get(M_FLAG_POSITION));
-        if (srEroSubobjectBuilder.isMFlag() != null && srEroSubobjectBuilder.isMFlag() && srEroSubobjectBuilder.getSid() != null) {
-            srEroSubobjectBuilder.setSid(srEroSubobjectBuilder.getSid() >> MPLS_LABEL_OFFSET);
-        }
+        final SrEroTypeBuilder srEroSubobjectBuilder = new SrEroTypeBuilder(parseSrSubobject(buffer));
         final SubobjectBuilder subobjectBuilder = new SubobjectBuilder();
         subobjectBuilder.setLoose(loose);
         subobjectBuilder.setSubobjectType(srEroSubobjectBuilder.build());
         return subobjectBuilder.build();
     }
-
 }
\ No newline at end of file
diff --git a/pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/SrEroUtil.java b/pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/SrEroUtil.java
deleted file mode 100644 (file)
index 391dda2..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.pcep.segment.routing;
-
-import org.opendaylight.protocol.pcep.spi.PCEPErrors;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.Srp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev150112.SrEroSubobject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.Ero;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.path.setup.type.tlv.PathSetupType;
-
-public final class SrEroUtil {
-
-    private static final int MPLS_LABEL_MIN_VALUE = 16;
-
-    private SrEroUtil() {
-        throw new UnsupportedOperationException();
-    }
-
-    protected static PCEPErrors validateSrEroSubobjects(final Ero ero) {
-        if (ero.getSubobject() != null) {
-            for (final Subobject subobject : ero.getSubobject()) {
-                if (!(subobject.getSubobjectType() instanceof SrEroSubobject)) {
-                    return PCEPErrors.NON_IDENTICAL_ERO_SUBOBJECTS;
-                }
-                final SrEroSubobject srEroSubobject = (SrEroSubobject) subobject.getSubobjectType();
-                if (srEroSubobject.isMFlag() != null && srEroSubobject.isMFlag() && srEroSubobject.getSid() < MPLS_LABEL_MIN_VALUE) {
-                    return PCEPErrors.BAD_LABEL_VALUE;
-                }
-            }
-        }
-        return null;
-    }
-
-    protected static boolean isSegmentRoutingPath(final Srp srp) {
-        if (srp != null && srp.getTlvs() != null && isSrTePst(srp.getTlvs().getPathSetupType())) {
-            return true;
-        }
-        return false;
-    }
-
-    private static boolean isSrTePst(final PathSetupType tlv) {
-        if (tlv != null && tlv.getPst() == 1) {
-            return true;
-        }
-        return false;
-    }
-
-}
index eae3b391e28e00e61b5a505e4ce2325a3f966978..19235ec264b382e837000935dc30e4152521cad9 100644 (file)
@@ -8,64 +8,36 @@
 
 package org.opendaylight.protocol.pcep.segment.routing;
 
-import static org.opendaylight.protocol.pcep.segment.routing.SrSubobjectParserUtil.BITSET_LENGTH;
-import static org.opendaylight.protocol.pcep.segment.routing.SrSubobjectParserUtil.MINIMAL_LENGTH;
-
-import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
+
 import io.netty.buffer.ByteBuf;
+
 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.protocol.util.BitArray;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev150112.SrRroSubobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev150112.SrSubobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev150112.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectBuilder;
 
-public class SrRroSubobjectParser implements RROSubobjectParser, RROSubobjectSerializer {
+public class SrRroSubobjectParser extends AbstractSrSubobjectParser implements RROSubobjectParser, RROSubobjectSerializer {
 
     public static final int TYPE = 6;
 
-    private static final int S_FLAG_POSITION = 7;
-    private static final int F_FLAG_POSITION = 6;
-
     @Override
-    public void serializeSubobject(final Subobject subobject, final ByteBuf buffer) {
-        Preconditions.checkArgument(subobject.getSubobjectType() instanceof SrRroSubobject,
-                "Unknown subobject instance. Passed %s. Needed SrRroSubobject.", subobject.getSubobjectType()
+    public void serializeSubobject(Subobject subobject, ByteBuf buffer) {
+        Preconditions.checkArgument(subobject.getSubobjectType() instanceof SrSubobject,
+                "Unknown subobject instance. Passed %s. Needed SrSubobject.", subobject.getSubobjectType()
                         .getClass());
-
-        final SrRroSubobject srRroSubobject = (SrRroSubobject) subobject.getSubobjectType();
-        final BitArray bits = new BitArray(BITSET_LENGTH);
-        if (srRroSubobject.getSid() == null) {
-            bits.set(S_FLAG_POSITION, Boolean.TRUE);
-        }
-        if (srRroSubobject.getNai() == null) {
-            bits.set(F_FLAG_POSITION, Boolean.TRUE);
-        }
-        final ByteBuf body = SrSubobjectParserUtil.serializeSrSubobject(srRroSubobject, bits);
+        final SrSubobject srSubobject = (SrSubobject) subobject.getSubobjectType();
+        final ByteBuf body = serializeSubobject(srSubobject);
         RROSubobjectUtil.formatSubobject(TYPE, body, buffer);
     }
 
     @Override
     public Subobject parseSubobject(final ByteBuf buffer) throws PCEPDeserializerException {
-        Preconditions.checkArgument(buffer != null && buffer.isReadable(),
-                "Array of bytes is mandatory. Can't be null or empty.");
-        if (buffer.readableBytes() <= MINIMAL_LENGTH) {
-            throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + buffer.readableBytes() + ";");
-        }
-
-        final SrSubobject srSubobject = SrSubobjectParserUtil.parseSrSubobject(buffer, new Function<BitArray, Void>() {
-            @Override
-            public Void apply(final BitArray input) {
-                return null;
-            }
-        }, F_FLAG_POSITION, S_FLAG_POSITION);
-        final SrRroTypeBuilder srRroSubobjectBuilder = new SrRroTypeBuilder(srSubobject);
-
+        final SrRroTypeBuilder srRroSubobjectBuilder = new SrRroTypeBuilder(parseSrSubobject(buffer));
         final SubobjectBuilder subobjectBuilder = new SubobjectBuilder();
         subobjectBuilder.setSubobjectType(srRroSubobjectBuilder.build());
         return subobjectBuilder.build();
index c08339c28b3409c48d56592e816e275faf3bbb40..fa6bc969f9e4c535b9e524a8cacdb627bdd5c377 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-00.
+        draft-ietf-pce-segment-routing-01.
 
         Copyright (c)2015 Cisco Systems, Inc. All rights reserved.
 
@@ -28,12 +28,12 @@ module odl-pcep-segment-routing {
     revision "2015-01-12" {
         description
             "Upgrade from draft-sivabalan-pce-segment-routing-02.";
-        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-00";
+        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01";
     }
 
     grouping sr-pce-capability-tlv {
         description "SR-PCE-CAPABILITY TLV";
-        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-00#section-5.1.1";
+        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.1.1";
 
         container sr-pce-capability {
             uses pcep:tlv;
@@ -46,17 +46,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-00#section-5.1";
+        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.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-00#section-5.1";
+        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.1";
         uses sr-pce-capability-tlv;
     }
 
     typedef sid-type {
-        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-00#section-5.3.1";
+        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.3.1";
         type enumeration {
             enum ipv4-node-id {
                 value 1;
@@ -77,17 +77,24 @@ module odl-pcep-segment-routing {
     }
 
     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 m-flag {
+            type boolean;
+            default false;
+        }
         leaf sid-type {
             type sid-type;
         }
-
         leaf sid {
             description "Segment Identifier";
             type uint32;
         }
-
         choice nai {
-            reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-00#section-5.3.2";
+            reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.3.2";
             description "Node or Adjacency Identifier";
             case ip-node-id {
                 when "../sid-type = 'ipv4-node-id' or ../sid-type = 'ipv6-node-id'";
@@ -132,21 +139,14 @@ module odl-pcep-segment-routing {
         }
     }
 
+    // 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-00#section-5.3.1";
-        leaf c-flags {
-            type boolean;
-            default false;
-        }
-        leaf m-flag {
-            type boolean;
-            default false;
-        }
+        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.3.1";
         uses sr-subobject;
     }
 
     grouping sr-rro-subobject {
-        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-00#section-5.4";
+        reference "http://tools.ietf.org/html/draft-ietf-pce-segment-routing-01#section-5.4";
         uses sr-subobject;
     }
 
index 19fdb80e9f7ef4a1952e3e4b651dd1d8dcf59971..44a6ea4fe18b78e0d10f33f8b114a8b195ce6e84 100644 (file)
@@ -76,7 +76,7 @@ public class SrEroSubobjectParserTest {
 
     private static final byte[] srEroSubobjectWithoutNAI  = {
         0x05,0x08,(byte) 0x10,0x08,
-        0x00,0x01,(byte) 0xe2,0x40,
+        0x00,0x01,(byte) 0xe2,0x40
     };
 
     private static final byte[] srEroSubobjectWithoutSID  = {
@@ -111,7 +111,7 @@ public class SrEroSubobjectParserTest {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder();
         builder.setSidType(SidType.Ipv4NodeId);
         builder.setSid(123456L);
-        builder.setCFlags(false);
+        builder.setCFlag(false);
         builder.setMFlag(false);
         builder.setNai(new IpNodeIdBuilder().setIpAddress(new IpAddress(new Ipv4Address("74.125.43.99"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
@@ -128,7 +128,7 @@ public class SrEroSubobjectParserTest {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder();
         builder.setSidType(SidType.Ipv6NodeId);
         builder.setSid(123456L);
-        builder.setCFlags(false);
+        builder.setCFlag(false);
         builder.setMFlag(false);
         builder.setNai(new IpNodeIdBuilder().setIpAddress(new IpAddress(new Ipv6Address("fe80:cd00::211e:729c"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
@@ -145,7 +145,7 @@ public class SrEroSubobjectParserTest {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder();
         builder.setSidType(SidType.Ipv4Adjacency);
         builder.setSid(123456L);
-        builder.setCFlags(false);
+        builder.setCFlag(false);
         builder.setMFlag(false);
         builder.setNai(new IpAdjacencyBuilder().setLocalIpAddress(new IpAddress(new Ipv4Address("74.125.43.99")))
                 .setRemoteIpAddress(new IpAddress(new Ipv4Address("74.125.43.100"))).build());
@@ -163,7 +163,7 @@ public class SrEroSubobjectParserTest {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder();
         builder.setSidType(SidType.Ipv6Adjacency);
         builder.setSid(123456L);
-        builder.setCFlags(false);
+        builder.setCFlag(false);
         builder.setMFlag(false);
         builder.setNai(new IpAdjacencyBuilder().setLocalIpAddress(new IpAddress(new Ipv6Address("fe80:cd00::211e:729c")))
                 .setRemoteIpAddress(new IpAddress(new Ipv6Address("fe80:cd00::211e:729d"))).build());
@@ -181,7 +181,7 @@ public class SrEroSubobjectParserTest {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder();
         builder.setSidType(SidType.Unnumbered);
         builder.setSid(123456L);
-        builder.setCFlags(false);
+        builder.setCFlag(false);
         builder.setMFlag(false);
         builder.setNai(new UnnumberedAdjacencyBuilder().setLocalNodeId(1L).setLocalInterfaceId(2L).setRemoteNodeId(3L).setRemoteInterfaceId(4L).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
@@ -198,7 +198,7 @@ public class SrEroSubobjectParserTest {
         final SrEroTypeBuilder builder = new SrEroTypeBuilder();
         builder.setSidType(SidType.Ipv4NodeId);
         builder.setSid(123456L);
-        builder.setCFlags(false);
+        builder.setCFlag(false);
         builder.setMFlag(false);
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
 
@@ -213,7 +213,7 @@ public class SrEroSubobjectParserTest {
         final SrEroSubobjectParser parser = new SrEroSubobjectParser();
         final SrEroTypeBuilder builder = new SrEroTypeBuilder();
         builder.setSidType(SidType.Ipv4NodeId);
-        builder.setCFlags(false);
+        builder.setCFlag(false);
         builder.setMFlag(false);
         builder.setNai(new IpNodeIdBuilder().setIpAddress(new IpAddress(new Ipv4Address("74.125.43.99"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
@@ -228,7 +228,7 @@ public class SrEroSubobjectParserTest {
     public void testSrEroSubobjectIpv4NodeIdNAIMFlag() throws PCEPDeserializerException {
         final SrEroSubobjectParser parser = new SrEroSubobjectParser();
         final SrEroTypeBuilder builder = new SrEroTypeBuilder();
-        builder.setCFlags(false);
+        builder.setCFlag(false);
         builder.setMFlag(true);
         builder.setSidType(SidType.Ipv4NodeId);
         builder.setSid(30140L);
diff --git a/pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrEroUtilTest.java b/pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrEroUtilTest.java
deleted file mode 100644 (file)
index 904e60c..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.protocol.pcep.segment.routing;
-
-import com.google.common.collect.Lists;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Collections;
-import java.util.List;
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.protocol.pcep.spi.PCEPErrors;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.SrpBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.srp.TlvsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev150112.pcinitiate.pcinitiate.message.requests.ero.subobject.subobject.type.SrEroTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.Ero;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.EroBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.path.setup.type.tlv.PathSetupTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.IpPrefixCaseBuilder;
-
-public class SrEroUtilTest {
-
-    @Test(expected=UnsupportedOperationException.class)
-    public void testPrivateConstructor() throws Throwable {
-        final Constructor<SrEroUtil> c = SrEroUtil.class.getDeclaredConstructor();
-        c.setAccessible(true);
-        try {
-            c.newInstance();
-        } catch (final InvocationTargetException e) {
-            throw e.getCause();
-        }
-    }
-
-    @Test
-    public void testValidateSrEroSubobjects() {
-        Assert.assertNull(SrEroUtil.validateSrEroSubobjects(createEro(Lists.newArrayList(createSRSubobject()))));
-        Assert.assertNull(SrEroUtil.validateSrEroSubobjects(createEro(Collections.<Subobject>emptyList())));
-        Assert.assertNull(SrEroUtil.validateSrEroSubobjects(createEro(null)));
-        Assert.assertNull(SrEroUtil.validateSrEroSubobjects(createEro(Lists.newArrayList(createSRSubobject(20L, true)))));
-        Assert.assertNull(SrEroUtil.validateSrEroSubobjects(createEro(Lists.newArrayList(createSRSubobject(20L, false)))));
-        Assert.assertNull(SrEroUtil.validateSrEroSubobjects(createEro(Lists.newArrayList(createSRSubobject(10L, false)))));
-        Assert.assertEquals(PCEPErrors.BAD_LABEL_VALUE, SrEroUtil.validateSrEroSubobjects(createEro(Lists.newArrayList(createSRSubobject(10L, true)))));
-        Assert.assertEquals(PCEPErrors.NON_IDENTICAL_ERO_SUBOBJECTS,
-                SrEroUtil.validateSrEroSubobjects(createEro(Lists.newArrayList(createIpPrefixSubobject()))));
-    }
-
-    @Test
-    public void testIsSegmentRoutingPath() {
-        Assert.assertFalse(SrEroUtil.isSegmentRoutingPath(null));
-        Assert.assertFalse(SrEroUtil.isSegmentRoutingPath(new SrpBuilder().build()));
-        Assert.assertFalse(SrEroUtil.isSegmentRoutingPath(new SrpBuilder().setTlvs(new TlvsBuilder().build()).build()));
-        Assert.assertFalse(SrEroUtil.isSegmentRoutingPath(new SrpBuilder().setTlvs(new TlvsBuilder().setPathSetupType(new PathSetupTypeBuilder().setPst((short) 8).build()).build()).build()));
-        Assert.assertTrue(SrEroUtil.isSegmentRoutingPath(new SrpBuilder().setTlvs(new TlvsBuilder().setPathSetupType(new PathSetupTypeBuilder().setPst((short) 1).build()).build()).build()));
-    }
-
-    private Ero createEro(final List<Subobject> subobejcts) {
-        return new EroBuilder().setSubobject(subobejcts).build();
-    }
-
-    private Subobject createSRSubobject() {
-        final SubobjectBuilder builder = new SubobjectBuilder();
-        builder.setSubobjectType(new SrEroTypeBuilder().build());
-        return builder.build();
-    }
-
-    private Subobject createSRSubobject(final long sid, final boolean isM) {
-        final SubobjectBuilder builder = new SubobjectBuilder();
-        builder.setSubobjectType(new SrEroTypeBuilder().setMFlag(isM).setSid(sid).build());
-        return builder.build();
-    }
-
-    private Subobject createIpPrefixSubobject() {
-        final SubobjectBuilder builder = new SubobjectBuilder();
-        builder.setSubobjectType(new IpPrefixCaseBuilder().build());
-        return builder.build();
-    }
-}
index ecf3aea886d4a23b5f18e6929d261b2223a2ff39..902cd5e742334adbeb7835a62605c338f881f24d 100644 (file)
@@ -105,7 +105,7 @@ public class SrObjectParserTest {
         final List<Subobject> subobjects = Lists.newArrayList();
 
         final SrEroTypeBuilder srEroSubBuilder = new SrEroTypeBuilder();
-        srEroSubBuilder.setCFlags(false);
+        srEroSubBuilder.setCFlag(false);
         srEroSubBuilder.setMFlag(false);
         srEroSubBuilder.setSidType(SidType.Ipv4NodeId);
         srEroSubBuilder.setSid(123456L);
index 67f0605e20bd4aa15f0533fd74682ad43a10c7a8..37811ade435c471e1453fb85bcfc616194bfdc38 100644 (file)
@@ -10,9 +10,9 @@ package org.opendaylight.protocol.pcep.segment.routing;
 
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
-
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
@@ -75,12 +75,12 @@ public class SrRroSubobjectParserTest {
     };
 
     private static final byte[] srRroSubobjectWithoutNAI  = {
-        0x06,0x08,(byte) 0x10,0x02,
-        0x00,0x01,(byte) 0xe2,0x40,
+        0x06,0x08, (byte) 0x10,0xb,
+        0x1e,0x24,(byte) (byte)-32, 0x00,
     };
 
     private static final byte[] srRroSubobjectWithoutSID  = {
-        0x06,0x08,(byte) 0x10,0x01,
+        0x06,0x08,(byte) 0x10,0x04,
         0x4A,0x7D,0x2b,0x63,
     };
 
@@ -100,6 +100,8 @@ public class SrRroSubobjectParserTest {
         final SrRroTypeBuilder builder = new SrRroTypeBuilder();
         builder.setSidType(SidType.Ipv4NodeId);
         builder.setSid(123456L);
+        builder.setCFlag(false);
+        builder.setMFlag(false);
         builder.setNai(new IpNodeIdBuilder().setIpAddress(new IpAddress(new Ipv4Address("74.125.43.99"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
 
@@ -114,6 +116,8 @@ public class SrRroSubobjectParserTest {
         final SrRroSubobjectParser parser = new SrRroSubobjectParser();
         final SrRroTypeBuilder builder = new SrRroTypeBuilder();
         builder.setSidType(SidType.Ipv6NodeId);
+        builder.setCFlag(false);
+        builder.setMFlag(false);
         builder.setSid(123456L);
         builder.setNai(new IpNodeIdBuilder().setIpAddress(new IpAddress(new Ipv6Address("fe80:cd00::211e:729c"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
@@ -130,6 +134,8 @@ public class SrRroSubobjectParserTest {
         final SrRroTypeBuilder builder = new SrRroTypeBuilder();
         builder.setSidType(SidType.Ipv4Adjacency);
         builder.setSid(123456L);
+        builder.setCFlag(false);
+        builder.setMFlag(false);
         builder.setNai(new IpAdjacencyBuilder().setLocalIpAddress(new IpAddress(new Ipv4Address("74.125.43.99")))
                 .setRemoteIpAddress(new IpAddress(new Ipv4Address("74.125.43.100"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
@@ -146,6 +152,8 @@ public class SrRroSubobjectParserTest {
         final SrRroTypeBuilder builder = new SrRroTypeBuilder();
         builder.setSidType(SidType.Ipv6Adjacency);
         builder.setSid(123456L);
+        builder.setCFlag(false);
+        builder.setMFlag(false);
         builder.setNai(new IpAdjacencyBuilder().setLocalIpAddress(new IpAddress(new Ipv6Address("fe80:cd00::211e:729c")))
                 .setRemoteIpAddress(new IpAddress(new Ipv6Address("fe80:cd00::211e:729d"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
@@ -162,6 +170,8 @@ public class SrRroSubobjectParserTest {
         final SrRroTypeBuilder builder = new SrRroTypeBuilder();
         builder.setSidType(SidType.Unnumbered);
         builder.setSid(123456L);
+        builder.setCFlag(false);
+        builder.setMFlag(false);
         builder.setNai(new UnnumberedAdjacencyBuilder().setLocalNodeId(1L).setLocalInterfaceId(2L).setRemoteNodeId(3L).setRemoteInterfaceId(4L).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
 
@@ -176,7 +186,9 @@ public class SrRroSubobjectParserTest {
         final SrRroSubobjectParser parser = new SrRroSubobjectParser();
         final SrRroTypeBuilder builder = new SrRroTypeBuilder();
         builder.setSidType(SidType.Ipv4NodeId);
-        builder.setSid(123456L);
+        builder.setSid(123470L);
+        builder.setCFlag(true);
+        builder.setMFlag(true);
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
 
         assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(srRroSubobjectWithoutNAI, 2))));
@@ -190,6 +202,8 @@ public class SrRroSubobjectParserTest {
         final SrRroSubobjectParser parser = new SrRroSubobjectParser();
         final SrRroTypeBuilder builder = new SrRroTypeBuilder();
         builder.setSidType(SidType.Ipv4NodeId);
+        builder.setCFlag(false);
+        builder.setMFlag(false);
         builder.setNai(new IpNodeIdBuilder().setIpAddress(new IpAddress(new Ipv4Address("74.125.43.99"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
 
diff --git a/pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrSubobjectParserUtilTest.java b/pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrSubobjectParserUtilTest.java
deleted file mode 100644 (file)
index 5e63263..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.protocol.pcep.segment.routing;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import org.junit.Test;
-
-public class SrSubobjectParserUtilTest {
-
-    @Test(expected=UnsupportedOperationException.class)
-    public void testPrivateConstructor() throws Throwable {
-        final Constructor<SrSubobjectParserUtil> c = SrSubobjectParserUtil.class.getDeclaredConstructor();
-        c.setAccessible(true);
-        try {
-            c.newInstance();
-        } catch (InvocationTargetException e) {
-            throw e.getCause();
-        }
-    }
-}
index 09a73820cb93e925ea4ffc848e2ef217b63346d0..1606001389c86c0bdd754fc17bd4a3f9d29523f9 100644 (file)
@@ -115,7 +115,7 @@ public class TopologyProviderTest extends AbstractPCEPSessionTest<Stateful07Topo
 
     private static Ero createSrEroObject(final String nai) {
         final SrEroTypeBuilder srEroBuilder = new SrEroTypeBuilder();
-        srEroBuilder.setCFlags(false);
+        srEroBuilder.setCFlag(false);
         srEroBuilder.setMFlag(false);
         srEroBuilder.setSidType(SidType.Ipv4NodeId);
         srEroBuilder.setSid(123456L);
index 35ee6cbe93386c3b9b3b648e17e179d0eca5531e..d6045916531fd0300754cb04a4216b2a6fefadd5 100644 (file)
@@ -284,6 +284,10 @@ public enum PCEPErrors {
      * Segment Routing error: Both SID and NAI are absent in RRO subobject.
      */
     SID_AND_NAI_ABSENT_IN_RRO(10, 7),
+    /**
+     * Segment Routing error: Non-identical RRO subobjects.
+     */
+    SID_NON_IDENTICAL_RRO_SUBOBJECTS(10, 8),
     /**
      * Invalid traffic engineering path setup type: Unsupported path setup type
      */