Committed by
Gerrit Code Review
PCEP protocol message update
Change-Id: Icdea6c105553cd3dec1cacea6e2951f9e422b676
Showing
9 changed files
with
315 additions
and
140 deletions
| ... | @@ -38,19 +38,19 @@ import com.google.common.base.MoreObjects; | ... | @@ -38,19 +38,19 @@ import com.google.common.base.MoreObjects; |
| 38 | public class PcepLabelObjectVer1 implements PcepLabelObject { | 38 | public class PcepLabelObjectVer1 implements PcepLabelObject { |
| 39 | 39 | ||
| 40 | /* | 40 | /* |
| 41 | - * ref : draft-zhao-pce-pcep-extension-for-pce-controller-01 , section : 7.4. | 41 | + * ref : draft-zhao-pce-pcep-extension-for-pce-controller-03, section : 7.3. |
| 42 | - | 42 | + |
| 43 | - 0 1 2 3 | 43 | + 0 1 2 3 |
| 44 | - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 44 | + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
| 45 | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 45 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 46 | - | Reserved | Flags |O| | 46 | + | Reserved | Flags |O| |
| 47 | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 47 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 48 | - | Label | | 48 | + | Label | Reserved | |
| 49 | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 49 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 50 | - | | | 50 | + | | |
| 51 | - // Optional TLV // | 51 | + // Optional TLV // |
| 52 | - | | | 52 | + | | |
| 53 | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 53 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 54 | The LABEL Object format | 54 | The LABEL Object format |
| 55 | */ | 55 | */ |
| 56 | protected static final Logger log = LoggerFactory.getLogger(PcepLspObjectVer1.class); | 56 | protected static final Logger log = LoggerFactory.getLogger(PcepLspObjectVer1.class); |
| ... | @@ -65,6 +65,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { | ... | @@ -65,6 +65,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { |
| 65 | public static final short LABEL_OBJ_MINIMUM_LENGTH = 12; | 65 | public static final short LABEL_OBJ_MINIMUM_LENGTH = 12; |
| 66 | 66 | ||
| 67 | public static final int OFLAG_SET = 1; | 67 | public static final int OFLAG_SET = 1; |
| 68 | + public static final int SHIFT_LABEL = 12; | ||
| 68 | public static final int OFLAG_RESET = 0; | 69 | public static final int OFLAG_RESET = 0; |
| 69 | public static final int MINIMUM_COMMON_HEADER_LENGTH = 4; | 70 | public static final int MINIMUM_COMMON_HEADER_LENGTH = 4; |
| 70 | 71 | ||
| ... | @@ -72,45 +73,45 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { | ... | @@ -72,45 +73,45 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { |
| 72 | PcepObjectHeader.REQ_OBJ_OPTIONAL_PROCESS, PcepObjectHeader.RSP_OBJ_PROCESSED, LABEL_OBJ_MINIMUM_LENGTH); | 73 | PcepObjectHeader.REQ_OBJ_OPTIONAL_PROCESS, PcepObjectHeader.RSP_OBJ_PROCESSED, LABEL_OBJ_MINIMUM_LENGTH); |
| 73 | 74 | ||
| 74 | private PcepObjectHeader labelObjHeader; | 75 | private PcepObjectHeader labelObjHeader; |
| 75 | - private boolean bOFlag; | 76 | + private boolean oBit; |
| 76 | private int label; | 77 | private int label; |
| 77 | // Optional TLV | 78 | // Optional TLV |
| 78 | - private LinkedList<PcepValueType> llOptionalTlv; | 79 | + private LinkedList<PcepValueType> optionalTlv; |
| 79 | 80 | ||
| 80 | /** | 81 | /** |
| 81 | * Constructor to initialize parameters for PCEP label object. | 82 | * Constructor to initialize parameters for PCEP label object. |
| 82 | * | 83 | * |
| 83 | * @param labelObjHeader label object header | 84 | * @param labelObjHeader label object header |
| 84 | - * @param bOFlag O flag | 85 | + * @param oBit O flag |
| 85 | * @param label label | 86 | * @param label label |
| 86 | - * @param llOptionalTlv list of optional tlvs | 87 | + * @param optionalTlv list of optional tlvs |
| 87 | */ | 88 | */ |
| 88 | - public PcepLabelObjectVer1(PcepObjectHeader labelObjHeader, boolean bOFlag, int label, | 89 | + public PcepLabelObjectVer1(PcepObjectHeader labelObjHeader, boolean oBit, int label, |
| 89 | - LinkedList<PcepValueType> llOptionalTlv) { | 90 | + LinkedList<PcepValueType> optionalTlv) { |
| 90 | this.labelObjHeader = labelObjHeader; | 91 | this.labelObjHeader = labelObjHeader; |
| 91 | - this.bOFlag = bOFlag; | 92 | + this.oBit = oBit; |
| 92 | this.label = label; | 93 | this.label = label; |
| 93 | - this.llOptionalTlv = llOptionalTlv; | 94 | + this.optionalTlv = optionalTlv; |
| 94 | } | 95 | } |
| 95 | 96 | ||
| 96 | @Override | 97 | @Override |
| 97 | public LinkedList<PcepValueType> getOptionalTlv() { | 98 | public LinkedList<PcepValueType> getOptionalTlv() { |
| 98 | - return this.llOptionalTlv; | 99 | + return this.optionalTlv; |
| 99 | } | 100 | } |
| 100 | 101 | ||
| 101 | @Override | 102 | @Override |
| 102 | - public void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv) { | 103 | + public void setOptionalTlv(LinkedList<PcepValueType> optionalTlv) { |
| 103 | - this.llOptionalTlv = llOptionalTlv; | 104 | + this.optionalTlv = optionalTlv; |
| 104 | } | 105 | } |
| 105 | 106 | ||
| 106 | @Override | 107 | @Override |
| 107 | public boolean getOFlag() { | 108 | public boolean getOFlag() { |
| 108 | - return this.bOFlag; | 109 | + return this.oBit; |
| 109 | } | 110 | } |
| 110 | 111 | ||
| 111 | @Override | 112 | @Override |
| 112 | public void setOFlag(boolean value) { | 113 | public void setOFlag(boolean value) { |
| 113 | - this.bOFlag = value; | 114 | + this.oBit = value; |
| 114 | } | 115 | } |
| 115 | 116 | ||
| 116 | @Override | 117 | @Override |
| ... | @@ -134,23 +135,24 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { | ... | @@ -134,23 +135,24 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { |
| 134 | 135 | ||
| 135 | PcepObjectHeader labelObjHeader; | 136 | PcepObjectHeader labelObjHeader; |
| 136 | 137 | ||
| 137 | - boolean bOFlag; | 138 | + boolean oBit; |
| 138 | int label; | 139 | int label; |
| 139 | 140 | ||
| 140 | // Optional TLV | 141 | // Optional TLV |
| 141 | - LinkedList<PcepValueType> llOptionalTlv = new LinkedList<>(); | 142 | + LinkedList<PcepValueType> optionalTlv = new LinkedList<>(); |
| 142 | labelObjHeader = PcepObjectHeader.read(cb); | 143 | labelObjHeader = PcepObjectHeader.read(cb); |
| 143 | 144 | ||
| 144 | //take only LspObject buffer. | 145 | //take only LspObject buffer. |
| 145 | ChannelBuffer tempCb = cb.readBytes(labelObjHeader.getObjLen() - OBJECT_HEADER_LENGTH); | 146 | ChannelBuffer tempCb = cb.readBytes(labelObjHeader.getObjLen() - OBJECT_HEADER_LENGTH); |
| 146 | 147 | ||
| 147 | int iTemp = tempCb.readInt(); | 148 | int iTemp = tempCb.readInt(); |
| 148 | - bOFlag = (iTemp & (byte) 0x01) == 1; | 149 | + oBit = (iTemp & (byte) OFLAG_SET) == OFLAG_SET; |
| 149 | - label = tempCb.readInt(); | 150 | + iTemp = tempCb.readInt(); |
| 151 | + label = (int) iTemp >> SHIFT_LABEL; | ||
| 150 | 152 | ||
| 151 | // parse optional TLV | 153 | // parse optional TLV |
| 152 | - llOptionalTlv = parseOptionalTlv(tempCb); | 154 | + optionalTlv = parseOptionalTlv(tempCb); |
| 153 | - return new PcepLabelObjectVer1(labelObjHeader, bOFlag, label, llOptionalTlv); | 155 | + return new PcepLabelObjectVer1(labelObjHeader, oBit, label, optionalTlv); |
| 154 | } | 156 | } |
| 155 | 157 | ||
| 156 | @Override | 158 | @Override |
| ... | @@ -166,9 +168,11 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { | ... | @@ -166,9 +168,11 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { |
| 166 | 168 | ||
| 167 | byte oFlag; | 169 | byte oFlag; |
| 168 | 170 | ||
| 169 | - oFlag = (byte) ((bOFlag) ? OFLAG_SET : OFLAG_RESET); | 171 | + oFlag = (byte) ((oBit) ? OFLAG_SET : OFLAG_RESET); |
| 170 | cb.writeInt(oFlag); | 172 | cb.writeInt(oFlag); |
| 171 | - cb.writeInt(label); | 173 | + int temp = label; |
| 174 | + temp = (int) label << SHIFT_LABEL; | ||
| 175 | + cb.writeInt(temp); | ||
| 172 | 176 | ||
| 173 | // Add optional TLV | 177 | // Add optional TLV |
| 174 | packOptionalTlv(cb); | 178 | packOptionalTlv(cb); |
| ... | @@ -245,7 +249,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { | ... | @@ -245,7 +249,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { |
| 245 | */ | 249 | */ |
| 246 | protected int packOptionalTlv(ChannelBuffer cb) { | 250 | protected int packOptionalTlv(ChannelBuffer cb) { |
| 247 | 251 | ||
| 248 | - ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator(); | 252 | + ListIterator<PcepValueType> listIterator = optionalTlv.listIterator(); |
| 249 | 253 | ||
| 250 | while (listIterator.hasNext()) { | 254 | while (listIterator.hasNext()) { |
| 251 | PcepValueType tlv = listIterator.next(); | 255 | PcepValueType tlv = listIterator.next(); |
| ... | @@ -269,10 +273,10 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { | ... | @@ -269,10 +273,10 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { |
| 269 | private boolean bIsLabelSet = false; | 273 | private boolean bIsLabelSet = false; |
| 270 | 274 | ||
| 271 | private PcepObjectHeader labelObjHeader; | 275 | private PcepObjectHeader labelObjHeader; |
| 272 | - private boolean bOFlag; | 276 | + private boolean oBit; |
| 273 | private int label; | 277 | private int label; |
| 274 | 278 | ||
| 275 | - LinkedList<PcepValueType> llOptionalTlv = new LinkedList<>(); | 279 | + LinkedList<PcepValueType> optionalTlv = new LinkedList<>(); |
| 276 | 280 | ||
| 277 | private boolean bIsPFlagSet = false; | 281 | private boolean bIsPFlagSet = false; |
| 278 | private boolean bPFlag; | 282 | private boolean bPFlag; |
| ... | @@ -283,7 +287,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { | ... | @@ -283,7 +287,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { |
| 283 | @Override | 287 | @Override |
| 284 | public PcepLabelObject build() throws PcepParseException { | 288 | public PcepLabelObject build() throws PcepParseException { |
| 285 | PcepObjectHeader labelObjHeader = this.bIsHeaderSet ? this.labelObjHeader : DEFAULT_LABEL_OBJECT_HEADER; | 289 | PcepObjectHeader labelObjHeader = this.bIsHeaderSet ? this.labelObjHeader : DEFAULT_LABEL_OBJECT_HEADER; |
| 286 | - boolean bOFlag = this.bIsOFlagSet ? this.bOFlag : DEFAULT_OFLAG; | 290 | + boolean oBit = this.bIsOFlagSet ? this.oBit : DEFAULT_OFLAG; |
| 287 | 291 | ||
| 288 | if (!this.bIsLabelSet) { | 292 | if (!this.bIsLabelSet) { |
| 289 | throw new PcepParseException(" Label NOT Set while building PcepLabelObject."); | 293 | throw new PcepParseException(" Label NOT Set while building PcepLabelObject."); |
| ... | @@ -294,7 +298,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { | ... | @@ -294,7 +298,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { |
| 294 | if (bIsIFlagSet) { | 298 | if (bIsIFlagSet) { |
| 295 | labelObjHeader.setIFlag(bIFlag); | 299 | labelObjHeader.setIFlag(bIFlag); |
| 296 | } | 300 | } |
| 297 | - return new PcepLabelObjectVer1(labelObjHeader, bOFlag, this.label, this.llOptionalTlv); | 301 | + return new PcepLabelObjectVer1(labelObjHeader, oBit, this.label, this.optionalTlv); |
| 298 | } | 302 | } |
| 299 | 303 | ||
| 300 | @Override | 304 | @Override |
| ... | @@ -311,12 +315,12 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { | ... | @@ -311,12 +315,12 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { |
| 311 | 315 | ||
| 312 | @Override | 316 | @Override |
| 313 | public boolean getOFlag() { | 317 | public boolean getOFlag() { |
| 314 | - return this.bOFlag; | 318 | + return this.oBit; |
| 315 | } | 319 | } |
| 316 | 320 | ||
| 317 | @Override | 321 | @Override |
| 318 | public Builder setOFlag(boolean value) { | 322 | public Builder setOFlag(boolean value) { |
| 319 | - this.bOFlag = value; | 323 | + this.oBit = value; |
| 320 | this.bIsOFlagSet = true; | 324 | this.bIsOFlagSet = true; |
| 321 | return this; | 325 | return this; |
| 322 | } | 326 | } |
| ... | @@ -335,12 +339,12 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { | ... | @@ -335,12 +339,12 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { |
| 335 | 339 | ||
| 336 | @Override | 340 | @Override |
| 337 | public LinkedList<PcepValueType> getOptionalTlv() { | 341 | public LinkedList<PcepValueType> getOptionalTlv() { |
| 338 | - return this.llOptionalTlv; | 342 | + return this.optionalTlv; |
| 339 | } | 343 | } |
| 340 | 344 | ||
| 341 | @Override | 345 | @Override |
| 342 | - public Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv) { | 346 | + public Builder setOptionalTlv(LinkedList<PcepValueType> optionalTlv) { |
| 343 | - this.llOptionalTlv = llOptionalTlv; | 347 | + this.optionalTlv = optionalTlv; |
| 344 | return this; | 348 | return this; |
| 345 | } | 349 | } |
| 346 | 350 | ||
| ... | @@ -362,9 +366,9 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { | ... | @@ -362,9 +366,9 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { |
| 362 | @Override | 366 | @Override |
| 363 | public String toString() { | 367 | public String toString() { |
| 364 | return MoreObjects.toStringHelper(getClass()) | 368 | return MoreObjects.toStringHelper(getClass()) |
| 365 | - .add("OFlag", bOFlag) | 369 | + .add("oBit", oBit) |
| 366 | .add("label", label) | 370 | .add("label", label) |
| 367 | - .add("OptionalTlvList", llOptionalTlv) | 371 | + .add("optionalTlv", optionalTlv) |
| 368 | .toString(); | 372 | .toString(); |
| 369 | } | 373 | } |
| 370 | } | 374 | } | ... | ... |
| ... | @@ -25,10 +25,12 @@ import org.onosproject.pcepio.protocol.PcepOpenObject; | ... | @@ -25,10 +25,12 @@ import org.onosproject.pcepio.protocol.PcepOpenObject; |
| 25 | import org.onosproject.pcepio.protocol.PcepType; | 25 | import org.onosproject.pcepio.protocol.PcepType; |
| 26 | import org.onosproject.pcepio.protocol.PcepVersion; | 26 | import org.onosproject.pcepio.protocol.PcepVersion; |
| 27 | import org.onosproject.pcepio.types.GmplsCapabilityTlv; | 27 | import org.onosproject.pcepio.types.GmplsCapabilityTlv; |
| 28 | +import org.onosproject.pcepio.types.NodeAttributesTlv; | ||
| 28 | import org.onosproject.pcepio.types.PceccCapabilityTlv; | 29 | import org.onosproject.pcepio.types.PceccCapabilityTlv; |
| 29 | import org.onosproject.pcepio.types.PcepLabelDbVerTlv; | 30 | import org.onosproject.pcepio.types.PcepLabelDbVerTlv; |
| 30 | import org.onosproject.pcepio.types.PcepObjectHeader; | 31 | import org.onosproject.pcepio.types.PcepObjectHeader; |
| 31 | import org.onosproject.pcepio.types.PcepValueType; | 32 | import org.onosproject.pcepio.types.PcepValueType; |
| 33 | +import org.onosproject.pcepio.types.SrPceCapabilityTlv; | ||
| 32 | import org.onosproject.pcepio.types.StatefulLspDbVerTlv; | 34 | import org.onosproject.pcepio.types.StatefulLspDbVerTlv; |
| 33 | import org.onosproject.pcepio.types.StatefulPceCapabilityTlv; | 35 | import org.onosproject.pcepio.types.StatefulPceCapabilityTlv; |
| 34 | import org.onosproject.pcepio.types.LsCapabilityTlv; | 36 | import org.onosproject.pcepio.types.LsCapabilityTlv; |
| ... | @@ -268,6 +270,20 @@ public class PcepOpenObjectVer1 implements PcepOpenObject { | ... | @@ -268,6 +270,20 @@ public class PcepOpenObjectVer1 implements PcepOpenObject { |
| 268 | lValue = cb.readLong(); | 270 | lValue = cb.readLong(); |
| 269 | tlv = new PcepLabelDbVerTlv(lValue); | 271 | tlv = new PcepLabelDbVerTlv(lValue); |
| 270 | break; | 272 | break; |
| 273 | + case NodeAttributesTlv.TYPE: | ||
| 274 | + log.debug("NodeAttributesTlv"); | ||
| 275 | + if (cb.readableBytes() < hLength) { | ||
| 276 | + throw new PcepParseException("Invalid length for NodeAttributesTlv."); | ||
| 277 | + } | ||
| 278 | + tlv = NodeAttributesTlv.read(cb.readBytes(hLength), hLength); | ||
| 279 | + break; | ||
| 280 | + case SrPceCapabilityTlv.TYPE: | ||
| 281 | + log.debug("SrPceCapabilityTlv"); | ||
| 282 | + if (SrPceCapabilityTlv.LENGTH != hLength) { | ||
| 283 | + throw new PcepParseException("Invalid length received for SrPceCapabilityTlv."); | ||
| 284 | + } | ||
| 285 | + tlv = SrPceCapabilityTlv.read(cb); | ||
| 286 | + break; | ||
| 271 | default: | 287 | default: |
| 272 | log.debug("Unsupported TLV: " + hType); | 288 | log.debug("Unsupported TLV: " + hType); |
| 273 | cb.skipBytes(hLength); | 289 | cb.skipBytes(hLength); | ... | ... |
| ... | @@ -22,6 +22,7 @@ import java.util.ListIterator; | ... | @@ -22,6 +22,7 @@ import java.util.ListIterator; |
| 22 | import org.jboss.netty.buffer.ChannelBuffer; | 22 | import org.jboss.netty.buffer.ChannelBuffer; |
| 23 | import org.onosproject.pcepio.exceptions.PcepParseException; | 23 | import org.onosproject.pcepio.exceptions.PcepParseException; |
| 24 | import org.onosproject.pcepio.protocol.PcepSrpObject; | 24 | import org.onosproject.pcepio.protocol.PcepSrpObject; |
| 25 | +import org.onosproject.pcepio.types.PathSetupTypeTlv; | ||
| 25 | import org.onosproject.pcepio.types.PcepObjectHeader; | 26 | import org.onosproject.pcepio.types.PcepObjectHeader; |
| 26 | import org.onosproject.pcepio.types.PcepValueType; | 27 | import org.onosproject.pcepio.types.PcepValueType; |
| 27 | import org.onosproject.pcepio.types.SymbolicPathNameTlv; | 28 | import org.onosproject.pcepio.types.SymbolicPathNameTlv; |
| ... | @@ -221,12 +222,18 @@ public class PcepSrpObjectVer1 implements PcepSrpObject { | ... | @@ -221,12 +222,18 @@ public class PcepSrpObjectVer1 implements PcepSrpObject { |
| 221 | short hLength = cb.readShort(); | 222 | short hLength = cb.readShort(); |
| 222 | 223 | ||
| 223 | switch (hType) { | 224 | switch (hType) { |
| 224 | - | ||
| 225 | case SymbolicPathNameTlv.TYPE: | 225 | case SymbolicPathNameTlv.TYPE: |
| 226 | + if (cb.readableBytes() < hLength) { | ||
| 227 | + throw new PcepParseException("Length is not valid in SymbolicPathNameTlv"); | ||
| 228 | + } | ||
| 226 | tlv = SymbolicPathNameTlv.read(cb, hLength); | 229 | tlv = SymbolicPathNameTlv.read(cb, hLength); |
| 227 | - cb.skipBytes(hLength); | ||
| 228 | break; | 230 | break; |
| 229 | - | 231 | + case PathSetupTypeTlv.TYPE: |
| 232 | + if (cb.readableBytes() != PathSetupTypeTlv.LENGTH) { | ||
| 233 | + throw new PcepParseException("Length is not valid in PathSetupTypeTlv"); | ||
| 234 | + } | ||
| 235 | + tlv = PathSetupTypeTlv.of(cb.readInt()); | ||
| 236 | + break; | ||
| 230 | default: | 237 | default: |
| 231 | throw new PcepParseException("Unsupported TLV received in SRP Object."); | 238 | throw new PcepParseException("Unsupported TLV received in SRP Object."); |
| 232 | } | 239 | } | ... | ... |
| ... | @@ -29,27 +29,25 @@ import com.google.common.base.MoreObjects; | ... | @@ -29,27 +29,25 @@ import com.google.common.base.MoreObjects; |
| 29 | public class PceccCapabilityTlv implements PcepValueType { | 29 | public class PceccCapabilityTlv implements PcepValueType { |
| 30 | 30 | ||
| 31 | /* PCECC CAPABILITY TLV | 31 | /* PCECC CAPABILITY TLV |
| 32 | - * Reference : draft-zhao-pce-pcep-extension-for-pce-controller-01, section-7.1.1 | 32 | + * Reference : draft-zhao-pce-pcep-extension-for-pce-controller-03, section-7.1.1 |
| 33 | 33 | ||
| 34 | 0 1 2 3 | 34 | 0 1 2 3 |
| 35 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 35 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
| 36 | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 36 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 37 | - | Type=32 | Length=4 | | 37 | + | Type=[TBD] | Length=4 | |
| 38 | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 38 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 39 | - | Flags |G|L| | 39 | + | Flags |S| |
| 40 | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 40 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 41 | 41 | ||
| 42 | */ | 42 | */ |
| 43 | protected static final Logger log = LoggerFactory.getLogger(PceccCapabilityTlv.class); | 43 | protected static final Logger log = LoggerFactory.getLogger(PceccCapabilityTlv.class); |
| 44 | 44 | ||
| 45 | - public static final short TYPE = 32; | 45 | + public static final short TYPE = (short) 65287; |
| 46 | public static final short LENGTH = 4; | 46 | public static final short LENGTH = 4; |
| 47 | public static final int SET = 1; | 47 | public static final int SET = 1; |
| 48 | - public static final byte LFLAG_CHECK = 0x01; | 48 | + public static final byte SBIT_CHECK = 0x01; |
| 49 | - public static final byte GFLAG_CHECK = 0x02; | ||
| 50 | 49 | ||
| 51 | - private final boolean bGFlag; | 50 | + private final boolean sBit; |
| 52 | - private final boolean bLFlag; | ||
| 53 | 51 | ||
| 54 | private final int rawValue; | 52 | private final int rawValue; |
| 55 | private final boolean isRawValueSet; | 53 | private final boolean isRawValueSet; |
| ... | @@ -63,18 +61,16 @@ public class PceccCapabilityTlv implements PcepValueType { | ... | @@ -63,18 +61,16 @@ public class PceccCapabilityTlv implements PcepValueType { |
| 63 | this.rawValue = rawValue; | 61 | this.rawValue = rawValue; |
| 64 | this.isRawValueSet = true; | 62 | this.isRawValueSet = true; |
| 65 | 63 | ||
| 66 | - bLFlag = (rawValue & LFLAG_CHECK) == LFLAG_CHECK; | 64 | + sBit = (rawValue & SBIT_CHECK) == SBIT_CHECK; |
| 67 | - bGFlag = (rawValue & GFLAG_CHECK) == GFLAG_CHECK; | ||
| 68 | } | 65 | } |
| 69 | 66 | ||
| 70 | /** | 67 | /** |
| 71 | * Constructor to initialize G-flag L-flag. | 68 | * Constructor to initialize G-flag L-flag. |
| 72 | - * @param bGFlag G-flag | 69 | + * |
| 73 | - * @param bLFlag L-flag | 70 | + * @param sBit pcecc sr capbaility bit |
| 74 | */ | 71 | */ |
| 75 | - public PceccCapabilityTlv(boolean bGFlag, boolean bLFlag) { | 72 | + public PceccCapabilityTlv(boolean sBit) { |
| 76 | - this.bGFlag = bGFlag; | 73 | + this.sBit = sBit; |
| 77 | - this.bLFlag = bLFlag; | ||
| 78 | this.rawValue = 0; | 74 | this.rawValue = 0; |
| 79 | this.isRawValueSet = false; | 75 | this.isRawValueSet = false; |
| 80 | } | 76 | } |
| ... | @@ -95,23 +91,17 @@ public class PceccCapabilityTlv implements PcepValueType { | ... | @@ -95,23 +91,17 @@ public class PceccCapabilityTlv implements PcepValueType { |
| 95 | } | 91 | } |
| 96 | 92 | ||
| 97 | /** | 93 | /** |
| 98 | - * Returns G-flag. | 94 | + * Returns sBit. |
| 99 | - * @return bGFlag G-flag | 95 | + * |
| 100 | - */ | 96 | + * @return sBit S bit |
| 101 | - public boolean getGFlag() { | ||
| 102 | - return bGFlag; | ||
| 103 | - } | ||
| 104 | - | ||
| 105 | - /** | ||
| 106 | - * Returns L-flag. | ||
| 107 | - * @return bLFlag L-flag | ||
| 108 | */ | 97 | */ |
| 109 | - public boolean getLFlag() { | 98 | + public boolean sBit() { |
| 110 | - return bLFlag; | 99 | + return sBit; |
| 111 | } | 100 | } |
| 112 | 101 | ||
| 113 | /** | 102 | /** |
| 114 | * Returns the raw value. | 103 | * Returns the raw value. |
| 104 | + * | ||
| 115 | * @return rawValue Flags | 105 | * @return rawValue Flags |
| 116 | */ | 106 | */ |
| 117 | public int getInt() { | 107 | public int getInt() { |
| ... | @@ -133,7 +123,7 @@ public class PceccCapabilityTlv implements PcepValueType { | ... | @@ -133,7 +123,7 @@ public class PceccCapabilityTlv implements PcepValueType { |
| 133 | if (isRawValueSet) { | 123 | if (isRawValueSet) { |
| 134 | return Objects.hash(rawValue); | 124 | return Objects.hash(rawValue); |
| 135 | } else { | 125 | } else { |
| 136 | - return Objects.hash(bLFlag, bGFlag); | 126 | + return Objects.hash(sBit); |
| 137 | } | 127 | } |
| 138 | } | 128 | } |
| 139 | 129 | ||
| ... | @@ -147,7 +137,7 @@ public class PceccCapabilityTlv implements PcepValueType { | ... | @@ -147,7 +137,7 @@ public class PceccCapabilityTlv implements PcepValueType { |
| 147 | if (isRawValueSet) { | 137 | if (isRawValueSet) { |
| 148 | return Objects.equals(this.rawValue, other.rawValue); | 138 | return Objects.equals(this.rawValue, other.rawValue); |
| 149 | } else { | 139 | } else { |
| 150 | - return Objects.equals(this.bGFlag, other.bGFlag) && Objects.equals(this.bLFlag, other.bLFlag); | 140 | + return Objects.equals(this.sBit, other.sBit); |
| 151 | } | 141 | } |
| 152 | } | 142 | } |
| 153 | return false; | 143 | return false; |
| ... | @@ -162,11 +152,8 @@ public class PceccCapabilityTlv implements PcepValueType { | ... | @@ -162,11 +152,8 @@ public class PceccCapabilityTlv implements PcepValueType { |
| 162 | if (isRawValueSet) { | 152 | if (isRawValueSet) { |
| 163 | c.writeInt(rawValue); | 153 | c.writeInt(rawValue); |
| 164 | } else { | 154 | } else { |
| 165 | - if (bGFlag) { | 155 | + if (sBit) { |
| 166 | - temp = temp | GFLAG_CHECK; | 156 | + temp = temp | SBIT_CHECK; |
| 167 | - } | ||
| 168 | - if (bLFlag) { | ||
| 169 | - temp = temp | LFLAG_CHECK; | ||
| 170 | } | 157 | } |
| 171 | c.writeInt(temp); | 158 | c.writeInt(temp); |
| 172 | } | 159 | } |
| ... | @@ -188,7 +175,7 @@ public class PceccCapabilityTlv implements PcepValueType { | ... | @@ -188,7 +175,7 @@ public class PceccCapabilityTlv implements PcepValueType { |
| 188 | return MoreObjects.toStringHelper(getClass()) | 175 | return MoreObjects.toStringHelper(getClass()) |
| 189 | .add("Type", TYPE) | 176 | .add("Type", TYPE) |
| 190 | .add("Length", LENGTH) | 177 | .add("Length", LENGTH) |
| 191 | - .add("Value", rawValue) | 178 | + .add("rawValue", rawValue) |
| 192 | .toString(); | 179 | .toString(); |
| 193 | } | 180 | } |
| 194 | } | 181 | } | ... | ... |
| ... | @@ -30,7 +30,8 @@ import java.util.Objects; | ... | @@ -30,7 +30,8 @@ import java.util.Objects; |
| 30 | */ | 30 | */ |
| 31 | public class SrEroSubObject implements PcepValueType { | 31 | public class SrEroSubObject implements PcepValueType { |
| 32 | /* | 32 | /* |
| 33 | - SR-ERO subobject: (draft-ietf-pce-segment-routing-00) | 33 | + SR-ERO subobject: (draft-ietf-pce-segment-routing-06) |
| 34 | + | ||
| 34 | 0 1 2 3 | 35 | 0 1 2 3 |
| 35 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 36 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
| 36 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 37 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| ... | @@ -40,7 +41,8 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -40,7 +41,8 @@ public class SrEroSubObject implements PcepValueType { |
| 40 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 41 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 41 | // NAI (variable) // | 42 | // NAI (variable) // |
| 42 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 43 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 43 | - | 44 | + When M bit is reset, SID is 32 bit Index. |
| 45 | + When M bit is set, SID is 20 bit Label. | ||
| 44 | 46 | ||
| 45 | 47 | ||
| 46 | NAI | 48 | NAI |
| ... | @@ -98,7 +100,8 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -98,7 +100,8 @@ public class SrEroSubObject implements PcepValueType { |
| 98 | private final boolean bMFlag; | 100 | private final boolean bMFlag; |
| 99 | private final byte st; | 101 | private final byte st; |
| 100 | 102 | ||
| 101 | - private final int sID; | 103 | + //If m bit is set SID will store label else store 32 bit value |
| 104 | + private final int sid; | ||
| 102 | private final PcepNai nai; | 105 | private final PcepNai nai; |
| 103 | 106 | ||
| 104 | /** | 107 | /** |
| ... | @@ -109,17 +112,17 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -109,17 +112,17 @@ public class SrEroSubObject implements PcepValueType { |
| 109 | * @param bSFlag S flag | 112 | * @param bSFlag S flag |
| 110 | * @param bCFlag C flag | 113 | * @param bCFlag C flag |
| 111 | * @param bMFlag M flag | 114 | * @param bMFlag M flag |
| 112 | - * @param sID segment identifier value | 115 | + * @param sid segment identifier value |
| 113 | * @param nai NAI associated with SID | 116 | * @param nai NAI associated with SID |
| 114 | */ | 117 | */ |
| 115 | - public SrEroSubObject(byte st, boolean bFFlag, boolean bSFlag, boolean bCFlag, boolean bMFlag, int sID, | 118 | + public SrEroSubObject(byte st, boolean bFFlag, boolean bSFlag, boolean bCFlag, boolean bMFlag, int sid, |
| 116 | PcepNai nai) { | 119 | PcepNai nai) { |
| 117 | this.st = st; | 120 | this.st = st; |
| 118 | this.bFFlag = bFFlag; | 121 | this.bFFlag = bFFlag; |
| 119 | this.bSFlag = bSFlag; | 122 | this.bSFlag = bSFlag; |
| 120 | this.bCFlag = bCFlag; | 123 | this.bCFlag = bCFlag; |
| 121 | this.bMFlag = bMFlag; | 124 | this.bMFlag = bMFlag; |
| 122 | - this.sID = sID; | 125 | + this.sid = sid; |
| 123 | this.nai = nai; | 126 | this.nai = nai; |
| 124 | } | 127 | } |
| 125 | 128 | ||
| ... | @@ -131,18 +134,19 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -131,18 +134,19 @@ public class SrEroSubObject implements PcepValueType { |
| 131 | * @param bSFlag S flag | 134 | * @param bSFlag S flag |
| 132 | * @param bCFlag C flag | 135 | * @param bCFlag C flag |
| 133 | * @param bMFlag M flag | 136 | * @param bMFlag M flag |
| 134 | - * @param sID segment identifier value | 137 | + * @param sid segment identifier value |
| 135 | * @param nai NAI associated with SID | 138 | * @param nai NAI associated with SID |
| 136 | * @return object of SrEroSubObject | 139 | * @return object of SrEroSubObject |
| 137 | */ | 140 | */ |
| 138 | - public static SrEroSubObject of(byte st, boolean bFFlag, boolean bSFlag, boolean bCFlag, boolean bMFlag, int sID, | 141 | + public static SrEroSubObject of(byte st, boolean bFFlag, boolean bSFlag, boolean bCFlag, boolean bMFlag, int sid, |
| 139 | PcepNai nai) { | 142 | PcepNai nai) { |
| 140 | - return new SrEroSubObject(st, bFFlag, bSFlag, bCFlag, bMFlag, sID, nai); | 143 | + return new SrEroSubObject(st, bFFlag, bSFlag, bCFlag, bMFlag, sid, nai); |
| 141 | } | 144 | } |
| 142 | 145 | ||
| 143 | /** | 146 | /** |
| 144 | * Returns SID type. | 147 | * Returns SID type. |
| 145 | - * @return st sid type | 148 | + * |
| 149 | + * @return st SID type | ||
| 146 | */ | 150 | */ |
| 147 | public byte getSt() { | 151 | public byte getSt() { |
| 148 | return st; | 152 | return st; |
| ... | @@ -150,6 +154,7 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -150,6 +154,7 @@ public class SrEroSubObject implements PcepValueType { |
| 150 | 154 | ||
| 151 | /** | 155 | /** |
| 152 | * Returns bFFlag. | 156 | * Returns bFFlag. |
| 157 | + * | ||
| 153 | * @return bFFlag | 158 | * @return bFFlag |
| 154 | */ | 159 | */ |
| 155 | public boolean getFFlag() { | 160 | public boolean getFFlag() { |
| ... | @@ -158,6 +163,7 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -158,6 +163,7 @@ public class SrEroSubObject implements PcepValueType { |
| 158 | 163 | ||
| 159 | /** | 164 | /** |
| 160 | * Returns bSFlag. | 165 | * Returns bSFlag. |
| 166 | + * | ||
| 161 | * @return bSFlag | 167 | * @return bSFlag |
| 162 | */ | 168 | */ |
| 163 | public boolean getSFlag() { | 169 | public boolean getSFlag() { |
| ... | @@ -166,6 +172,7 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -166,6 +172,7 @@ public class SrEroSubObject implements PcepValueType { |
| 166 | 172 | ||
| 167 | /** | 173 | /** |
| 168 | * Returns bCFlag. | 174 | * Returns bCFlag. |
| 175 | + * | ||
| 169 | * @return bCFlag | 176 | * @return bCFlag |
| 170 | */ | 177 | */ |
| 171 | public boolean getCFlag() { | 178 | public boolean getCFlag() { |
| ... | @@ -174,6 +181,7 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -174,6 +181,7 @@ public class SrEroSubObject implements PcepValueType { |
| 174 | 181 | ||
| 175 | /** | 182 | /** |
| 176 | * Returns bMFlag. | 183 | * Returns bMFlag. |
| 184 | + * | ||
| 177 | * @return bMFlag | 185 | * @return bMFlag |
| 178 | */ | 186 | */ |
| 179 | public boolean getMFlag() { | 187 | public boolean getMFlag() { |
| ... | @@ -182,10 +190,11 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -182,10 +190,11 @@ public class SrEroSubObject implements PcepValueType { |
| 182 | 190 | ||
| 183 | /** | 191 | /** |
| 184 | * Returns sID. | 192 | * Returns sID. |
| 185 | - * @return sID | 193 | + * |
| 194 | + * @return sid | ||
| 186 | */ | 195 | */ |
| 187 | public int getSid() { | 196 | public int getSid() { |
| 188 | - return sID; | 197 | + return sid; |
| 189 | } | 198 | } |
| 190 | 199 | ||
| 191 | /** | 200 | /** |
| ... | @@ -213,7 +222,7 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -213,7 +222,7 @@ public class SrEroSubObject implements PcepValueType { |
| 213 | 222 | ||
| 214 | @Override | 223 | @Override |
| 215 | public int hashCode() { | 224 | public int hashCode() { |
| 216 | - return Objects.hash(st, bFFlag, bSFlag, bCFlag, bMFlag, sID, nai); | 225 | + return Objects.hash(st, bFFlag, bSFlag, bCFlag, bMFlag, sid, nai); |
| 217 | } | 226 | } |
| 218 | 227 | ||
| 219 | @Override | 228 | @Override |
| ... | @@ -225,7 +234,7 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -225,7 +234,7 @@ public class SrEroSubObject implements PcepValueType { |
| 225 | SrEroSubObject other = (SrEroSubObject) obj; | 234 | SrEroSubObject other = (SrEroSubObject) obj; |
| 226 | return Objects.equals(this.st, other.st) && Objects.equals(this.bFFlag, other.bFFlag) | 235 | return Objects.equals(this.st, other.st) && Objects.equals(this.bFFlag, other.bFFlag) |
| 227 | && Objects.equals(this.bSFlag, other.bSFlag) && Objects.equals(this.bCFlag, other.bCFlag) | 236 | && Objects.equals(this.bSFlag, other.bSFlag) && Objects.equals(this.bCFlag, other.bCFlag) |
| 228 | - && Objects.equals(this.bMFlag, other.bMFlag) && Objects.equals(this.sID, other.sID) | 237 | + && Objects.equals(this.bMFlag, other.bMFlag) && Objects.equals(this.sid, other.sid) |
| 229 | && Objects.equals(this.nai, other.nai); | 238 | && Objects.equals(this.nai, other.nai); |
| 230 | } | 239 | } |
| 231 | return false; | 240 | return false; |
| ... | @@ -254,7 +263,12 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -254,7 +263,12 @@ public class SrEroSubObject implements PcepValueType { |
| 254 | short tempST = (short) (st << SHIFT_ST); | 263 | short tempST = (short) (st << SHIFT_ST); |
| 255 | temp = (short) (temp | tempST); | 264 | temp = (short) (temp | tempST); |
| 256 | c.writeShort(temp); | 265 | c.writeShort(temp); |
| 257 | - c.writeInt(sID); | 266 | + if (bMFlag) { |
| 267 | + int tempSid = (int) sid << 12; | ||
| 268 | + c.writeInt(tempSid); | ||
| 269 | + } else { | ||
| 270 | + c.writeInt(sid); | ||
| 271 | + } | ||
| 258 | nai.write(c); | 272 | nai.write(c); |
| 259 | 273 | ||
| 260 | return c.writerIndex() - iLenStartIndex; | 274 | return c.writerIndex() - iLenStartIndex; |
| ... | @@ -281,21 +295,24 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -281,21 +295,24 @@ public class SrEroSubObject implements PcepValueType { |
| 281 | 295 | ||
| 282 | st = (byte) (temp >> SHIFT_ST); | 296 | st = (byte) (temp >> SHIFT_ST); |
| 283 | 297 | ||
| 284 | - int sID = c.readInt(); | 298 | + int sid = c.readInt(); |
| 299 | + if (bMFlag) { | ||
| 300 | + sid = sid >> 12; | ||
| 301 | + } | ||
| 285 | switch (st) { | 302 | switch (st) { |
| 286 | - case 0x01: | 303 | + case PcepNaiIpv4NodeId.ST_TYPE: |
| 287 | nai = PcepNaiIpv4NodeId.read(c); | 304 | nai = PcepNaiIpv4NodeId.read(c); |
| 288 | break; | 305 | break; |
| 289 | - case 0x02: | 306 | + case PcepNaiIpv6NodeId.ST_TYPE: |
| 290 | nai = PcepNaiIpv6NodeId.read(c); | 307 | nai = PcepNaiIpv6NodeId.read(c); |
| 291 | break; | 308 | break; |
| 292 | - case 0x03: | 309 | + case PcepNaiIpv4Adjacency.ST_TYPE: |
| 293 | nai = PcepNaiIpv4Adjacency.read(c); | 310 | nai = PcepNaiIpv4Adjacency.read(c); |
| 294 | break; | 311 | break; |
| 295 | - case 0x04: | 312 | + case PcepNaiIpv6Adjacency.ST_TYPE: |
| 296 | nai = PcepNaiIpv6Adjacency.read(c); | 313 | nai = PcepNaiIpv6Adjacency.read(c); |
| 297 | break; | 314 | break; |
| 298 | - case 0x05: | 315 | + case PcepNaiUnnumberedAdjacencyIpv4.ST_TYPE: |
| 299 | nai = PcepNaiUnnumberedAdjacencyIpv4.read(c); | 316 | nai = PcepNaiUnnumberedAdjacencyIpv4.read(c); |
| 300 | break; | 317 | break; |
| 301 | default: | 318 | default: |
| ... | @@ -303,7 +320,7 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -303,7 +320,7 @@ public class SrEroSubObject implements PcepValueType { |
| 303 | break; | 320 | break; |
| 304 | } | 321 | } |
| 305 | 322 | ||
| 306 | - return new SrEroSubObject(st, bFFlag, bSFlag, bCFlag, bMFlag, sID, nai); | 323 | + return new SrEroSubObject(st, bFFlag, bSFlag, bCFlag, bMFlag, sid, nai); |
| 307 | } | 324 | } |
| 308 | 325 | ||
| 309 | @Override | 326 | @Override |
| ... | @@ -316,7 +333,7 @@ public class SrEroSubObject implements PcepValueType { | ... | @@ -316,7 +333,7 @@ public class SrEroSubObject implements PcepValueType { |
| 316 | .add("bSFlag", bSFlag) | 333 | .add("bSFlag", bSFlag) |
| 317 | .add("bCFlag", bCFlag) | 334 | .add("bCFlag", bCFlag) |
| 318 | .add("bMFlag", bMFlag) | 335 | .add("bMFlag", bMFlag) |
| 319 | - .add("sID", sID) | 336 | + .add("sid", sid) |
| 320 | .add("nAI", nai) | 337 | .add("nAI", nai) |
| 321 | .toString(); | 338 | .toString(); |
| 322 | } | 339 | } | ... | ... |
| 1 | +/* | ||
| 2 | + * Copyright 2016 Open Networking Laboratory | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | + | ||
| 17 | +package org.onosproject.pcepio.types; | ||
| 18 | + | ||
| 19 | +import java.util.Objects; | ||
| 20 | + | ||
| 21 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
| 22 | +import org.onosproject.pcepio.protocol.PcepVersion; | ||
| 23 | +import org.slf4j.Logger; | ||
| 24 | +import org.slf4j.LoggerFactory; | ||
| 25 | + | ||
| 26 | +import com.google.common.base.MoreObjects; | ||
| 27 | + | ||
| 28 | +/** | ||
| 29 | + * Provides SR PCE Capability Tlv. | ||
| 30 | + */ | ||
| 31 | +public class SrPceCapabilityTlv implements PcepValueType { | ||
| 32 | + | ||
| 33 | + /* | ||
| 34 | + * | ||
| 35 | + reference : draft-ietf-pce-segment-routing-06, section 5.1.1 | ||
| 36 | + | ||
| 37 | + 0 1 2 3 | ||
| 38 | + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | ||
| 39 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 40 | + | Type=TBD | Length=4 | | ||
| 41 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 42 | + | Reserved | Flags | MSD | | ||
| 43 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 44 | + fig: SR-PCE-CAPABILITY TLV format | ||
| 45 | + */ | ||
| 46 | + protected static final Logger log = LoggerFactory.getLogger(SrPceCapabilityTlv.class); | ||
| 47 | + | ||
| 48 | + public static final short TYPE = 26; | ||
| 49 | + public static final short LENGTH = 4; | ||
| 50 | + | ||
| 51 | + private final byte msd; | ||
| 52 | + | ||
| 53 | + /** | ||
| 54 | + * Constructor to initialize its parameter. | ||
| 55 | + * | ||
| 56 | + * @param msd maximum SID depth | ||
| 57 | + */ | ||
| 58 | + public SrPceCapabilityTlv(byte msd) { | ||
| 59 | + this.msd = msd; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + /** | ||
| 63 | + * Obtains newly created SrPceCapabilityTlv object. | ||
| 64 | + * | ||
| 65 | + * @param msd maximum SID depth | ||
| 66 | + * @return object of SrPceCapabilityTlv | ||
| 67 | + */ | ||
| 68 | + public static SrPceCapabilityTlv of(final byte msd) { | ||
| 69 | + return new SrPceCapabilityTlv(msd); | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + /** | ||
| 73 | + * Obtains msd. | ||
| 74 | + * | ||
| 75 | + * @return msd | ||
| 76 | + */ | ||
| 77 | + public byte msd() { | ||
| 78 | + return msd; | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + @Override | ||
| 82 | + public PcepVersion getVersion() { | ||
| 83 | + return PcepVersion.PCEP_1; | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + @Override | ||
| 87 | + public short getType() { | ||
| 88 | + return TYPE; | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + @Override | ||
| 92 | + public short getLength() { | ||
| 93 | + return LENGTH; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + @Override | ||
| 97 | + public int hashCode() { | ||
| 98 | + return Objects.hash(msd); | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + @Override | ||
| 102 | + public boolean equals(Object obj) { | ||
| 103 | + if (this == obj) { | ||
| 104 | + return true; | ||
| 105 | + } | ||
| 106 | + if (obj instanceof SrPceCapabilityTlv) { | ||
| 107 | + SrPceCapabilityTlv other = (SrPceCapabilityTlv) obj; | ||
| 108 | + return Objects.equals(msd, other.msd); | ||
| 109 | + } | ||
| 110 | + return false; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + @Override | ||
| 114 | + public int write(ChannelBuffer c) { | ||
| 115 | + int iLenStartIndex = c.writerIndex(); | ||
| 116 | + c.writeShort(TYPE); | ||
| 117 | + c.writeShort(LENGTH); | ||
| 118 | + c.writeInt(msd); | ||
| 119 | + return c.writerIndex() - iLenStartIndex; | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + /** | ||
| 123 | + * Reads the channel buffer and returns object of SrPceCapabilityTlv. | ||
| 124 | + * | ||
| 125 | + * @param cb channel buffer | ||
| 126 | + * @return object of Gmpls-Capability-Tlv | ||
| 127 | + */ | ||
| 128 | + public static SrPceCapabilityTlv read(ChannelBuffer cb) { | ||
| 129 | + //read reserved bits | ||
| 130 | + cb.readShort(); | ||
| 131 | + //read flags | ||
| 132 | + cb.readByte(); | ||
| 133 | + return SrPceCapabilityTlv.of(cb.readByte()); | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + @Override | ||
| 137 | + public String toString() { | ||
| 138 | + return MoreObjects.toStringHelper(getClass()) | ||
| 139 | + .add("Type", TYPE) | ||
| 140 | + .add("Length", LENGTH) | ||
| 141 | + .add("msd", msd) | ||
| 142 | + .toString(); | ||
| 143 | + } | ||
| 144 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -46,7 +46,7 @@ public class PcepErrorMsgTest { | ... | @@ -46,7 +46,7 @@ public class PcepErrorMsgTest { |
| 46 | 0x20, 0x05, 0x1E, 0x01, // OPEN object | 46 | 0x20, 0x05, 0x1E, 0x01, // OPEN object |
| 47 | 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY | 47 | 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY |
| 48 | 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV | 48 | 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV |
| 49 | - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV | 49 | + 0x00, 0x00, 0x00, 0x00, (byte) 0xff, 0x07, 0x00, 0x04, // PCECC-CAPABILITY-TLV |
| 50 | 0x00, 0x00, 0x00, 0x03, (byte) 0xFF, (byte) 0x00, 0x00, 0x04, // LS Capability TLV | 50 | 0x00, 0x00, 0x00, 0x03, (byte) 0xFF, (byte) 0x00, 0x00, 0x04, // LS Capability TLV |
| 51 | 0x00, 0x00, 0x00, 0x00}; | 51 | 0x00, 0x00, 0x00, 0x00}; |
| 52 | 52 | ||
| ... | @@ -86,7 +86,7 @@ public class PcepErrorMsgTest { | ... | @@ -86,7 +86,7 @@ public class PcepErrorMsgTest { |
| 86 | 0x20, 0x05, 0x1E, 0x01, // OPEN object | 86 | 0x20, 0x05, 0x1E, 0x01, // OPEN object |
| 87 | 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY | 87 | 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY |
| 88 | 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV | 88 | 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV |
| 89 | - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV | 89 | + 0x00, 0x00, 0x00, 0x00, (byte) 0xff, 0x07, 0x00, 0x04, // PCECC-CAPABILITY-TLV |
| 90 | 0x00, 0x00, 0x00, 0x03, (byte) 0xFF, (byte) 0x00, 0x00, 0x04, // LS Capability TLV | 90 | 0x00, 0x00, 0x00, 0x03, (byte) 0xFF, (byte) 0x00, 0x00, 0x04, // LS Capability TLV |
| 91 | 0x00, 0x00, 0x00, 0x00}; | 91 | 0x00, 0x00, 0x00, 0x00}; |
| 92 | 92 | ||
| ... | @@ -125,7 +125,7 @@ public class PcepErrorMsgTest { | ... | @@ -125,7 +125,7 @@ public class PcepErrorMsgTest { |
| 125 | 0x20, 0x05, 0x1E, 0x01, // OPEN object | 125 | 0x20, 0x05, 0x1E, 0x01, // OPEN object |
| 126 | 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY | 126 | 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY |
| 127 | 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV | 127 | 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV |
| 128 | - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV | 128 | + 0x00, 0x00, 0x00, 0x00, (byte) 0xff, 0x07, 0x00, 0x04, // PCECC-CAPABILITY-TLV |
| 129 | 0x00, 0x00, 0x00, 0x03}; | 129 | 0x00, 0x00, 0x00, 0x03}; |
| 130 | 130 | ||
| 131 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); | 131 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); | ... | ... |
| ... | @@ -43,7 +43,7 @@ public class PcepLabelUpdateMsgTest { | ... | @@ -43,7 +43,7 @@ public class PcepLabelUpdateMsgTest { |
| 43 | 0x00, 0x01, 0x00, 0x00, | 43 | 0x00, 0x01, 0x00, 0x00, |
| 44 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 44 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 45 | 0x00, 0x00, 0x00, 0x00, | 45 | 0x00, 0x00, 0x00, 0x00, |
| 46 | - 0x00, 0x00, 0x00, 0x66}; | 46 | + 0x00, 0x10, 0x10, 0x00}; |
| 47 | 47 | ||
| 48 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); | 48 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 49 | buffer.writeBytes(labelUpdate); | 49 | buffer.writeBytes(labelUpdate); |
| ... | @@ -83,10 +83,10 @@ public class PcepLabelUpdateMsgTest { | ... | @@ -83,10 +83,10 @@ public class PcepLabelUpdateMsgTest { |
| 83 | 0x00, 0x01, 0x00, 0x00, | 83 | 0x00, 0x01, 0x00, 0x00, |
| 84 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 84 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 85 | 0x00, 0x00, 0x00, 0x00, | 85 | 0x00, 0x00, 0x00, 0x00, |
| 86 | - 0x00, 0x00, 0x00, 0x66, | 86 | + 0x00, 0x44, 0x00, 0x00, |
| 87 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 87 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 88 | 0x00, 0x00, 0x00, 0x00, | 88 | 0x00, 0x00, 0x00, 0x00, |
| 89 | - 0x00, 0x00, 0x00, 0x77}; | 89 | + 0x00, 0x79, 0x00, 0x00}; |
| 90 | 90 | ||
| 91 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); | 91 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 92 | buffer.writeBytes(labelUpdate); | 92 | buffer.writeBytes(labelUpdate); |
| ... | @@ -122,7 +122,7 @@ public class PcepLabelUpdateMsgTest { | ... | @@ -122,7 +122,7 @@ public class PcepLabelUpdateMsgTest { |
| 122 | 0x00, 0x00, 0x00, 0x10, | 122 | 0x00, 0x00, 0x00, 0x10, |
| 123 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 123 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 124 | 0x00, 0x00, 0x00, 0x00, | 124 | 0x00, 0x00, 0x00, 0x00, |
| 125 | - 0x00, 0x00, 0x00, 0x66, | 125 | + 0x00, 0x79, 0x00, 0x00, |
| 126 | (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header | 126 | (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header |
| 127 | 0x0A, 0x0A, 0x0B, 0x0B}; | 127 | 0x0A, 0x0A, 0x0B, 0x0B}; |
| 128 | 128 | ||
| ... | @@ -162,10 +162,10 @@ public class PcepLabelUpdateMsgTest { | ... | @@ -162,10 +162,10 @@ public class PcepLabelUpdateMsgTest { |
| 162 | 0x00, 0x01, 0x00, 0x00, | 162 | 0x00, 0x01, 0x00, 0x00, |
| 163 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 163 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 164 | 0x00, 0x00, 0x00, 0x00, | 164 | 0x00, 0x00, 0x00, 0x00, |
| 165 | - 0x00, 0x00, 0x00, 0x66, | 165 | + 0x00, 0x66, 0x00, 0x00, |
| 166 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 166 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 167 | 0x00, 0x00, 0x00, 0x00, | 167 | 0x00, 0x00, 0x00, 0x00, |
| 168 | - 0x00, 0x00, 0x00, 0x77, | 168 | + 0x00, 0x68, 0x00, 0x00, |
| 169 | 0x21, 0x10, 0x00, 0x0C, // SRP Object Header | 169 | 0x21, 0x10, 0x00, 0x0C, // SRP Object Header |
| 170 | 0x00, 0x00, 0x00, 0x00, | 170 | 0x00, 0x00, 0x00, 0x00, |
| 171 | 0x00, 0x00, 0x00, 0x11, | 171 | 0x00, 0x00, 0x00, 0x11, |
| ... | @@ -173,7 +173,7 @@ public class PcepLabelUpdateMsgTest { | ... | @@ -173,7 +173,7 @@ public class PcepLabelUpdateMsgTest { |
| 173 | 0x00, 0x02, 0x00, 0x00, | 173 | 0x00, 0x02, 0x00, 0x00, |
| 174 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 174 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 175 | 0x00, 0x00, 0x00, 0x00, | 175 | 0x00, 0x00, 0x00, 0x00, |
| 176 | - 0x00, 0x00, 0x00, 0x44}; | 176 | + 0x00, 0x44, 0x00, 0x00}; |
| 177 | 177 | ||
| 178 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); | 178 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 179 | buffer.writeBytes(labelUpdate); | 179 | buffer.writeBytes(labelUpdate); |
| ... | @@ -209,7 +209,7 @@ public class PcepLabelUpdateMsgTest { | ... | @@ -209,7 +209,7 @@ public class PcepLabelUpdateMsgTest { |
| 209 | 0x00, 0x00, 0x00, 0x10, | 209 | 0x00, 0x00, 0x00, 0x10, |
| 210 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 210 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 211 | 0x00, 0x00, 0x00, 0x01, | 211 | 0x00, 0x00, 0x00, 0x01, |
| 212 | - 0x00, 0x00, 0x00, 0x66, | 212 | + 0x00, 0x44, 0x00, 0x00, |
| 213 | (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header | 213 | (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header |
| 214 | 0x0A, 0x0A, 0x0B, 0x0B, | 214 | 0x0A, 0x0A, 0x0B, 0x0B, |
| 215 | 0x21, 0x10, 0x00, 0x0C, // SRP Object Header | 215 | 0x21, 0x10, 0x00, 0x0C, // SRP Object Header |
| ... | @@ -217,7 +217,7 @@ public class PcepLabelUpdateMsgTest { | ... | @@ -217,7 +217,7 @@ public class PcepLabelUpdateMsgTest { |
| 217 | 0x00, 0x00, 0x00, 0x11, | 217 | 0x00, 0x00, 0x00, 0x11, |
| 218 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 218 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 219 | 0x00, 0x00, 0x00, 0x00, | 219 | 0x00, 0x00, 0x00, 0x00, |
| 220 | - 0x00, 0x00, 0x00, 0x66, | 220 | + 0x00, 0x44, 0x00, 0x00, |
| 221 | (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header | 221 | (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header |
| 222 | 0x0A, 0x0A, 0x0C, 0x0C}; | 222 | 0x0A, 0x0A, 0x0C, 0x0C}; |
| 223 | 223 | ||
| ... | @@ -257,16 +257,16 @@ public class PcepLabelUpdateMsgTest { | ... | @@ -257,16 +257,16 @@ public class PcepLabelUpdateMsgTest { |
| 257 | 0x00, 0x01, 0x00, 0x00, | 257 | 0x00, 0x01, 0x00, 0x00, |
| 258 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 258 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 259 | 0x00, 0x00, 0x00, 0x00, | 259 | 0x00, 0x00, 0x00, 0x00, |
| 260 | - 0x00, 0x00, 0x00, 0x66, | 260 | + 0x00, 0x44, 0x00, 0x00, |
| 261 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 261 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 262 | 0x00, 0x00, 0x00, 0x00, | 262 | 0x00, 0x00, 0x00, 0x00, |
| 263 | - 0x00, 0x00, 0x00, 0x77, | 263 | + 0x00, 0x44, 0x00, 0x00, |
| 264 | 0x21, 0x10, 0x00, 0x0C, // SRP Object Header | 264 | 0x21, 0x10, 0x00, 0x0C, // SRP Object Header |
| 265 | 0x00, 0x00, 0x00, 0x00, | 265 | 0x00, 0x00, 0x00, 0x00, |
| 266 | 0x00, 0x00, 0x00, 0x12, | 266 | 0x00, 0x00, 0x00, 0x12, |
| 267 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 267 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 268 | 0x00, 0x00, 0x00, 0x00, | 268 | 0x00, 0x00, 0x00, 0x00, |
| 269 | - 0x00, 0x00, 0x00, 0x66, | 269 | + 0x00, 0x44, 0x00, 0x00, |
| 270 | (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header | 270 | (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header |
| 271 | 0x0A, 0x0A, 0x0D, 0x0D}; | 271 | 0x0A, 0x0A, 0x0D, 0x0D}; |
| 272 | 272 | ||
| ... | @@ -304,7 +304,7 @@ public class PcepLabelUpdateMsgTest { | ... | @@ -304,7 +304,7 @@ public class PcepLabelUpdateMsgTest { |
| 304 | 0x00, 0x00, 0x00, 0x12, | 304 | 0x00, 0x00, 0x00, 0x12, |
| 305 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 305 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 306 | 0x00, 0x00, 0x00, 0x00, | 306 | 0x00, 0x00, 0x00, 0x00, |
| 307 | - 0x00, 0x00, 0x00, 0x66, | 307 | + 0x00, 0x44, 0x00, 0x00, |
| 308 | (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header | 308 | (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header |
| 309 | 0x0A, 0x0A, 0x0D, 0x0D, | 309 | 0x0A, 0x0A, 0x0D, 0x0D, |
| 310 | 0x21, 0x10, 0x00, 0x0C, // SRP Object Header | 310 | 0x21, 0x10, 0x00, 0x0C, // SRP Object Header |
| ... | @@ -314,10 +314,10 @@ public class PcepLabelUpdateMsgTest { | ... | @@ -314,10 +314,10 @@ public class PcepLabelUpdateMsgTest { |
| 314 | 0x00, 0x01, 0x00, 0x00, | 314 | 0x00, 0x01, 0x00, 0x00, |
| 315 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 315 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 316 | 0x00, 0x00, 0x00, 0x00, | 316 | 0x00, 0x00, 0x00, 0x00, |
| 317 | - 0x00, 0x00, 0x00, 0x66, | 317 | + 0x00, 0x44, 0x00, 0x00, |
| 318 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 318 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 319 | 0x00, 0x00, 0x00, 0x00, | 319 | 0x00, 0x00, 0x00, 0x00, |
| 320 | - 0x00, 0x00, 0x00, 0x77}; | 320 | + 0x00, 0x44, 0x00, 0x00}; |
| 321 | 321 | ||
| 322 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); | 322 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 323 | buffer.writeBytes(labelUpdate); | 323 | buffer.writeBytes(labelUpdate); |
| ... | @@ -354,7 +354,7 @@ public class PcepLabelUpdateMsgTest { | ... | @@ -354,7 +354,7 @@ public class PcepLabelUpdateMsgTest { |
| 354 | 0x00, 0x00, 0x00, 0x12, | 354 | 0x00, 0x00, 0x00, 0x12, |
| 355 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 355 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 356 | 0x00, 0x00, 0x00, 0x00, | 356 | 0x00, 0x00, 0x00, 0x00, |
| 357 | - 0x00, 0x00, 0x00, 0x66, | 357 | + 0x00, 0x44, 0x00, 0x00, |
| 358 | (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header | 358 | (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header |
| 359 | 0x0A, 0x0A, 0x0D, 0x0D, | 359 | 0x0A, 0x0A, 0x0D, 0x0D, |
| 360 | 0x21, 0x10, 0x00, 0x0C, // SRP Object Header | 360 | 0x21, 0x10, 0x00, 0x0C, // SRP Object Header |
| ... | @@ -364,10 +364,10 @@ public class PcepLabelUpdateMsgTest { | ... | @@ -364,10 +364,10 @@ public class PcepLabelUpdateMsgTest { |
| 364 | 0x00, 0x01, 0x00, 0x00, | 364 | 0x00, 0x01, 0x00, 0x00, |
| 365 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 365 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 366 | 0x00, 0x00, 0x00, 0x00, | 366 | 0x00, 0x00, 0x00, 0x00, |
| 367 | - 0x00, 0x00, 0x00, 0x66, | 367 | + 0x00, 0x44, 0x00, 0x00, |
| 368 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 368 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 369 | 0x00, 0x00, 0x00, 0x00, | 369 | 0x00, 0x00, 0x00, 0x00, |
| 370 | - 0x00, 0x00, 0x00, 0x77, | 370 | + 0x00, 0x44, 0x00, 0x00, |
| 371 | 0x21, 0x10, 0x00, 0x0C, // SRP Object Header | 371 | 0x21, 0x10, 0x00, 0x0C, // SRP Object Header |
| 372 | 0x00, 0x00, 0x00, 0x00, | 372 | 0x00, 0x00, 0x00, 0x00, |
| 373 | 0x00, 0x00, 0x00, 0x10, | 373 | 0x00, 0x00, 0x00, 0x10, |
| ... | @@ -375,10 +375,10 @@ public class PcepLabelUpdateMsgTest { | ... | @@ -375,10 +375,10 @@ public class PcepLabelUpdateMsgTest { |
| 375 | 0x00, 0x01, 0x00, 0x00, | 375 | 0x00, 0x01, 0x00, 0x00, |
| 376 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 376 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 377 | 0x00, 0x00, 0x00, 0x00, | 377 | 0x00, 0x00, 0x00, 0x00, |
| 378 | - 0x00, 0x00, 0x00, 0x66, | 378 | + 0x00, 0x44, 0x00, 0x00, |
| 379 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header | 379 | (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header |
| 380 | 0x00, 0x00, 0x00, 0x00, | 380 | 0x00, 0x00, 0x00, 0x00, |
| 381 | - 0x00, 0x00, 0x00, 0x77}; | 381 | + 0x00, 0x44, 0x00, 0x00}; |
| 382 | 382 | ||
| 383 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); | 383 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 384 | buffer.writeBytes(labelUpdate); | 384 | buffer.writeBytes(labelUpdate); | ... | ... |
| ... | @@ -39,7 +39,7 @@ public class PcepOpenMsgTest { | ... | @@ -39,7 +39,7 @@ public class PcepOpenMsgTest { |
| 39 | byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x10, 0x00, 0x20, 0x20, 0x1e, 0x78, (byte) 0xbd, | 39 | byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x10, 0x00, 0x20, 0x20, 0x1e, 0x78, (byte) 0xbd, |
| 40 | 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY | 40 | 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY |
| 41 | 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV | 41 | 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV |
| 42 | - 0x00, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV | 42 | + (byte) 0xff, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV |
| 43 | }; | 43 | }; |
| 44 | 44 | ||
| 45 | byte[] testOpenMsg = {0}; | 45 | byte[] testOpenMsg = {0}; |
| ... | @@ -204,7 +204,7 @@ public class PcepOpenMsgTest { | ... | @@ -204,7 +204,7 @@ public class PcepOpenMsgTest { |
| 204 | 0x20, 0x1e, 0x78, (byte) 0xbd, | 204 | 0x20, 0x1e, 0x78, (byte) 0xbd, |
| 205 | 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, // STATEFUL-PCE-CAPABILITY | 205 | 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, // STATEFUL-PCE-CAPABILITY |
| 206 | 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV | 206 | 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV |
| 207 | - 0x00, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV | 207 | + (byte) 0xff, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV |
| 208 | }; | 208 | }; |
| 209 | 209 | ||
| 210 | byte[] testOpenMsg = {0}; | 210 | byte[] testOpenMsg = {0}; |
| ... | @@ -240,7 +240,7 @@ public class PcepOpenMsgTest { | ... | @@ -240,7 +240,7 @@ public class PcepOpenMsgTest { |
| 240 | 0x20, 0x1e, 0x78, (byte) 0xbd, | 240 | 0x20, 0x1e, 0x78, (byte) 0xbd, |
| 241 | 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY | 241 | 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY |
| 242 | 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV | 242 | 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV |
| 243 | - 0x00, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV | 243 | + (byte) 0xff, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV |
| 244 | }; | 244 | }; |
| 245 | 245 | ||
| 246 | byte[] testOpenMsg = {0}; | 246 | byte[] testOpenMsg = {0}; |
| ... | @@ -279,7 +279,7 @@ public class PcepOpenMsgTest { | ... | @@ -279,7 +279,7 @@ public class PcepOpenMsgTest { |
| 279 | 0x20, 0x1e, 0x78, (byte) 0xbd, | 279 | 0x20, 0x1e, 0x78, (byte) 0xbd, |
| 280 | 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY | 280 | 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY |
| 281 | 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV | 281 | 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV |
| 282 | - 0x00, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV | 282 | + (byte) 0xff, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV |
| 283 | }; | 283 | }; |
| 284 | 284 | ||
| 285 | byte[] testOpenMsg = {0}; | 285 | byte[] testOpenMsg = {0}; |
| ... | @@ -315,7 +315,7 @@ public class PcepOpenMsgTest { | ... | @@ -315,7 +315,7 @@ public class PcepOpenMsgTest { |
| 315 | 0x20, 0x1e, 0x78, 0x00, //invalid sessionID | 315 | 0x20, 0x1e, 0x78, 0x00, //invalid sessionID |
| 316 | 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY | 316 | 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY |
| 317 | 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV | 317 | 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV |
| 318 | - 0x00, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV | 318 | + (byte) 0xff, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV |
| 319 | }; | 319 | }; |
| 320 | 320 | ||
| 321 | byte[] testOpenMsg = {0}; | 321 | byte[] testOpenMsg = {0}; |
| ... | @@ -390,7 +390,7 @@ public class PcepOpenMsgTest { | ... | @@ -390,7 +390,7 @@ public class PcepOpenMsgTest { |
| 390 | 0x20, 0x05, 0x1E, 0x01, // OPEN object | 390 | 0x20, 0x05, 0x1E, 0x01, // OPEN object |
| 391 | 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY | 391 | 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY |
| 392 | 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV | 392 | 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV |
| 393 | - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV | 393 | + 0x00, 0x00, 0x00, 0x00, (byte) 0xff, 0x07, 0x00, 0x04, // PCECC-CAPABILITY-TLV |
| 394 | 0x00, 0x00, 0x00, 0x03, (byte) 0xFF, (byte) 0x00, 0x00, 0x04, // LS Capability TLV | 394 | 0x00, 0x00, 0x00, 0x03, (byte) 0xFF, (byte) 0x00, 0x00, 0x04, // LS Capability TLV |
| 395 | 0x00, 0x00, 0x00, 0x00 }; | 395 | 0x00, 0x00, 0x00, 0x00 }; |
| 396 | 396 | ||
| ... | @@ -427,7 +427,7 @@ public class PcepOpenMsgTest { | ... | @@ -427,7 +427,7 @@ public class PcepOpenMsgTest { |
| 427 | 0x20, 0x05, 0x1E, 0x01, // OPEN object | 427 | 0x20, 0x05, 0x1E, 0x01, // OPEN object |
| 428 | 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY | 428 | 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY |
| 429 | 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV | 429 | 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV |
| 430 | - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV | 430 | + 0x00, 0x00, 0x00, 0x00, (byte) 0xff, 0x07, 0x00, 0x04, // PCECC-CAPABILITY-TLV |
| 431 | 0x00, 0x00, 0x00, 0x03}; | 431 | 0x00, 0x00, 0x00, 0x03}; |
| 432 | 432 | ||
| 433 | byte[] testOpenMsg = {0}; | 433 | byte[] testOpenMsg = {0}; | ... | ... |
-
Please register or login to post a comment