BUG-2738 : fixed path setup tlv type 00/15500/2
authorMilos Fabian <milfabia@cisco.com>
Thu, 19 Feb 2015 16:43:44 +0000 (17:43 +0100)
committerMilos Fabian <milfabia@cisco.com>
Thu, 19 Feb 2015 16:43:44 +0000 (17:43 +0100)
Change-Id: Ic19c57a9a614bacd9be2709b09c2e94214276282
Signed-off-by: Dana Kutenicsova <dkutenic@cisco.com>
Signed-off-by: Milos Fabian <milfabia@cisco.com>
pcep/ietf-stateful07/src/test/java/org/opendaylight/protocol/pcep/ietf/PCEPObjectParserTest.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/tlv/PathSetupTypeTlvParser.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPObjectParserTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPTlvParserTest.java
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrTlvParserTest.java

index de6fbe6744c3243ee10121c8e03e23545d38fad7..ce4d9f56d64ec450f87834dadabfddc22fa1b695 100644 (file)
@@ -228,7 +228,7 @@ public class PCEPObjectParserTest {
         final byte[] srpObjectWithPstTlvBytes = { 0x21, 0x10, 0x00, 0x14, 0x0, 0x0, 0x0, 0x01, 0x0, 0x0,
             0x0, 0x01,
             /* pst-tlv */
-            0x0, 0x1b, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
+            0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
         final CInitiated00SrpObjectParser parser = new CInitiated00SrpObjectParser(this.tlvRegistry, this.viTlvRegistry);
         SrpBuilder builder = new SrpBuilder();
         builder.setProcessingRule(false);
index 0b72a4c35d4c74d239bfb0b94bf3b7726cb6bf01..8f87502a7f9c80fa57737810b01bf4fb31791940 100644 (file)
@@ -25,8 +25,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ
 
 public class PathSetupTypeTlvParser implements TlvParser, TlvSerializer {
 
-    // http://tools.ietf.org/html/draft-sivabalan-pce-ietf-routing-00#section-9.3
-    public static final int TYPE = 27;
+    public static final int TYPE = 28;
 
     private static final int CONTENT_LENGTH = 4;
     private static final int PST_LENGTH = 1;
@@ -41,18 +40,18 @@ public class PathSetupTypeTlvParser implements TlvParser, TlvSerializer {
     }
 
     @Override
-    public void serializeTlv(Tlv tlv, ByteBuf buffer) {
+    public void serializeTlv(final Tlv tlv, final ByteBuf buffer) {
         Preconditions.checkArgument(tlv instanceof PathSetupType, "PathSetupType is mandatory.");
         final PathSetupType pstTlv = (PathSetupType) tlv;
         Preconditions.checkArgument(checkPST(pstTlv.getPst()), UNSUPPORTED_PST);
-        ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
+        final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
         body.writeZero(OFFSET);
         writeUnsignedByte(pstTlv.getPst(), body);
         TlvUtil.formatTlv(TYPE, body, buffer);
     }
 
     @Override
-    public Tlv parseTlv(ByteBuf buffer) throws PCEPDeserializerException {
+    public Tlv parseTlv(final ByteBuf buffer) throws PCEPDeserializerException {
         if (buffer == null) {
             return null;
         }
index 6cdfdb13bddc14f4460d5e2e6757e9178ec673a1..2292cc5d03786aa96e8467321d61e67cc4d7954f 100644 (file)
@@ -1268,7 +1268,7 @@ public class PCEPObjectParserTest {
         final byte[] rpObjectWithPstTlvBytes = { 0x2, 0x10, 0x0, 0x14, 0x0, 0x0, 0x4, 0x2d, (byte) 0xde,
             (byte) 0xad, (byte) 0xbe, (byte) 0xef,
             /* pst-tlv */
-            0x0, 0x1b, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
+            0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
 
         final PCEPRequestParameterObjectParser parser = new PCEPRequestParameterObjectParser(this.tlvRegistry, this.viTlvRegistry);
         final RpBuilder builder = new RpBuilder();
index 59178911624c361cbfc510b513dcd12216d0d8d5..cbd21943c81695ec5d096df95737b5a512c98787 100644 (file)
@@ -66,9 +66,9 @@ public class PCEPTlvParserTest {
         0x00, 0x00, 0x00, 0x05
     };
 
-    private static final byte[] PST_TLV_BYTES = { 0x0, 0x1b, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
+    private static final byte[] PST_TLV_BYTES = { 0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
 
-    private static final byte[] PST_TLV_BYTES_UNSUPPORTED = { 0x0, 0x1b, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1 };
+    private static final byte[] PST_TLV_BYTES_UNSUPPORTED = { 0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1 };
 
     private final AbstractVendorSpecificTlvParser vsParser = new AbstractVendorSpecificTlvParser() {
 
index 0854f7327a3c29e446682e2204fb89fb127f6584..68515b3b46c24339959e2541b5dbac8a0664bc47 100644 (file)
@@ -25,7 +25,7 @@ public class SrTlvParserTest {
 
     private static final byte[] SPC_TLV_BYTES = { 0x0, 0x1a, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1 };
 
-    private static final byte[] SR_TE_PST_BYTES = { 0x0, 0x1b, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1 };
+    private static final byte[] SR_TE_PST_BYTES = { 0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1 };
 
     @Test
     public void testSrPceCapabilityParser() throws PCEPDeserializerException {