PCEP modificaton to support PCEP-LS
Change-Id: Ic829dd17b0398ad76ec412b4e8293de564b5b56b
diff --git a/protocols/pcep/ctl/src/main/java/org/onosproject/pcep/controller/impl/PcepMessageDecoder.java b/protocols/pcep/ctl/src/main/java/org/onosproject/pcep/controller/impl/PcepMessageDecoder.java
index b106589..7f0ea90 100644
--- a/protocols/pcep/ctl/src/main/java/org/onosproject/pcep/controller/impl/PcepMessageDecoder.java
+++ b/protocols/pcep/ctl/src/main/java/org/onosproject/pcep/controller/impl/PcepMessageDecoder.java
@@ -22,6 +22,7 @@
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.frame.FrameDecoder;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.protocol.PcepFactories;
import org.onosproject.pcepio.protocol.PcepMessage;
import org.onosproject.pcepio.protocol.PcepMessageReader;
@@ -49,20 +50,31 @@
HexDump.pcepHexDump(buffer);
- // Note that a single call to decode results in reading a single
- // PcepMessage from the channel buffer, which is passed on to, and processed
- // by, the controller (in PcepChannelHandler).
- // This is different from earlier behavior (with the original pcepIO),
- // where we parsed all the messages in the buffer, before passing on
- // a list of the parsed messages to the controller.
- // The performance *may or may not* not be as good as before.
+ // Buffer can contain multiple messages, also may contain out of bound message.
+ // Read the message one by one from buffer and parse it. If it encountered out of bound message,
+ // then mark the reader index and again take the next chunk of messages from the channel
+ // and parse again from the marked reader index.
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- List<PcepMessage> msgList = new LinkedList<>();
+ List<PcepMessage> msgList = (List<PcepMessage>) ctx.getAttachment();
- while (buffer.readableBytes() > 0) {
- PcepMessage message = reader.readFrom(buffer);
- msgList.add(message);
+ if (msgList == null) {
+ msgList = new LinkedList<>();
}
- return msgList;
+
+ try {
+ while (buffer.readableBytes() > 0) {
+ buffer.markReaderIndex();
+ PcepMessage message = reader.readFrom(buffer);
+ msgList.add(message);
+ }
+ ctx.setAttachment(null);
+ return msgList;
+ } catch (PcepOutOfBoundMessageException e) {
+ log.debug("PCEP message decode error");
+ buffer.resetReaderIndex();
+ buffer.discardReadBytes();
+ ctx.setAttachment(msgList);
+ }
+ return null;
}
}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/exceptions/PcepOutOfBoundMessageException.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/exceptions/PcepOutOfBoundMessageException.java
new file mode 100644
index 0000000..3f14060
--- /dev/null
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/exceptions/PcepOutOfBoundMessageException.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.pcepio.exceptions;
+
+/**
+ * Custom exception for message out-of-bound.
+ */
+public class PcepOutOfBoundMessageException extends Exception {
+
+ private static final long serialVersionUID = 3L;
+
+ /**
+ * Default constructor to create a new exception.
+ */
+ public PcepOutOfBoundMessageException() {
+ super();
+ }
+
+ /**
+ * Constructor to create exception from message and cause.
+ *
+ * @param message the detail of exception in string
+ * @param cause underlying cause of the error
+ */
+ public PcepOutOfBoundMessageException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructor to create exception from message.
+ *
+ * @param message the detail of exception in string
+ */
+ public PcepOutOfBoundMessageException(final String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor to create exception from cause.
+ *
+ * @param cause underlying cause of the error
+ */
+ public PcepOutOfBoundMessageException(final Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/exceptions/PcepParseException.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/exceptions/PcepParseException.java
old mode 100755
new mode 100644
index 85bc33f..466f0e0
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/exceptions/PcepParseException.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/exceptions/PcepParseException.java
@@ -21,7 +21,7 @@
*/
public class PcepParseException extends Exception {
- private static final long serialVersionUID = 7960991379951448423L;
+ private static final long serialVersionUID = 1L;
private byte errType = 0;
private byte errValue = 0;
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/exceptions/PcepTunnelAttributeException.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/exceptions/PcepTunnelAttributeException.java
old mode 100755
new mode 100644
index 25bdf5b..100392c
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/exceptions/PcepTunnelAttributeException.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/exceptions/PcepTunnelAttributeException.java
@@ -21,7 +21,7 @@
*/
public class PcepTunnelAttributeException extends Exception {
- private static final long serialVersionUID = 7860981378961458434L;
+ private static final long serialVersionUID = 2L;
/**
* Default constructor to create a new exception.
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepError.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepError.java
old mode 100755
new mode 100644
index b61bfb9..13bbc46
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepError.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepError.java
@@ -15,7 +15,7 @@
*/
package org.onosproject.pcepio.protocol;
-import java.util.LinkedList;
+import java.util.List;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
@@ -30,42 +30,42 @@
*
* @return list of type PcepRPObject
*/
- LinkedList<PcepRPObject> getRPObjList();
+ List<PcepRPObject> getRPObjList();
/**
* Sets the RP Objects lists.
*
- * @param llRPObjList list of type PcepRPObject
+ * @param rpObjList list of type PcepRPObject
*/
- void setRPObjList(LinkedList<PcepRPObject> llRPObjList);
+ void setRPObjList(List<PcepRPObject> rpObjList);
/**
- * Returns the PcepTEObject List.
+ * Returns the PcepLSObject List.
*
- * @return list of type PcepTEObject
+ * @return list of type PcepLSObject
*/
- LinkedList<PcepTEObject> getTEObjList();
+ List<PcepLSObject> getLSObjList();
/**
- * Sets the TE Objects lists.
+ * Sets the LS Objects lists.
*
- * @param llTEObjList list of type PcepTEObject
+ * @param lsObjList list of type PcepLSObject
*/
- void setTEObjList(LinkedList<PcepTEObject> llTEObjList);
+ void setLSObjList(List<PcepLSObject> lsObjList);
/**
* Returns the PcepErrorObject.
*
* @return list of type PcepErrorObject
*/
- LinkedList<PcepErrorObject> getErrorObjList();
+ List<PcepErrorObject> getErrorObjList();
/**
* Sets the Error Objects lists.
*
- * @param llErrorObjList list of type PcepErrorObject
+ * @param errorObjList list of type PcepErrorObject
*/
- void setErrorObjList(LinkedList<PcepErrorObject> llErrorObjList);
+ void setErrorObjList(List<PcepErrorObject> errorObjList);
/**
* Writes the byte stream of PCEP error to the channel buffer.
@@ -93,44 +93,44 @@
*
* @return list of type PcepRPObject
*/
- LinkedList<PcepRPObject> getRPObjList();
+ List<PcepRPObject> getRPObjList();
/**
* Sets RP Object lists and returns its builder.
*
- * @param llRPObjList list of type PcepRpObject
+ * @param rpObjList list of type PcepRpObject
* @return builder by setting Linked list of RP Object
*/
- Builder setRPObjList(LinkedList<PcepRPObject> llRPObjList);
+ Builder setRPObjList(List<PcepRPObject> rpObjList);
/**
- * Returns the PcepTEObject.
+ * Returns the PcepLSObject.
*
- * @return llTEObjList of type PcepTEObject
+ * @return lsObjList of type PcepLSObject
*/
- LinkedList<PcepTEObject> getTEObjList();
+ List<PcepLSObject> getLSObjList();
/**
- * Sets TE Object lists and returns its builder.
+ * Sets LS Object lists and returns its builder.
*
- * @param llTEObjList list of type PcepTEObject
- * @return builder by setting list of type PcepTEObject
+ * @param lsObjList list of type PcepLSObject
+ * @return builder by setting list of type PcepLSObject
*/
- Builder setTEObjList(LinkedList<PcepTEObject> llTEObjList);
+ Builder setLSObjList(List<PcepLSObject> lsObjList);
/**
* Returns the PcepErrorObject.
*
* @return list of type PcepErrorObject
*/
- LinkedList<PcepErrorObject> getErrorObjList();
+ List<PcepErrorObject> getErrorObjList();
/**
* Sets Error Object lists and returns its builder.
*
- * @param llErrorObjList list of type PcepErrorObject
+ * @param errorObjList list of type PcepErrorObject
* @return builder by setting list of type PcepErrorObject
*/
- Builder setErrorObjList(LinkedList<PcepErrorObject> llErrorObjList);
+ Builder setErrorObjList(List<PcepErrorObject> errorObjList);
}
}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepErrorInfo.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepErrorInfo.java
old mode 100755
new mode 100644
index 0c625a0..09bc8d3
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepErrorInfo.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepErrorInfo.java
@@ -15,7 +15,7 @@
*/
package org.onosproject.pcepio.protocol;
-import java.util.LinkedList;
+import java.util.List;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
@@ -54,14 +54,14 @@
*
* @return list of Error Value in PCEP-ERROR Object
*/
- LinkedList<Integer> getErrorValue();
+ List<Integer> getErrorValue();
/**
* Returns Error Type in PCEP-ERROR Object.
*
* @return list of Error Type in PCEP-ERROR Object
*/
- LinkedList<Integer> getErrorType();
+ List<Integer> getErrorType();
/**
* Builder interface with get and set functions to build ErrorInfo.
@@ -80,7 +80,7 @@
*
* @return list of PcepError
*/
- LinkedList<PcepError> getPcepErrorList();
+ List<PcepError> getPcepErrorList();
/**
* Sets PcepError lists and returns its builder.
@@ -88,6 +88,6 @@
* @param llPcepErrorList list of PcepError
* @return builder by setting list of PcepError.
*/
- Builder setPcepErrorList(LinkedList<PcepError> llPcepErrorList);
+ Builder setPcepErrorList(List<PcepError> llPcepErrorList);
}
}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepFactories.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepFactories.java
index 85416f9..a3e3b05 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepFactories.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepFactories.java
@@ -17,6 +17,7 @@
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.protocol.ver1.PcepFactoryVer1;
import org.slf4j.Logger;
@@ -54,7 +55,7 @@
private static class GenericReader implements PcepMessageReader<PcepMessage> {
@Override
- public PcepMessage readFrom(ChannelBuffer bb) throws PcepParseException {
+ public PcepMessage readFrom(ChannelBuffer bb) throws PcepParseException, PcepOutOfBoundMessageException {
if (!bb.readable()) {
throw new PcepParseException("Empty message received");
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepLSObject.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepLSObject.java
new file mode 100644
index 0000000..a5423ca
--- /dev/null
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepLSObject.java
@@ -0,0 +1,241 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio.protocol;
+
+import java.util.List;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.types.PcepObjectHeader;
+import org.onosproject.pcepio.types.PcepValueType;
+
+/**
+ * Abstraction of an entity providing PCEP LS Object.
+ */
+public interface PcepLSObject {
+
+ /**
+ * Returns LS object header.
+ *
+ * @return LS object header
+ */
+ PcepObjectHeader getLSObjHeader();
+
+ /**
+ * Sets LS Object header.
+ *
+ * @param obj LS Object header
+ */
+ void setLSObjHeader(PcepObjectHeader obj);
+
+ /**
+ * Returns ProtocolId in LS Object.
+ *
+ * @return ProtocolId in LS Object
+ */
+ byte getProtocolId();
+
+ /**
+ * Sets ProtocolId in LS Object.
+ *
+ * @param protId ProtocolId in LS Object
+ */
+ void setProtocolId(byte protId);
+
+ /**
+ * Returns R flag in LS Object.
+ *
+ * @return R flag in LS Object
+ */
+ boolean getRemoveFlag();
+
+ /**
+ * Sets R flag in LS Object.
+ *
+ * @param removeFlag R flag in LS Object
+ */
+ void setRemoveFlag(boolean removeFlag);
+
+ /**
+ * Returns sync flag in LS Object.
+ *
+ * @return sync flag in LS Object
+ */
+ boolean getSyncFlag();
+
+ /**
+ * Sets sync flag in LS Object.
+ *
+ * @param syncFlag sync flag in LS Object
+ */
+ void setSyncFlag(boolean syncFlag);
+
+ /**
+ * Returns LS ID in LS Object.
+ *
+ * @return LS ID in LS Object
+ */
+ long getLSId();
+
+ /**
+ * Sets LS ID in LS Object.
+ *
+ * @param lsId LS ID in LS Object
+ */
+ void setLSId(long lsId);
+
+ /**
+ * Returns list of Optional Tlvs in LS Object.
+ *
+ * @return list of Optional Tlvs
+ */
+ List<PcepValueType> getOptionalTlv();
+
+ /**
+ * Sets list of Optional Tlvs in LS Object.
+ *
+ * @param optionalTlvList list of Optional Tlvs
+ */
+ void setOptionalTlv(List<PcepValueType> optionalTlvList);
+
+ /**
+ * Writes the LS Object into channel buffer.
+ *
+ * @param bb channel buffer
+ * @return Returns the writerIndex of this buffer
+ * @throws PcepParseException when object header is not written to channel buffer
+ */
+ int write(ChannelBuffer bb) throws PcepParseException;
+
+ /**
+ * Builder interface with get and set functions to build LS object.
+ */
+ interface Builder {
+
+ /**
+ * Builds LS Object.
+ *
+ * @return LS Object
+ */
+ PcepLSObject build();
+
+ /**
+ * Returns LS object header.
+ *
+ * @return LS object header
+ */
+ PcepObjectHeader getLSObjHeader();
+
+ /**
+ * Sets LS object header and returns its builder.
+ *
+ * @param obj LS object header
+ * @return Builder by setting LS object header
+ */
+ Builder setLSObjHeader(PcepObjectHeader obj);
+
+ /**
+ * Returns ProtocolId in LS Object.
+ *
+ * @return ProtocolId in LS Object
+ */
+ byte getProtocolId();
+
+ /**
+ * Sets ProtocolId in LS Object and returns its builder.
+ *
+ * @param protId ProtocolId in LS Object
+ * @return Builder by setting ProtocolId
+ */
+ Builder setProtocolId(byte protId);
+
+ /**
+ * Returns R flag in LS Object.
+ *
+ * @return R flag in LS Object
+ */
+ boolean getRemoveFlag();
+
+ /**
+ * Sets R flag in LS Object and returns its builder.
+ *
+ * @param removeFlag R flag in LS Object
+ * @return Builder by setting R flag
+ */
+ Builder setRemoveFlag(boolean removeFlag);
+
+ /**
+ * Returns sync flag in LS Object.
+ *
+ * @return sync flag in LS Object
+ */
+ boolean getSyncFlag();
+
+ /**
+ * Sets sync flag in LS Object and returns its builder.
+ *
+ * @param syncFlag sync flag in LS Object
+ * @return Builder by setting sync flag
+ */
+ Builder setSyncFlag(boolean syncFlag);
+
+ /**
+ * Returns LS ID in LS Object.
+ *
+ * @return LS ID in LS Object
+ */
+ long getLSId();
+
+ /**
+ * Sets LS ID in LS Object and returns its builder.
+ *
+ * @param lsId LS ID in LS Object
+ * @return Builder by setting LS ID
+ */
+ Builder setLSId(long lsId);
+
+ /**
+ * Returns list of Optional Tlvs in LS Object.
+ *
+ * @return list of Optional Tlvs
+ */
+ List<PcepValueType> getOptionalTlv();
+
+ /**
+ * Sets list of Optional Tlvs in LS Object and returns its builder.
+ *
+ * @param optionalTlvList list of Optional Tlvs
+ * @return Builder by setting list of Optional Tlvs
+ */
+ Builder setOptionalTlv(List<PcepValueType> optionalTlvList);
+
+ /**
+ * Sets Processing rule flag in LS object header and returns its builder.
+ *
+ * @param value boolean value to set Processing rule flag
+ * @return Builder by setting Processing rule flag
+ */
+ Builder setPFlag(boolean value);
+
+ /**
+ * Sets Ignore flag in LS object header and returns its builder.
+ *
+ * @param value boolean value to set Ignore flag
+ * @return Builder by setting Ignore flag
+ */
+ Builder setIFlag(boolean value);
+ }
+}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepLSReportMsg.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepLSReportMsg.java
new file mode 100644
index 0000000..1de448c
--- /dev/null
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepLSReportMsg.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.pcepio.protocol;
+
+import java.util.List;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+
+/**
+ * Abstraction of an entity providing PCEP LS-Report Message.
+ */
+public interface PcepLSReportMsg extends PcepObject, PcepMessage {
+
+ @Override
+ PcepVersion getVersion();
+
+ @Override
+ PcepType getType();
+
+ /**
+ * Returns list of PCEP LS Objects.
+ *
+ * @return list of PCEP LS Objects
+ */
+ List<PcepLSObject> getLSReportList();
+
+ /**
+ * Sets list of Optional Tlvs in LS-Report Message.
+ *
+ * @param lsReportList list of optional Tlvs
+ */
+ void setLSReportList(List<PcepLSObject> lsReportList);
+
+ @Override
+ void writeTo(ChannelBuffer channelBuffer) throws PcepParseException;
+
+ /**
+ * Builder interface with get and set functions to build LS-Report message.
+ */
+ interface Builder extends PcepMessage.Builder {
+
+ @Override
+ PcepLSReportMsg build();
+
+ @Override
+ PcepVersion getVersion();
+
+ @Override
+ PcepType getType();
+
+ /**
+ * Returns list of LS Object in LS Report Message.
+ *
+ * @return list of LS Objects
+ */
+ List<PcepLSObject> getLSReportList();
+
+ /**
+ * Sets list of LS Objects and returns its builder.
+ *
+ * @param lsReportList list of LS Objects
+ * @return Builder object for LS-Report message
+ */
+ Builder setLSReportList(List<PcepLSObject> lsReportList);
+ }
+}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepMessageReader.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepMessageReader.java
old mode 100755
new mode 100644
index 591a033..4dc2e6e
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepMessageReader.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepMessageReader.java
@@ -17,6 +17,7 @@
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
/**
@@ -32,5 +33,5 @@
* @throws PcepParseException while parsing PCEP message.
* @throws PcepParseException when received message is empty
*/
- T readFrom(ChannelBuffer bb) throws PcepParseException;
+ T readFrom(ChannelBuffer bb) throws PcepParseException, PcepOutOfBoundMessageException;
}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepTEObject.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepTEObject.java
deleted file mode 100755
index 21f6c71..0000000
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepTEObject.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.protocol;
-
-import java.util.LinkedList;
-
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.onosproject.pcepio.exceptions.PcepParseException;
-import org.onosproject.pcepio.types.PcepObjectHeader;
-import org.onosproject.pcepio.types.PcepValueType;
-
-/**
- * Abstraction of an entity providing PCEP TE Object.
- */
-public interface PcepTEObject {
-
- /**
- * Returns TE object header.
- *
- * @return TE object header
- */
- PcepObjectHeader getTEObjHeader();
-
- /**
- * Sets TE Object header.
- *
- * @param obj TE Object header
- */
- void setTEObjHeader(PcepObjectHeader obj);
-
- /**
- * Returns ProtocolId in TE Object.
- *
- * @return ProtocolId in TE Object
- */
- byte getProtocolId();
-
- /**
- * Sets ProtocolId in TE Object.
- *
- * @param yProtId ProtocolId in TE Object
- */
- void setProtocolId(byte yProtId);
-
- /**
- * Returns R flag in TE Object.
- *
- * @return R flag in TE Object
- */
- boolean getRFlag();
-
- /**
- * Sets R flag in TE Object.
- *
- * @param bRFlag R flag in TE Object
- */
- void setRFlag(boolean bRFlag);
-
- /**
- * Returns S flag in TE Object.
- *
- * @return S flag in TE Object
- */
- boolean getSFlag();
-
- /**
- * Sets S flag in TE Object.
- *
- * @param bSFlag S flag in TE Object
- */
- void setSFlag(boolean bSFlag);
-
- /**
- * Returns TE ID in TE Object.
- *
- * @return TE ID in TE Object
- */
- int getTEId();
-
- /**
- * Sets TE ID in TE Object.
- *
- * @param iTEId TE ID in TE Object
- */
- void setTEId(int iTEId);
-
- /**
- * Returns list of Optional Tlvs in TE Object.
- *
- * @return list of Optional Tlvs
- */
- LinkedList<PcepValueType> getOptionalTlv();
-
- /**
- * Sets list of Optional Tlvs in TE Object.
- *
- * @param llOptionalTlv list of Optional Tlvs
- */
- void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
-
- /**
- * Writes the TE Object into channel buffer.
- *
- * @param bb channel buffer
- * @return Returns the writerIndex of this buffer
- * @throws PcepParseException when obj header is not written to channel buffer
- */
- int write(ChannelBuffer bb) throws PcepParseException;
-
- /**
- * Builder interface with get and set functions to build TE object.
- */
- interface Builder {
-
- /**
- * Builds TE Object.
- *
- * @return TE Object
- */
- PcepTEObject build();
-
- /**
- * Returns TE object header.
- *
- * @return TE object header
- */
- PcepObjectHeader getTEObjHeader();
-
- /**
- * Sets TE object header and returns its builder.
- *
- * @param obj TE object header
- * @return Builder by setting TE object header
- */
- Builder setTEObjHeader(PcepObjectHeader obj);
-
- /**
- * Returns ProtocolId in TE Object.
- *
- * @return ProtocolId in TE Object
- */
- byte getProtocolId();
-
- /**
- * Sets ProtocolId in TE Object and returns its builder.
- *
- * @param yProtId ProtocolId in TE Object
- * @return Builder by setting ProtocolId
- */
- Builder setProtocolId(byte yProtId);
-
- /**
- * Returns R flag in TE Object.
- *
- * @return R flag in TE Object
- */
- boolean getRFlag();
-
- /**
- * Sets R flag in TE Object and returns its builder.
- *
- * @param bRFlag R flag in TE Object
- * @return Builder by setting R flag
- */
- Builder setRFlag(boolean bRFlag);
-
- /**
- * Returns S flag in TE Object.
- *
- * @return S flag in TE Object
- */
- boolean getSFlag();
-
- /**
- * Sets S flag in TE Object and returns its builder.
- *
- * @param bSFlag S flag in TE Object
- * @return Builder by setting S flag
- */
- Builder setSFlag(boolean bSFlag);
-
- /**
- * Returns TE ID in TE Object.
- *
- * @return TE ID in TE Object
- */
- int getTEId();
-
- /**
- * Sets TE ID in TE Object and returns its builder.
- *
- * @param iTEId TE ID in TE Object
- * @return Builder by setting TE ID
- */
- Builder setTEId(int iTEId);
-
- /**
- * Returns list of Optional Tlvs in TE Object.
- *
- * @return list of Optional Tlvs
- */
- LinkedList<PcepValueType> getOptionalTlv();
-
- /**
- * Sets list of Optional Tlvs in TE Object and returns its builder.
- *
- * @param llOptionalTlv list of Optional Tlvs
- * @return Builder by setting list of Optional Tlvs
- */
- Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
-
- /**
- * Sets P flag in TE object header and returns its builder.
- *
- * @param value boolean value to set P flag
- * @return Builder by setting P flag
- */
- Builder setPFlag(boolean value);
-
- /**
- * Sets I flag in TE object header and returns its builder.
- *
- * @param value boolean value to set I flag
- * @return Builder by setting I flag
- */
- Builder setIFlag(boolean value);
- }
-}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepTEReportMsg.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepTEReportMsg.java
deleted file mode 100755
index 3bc5034..0000000
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepTEReportMsg.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.pcepio.protocol;
-
-import java.util.LinkedList;
-
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.onosproject.pcepio.exceptions.PcepParseException;
-
-/**
- * Abstraction of an entity providing PCEP TE Report Message.
- */
-public interface PcepTEReportMsg extends PcepObject, PcepMessage {
-
- @Override
- PcepVersion getVersion();
-
- @Override
- PcepType getType();
-
- /**
- * Returns list of PCEP TE Objects.
- *
- * @return list of PCEP TE Objects
- */
- LinkedList<PcepTEObject> getTEReportList();
-
- /**
- * Sets list of Optional Tlvs in TE Report Message.
- *
- * @param llTEReportList list of optional Tlvs
- */
- void setTEReportList(LinkedList<PcepTEObject> llTEReportList);
-
- @Override
- void writeTo(ChannelBuffer channelBuffer) throws PcepParseException;
-
- /**
- * Builder interface with get and set functions to build TE Report message.
- */
- interface Builder extends PcepMessage.Builder {
-
- @Override
- PcepTEReportMsg build();
-
- @Override
- PcepVersion getVersion();
-
- @Override
- PcepType getType();
-
- /**
- * Returns list of Optional Tlv in TE Report Message.
- *
- * @return list of Optional Tlv
- */
- LinkedList<PcepTEObject> getTEReportList();
-
- /**
- * Sets list of Optional Tlvs and returns its builder.
- *
- * @param llTEReportList list of Optional Tlvs
- * @return Builder object for TE report message
- */
- Builder setTEReportList(LinkedList<PcepTEObject> llTEReportList);
- }
-}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepType.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepType.java
old mode 100755
new mode 100644
index 450fdfa..7be9f44
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepType.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepType.java
@@ -22,8 +22,8 @@
public enum PcepType {
NONE(0), OPEN(1), KEEP_ALIVE(2), PATH_COMPUTATION_REQUEST(3), PATH_COMPUTATION_REPLY(4),
- NOTIFICATION(5), ERROR(6), CLOSE(7), REPORT(10), UPDATE(11), INITIATE(12), LABEL_UPDATE(13),
- TE_REPORT(14), LABEL_RANGE_RESERV(15), MAX(16), END(17);
+ NOTIFICATION(5), ERROR(6), CLOSE(7), REPORT(10), UPDATE(11), INITIATE(12),
+ LS_REPORT(224), LABEL_RANGE_RESERV(225), LABEL_UPDATE(226), MAX(227), END(228);
int iValue;
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepEroObjectVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepEroObjectVer1.java
index 4d7cb16..6afd062 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepEroObjectVer1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepEroObjectVer1.java
@@ -22,7 +22,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.protocol.PcepEroObject;
-import org.onosproject.pcepio.types.AutonomousSystemTlv;
+import org.onosproject.pcepio.types.AutonomousSystemNumberSubObject;
import org.onosproject.pcepio.types.IPv4SubObject;
import org.onosproject.pcepio.types.IPv6SubObject;
import org.onosproject.pcepio.types.PathKeySubObject;
@@ -147,32 +147,32 @@
public static final int LABEL_SUB_OBJ_TYPE = 3;
public static final int SR_ERO_SUB_OBJ_TYPE = 96;
public static final int OBJECT_HEADER_LENGTH = 4;
- public static final int YTYPE_SHIFT_VALUE = 0x7F;
+ public static final int TYPE_SHIFT_VALUE = 0x7F;
- static final PcepObjectHeader DEFAULT_ERO_OBJECT_HEADER = new PcepObjectHeader(ERO_OBJ_CLASS, ERO_OBJ_TYPE,
+ public static final PcepObjectHeader DEFAULT_ERO_OBJECT_HEADER = new PcepObjectHeader(ERO_OBJ_CLASS, ERO_OBJ_TYPE,
PcepObjectHeader.REQ_OBJ_OPTIONAL_PROCESS, PcepObjectHeader.RSP_OBJ_PROCESSED, ERO_OBJ_MINIMUM_LENGTH);
private PcepObjectHeader eroObjHeader;
- private LinkedList<PcepValueType> llSubObjects = new LinkedList<>();
+ private LinkedList<PcepValueType> subObjectList = new LinkedList<>();
/**
* reset variables.
*/
public PcepEroObjectVer1() {
this.eroObjHeader = null;
- this.llSubObjects = null;
+ this.subObjectList = null;
}
/**
* Constructor to initialize parameters of ERO object.
*
* @param eroObjHeader ERO object header
- * @param llSubObjects list of sub objects.
+ * @param subObjectList list of sub objects.
*/
- public PcepEroObjectVer1(PcepObjectHeader eroObjHeader, LinkedList<PcepValueType> llSubObjects) {
+ public PcepEroObjectVer1(PcepObjectHeader eroObjHeader, LinkedList<PcepValueType> subObjectList) {
this.eroObjHeader = eroObjHeader;
- this.llSubObjects = llSubObjects;
+ this.subObjectList = subObjectList;
}
/**
@@ -195,12 +195,12 @@
@Override
public LinkedList<PcepValueType> getSubObjects() {
- return this.llSubObjects;
+ return this.subObjectList;
}
@Override
- public void setSubObjects(LinkedList<PcepValueType> llSubObjects) {
- this.llSubObjects = llSubObjects;
+ public void setSubObjects(LinkedList<PcepValueType> subObjectList) {
+ this.subObjectList = subObjectList;
}
/**
@@ -213,7 +213,7 @@
public static PcepEroObject read(ChannelBuffer cb) throws PcepParseException {
PcepObjectHeader eroObjHeader;
- LinkedList<PcepValueType> llSubObjects = new LinkedList<>();
+ LinkedList<PcepValueType> subObjectList = new LinkedList<>();
eroObjHeader = PcepObjectHeader.read(cb);
@@ -225,9 +225,9 @@
if (eroObjHeader.getObjLen() > OBJECT_HEADER_LENGTH) {
ChannelBuffer tempCb = cb.readBytes(eroObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
- llSubObjects = parseSubObjects(tempCb);
+ subObjectList = parseSubObjects(tempCb);
}
- return new PcepEroObjectVer1(eroObjHeader, llSubObjects);
+ return new PcepEroObjectVer1(eroObjHeader, subObjectList);
}
/**
@@ -239,18 +239,18 @@
*/
protected static LinkedList<PcepValueType> parseSubObjects(ChannelBuffer cb) throws PcepParseException {
- LinkedList<PcepValueType> llSubObjects = new LinkedList<>();
+ LinkedList<PcepValueType> subObjectList = new LinkedList<>();
while (0 < cb.readableBytes()) {
//check the Type of the TLV
- byte yType = cb.readByte();
- yType = (byte) (yType & (YTYPE_SHIFT_VALUE));
+ short type = cb.readByte();
+ type = (short) (type & (TYPE_SHIFT_VALUE));
byte hLength = cb.readByte();
PcepValueType subObj;
- switch (yType) {
+ switch (type) {
case IPv4SubObject.TYPE:
subObj = IPv4SubObject.read(cb);
@@ -260,8 +260,8 @@
cb.readBytes(ipv6Value, 0, IPv6SubObject.VALUE_LENGTH);
subObj = new IPv6SubObject(ipv6Value);
break;
- case AutonomousSystemTlv.TYPE:
- subObj = AutonomousSystemTlv.read(cb);
+ case AutonomousSystemNumberSubObject.TYPE:
+ subObj = AutonomousSystemNumberSubObject.read(cb);
break;
case PathKeySubObject.TYPE:
subObj = PathKeySubObject.read(cb);
@@ -270,7 +270,7 @@
subObj = SrEroSubObject.read(cb);
break;
default:
- throw new PcepParseException("Unexpected sub object. Type: " + (int) yType);
+ throw new PcepParseException("Unexpected sub object. Type: " + (int) type);
}
// Check for the padding
int pad = hLength % 4;
@@ -281,12 +281,12 @@
}
}
- llSubObjects.add(subObj);
+ subObjectList.add(subObj);
}
if (0 < cb.readableBytes()) {
throw new PcepParseException("Subobject parsing error. Extra bytes received.");
}
- return llSubObjects;
+ return subObjectList;
}
@Override
@@ -301,7 +301,7 @@
throw new PcepParseException("Failed to write ERO object header. Index " + objLenIndex);
}
- ListIterator<PcepValueType> listIterator = llSubObjects.listIterator();
+ ListIterator<PcepValueType> listIterator = subObjectList.listIterator();
while (listIterator.hasNext()) {
listIterator.next().write(cb);
@@ -342,7 +342,7 @@
private boolean bIFlag;
private PcepObjectHeader eroObjHeader;
- LinkedList<PcepValueType> llSubObjects = new LinkedList<>();
+ LinkedList<PcepValueType> subObjectList = new LinkedList<>();
@Override
public PcepEroObject build() {
@@ -357,7 +357,7 @@
eroObjHeader.setIFlag(bIFlag);
}
- return new PcepEroObjectVer1(eroObjHeader, this.llSubObjects);
+ return new PcepEroObjectVer1(eroObjHeader, this.subObjectList);
}
@Override
@@ -374,12 +374,12 @@
@Override
public LinkedList<PcepValueType> getSubObjects() {
- return this.llSubObjects;
+ return this.subObjectList;
}
@Override
- public Builder setSubObjects(LinkedList<PcepValueType> llSubObjects) {
- this.llSubObjects = llSubObjects;
+ public Builder setSubObjects(LinkedList<PcepValueType> subObjectList) {
+ this.subObjectList = subObjectList;
return this;
}
@@ -400,8 +400,9 @@
@Override
public String toString() {
- return MoreObjects.toStringHelper(getClass())
- .add("EroObjHeader", eroObjHeader).add("SubObjects", llSubObjects)
+ return MoreObjects.toStringHelper(getClass()).omitNullValues()
+ .add("EroObjHeader", eroObjHeader)
+ .add("SubObjects", subObjectList)
.toString();
}
}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorInfoVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorInfoVer1.java
index 594e40c..6fbfb41 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorInfoVer1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorInfoVer1.java
@@ -16,6 +16,7 @@
package org.onosproject.pcepio.protocol.ver1;
import java.util.LinkedList;
+import java.util.List;
import java.util.ListIterator;
import org.jboss.netty.buffer.ChannelBuffer;
@@ -24,7 +25,7 @@
import org.onosproject.pcepio.protocol.PcepErrorInfo;
import org.onosproject.pcepio.protocol.PcepErrorObject;
import org.onosproject.pcepio.protocol.PcepRPObject;
-import org.onosproject.pcepio.protocol.PcepTEObject;
+import org.onosproject.pcepio.protocol.PcepLSObject;
import org.onosproject.pcepio.types.PcepObjectHeader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -33,26 +34,26 @@
/**
* Provides PCEP Error Info.
- * Reference :PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02.
+ * Reference : draft-dhodylee-pce-pcep-ls-01, section 8.2.
*/
public class PcepErrorInfoVer1 implements PcepErrorInfo {
protected static final Logger log = LoggerFactory.getLogger(PcepErrorInfoVer1.class);
//Error list is optional
- private LinkedList<PcepError> errList;
+ private List<PcepError> errList;
/**
* Constructor to add PCEP error object to the list.
*
* @param llRPObjList list of PCEP RP object
- * @param llTEObjList list of PCEP TE object
+ * @param llLSObjList list of PCEP LS object
* @param llErrObjList list of PCEP error object
*/
- public PcepErrorInfoVer1(LinkedList<PcepRPObject> llRPObjList, LinkedList<PcepTEObject> llTEObjList,
- LinkedList<PcepErrorObject> llErrObjList) {
+ public PcepErrorInfoVer1(List<PcepRPObject> llRPObjList, List<PcepLSObject> llLSObjList,
+ List<PcepErrorObject> llErrObjList) {
this.errList = new LinkedList<>();
if ((llErrObjList != null) && (!llErrObjList.isEmpty())) {
- this.errList.add(new PcepErrorVer1(llRPObjList, llTEObjList, llErrObjList));
+ this.errList.add(new PcepErrorVer1(llRPObjList, llLSObjList, llErrObjList));
}
}
@@ -61,7 +62,7 @@
*
* @param errll linked list or pcep error
*/
- public PcepErrorInfoVer1(LinkedList<PcepError> errll) {
+ public PcepErrorInfoVer1(List<PcepError> errll) {
this.errList = errll;
}
@@ -79,7 +80,7 @@
tempObjHeader = PcepObjectHeader.read(cb);
cb.resetReaderIndex();
byte yObjClass = tempObjHeader.getObjClass();
- if ((yObjClass != PcepRPObjectVer1.RP_OBJ_CLASS) && (yObjClass != PcepTEObjectVer1.TE_OBJ_CLASS)
+ if ((yObjClass != PcepRPObjectVer1.RP_OBJ_CLASS) && (yObjClass != PcepLSObjectVer1.LS_OBJ_CLASS)
&& (yObjClass != PcepErrorObjectVer1.ERROR_OBJ_CLASS)) {
throw new PcepParseException("Unknown Object is present in PCEP-ERROR. Object Class: " + yObjClass);
}
@@ -96,7 +97,7 @@
PcepError pcepError = listIterator.next();
//RP Object list is optional
- LinkedList<PcepRPObject> llRPObjList = pcepError.getRPObjList();
+ List<PcepRPObject> llRPObjList = pcepError.getRPObjList();
if (llRPObjList != null) {
ListIterator<PcepRPObject> rpListIterator = llRPObjList.listIterator();
while (rpListIterator.hasNext()) {
@@ -104,10 +105,10 @@
}
}
- //TE Object list is optional
- LinkedList<PcepTEObject> llTEObjList = pcepError.getTEObjList();
- if (llTEObjList != null) {
- ListIterator<PcepTEObject> teListIterator = llTEObjList.listIterator();
+ //LS Object list is optional
+ List<PcepLSObject> llLSObjList = pcepError.getLSObjList();
+ if (llLSObjList != null) {
+ ListIterator<PcepLSObject> teListIterator = llLSObjList.listIterator();
while (teListIterator.hasNext()) {
teListIterator.next().write(cb);
}
@@ -116,7 +117,7 @@
// <error-obj-list> is mandatory
boolean bIsErrorObjListFound = false;
- LinkedList<PcepErrorObject> llErrObjList = pcepError.getErrorObjList();
+ List<PcepErrorObject> llErrObjList = pcepError.getErrorObjList();
if (llErrObjList != null) {
ListIterator<PcepErrorObject> errObjListIterator = llErrObjList.listIterator();
while (errObjListIterator.hasNext()) {
@@ -132,14 +133,14 @@
}
@Override
- public LinkedList<Integer> getErrorType() {
- LinkedList<Integer> errorType = new LinkedList<>();
+ public List<Integer> getErrorType() {
+ List<Integer> errorType = new LinkedList<>();
ListIterator<PcepError> listIterator = errList.listIterator();
PcepErrorObject errObj;
int error;
while (listIterator.hasNext()) {
PcepError pcepError = listIterator.next();
- LinkedList<PcepErrorObject> llErrObjList = pcepError.getErrorObjList();
+ List<PcepErrorObject> llErrObjList = pcepError.getErrorObjList();
if (llErrObjList != null) {
ListIterator<PcepErrorObject> errObjListIterator = llErrObjList.listIterator();
while (errObjListIterator.hasNext()) {
@@ -153,14 +154,14 @@
}
@Override
- public LinkedList<Integer> getErrorValue() {
- LinkedList<Integer> errorValue = new LinkedList<>();
+ public List<Integer> getErrorValue() {
+ List<Integer> errorValue = new LinkedList<>();
ListIterator<PcepError> listIterator = errList.listIterator();
PcepErrorObject errObj;
int error;
while (listIterator.hasNext()) {
PcepError pcepError = listIterator.next();
- LinkedList<PcepErrorObject> llErrObjList = pcepError.getErrorObjList();
+ List<PcepErrorObject> llErrObjList = pcepError.getErrorObjList();
if (llErrObjList != null) {
ListIterator<PcepErrorObject> errObjListIterator = llErrObjList.listIterator();
while (errObjListIterator.hasNext()) {
@@ -177,7 +178,7 @@
* Builder class for PCEP error info.
*/
public static class Builder implements PcepErrorInfo.Builder {
- private LinkedList<PcepError> errll;
+ private List<PcepError> errll;
@Override
public PcepErrorInfo build() {
@@ -185,12 +186,12 @@
}
@Override
- public LinkedList<PcepError> getPcepErrorList() {
+ public List<PcepError> getPcepErrorList() {
return this.errll;
}
@Override
- public Builder setPcepErrorList(LinkedList<PcepError> errll) {
+ public Builder setPcepErrorList(List<PcepError> errll) {
this.errll = errll;
return this;
}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorMsgVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorMsgVer1.java
index 927d83d..e27e2cd 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorMsgVer1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorMsgVer1.java
@@ -16,6 +16,7 @@
package org.onosproject.pcepio.protocol.ver1;
import java.util.LinkedList;
+import java.util.List;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
@@ -42,6 +43,7 @@
/*
* PCE Error message format.
+ Reference: draft-dhodylee-pce-pcep-ls-01, section 8.2.
<PCErr Message> ::= <Common Header>
( <error-obj-list> [<Open>] ) | <error>
@@ -49,12 +51,12 @@
<error-obj-list> ::=<PCEP-ERROR>[<error-obj-list>]
- <error> ::=[<request-id-list> | <te-id-list>]
+ <error> ::=[<request-id-list> | <ls-id-list>]
<error-obj-list>
<request-id-list> ::=<RP>[<request-id-list>]
- <te-id-list> ::=<TE>[<te-id-list>]
+ <ls-id-list> ::=<LS>[<ls-id-list>]
<error-list> ::=<error>[<error-list>]
*/
@@ -71,7 +73,7 @@
public static final PcepErrorMsgVer1.Reader READER = new Reader();
/**
- * constructor to initialize variables.
+ * Constructor to initialize variables.
*/
public PcepErrorMsgVer1() {
errObjListWithOpen = null;
@@ -128,7 +130,7 @@
//parse <PCErr Message>
parsePCErrMsg(cb);
- // If other than RP or TE or PCEP-ERROR present then it is error.
+ // If other than RP or LS or PCEP-ERROR present then it is error.
if (0 < cb.readableBytes()) {
PcepObjectHeader tempObjHeader = PcepObjectHeader.read(cb);
throw new PcepParseException("Unexpected Object found. Object Class : " + tempObjHeader.getObjClass());
@@ -147,10 +149,10 @@
public void parsePCErrMsg(ChannelBuffer cb) throws PcepParseException {
//If PCEP-ERROR list is followed by OPEN Object then store into ErrorObjListWithOpen.
// ( <error-obj-list> [<Open>]
- //If PCEP-ERROR list is followed by RP or TE Object then store into errInfo. <error> [<error-list>]
+ //If PCEP-ERROR list is followed by RP or LS Object then store into errInfo. <error> [<error-list>]
//If only PCEP-ERROR list is present then store into ErrorObjListWithOpen.
PcepObjectHeader tempObjHeader;
- LinkedList<PcepErrorObject> llErrObjList;
+ List<PcepErrorObject> llErrObjList;
if (0 >= cb.readableBytes()) {
throw new PcepParseException("PCEP-ERROR message came with empty objects.");
@@ -171,9 +173,9 @@
PcepOpenObject pcepOpenObj = PcepOpenObjectVer1.read(cb);
this.errObjListWithOpen = new ErrorObjListWithOpen(llErrObjList, pcepOpenObj);
- } else if ((tempObjHeader != null) //check whether RP or TE Object is present.
+ } else if ((tempObjHeader != null) //check whether RP or LS Object is present.
&& ((tempObjHeader.getObjClass() == PcepRPObjectVer1.RP_OBJ_CLASS)
- || (tempObjHeader.getObjClass() == PcepTEObjectVer1.TE_OBJ_CLASS))) {
+ || (tempObjHeader.getObjClass() == PcepLSObjectVer1.LS_OBJ_CLASS))) {
this.errInfo = new PcepErrorInfoVer1(null, null, llErrObjList);
this.errInfo.read(cb);
@@ -194,7 +196,7 @@
* @throws PcepParseException if mandatory fields are missing
* @return error object header
*/
- public PcepObjectHeader parseErrorObjectList(LinkedList<PcepErrorObject> llErrObjList, ChannelBuffer cb)
+ public PcepObjectHeader parseErrorObjectList(List<PcepErrorObject> llErrObjList, ChannelBuffer cb)
throws PcepParseException {
PcepObjectHeader tempObjHeader = null;
@@ -337,8 +339,8 @@
*
* @return error types list
*/
- public LinkedList<Integer> getErrorType() {
- LinkedList<Integer> llErrorType = new LinkedList<>();
+ public List<Integer> getErrorType() {
+ List<Integer> llErrorType = new LinkedList<>();
if ((errObjListWithOpen != null)
&& (errObjListWithOpen.isErrorObjListWithOpenPresent())) {
llErrorType = errObjListWithOpen.getErrorType();
@@ -354,8 +356,8 @@
*
* @return error value list
*/
- public LinkedList<Integer> getErrorValue() {
- LinkedList<Integer> llErrorValue = new LinkedList<>();
+ public List<Integer> getErrorValue() {
+ List<Integer> llErrorValue = new LinkedList<>();
if ((errObjListWithOpen != null)
&& (errObjListWithOpen.isErrorObjListWithOpenPresent())) {
llErrorValue = errObjListWithOpen.getErrorValue();
@@ -368,7 +370,7 @@
@Override
public String toString() {
- ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());
+ ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass()).omitNullValues();
if ((errObjListWithOpen != null)
&& (errObjListWithOpen.isErrorObjListWithOpenPresent())) {
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorObjectVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorObjectVer1.java
index 48a337f..f9793f4 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorObjectVer1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorObjectVer1.java
@@ -60,25 +60,25 @@
ERROR_OBJ_MINIMUM_LENGTH);
private PcepObjectHeader errorObjHeader;
- private byte yErrorType;
- private byte yErrorValue;
- private LinkedList<PcepValueType> llOptionalTlv; // Optional TLV
+ private byte errorType;
+ private byte errorValue;
+ private LinkedList<PcepValueType> optionalTlv; // Optional TLV
/**
* Constructor to initialize variables.
*
* @param errorObjHeader ERROR Object header
- * @param yErrorType Error Type
- * @param yErrorValue Error Value
- * @param llOptionalTlv list of optional TLV
+ * @param errorType Error Type
+ * @param errorValue Error Value
+ * @param optionalTlv list of optional TLV
*/
- public PcepErrorObjectVer1(PcepObjectHeader errorObjHeader, byte yErrorType, byte yErrorValue,
- LinkedList<PcepValueType> llOptionalTlv) {
+ public PcepErrorObjectVer1(PcepObjectHeader errorObjHeader, byte errorType, byte errorValue,
+ LinkedList<PcepValueType> optionalTlv) {
this.errorObjHeader = errorObjHeader;
- this.yErrorType = yErrorType;
- this.yErrorValue = yErrorValue;
- this.llOptionalTlv = llOptionalTlv;
+ this.errorType = errorType;
+ this.errorValue = errorValue;
+ this.optionalTlv = optionalTlv;
}
/**
@@ -91,13 +91,13 @@
}
@Override
- public void setErrorType(byte yErrorType) {
- this.yErrorType = yErrorType;
+ public void setErrorType(byte errorType) {
+ this.errorType = errorType;
}
@Override
- public void setErrorValue(byte yErrorValue) {
- this.yErrorValue = yErrorValue;
+ public void setErrorValue(byte errorValue) {
+ this.errorValue = errorValue;
}
/**
@@ -111,22 +111,22 @@
@Override
public int getErrorType() {
- return this.yErrorType;
+ return this.errorType;
}
@Override
public byte getErrorValue() {
- return this.yErrorValue;
+ return this.errorValue;
}
@Override
public LinkedList<PcepValueType> getOptionalTlv() {
- return this.llOptionalTlv;
+ return this.optionalTlv;
}
@Override
- public void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv) {
- this.llOptionalTlv = llOptionalTlv;
+ public void setOptionalTlv(LinkedList<PcepValueType> optionalTlv) {
+ this.optionalTlv = optionalTlv;
}
/**
@@ -138,9 +138,9 @@
public static PcepErrorObject read(ChannelBuffer cb) {
PcepObjectHeader errorObjHeader;
- byte yErrorType;
- byte yErrorValue;
- LinkedList<PcepValueType> llOptionalTlv;
+ byte errorType;
+ byte errorValue;
+ LinkedList<PcepValueType> optionalTlv;
errorObjHeader = PcepObjectHeader.read(cb);
@@ -148,12 +148,12 @@
ChannelBuffer tempCb = cb.readBytes(errorObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
tempCb.readByte(); //ignore Reserved
tempCb.readByte(); //ignore Flags
- yErrorType = tempCb.readByte();
- yErrorValue = tempCb.readByte();
+ errorType = tempCb.readByte();
+ errorValue = tempCb.readByte();
- llOptionalTlv = parseOptionalTlv(tempCb);
+ optionalTlv = parseOptionalTlv(tempCb);
- return new PcepErrorObjectVer1(errorObjHeader, yErrorType, yErrorValue, llOptionalTlv);
+ return new PcepErrorObjectVer1(errorObjHeader, errorType, errorValue, optionalTlv);
}
/**
@@ -189,8 +189,8 @@
//write Flags
cb.writeByte(0);
//write ErrorType and ErrorValue
- cb.writeByte(this.yErrorType);
- cb.writeByte(this.yErrorValue);
+ cb.writeByte(this.errorType);
+ cb.writeByte(this.errorValue);
// Add optional TLV
packOptionalTlv(cb);
@@ -222,7 +222,7 @@
*/
protected int packOptionalTlv(ChannelBuffer cb) {
- ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
+ ListIterator<PcepValueType> listIterator = optionalTlv.listIterator();
int startIndex = cb.writerIndex();
while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next();
@@ -245,8 +245,8 @@
private boolean bIsHeaderSet = false;
private PcepObjectHeader errorObjHeader;
- private byte yErrorType;
- private byte yErrorValue;
+ private byte errorType;
+ private byte errorValue;
private boolean bIsPFlagSet = false;
private boolean bPFlag;
@@ -254,7 +254,7 @@
private boolean bIsIFlagSet = false;
private boolean bIFlag;
- private LinkedList<PcepValueType> llOptionalTlv = new LinkedList<>();
+ private LinkedList<PcepValueType> optionalTlv = new LinkedList<>();
@Override
public PcepErrorObject build() {
@@ -269,7 +269,7 @@
errorObjHeader.setIFlag(bIFlag);
}
- return new PcepErrorObjectVer1(errorObjHeader, yErrorType, yErrorValue, llOptionalTlv);
+ return new PcepErrorObjectVer1(errorObjHeader, errorType, errorValue, optionalTlv);
}
@Override
@@ -286,35 +286,35 @@
@Override
public int getErrorType() {
- return this.yErrorType;
+ return this.errorType;
}
@Override
public Builder setErrorType(byte value) {
- this.yErrorType = value;
+ this.errorType = value;
return this;
}
@Override
public byte getErrorValue() {
- return this.yErrorValue;
+ return this.errorValue;
}
@Override
public Builder setErrorValue(byte value) {
- this.yErrorValue = value;
+ this.errorValue = value;
return this;
}
@Override
- public Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv) {
- this.llOptionalTlv = llOptionalTlv;
+ public Builder setOptionalTlv(LinkedList<PcepValueType> optionalTlv) {
+ this.optionalTlv = optionalTlv;
return this;
}
@Override
public LinkedList<PcepValueType> getOptionalTlv() {
- return this.llOptionalTlv;
+ return this.optionalTlv;
}
@Override
@@ -335,7 +335,7 @@
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
- .add("ObjectHeader", errorObjHeader).add("ErrorType", yErrorType)
- .add("ErrorValue", yErrorValue).add("OptionalTlv", llOptionalTlv).toString();
+ .add("ObjectHeader", errorObjHeader).add("ErrorType", errorType)
+ .add("ErrorValue", errorValue).add("OptionalTlv", optionalTlv).toString();
}
}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorVer1.java
index 0ea5141..1c5bf63 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorVer1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepErrorVer1.java
@@ -16,6 +16,7 @@
package org.onosproject.pcepio.protocol.ver1;
import java.util.LinkedList;
+import java.util.List;
import java.util.ListIterator;
import org.jboss.netty.buffer.ChannelBuffer;
@@ -23,7 +24,7 @@
import org.onosproject.pcepio.protocol.PcepError;
import org.onosproject.pcepio.protocol.PcepErrorObject;
import org.onosproject.pcepio.protocol.PcepRPObject;
-import org.onosproject.pcepio.protocol.PcepTEObject;
+import org.onosproject.pcepio.protocol.PcepLSObject;
import org.onosproject.pcepio.types.PcepObjectHeader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -31,30 +32,30 @@
import com.google.common.base.MoreObjects;
/**
- * Provides PcepError list which contains RP or TE objects.
- * Reference:PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02.
+ * Provides PcepError list which contains RP or LS objects.
+ * Reference: draft-dhodylee-pce-pcep-ls-01, section 8.2.
*/
public class PcepErrorVer1 implements PcepError {
/*
- <error>::=[<request-id-list> | <te-id-list>]
+ <error>::=[<request-id-list> | <ls-id-list>]
<error-obj-list>
<request-id-list>::=<RP>[<request-id-list>]
- <te-id-list>::=<TE>[<te-id-list>]
+ <ls-id-list>::=<LS>[<ls-id-list>]
*/
protected static final Logger log = LoggerFactory.getLogger(PcepErrorVer1.class);
private boolean isErroInfoSet;
//PcepErrorObject list
- private LinkedList<PcepErrorObject> llErrObjList;
+ private List<PcepErrorObject> errObjList;
//PcepRPObject list
- private LinkedList<PcepRPObject> llRPObjList;
- //PcepTEObject list
- private LinkedList<PcepTEObject> llTEObjList;
- private boolean isTEObjListSet;
+ private List<PcepRPObject> rpObjList;
+ //PcepLSObject list
+ private List<PcepLSObject> lsObjList;
+ private boolean isLSObjListSet;
public static final int OBJECT_HEADER_LENGTH = 4;
@@ -62,49 +63,49 @@
* Constructor to initialize variable.
*/
public PcepErrorVer1() {
- this.llRPObjList = null;
- this.llTEObjList = null;
- this.llErrObjList = null;
+ this.rpObjList = null;
+ this.lsObjList = null;
+ this.errObjList = null;
}
/**
* Constructor to initialize variable.
*
- * @param llRPObjList list of PcepRPObject
- * @param llTEObjList list of PcepTEObject
- * @param llErrObjListObjList list of PcepErrorObject
+ * @param rpObjList list of PcepRPObject
+ * @param lsObjList list of PcepLSObject
+ * @param errObjListObjList list of PcepErrorObject
*/
- public PcepErrorVer1(LinkedList<PcepRPObject> llRPObjList, LinkedList<PcepTEObject> llTEObjList,
- LinkedList<PcepErrorObject> llErrObjListObjList) {
- this.llRPObjList = llRPObjList;
- this.llTEObjList = llTEObjList;
- this.llErrObjList = llErrObjListObjList;
+ public PcepErrorVer1(List<PcepRPObject> rpObjList, List<PcepLSObject> lsObjList,
+ List<PcepErrorObject> errObjListObjList) {
+ this.rpObjList = rpObjList;
+ this.lsObjList = lsObjList;
+ this.errObjList = errObjListObjList;
}
/**
* Constructor to initialize PcepError.
*
- * @param llErrObjList list of PcepErrorObject
+ * @param errObjList list of PcepErrorObject
*/
- public PcepErrorVer1(LinkedList<PcepErrorObject> llErrObjList) {
- this.llRPObjList = null;
- this.llTEObjList = null;
- this.llErrObjList = llErrObjList;
+ public PcepErrorVer1(List<PcepErrorObject> errObjList) {
+ this.rpObjList = null;
+ this.lsObjList = null;
+ this.errObjList = errObjList;
}
@Override
- public LinkedList<PcepRPObject> getRPObjList() {
- return this.llRPObjList;
+ public List<PcepRPObject> getRPObjList() {
+ return this.rpObjList;
}
@Override
- public LinkedList<PcepTEObject> getTEObjList() {
- return this.llTEObjList;
+ public List<PcepLSObject> getLSObjList() {
+ return this.lsObjList;
}
@Override
- public LinkedList<PcepErrorObject> getErrorObjList() {
- return this.llErrObjList;
+ public List<PcepErrorObject> getErrorObjList() {
+ return this.errObjList;
}
/**
@@ -117,7 +118,7 @@
byte yObjClass;
byte yObjType;
- llRPObjList = new LinkedList<>();
+ rpObjList = new LinkedList<>();
// caller should verify for RP object
if (cb.readableBytes() < OBJECT_HEADER_LENGTH) {
@@ -133,7 +134,7 @@
PcepRPObject rpObj;
while ((yObjClass == PcepRPObjectVer1.RP_OBJ_CLASS) && (yObjType == PcepRPObjectVer1.RP_OBJ_TYPE)) {
rpObj = PcepRPObjectVer1.read(cb);
- llRPObjList.add(rpObj);
+ rpObjList.add(rpObj);
if (cb.readableBytes() > OBJECT_HEADER_LENGTH) {
cb.markReaderIndex();
@@ -148,20 +149,20 @@
}
/**
- * Parse TE List from the channel buffer.
+ * Parse LS List from the channel buffer.
*
* @param cb of type channel buffer
* @throws PcepParseException if mandatory fields are missing
*/
- public void parseTEList(ChannelBuffer cb) throws PcepParseException {
+ public void parseLSList(ChannelBuffer cb) throws PcepParseException {
byte yObjClass;
byte yObjType;
- llTEObjList = new LinkedList<>();
+ lsObjList = new LinkedList<>();
- // caller should verify for TE object
+ // caller should verify for LS object
if (cb.readableBytes() < OBJECT_HEADER_LENGTH) {
- log.debug("Unable to find TE Object");
+ log.debug("Unable to find LS Object");
return;
}
@@ -170,11 +171,11 @@
cb.resetReaderIndex();
yObjClass = tempObjHeader.getObjClass();
yObjType = tempObjHeader.getObjType();
- PcepTEObject teObj;
- while ((yObjClass == PcepTEObjectVer1.TE_OBJ_CLASS) && ((yObjType == PcepTEObjectVer1.TE_OBJ_TYPE_NODE_VALUE)
- || (yObjType == PcepTEObjectVer1.TE_OBJ_TYPE_LINK_VALUE))) {
- teObj = PcepTEObjectVer1.read(cb);
- llTEObjList.add(teObj);
+ PcepLSObject lsObj;
+ while ((yObjClass == PcepLSObjectVer1.LS_OBJ_CLASS) && ((yObjType == PcepLSObjectVer1.LS_OBJ_TYPE_NODE_VALUE)
+ || (yObjType == PcepLSObjectVer1.LS_OBJ_TYPE_LINK_VALUE))) {
+ lsObj = PcepLSObjectVer1.read(cb);
+ lsObjList.add(lsObj);
if (cb.readableBytes() > OBJECT_HEADER_LENGTH) {
cb.markReaderIndex();
@@ -199,7 +200,7 @@
byte yObjType;
boolean bIsErrorObjFound = false;
- llErrObjList = new LinkedList<>();
+ errObjList = new LinkedList<>();
// caller should verify for RP object
if (cb.readableBytes() < OBJECT_HEADER_LENGTH) {
@@ -214,7 +215,7 @@
PcepErrorObject errorObject;
while ((yObjClass == PcepErrorObjectVer1.ERROR_OBJ_CLASS) && (yObjType == PcepErrorObjectVer1.ERROR_OBJ_TYPE)) {
errorObject = PcepErrorObjectVer1.read(cb);
- llErrObjList.add(errorObject);
+ errObjList.add(errorObject);
bIsErrorObjFound = true;
if (cb.readableBytes() > OBJECT_HEADER_LENGTH) {
@@ -252,14 +253,14 @@
cb.resetReaderIndex();
byte yObjClass = tempObjHeader.getObjClass();
- //If RPlist present then store it.RPList and TEList are optional
+ //If RPlist present then store it.RPList and LSList are optional
if (yObjClass == PcepRPObjectVer1.RP_OBJ_CLASS) {
log.debug("RP_LIST");
pcepError.parseRPList(cb);
yObjClass = checkNextObject(cb);
- } else if (yObjClass == PcepTEObjectVer1.TE_OBJ_CLASS) {
- log.debug("TE_LIST");
- pcepError.parseTEList(cb);
+ } else if (yObjClass == PcepLSObjectVer1.LS_OBJ_CLASS) {
+ log.debug("LS_LIST");
+ pcepError.parseLSList(cb);
yObjClass = checkNextObject(cb);
}
@@ -301,21 +302,21 @@
// RPlist is optional
if (this.isErroInfoSet) {
- ListIterator<PcepRPObject> rpObjlistIterator = this.llRPObjList.listIterator();
+ ListIterator<PcepRPObject> rpObjlistIterator = this.rpObjList.listIterator();
while (rpObjlistIterator.hasNext()) {
rpObjlistIterator.next().write(cb);
}
}
- // TElist is optional
- if (this.isTEObjListSet) {
- ListIterator<PcepTEObject> teObjlistIterator = this.llTEObjList.listIterator();
+ // LSlist is optional
+ if (this.isLSObjListSet) {
+ ListIterator<PcepLSObject> teObjlistIterator = this.lsObjList.listIterator();
while (teObjlistIterator.hasNext()) {
teObjlistIterator.next().write(cb);
}
}
//ErrList is mandatory
- ListIterator<PcepErrorObject> errlistIterator = this.llErrObjList.listIterator();
+ ListIterator<PcepErrorObject> errlistIterator = this.errObjList.listIterator();
while (errlistIterator.hasNext()) {
errlistIterator.next().write(cb);
}
@@ -328,72 +329,72 @@
*/
public static class Builder implements PcepError.Builder {
- private LinkedList<PcepRPObject> llRPObjList;
- private LinkedList<PcepTEObject> llTEObjList;
- private LinkedList<PcepErrorObject> llErrObjList;
+ private List<PcepRPObject> rpObjList;
+ private List<PcepLSObject> lsObjList;
+ private List<PcepErrorObject> errObjList;
@Override
public PcepError build() {
- return new PcepErrorVer1(llRPObjList, llTEObjList, llErrObjList);
+ return new PcepErrorVer1(rpObjList, lsObjList, errObjList);
}
@Override
- public LinkedList<PcepRPObject> getRPObjList() {
- return this.llRPObjList;
+ public List<PcepRPObject> getRPObjList() {
+ return this.rpObjList;
}
@Override
- public Builder setRPObjList(LinkedList<PcepRPObject> llRPObjList) {
- this.llRPObjList = llRPObjList;
+ public Builder setRPObjList(List<PcepRPObject> rpObjList) {
+ this.rpObjList = rpObjList;
return this;
}
@Override
- public LinkedList<PcepTEObject> getTEObjList() {
- return this.llTEObjList;
+ public List<PcepLSObject> getLSObjList() {
+ return this.lsObjList;
}
@Override
- public Builder setTEObjList(LinkedList<PcepTEObject> llTEObjList) {
- this.llTEObjList = llTEObjList;
+ public Builder setLSObjList(List<PcepLSObject> lsObjList) {
+ this.lsObjList = lsObjList;
return this;
}
@Override
- public LinkedList<PcepErrorObject> getErrorObjList() {
- return this.llErrObjList;
+ public List<PcepErrorObject> getErrorObjList() {
+ return this.errObjList;
}
@Override
- public Builder setErrorObjList(LinkedList<PcepErrorObject> llErrObjList) {
- this.llErrObjList = llErrObjList;
+ public Builder setErrorObjList(List<PcepErrorObject> errObjList) {
+ this.errObjList = errObjList;
return this;
}
}
@Override
- public void setRPObjList(LinkedList<PcepRPObject> llRPObjList) {
- this.llRPObjList = llRPObjList;
+ public void setRPObjList(List<PcepRPObject> rpObjList) {
+ this.rpObjList = rpObjList;
}
@Override
- public void setTEObjList(LinkedList<PcepTEObject> llTEObjList) {
- this.llTEObjList = llTEObjList;
+ public void setLSObjList(List<PcepLSObject> lsObjList) {
+ this.lsObjList = lsObjList;
}
@Override
- public void setErrorObjList(LinkedList<PcepErrorObject> llErrObjList) {
- this.llErrObjList = llErrObjList;
+ public void setErrorObjList(List<PcepErrorObject> errObjList) {
+ this.errObjList = errObjList;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.omitNullValues()
- .add("RpObjectList", llRPObjList)
- .add("TeObjectList", llTEObjList)
- .add("ErrorObjectList", llErrObjList)
+ .add("RpObjectList", rpObjList)
+ .add("LsObjectList", lsObjList)
+ .add("ErrorObjectList", errObjList)
.toString();
}
}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv4AdjacencyVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv4AdjacencyVer1.java
index 51c672d..0a2a6ea 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv4AdjacencyVer1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv4AdjacencyVer1.java
@@ -47,12 +47,12 @@
protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv4AdjacencyVer1.class);
public static final byte FEC_OBJ_TYPE = 3;
- public static final byte FEC_OBJ_CLASS = 36; //to be defined
+ public static final byte FEC_OBJ_CLASS = (byte) 226;
public static final byte FEC_OBJECT_VERSION = 1;
public static final short FEC_OBJ_MINIMUM_LENGTH = 12;
public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
- static final PcepObjectHeader DEFAULT_FEC_OBJECT_HEADER = new PcepObjectHeader(FEC_OBJ_CLASS, FEC_OBJ_TYPE,
+ public static final PcepObjectHeader DEFAULT_FEC_OBJECT_HEADER = new PcepObjectHeader(FEC_OBJ_CLASS, FEC_OBJ_TYPE,
PcepObjectHeader.REQ_OBJ_OPTIONAL_PROCESS, PcepObjectHeader.RSP_OBJ_PROCESSED, FEC_OBJ_MINIMUM_LENGTH);
private PcepObjectHeader fecObjHeader;
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv4UnnumberedAdjacencyVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv4UnnumberedAdjacencyVer1.java
index f2f54cd..d8c9d8f 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv4UnnumberedAdjacencyVer1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv4UnnumberedAdjacencyVer1.java
@@ -51,7 +51,7 @@
protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv4UnnumberedAdjacencyVer1.class);
public static final byte FEC_OBJ_TYPE = 5;
- public static final byte FEC_OBJ_CLASS = 63; //to be defined
+ public static final byte FEC_OBJ_CLASS = (byte) 226;
public static final byte FEC_OBJECT_VERSION = 1;
public static final short FEC_OBJ_MINIMUM_LENGTH = 20;
public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv4Ver1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv4Ver1.java
index 354547a..25fc459 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv4Ver1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv4Ver1.java
@@ -45,7 +45,7 @@
protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv4Ver1.class);
public static final byte FEC_OBJ_TYPE = 1;
- public static final byte FEC_OBJ_CLASS = 63; //to be defined
+ public static final byte FEC_OBJ_CLASS = (byte) 226;
public static final byte FEC_OBJECT_VERSION = 1;
public static final short FEC_OBJ_MINIMUM_LENGTH = 8;
public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv6AdjacencyVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv6AdjacencyVer1.java
index f8ea786..a58bc9b 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv6AdjacencyVer1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv6AdjacencyVer1.java
@@ -51,7 +51,7 @@
protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv6AdjacencyVer1.class);
public static final byte FEC_OBJ_TYPE = 4;
- public static final byte FEC_OBJ_CLASS = 63; //to be defined
+ public static final byte FEC_OBJ_CLASS = (byte) 226;
public static final byte FEC_OBJECT_VERSION = 1;
public static final short FEC_OBJ_MINIMUM_LENGTH = 36;
public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv6Ver1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv6Ver1.java
index 240a96f..59d09b6 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv6Ver1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepFecObjectIPv6Ver1.java
@@ -47,7 +47,7 @@
protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv6Ver1.class);
public static final byte FEC_OBJ_TYPE = 2;
- public static final byte FEC_OBJ_CLASS = 63; //to be defined
+ public static final byte FEC_OBJ_CLASS = (byte) 226;
public static final byte FEC_OBJECT_VERSION = 1;
public static final short FEC_OBJ_MINIMUM_LENGTH = 20;
public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLSObjectVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLSObjectVer1.java
new file mode 100644
index 0000000..d90c848
--- /dev/null
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLSObjectVer1.java
@@ -0,0 +1,510 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.pcepio.protocol.ver1;
+
+import java.util.List;
+import java.util.LinkedList;
+import java.util.ListIterator;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepLSObject;
+import org.onosproject.pcepio.types.LocalNodeDescriptorsTlv;
+import org.onosproject.pcepio.types.PcepObjectHeader;
+import org.onosproject.pcepio.types.PcepValueType;
+import org.onosproject.pcepio.types.RemoteNodeDescriptorsTlv;
+import org.onosproject.pcepio.types.RoutingUniverseTlv;
+import org.onosproject.pcepio.types.LinkAttributesTlv;
+import org.onosproject.pcepio.types.LinkDescriptorsTlv;
+import org.onosproject.pcepio.types.NodeAttributesTlv;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Provides PCEP LS (link-state) object.
+ */
+public class PcepLSObjectVer1 implements PcepLSObject {
+ /*
+ *
+ reference: draft-dhodylee-pce-pcep-ls-01, section 9.2.
+
+ Two Object-Type values are defined for the LS object:
+
+ o LS Node: LS Object-Type is 1.
+
+ o LS Link: LS Object-Type is 2.
+
+ o LS IPv4 Topology Prefix: LS Object-Type is 3.
+
+ o LS IPv6 Topology Prefix: LS Object-Type is 4.
+
+ The format of the LS object body is as follows:
+
+ 0 1 2 3
+ 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
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Protocol-ID | Flag |R|S|
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | LS-ID |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // TLVs //
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+
+ protected static final Logger log = LoggerFactory.getLogger(PcepLSObjectVer1.class);
+
+ public static final byte LS_OBJ_TYPE_NODE_VALUE = 1;
+ public static final byte LS_OBJ_TYPE_LINK_VALUE = 2;
+
+ public static final byte LS_OBJ_CLASS = (byte) 224;
+ public static final byte LS_OBJECT_VERSION = 1;
+
+ // LS_OBJ_MINIMUM_LENGTH = LSObjectHeaderLen(4) + LSObjectLen(8)
+ public static final short LS_OBJ_MINIMUM_LENGTH = 12;
+
+ // Signaled, all default values to be checked.
+ public static final byte DEFAULT_PROTOCOL_ID = 1; //IS-IS Level 1
+ public static final boolean DEFAULT_R_FLAG = false;
+ public static final boolean DEFAULT_S_FLAG = false;
+ public static final int DEFAULT_LS_ID = 0;
+
+ public static final int OBJECT_HEADER_LENGTH = 4;
+ public static final int RIGHT_SHIFT_ONE = 1;
+ public static final int RIGHT_FIRST_FLAG = 0x1;
+ public static final int FLAG_SET_R_FLAG = 0x2;
+ public static final int FLAG_SET_S_FLAG = 0x1;
+ public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
+ public static final int MINIMUM_TLV_HEADER_LENGTH = 4;
+
+ public static final PcepObjectHeader DEFAULT_LS_OBJECT_HEADER = new PcepObjectHeader(LS_OBJ_CLASS,
+ LS_OBJ_TYPE_NODE_VALUE, PcepObjectHeader.REQ_OBJ_OPTIONAL_PROCESS, PcepObjectHeader.RSP_OBJ_PROCESSED,
+ LS_OBJ_MINIMUM_LENGTH);
+
+ private PcepObjectHeader lsObjHeader;
+ private byte protocolId;
+ // 2-flags
+ private boolean removeFlag;
+ private boolean syncFlag;
+ private long lsId; //link-state identifier
+ // Optional TLV
+ private List<PcepValueType> optionalTlvList;
+
+ /**
+ * Constructor to initialize variables.
+ *
+ * @param lsObjHeader LS Object header
+ * @param protocolId Protocol-ID
+ * @param removeFlag R-flag
+ * @param syncFlag S-flag
+ * @param lsId LS-ID
+ * @param optionalTlvList linked list of Optional TLV
+ */
+ public PcepLSObjectVer1(PcepObjectHeader lsObjHeader, byte protocolId, boolean removeFlag,
+ boolean syncFlag, long lsId, List<PcepValueType> optionalTlvList) {
+
+ this.lsObjHeader = lsObjHeader;
+ this.protocolId = protocolId;
+ this.removeFlag = removeFlag;
+ this.syncFlag = syncFlag;
+ this.lsId = lsId;
+ this.optionalTlvList = optionalTlvList;
+ }
+
+ @Override
+ public PcepObjectHeader getLSObjHeader() {
+ return this.lsObjHeader;
+ }
+
+ @Override
+ public void setLSObjHeader(PcepObjectHeader obj) {
+ this.lsObjHeader = obj;
+ }
+
+ @Override
+ public byte getProtocolId() {
+ return this.protocolId;
+ }
+
+ @Override
+ public void setProtocolId(byte protId) {
+ this.protocolId = protId;
+ }
+
+ @Override
+ public boolean getRemoveFlag() {
+ return this.removeFlag;
+ }
+
+ @Override
+ public void setRemoveFlag(boolean removeFlag) {
+ this.removeFlag = removeFlag;
+ }
+
+ @Override
+ public boolean getSyncFlag() {
+ return this.syncFlag;
+ }
+
+ @Override
+ public void setSyncFlag(boolean syncFlag) {
+ this.syncFlag = syncFlag;
+ }
+
+ @Override
+ public long getLSId() {
+ return this.lsId;
+ }
+
+ @Override
+ public void setLSId(long lsId) {
+ this.lsId = lsId;
+ }
+
+ @Override
+ public List<PcepValueType> getOptionalTlv() {
+ return this.optionalTlvList;
+ }
+
+ @Override
+ public void setOptionalTlv(List<PcepValueType> optionalTlvList) {
+ this.optionalTlvList = optionalTlvList;
+ }
+
+ /**
+ * Reads from the channel buffer and returns Object of PcepLSObject.
+ *
+ * @param cb of type channel buffer
+ * @return Object of PcepLSObject
+ * @throws PcepParseException if mandatory fields are missing
+ */
+ public static PcepLSObject read(ChannelBuffer cb) throws PcepParseException {
+ log.debug("read");
+
+ PcepObjectHeader lsObjHeader;
+ byte protocolId;
+ // 2-flags
+ boolean removeFlag;
+ boolean syncFlag;
+ long lsId;
+ List<PcepValueType> optionalTlvList;
+
+ lsObjHeader = PcepObjectHeader.read(cb);
+
+ //take only LSObject buffer.
+ ChannelBuffer tempCb = cb.readBytes(lsObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
+
+ protocolId = tempCb.readByte();
+ //ignore first two bytes of Flags
+ tempCb.readShort();
+
+ Integer iTemp = (int) tempCb.readByte(); //read 3rd byte Flag
+ syncFlag = (iTemp & FLAG_SET_S_FLAG) == FLAG_SET_S_FLAG;
+ removeFlag = (iTemp & FLAG_SET_R_FLAG) == FLAG_SET_R_FLAG;
+
+ lsId = tempCb.readLong();
+
+ // parse optional TLV
+ optionalTlvList = parseOptionalTlv(tempCb);
+
+ return new PcepLSObjectVer1(lsObjHeader, protocolId, removeFlag, syncFlag, lsId, optionalTlvList);
+ }
+
+ @Override
+ public int write(ChannelBuffer cb) throws PcepParseException {
+
+ //write Object header
+ int objStartIndex = cb.writerIndex();
+ int objLenIndex = lsObjHeader.write(cb);
+
+ if (objLenIndex <= 0) {
+ throw new PcepParseException("ObjectLength Index is " + objLenIndex);
+ }
+
+ //write Protocol ID
+ cb.writeByte(this.protocolId);
+
+ //write Flag
+ cb.writeShort(0);
+
+ byte bTemp = 0;
+ if (syncFlag) {
+ bTemp = FLAG_SET_S_FLAG;
+ }
+
+ if (removeFlag) {
+ bTemp = (byte) (bTemp | FLAG_SET_R_FLAG);
+ }
+ cb.writeByte(bTemp);
+
+ //write LSId
+ cb.writeLong(lsId);
+
+ // Add optional TLV
+ packOptionalTlv(cb);
+
+ //Update object length now
+ int length = cb.writerIndex() - objStartIndex;
+
+ //will be helpful during print().
+ lsObjHeader.setObjLen((short) length);
+
+ cb.setShort(objLenIndex, (short) length);
+
+ return cb.writerIndex();
+ }
+
+ /**
+ * Returns Linked list of PCEP Value Type.
+ *
+ * @param cb of channel buffer
+ * @return Linked list of PCEP Value Type
+ * @throws PcepParseException if mandatory fields are missing
+ */
+ protected static List<PcepValueType> parseOptionalTlv(ChannelBuffer cb) throws PcepParseException {
+
+ List<PcepValueType> llOutOptionalTlv;
+
+ llOutOptionalTlv = new LinkedList<>();
+
+ while (MINIMUM_TLV_HEADER_LENGTH <= cb.readableBytes()) {
+
+ PcepValueType tlv;
+ short hType = cb.readShort();
+ short hLength = cb.readShort();
+ long lValue = 0;
+
+ switch (hType) {
+
+ case RoutingUniverseTlv.TYPE:
+ lValue = cb.readLong();
+ tlv = new RoutingUniverseTlv(lValue);
+ break;
+ case LocalNodeDescriptorsTlv.TYPE:
+ tlv = LocalNodeDescriptorsTlv.read(cb, hLength);
+ break;
+ case RemoteNodeDescriptorsTlv.TYPE:
+ tlv = RemoteNodeDescriptorsTlv.read(cb, hLength);
+ break;
+ case LinkDescriptorsTlv.TYPE:
+ tlv = LinkDescriptorsTlv.read(cb, hLength);
+ break;
+ case NodeAttributesTlv.TYPE:
+ tlv = NodeAttributesTlv.read(cb, hLength);
+ break;
+ case LinkAttributesTlv.TYPE:
+ tlv = LinkAttributesTlv.read(cb, hLength);
+ break;
+ default:
+ throw new PcepParseException("Unsupported TLV type :" + hType);
+ }
+
+ // Check for the padding
+ int pad = hLength % 4;
+ if (0 < pad) {
+ pad = 4 - pad;
+ if (pad <= cb.readableBytes()) {
+ cb.skipBytes(pad);
+ }
+ }
+
+ llOutOptionalTlv.add(tlv);
+ }
+
+ if (0 < cb.readableBytes()) {
+
+ throw new PcepParseException("Optional Tlv parsing error. Extra bytes received.");
+ }
+ return llOutOptionalTlv;
+ }
+
+ /**
+ * Returns the writer index.
+ *
+ * @param cb of type channel buffer
+ * @return the writer index.
+ */
+ protected int packOptionalTlv(ChannelBuffer cb) {
+
+ ListIterator<PcepValueType> listIterator = optionalTlvList.listIterator();
+
+ while (listIterator.hasNext()) {
+ PcepValueType tlv = listIterator.next();
+
+ if (tlv == null) {
+ log.debug("TLV is null from OptionalTlv list");
+ continue;
+ }
+ tlv.write(cb);
+
+ // need to take care of padding
+ int pad = tlv.getLength() % 4;
+
+ if (0 != pad) {
+ pad = 4 - pad;
+ for (int i = 0; i < pad; ++i) {
+ cb.writeByte((byte) 0);
+ }
+ }
+ }
+ return cb.writerIndex();
+ }
+
+ /**
+ * Builder class for PCEP LS (link-state) object.
+ */
+ public static class Builder implements PcepLSObject.Builder {
+ private boolean isHeaderSet = false;
+ private boolean isProtocolIdSet = false;
+ private boolean isRemoveFlagSet = false;
+ private boolean isSyncFlagSet = false;
+ private boolean isLSIdSet = false;
+
+ private PcepObjectHeader lsObjHeader;
+ private byte protocolId;
+ private boolean removeFlag;
+ private boolean syncFlag;
+ private long lsId;
+ private List<PcepValueType> optionalTlvList = new LinkedList<>();
+
+ private boolean isProcRuleFlagSet = false;
+ private boolean procRuleFlag; //Processing rule flag
+
+ private boolean isIgnoreFlagSet = false;
+ private boolean ignoreFlag;
+
+ @Override
+ public PcepLSObject build() {
+ PcepObjectHeader lsObjHeader = this.isHeaderSet ? this.lsObjHeader : DEFAULT_LS_OBJECT_HEADER;
+
+ byte protocolId = this.isProtocolIdSet ? this.protocolId : DEFAULT_PROTOCOL_ID;
+ boolean removeFlag = this.isRemoveFlagSet ? this.removeFlag : DEFAULT_R_FLAG;
+ boolean syncFlag = this.isSyncFlagSet ? this.syncFlag : DEFAULT_S_FLAG;
+ long lsId = this.isLSIdSet ? this.lsId : DEFAULT_LS_ID;
+
+ if (isProcRuleFlagSet) {
+ lsObjHeader.setPFlag(procRuleFlag);
+ }
+
+ if (isIgnoreFlagSet) {
+ lsObjHeader.setIFlag(ignoreFlag);
+ }
+
+ return new PcepLSObjectVer1(lsObjHeader, protocolId, removeFlag, syncFlag, lsId, optionalTlvList);
+
+ }
+
+ @Override
+ public PcepObjectHeader getLSObjHeader() {
+ return this.lsObjHeader;
+ }
+
+ @Override
+ public Builder setLSObjHeader(PcepObjectHeader obj) {
+ this.lsObjHeader = obj;
+ this.isHeaderSet = true;
+ return this;
+ }
+
+ @Override
+ public byte getProtocolId() {
+ return this.protocolId;
+ }
+
+ @Override
+ public Builder setProtocolId(byte protId) {
+ this.protocolId = protId;
+ this.isProtocolIdSet = true;
+ return this;
+ }
+
+ @Override
+ public boolean getRemoveFlag() {
+ return this.removeFlag;
+ }
+
+ @Override
+ public Builder setRemoveFlag(boolean removeFlag) {
+ this.removeFlag = removeFlag;
+ this.isRemoveFlagSet = true;
+ return this;
+ }
+
+ @Override
+ public boolean getSyncFlag() {
+ return this.syncFlag;
+ }
+
+ @Override
+ public Builder setSyncFlag(boolean syncFlag) {
+ this.syncFlag = syncFlag;
+ this.isSyncFlagSet = true;
+ return this;
+ }
+
+ @Override
+ public long getLSId() {
+ return this.lsId;
+ }
+
+ @Override
+ public Builder setLSId(long lsId) {
+ this.lsId = lsId;
+ this.isLSIdSet = true;
+ return this;
+ }
+
+ @Override
+ public List<PcepValueType> getOptionalTlv() {
+ return this.optionalTlvList;
+ }
+
+ @Override
+ public Builder setOptionalTlv(List<PcepValueType> optionalTlvList) {
+ this.optionalTlvList = optionalTlvList;
+ return this;
+ }
+
+ @Override
+ public Builder setPFlag(boolean value) {
+ this.procRuleFlag = value;
+ this.isProcRuleFlagSet = true;
+ return this;
+ }
+
+ @Override
+ public Builder setIFlag(boolean value) {
+ this.ignoreFlag = value;
+ this.isIgnoreFlagSet = true;
+ return this;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(getClass()).omitNullValues()
+ .add("ObjectHeader", lsObjHeader)
+ .add("ProtocolId", protocolId)
+ .add("RFlag", (removeFlag) ? 1 : 0)
+ .add("SFlag", (syncFlag) ? 1 : 0)
+ .add("LsId", lsId)
+ .add("OptionalTlv", optionalTlvList).toString();
+ }
+}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLSReportMsgVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLSReportMsgVer1.java
new file mode 100644
index 0000000..9c4ec45
--- /dev/null
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLSReportMsgVer1.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.pcepio.protocol.ver1;
+
+import java.util.List;
+import java.util.LinkedList;
+import java.util.ListIterator;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepMessageReader;
+import org.onosproject.pcepio.protocol.PcepMessageWriter;
+import org.onosproject.pcepio.protocol.PcepLSObject;
+import org.onosproject.pcepio.protocol.PcepLSReportMsg;
+import org.onosproject.pcepio.protocol.PcepType;
+import org.onosproject.pcepio.protocol.PcepVersion;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Provides PCEP LS (link-state) Report Message.
+ */
+class PcepLSReportMsgVer1 implements PcepLSReportMsg {
+
+ /*
+ * Ref : draft-dhodylee-pce-pcep-ls-01, section 8.1
+
+ <LSRpt Message> ::= <Common Header>
+ <ls-report-list>
+ Where:
+ <ls-report-list> ::= <LS>[<ls-report-list>]
+ */
+
+ private static final Logger log = LoggerFactory.getLogger(PcepLSReportMsgVer1.class);
+ //PACKET_MINIMUM_LENGTH = CommonHeaderLen(4)+LSObjMinLen(12)
+ public static final int PACKET_MINIMUM_LENGTH = 16;
+ public static final PcepType MSG_TYPE = PcepType.LS_REPORT;
+ // <ls-report-list>
+ private List<PcepLSObject> lsReportList;
+
+ public static final PcepLSReportMsgVer1.Reader READER = new Reader();
+
+ /**
+ * Reader class for reading PCEP LS-Report message form channel buffer.
+ */
+ static class Reader implements PcepMessageReader<PcepLSReportMsg> {
+
+ List<PcepLSObject> lsReportList;
+
+ @Override
+ public PcepLSReportMsg readFrom(ChannelBuffer cb) throws PcepParseException {
+
+ if (cb.readableBytes() < PACKET_MINIMUM_LENGTH) {
+ return null;
+ }
+
+ lsReportList = new LinkedList<>();
+
+ byte version = cb.readByte();
+ version = (byte) (version >> PcepMessageVer1.SHIFT_FLAG);
+ if (version != PcepMessageVer1.PACKET_VERSION) {
+ throw new PcepParseException("Wrong version. Expected=PcepVersion.PCEP_1(1), got=" + version);
+ }
+
+ byte type = cb.readByte();
+ if (type != MSG_TYPE.getType()) {
+ throw new PcepParseException("Wrong type. Expected=PcepType.LS_REPORT(224), got=" + type);
+ }
+
+ short length = cb.readShort();
+ if (length < PACKET_MINIMUM_LENGTH) {
+ throw new PcepParseException(
+ "Wrong length. Expected to be >= " + PACKET_MINIMUM_LENGTH + ", is: " + length);
+ }
+
+ // Parse <ls-report-list>
+ parseLSReportList(cb);
+
+ return new PcepLSReportMsgVer1(lsReportList);
+ }
+
+ /**
+ * Parse ls-report-list.
+ *
+ * @param cb input Channel Buffer
+ * @throws PcepParseException when fails to parse LS-Report list.
+ */
+ public void parseLSReportList(ChannelBuffer cb) throws PcepParseException {
+ // <ls-report-list> ::= <LS>[<ls-report-list>]
+
+ while (0 < cb.readableBytes()) {
+ //store LS objects
+ if (!lsReportList.add(PcepLSObjectVer1.read(cb))) {
+ throw new PcepParseException("Failed to add LS object to LS-Report list");
+ }
+ }
+ }
+ }
+
+ /**
+ * Constructor to initialize LS-Report list.
+ *
+ * @param lsReportList list of PCEP LS Object
+ */
+ PcepLSReportMsgVer1(List<PcepLSObject> lsReportList) {
+ this.lsReportList = lsReportList;
+ }
+
+ /**
+ * Builder class for PCEP LS-Report message.
+ */
+ static class Builder implements PcepLSReportMsg.Builder {
+ // PCEP LS Report message fields
+ List<PcepLSObject> lsReportList;
+
+ @Override
+ public PcepVersion getVersion() {
+ return PcepVersion.PCEP_1;
+ }
+
+ @Override
+ public PcepType getType() {
+ return PcepType.LS_REPORT;
+ }
+
+ @Override
+ public PcepLSReportMsg build() {
+ return new PcepLSReportMsgVer1(this.lsReportList);
+ }
+
+ @Override
+ public List<PcepLSObject> getLSReportList() {
+ return this.lsReportList;
+ }
+
+ @Override
+ public Builder setLSReportList(List<PcepLSObject> ll) {
+ this.lsReportList = ll;
+ return this;
+ }
+ }
+
+ @Override
+ public void writeTo(ChannelBuffer bb) throws PcepParseException {
+ WRITER.write(bb, this);
+ }
+
+ static final Writer WRITER = new Writer();
+
+ /**
+ * Writer class for writing PCEP LS-Report message to channel buffer.
+ */
+ static class Writer implements PcepMessageWriter<PcepLSReportMsgVer1> {
+
+ @Override
+ public void write(ChannelBuffer bb, PcepLSReportMsgVer1 message) throws PcepParseException {
+
+ int startIndex = bb.writerIndex();
+
+ // first 3 bits set to version
+ bb.writeByte((byte) (PcepMessageVer1.PACKET_VERSION << PcepMessageVer1.SHIFT_FLAG));
+
+ // message type
+ bb.writeByte(MSG_TYPE.getType());
+
+ // Length of the message will be updated at the end
+ // First write with 0s
+ int msgLenIndex = bb.writerIndex();
+ bb.writeShort((short) 0);
+
+ ListIterator<PcepLSObject> listIterator = message.lsReportList.listIterator();
+
+ while (listIterator.hasNext()) {
+ PcepLSObject lsObj = listIterator.next();
+ lsObj.write(bb);
+ }
+
+ // update message length field
+ int length = bb.writerIndex() - startIndex;
+ bb.setShort(msgLenIndex, (short) length);
+ }
+ }
+
+ @Override
+ public PcepVersion getVersion() {
+ return PcepVersion.PCEP_1;
+ }
+
+ @Override
+ public PcepType getType() {
+ return MSG_TYPE;
+ }
+
+ @Override
+ public List<PcepLSObject> getLSReportList() {
+ return this.lsReportList;
+ }
+
+ @Override
+ public void setLSReportList(List<PcepLSObject> ll) {
+ this.lsReportList = ll;
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(getClass())
+ .add("LSReportList", lsReportList)
+ .toString();
+ }
+}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLabelObjectVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLabelObjectVer1.java
index a4ac87c..0c76894 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLabelObjectVer1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLabelObjectVer1.java
@@ -56,7 +56,7 @@
protected static final Logger log = LoggerFactory.getLogger(PcepLspObjectVer1.class);
public static final byte LABEL_OBJ_TYPE = 1;
- public static final byte LABEL_OBJ_CLASS = 35; //TBD : to be defined
+ public static final byte LABEL_OBJ_CLASS = (byte) 225;
public static final byte LABEL_OBJECT_VERSION = 1;
public static final byte OBJECT_HEADER_LENGTH = 4;
public static final boolean DEFAULT_OFLAG = false;
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepMessageVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepMessageVer1.java
index 2169a67..5e4db6c 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepMessageVer1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepMessageVer1.java
@@ -17,10 +17,12 @@
package org.onosproject.pcepio.protocol.ver1;
import org.jboss.netty.buffer.ChannelBuffer;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.protocol.PcepFactories;
import org.onosproject.pcepio.protocol.PcepMessage;
import org.onosproject.pcepio.protocol.PcepMessageReader;
+import org.onosproject.pcepio.protocol.PcepType;
import org.onosproject.pcepio.types.PcepErrorDetailInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -33,21 +35,11 @@
protected static final Logger log = LoggerFactory.getLogger(PcepFactories.class);
// version: 1.0
- static final byte WIRE_VERSION = 1;
- static final int MINIMUM_LENGTH = 4;
- static final int PACKET_VERSION = 1;
- static final byte OPEN_MSG_TYPE = 0x1;
- static final byte KEEPALIVE_MSG_TYPE = 0x2;
- static final byte REPORT_MSG_TYPE = 0xa;
- static final byte TE_REPORT_MSG_TYPE = 0xe;
- static final byte UPDATE_MSG_TYPE = 0xb;
- static final byte INITIATE_MSG_TYPE = 0xc;
- static final byte CLOSE_MSG_TYPE = 0x7;
- static final byte ERROR_MSG_TYPE = 0x6;
- static final byte LABEL_UPDATE_MSG_TYPE = 0xD;
- static final byte LABEL_RANGE_RESV_MSG_TYPE = 0xF;
+ public static final byte WIRE_VERSION = 1;
+ public static final int MINIMUM_LENGTH = 4;
+ public static final int PACKET_VERSION = 1;
public static final int SHIFT_FLAG = 5;
- static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
+ public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
public static final PcepMessageVer1.Reader READER = new Reader();
@@ -56,7 +48,7 @@
*/
static class Reader implements PcepMessageReader<PcepMessage> {
@Override
- public PcepMessage readFrom(ChannelBuffer cb) throws PcepParseException {
+ public PcepMessage readFrom(ChannelBuffer cb) throws PcepParseException, PcepOutOfBoundMessageException {
if (cb.readableBytes() < MINIMUM_LENGTH) {
throw new PcepParseException("Packet should have minimum length: " + MINIMUM_LENGTH);
@@ -75,53 +67,43 @@
short length = cb.readShort();
cb.readerIndex(start);
- switch (type) {
+ // Check the out-of-bound message.
+ // If the message is out-of-bound then throw PcepOutOfBoundException.
+ if ((length - MINIMUM_COMMON_HEADER_LENGTH) > cb.readableBytes()) {
+ throw new PcepOutOfBoundMessageException("Message is out-of-bound.");
+ }
- case OPEN_MSG_TYPE:
+ if (type == (byte) PcepType.OPEN.getType()) {
log.debug("OPEN MESSAGE is received");
- // message type value 1 means it is open message
return PcepOpenMsgVer1.READER.readFrom(cb.readBytes(length));
- case KEEPALIVE_MSG_TYPE:
+ } else if (type == (byte) PcepType.KEEP_ALIVE.getType()) {
log.debug("KEEPALIVE MESSAGE is received");
- // message type value 2 means it is Keepalive message
return PcepKeepaliveMsgVer1.READER.readFrom(cb.readBytes(length));
- case ERROR_MSG_TYPE:
+ } else if (type == (byte) PcepType.ERROR.getType()) {
log.debug("ERROR MESSAGE is received");
- // message type value 6 means it is error message
return PcepErrorMsgVer1.READER.readFrom(cb.readBytes(length));
- case REPORT_MSG_TYPE:
- log.debug("REPORT MESSAGE is received");
- // message type value 10 means it is Report message
- // return
- return PcepReportMsgVer1.READER.readFrom(cb.readBytes(length));
- case UPDATE_MSG_TYPE:
- log.debug("UPDATE MESSAGE is received");
- //message type value 11 means it is Update message
- return PcepUpdateMsgVer1.READER.readFrom(cb.readBytes(length));
- case INITIATE_MSG_TYPE:
- log.debug("INITIATE MESSAGE is received");
- //message type value 12 means it is PcInitiate message
- return PcepInitiateMsgVer1.READER.readFrom(cb.readBytes(length));
- case CLOSE_MSG_TYPE:
+ } else if (type == (byte) PcepType.CLOSE.getType()) {
log.debug("CLOSE MESSAGE is received");
- // message type value 7 means it is Close message
return PcepCloseMsgVer1.READER.readFrom(cb.readBytes(length));
- case TE_REPORT_MSG_TYPE:
- log.debug("TE REPORT MESSAGE is received");
- // message type value 14 means it is TE REPORT message
- // return
- return PcepTEReportMsgVer1.READER.readFrom(cb.readBytes(length));
- case LABEL_UPDATE_MSG_TYPE:
- log.debug("LABEL UPDATE MESSAGE is received");
- // message type value 13 means it is LABEL UPDATE message
- // return
- return PcepLabelUpdateMsgVer1.READER.readFrom(cb.readBytes(length));
- case LABEL_RANGE_RESV_MSG_TYPE:
+ } else if (type == (byte) PcepType.REPORT.getType()) {
+ log.debug("REPORT MESSAGE is received");
+ return PcepReportMsgVer1.READER.readFrom(cb.readBytes(length));
+ } else if (type == (byte) PcepType.UPDATE.getType()) {
+ log.debug("UPDATE MESSAGE is received");
+ return PcepUpdateMsgVer1.READER.readFrom(cb.readBytes(length));
+ } else if (type == (byte) PcepType.INITIATE.getType()) {
+ log.debug("INITIATE MESSAGE is received");
+ return PcepInitiateMsgVer1.READER.readFrom(cb.readBytes(length));
+ } else if (type == (byte) PcepType.LS_REPORT.getType()) {
+ log.debug("LS REPORT MESSAGE is received");
+ return PcepLSReportMsgVer1.READER.readFrom(cb.readBytes(length));
+ } else if (type == (byte) PcepType.LABEL_RANGE_RESERV.getType()) {
log.debug("LABEL RANGE RESERVE MESSAGE is received");
- // message type value 15 means it is LABEL RANGE RESERVE message
- // return
return PcepLabelRangeResvMsgVer1.READER.readFrom(cb.readBytes(length));
- default:
+ } else if (type == (byte) PcepType.LABEL_UPDATE.getType()) {
+ log.debug("LABEL UPDATE MESSAGE is received");
+ return PcepLabelUpdateMsgVer1.READER.readFrom(cb.readBytes(length));
+ } else {
throw new PcepParseException("ERROR: UNKNOWN MESSAGE is received. Msg Type: " + type);
}
} catch (IndexOutOfBoundsException e) {
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepOpenObjectVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepOpenObjectVer1.java
index d5e5869..13d2584 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepOpenObjectVer1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepOpenObjectVer1.java
@@ -31,7 +31,7 @@
import org.onosproject.pcepio.types.PcepValueType;
import org.onosproject.pcepio.types.StatefulLspDbVerTlv;
import org.onosproject.pcepio.types.StatefulPceCapabilityTlv;
-import org.onosproject.pcepio.types.TedCapabilityTlv;
+import org.onosproject.pcepio.types.LsCapabilityTlv;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -252,13 +252,13 @@
long lValue = cb.readLong();
tlv = new StatefulLspDbVerTlv(lValue);
break;
- case TedCapabilityTlv.TYPE:
- log.debug("TedCapabilityTlv");
- if (TedCapabilityTlv.LENGTH != hLength) {
- throw new PcepParseException("Invalid length received for TedCapabilityTlv.");
+ case LsCapabilityTlv.TYPE:
+ log.debug("LsCapabilityTlv");
+ if (LsCapabilityTlv.LENGTH != hLength) {
+ throw new PcepParseException("Invalid length received for LsCapabilityTlv.");
}
iValue = cb.readInt();
- tlv = new TedCapabilityTlv(iValue);
+ tlv = new LsCapabilityTlv(iValue);
break;
case PcepLabelDbVerTlv.TYPE:
log.debug("PcepLabelDbVerTlv");
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepTEObjectVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepTEObjectVer1.java
deleted file mode 100644
index b1c6940..0000000
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepTEObjectVer1.java
+++ /dev/null
@@ -1,506 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.pcepio.protocol.ver1;
-
-import java.util.LinkedList;
-import java.util.ListIterator;
-
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.onosproject.pcepio.exceptions.PcepParseException;
-import org.onosproject.pcepio.protocol.PcepTEObject;
-import org.onosproject.pcepio.types.LocalTENodeDescriptorsTlv;
-import org.onosproject.pcepio.types.PcepObjectHeader;
-import org.onosproject.pcepio.types.PcepValueType;
-import org.onosproject.pcepio.types.RemoteTENodeDescriptorsTlv;
-import org.onosproject.pcepio.types.RoutingUniverseTlv;
-import org.onosproject.pcepio.types.TELinkAttributesTlv;
-import org.onosproject.pcepio.types.TELinkDescriptorsTlv;
-import org.onosproject.pcepio.types.TENodeAttributesTlv;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.MoreObjects;
-
-/**
- * Provides PCEP TE Object.
- */
-public class PcepTEObjectVer1 implements PcepTEObject {
- /*
- *
- reference: PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02.
- TE Object-Class is [TBD6].
-
- Two Object-Type values are defined for the TE object:
-
- o TE Node: TE Object-Type is 1.
-
- o TE Link: TE Object-Type is 2.
-
- The format of the TE object body is as follows:
-
- 0 1 2 3
- 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
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Protocol-ID | Flag |R|S|
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | TE-ID |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- // TLVs //
- | |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
-
- protected static final Logger log = LoggerFactory.getLogger(PcepTEObjectVer1.class);
-
- public static final byte TE_OBJ_TYPE_NODE_VALUE = 1;
- public static final byte TE_OBJ_TYPE_LINK_VALUE = 2;
-
- public static final byte TE_OBJ_CLASS = 101; //TBD6 in RFC.
- public static final byte TE_OBJECT_VERSION = 1;
-
- // TE_OBJ_MINIMUM_LENGTH = TEObjectHeaderLen(4)+ TEObjectLen(8)
- public static final short TE_OBJ_MINIMUM_LENGTH = 12;
-
- // Signaled ,all default values to be checked.
- public static final byte DEFAULT_PROTOCOL_ID = 1; //IS-IS Level 1
- public static final boolean DEFAULT_R_FLAG = false;
- public static final boolean DEFAULT_S_FLAG = false;
- public static final int DEFAULT_TE_ID = 0;
-
- public static final int OBJECT_HEADER_LENGTH = 4;
- public static final int RIGHT_SHIFT_ONE = 1;
- public static final int RIGHT_FIRST_FLAG = 0x1;
- public static final int FLAG_SET_R_FLAG = 0x2;
- public static final int FLAG_SET_S_FLAG = 0x1;
- public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
- public static final int MINIMUM_TLV_HEADER_LENGTH = 4;
-
- public static final PcepObjectHeader DEFAULT_TE_OBJECT_HEADER = new PcepObjectHeader(TE_OBJ_CLASS,
- TE_OBJ_TYPE_NODE_VALUE, PcepObjectHeader.REQ_OBJ_OPTIONAL_PROCESS, PcepObjectHeader.RSP_OBJ_PROCESSED,
- TE_OBJ_MINIMUM_LENGTH);
-
- private PcepObjectHeader teObjHeader;
- private byte yProtocolId;
- // 2-flags
- private boolean bRFlag;
- private boolean bSFlag;
- private int iTEId;
- // Optional TLV
- private LinkedList<PcepValueType> llOptionalTlv;
-
- /**
- * Constructor to initialize variables.
- *
- * @param teObjHeader TE Object header
- * @param yProtocolId Protocol-ID
- * @param bRFlag R-flag
- * @param bSFlag S-flag
- * @param iTEId TE-ID
- * @param llOptionalTlv linked list of Optional TLV
- */
- public PcepTEObjectVer1(PcepObjectHeader teObjHeader, byte yProtocolId, boolean bRFlag, boolean bSFlag, int iTEId,
- LinkedList<PcepValueType> llOptionalTlv) {
-
- this.teObjHeader = teObjHeader;
- this.yProtocolId = yProtocolId;
- this.bRFlag = bRFlag;
- this.bSFlag = bSFlag;
- this.iTEId = iTEId;
- this.llOptionalTlv = llOptionalTlv;
- }
-
- @Override
- public PcepObjectHeader getTEObjHeader() {
- return this.teObjHeader;
- }
-
- @Override
- public void setTEObjHeader(PcepObjectHeader obj) {
- this.teObjHeader = obj;
- }
-
- @Override
- public byte getProtocolId() {
- return this.yProtocolId;
- }
-
- @Override
- public void setProtocolId(byte yProtId) {
- this.yProtocolId = yProtId;
- }
-
- @Override
- public boolean getRFlag() {
- return this.bRFlag;
- }
-
- @Override
- public void setRFlag(boolean bRFlag) {
- this.bRFlag = bRFlag;
- }
-
- @Override
- public boolean getSFlag() {
- return this.bSFlag;
- }
-
- @Override
- public void setSFlag(boolean bSFlag) {
- this.bSFlag = bSFlag;
- }
-
- @Override
- public int getTEId() {
- return this.iTEId;
- }
-
- @Override
- public void setTEId(int iTEId) {
- this.iTEId = iTEId;
- }
-
- @Override
- public LinkedList<PcepValueType> getOptionalTlv() {
- return this.llOptionalTlv;
- }
-
- @Override
- public void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv) {
- this.llOptionalTlv = llOptionalTlv;
- }
-
- /**
- * Reads from the channel buffer and returns Object of PcepTEObject.
- *
- * @param cb of type channel buffer
- * @return Object of PcepTEObject
- * @throws PcepParseException if mandatory fields are missing
- */
- public static PcepTEObject read(ChannelBuffer cb) throws PcepParseException {
- log.debug("read");
-
- PcepObjectHeader teObjHeader;
- byte yProtocolId;
- // 2-flags
- boolean bRFlag;
- boolean bSFlag;
- int iTEId;
- LinkedList<PcepValueType> llOptionalTlv;
-
- teObjHeader = PcepObjectHeader.read(cb);
-
- //take only TEObject buffer.
- ChannelBuffer tempCb = cb.readBytes(teObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
-
- yProtocolId = tempCb.readByte();
- //ignore first two bytes of Flags
- tempCb.readShort();
-
- Integer iTemp = (int) tempCb.readByte(); //read 3rd byte Flag
- bSFlag = (iTemp & FLAG_SET_S_FLAG) == FLAG_SET_S_FLAG;
- bRFlag = (iTemp & FLAG_SET_R_FLAG) == FLAG_SET_R_FLAG;
-
- iTEId = tempCb.readInt();
-
- // parse optional TLV
- llOptionalTlv = parseOptionalTlv(tempCb);
-
- return new PcepTEObjectVer1(teObjHeader, yProtocolId, bRFlag, bSFlag, iTEId, llOptionalTlv);
- }
-
- @Override
- public int write(ChannelBuffer cb) throws PcepParseException {
-
- //write Object header
- int objStartIndex = cb.writerIndex();
- int objLenIndex = teObjHeader.write(cb);
-
- if (objLenIndex <= 0) {
- throw new PcepParseException("ObjectLength Index is " + objLenIndex);
- }
-
- //write Protocol ID
- cb.writeByte(this.yProtocolId);
-
- //write Flag
- cb.writeShort(0);
-
- byte bTemp = 0;
- if (bSFlag) {
- bTemp = FLAG_SET_S_FLAG;
- }
-
- if (bRFlag) {
- bTemp = (byte) (bTemp | FLAG_SET_R_FLAG);
- }
- cb.writeByte(bTemp);
-
- //write TEId
- cb.writeInt(iTEId);
-
- // Add optional TLV
- packOptionalTlv(cb);
-
- //Update object length now
- int length = cb.writerIndex() - objStartIndex;
-
- //will be helpful during print().
- teObjHeader.setObjLen((short) length);
-
- cb.setShort(objLenIndex, (short) length);
-
- return cb.writerIndex();
- }
-
- /**
- * Returns Linked list of PCEP Value Type.
- *
- * @param cb of channel buffer
- * @return Linked list of PCEP Value Type
- * @throws PcepParseException if mandatory fields are missing
- */
- protected static LinkedList<PcepValueType> parseOptionalTlv(ChannelBuffer cb) throws PcepParseException {
-
- LinkedList<PcepValueType> llOutOptionalTlv;
-
- llOutOptionalTlv = new LinkedList<>();
-
- while (MINIMUM_TLV_HEADER_LENGTH <= cb.readableBytes()) {
-
- PcepValueType tlv;
- short hType = cb.readShort();
- short hLength = cb.readShort();
- long lValue = 0;
-
- switch (hType) {
-
- case RoutingUniverseTlv.TYPE:
- lValue = cb.readLong();
- tlv = new RoutingUniverseTlv(lValue);
- break;
- case LocalTENodeDescriptorsTlv.TYPE:
- tlv = LocalTENodeDescriptorsTlv.read(cb, hLength);
- break;
- case RemoteTENodeDescriptorsTlv.TYPE:
- tlv = RemoteTENodeDescriptorsTlv.read(cb, hLength);
- break;
- case TELinkDescriptorsTlv.TYPE:
- tlv = TELinkDescriptorsTlv.read(cb, hLength);
- break;
- case TENodeAttributesTlv.TYPE:
- tlv = TENodeAttributesTlv.read(cb, hLength);
- break;
- case TELinkAttributesTlv.TYPE:
- tlv = TELinkAttributesTlv.read(cb, hLength);
- break;
- default:
- throw new PcepParseException("Unsupported TLV type :" + hType);
- }
-
- // Check for the padding
- int pad = hLength % 4;
- if (0 < pad) {
- pad = 4 - pad;
- if (pad <= cb.readableBytes()) {
- cb.skipBytes(pad);
- }
- }
-
- llOutOptionalTlv.add(tlv);
- }
-
- if (0 < cb.readableBytes()) {
-
- throw new PcepParseException("Optional Tlv parsing error. Extra bytes received.");
- }
- return llOutOptionalTlv;
- }
-
- /**
- * Returns the writer index.
- *
- * @param cb of type channel buffer
- * @return the writer index.
- */
- protected int packOptionalTlv(ChannelBuffer cb) {
-
- ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
-
- while (listIterator.hasNext()) {
- PcepValueType tlv = listIterator.next();
-
- if (tlv == null) {
- log.debug("TLV is null from OptionalTlv list");
- continue;
- }
- tlv.write(cb);
-
- // need to take care of padding
- int pad = tlv.getLength() % 4;
-
- if (0 != pad) {
- pad = 4 - pad;
- for (int i = 0; i < pad; ++i) {
- cb.writeByte((byte) 0);
- }
- }
- }
- return cb.writerIndex();
- }
-
- /**
- * Builder class for PCEP te object.
- */
- public static class Builder implements PcepTEObject.Builder {
- private boolean bIsHeaderSet = false;
- private boolean bIsProtocolIdSet = false;
- private boolean bIsRFlagSet = false;
- private boolean bIsSFlagSet = false;
- private boolean bIsTEIdSet = false;
-
- private PcepObjectHeader teObjHeader;
- private byte yProtocolId;
- private boolean bRFlag;
- private boolean bSFlag;
- private int iTEId;
- private LinkedList<PcepValueType> llOptionalTlv = new LinkedList<>();
-
- private boolean bIsPFlagSet = false;
- private boolean bPFlag;
-
- private boolean bIsIFlagSet = false;
- private boolean bIFlag;
-
- @Override
- public PcepTEObject build() {
- PcepObjectHeader teObjHeader = this.bIsHeaderSet ? this.teObjHeader : DEFAULT_TE_OBJECT_HEADER;
-
- byte yProtocolId = this.bIsProtocolIdSet ? this.yProtocolId : DEFAULT_PROTOCOL_ID;
- boolean bRFlag = this.bIsRFlagSet ? this.bRFlag : DEFAULT_R_FLAG;
- boolean bSFlag = this.bIsSFlagSet ? this.bSFlag : DEFAULT_S_FLAG;
- int iTEId = this.bIsTEIdSet ? this.iTEId : DEFAULT_TE_ID;
-
- if (bIsPFlagSet) {
- teObjHeader.setPFlag(bPFlag);
- }
-
- if (bIsIFlagSet) {
- teObjHeader.setIFlag(bIFlag);
- }
-
- return new PcepTEObjectVer1(teObjHeader, yProtocolId, bRFlag, bSFlag, iTEId, llOptionalTlv);
-
- }
-
- @Override
- public PcepObjectHeader getTEObjHeader() {
- return this.teObjHeader;
- }
-
- @Override
- public Builder setTEObjHeader(PcepObjectHeader obj) {
- this.teObjHeader = obj;
- this.bIsHeaderSet = true;
- return this;
- }
-
- @Override
- public byte getProtocolId() {
- return this.yProtocolId;
- }
-
- @Override
- public Builder setProtocolId(byte yProtId) {
- this.yProtocolId = yProtId;
- this.bIsProtocolIdSet = true;
- return this;
- }
-
- @Override
- public boolean getRFlag() {
- return this.bRFlag;
- }
-
- @Override
- public Builder setRFlag(boolean bRFlag) {
- this.bRFlag = bRFlag;
- this.bIsRFlagSet = true;
- return this;
- }
-
- @Override
- public boolean getSFlag() {
- return this.bSFlag;
- }
-
- @Override
- public Builder setSFlag(boolean bSFlag) {
- this.bSFlag = bSFlag;
- this.bIsSFlagSet = true;
- return this;
- }
-
- @Override
- public int getTEId() {
- return this.iTEId;
- }
-
- @Override
- public Builder setTEId(int iTEId) {
- this.iTEId = iTEId;
- this.bIsTEIdSet = true;
- return this;
- }
-
- @Override
- public LinkedList<PcepValueType> getOptionalTlv() {
- return this.llOptionalTlv;
- }
-
- @Override
- public Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv) {
- this.llOptionalTlv = llOptionalTlv;
- return this;
- }
-
- @Override
- public Builder setPFlag(boolean value) {
- this.bPFlag = value;
- this.bIsPFlagSet = true;
- return this;
- }
-
- @Override
- public Builder setIFlag(boolean value) {
- this.bIFlag = value;
- this.bIsIFlagSet = true;
- return this;
- }
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(getClass())
- .add("ObjectHeader", teObjHeader)
- .add("ProtocolId", yProtocolId)
- .add("RFlag", (bRFlag) ? 1 : 0)
- .add("SFlag", (bSFlag) ? 1 : 0)
- .add("TeId", iTEId)
- .add("OptionalTlv", llOptionalTlv)
- .toString();
- }
-}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepTEReportMsgVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepTEReportMsgVer1.java
deleted file mode 100644
index 9283308..0000000
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepTEReportMsgVer1.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.pcepio.protocol.ver1;
-
-import java.util.LinkedList;
-import java.util.ListIterator;
-
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.onosproject.pcepio.exceptions.PcepParseException;
-import org.onosproject.pcepio.protocol.PcepMessageReader;
-import org.onosproject.pcepio.protocol.PcepMessageWriter;
-import org.onosproject.pcepio.protocol.PcepTEObject;
-import org.onosproject.pcepio.protocol.PcepTEReportMsg;
-import org.onosproject.pcepio.protocol.PcepType;
-import org.onosproject.pcepio.protocol.PcepVersion;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.MoreObjects;
-
-/**
- * Provides PCEP TE Report Message.
- */
-class PcepTEReportMsgVer1 implements PcepTEReportMsg {
-
- /*
- * Ref : draft-dhodylee-pce-pcep-te-data-extn-02, section 8.1
-
- <TERpt Message> ::= <Common Header>
- <te-report-list>
- Where:
- <te-report-list> ::= <TE>[<te-report-list>]
- */
-
- private static final Logger log = LoggerFactory.getLogger(PcepTEReportMsgVer1.class);
- //PACKET_MINIMUM_LENGTH = CommonHeaderLen(4)+TEObjMinLen(12)
- public static final int PACKET_MINIMUM_LENGTH = 16;
- public static final PcepType MSG_TYPE = PcepType.TE_REPORT;
- // <te-report-list>
- private LinkedList<PcepTEObject> teReportList;
-
- public static final PcepTEReportMsgVer1.Reader READER = new Reader();
-
- /**
- * Reader class for reading PCPE te report message form channel buffer.
- */
- static class Reader implements PcepMessageReader<PcepTEReportMsg> {
-
- LinkedList<PcepTEObject> teReportList;
-
- @Override
- public PcepTEReportMsg readFrom(ChannelBuffer cb) throws PcepParseException {
-
- if (cb.readableBytes() < PACKET_MINIMUM_LENGTH) {
- return null;
- }
-
- teReportList = new LinkedList<>();
-
- byte version = cb.readByte();
- version = (byte) (version >> PcepMessageVer1.SHIFT_FLAG);
- if (version != PcepMessageVer1.PACKET_VERSION) {
- throw new PcepParseException("Wrong version. Expected=PcepVersion.PCEP_1(1), got=" + version);
- }
-
- byte type = cb.readByte();
- if (type != MSG_TYPE.getType()) {
- throw new PcepParseException("Wrong type. Expected=PcepType.TE_REPORT(14), got=" + type);
- }
-
- short length = cb.readShort();
- if (length < PACKET_MINIMUM_LENGTH) {
- throw new PcepParseException(
- "Wrong length. Expected to be >= " + PACKET_MINIMUM_LENGTH + ", is: " + length);
- }
-
- // Parse state report list
- parseTEReportList(cb);
-
- return new PcepTEReportMsgVer1(teReportList);
- }
-
- /**
- * Parse te-report-list.
- *
- * @param cb input Channel Buffer
- * @throws PcepParseException when fails to parse TE Report list.
- */
- public void parseTEReportList(ChannelBuffer cb) throws PcepParseException {
- // <te-report-list> ::= <TE>[<te-report-list>]
-
- while (0 < cb.readableBytes()) {
- //store TE objectS
- if (!teReportList.add(PcepTEObjectVer1.read(cb))) {
- throw new PcepParseException("Failed to add TE object to TE report list");
- }
- }
- }
- }
-
- /**
- * Constructor to initialize TE Report List.
- *
- * @param teReportList list of PCEP TE Object
- */
- PcepTEReportMsgVer1(LinkedList<PcepTEObject> teReportList) {
- this.teReportList = teReportList;
- }
-
- /**
- * Builder class for PCEP te report message.
- */
- static class Builder implements PcepTEReportMsg.Builder {
- // PCEP TE Report message fields
- LinkedList<PcepTEObject> teReportList;
-
- @Override
- public PcepVersion getVersion() {
- return PcepVersion.PCEP_1;
- }
-
- @Override
- public PcepType getType() {
- return PcepType.TE_REPORT;
- }
-
- @Override
- public PcepTEReportMsg build() {
- return new PcepTEReportMsgVer1(this.teReportList);
- }
-
- @Override
- public LinkedList<PcepTEObject> getTEReportList() {
- return this.teReportList;
- }
-
- @Override
- public Builder setTEReportList(LinkedList<PcepTEObject> ll) {
- this.teReportList = ll;
- return this;
- }
- }
-
- @Override
- public void writeTo(ChannelBuffer bb) throws PcepParseException {
- WRITER.write(bb, this);
- }
-
- static final Writer WRITER = new Writer();
-
- /**
- * Writer class for writing PCEP te report message to channel buffer.
- */
- static class Writer implements PcepMessageWriter<PcepTEReportMsgVer1> {
-
- @Override
- public void write(ChannelBuffer bb, PcepTEReportMsgVer1 message) throws PcepParseException {
-
- int startIndex = bb.writerIndex();
-
- // first 3 bits set to version
- bb.writeByte((byte) (PcepMessageVer1.PACKET_VERSION << PcepMessageVer1.SHIFT_FLAG));
-
- // message type
- bb.writeByte(MSG_TYPE.getType());
-
- // Length of the message will be updated at the end
- // First write with 0s
- int msgLenIndex = bb.writerIndex();
- bb.writeShort((short) 0);
-
- ListIterator<PcepTEObject> listIterator = message.teReportList.listIterator();
-
- while (listIterator.hasNext()) {
- PcepTEObject teObj = listIterator.next();
- teObj.write(bb);
- }
-
- // update message length field
- int length = bb.writerIndex() - startIndex;
- bb.setShort(msgLenIndex, (short) length);
- }
- }
-
- @Override
- public PcepVersion getVersion() {
- return PcepVersion.PCEP_1;
- }
-
- @Override
- public PcepType getType() {
- return MSG_TYPE;
- }
-
- @Override
- public LinkedList<PcepTEObject> getTEReportList() {
- return this.teReportList;
- }
-
- @Override
- public void setTEReportList(LinkedList<PcepTEObject> ll) {
- this.teReportList = ll;
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(getClass())
- .add("TeReportList", teReportList)
- .toString();
- }
-}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AdministrativeGroupTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AdministrativeGroupSubTlv.java
similarity index 85%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AdministrativeGroupTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AdministrativeGroupSubTlv.java
index 62ed4e7..0c231b7 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AdministrativeGroupTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AdministrativeGroupSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provides Administrative Group Tlv which contains value (32 Bit ).
*/
-public class AdministrativeGroupTlv implements PcepValueType {
+public class AdministrativeGroupSubTlv implements PcepValueType {
/* REFERENCE :[RFC5305]/3.1
* 0 1 2 3
@@ -39,9 +39,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(AdministrativeGroupTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(AdministrativeGroupSubTlv.class);
- public static final short TYPE = 3; //TDB33
+ public static final short TYPE = 22;
public static final short LENGTH = 4;
private final int rawValue;
@@ -51,7 +51,7 @@
*
* @param rawValue of Administrative-Group-Tlv.
*/
- public AdministrativeGroupTlv(int rawValue) {
+ public AdministrativeGroupSubTlv(int rawValue) {
this.rawValue = rawValue;
}
@@ -61,8 +61,8 @@
* @param raw value.
* @return object of Administrative-Group-Tlv
*/
- public static AdministrativeGroupTlv of(final int raw) {
- return new AdministrativeGroupTlv(raw);
+ public static AdministrativeGroupSubTlv of(final int raw) {
+ return new AdministrativeGroupSubTlv(raw);
}
/**
@@ -99,8 +99,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof AdministrativeGroupTlv) {
- AdministrativeGroupTlv other = (AdministrativeGroupTlv) obj;
+ if (obj instanceof AdministrativeGroupSubTlv) {
+ AdministrativeGroupSubTlv other = (AdministrativeGroupSubTlv) obj;
return Objects.equals(rawValue, other.rawValue);
}
return false;
@@ -121,8 +121,8 @@
* @param c input channel buffer
* @return object of Administrative-Group-Tlv
*/
- public static AdministrativeGroupTlv read(ChannelBuffer c) {
- return AdministrativeGroupTlv.of(c.readInt());
+ public static AdministrativeGroupSubTlv read(ChannelBuffer c) {
+ return AdministrativeGroupSubTlv.of(c.readInt());
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AutonomousSystemNumberSubObject.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AutonomousSystemNumberSubObject.java
new file mode 100644
index 0000000..bf56d5e
--- /dev/null
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AutonomousSystemNumberSubObject.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author b00295750
+ *
+ */
+package org.onosproject.pcepio.types;
+
+import java.util.Objects;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.onosproject.pcepio.protocol.PcepVersion;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Provides Autonomous system number sub object.
+ */
+public class AutonomousSystemNumberSubObject implements PcepValueType {
+
+ /*Reference : RFC 3209 : 4.3.3.4
+ * 0 1 2 3
+ 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
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |L| Type | Length | AS number (2-octet) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ protected static final Logger log = LoggerFactory.getLogger(AutonomousSystemNumberSubObject.class);
+
+ public static final byte TYPE = (byte) 0x32;
+ public static final byte LENGTH = 4;
+ public static final byte VALUE_LENGTH = 2;
+ public static final byte OBJ_LENGTH = 4;
+ public static final byte LBIT = 0;
+ public static final int SHIFT_LBIT_POSITION = 7;
+ private short asNumber;
+
+ /**
+ * Constructor to initialize AS number.
+ *
+ * @param asNumber AS number
+ */
+ public AutonomousSystemNumberSubObject(short asNumber) {
+ this.asNumber = asNumber;
+ }
+
+ /**
+ * Returns a new instance of AutonomousSystemNumberSubObject.
+ *
+ * @param asNumber AS number
+ * @return object of AutonomousSystemNumberSubObject
+ */
+ public static AutonomousSystemNumberSubObject of(short asNumber) {
+ return new AutonomousSystemNumberSubObject(asNumber);
+ }
+
+ /**
+ * Returns value of AS number.
+ *
+ * @return value of AS number
+ */
+ public short getAsNumber() {
+ return asNumber;
+ }
+
+ @Override
+ public PcepVersion getVersion() {
+ return PcepVersion.PCEP_1;
+ }
+
+ @Override
+ public short getType() {
+ return TYPE;
+ }
+
+ @Override
+ public short getLength() {
+ return LENGTH;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(asNumber);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof AutonomousSystemNumberSubObject) {
+ AutonomousSystemNumberSubObject other = (AutonomousSystemNumberSubObject) obj;
+ return Objects.equals(this.asNumber, other.asNumber);
+ }
+ return false;
+ }
+
+ /**
+ * Reads the channel buffer and returns object of AutonomousSystemNumberSubObject.
+ *
+ * @param c type of channel buffer
+ * @return object of AutonomousSystemNumberSubObject
+ */
+ public static PcepValueType read(ChannelBuffer c) {
+ short asNumber = c.readShort();
+ return new AutonomousSystemNumberSubObject(asNumber);
+ }
+
+ @Override
+ public int write(ChannelBuffer c) {
+ int iLenStartIndex = c.writerIndex();
+ byte bValue = LBIT;
+ bValue = (byte) (bValue << SHIFT_LBIT_POSITION);
+ bValue = (byte) (bValue | TYPE);
+ c.writeByte(bValue);
+ c.writeByte(OBJ_LENGTH);
+ c.writeShort(asNumber);
+
+ return c.writerIndex() - iLenStartIndex;
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(getClass())
+ .add("Type", TYPE)
+ .add("Length", LENGTH)
+ .add("AsNumber", asNumber)
+ .toString();
+ }
+}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AutonomousSystemTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AutonomousSystemSubTlv.java
similarity index 85%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AutonomousSystemTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AutonomousSystemSubTlv.java
index 3f21319..631cff7 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AutonomousSystemTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/AutonomousSystemSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provides Autonomous-System-Tlv which contains opaque value (32 Bit AS Number).
*/
-public class AutonomousSystemTlv implements PcepValueType {
+public class AutonomousSystemSubTlv implements PcepValueType {
/* Reference :RFC3209
* 0 1 2 3
@@ -39,9 +39,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(AutonomousSystemTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(AutonomousSystemSubTlv.class);
- public static final short TYPE = 100; //TODD:change this TBD10
+ public static final short TYPE = 1;
public static final short LENGTH = 4;
private final int rawValue;
@@ -51,7 +51,7 @@
*
* @param rawValue Autonomous-System-Tlv
*/
- public AutonomousSystemTlv(int rawValue) {
+ public AutonomousSystemSubTlv(int rawValue) {
this.rawValue = rawValue;
}
@@ -61,8 +61,8 @@
* @param raw value of opaque.
* @return object of Autonomous-System-Tlv
*/
- public static AutonomousSystemTlv of(final int raw) {
- return new AutonomousSystemTlv(raw);
+ public static AutonomousSystemSubTlv of(final int raw) {
+ return new AutonomousSystemSubTlv(raw);
}
/**
@@ -99,8 +99,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof AutonomousSystemTlv) {
- AutonomousSystemTlv other = (AutonomousSystemTlv) obj;
+ if (obj instanceof AutonomousSystemSubTlv) {
+ AutonomousSystemSubTlv other = (AutonomousSystemSubTlv) obj;
return Objects.equals(rawValue, other.rawValue);
}
return false;
@@ -121,8 +121,8 @@
* @param c input channel buffer
* @return object of Autonomous-System-Tlv
*/
- public static AutonomousSystemTlv read(ChannelBuffer c) {
- return AutonomousSystemTlv.of(c.readInt());
+ public static AutonomousSystemSubTlv read(ChannelBuffer c) {
+ return AutonomousSystemSubTlv.of(c.readInt());
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/BgpLsIdentifierTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/BgpLsIdentifierSubTlv.java
similarity index 86%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/BgpLsIdentifierTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/BgpLsIdentifierSubTlv.java
index 9fd80c4..08885f4 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/BgpLsIdentifierTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/BgpLsIdentifierSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provides BGP LS identifier which contains opaque value (32 Bit ID).
*/
-public class BgpLsIdentifierTlv implements PcepValueType {
+public class BgpLsIdentifierSubTlv implements PcepValueType {
/* Reference :draft-ietf-idr-ls-distribution-10
* 0 1 2 3
@@ -39,9 +39,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(BgpLsIdentifierTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(BgpLsIdentifierSubTlv.class);
- public static final short TYPE = 17; //TODD:change this TBD11
+ public static final short TYPE = 2;
public static final short LENGTH = 4;
private final int rawValue;
@@ -51,7 +51,7 @@
*
* @param rawValue BGP LS identifier Tlv
*/
- public BgpLsIdentifierTlv(int rawValue) {
+ public BgpLsIdentifierSubTlv(int rawValue) {
this.rawValue = rawValue;
}
@@ -61,8 +61,8 @@
* @param raw value
* @return object of BGPLSidentifierTlv
*/
- public static BgpLsIdentifierTlv of(final int raw) {
- return new BgpLsIdentifierTlv(raw);
+ public static BgpLsIdentifierSubTlv of(final int raw) {
+ return new BgpLsIdentifierSubTlv(raw);
}
/**
@@ -99,8 +99,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof BgpLsIdentifierTlv) {
- BgpLsIdentifierTlv other = (BgpLsIdentifierTlv) obj;
+ if (obj instanceof BgpLsIdentifierSubTlv) {
+ BgpLsIdentifierSubTlv other = (BgpLsIdentifierSubTlv) obj;
return Objects.equals(rawValue, other.rawValue);
}
return false;
@@ -121,8 +121,8 @@
* @param c input channel buffer
* @return object of BGP LS identifier Tlv
*/
- public static BgpLsIdentifierTlv read(ChannelBuffer c) {
- return BgpLsIdentifierTlv.of(c.readInt());
+ public static BgpLsIdentifierSubTlv read(ChannelBuffer c) {
+ return BgpLsIdentifierSubTlv.of(c.readInt());
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/ErrorObjListWithOpen.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/ErrorObjListWithOpen.java
index 40f89f4..98ad41e 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/ErrorObjListWithOpen.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/ErrorObjListWithOpen.java
@@ -16,6 +16,7 @@
package org.onosproject.pcepio.types;
import java.util.LinkedList;
+import java.util.List;
import java.util.ListIterator;
import org.jboss.netty.buffer.ChannelBuffer;
@@ -32,7 +33,7 @@
*/
public class ErrorObjListWithOpen {
//errorObjList is mandatory
- private LinkedList<PcepErrorObject> llerrorObjList;
+ private List<PcepErrorObject> llerrorObjList;
// openObject is optional
private PcepOpenObject openObject;
// flag to check if open object is set or not
@@ -45,7 +46,7 @@
* @param errObj ERROR object list
* @param openObj OPEN object
*/
- public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj, PcepOpenObject openObj) {
+ public ErrorObjListWithOpen(List<PcepErrorObject> errObj, PcepOpenObject openObj) {
this.llerrorObjList = errObj;
this.openObject = openObj;
if (openObj != null) {
@@ -60,7 +61,7 @@
*
* @param errObj ERROR Object list
*/
- public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj) {
+ public ErrorObjListWithOpen(List<PcepErrorObject> errObj) {
this.llerrorObjList = errObj;
this.openObject = null;
isOpenObjectSet = false;
@@ -71,8 +72,8 @@
*
* @return error types list
*/
- public LinkedList<Integer> getErrorType() {
- LinkedList<Integer> errorType = new LinkedList<>();
+ public List<Integer> getErrorType() {
+ List<Integer> errorType = new LinkedList<>();
if (llerrorObjList != null) {
ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator();
int error;
@@ -91,8 +92,8 @@
*
* @return error values list
*/
- public LinkedList<Integer> getErrorValue() {
- LinkedList<Integer> errorValue = new LinkedList<>();
+ public List<Integer> getErrorValue() {
+ List<Integer> errorValue = new LinkedList<>();
if (llerrorObjList != null) {
ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator();
int error;
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4InterfaceAddressSubTlv.java
similarity index 85%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4InterfaceAddressSubTlv.java
index d1a3015..72a1878 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4InterfaceAddressSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provides IPv4 Interface Address .
*/
-public class IPv4InterfaceAddressTlv implements PcepValueType {
+public class IPv4InterfaceAddressSubTlv implements PcepValueType {
/*
* reference :[RFC5305]/3.2
@@ -40,9 +40,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(IPv4InterfaceAddressTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(IPv4InterfaceAddressSubTlv.class);
- public static final short TYPE = 6;
+ public static final short TYPE = 7;
public static final short LENGTH = 4;
private final int rawValue;
@@ -52,7 +52,7 @@
*
* @param rawValue of IPv4-Interface-Address.
*/
- public IPv4InterfaceAddressTlv(int rawValue) {
+ public IPv4InterfaceAddressSubTlv(int rawValue) {
this.rawValue = rawValue;
}
@@ -62,8 +62,8 @@
* @param raw value of IPv4-Interface-Address
* @return object of IPv4-Interface-Address-Tlv
*/
- public static IPv4InterfaceAddressTlv of(final int raw) {
- return new IPv4InterfaceAddressTlv(raw);
+ public static IPv4InterfaceAddressSubTlv of(final int raw) {
+ return new IPv4InterfaceAddressSubTlv(raw);
}
/**
@@ -100,8 +100,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof IPv4InterfaceAddressTlv) {
- IPv4InterfaceAddressTlv other = (IPv4InterfaceAddressTlv) obj;
+ if (obj instanceof IPv4InterfaceAddressSubTlv) {
+ IPv4InterfaceAddressSubTlv other = (IPv4InterfaceAddressSubTlv) obj;
return Objects.equals(rawValue, other.rawValue);
}
return false;
@@ -122,8 +122,8 @@
* @param c input channel buffer
* @return object of IPv4-Interface-Address-Tlv
*/
- public static IPv4InterfaceAddressTlv read(ChannelBuffer c) {
- return IPv4InterfaceAddressTlv.of(c.readInt());
+ public static IPv4InterfaceAddressSubTlv read(ChannelBuffer c) {
+ return IPv4InterfaceAddressSubTlv.of(c.readInt());
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4NeighborAddressTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4NeighborAddressSubTlv.java
similarity index 86%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4NeighborAddressTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4NeighborAddressSubTlv.java
index 0f98777..c9b070c 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4NeighborAddressTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4NeighborAddressSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provides IPv4 Neighbor Address .
*/
-public class IPv4NeighborAddressTlv implements PcepValueType {
+public class IPv4NeighborAddressSubTlv implements PcepValueType {
/* Reference :[RFC5305]/3.3
0 1 2 3
@@ -39,7 +39,7 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(IPv4NeighborAddressTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(IPv4NeighborAddressSubTlv.class);
public static final short TYPE = 8;
public static final short LENGTH = 4;
@@ -51,7 +51,7 @@
*
* @param rawValue IPv4-Neighbor-Address-Tlv
*/
- public IPv4NeighborAddressTlv(int rawValue) {
+ public IPv4NeighborAddressSubTlv(int rawValue) {
log.debug("IPv4NeighborAddressTlv");
this.rawValue = rawValue;
}
@@ -62,8 +62,8 @@
* @param raw value of IPv4-Neighbor-Address
* @return object of IPv4NeighborAddressTlv
*/
- public static IPv4NeighborAddressTlv of(final int raw) {
- return new IPv4NeighborAddressTlv(raw);
+ public static IPv4NeighborAddressSubTlv of(final int raw) {
+ return new IPv4NeighborAddressSubTlv(raw);
}
/**
@@ -100,8 +100,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof IPv4NeighborAddressTlv) {
- IPv4NeighborAddressTlv other = (IPv4NeighborAddressTlv) obj;
+ if (obj instanceof IPv4NeighborAddressSubTlv) {
+ IPv4NeighborAddressSubTlv other = (IPv4NeighborAddressSubTlv) obj;
return Objects.equals(rawValue, other.rawValue);
}
return false;
@@ -122,8 +122,8 @@
* @param c input channel buffer
* @return object of IPv4-Neighbor-Address-Tlv
*/
- public static IPv4NeighborAddressTlv read(ChannelBuffer c) {
- return IPv4NeighborAddressTlv.of(c.readInt());
+ public static IPv4NeighborAddressSubTlv read(ChannelBuffer c) {
+ return IPv4NeighborAddressSubTlv.of(c.readInt());
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4TERouterIdOfLocalNodeTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4RouterIdOfLocalNodeSubTlv.java
similarity index 69%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4TERouterIdOfLocalNodeTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4RouterIdOfLocalNodeSubTlv.java
index 2abf4cd..0e8c90f 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4TERouterIdOfLocalNodeTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4RouterIdOfLocalNodeSubTlv.java
@@ -25,9 +25,9 @@
import com.google.common.base.MoreObjects;
/**
- * Provides IPv4 TE Router Id Of Local Node.
+ * Provides IPv4 Router Id Of Local Node.
*/
-public class IPv4TERouterIdOfLocalNodeTlv implements PcepValueType {
+public class IPv4RouterIdOfLocalNodeSubTlv implements PcepValueType {
/* Reference:[RFC5305]/4.3
* 0 1 2 3
@@ -35,13 +35,13 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type=[TDB25] | Length=4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | IPv4 TE Router Id Of Local Node |
+ | IPv4 Router Id Of Local Node |
+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-
*/
- protected static final Logger log = LoggerFactory.getLogger(IPv4TERouterIdOfLocalNodeTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(IPv4RouterIdOfLocalNodeSubTlv.class);
- public static final short TYPE = 134; //TDB25
+ public static final short TYPE = 17;
public static final short LENGTH = 4;
private final int rawValue;
@@ -49,26 +49,26 @@
/**
* Constructor to initialize rawValue.
*
- * @param rawValue IPv4-TE-RouterId-Of-Local-Node-Tlv
+ * @param rawValue IPv4-RouterId-Of-Local-Node-Tlv
*/
- public IPv4TERouterIdOfLocalNodeTlv(int rawValue) {
+ public IPv4RouterIdOfLocalNodeSubTlv(int rawValue) {
this.rawValue = rawValue;
}
/**
- * Returns newly created IPv4TERouterIdOfLocalNodeTlv object.
+ * Returns newly created IPv4RouterIdOfLocalNodeTlv object.
*
- * @param raw value of IPv4-TE-RouterId-Of-Local-Node
- * @return object of IPv4TERouterIdOfLocalNodeTlv
+ * @param raw value of IPv4-RouterId-Of-Local-Node
+ * @return object of IPv4RouterIdOfLocalNodeTlv
*/
- public static IPv4TERouterIdOfLocalNodeTlv of(final int raw) {
- return new IPv4TERouterIdOfLocalNodeTlv(raw);
+ public static IPv4RouterIdOfLocalNodeSubTlv of(final int raw) {
+ return new IPv4RouterIdOfLocalNodeSubTlv(raw);
}
/**
- * Returns value of IPv4 TE Router Id Of Local Node.
+ * Returns value of IPv4 Router Id Of Local Node.
*
- * @return rawValue IPv4 TE Router Id Of Local Node
+ * @return rawValue IPv4 Router Id Of Local Node
*/
public int getInt() {
return rawValue;
@@ -99,8 +99,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof IPv4TERouterIdOfLocalNodeTlv) {
- IPv4TERouterIdOfLocalNodeTlv other = (IPv4TERouterIdOfLocalNodeTlv) obj;
+ if (obj instanceof IPv4RouterIdOfLocalNodeSubTlv) {
+ IPv4RouterIdOfLocalNodeSubTlv other = (IPv4RouterIdOfLocalNodeSubTlv) obj;
return Objects.equals(rawValue, other.rawValue);
}
return false;
@@ -116,13 +116,13 @@
}
/**
- * Reads the channel buffer and returns object of IPv4TERouterIdOfLocalNodeTlv.
+ * Reads the channel buffer and returns object of IPv4RouterIdOfLocalNodeTlv.
*
* @param c input channel buffer
- * @return object of IPv4TERouterIdOfLocalNodeTlv
+ * @return object of IPv4RouterIdOfLocalNodeTlv
*/
- public static IPv4TERouterIdOfLocalNodeTlv read(ChannelBuffer c) {
- return IPv4TERouterIdOfLocalNodeTlv.of(c.readInt());
+ public static IPv4RouterIdOfLocalNodeSubTlv read(ChannelBuffer c) {
+ return IPv4RouterIdOfLocalNodeSubTlv.of(c.readInt());
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4TERouterIdOfRemoteNodeTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4RouterIdOfRemoteNodeSubTlv.java
similarity index 68%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4TERouterIdOfRemoteNodeTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4RouterIdOfRemoteNodeSubTlv.java
index 21e0989..2a11feb 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4TERouterIdOfRemoteNodeTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv4RouterIdOfRemoteNodeSubTlv.java
@@ -25,9 +25,9 @@
import com.google.common.base.MoreObjects;
/**
- * Provides IPv4 TE Router Id Of Remote Node.
+ * Provides IPv4 Router Id Of Remote Node.
*/
-public class IPv4TERouterIdOfRemoteNodeTlv implements PcepValueType {
+public class IPv4RouterIdOfRemoteNodeSubTlv implements PcepValueType {
/* Reference :[RFC5305]/4.3
* 0 1 2 3
@@ -35,13 +35,13 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type=[TDB28] | Length=4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | IPv4 TE Router Id Of Remote Node |
+ | IPv4 Router Id Of Remote Node |
+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-
*/
- protected static final Logger log = LoggerFactory.getLogger(IPv4TERouterIdOfRemoteNodeTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(IPv4RouterIdOfRemoteNodeSubTlv.class);
- public static final short TYPE = 1340; //TDB28
+ public static final short TYPE = 19;
public static final short LENGTH = 4;
private final int rawValue;
@@ -49,27 +49,27 @@
/**
* Constructor to initialize rawValue.
*
- * @param rawValue IPv4 TE RouterId Of Remote Node Tlv
+ * @param rawValue IPv4 RouterId Of Remote Node Tlv
*/
- public IPv4TERouterIdOfRemoteNodeTlv(int rawValue) {
- log.debug("IPv4TERouterIdOfRemoteNodeTlv");
+ public IPv4RouterIdOfRemoteNodeSubTlv(int rawValue) {
+ log.debug("IPv4RouterIdOfRemoteNodeTlv");
this.rawValue = rawValue;
}
/**
- * Returns newly created IPv4TERouterIdOfRemoteNodeTlv object.
+ * Returns newly created IPv4RouterIdOfRemoteNodeTlv object.
*
- * @param raw IPv4 TE RouterId Of Remote Node
- * @return object of IPv4TERouterIdOfRemoteNodeTlv
+ * @param raw IPv4 RouterId Of Remote Node
+ * @return object of IPv4RouterIdOfRemoteNodeTlv
*/
- public static IPv4TERouterIdOfRemoteNodeTlv of(final int raw) {
- return new IPv4TERouterIdOfRemoteNodeTlv(raw);
+ public static IPv4RouterIdOfRemoteNodeSubTlv of(final int raw) {
+ return new IPv4RouterIdOfRemoteNodeSubTlv(raw);
}
/**
- * Returns value of IPv4 TE Router Id Of Remote Node.
+ * Returns value of IPv4 Router Id Of Remote Node.
*
- * @return rawValue IPv4 TE Router Id Of Remote Node
+ * @return rawValue IPv4 Router Id Of Remote Node
*/
public int getInt() {
return rawValue;
@@ -100,8 +100,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof IPv4TERouterIdOfRemoteNodeTlv) {
- IPv4TERouterIdOfRemoteNodeTlv other = (IPv4TERouterIdOfRemoteNodeTlv) obj;
+ if (obj instanceof IPv4RouterIdOfRemoteNodeSubTlv) {
+ IPv4RouterIdOfRemoteNodeSubTlv other = (IPv4RouterIdOfRemoteNodeSubTlv) obj;
return Objects.equals(rawValue, other.rawValue);
}
return false;
@@ -117,13 +117,13 @@
}
/**
- * Reads the channel buffer and returns object of IPv4TERouterIdOfRemoteNodeTlv.
+ * Reads the channel buffer and returns object of IPv4RouterIdOfRemoteNodeTlv.
*
* @param c input channel buffer
- * @return object of IPv4TERouterIdOfRemoteNodeTlv
+ * @return object of IPv4RouterIdOfRemoteNodeTlv
*/
- public static IPv4TERouterIdOfRemoteNodeTlv read(ChannelBuffer c) {
- return IPv4TERouterIdOfRemoteNodeTlv.of(c.readInt());
+ public static IPv4RouterIdOfRemoteNodeSubTlv read(ChannelBuffer c) {
+ return IPv4RouterIdOfRemoteNodeSubTlv.of(c.readInt());
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6InterfaceAddressTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6InterfaceAddressSubTlv.java
similarity index 83%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6InterfaceAddressTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6InterfaceAddressSubTlv.java
index 386de1d..fe09d8b 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6InterfaceAddressTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6InterfaceAddressSubTlv.java
@@ -27,22 +27,22 @@
/**
* Provides IPv6 Interface Address. REFERENCE :[RFC6119]/4.2.
*/
-public class IPv6InterfaceAddressTlv implements PcepValueType {
+public class IPv6InterfaceAddressSubTlv implements PcepValueType {
- protected static final Logger log = LoggerFactory.getLogger(IPv6InterfaceAddressTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(IPv6InterfaceAddressSubTlv.class);
- public static final short TYPE = 12; //TDB18
+ public static final short TYPE = 9;
public static final short LENGTH = 20;
public static final byte VALUE_LENGTH = 18;
private static final byte[] NONE_VAL = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- public static final IPv6InterfaceAddressTlv NONE = new IPv6InterfaceAddressTlv(NONE_VAL);
+ public static final IPv6InterfaceAddressSubTlv NONE = new IPv6InterfaceAddressSubTlv(NONE_VAL);
private static final byte[] NO_MASK_VAL = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
- public static final IPv6InterfaceAddressTlv NO_MASK = new IPv6InterfaceAddressTlv(NO_MASK_VAL);
- public static final IPv6InterfaceAddressTlv FULL_MASK = NONE;
+ public static final IPv6InterfaceAddressSubTlv NO_MASK = new IPv6InterfaceAddressSubTlv(NO_MASK_VAL);
+ public static final IPv6InterfaceAddressSubTlv FULL_MASK = NONE;
private final byte[] rawValue;
@@ -51,7 +51,7 @@
*
* @param rawValue IPv6 Interface Address Tlv
*/
- public IPv6InterfaceAddressTlv(byte[] rawValue) {
+ public IPv6InterfaceAddressSubTlv(byte[] rawValue) {
log.debug("IPv6InterfaceAddressTlv");
this.rawValue = rawValue;
}
@@ -62,7 +62,7 @@
* @param raw IPv6 Interface Address
* @return object of IPv6InterfaceAddressTlv
*/
- public static IPv6InterfaceAddressTlv of(final byte[] raw) {
+ public static IPv6InterfaceAddressSubTlv of(final byte[] raw) {
//check NONE_VAL
boolean bFoundNone = true;
//value starts from 3rd byte.
@@ -88,7 +88,7 @@
return NO_MASK;
}
- return new IPv6InterfaceAddressTlv(raw);
+ return new IPv6InterfaceAddressSubTlv(raw);
}
/**
@@ -134,8 +134,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof IPv6InterfaceAddressTlv) {
- IPv6InterfaceAddressTlv other = (IPv6InterfaceAddressTlv) obj;
+ if (obj instanceof IPv6InterfaceAddressSubTlv) {
+ IPv6InterfaceAddressSubTlv other = (IPv6InterfaceAddressSubTlv) obj;
return Arrays.equals(rawValue, other.rawValue);
}
return false;
@@ -156,10 +156,10 @@
* @param c input channel buffer
* @return object of IPv6InterfaceAddressTlv
*/
- public static IPv6InterfaceAddressTlv read20Bytes(ChannelBuffer c) {
+ public static IPv6InterfaceAddressSubTlv read20Bytes(ChannelBuffer c) {
byte[] yTemp = new byte[20];
c.readBytes(yTemp, 0, 20);
- return IPv6InterfaceAddressTlv.of(yTemp);
+ return IPv6InterfaceAddressSubTlv.of(yTemp);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6NeighborAddressTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6NeighborAddressSubTlv.java
similarity index 83%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6NeighborAddressTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6NeighborAddressSubTlv.java
index 3684af9..206cb31 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6NeighborAddressTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6NeighborAddressSubTlv.java
@@ -27,21 +27,21 @@
/**
* Provides IPv6 Neighbor Address. Reference :[RFC6119]/4.3.
*/
-public class IPv6NeighborAddressTlv implements PcepValueType {
- protected static final Logger log = LoggerFactory.getLogger(IPv6NeighborAddressTlv.class);
+public class IPv6NeighborAddressSubTlv implements PcepValueType {
+ protected static final Logger log = LoggerFactory.getLogger(IPv6NeighborAddressSubTlv.class);
- public static final short TYPE = 13; // TDB19
+ public static final short TYPE = 10;
public static final short LENGTH = 20;
public static final byte VALUE_LENGTH = 18;
private static final byte[] NONE_VAL = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- public static final IPv6NeighborAddressTlv NONE = new IPv6NeighborAddressTlv(NONE_VAL);
+ public static final IPv6NeighborAddressSubTlv NONE = new IPv6NeighborAddressSubTlv(NONE_VAL);
private static final byte[] NO_MASK_VAL = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
- public static final IPv6NeighborAddressTlv NO_MASK = new IPv6NeighborAddressTlv(NO_MASK_VAL);
- public static final IPv6NeighborAddressTlv FULL_MASK = NONE;
+ public static final IPv6NeighborAddressSubTlv NO_MASK = new IPv6NeighborAddressSubTlv(NO_MASK_VAL);
+ public static final IPv6NeighborAddressSubTlv FULL_MASK = NONE;
private final byte[] rawValue;
@@ -50,7 +50,7 @@
*
* @param rawValue IPv6 Neighbor Address Tlv
*/
- public IPv6NeighborAddressTlv(byte[] rawValue) {
+ public IPv6NeighborAddressSubTlv(byte[] rawValue) {
this.rawValue = rawValue;
}
@@ -60,7 +60,7 @@
* @param raw IPv6 Neighbor Address
* @return object of IPv6 Neighbor Address Tlv
*/
- public static IPv6NeighborAddressTlv of(final byte[] raw) {
+ public static IPv6NeighborAddressSubTlv of(final byte[] raw) {
//check NONE_VAL
boolean bFoundNone = true;
//value starts from 3rd byte.
@@ -86,7 +86,7 @@
return NO_MASK;
}
- return new IPv6NeighborAddressTlv(raw);
+ return new IPv6NeighborAddressSubTlv(raw);
}
/**
@@ -132,8 +132,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof IPv6NeighborAddressTlv) {
- IPv6NeighborAddressTlv other = (IPv6NeighborAddressTlv) obj;
+ if (obj instanceof IPv6NeighborAddressSubTlv) {
+ IPv6NeighborAddressSubTlv other = (IPv6NeighborAddressSubTlv) obj;
return Arrays.equals(rawValue, other.rawValue);
}
return false;
@@ -154,10 +154,10 @@
* @param c input channel buffer
* @return object of IPv6NeighborAddressTlv
*/
- public static IPv6NeighborAddressTlv read20Bytes(ChannelBuffer c) {
+ public static IPv6NeighborAddressSubTlv read20Bytes(ChannelBuffer c) {
byte[] yTemp = new byte[20];
c.readBytes(yTemp, 0, 20);
- return IPv6NeighborAddressTlv.of(yTemp);
+ return IPv6NeighborAddressSubTlv.of(yTemp);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6TERouterIdofLocalNodeTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6RouterIdofLocalNodeSubTlv.java
similarity index 77%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6TERouterIdofLocalNodeTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6RouterIdofLocalNodeSubTlv.java
index 7330fa0..40616e4 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6TERouterIdofLocalNodeTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6RouterIdofLocalNodeSubTlv.java
@@ -27,40 +27,40 @@
/**
* Provides IPv6 TE Router Id of Local Node. Reference :[RFC6119]/4.1.
*/
-public class IPv6TERouterIdofLocalNodeTlv implements PcepValueType {
- protected static final Logger log = LoggerFactory.getLogger(IPv6TERouterIdofLocalNodeTlv.class);
+public class IPv6RouterIdofLocalNodeSubTlv implements PcepValueType {
+ protected static final Logger log = LoggerFactory.getLogger(IPv6RouterIdofLocalNodeSubTlv.class);
- public static final short TYPE = 140; //TDB26
+ public static final short TYPE = 18;
public static final short LENGTH = 20;
public static final byte VALUE_LENGTH = 18;
private static final byte[] NONE_VAL = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- public static final IPv6TERouterIdofLocalNodeTlv NONE = new IPv6TERouterIdofLocalNodeTlv(NONE_VAL);
+ public static final IPv6RouterIdofLocalNodeSubTlv NONE = new IPv6RouterIdofLocalNodeSubTlv(NONE_VAL);
private static final byte[] NO_MASK_VAL = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF };
- public static final IPv6TERouterIdofLocalNodeTlv NO_MASK = new IPv6TERouterIdofLocalNodeTlv(NO_MASK_VAL);
- public static final IPv6TERouterIdofLocalNodeTlv FULL_MASK = NONE;
+ public static final IPv6RouterIdofLocalNodeSubTlv NO_MASK = new IPv6RouterIdofLocalNodeSubTlv(NO_MASK_VAL);
+ public static final IPv6RouterIdofLocalNodeSubTlv FULL_MASK = NONE;
private final byte[] rawValue;
/**
* Constructor to initialize rawValue.
*
- * @param rawValue IPv6TERouterIdofLocalNodeTlv
+ * @param rawValue IPv6RouterIdofLocalNodeTlv
*/
- public IPv6TERouterIdofLocalNodeTlv(byte[] rawValue) {
+ public IPv6RouterIdofLocalNodeSubTlv(byte[] rawValue) {
this.rawValue = rawValue;
}
/**
- * Returns newly created IPv6TERouterIdofLocalNodeTlv object.
+ * Returns newly created IPv6RouterIdofLocalNodeTlv object.
*
* @param raw IPv6 TE Router Id of Local Node
- * @return object of IPv6TERouterIdofLocalNodeTlv
+ * @return object of IPv6RouterIdofLocalNodeTlv
*/
- public static IPv6TERouterIdofLocalNodeTlv of(final byte[] raw) {
+ public static IPv6RouterIdofLocalNodeSubTlv of(final byte[] raw) {
//check NONE_VAL
boolean bFoundNone = true;
//value starts from 3rd byte.
@@ -86,7 +86,7 @@
return NO_MASK;
}
- return new IPv6TERouterIdofLocalNodeTlv(raw);
+ return new IPv6RouterIdofLocalNodeSubTlv(raw);
}
/**
@@ -132,8 +132,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof IPv6TERouterIdofLocalNodeTlv) {
- IPv6TERouterIdofLocalNodeTlv other = (IPv6TERouterIdofLocalNodeTlv) obj;
+ if (obj instanceof IPv6RouterIdofLocalNodeSubTlv) {
+ IPv6RouterIdofLocalNodeSubTlv other = (IPv6RouterIdofLocalNodeSubTlv) obj;
return Arrays.equals(rawValue, other.rawValue);
}
return false;
@@ -149,15 +149,15 @@
}
/**
- * Reads the channel buffer and returns object of IPv6TERouterIdofLocalNodeTlv.
+ * Reads the channel buffer and returns object of IPv6RouterIdofLocalNodeTlv.
*
* @param c input channel buffer
- * @return object of IPv6TERouterIdofLocalNodeTlv
+ * @return object of IPv6RouterIdofLocalNodeTlv
*/
- public static IPv6TERouterIdofLocalNodeTlv read20Bytes(ChannelBuffer c) {
+ public static IPv6RouterIdofLocalNodeSubTlv read20Bytes(ChannelBuffer c) {
byte[] yTemp = new byte[20];
c.readBytes(yTemp, 0, 20);
- return IPv6TERouterIdofLocalNodeTlv.of(yTemp);
+ return IPv6RouterIdofLocalNodeSubTlv.of(yTemp);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6TERouterIdofRemoteNodeTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6RouterIdofRemoteNodeSubTlv.java
similarity index 75%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6TERouterIdofRemoteNodeTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6RouterIdofRemoteNodeSubTlv.java
index dd24788..3880824 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6TERouterIdofRemoteNodeTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IPv6RouterIdofRemoteNodeSubTlv.java
@@ -27,41 +27,41 @@
/**
* Provides IPv6 TE Router Id of Remote Node. Reference :[RFC6119]/4.1.
*/
-public class IPv6TERouterIdofRemoteNodeTlv implements PcepValueType {
- protected static final Logger log = LoggerFactory.getLogger(IPv6TERouterIdofRemoteNodeTlv.class);
+public class IPv6RouterIdofRemoteNodeSubTlv implements PcepValueType {
+ protected static final Logger log = LoggerFactory.getLogger(IPv6RouterIdofRemoteNodeSubTlv.class);
- public static final short TYPE = 1400; //TDB29
+ public static final short TYPE = 20;
public static final short LENGTH = 20;
public static final byte VALUE_LENGTH = 18;
private static final byte[] NONE_VAL = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- public static final IPv6TERouterIdofRemoteNodeTlv NONE = new IPv6TERouterIdofRemoteNodeTlv(NONE_VAL);
+ public static final IPv6RouterIdofRemoteNodeSubTlv NONE = new IPv6RouterIdofRemoteNodeSubTlv(NONE_VAL);
private static final byte[] NO_MASK_VAL = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
- public static final IPv6TERouterIdofRemoteNodeTlv NO_MASK = new IPv6TERouterIdofRemoteNodeTlv(NO_MASK_VAL);
- public static final IPv6TERouterIdofRemoteNodeTlv FULL_MASK = NONE;
+ public static final IPv6RouterIdofRemoteNodeSubTlv NO_MASK = new IPv6RouterIdofRemoteNodeSubTlv(NO_MASK_VAL);
+ public static final IPv6RouterIdofRemoteNodeSubTlv FULL_MASK = NONE;
private final byte[] rawValue;
/**
* constructor to initialize rawValue.
*
- * @param rawValue IPv6TERouterIdofRemoteNodeTlv
+ * @param rawValue IPv6RouterIdofRemoteNodeTlv
*/
- public IPv6TERouterIdofRemoteNodeTlv(byte[] rawValue) {
- log.debug("IPv6TERouterIdofRemoteNodeTlv");
+ public IPv6RouterIdofRemoteNodeSubTlv(byte[] rawValue) {
+ log.debug("IPv6RouterIdofRemoteNodeTlv");
this.rawValue = rawValue;
}
/**
- * Returns newly created IPv6TERouterIdofRemoteNodeTlv object.
+ * Returns newly created IPv6RouterIdofRemoteNodeTlv object.
*
* @param raw IPv6 TE Router Id of RemoteNode
- * @return object of IPv6TERouterIdofRemoteNodeTlv
+ * @return object of IPv6RouterIdofRemoteNodeTlv
*/
- public static IPv6TERouterIdofRemoteNodeTlv of(final byte[] raw) {
+ public static IPv6RouterIdofRemoteNodeSubTlv of(final byte[] raw) {
//check NONE_VAL
boolean bFoundNone = true;
//value starts from 3rd byte.
@@ -87,7 +87,7 @@
return NO_MASK;
}
- return new IPv6TERouterIdofRemoteNodeTlv(raw);
+ return new IPv6RouterIdofRemoteNodeSubTlv(raw);
}
/**
@@ -124,8 +124,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof IPv6TERouterIdofRemoteNodeTlv) {
- IPv6TERouterIdofRemoteNodeTlv other = (IPv6TERouterIdofRemoteNodeTlv) obj;
+ if (obj instanceof IPv6RouterIdofRemoteNodeSubTlv) {
+ IPv6RouterIdofRemoteNodeSubTlv other = (IPv6RouterIdofRemoteNodeSubTlv) obj;
return Arrays.equals(rawValue, other.rawValue);
}
return false;
@@ -141,15 +141,15 @@
}
/**
- * Reads the channel buffer and returns object of IPv6TERouterIdofRemoteNodeTlv.
+ * Reads the channel buffer and returns object of IPv6RouterIdofRemoteNodeTlv.
*
* @param c input channel buffer
- * @return object of IPv6TERouterIdofRemoteNodeTlv
+ * @return object of IPv6RouterIdofRemoteNodeTlv
*/
- public static IPv6TERouterIdofRemoteNodeTlv read20Bytes(ChannelBuffer c) {
+ public static IPv6RouterIdofRemoteNodeSubTlv read20Bytes(ChannelBuffer c) {
byte[] yTemp = new byte[20];
c.readBytes(yTemp, 0, 20);
- return IPv6TERouterIdofRemoteNodeTlv.of(yTemp);
+ return IPv6RouterIdofRemoteNodeSubTlv.of(yTemp);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IgpMetricTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IgpMetricSubTlv.java
similarity index 88%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IgpMetricTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IgpMetricSubTlv.java
index fb8eee3..6aff439 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IgpMetricTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IgpMetricSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provides IGP Link Metric .
*/
-public class IgpMetricTlv implements PcepValueType {
+public class IgpMetricSubTlv implements PcepValueType {
/* Reference :[I-D.ietf-idr-ls-distribution] /3.3.2.4
* 0 1 2 3
@@ -39,9 +39,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(IgpMetricTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(IgpMetricSubTlv.class);
- public static final short TYPE = 1095; //TODO:NEED TO HANDLE TDB40
+ public static final short TYPE = 29;
private short hLength;
private final byte[] rawValue;
@@ -52,7 +52,7 @@
* @param rawValue IGP Link Metric
* @param hLength length
*/
- public IgpMetricTlv(byte[] rawValue, short hLength) {
+ public IgpMetricSubTlv(byte[] rawValue, short hLength) {
this.rawValue = rawValue;
this.hLength = hLength;
}
@@ -64,8 +64,8 @@
* @param hLength length
* @return object of IGPMetricTlv
*/
- public static IgpMetricTlv of(final byte[] raw, short hLength) {
- return new IgpMetricTlv(raw, hLength);
+ public static IgpMetricSubTlv of(final byte[] raw, short hLength) {
+ return new IgpMetricSubTlv(raw, hLength);
}
/**
@@ -102,8 +102,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof IgpMetricTlv) {
- IgpMetricTlv other = (IgpMetricTlv) obj;
+ if (obj instanceof IgpMetricSubTlv) {
+ IgpMetricSubTlv other = (IgpMetricSubTlv) obj;
return Arrays.equals(rawValue, other.rawValue);
}
return false;
@@ -128,7 +128,7 @@
public static PcepValueType read(ChannelBuffer c, short hLength) {
byte[] iIgpMetric = new byte[hLength];
c.readBytes(iIgpMetric, 0, hLength);
- return new IgpMetricTlv(iIgpMetric, hLength);
+ return new IgpMetricSubTlv(iIgpMetric, hLength);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/RouterIDSubTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IgpRouterIdSubTlv.java
similarity index 86%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/RouterIDSubTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IgpRouterIdSubTlv.java
index 228d853..9bc6ac7 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/RouterIDSubTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IgpRouterIdSubTlv.java
@@ -28,7 +28,7 @@
/**
* Provides router id.
*/
-public class RouterIDSubTlv implements PcepValueType {
+public class IgpRouterIdSubTlv implements PcepValueType {
/* reference :I-D.ietf-idr-ls-distribution.
* 0 1 2 3
@@ -40,9 +40,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(RouterIDSubTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(IgpRouterIdSubTlv.class);
- public static final short TYPE = 1000; //TODD:change this TBD13
+ public static final short TYPE = 4;
private final short hLength;
private final byte[] rawValue;
@@ -53,7 +53,7 @@
* @param rawValue raw value
* @param hLength length
*/
- public RouterIDSubTlv(byte[] rawValue, short hLength) {
+ public IgpRouterIdSubTlv(byte[] rawValue, short hLength) {
this.rawValue = rawValue;
if (0 == hLength) {
this.hLength = (short) rawValue.length;
@@ -69,8 +69,8 @@
* @param hLength length
* @return object of Router ID Sub Tlv
*/
- public static RouterIDSubTlv of(final byte[] raw, short hLength) {
- return new RouterIDSubTlv(raw, hLength);
+ public static IgpRouterIdSubTlv of(final byte[] raw, short hLength) {
+ return new IgpRouterIdSubTlv(raw, hLength);
}
/**
@@ -107,8 +107,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof RouterIDSubTlv) {
- RouterIDSubTlv other = (RouterIDSubTlv) obj;
+ if (obj instanceof IgpRouterIdSubTlv) {
+ IgpRouterIdSubTlv other = (IgpRouterIdSubTlv) obj;
return Arrays.equals(this.rawValue, other.rawValue);
}
return false;
@@ -124,16 +124,16 @@
}
/**
- * Reads channel buffer and returns object of RouterIDSubTlv.
+ * Reads channel buffer and returns object of IgpRouterIDTlv.
*
* @param c input channel buffer
* @param hLength length
- * @return object of RouterIDSubTlv
+ * @return object of IgpRouterIDTlv
*/
public static PcepValueType read(ChannelBuffer c, short hLength) {
byte[] iOpaqueValue = new byte[hLength];
c.readBytes(iOpaqueValue, 0, hLength);
- return new RouterIDSubTlv(iOpaqueValue, hLength);
+ return new IgpRouterIdSubTlv(iOpaqueValue, hLength);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IsisAreaIdentifierTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IsisAreaIdentifierSubTlv.java
similarity index 87%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IsisAreaIdentifierTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IsisAreaIdentifierSubTlv.java
index 4382fc5..fd0f1d7 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IsisAreaIdentifierTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/IsisAreaIdentifierSubTlv.java
@@ -28,7 +28,7 @@
/**
* Provides ISIS Area Identifier.
*/
-public class IsisAreaIdentifierTlv implements PcepValueType {
+public class IsisAreaIdentifierSubTlv implements PcepValueType {
/* Reference :[I-D.ietf-idr- ls-distribution]/3.3.1.2
* 0 1 2 3
@@ -40,9 +40,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(IsisAreaIdentifierTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(IsisAreaIdentifierSubTlv.class);
- public static final short TYPE = 107; //TODO:NEED TO HANDLE TBD24
+ public static final short TYPE = 16;
private short hLength;
private final byte[] rawValue;
@@ -53,7 +53,7 @@
* @param rawValue ISIS-Area-Identifier
* @param hLength length
*/
- public IsisAreaIdentifierTlv(byte[] rawValue, short hLength) {
+ public IsisAreaIdentifierSubTlv(byte[] rawValue, short hLength) {
log.debug("ISISAreaIdentifierTlv");
this.rawValue = rawValue;
if (0 == hLength) {
@@ -70,8 +70,8 @@
* @param hLength length
* @return object of ISISAreaIdentifierTlv
*/
- public static IsisAreaIdentifierTlv of(final byte[] raw, short hLength) {
- return new IsisAreaIdentifierTlv(raw, hLength);
+ public static IsisAreaIdentifierSubTlv of(final byte[] raw, short hLength) {
+ return new IsisAreaIdentifierSubTlv(raw, hLength);
}
/**
@@ -108,8 +108,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof IsisAreaIdentifierTlv) {
- IsisAreaIdentifierTlv other = (IsisAreaIdentifierTlv) obj;
+ if (obj instanceof IsisAreaIdentifierSubTlv) {
+ IsisAreaIdentifierSubTlv other = (IsisAreaIdentifierSubTlv) obj;
return Objects.equals(hLength, other.hLength) && Arrays.equals(rawValue, other.rawValue);
}
return false;
@@ -134,7 +134,7 @@
public static PcepValueType read(ChannelBuffer c, short hLength) {
byte[] iIsisAreaIdentifier = new byte[hLength];
c.readBytes(iIsisAreaIdentifier, 0, hLength);
- return new IsisAreaIdentifierTlv(iIsisAreaIdentifier, hLength);
+ return new IsisAreaIdentifierSubTlv(iIsisAreaIdentifier, hLength);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TELinkAttributesTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkAttributesTlv.java
similarity index 69%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TELinkAttributesTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkAttributesTlv.java
index 10e672e..7568509 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TELinkAttributesTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkAttributesTlv.java
@@ -17,6 +17,7 @@
import java.util.Iterator;
import java.util.LinkedList;
+import java.util.List;
import java.util.ListIterator;
import java.util.Objects;
@@ -29,12 +30,12 @@
import com.google.common.base.MoreObjects;
/**
- * Provides TELinkAttributesTlv.
+ * Provides LinkAttributesTlv.
*/
-public class TELinkAttributesTlv implements PcepValueType {
+public class LinkAttributesTlv implements PcepValueType {
/*
- * Reference :PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02
+ * Reference :draft-dhodylee-pce-pcep-ls-01, section 9.2.8.2.
* 0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -46,22 +47,22 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(TELinkAttributesTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(LinkAttributesTlv.class);
- public static final short TYPE = 1897; //TODD:change this TBD27
+ public static final short TYPE = (short) 65286;
public short hLength;
public static final int TLV_HEADER_LENGTH = 4;
// LinkDescriptors Sub-TLVs (variable)
- private LinkedList<PcepValueType> llLinkAttributesSubTLVs;
+ private List<PcepValueType> llLinkAttributesSubTLVs;
/**
* Constructor to initialize Link Attributes Sub TLVs.
*
* @param llLinkAttributesSubTLVs linked list of PcepValueType
*/
- public TELinkAttributesTlv(LinkedList<PcepValueType> llLinkAttributesSubTLVs) {
+ public LinkAttributesTlv(List<PcepValueType> llLinkAttributesSubTLVs) {
this.llLinkAttributesSubTLVs = llLinkAttributesSubTLVs;
}
@@ -69,10 +70,10 @@
* Returns object of TE Link Attributes TLV.
*
* @param llLinkAttributesSubTLVs linked list of Link Attribute of Sub TLV
- * @return object of TELinkAttributesTlv
+ * @return object of LinkAttributesTlv
*/
- public static TELinkAttributesTlv of(final LinkedList<PcepValueType> llLinkAttributesSubTLVs) {
- return new TELinkAttributesTlv(llLinkAttributesSubTLVs);
+ public static LinkAttributesTlv of(final List<PcepValueType> llLinkAttributesSubTLVs) {
+ return new LinkAttributesTlv(llLinkAttributesSubTLVs);
}
/**
@@ -80,7 +81,7 @@
*
* @return llLinkAttributesSubTLVs linked list of Link Attribute of Sub TLV
*/
- public LinkedList<PcepValueType> getllLinkAttributesSubTLVs() {
+ public List<PcepValueType> getllLinkAttributesSubTLVs() {
return llLinkAttributesSubTLVs;
}
@@ -117,13 +118,13 @@
* the size, if both are same then we should check for the subtlv objects otherwise
* we should return false.
*/
- if (obj instanceof TELinkAttributesTlv) {
+ if (obj instanceof LinkAttributesTlv) {
int countObjSubTlv = 0;
int countOtherSubTlv = 0;
boolean isCommonSubTlv = true;
- TELinkAttributesTlv other = (TELinkAttributesTlv) obj;
- Iterator<PcepValueType> objListIterator = ((TELinkAttributesTlv) obj).llLinkAttributesSubTLVs.iterator();
- countObjSubTlv = ((TELinkAttributesTlv) obj).llLinkAttributesSubTLVs.size();
+ LinkAttributesTlv other = (LinkAttributesTlv) obj;
+ Iterator<PcepValueType> objListIterator = ((LinkAttributesTlv) obj).llLinkAttributesSubTLVs.iterator();
+ countObjSubTlv = ((LinkAttributesTlv) obj).llLinkAttributesSubTLVs.size();
countOtherSubTlv = other.llLinkAttributesSubTLVs.size();
if (countObjSubTlv != countOtherSubTlv) {
return false;
@@ -180,13 +181,13 @@
*
* @param c input channel buffer
* @param hLength length
- * @return object of TELinkAttributesTlv
+ * @return object of LinkAttributesTlv
* @throws PcepParseException if mandatory fields are missing
*/
public static PcepValueType read(ChannelBuffer c, short hLength) throws PcepParseException {
// Node Descriptor Sub-TLVs (variable)
- LinkedList<PcepValueType> llLinkAttributesSubTLVs = new LinkedList<>();
+ List<PcepValueType> llLinkAttributesSubTLVs = new LinkedList<>();
ChannelBuffer tempCb = c.readBytes(hLength);
@@ -198,65 +199,65 @@
short length = tempCb.readShort();
switch (hType) {
- case IPv4TERouterIdOfLocalNodeTlv.TYPE:
+ case IPv4RouterIdOfLocalNodeSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new IPv4TERouterIdOfLocalNodeTlv(iValue);
+ tlv = new IPv4RouterIdOfLocalNodeSubTlv(iValue);
break;
- case IPv6TERouterIdofLocalNodeTlv.TYPE:
- byte[] ipv6LValue = new byte[IPv6TERouterIdofLocalNodeTlv.VALUE_LENGTH];
- tempCb.readBytes(ipv6LValue, 0, IPv6TERouterIdofLocalNodeTlv.VALUE_LENGTH);
- tlv = new IPv6TERouterIdofLocalNodeTlv(ipv6LValue);
+ case IPv6RouterIdofLocalNodeSubTlv.TYPE:
+ byte[] ipv6LValue = new byte[IPv6RouterIdofLocalNodeSubTlv.VALUE_LENGTH];
+ tempCb.readBytes(ipv6LValue, 0, IPv6RouterIdofLocalNodeSubTlv.VALUE_LENGTH);
+ tlv = new IPv6RouterIdofLocalNodeSubTlv(ipv6LValue);
break;
- case IPv4TERouterIdOfRemoteNodeTlv.TYPE:
+ case IPv4RouterIdOfRemoteNodeSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new IPv4TERouterIdOfRemoteNodeTlv(iValue);
+ tlv = new IPv4RouterIdOfRemoteNodeSubTlv(iValue);
break;
- case IPv6TERouterIdofRemoteNodeTlv.TYPE:
- byte[] ipv6RValue = new byte[IPv6TERouterIdofRemoteNodeTlv.VALUE_LENGTH];
- tempCb.readBytes(ipv6RValue, 0, IPv6TERouterIdofRemoteNodeTlv.VALUE_LENGTH);
- tlv = new IPv6TERouterIdofRemoteNodeTlv(ipv6RValue);
+ case IPv6RouterIdofRemoteNodeSubTlv.TYPE:
+ byte[] ipv6RValue = new byte[IPv6RouterIdofRemoteNodeSubTlv.VALUE_LENGTH];
+ tempCb.readBytes(ipv6RValue, 0, IPv6RouterIdofRemoteNodeSubTlv.VALUE_LENGTH);
+ tlv = new IPv6RouterIdofRemoteNodeSubTlv(ipv6RValue);
break;
- case LinkLocalRemoteIdentifiersTlv.TYPE:
- tlv = LinkLocalRemoteIdentifiersTlv.read(tempCb);
+ case LinkLocalRemoteIdentifiersSubTlv.TYPE:
+ tlv = LinkLocalRemoteIdentifiersSubTlv.read(tempCb);
break;
- case AdministrativeGroupTlv.TYPE:
+ case AdministrativeGroupSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new AdministrativeGroupTlv(iValue);
+ tlv = new AdministrativeGroupSubTlv(iValue);
break;
- case MaximumLinkBandwidthTlv.TYPE:
+ case MaximumLinkBandwidthSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new MaximumLinkBandwidthTlv(iValue);
+ tlv = new MaximumLinkBandwidthSubTlv(iValue);
break;
- case MaximumReservableLinkBandwidthTlv.TYPE:
+ case MaximumReservableLinkBandwidthSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new MaximumReservableLinkBandwidthTlv(iValue);
+ tlv = new MaximumReservableLinkBandwidthSubTlv(iValue);
break;
- case UnreservedBandwidthTlv.TYPE:
+ case UnreservedBandwidthSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new UnreservedBandwidthTlv(iValue);
+ tlv = new UnreservedBandwidthSubTlv(iValue);
break;
- case TEDefaultMetricTlv.TYPE:
+ case TEDefaultMetricSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new TEDefaultMetricTlv(iValue);
+ tlv = new TEDefaultMetricSubTlv(iValue);
break;
- case LinkProtectionTypeTlv.TYPE:
- tlv = LinkProtectionTypeTlv.read(tempCb);
+ case LinkProtectionTypeSubTlv.TYPE:
+ tlv = LinkProtectionTypeSubTlv.read(tempCb);
break;
- case MplsProtocolMaskTlv.TYPE:
+ case MplsProtocolMaskSubTlv.TYPE:
byte cValue = tempCb.readByte();
- tlv = new MplsProtocolMaskTlv(cValue);
+ tlv = new MplsProtocolMaskSubTlv(cValue);
break;
- case IgpMetricTlv.TYPE:
- tlv = IgpMetricTlv.read(tempCb, length);
+ case IgpMetricSubTlv.TYPE:
+ tlv = IgpMetricSubTlv.read(tempCb, length);
break;
- case SharedRiskLinkGroupTlv.TYPE:
- tlv = SharedRiskLinkGroupTlv.read(tempCb, length);
+ case SharedRiskLinkGroupSubTlv.TYPE:
+ tlv = SharedRiskLinkGroupSubTlv.read(tempCb, length);
break;
- case OpaqueLinkAttributeTlv.TYPE:
- tlv = OpaqueLinkAttributeTlv.read(tempCb, length);
+ case OpaqueLinkAttributeSubTlv.TYPE:
+ tlv = OpaqueLinkAttributeSubTlv.read(tempCb, length);
break;
- case LinkNameTlv.TYPE:
- tlv = LinkNameTlv.read(tempCb, length);
+ case LinkNameAttributeSubTlv.TYPE:
+ tlv = LinkNameAttributeSubTlv.read(tempCb, length);
break;
default:
throw new PcepParseException("Unsupported Sub TLV type :" + hType);
@@ -278,7 +279,7 @@
throw new PcepParseException("Sub Tlv parsing error. Extra bytes received.");
}
- return new TELinkAttributesTlv(llLinkAttributesSubTLVs);
+ return new LinkAttributesTlv(llLinkAttributesSubTLVs);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TELinkDescriptorsTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkDescriptorsTlv.java
similarity index 77%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TELinkDescriptorsTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkDescriptorsTlv.java
index b974cf8..0770421 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TELinkDescriptorsTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkDescriptorsTlv.java
@@ -17,6 +17,7 @@
import java.util.Iterator;
import java.util.LinkedList;
+import java.util.List;
import java.util.ListIterator;
import java.util.Objects;
@@ -31,10 +32,10 @@
/**
* Provides TE Link Descriptors TLV.
*/
-public class TELinkDescriptorsTlv implements PcepValueType {
+public class LinkDescriptorsTlv implements PcepValueType {
/*
- * Reference: PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02
+ * Reference: draft-dhodylee-pce-pcep-ls-01, section 9.2.6.
* 0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -47,33 +48,33 @@
*/
- protected static final Logger log = LoggerFactory.getLogger(TELinkDescriptorsTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(LinkDescriptorsTlv.class);
- public static final short TYPE = 1070; //TODD:change this TBD14
+ public static final short TYPE = (short) 65284;
public short hLength;
public static final int TLV_HEADER_LENGTH = 4;
// LinkDescriptors Sub-TLVs (variable)
- private LinkedList<PcepValueType> llLinkDescriptorsSubTLVs;
+ private List<PcepValueType> llLinkDescriptorsSubTLVs;
/**
* Constructor to initialize llLinkDescriptorsSubTLVs.
*
* @param llLinkDescriptorsSubTLVs of PcepValueType
*/
- public TELinkDescriptorsTlv(LinkedList<PcepValueType> llLinkDescriptorsSubTLVs) {
+ public LinkDescriptorsTlv(List<PcepValueType> llLinkDescriptorsSubTLVs) {
this.llLinkDescriptorsSubTLVs = llLinkDescriptorsSubTLVs;
}
/**
- * Returns object of TELinkDescriptorsTLV.
+ * Returns object of LinkDescriptorsTlv.
*
* @param llLinkDescriptorsSubTLVs of PcepValueType
- * @return object of TELinkDescriptorsTLV
+ * @return object of LinkDescriptorsTlv
*/
- public static TELinkDescriptorsTlv of(final LinkedList<PcepValueType> llLinkDescriptorsSubTLVs) {
- return new TELinkDescriptorsTlv(llLinkDescriptorsSubTLVs);
+ public static LinkDescriptorsTlv of(final List<PcepValueType> llLinkDescriptorsSubTLVs) {
+ return new LinkDescriptorsTlv(llLinkDescriptorsSubTLVs);
}
/**
@@ -81,7 +82,7 @@
*
* @return llLinkDescriptorsSubTLVs linked list of Link Attribute of Sub TLV
*/
- public LinkedList<PcepValueType> getllLinkDescriptorsSubTLVs() {
+ public List<PcepValueType> getllLinkDescriptorsSubTLVs() {
return llLinkDescriptorsSubTLVs;
}
@@ -118,13 +119,13 @@
* the size, if both are same then we should check for the subtlv objects otherwise
* we should return false.
*/
- if (obj instanceof TELinkDescriptorsTlv) {
+ if (obj instanceof LinkDescriptorsTlv) {
int countObjSubTlv = 0;
int countOtherSubTlv = 0;
boolean isCommonSubTlv = true;
- TELinkDescriptorsTlv other = (TELinkDescriptorsTlv) obj;
- Iterator<PcepValueType> objListIterator = ((TELinkDescriptorsTlv) obj).llLinkDescriptorsSubTLVs.iterator();
- countObjSubTlv = ((TELinkDescriptorsTlv) obj).llLinkDescriptorsSubTLVs.size();
+ LinkDescriptorsTlv other = (LinkDescriptorsTlv) obj;
+ Iterator<PcepValueType> objListIterator = ((LinkDescriptorsTlv) obj).llLinkDescriptorsSubTLVs.iterator();
+ countObjSubTlv = ((LinkDescriptorsTlv) obj).llLinkDescriptorsSubTLVs.size();
countOtherSubTlv = other.llLinkDescriptorsSubTLVs.size();
if (countObjSubTlv != countOtherSubTlv) {
return false;
@@ -173,17 +174,17 @@
}
/**
- * Reads channel buffer and returns object of TELinkDescriptorsTLV.
+ * Reads channel buffer and returns object of LinkDescriptorsTlv.
*
* @param c input channel buffer
* @param length length
- * @return object of TELinkDescriptorsTLV
+ * @return object of LinkDescriptorsTlv
* @throws PcepParseException if mandatory fields are missing
*/
public static PcepValueType read(ChannelBuffer c, short length) throws PcepParseException {
// Node Descriptor Sub-TLVs (variable)
- LinkedList<PcepValueType> llLinkDescriptorsSubTLVs = new LinkedList<>();
+ List<PcepValueType> llLinkDescriptorsSubTLVs = new LinkedList<>();
ChannelBuffer tempCb = c.readBytes(length);
@@ -196,26 +197,26 @@
log.debug("sub Tlv Length" + hLength);
switch (hType) {
- case LinkLocalRemoteIdentifiersTlv.TYPE:
- tlv = LinkLocalRemoteIdentifiersTlv.read(tempCb);
+ case LinkLocalRemoteIdentifiersSubTlv.TYPE:
+ tlv = LinkLocalRemoteIdentifiersSubTlv.read(tempCb);
break;
- case IPv4InterfaceAddressTlv.TYPE:
+ case IPv4InterfaceAddressSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new IPv4InterfaceAddressTlv(iValue);
+ tlv = new IPv4InterfaceAddressSubTlv(iValue);
break;
- case IPv4NeighborAddressTlv.TYPE:
+ case IPv4NeighborAddressSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new IPv4NeighborAddressTlv(iValue);
+ tlv = new IPv4NeighborAddressSubTlv(iValue);
break;
- case IPv6InterfaceAddressTlv.TYPE:
- byte[] ipv6Value = new byte[IPv6InterfaceAddressTlv.VALUE_LENGTH];
- tempCb.readBytes(ipv6Value, 0, IPv6InterfaceAddressTlv.VALUE_LENGTH);
- tlv = new IPv6InterfaceAddressTlv(ipv6Value);
+ case IPv6InterfaceAddressSubTlv.TYPE:
+ byte[] ipv6Value = new byte[IPv6InterfaceAddressSubTlv.VALUE_LENGTH];
+ tempCb.readBytes(ipv6Value, 0, IPv6InterfaceAddressSubTlv.VALUE_LENGTH);
+ tlv = new IPv6InterfaceAddressSubTlv(ipv6Value);
break;
- case IPv6NeighborAddressTlv.TYPE:
- byte[] ipv6NeighborAdd = new byte[IPv6NeighborAddressTlv.VALUE_LENGTH];
- tempCb.readBytes(ipv6NeighborAdd, 0, IPv6NeighborAddressTlv.VALUE_LENGTH);
- tlv = new IPv6NeighborAddressTlv(ipv6NeighborAdd);
+ case IPv6NeighborAddressSubTlv.TYPE:
+ byte[] ipv6NeighborAdd = new byte[IPv6NeighborAddressSubTlv.VALUE_LENGTH];
+ tempCb.readBytes(ipv6NeighborAdd, 0, IPv6NeighborAddressSubTlv.VALUE_LENGTH);
+ tlv = new IPv6NeighborAddressSubTlv(ipv6NeighborAdd);
break;
default:
throw new PcepParseException("Unsupported Sub TLV type:" + hType);
@@ -237,7 +238,7 @@
throw new PcepParseException("Sub Tlv parsing error. Extra bytes received.");
}
- return new TELinkDescriptorsTlv(llLinkDescriptorsSubTLVs);
+ return new LinkDescriptorsTlv(llLinkDescriptorsSubTLVs);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkLocalRemoteIdentifiersTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkLocalRemoteIdentifiersSubTlv.java
similarity index 86%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkLocalRemoteIdentifiersTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkLocalRemoteIdentifiersSubTlv.java
index 5fa0a4c..336c884 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkLocalRemoteIdentifiersTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkLocalRemoteIdentifiersSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provides Local and remote Link Identifiers.
*/
-public class LinkLocalRemoteIdentifiersTlv implements PcepValueType {
+public class LinkLocalRemoteIdentifiersSubTlv implements PcepValueType {
/* Reference :RFC5307
* 0 1 2 3
@@ -41,9 +41,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(LinkLocalRemoteIdentifiersTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(LinkLocalRemoteIdentifiersSubTlv.class);
- public static final short TYPE = 4;
+ public static final short TYPE = 6;
public static final short LENGTH = 8;
private final int iLinkLocalIdentifier;
private final int iLinkRemoteIdentifier;
@@ -54,7 +54,7 @@
* @param iLinkLocalIdentifier Link Local identifier
* @param iLinkRemoteIdentifier Link Remote identifier
*/
- public LinkLocalRemoteIdentifiersTlv(int iLinkLocalIdentifier, int iLinkRemoteIdentifier) {
+ public LinkLocalRemoteIdentifiersSubTlv(int iLinkLocalIdentifier, int iLinkRemoteIdentifier) {
this.iLinkLocalIdentifier = iLinkLocalIdentifier;
this.iLinkRemoteIdentifier = iLinkRemoteIdentifier;
}
@@ -66,8 +66,8 @@
* @param iLinkRemoteIdentifier Link Remote identifier
* @return object of LinkLocalRemoteIdentifiersTlv
*/
- public static LinkLocalRemoteIdentifiersTlv of(int iLinkLocalIdentifier, int iLinkRemoteIdentifier) {
- return new LinkLocalRemoteIdentifiersTlv(iLinkLocalIdentifier, iLinkRemoteIdentifier);
+ public static LinkLocalRemoteIdentifiersSubTlv of(int iLinkLocalIdentifier, int iLinkRemoteIdentifier) {
+ return new LinkLocalRemoteIdentifiersSubTlv(iLinkLocalIdentifier, iLinkRemoteIdentifier);
}
/**
@@ -113,8 +113,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof LinkLocalRemoteIdentifiersTlv) {
- LinkLocalRemoteIdentifiersTlv other = (LinkLocalRemoteIdentifiersTlv) obj;
+ if (obj instanceof LinkLocalRemoteIdentifiersSubTlv) {
+ LinkLocalRemoteIdentifiersSubTlv other = (LinkLocalRemoteIdentifiersSubTlv) obj;
return Objects.equals(iLinkLocalIdentifier, other.iLinkLocalIdentifier)
&& Objects.equals(iLinkRemoteIdentifier, other.iLinkRemoteIdentifier);
}
@@ -140,7 +140,7 @@
public static PcepValueType read(ChannelBuffer c) {
int iLinkLocalIdentifier = c.readInt();
int iLinkRemoteIdentifier = c.readInt();
- return new LinkLocalRemoteIdentifiersTlv(iLinkLocalIdentifier, iLinkRemoteIdentifier);
+ return new LinkLocalRemoteIdentifiersSubTlv(iLinkLocalIdentifier, iLinkRemoteIdentifier);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkNameTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkNameAttributeSubTlv.java
similarity index 87%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkNameTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkNameAttributeSubTlv.java
index 34dea5b..fe38db9 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkNameTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkNameAttributeSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provides the Link Name.
*/
-public class LinkNameTlv implements PcepValueType {
+public class LinkNameAttributeSubTlv implements PcepValueType {
/* Reference :[I-D.ietf-idr- ls-distribution] /3.3.2.7
* Link name tlv format.
@@ -40,9 +40,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(LinkNameTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(LinkNameAttributeSubTlv.class);
- public static final short TYPE = 1098; //TODO:NEED TO HANDLE TDB43
+ public static final short TYPE = 32;
private short hLength;
private final byte[] rawValue;
@@ -53,7 +53,7 @@
* @param rawValue Link-Name
* @param hLength length
*/
- public LinkNameTlv(byte[] rawValue, short hLength) {
+ public LinkNameAttributeSubTlv(byte[] rawValue, short hLength) {
this.rawValue = rawValue;
if (0 == hLength) {
this.hLength = (short) rawValue.length;
@@ -69,8 +69,8 @@
* @param hLength length
* @return object of LinkNameTlv
*/
- public static LinkNameTlv of(final byte[] raw, short hLength) {
- return new LinkNameTlv(raw, hLength);
+ public static LinkNameAttributeSubTlv of(final byte[] raw, short hLength) {
+ return new LinkNameAttributeSubTlv(raw, hLength);
}
/**
@@ -107,8 +107,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof LinkNameTlv) {
- LinkNameTlv other = (LinkNameTlv) obj;
+ if (obj instanceof LinkNameAttributeSubTlv) {
+ LinkNameAttributeSubTlv other = (LinkNameAttributeSubTlv) obj;
return Arrays.equals(this.rawValue, other.rawValue);
}
return false;
@@ -133,7 +133,7 @@
public static PcepValueType read(ChannelBuffer c, short hLength) {
byte[] linkName = new byte[hLength];
c.readBytes(linkName, 0, hLength);
- return new LinkNameTlv(linkName, hLength);
+ return new LinkNameAttributeSubTlv(linkName, hLength);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkProtectionTypeTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkProtectionTypeSubTlv.java
similarity index 88%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkProtectionTypeTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkProtectionTypeSubTlv.java
index a802d57..2fe60a3 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkProtectionTypeTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LinkProtectionTypeSubTlv.java
@@ -28,7 +28,7 @@
* Provide Link Protection Type.
*/
-public class LinkProtectionTypeTlv implements PcepValueType {
+public class LinkProtectionTypeSubTlv implements PcepValueType {
/* Reference :[RFC5307]/1.2
* 0 1 2 3
@@ -39,9 +39,9 @@
|Protection Cap | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(LinkProtectionTypeTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(LinkProtectionTypeSubTlv.class);
- public static final short TYPE = 20; //TDB38
+ public static final short TYPE = 27;
public static final short LENGTH = 2;
private final byte protectionCap;
private final byte reserved;
@@ -51,7 +51,7 @@
*
* @param protectionCap Protection Cap
*/
- public LinkProtectionTypeTlv(byte protectionCap) {
+ public LinkProtectionTypeSubTlv(byte protectionCap) {
this.protectionCap = protectionCap;
this.reserved = 0;
}
@@ -62,7 +62,7 @@
* @param protectionCap Protection Cap
* @param reserved Reserved value
*/
- public LinkProtectionTypeTlv(byte protectionCap, byte reserved) {
+ public LinkProtectionTypeSubTlv(byte protectionCap, byte reserved) {
this.protectionCap = protectionCap;
this.reserved = reserved;
}
@@ -101,8 +101,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof LinkProtectionTypeTlv) {
- LinkProtectionTypeTlv other = (LinkProtectionTypeTlv) obj;
+ if (obj instanceof LinkProtectionTypeSubTlv) {
+ LinkProtectionTypeSubTlv other = (LinkProtectionTypeSubTlv) obj;
return Objects.equals(protectionCap, other.protectionCap) && Objects.equals(reserved, other.reserved);
}
@@ -128,7 +128,7 @@
public static PcepValueType read(ChannelBuffer c) {
byte protectionCap = c.readByte();
byte reserved = c.readByte();
- return new LinkProtectionTypeTlv(protectionCap, reserved);
+ return new LinkProtectionTypeSubTlv(protectionCap, reserved);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LocalTENodeDescriptorsTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LocalNodeDescriptorsTlv.java
similarity index 81%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LocalTENodeDescriptorsTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LocalNodeDescriptorsTlv.java
index e2f9779..5f353e8 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LocalTENodeDescriptorsTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LocalNodeDescriptorsTlv.java
@@ -17,6 +17,7 @@
import java.util.Iterator;
import java.util.LinkedList;
+import java.util.List;
import java.util.ListIterator;
import java.util.Objects;
@@ -31,9 +32,9 @@
/**
* Provides Local TE Node Descriptors TLV which contains Node Descriptor Sub-TLVs.
*/
-public class LocalTENodeDescriptorsTlv implements PcepValueType {
+public class LocalNodeDescriptorsTlv implements PcepValueType {
- /* REFERENCE :draft-ietf-idr-ls-distribution-10
+ /* REFERENCE :draft-dhodylee-pce-pcep-ls-01, section 9.2.2
* 0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -46,32 +47,32 @@
Note: Length is including header here. Refer Routing Universe TLV.
*/
- protected static final Logger log = LoggerFactory.getLogger(LocalTENodeDescriptorsTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(LocalNodeDescriptorsTlv.class);
- public static final short TYPE = 1637; //TODD:change this TBD8
+ public static final short TYPE = (short) 65282;
public short hLength;
public static final int TLV_HEADER_LENGTH = 4;
// Node Descriptor Sub-TLVs (variable)
- private LinkedList<PcepValueType> llNodeDescriptorSubTLVs;
+ private List<PcepValueType> llNodeDescriptorSubTLVs;
/**
* Constructor to initialize llNodeDescriptorSubTLVs.
*
- * @param llNodeDescriptorSubTLVs LinkedList of PcepValueType
+ * @param llNodeDescriptorSubTLVs List of PcepValueType
*/
- public LocalTENodeDescriptorsTlv(LinkedList<PcepValueType> llNodeDescriptorSubTLVs) {
+ public LocalNodeDescriptorsTlv(List<PcepValueType> llNodeDescriptorSubTLVs) {
this.llNodeDescriptorSubTLVs = llNodeDescriptorSubTLVs;
}
/**
- * Returns a new object of LocalTENodeDescriptorsTLV.
+ * Returns a new object of LocalNodeDescriptorsTLV.
*
* @param llNodeDescriptorSubTLVs linked list of Node Descriptor Sub TLVs
- * @return object of LocalTENodeDescriptorsTLV
+ * @return object of LocalNodeDescriptorsTLV
*/
- public static LocalTENodeDescriptorsTlv of(final LinkedList<PcepValueType> llNodeDescriptorSubTLVs) {
- return new LocalTENodeDescriptorsTlv(llNodeDescriptorSubTLVs);
+ public static LocalNodeDescriptorsTlv of(final List<PcepValueType> llNodeDescriptorSubTLVs) {
+ return new LocalNodeDescriptorsTlv(llNodeDescriptorSubTLVs);
}
/**
@@ -79,7 +80,7 @@
*
* @return llNodeDescriptorSubTLVs linked list of Node Descriptor Sub TLV
*/
- public LinkedList<PcepValueType> getllNodeDescriptorSubTLVs() {
+ public List<PcepValueType> getllNodeDescriptorSubTLVs() {
return llNodeDescriptorSubTLVs;
}
@@ -117,14 +118,14 @@
* the size, if both are same then we should check for the subtlv objects otherwise
* we should return false.
*/
- if (obj instanceof LocalTENodeDescriptorsTlv) {
+ if (obj instanceof LocalNodeDescriptorsTlv) {
int countObjSubTlv = 0;
int countOtherSubTlv = 0;
boolean isCommonSubTlv = true;
- LocalTENodeDescriptorsTlv other = (LocalTENodeDescriptorsTlv) obj;
- Iterator<PcepValueType> objListIterator = ((LocalTENodeDescriptorsTlv) obj).llNodeDescriptorSubTLVs
+ LocalNodeDescriptorsTlv other = (LocalNodeDescriptorsTlv) obj;
+ Iterator<PcepValueType> objListIterator = ((LocalNodeDescriptorsTlv) obj).llNodeDescriptorSubTLVs
.iterator();
- countObjSubTlv = ((LocalTENodeDescriptorsTlv) obj).llNodeDescriptorSubTLVs.size();
+ countObjSubTlv = ((LocalNodeDescriptorsTlv) obj).llNodeDescriptorSubTLVs.size();
countOtherSubTlv = other.llNodeDescriptorSubTLVs.size();
if (countObjSubTlv != countOtherSubTlv) {
return false;
@@ -184,7 +185,7 @@
public static PcepValueType read(ChannelBuffer c, short hLength) throws PcepParseException {
// Node Descriptor Sub-TLVs (variable)
- LinkedList<PcepValueType> llNodeDescriptorSubTLVs = new LinkedList<>();
+ List<PcepValueType> llNodeDescriptorSubTLVs = new LinkedList<>();
ChannelBuffer tempCb = c.readBytes(hLength);
@@ -197,20 +198,20 @@
switch (hType) {
- case AutonomousSystemTlv.TYPE:
+ case AutonomousSystemSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new AutonomousSystemTlv(iValue);
+ tlv = new AutonomousSystemSubTlv(iValue);
break;
- case BgpLsIdentifierTlv.TYPE:
+ case BgpLsIdentifierSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new BgpLsIdentifierTlv(iValue);
+ tlv = new BgpLsIdentifierSubTlv(iValue);
break;
case OspfAreaIdSubTlv.TYPE:
iValue = tempCb.readInt();
tlv = new OspfAreaIdSubTlv(iValue);
break;
- case RouterIDSubTlv.TYPE:
- tlv = RouterIDSubTlv.read(tempCb, length);
+ case IgpRouterIdSubTlv.TYPE:
+ tlv = IgpRouterIdSubTlv.read(tempCb, length);
break;
default:
@@ -232,7 +233,7 @@
if (0 < tempCb.readableBytes()) {
throw new PcepParseException("Sub Tlv parsing error. Extra bytes received.");
}
- return new LocalTENodeDescriptorsTlv(llNodeDescriptorSubTLVs);
+ return new LocalNodeDescriptorsTlv(llNodeDescriptorSubTLVs);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TedCapabilityTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LsCapabilityTlv.java
similarity index 74%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TedCapabilityTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LsCapabilityTlv.java
index 189dcad..549ac38 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TedCapabilityTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/LsCapabilityTlv.java
@@ -27,10 +27,10 @@
/**
* Provides TED Capability Tlv.
*/
-public class TedCapabilityTlv implements PcepValueType {
+public class LsCapabilityTlv implements PcepValueType {
/*
- * Reference :PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02
+ * Reference :draft-dhodylee-pce-pcep-ls-01, section 9.1.1.
* 0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -40,14 +40,14 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(TedCapabilityTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(LsCapabilityTlv.class);
- public static final short TYPE = 132; //TODO: need to change this TBD5
+ public static final short TYPE = (short) 65280;
public static final short LENGTH = 4;
public static final int SET = 1;
public static final byte RFLAG_CHECK = 0x01;
- private final boolean bRFlag;
+ private final boolean rFlag;
private final int rawValue;
private final boolean isRawValueSet;
@@ -56,26 +56,26 @@
*
* @param rawValue Flags
*/
- public TedCapabilityTlv(final int rawValue) {
+ public LsCapabilityTlv(final int rawValue) {
this.rawValue = rawValue;
this.isRawValueSet = true;
int temp = rawValue;
temp = temp & RFLAG_CHECK;
if (temp == SET) {
- this.bRFlag = true;
+ this.rFlag = true;
} else {
- this.bRFlag = false;
+ this.rFlag = false;
}
}
/**
- * Constructor to initialize bRFlag.
+ * Constructor to initialize rFlag.
*
- * @param bRFlag R-flag
+ * @param rFlag R-flag
*/
- public TedCapabilityTlv(boolean bRFlag) {
- this.bRFlag = bRFlag;
+ public LsCapabilityTlv(boolean rFlag) {
+ this.rFlag = rFlag;
this.rawValue = 0;
this.isRawValueSet = false;
}
@@ -83,20 +83,20 @@
/**
* Returns R-flag.
*
- * @return bRFlag
+ * @return rFlag
*/
- public boolean getbRFlag() {
- return bRFlag;
+ public boolean getrFlag() {
+ return rFlag;
}
/**
- * Returns an object of TedCapabilityTlv.
+ * Returns an object of LsCapabilityTlv.
*
* @param raw value Flags
- * @return object of TedCapabilityTlv
+ * @return object of LsCapabilityTlv
*/
- public static TedCapabilityTlv of(final int raw) {
- return new TedCapabilityTlv(raw);
+ public static LsCapabilityTlv of(final int raw) {
+ return new LsCapabilityTlv(raw);
}
@Override
@@ -123,7 +123,7 @@
if (isRawValueSet) {
return Objects.hash(rawValue);
} else {
- return Objects.hash(bRFlag);
+ return Objects.hash(rFlag);
}
}
@@ -132,12 +132,12 @@
if (this == obj) {
return true;
}
- if (obj instanceof TedCapabilityTlv) {
- TedCapabilityTlv other = (TedCapabilityTlv) obj;
+ if (obj instanceof LsCapabilityTlv) {
+ LsCapabilityTlv other = (LsCapabilityTlv) obj;
if (isRawValueSet) {
return Objects.equals(this.rawValue, other.rawValue);
} else {
- return Objects.equals(this.bRFlag, other.bRFlag);
+ return Objects.equals(this.rFlag, other.rFlag);
}
}
return false;
@@ -152,7 +152,7 @@
if (isRawValueSet) {
c.writeInt(rawValue);
} else {
- if (bRFlag) {
+ if (rFlag) {
temp = temp | RFLAG_CHECK;
}
c.writeInt(temp);
@@ -161,13 +161,13 @@
}
/**
- * Reads channel buffer and returns object of TedCapabilityTlv.
+ * Reads channel buffer and returns object of LsCapabilityTlv.
*
* @param c input channel buffer
- * @return object of TedCapabilityTlv
+ * @return object of LsCapabilityTlv
*/
- public static TedCapabilityTlv read(ChannelBuffer c) {
- return TedCapabilityTlv.of(c.readInt());
+ public static LsCapabilityTlv read(ChannelBuffer c) {
+ return LsCapabilityTlv.of(c.readInt());
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MaximumLinkBandwidthTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MaximumLinkBandwidthSubTlv.java
similarity index 85%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MaximumLinkBandwidthTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MaximumLinkBandwidthSubTlv.java
index db1acf0..5b11792 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MaximumLinkBandwidthTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MaximumLinkBandwidthSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provide the Maximum Link Bandwidth.
*/
-public class MaximumLinkBandwidthTlv implements PcepValueType {
+public class MaximumLinkBandwidthSubTlv implements PcepValueType {
/* Reference :[RFC5305]/3.3.
* 0 1 2 3
@@ -39,9 +39,9 @@
+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-
*/
- protected static final Logger log = LoggerFactory.getLogger(MaximumLinkBandwidthTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(MaximumLinkBandwidthSubTlv.class);
- public static final short TYPE = 9; //TDB34
+ public static final short TYPE = 23;
public static final short LENGTH = 4;
private final int rawValue;
@@ -52,7 +52,7 @@
* @param rawValue Maximum-Link-Bandwidth
*/
- public MaximumLinkBandwidthTlv(int rawValue) {
+ public MaximumLinkBandwidthSubTlv(int rawValue) {
this.rawValue = rawValue;
}
@@ -62,8 +62,8 @@
* @param raw value of Maximum-Link-Bandwidth
* @return object of MaximumLinkBandwidthTlv
*/
- public static MaximumLinkBandwidthTlv of(final int raw) {
- return new MaximumLinkBandwidthTlv(raw);
+ public static MaximumLinkBandwidthSubTlv of(final int raw) {
+ return new MaximumLinkBandwidthSubTlv(raw);
}
/**
@@ -100,8 +100,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof MaximumLinkBandwidthTlv) {
- MaximumLinkBandwidthTlv other = (MaximumLinkBandwidthTlv) obj;
+ if (obj instanceof MaximumLinkBandwidthSubTlv) {
+ MaximumLinkBandwidthSubTlv other = (MaximumLinkBandwidthSubTlv) obj;
return Objects.equals(rawValue, other.rawValue);
}
return false;
@@ -122,8 +122,8 @@
* @param c input channel buffer
* @return object of MaximumLinkBandwidthTlv
*/
- public static MaximumLinkBandwidthTlv read(ChannelBuffer c) {
- return MaximumLinkBandwidthTlv.of(c.readInt());
+ public static MaximumLinkBandwidthSubTlv read(ChannelBuffer c) {
+ return MaximumLinkBandwidthSubTlv.of(c.readInt());
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MaximumReservableLinkBandwidthTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MaximumReservableLinkBandwidthSubTlv.java
similarity index 83%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MaximumReservableLinkBandwidthTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MaximumReservableLinkBandwidthSubTlv.java
index 01d08ca..ece6b79e 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MaximumReservableLinkBandwidthTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MaximumReservableLinkBandwidthSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provide the Maximum Reservable Link Bandwidth.
*/
-public class MaximumReservableLinkBandwidthTlv implements PcepValueType {
+public class MaximumReservableLinkBandwidthSubTlv implements PcepValueType {
/* Reference :[RFC5305]/3.5.
* 0 1 2 3
@@ -39,9 +39,9 @@
+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-
*/
- protected static final Logger log = LoggerFactory.getLogger(MaximumReservableLinkBandwidthTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(MaximumReservableLinkBandwidthSubTlv.class);
- public static final short TYPE = 10; // TDB35
+ public static final short TYPE = 24;
public static final short LENGTH = 4;
private final int rawValue;
@@ -51,7 +51,7 @@
*
* @param rawValue MaximumReservableLinkBandwidth
*/
- public MaximumReservableLinkBandwidthTlv(int rawValue) {
+ public MaximumReservableLinkBandwidthSubTlv(int rawValue) {
log.debug("MaximumReservableLinkBandwidthTlv");
this.rawValue = rawValue;
}
@@ -62,8 +62,8 @@
* @param raw MaximumReservableLinkBandwidth
* @return object of MaximumReservableLinkBandwidthTlv
*/
- public static MaximumReservableLinkBandwidthTlv of(final int raw) {
- return new MaximumReservableLinkBandwidthTlv(raw);
+ public static MaximumReservableLinkBandwidthSubTlv of(final int raw) {
+ return new MaximumReservableLinkBandwidthSubTlv(raw);
}
/**
@@ -99,8 +99,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof MaximumReservableLinkBandwidthTlv) {
- MaximumReservableLinkBandwidthTlv other = (MaximumReservableLinkBandwidthTlv) obj;
+ if (obj instanceof MaximumReservableLinkBandwidthSubTlv) {
+ MaximumReservableLinkBandwidthSubTlv other = (MaximumReservableLinkBandwidthSubTlv) obj;
return Objects.equals(this.rawValue, other.rawValue);
}
return false;
@@ -121,8 +121,8 @@
* @param c input channel buffer
* @return object of MaximumReservableLinkBandwidthTlv
*/
- public static MaximumReservableLinkBandwidthTlv read(ChannelBuffer c) {
- return MaximumReservableLinkBandwidthTlv.of(c.readInt());
+ public static MaximumReservableLinkBandwidthSubTlv read(ChannelBuffer c) {
+ return MaximumReservableLinkBandwidthSubTlv.of(c.readInt());
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MplsProtocolMaskTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MplsProtocolMaskSubTlv.java
similarity index 89%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MplsProtocolMaskTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MplsProtocolMaskSubTlv.java
index 95f8514..d47dc21 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MplsProtocolMaskTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/MplsProtocolMaskSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provides MPLS Protocol Mask.
*/
-public class MplsProtocolMaskTlv implements PcepValueType {
+public class MplsProtocolMaskSubTlv implements PcepValueType {
/* Reference :[I-D.ietf-idr-ls-distribution]/3.3.2.2
* 0 1 2 3
@@ -38,9 +38,9 @@
|L|R| Reserved |
+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(MplsProtocolMaskTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(MplsProtocolMaskSubTlv.class);
- public static final short TYPE = 1094; //TDB39
+ public static final short TYPE = 28;
public static final short LENGTH = 1;
public static final byte LFLAG_SET = (byte) 0x80;
public static final byte RFLAG_SET = 0x40;
@@ -55,7 +55,7 @@
*
* @param rawValue MPLS Protocol Mask Flag Bits
*/
- public MplsProtocolMaskTlv(byte rawValue) {
+ public MplsProtocolMaskSubTlv(byte rawValue) {
this.rawValue = rawValue;
this.isRawValueSet = true;
this.bLFlag = (rawValue & LFLAG_SET) == LFLAG_SET;
@@ -68,7 +68,7 @@
* @param bLFlag L-flag
* @param bRFlag R-flag
*/
- public MplsProtocolMaskTlv(boolean bLFlag, boolean bRFlag) {
+ public MplsProtocolMaskSubTlv(boolean bLFlag, boolean bRFlag) {
this.bLFlag = bLFlag;
this.bRFlag = bRFlag;
this.rawValue = 0;
@@ -81,8 +81,8 @@
* @param raw MPLS Protocol Mask Tlv
* @return new object of MPLS Protocol Mask Tlv
*/
- public static MplsProtocolMaskTlv of(final byte raw) {
- return new MplsProtocolMaskTlv(raw);
+ public static MplsProtocolMaskSubTlv of(final byte raw) {
+ return new MplsProtocolMaskSubTlv(raw);
}
/**
@@ -141,8 +141,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof MplsProtocolMaskTlv) {
- MplsProtocolMaskTlv other = (MplsProtocolMaskTlv) obj;
+ if (obj instanceof MplsProtocolMaskSubTlv) {
+ MplsProtocolMaskSubTlv other = (MplsProtocolMaskSubTlv) obj;
if (isRawValueSet) {
return Objects.equals(this.rawValue, other.rawValue);
} else {
@@ -186,7 +186,7 @@
bLFlag = (temp & LFLAG_SET) == LFLAG_SET;
bRFlag = (temp & RFLAG_SET) == RFLAG_SET;
- return new MplsProtocolMaskTlv(bLFlag, bRFlag);
+ return new MplsProtocolMaskSubTlv(bLFlag, bRFlag);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TENodeAttributesTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeAttributesTlv.java
similarity index 76%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TENodeAttributesTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeAttributesTlv.java
index 10f54de..dc0ab7c 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TENodeAttributesTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeAttributesTlv.java
@@ -17,6 +17,7 @@
import java.util.Iterator;
import java.util.LinkedList;
+import java.util.List;
import java.util.ListIterator;
import java.util.Objects;
@@ -31,7 +32,7 @@
/**
* Provides TE Node Attributes Tlv.
*/
-public class TENodeAttributesTlv implements PcepValueType {
+public class NodeAttributesTlv implements PcepValueType {
/*
* Reference :PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02
*
@@ -48,32 +49,32 @@
*/
- protected static final Logger log = LoggerFactory.getLogger(TENodeAttributesTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(NodeAttributesTlv.class);
- public static final short TYPE = 1267; //TODD:change this TBD20
+ public static final short TYPE = (short) 65285;
public short hLength;
public static final int TLV_HEADER_LENGTH = 4;
// LinkDescriptors Sub-TLVs (variable)
- private LinkedList<PcepValueType> llNodeAttributesSubTLVs;
+ private List<PcepValueType> llNodeAttributesSubTLVs;
/**
* Constructor to initialize llNodeAttributesSubTLVs.
*
* @param llNodeAttributesSubTLVs linked list of Node Attributes Sub-TLVs
*/
- public TENodeAttributesTlv(LinkedList<PcepValueType> llNodeAttributesSubTLVs) {
+ public NodeAttributesTlv(List<PcepValueType> llNodeAttributesSubTLVs) {
this.llNodeAttributesSubTLVs = llNodeAttributesSubTLVs;
}
/**
- * Returns object of TENodeAttributesTlv.
+ * Returns object of NodeAttributesTlv.
*
- * @param llNodeAttributesSubTLVs LinkedList of PcepValueType
- * @return object of TENodeAttributesTlv
+ * @param llNodeAttributesSubTLVs List of PcepValueType
+ * @return object of NodeAttributesTlv
*/
- public static TENodeAttributesTlv of(LinkedList<PcepValueType> llNodeAttributesSubTLVs) {
- return new TENodeAttributesTlv(llNodeAttributesSubTLVs);
+ public static NodeAttributesTlv of(List<PcepValueType> llNodeAttributesSubTLVs) {
+ return new NodeAttributesTlv(llNodeAttributesSubTLVs);
}
/**
@@ -81,7 +82,7 @@
*
* @return llNodeAttributesSubTLVs linked list of Node Attributes Sub-TLVs
*/
- public LinkedList<PcepValueType> getllNodeAttributesSubTLVs() {
+ public List<PcepValueType> getllNodeAttributesSubTLVs() {
return llNodeAttributesSubTLVs;
}
@@ -118,13 +119,13 @@
* the size, if both are same then we should check for the subtlv objects otherwise
* we should return false.
*/
- if (obj instanceof TENodeAttributesTlv) {
+ if (obj instanceof NodeAttributesTlv) {
int countObjSubTlv = 0;
int countOtherSubTlv = 0;
boolean isCommonSubTlv = true;
- TENodeAttributesTlv other = (TENodeAttributesTlv) obj;
- Iterator<PcepValueType> objListIterator = ((TENodeAttributesTlv) obj).llNodeAttributesSubTLVs.iterator();
- countObjSubTlv = ((TENodeAttributesTlv) obj).llNodeAttributesSubTLVs.size();
+ NodeAttributesTlv other = (NodeAttributesTlv) obj;
+ Iterator<PcepValueType> objListIterator = ((NodeAttributesTlv) obj).llNodeAttributesSubTLVs.iterator();
+ countObjSubTlv = ((NodeAttributesTlv) obj).llNodeAttributesSubTLVs.size();
countOtherSubTlv = other.llNodeAttributesSubTLVs.size();
if (countObjSubTlv != countOtherSubTlv) {
return false;
@@ -173,17 +174,17 @@
}
/**
- * Reads the channel buffer and returns object of TENodeAttributesTlv.
+ * Reads the channel buffer and returns object of NodeAttributesTlv.
*
* @param c input channel buffer
* @param hLength length
- * @return object of TENodeAttributesTlv
+ * @return object of NodeAttributesTlv
* @throws PcepParseException if mandatory fields are missing
*/
public static PcepValueType read(ChannelBuffer c, short hLength) throws PcepParseException {
// Node Descriptor Sub-TLVs (variable)
- LinkedList<PcepValueType> llNodeAttributesSubTLVs = new LinkedList<>();
+ List<PcepValueType> llNodeAttributesSubTLVs = new LinkedList<>();
ChannelBuffer tempCb = c.readBytes(hLength);
@@ -194,27 +195,27 @@
short length = tempCb.readShort();
switch (hType) {
- case NodeFlagBitsTlv.TYPE:
+ case NodeFlagBitsSubTlv.TYPE:
byte cValue = tempCb.readByte();
- tlv = new NodeFlagBitsTlv(cValue);
+ tlv = new NodeFlagBitsSubTlv(cValue);
break;
- case OpaqueNodeAttributeTlv.TYPE:
- tlv = OpaqueNodeAttributeTlv.read(tempCb, length);
+ case OpaqueNodePropertiesSubTlv.TYPE:
+ tlv = OpaqueNodePropertiesSubTlv.read(tempCb, length);
break;
- case NodeNameTlv.TYPE:
- tlv = NodeNameTlv.read(tempCb, length);
+ case NodeNameSubTlv.TYPE:
+ tlv = NodeNameSubTlv.read(tempCb, length);
break;
- case IsisAreaIdentifierTlv.TYPE:
- tlv = IsisAreaIdentifierTlv.read(tempCb, length);
+ case IsisAreaIdentifierSubTlv.TYPE:
+ tlv = IsisAreaIdentifierSubTlv.read(tempCb, length);
break;
- case IPv4TERouterIdOfLocalNodeTlv.TYPE:
+ case IPv4RouterIdOfLocalNodeSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new IPv4TERouterIdOfLocalNodeTlv(iValue);
+ tlv = new IPv4RouterIdOfLocalNodeSubTlv(iValue);
break;
- case IPv6TERouterIdofLocalNodeTlv.TYPE:
- byte[] ipv6Value = new byte[IPv6TERouterIdofLocalNodeTlv.VALUE_LENGTH];
- tempCb.readBytes(ipv6Value, 0, IPv6TERouterIdofLocalNodeTlv.VALUE_LENGTH);
- tlv = new IPv6TERouterIdofLocalNodeTlv(ipv6Value);
+ case IPv6RouterIdofLocalNodeSubTlv.TYPE:
+ byte[] ipv6Value = new byte[IPv6RouterIdofLocalNodeSubTlv.VALUE_LENGTH];
+ tempCb.readBytes(ipv6Value, 0, IPv6RouterIdofLocalNodeSubTlv.VALUE_LENGTH);
+ tlv = new IPv6RouterIdofLocalNodeSubTlv(ipv6Value);
break;
default:
throw new PcepParseException("Unsupported Sub TLV type :" + hType);
@@ -236,7 +237,7 @@
throw new PcepParseException("Sub Tlv parsing error. Extra bytes received.");
}
- return new TENodeAttributesTlv(llNodeAttributesSubTLVs);
+ return new NodeAttributesTlv(llNodeAttributesSubTLVs);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeFlagBitsTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeFlagBitsSubTlv.java
similarity index 91%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeFlagBitsTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeFlagBitsSubTlv.java
index 019daa1..88b40f2 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeFlagBitsTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeFlagBitsSubTlv.java
@@ -26,7 +26,7 @@
/**
* Provide node Flags bits.
*/
-public class NodeFlagBitsTlv implements PcepValueType {
+public class NodeFlagBitsSubTlv implements PcepValueType {
/* Reference :[I-D.ietf-idr- ls-distribution] /3.3.1.1
* 0 1 2 3
@@ -38,9 +38,9 @@
+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(NodeFlagBitsTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(NodeFlagBitsSubTlv.class);
- public static final short TYPE = 14;
+ public static final short TYPE = 13;
public static final short LENGTH = 1;
public static final int SET = 1;
public static final byte OFLAG_SET = (byte) 0x80;
@@ -60,7 +60,7 @@
*
* @param rawValue of Node Flag Bits TLV
*/
- public NodeFlagBitsTlv(byte rawValue) {
+ public NodeFlagBitsSubTlv(byte rawValue) {
this.rawValue = rawValue;
isRawValueSet = true;
this.bOFlag = (rawValue & OFLAG_SET) == OFLAG_SET;
@@ -77,7 +77,7 @@
* @param bEFlag E-flag
* @param bBFlag B-flag
*/
- public NodeFlagBitsTlv(boolean bOFlag, boolean bTFlag, boolean bEFlag, boolean bBFlag) {
+ public NodeFlagBitsSubTlv(boolean bOFlag, boolean bTFlag, boolean bEFlag, boolean bBFlag) {
this.bOFlag = bOFlag;
this.bTFlag = bTFlag;
this.bEFlag = bEFlag;
@@ -92,8 +92,8 @@
* @param raw of Node Flag Bits TLV
* @return new object of NodeFlagBitsTlv
*/
- public static NodeFlagBitsTlv of(final byte raw) {
- return new NodeFlagBitsTlv(raw);
+ public static NodeFlagBitsSubTlv of(final byte raw) {
+ return new NodeFlagBitsSubTlv(raw);
}
/**
@@ -170,8 +170,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof NodeFlagBitsTlv) {
- NodeFlagBitsTlv other = (NodeFlagBitsTlv) obj;
+ if (obj instanceof NodeFlagBitsSubTlv) {
+ NodeFlagBitsSubTlv other = (NodeFlagBitsSubTlv) obj;
if (isRawValueSet) {
return Objects.equals(this.rawValue, other.rawValue);
} else {
@@ -216,7 +216,7 @@
*/
public static PcepValueType read(ChannelBuffer c) {
- return NodeFlagBitsTlv.of(c.readByte());
+ return NodeFlagBitsSubTlv.of(c.readByte());
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeNameTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeNameSubTlv.java
similarity index 89%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeNameTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeNameSubTlv.java
index e535a35..33ab692 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeNameTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/NodeNameSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provide the name for the node.
*/
-public class NodeNameTlv implements PcepValueType {
+public class NodeNameSubTlv implements PcepValueType {
/* reference :[I-D.ietf-idr-ls-distribution]/3.3.1.3
* 0 1 2 3
@@ -39,9 +39,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(NodeNameTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(NodeNameSubTlv.class);
- public static final short TYPE = 1007; //TODO:check and change TBD23
+ public static final short TYPE = 15;
public final short hLength;
private final byte[] rawValue;
@@ -52,7 +52,7 @@
* @param rawValue of Node Name
* @param hLength length
*/
- public NodeNameTlv(byte[] rawValue, short hLength) {
+ public NodeNameSubTlv(byte[] rawValue, short hLength) {
log.debug("NodeNameTlv");
this.rawValue = rawValue;
if (0 == hLength) {
@@ -69,8 +69,8 @@
* @param hLength length
* @return new object of Node Name Tlv
*/
- public static NodeNameTlv of(final byte[] raw, short hLength) {
- return new NodeNameTlv(raw, hLength);
+ public static NodeNameSubTlv of(final byte[] raw, short hLength) {
+ return new NodeNameSubTlv(raw, hLength);
}
/**
@@ -107,8 +107,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof NodeNameTlv) {
- NodeNameTlv other = (NodeNameTlv) obj;
+ if (obj instanceof NodeNameSubTlv) {
+ NodeNameSubTlv other = (NodeNameSubTlv) obj;
return Objects.equals(this.rawValue, other.rawValue);
}
return false;
@@ -133,7 +133,7 @@
public static PcepValueType read(ChannelBuffer c, short hLength) {
byte[] iNodeName = new byte[hLength];
c.readBytes(iNodeName, 0, hLength);
- return new NodeNameTlv(iNodeName, hLength);
+ return new NodeNameSubTlv(iNodeName, hLength);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OpaqueLinkAttributeTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OpaqueLinkAttributeSubTlv.java
similarity index 87%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OpaqueLinkAttributeTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OpaqueLinkAttributeSubTlv.java
index 1af332e..0707cbd 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OpaqueLinkAttributeTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OpaqueLinkAttributeSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provides Opaque Link Attribute.
*/
-public class OpaqueLinkAttributeTlv implements PcepValueType {
+public class OpaqueLinkAttributeSubTlv implements PcepValueType {
/*
* TLV format.
@@ -41,9 +41,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(OpaqueLinkAttributeTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(OpaqueLinkAttributeSubTlv.class);
- public static final short TYPE = 1097; //TODO:NEED TO HANDLE TDB42
+ public static final short TYPE = 31;
private final short hLength;
private final byte[] rawValue;
@@ -54,7 +54,7 @@
* @param rawValue of Opaque Link Attribute
* @param hLength length
*/
- public OpaqueLinkAttributeTlv(byte[] rawValue, short hLength) {
+ public OpaqueLinkAttributeSubTlv(byte[] rawValue, short hLength) {
log.debug("OpaqueLinkAttributeTlv");
this.rawValue = rawValue;
if (0 == hLength) {
@@ -71,8 +71,8 @@
* @param hLength length
* @return new object of OpaqueLinkAttributeTlv
*/
- public static OpaqueLinkAttributeTlv of(final byte[] raw, short hLength) {
- return new OpaqueLinkAttributeTlv(raw, hLength);
+ public static OpaqueLinkAttributeSubTlv of(final byte[] raw, short hLength) {
+ return new OpaqueLinkAttributeSubTlv(raw, hLength);
}
/**
@@ -108,8 +108,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof OpaqueLinkAttributeTlv) {
- OpaqueLinkAttributeTlv other = (OpaqueLinkAttributeTlv) obj;
+ if (obj instanceof OpaqueLinkAttributeSubTlv) {
+ OpaqueLinkAttributeSubTlv other = (OpaqueLinkAttributeSubTlv) obj;
return Objects.equals(this.rawValue, other.rawValue);
}
return false;
@@ -134,7 +134,7 @@
public static PcepValueType read(ChannelBuffer c, short hLength) {
byte[] iOpaqueValue = new byte[hLength];
c.readBytes(iOpaqueValue, 0, hLength);
- return new OpaqueLinkAttributeTlv(iOpaqueValue, hLength);
+ return new OpaqueLinkAttributeSubTlv(iOpaqueValue, hLength);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OpaqueNodeAttributeTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OpaqueNodePropertiesSubTlv.java
similarity index 87%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OpaqueNodeAttributeTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OpaqueNodePropertiesSubTlv.java
index 26e8c8b..83b0b39 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OpaqueNodeAttributeTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OpaqueNodePropertiesSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provides Opaque node attributes.
*/
-public class OpaqueNodeAttributeTlv implements PcepValueType {
+public class OpaqueNodePropertiesSubTlv implements PcepValueType {
/*
* Reference [I-D.ietf-idr-Properties ls-distribution] /3.3.1.5
* 0 1 2 3
@@ -39,9 +39,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(OpaqueNodeAttributeTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(OpaqueNodePropertiesSubTlv.class);
- public static final short TYPE = 1001;
+ public static final short TYPE = 14;
private final short hLength;
private final byte[] rawValue;
@@ -52,7 +52,7 @@
* @param rawValue Opaque Node Attribute
* @param hLength length
*/
- public OpaqueNodeAttributeTlv(byte[] rawValue, short hLength) {
+ public OpaqueNodePropertiesSubTlv(byte[] rawValue, short hLength) {
this.rawValue = rawValue;
if (0 == hLength) {
@@ -69,8 +69,8 @@
* @param hLength length
* @return new object of Opaque Node Attribute Tlv
*/
- public static OpaqueNodeAttributeTlv of(final byte[] raw, short hLength) {
- return new OpaqueNodeAttributeTlv(raw, hLength);
+ public static OpaqueNodePropertiesSubTlv of(final byte[] raw, short hLength) {
+ return new OpaqueNodePropertiesSubTlv(raw, hLength);
}
/**
@@ -107,8 +107,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof OpaqueNodeAttributeTlv) {
- OpaqueNodeAttributeTlv other = (OpaqueNodeAttributeTlv) obj;
+ if (obj instanceof OpaqueNodePropertiesSubTlv) {
+ OpaqueNodePropertiesSubTlv other = (OpaqueNodePropertiesSubTlv) obj;
return Objects.equals(this.rawValue, other.rawValue);
}
return false;
@@ -133,7 +133,7 @@
public static PcepValueType read(ChannelBuffer c, short hLength) {
byte[] iOpaqueValue = new byte[hLength];
c.readBytes(iOpaqueValue, 0, hLength);
- return new OpaqueNodeAttributeTlv(iOpaqueValue, hLength);
+ return new OpaqueNodePropertiesSubTlv(iOpaqueValue, hLength);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OspfAreaIdSubTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OspfAreaIdSubTlv.java
index d60eb60..79527c4 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OspfAreaIdSubTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/OspfAreaIdSubTlv.java
@@ -40,7 +40,7 @@
protected static final Logger log = LoggerFactory.getLogger(OspfAreaIdSubTlv.class);
- public static final short TYPE = 600; //TODD:change this TBD12
+ public static final short TYPE = 3;
public static final short LENGTH = 4;
private final int rawValue;
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/PcepRsvpUserErrorSpec.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/PcepRsvpUserErrorSpec.java
index 4a9357d..b42d135 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/PcepRsvpUserErrorSpec.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/PcepRsvpUserErrorSpec.java
@@ -169,9 +169,9 @@
int iValue = 0;
//short hLength = cb.readShort();
switch (hType) {
- case AutonomousSystemTlv.TYPE:
+ case AutonomousSystemSubTlv.TYPE:
iValue = cb.readInt();
- tlv = new AutonomousSystemTlv(iValue);
+ tlv = new AutonomousSystemSubTlv(iValue);
break;
default:
throw new PcepParseException("Unsupported Sub TLV type :" + hType);
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/RemoteTENodeDescriptorsTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/RemoteNodeDescriptorsTlv.java
similarity index 79%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/RemoteTENodeDescriptorsTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/RemoteNodeDescriptorsTlv.java
index cabd709..3912600 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/RemoteTENodeDescriptorsTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/RemoteNodeDescriptorsTlv.java
@@ -17,6 +17,7 @@
import java.util.Iterator;
import java.util.LinkedList;
+import java.util.List;
import java.util.ListIterator;
import java.util.Objects;
@@ -31,10 +32,9 @@
/**
* Provides Remote TE Node Descriptors TLV.
*/
-public class RemoteTENodeDescriptorsTlv implements PcepValueType {
+public class RemoteNodeDescriptorsTlv implements PcepValueType {
- /* Reference :PCEP Extension for Transporting TE Data
- draft-dhodylee-pce-pcep-te-data-extn-02
+ /* Reference : draft-dhodylee-pce-pcep-ls-01, section 9.2.3.
*
0 1 2 3
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
@@ -47,32 +47,32 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(RemoteTENodeDescriptorsTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(RemoteNodeDescriptorsTlv.class);
- public static final short TYPE = 1003; //TODD:change this TBD9
+ public static final short TYPE = (short) 65283;
public short hLength;
public static final int TLV_HEADER_LENGTH = 4;
// Node Descriptor Sub-TLVs (variable)
- private LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLVs;
+ private List<PcepValueType> llRemoteTENodeDescriptorSubTLVs;
/**
* Constructor to initialize llRemoteTENodeDescriptorSubTLVs.
*
- * @param llRemoteTENodeDescriptorSubTLVs LinkedList of PcepValueType
+ * @param llRemoteTENodeDescriptorSubTLVs List of PcepValueType
*/
- public RemoteTENodeDescriptorsTlv(LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLVs) {
+ public RemoteNodeDescriptorsTlv(List<PcepValueType> llRemoteTENodeDescriptorSubTLVs) {
this.llRemoteTENodeDescriptorSubTLVs = llRemoteTENodeDescriptorSubTLVs;
}
/**
* Returns object of Remote TE Node Descriptors TLV.
*
- * @param llRemoteTENodeDescriptorSubTLVs LinkedList of PcepValueType
- * @return object of RemoteTENodeDescriptorsTLV
+ * @param llRemoteTENodeDescriptorSubTLVs List of PcepValueType
+ * @return object of RemoteNodeDescriptorsTlv
*/
- public static RemoteTENodeDescriptorsTlv of(final LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLVs) {
- return new RemoteTENodeDescriptorsTlv(llRemoteTENodeDescriptorSubTLVs);
+ public static RemoteNodeDescriptorsTlv of(final List<PcepValueType> llRemoteTENodeDescriptorSubTLVs) {
+ return new RemoteNodeDescriptorsTlv(llRemoteTENodeDescriptorSubTLVs);
}
/**
@@ -80,7 +80,7 @@
*
* @return llRemoteTENodeDescriptorSubTLVs
*/
- public LinkedList<PcepValueType> getllRemoteTENodeDescriptorSubTLVs() {
+ public List<PcepValueType> getllRemoteTENodeDescriptorSubTLVs() {
return llRemoteTENodeDescriptorSubTLVs;
}
@@ -117,14 +117,14 @@
* the size, if both are same then we should check for the subtlv objects otherwise
* we should return false.
*/
- if (obj instanceof RemoteTENodeDescriptorsTlv) {
+ if (obj instanceof RemoteNodeDescriptorsTlv) {
int countObjSubTlv = 0;
int countOtherSubTlv = 0;
boolean isCommonSubTlv = true;
- RemoteTENodeDescriptorsTlv other = (RemoteTENodeDescriptorsTlv) obj;
- Iterator<PcepValueType> objListIterator = ((RemoteTENodeDescriptorsTlv) obj).llRemoteTENodeDescriptorSubTLVs
+ RemoteNodeDescriptorsTlv other = (RemoteNodeDescriptorsTlv) obj;
+ Iterator<PcepValueType> objListIterator = ((RemoteNodeDescriptorsTlv) obj).llRemoteTENodeDescriptorSubTLVs
.iterator();
- countObjSubTlv = ((RemoteTENodeDescriptorsTlv) obj).llRemoteTENodeDescriptorSubTLVs.size();
+ countObjSubTlv = ((RemoteNodeDescriptorsTlv) obj).llRemoteTENodeDescriptorSubTLVs.size();
countOtherSubTlv = other.llRemoteTENodeDescriptorSubTLVs.size();
if (countObjSubTlv != countOtherSubTlv) {
return false;
@@ -182,13 +182,13 @@
*
* @param c input channel buffer
* @param length length of buffer
- * @return object of RemoteTENodeDescriptorsTLV
+ * @return object of RemoteNodeDescriptorsTlv
* @throws PcepParseException if mandatory fields are missing
*/
public static PcepValueType read(ChannelBuffer c, short length) throws PcepParseException {
// Node Descriptor Sub-TLVs (variable)
- LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLVs = new LinkedList<>();
+ List<PcepValueType> llRemoteTENodeDescriptorSubTLVs = new LinkedList<>();
ChannelBuffer tempCb = c.readBytes(length);
@@ -200,20 +200,20 @@
short hLength = tempCb.readShort();
switch (hType) {
- case AutonomousSystemTlv.TYPE:
+ case AutonomousSystemSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new AutonomousSystemTlv(iValue);
+ tlv = new AutonomousSystemSubTlv(iValue);
break;
- case BgpLsIdentifierTlv.TYPE:
+ case BgpLsIdentifierSubTlv.TYPE:
iValue = tempCb.readInt();
- tlv = new BgpLsIdentifierTlv(iValue);
+ tlv = new BgpLsIdentifierSubTlv(iValue);
break;
case OspfAreaIdSubTlv.TYPE:
iValue = tempCb.readInt();
tlv = new OspfAreaIdSubTlv(iValue);
break;
- case RouterIDSubTlv.TYPE:
- tlv = RouterIDSubTlv.read(tempCb, hLength);
+ case IgpRouterIdSubTlv.TYPE:
+ tlv = IgpRouterIdSubTlv.read(tempCb, hLength);
break;
default:
@@ -236,7 +236,7 @@
throw new PcepParseException("Sub Tlv parsing error. Extra bytes received.");
}
- return new RemoteTENodeDescriptorsTlv(llRemoteTENodeDescriptorSubTLVs);
+ return new RemoteNodeDescriptorsTlv(llRemoteTENodeDescriptorSubTLVs);
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/RoutingUniverseTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/RoutingUniverseTlv.java
index 924a3a3..f5c9a04 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/RoutingUniverseTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/RoutingUniverseTlv.java
@@ -52,7 +52,7 @@
protected static final Logger log = LoggerFactory.getLogger(RoutingUniverseTlv.class);
- public static final short TYPE = 14; // TODO:need to change TBD7
+ public static final short TYPE = (short) 65281;
public static final short LENGTH = 8;
private final long rawValue;
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/SharedRiskLinkGroupTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/SharedRiskLinkGroupSubTlv.java
similarity index 88%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/SharedRiskLinkGroupTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/SharedRiskLinkGroupSubTlv.java
index e855a52..a7c1b81 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/SharedRiskLinkGroupTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/SharedRiskLinkGroupSubTlv.java
@@ -28,7 +28,7 @@
/**
* Provides SharedRiskLinkGroupTlv.
*/
-public class SharedRiskLinkGroupTlv implements PcepValueType {
+public class SharedRiskLinkGroupSubTlv implements PcepValueType {
/*
* Reference :[I-D.ietf-idr- Group ls-distribution] /3.3.2.5
@@ -46,9 +46,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(SharedRiskLinkGroupTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(SharedRiskLinkGroupSubTlv.class);
- public static final short TYPE = 1096; //TODO:NEED TO HANDLE TDB41
+ public static final short TYPE = 30;
private final short hLength;
@@ -60,7 +60,7 @@
* @param srlgValue Shared Risk Link Group Value
* @param hLength length
*/
- public SharedRiskLinkGroupTlv(int[] srlgValue, short hLength) {
+ public SharedRiskLinkGroupSubTlv(int[] srlgValue, short hLength) {
this.srlgValue = srlgValue;
if (0 == hLength) {
this.hLength = (short) ((srlgValue.length) * 4);
@@ -76,8 +76,8 @@
* @param hLength length
* @return object of SharedRiskLinkGroupTlv
*/
- public static SharedRiskLinkGroupTlv of(final int[] raw, short hLength) {
- return new SharedRiskLinkGroupTlv(raw, hLength);
+ public static SharedRiskLinkGroupSubTlv of(final int[] raw, short hLength) {
+ return new SharedRiskLinkGroupSubTlv(raw, hLength);
}
/**
@@ -114,8 +114,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof SharedRiskLinkGroupTlv) {
- SharedRiskLinkGroupTlv other = (SharedRiskLinkGroupTlv) obj;
+ if (obj instanceof SharedRiskLinkGroupSubTlv) {
+ SharedRiskLinkGroupSubTlv other = (SharedRiskLinkGroupSubTlv) obj;
return Arrays.equals(this.srlgValue, other.srlgValue);
}
return false;
@@ -145,7 +145,7 @@
for (int i = 0; i < iLength; i++) {
iSharedRiskLinkGroup[i] = c.readInt();
}
- return new SharedRiskLinkGroupTlv(iSharedRiskLinkGroup, hLength);
+ return new SharedRiskLinkGroupSubTlv(iSharedRiskLinkGroup, hLength);
}
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TEDefaultMetricTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TEDefaultMetricSubTlv.java
similarity index 86%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TEDefaultMetricTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TEDefaultMetricSubTlv.java
index 4429d22..c63ba64 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TEDefaultMetricTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/TEDefaultMetricSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provides TEDefaultMetricTlv.
*/
-public class TEDefaultMetricTlv implements PcepValueType {
+public class TEDefaultMetricSubTlv implements PcepValueType {
/*
* Reference :| [I-D.ietf-idr- ls-distribution] /3.3.2.3
@@ -40,9 +40,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(TEDefaultMetricTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(TEDefaultMetricSubTlv.class);
- public static final short TYPE = 13400; //TDB37
+ public static final short TYPE = 26;
public static final short LENGTH = 4;
private final int rawValue;
@@ -52,7 +52,7 @@
*
* @param rawValue TE Default Link Metric
*/
- public TEDefaultMetricTlv(int rawValue) {
+ public TEDefaultMetricSubTlv(int rawValue) {
this.rawValue = rawValue;
}
@@ -62,8 +62,8 @@
* @param raw raw value
* @return object of TEDefaultMetricTlv.
*/
- public static TEDefaultMetricTlv of(final int raw) {
- return new TEDefaultMetricTlv(raw);
+ public static TEDefaultMetricSubTlv of(final int raw) {
+ return new TEDefaultMetricSubTlv(raw);
}
/**
@@ -100,8 +100,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof TEDefaultMetricTlv) {
- TEDefaultMetricTlv other = (TEDefaultMetricTlv) obj;
+ if (obj instanceof TEDefaultMetricSubTlv) {
+ TEDefaultMetricSubTlv other = (TEDefaultMetricSubTlv) obj;
return Objects.equals(this.rawValue, other.rawValue);
}
return false;
@@ -122,8 +122,8 @@
* @param c input channel buffer
* @return object of TEDefaultMetricTlv
*/
- public static TEDefaultMetricTlv read(ChannelBuffer c) {
- return TEDefaultMetricTlv.of(c.readInt());
+ public static TEDefaultMetricSubTlv read(ChannelBuffer c) {
+ return TEDefaultMetricSubTlv.of(c.readInt());
}
@Override
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/UnreservedBandwidthTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/UnreservedBandwidthSubTlv.java
similarity index 85%
rename from protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/UnreservedBandwidthTlv.java
rename to protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/UnreservedBandwidthSubTlv.java
index d44bf82..859199e 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/UnreservedBandwidthTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/UnreservedBandwidthSubTlv.java
@@ -27,7 +27,7 @@
/**
* Provides Unreserved Bandwidth Tlv.
*/
-public class UnreservedBandwidthTlv implements PcepValueType {
+public class UnreservedBandwidthSubTlv implements PcepValueType {
/* Reference :[RFC5305]/3.6
0 1 2 3
@@ -39,9 +39,9 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- protected static final Logger log = LoggerFactory.getLogger(UnreservedBandwidthTlv.class);
+ protected static final Logger log = LoggerFactory.getLogger(UnreservedBandwidthSubTlv.class);
- public static final short TYPE = 11; //TDB36
+ public static final short TYPE = 25;
public static final short LENGTH = 4;
private final int rawValue;
@@ -51,7 +51,7 @@
*
* @param rawValue Unreserved Bandwidth
*/
- public UnreservedBandwidthTlv(int rawValue) {
+ public UnreservedBandwidthSubTlv(int rawValue) {
this.rawValue = rawValue;
}
@@ -61,8 +61,8 @@
* @param raw as Unreserved Bandwidth
* @return object of UnreservedBandwidthTlv
*/
- public static UnreservedBandwidthTlv of(final int raw) {
- return new UnreservedBandwidthTlv(raw);
+ public static UnreservedBandwidthSubTlv of(final int raw) {
+ return new UnreservedBandwidthSubTlv(raw);
}
/**
@@ -99,8 +99,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof UnreservedBandwidthTlv) {
- UnreservedBandwidthTlv other = (UnreservedBandwidthTlv) obj;
+ if (obj instanceof UnreservedBandwidthSubTlv) {
+ UnreservedBandwidthSubTlv other = (UnreservedBandwidthSubTlv) obj;
return Objects.equals(this.rawValue, other.rawValue);
}
return false;
@@ -121,8 +121,8 @@
* @param c input channel buffer
* @return object of UnreservedBandwidthTlv
*/
- public static UnreservedBandwidthTlv read(ChannelBuffer c) {
- return UnreservedBandwidthTlv.of(c.readInt());
+ public static UnreservedBandwidthSubTlv read(ChannelBuffer c) {
+ return UnreservedBandwidthSubTlv.of(c.readInt());
}
@Override
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepCloseMsgTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepCloseMsgTest.java
index 33c00dd..e51b0ce 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepCloseMsgTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepCloseMsgTest.java
@@ -18,6 +18,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -30,7 +31,7 @@
* Common header, reason to close.
*/
@Test
- public void closeMessageTest1() throws PcepParseException {
+ public void closeMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] closeMsg = new byte[] {0x20, 0x07, 0x00, 0x0C, 0x0f, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02 };
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepErrorMsgTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepErrorMsgTest.java
index 234cea6..71655b5 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepErrorMsgTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepErrorMsgTest.java
@@ -19,6 +19,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -33,11 +34,11 @@
/**
* This test case checks for
* PCEP-ERROR Object, OPEN Object (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV,
- * PCECC-CAPABILITY-TLV, TED Capability TLV)
+ * PCECC-CAPABILITY-TLV, LS Capability TLV)
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest1() throws PcepParseException {
+ public void errorMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x34, // common header
0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
@@ -46,7 +47,7 @@
0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV
- 0x00, 0x00, 0x00, 0x03, 0x00, (byte) 0x84, 0x00, 0x04, // TED Capability TLV
+ 0x00, 0x00, 0x00, 0x03, (byte) 0xFF, (byte) 0x00, 0x00, 0x04, // LS Capability TLV
0x00, 0x00, 0x00, 0x00};
ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
@@ -72,11 +73,11 @@
/**
* This test case checks for
* PCEP-ERROR Object, PCEP-ERROR Object, OPEN Object (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV,
- * PCECC-CAPABILITY-TLV, TED Capability TLV)
+ * PCECC-CAPABILITY-TLV, LS Capability TLV)
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest2() throws PcepParseException {
+ public void errorMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x3C, // common header
0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
@@ -86,7 +87,7 @@
0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV
- 0x00, 0x00, 0x00, 0x03, 0x00, (byte) 0x84, 0x00, 0x04, // TED Capability TLV
+ 0x00, 0x00, 0x00, 0x03, (byte) 0xFF, (byte) 0x00, 0x00, 0x04, // LS Capability TLV
0x00, 0x00, 0x00, 0x00};
ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
@@ -115,7 +116,7 @@
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest3() throws PcepParseException {
+ public void errorMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x34, // common header
0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
@@ -152,7 +153,7 @@
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest4() throws PcepParseException {
+ public void errorMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x2c, // common header
0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
@@ -188,7 +189,7 @@
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest5() throws PcepParseException {
+ public void errorMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x24, // common header
0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
@@ -223,7 +224,7 @@
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest6() throws PcepParseException {
+ public void errorMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x1C, // common header
0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
@@ -257,7 +258,7 @@
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest7() throws PcepParseException {
+ public void errorMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x14, // common header
0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
@@ -290,7 +291,7 @@
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest8() throws PcepParseException {
+ public void errorMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x20, // common header
0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
@@ -323,7 +324,7 @@
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest9() throws PcepParseException {
+ public void errorMessageTest9() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x14, // common header
0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
@@ -355,7 +356,7 @@
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest10() throws PcepParseException {
+ public void errorMessageTest10() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x14, // common header
0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
@@ -383,15 +384,16 @@
/**
* This test case checks for
- * TE Object, PCEP-ERROR Object
+ * LS Object, PCEP-ERROR Object
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest11() throws PcepParseException {
+ public void errorMessageTest11() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x18, // common header
- 0x65, 0x13, 0x00, 0x0C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x1C, // common header
+ (byte) 0xE0, 0x13, 0x00, 0x10, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // LS-ID
+ 0x00, 0x00, 0x00, 0x10,
0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
0x00, 0x00, 0x01, 0x01};
@@ -420,7 +422,7 @@
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest12() throws PcepParseException {
+ public void errorMessageTest12() throws PcepParseException, PcepOutOfBoundMessageException {
//RP Object, PCEP-ERROR Object
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x18, // common header
@@ -453,7 +455,7 @@
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest13() throws PcepParseException {
+ public void errorMessageTest13() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x24, // common header
0x02, 0x10, 0x00, 0x0C, // RP Object Header
@@ -482,17 +484,21 @@
/**
* This test case checks for
- * TE Object, TE Object, PCEP-ERROR Object
+ * LS Object, LS Object, PCEP-ERROR Object
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest14() throws PcepParseException {
+ public void errorMessageTest14() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x24, // common header
- 0x65, 0x10, 0x00, 0x0C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x65, 0x10, 0x00, 0x0C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x11, // TE-ID
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x2C, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, // LS-ID
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, // LS-ID
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x11,
0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
0x00, 0x00, 0x01, 0x01};
@@ -517,16 +523,19 @@
/**
* This test case checks for
- * PCEP-ERROR Object, TE Object, PCEP-ERROR Object
+ * PCEP-ERROR Object, LS Object, PCEP-ERROR Object
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest15() throws PcepParseException {
+ public void errorMessageTest15() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x20, // common header
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x24, // common header
0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
- 0x00, 0x00, 0x01, 0x01, 0x65, 0x10, 0x00, 0x0C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x00, 0x01, 0x01,
+ (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, // LS-ID
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
0x00, 0x00, 0x01, 0x03};
@@ -555,7 +564,7 @@
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest16() throws PcepParseException {
+ public void errorMessageTest16() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x2C, // common header
0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
@@ -585,18 +594,23 @@
/**
* This test case checks for
- * PCEP-ERROR Object, TE Object, TE Object, PCEP-ERROR Object
+ * PCEP-ERROR Object, LS Object, LS Object, PCEP-ERROR Object
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest17() throws PcepParseException {
+ public void errorMessageTest17() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x2C, // common header
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x34, // common header
0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
- 0x00, 0x00, 0x01, 0x01, 0x65, 0x10, 0x00, 0x0C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x65, 0x10, 0x00, 0x0C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x11, // TE-ID
+ 0x00, 0x00, 0x01, 0x01,
+ (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, // LS-ID
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, // LS-ID
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x11,
0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
0x00, 0x00, 0x01, 0x03};
@@ -625,7 +639,7 @@
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest18() throws PcepParseException {
+ public void errorMessageTest18() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x3C, // common header
0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
@@ -657,21 +671,28 @@
/**
* This test case checks for
- * PCEP-ERROR Object, PCEP-ERROR Object, TE Object, TE Object, PCEP-ERROR Object, PCEP-ERROR Object
+ * PCEP-ERROR Object, PCEP-ERROR Object, LS Object, LS Object, PCEP-ERROR Object, PCEP-ERROR Object
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest19() throws PcepParseException {
+ public void errorMessageTest19() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x3C, // common header
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x44, // common header
0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
- 0x00, 0x00, 0x01, 0x01, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
- 0x00, 0x00, 0x01, 0x03, 0x65, 0x10, 0x00, 0x0C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x65, 0x10, 0x00, 0x0C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x11, // TE-ID
+ 0x00, 0x00, 0x01, 0x01,
0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
- 0x00, 0x00, 0x01, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x03,
+ (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, // LS-ID
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, // LS-ID
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x04, // PCERR Object Header
+ 0x0D, 0x10, 0x00, 0x08,
0x00, 0x00, 0x01, 0x06};
ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
@@ -696,20 +717,20 @@
/**
* This test case checks for
* PCEP-ERROR Object, RP Object, RP Object, PCEP-ERROR Object, PCEP-ERROR Object,
- * TE Object, PCEP-ERROR Object
+ * LS Object, PCEP-ERROR Object
* in PcepErrorMsg message.
*/
@Test
- public void errorMessageTest20() throws PcepParseException {
+ public void errorMessageTest20() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x48, // common header
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x4C, // common header
0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
0x00, 0x00, 0x01, 0x01, 0x02, 0x10, 0x00, 0x0C, // RP Object Header
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x10, 0x00, 0x0C, // RP Object Header
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
0x00, 0x00, 0x01, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
- 0x00, 0x00, 0x01, 0x06, 0x65, 0x10, 0x00, 0x0C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x00, 0x01, 0x06, (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
0x00, 0x00, 0x01, 0x06};
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepInitiateMsgExtTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepInitiateMsgExtTest.java
index 9341f32..dad53ad 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepInitiateMsgExtTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepInitiateMsgExtTest.java
@@ -18,6 +18,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -32,11 +33,11 @@
* END-POINTS, ERO, LSPA, BANDWIDTH, METRIC-LIST objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest1() throws PcepParseException {
+ public void initiateMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
- * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC-LIST.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ // StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC-LIST.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xA4,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -88,11 +89,11 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest2() throws PcepParseException {
+ public void initiateMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
- * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ // StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xA8,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -143,11 +144,11 @@
* ERO, LSPA, BANDWIDTH objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest3() throws PcepParseException {
+ public void initiateMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
- * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH.
- */
+ // SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ // StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x8c,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -197,11 +198,11 @@
* END-POINTS, ERO, LSPA objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest4() throws PcepParseException {
+ public void initiateMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
- * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ // StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -250,11 +251,11 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest5() throws PcepParseException {
+ public void initiateMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
- * StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ // StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -301,11 +302,11 @@
* BANDWIDTH OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest6() throws PcepParseException {
+ public void initiateMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
- * StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ // StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x8c,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -353,11 +354,11 @@
* LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest7() throws PcepParseException {
+ public void initiateMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
- * StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ // StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x98,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -406,11 +407,11 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest8() throws PcepParseException {
+ public void initiateMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
- * END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
+ // END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x90,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -458,11 +459,11 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest9() throws PcepParseException {
+ public void initiateMessageTest9() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
- * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
+ // END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -508,11 +509,11 @@
* SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest10() throws PcepParseException {
+ public void initiateMessageTest10() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
- * END-POINTS, ERO, LSPA OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
+ // END-POINTS, ERO, LSPA OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x70,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -556,11 +557,11 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest11() throws PcepParseException {
+ public void initiateMessageTest11() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
- * END-POINTS, ERO, LSPA OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
+ // END-POINTS, ERO, LSPA OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x7C,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -604,11 +605,11 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest12() throws PcepParseException {
+ public void initiateMessageTest12() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
- * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
+ // END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x78,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -653,11 +654,11 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest13() throws PcepParseException {
+ public void initiateMessageTest13() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
- * END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
+ // END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -702,11 +703,11 @@
* END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest14() throws PcepParseException {
+ public void initiateMessageTest14() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
- * END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ // END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x7c,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -750,11 +751,11 @@
* END-POINTS, ERO, LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest15() throws PcepParseException {
+ public void initiateMessageTest15() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
- * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ // END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x70,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -797,11 +798,11 @@
* END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest16() throws PcepParseException {
+ public void initiateMessageTest16() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
- * END-POINTS, ERO, LSPA OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ // END-POINTS, ERO, LSPA OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x68,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -843,10 +844,10 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest17() throws PcepParseException {
+ public void initiateMessageTest17() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
- */
+ // SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -887,10 +888,10 @@
* BANDWIDTH OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest18() throws PcepParseException {
+ public void initiateMessageTest18() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
- */
+ // SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x68,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03,
@@ -933,10 +934,10 @@
* BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest19() throws PcepParseException {
+ public void initiateMessageTest19() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
- */
+ // SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x74,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -979,10 +980,10 @@
* BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest20() throws PcepParseException {
+ public void initiateMessageTest20() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
- */
+ // SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -1024,10 +1025,10 @@
* BANDWIDTH OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest21() throws PcepParseException {
+ public void initiateMessageTest21() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
- */
+ // SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -1068,10 +1069,10 @@
* LSPA OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest22() throws PcepParseException {
+ public void initiateMessageTest22() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
- */
+ // SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -1111,10 +1112,10 @@
* END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest23() throws PcepParseException {
+ public void initiateMessageTest23() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1155,10 +1156,10 @@
* END-POINTS, ERO, LSPA BANDWIDTH OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest25() throws PcepParseException {
+ public void initiateMessageTest25() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA BANDWIDTH OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA BANDWIDTH OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1200,11 +1201,11 @@
* ERO, LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest26() throws PcepParseException {
+ public void initiateMessageTest26() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS,
- * ERO, LSPA, BANDWIDTH, METRIC OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS,
+ // ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x6C,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1247,10 +1248,10 @@
* BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest27() throws PcepParseException {
+ public void initiateMessageTest27() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1291,10 +1292,10 @@
* LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest28() throws PcepParseException {
+ public void initiateMessageTest28() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x54,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1334,10 +1335,10 @@
* END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest29() throws PcepParseException {
+ public void initiateMessageTest29() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x4C,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1376,10 +1377,10 @@
* END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest30() throws PcepParseException {
+ public void initiateMessageTest30() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x5C,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1419,10 +1420,10 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest31() throws PcepParseException {
+ public void initiateMessageTest31() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP (SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
- */
+ // SRP, LSP (SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x54,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -1461,11 +1462,11 @@
* ERO, LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest32() throws PcepParseException {
+ public void initiateMessageTest32() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
- * ERO, LSPA, BANDWIDTH, METRIC OBJECT.
- */
+ // SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ // ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1507,11 +1508,11 @@
* ERO, LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest33() throws PcepParseException {
+ public void initiateMessageTest33() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
- * ERO, LSPA, BANDWIDTH OBJECT.
- */
+ // SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ // ERO, LSPA, BANDWIDTH OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1552,11 +1553,11 @@
* ERO, LSPA OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest34() throws PcepParseException {
+ public void initiateMessageTest34() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
- * ERO, LSPA OBJECT.
- */
+ // SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ // ERO, LSPA OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1596,11 +1597,11 @@
* ERO, LSPA OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest35() throws PcepParseException {
+ public void initiateMessageTest35() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
- * ERO, LSPA OBJECT.
- */
+ // SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ // ERO, LSPA OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1641,11 +1642,11 @@
* ERO, LSPA OBJECT objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest36() throws PcepParseException {
+ public void initiateMessageTest36() throws PcepParseException, PcepOutOfBoundMessageException {
- /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
- * ERO, LSPA OBJECT.
- */
+ // SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ // ERO, LSPA OBJECT.
+ //
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepInitiateMsgTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepInitiateMsgTest.java
index 0f8bb7b..cb5b0dd 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepInitiateMsgTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepInitiateMsgTest.java
@@ -18,6 +18,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -30,7 +31,7 @@
* This test case checks for srp, lsp, end-point, ERO objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest1() throws PcepParseException {
+ public void initiateMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
/* srp, lsp, end-point, ERO.
*/
@@ -75,7 +76,7 @@
* This test case checks for srp and lsp objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest2() throws PcepParseException {
+ public void initiateMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
/* srp, lsp.
*/
byte[] initiateDeletionMsg = new byte[]{0x20, 0x0C, 0x00, 0x34,
@@ -115,7 +116,7 @@
* in PcInitiate message.
*/
@Test
- public void initiateMessageTest3() throws PcepParseException {
+ public void initiateMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
/* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
* StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO.
@@ -162,7 +163,7 @@
* StatefulLspErrorCodeTlv), END-POINT, ERO objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest4() throws PcepParseException {
+ public void initiateMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
/* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
* StatefulLspErrorCodeTlv), END-POINT, ERO.
@@ -208,7 +209,7 @@
* END-POINT, ERO objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest5() throws PcepParseException {
+ public void initiateMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
/* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
* END-POINT, ERO.
@@ -255,7 +256,7 @@
* END-POINT, ERO objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest6() throws PcepParseException {
+ public void initiateMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
/* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
* END-POINT, ERO.
@@ -303,7 +304,7 @@
* END-POINT, ERO objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest7() throws PcepParseException {
+ public void initiateMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
/* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
* END-POINT, ERO.
@@ -350,7 +351,7 @@
* END-POINT, ERO objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest8() throws PcepParseException {
+ public void initiateMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
/* SRP, LSP (StatefulIPv4LspIdentidiersTlv),
* END-POINT, ERO.
@@ -396,7 +397,7 @@
* END-POINT, ERO objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest9() throws PcepParseException {
+ public void initiateMessageTest9() throws PcepParseException, PcepOutOfBoundMessageException {
/* SRP, LSP (StatefulIPv4LspIdentidiersTlv),
* END-POINT, ERO.
@@ -440,7 +441,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest10() throws PcepParseException {
+ public void initiateMessageTest10() throws PcepParseException, PcepOutOfBoundMessageException {
/* SRP, LSP (StatefulIPv4LspIdentidiersTlv, StatefulRsvpErrorSpecTlv).
*/
@@ -484,7 +485,7 @@
* StatefulLspErrorCodeTlv) objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest11() throws PcepParseException {
+ public void initiateMessageTest11() throws PcepParseException, PcepOutOfBoundMessageException {
/* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
StatefulLspErrorCodeTlv).*/
@@ -528,7 +529,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest12() throws PcepParseException {
+ public void initiateMessageTest12() throws PcepParseException, PcepOutOfBoundMessageException {
/* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv).
*/
@@ -571,7 +572,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest13() throws PcepParseException {
+ public void initiateMessageTest13() throws PcepParseException, PcepOutOfBoundMessageException {
/* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv).
*/
@@ -613,7 +614,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest14() throws PcepParseException {
+ public void initiateMessageTest14() throws PcepParseException, PcepOutOfBoundMessageException {
/* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv).
*/
@@ -655,7 +656,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest15() throws PcepParseException {
+ public void initiateMessageTest15() throws PcepParseException, PcepOutOfBoundMessageException {
/* SRP, LSP (StatefulIPv4LspIdentidiersTlv).
*/
@@ -696,7 +697,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest16() throws PcepParseException {
+ public void initiateMessageTest16() throws PcepParseException, PcepOutOfBoundMessageException {
//srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50,
@@ -740,7 +741,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest17() throws PcepParseException {
+ public void initiateMessageTest17() throws PcepParseException, PcepOutOfBoundMessageException {
//srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
@@ -784,7 +785,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest18() throws PcepParseException {
+ public void initiateMessageTest18() throws PcepParseException, PcepOutOfBoundMessageException {
//srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth,metric-list
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -829,7 +830,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest19() throws PcepParseException {
+ public void initiateMessageTest19() throws PcepParseException, PcepOutOfBoundMessageException {
//srp,lsp(all tlvs),end-point,ero,lspa,bandwidth,metric-list
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x74,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -876,7 +877,7 @@
* lsp(SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv) objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest20() throws PcepParseException {
+ public void initiateMessageTest20() throws PcepParseException, PcepOutOfBoundMessageException {
/* srp,lsp (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, srp,
* lsp(SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv).
*/
@@ -924,7 +925,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest21() throws PcepParseException {
+ public void initiateMessageTest21() throws PcepParseException, PcepOutOfBoundMessageException {
/*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
* srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero
*/
@@ -978,7 +979,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest22() throws PcepParseException {
+ public void initiateMessageTest22() throws PcepParseException, PcepOutOfBoundMessageException {
/*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
* srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa
*/
@@ -1033,7 +1034,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest23() throws PcepParseException {
+ public void initiateMessageTest23() throws PcepParseException, PcepOutOfBoundMessageException {
/*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
* srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth
*/
@@ -1090,7 +1091,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest24() throws PcepParseException {
+ public void initiateMessageTest24() throws PcepParseException, PcepOutOfBoundMessageException {
/*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
* srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth*/
byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xBC,
@@ -1148,7 +1149,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest25() throws PcepParseException {
+ public void initiateMessageTest25() throws PcepParseException, PcepOutOfBoundMessageException {
/*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,bandwidth,
* srp,lsp(StatefulIPv4LspIdentidiersTlv),
@@ -1209,7 +1210,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest26() throws PcepParseException {
+ public void initiateMessageTest26() throws PcepParseException, PcepOutOfBoundMessageException {
/*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,bandwidth,metric-list,
* srp,lsp(StatefulIPv4LspIdentidiersTlv),
@@ -1271,7 +1272,7 @@
* objects in PcInitiate message.
*/
@Test
- public void initiateMessageTest27() throws PcepParseException {
+ public void initiateMessageTest27() throws PcepParseException, PcepOutOfBoundMessageException {
/*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth,metric-list,
* srp,lsp(StatefulIPv4LspIdentidiersTlv),
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepKeepaliveMsgTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepKeepaliveMsgTest.java
index 56cf06b..0131860 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepKeepaliveMsgTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepKeepaliveMsgTest.java
@@ -19,6 +19,7 @@
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Assert;
import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -31,7 +32,7 @@
* Common header for keep alive message.
*/
@Test
- public void keepaliveMessageTest1() throws PcepParseException {
+ public void keepaliveMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] keepaliveMsg = new byte[] {0x20, 0x02, 0x00, 0x04 };
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepLSReportMsgTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepLSReportMsgTest.java
new file mode 100644
index 0000000..ea1009d
--- /dev/null
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepLSReportMsgTest.java
@@ -0,0 +1,1585 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio.protocol;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.core.Is.is;
+
+public class PcepLSReportMsgTest {
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV, Local Node Descriptors TLV(AutonomousSystemSubTlv)).
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x2C, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x28, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x08, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystem Tlv
+ 0x00, 0x00, 0x00, 0x11};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV, Local Node Descriptors TLV(AutonomousSystemSubTlv)) with different LS-ID.
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x2C, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x28, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x08, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for LS Object (Routing Universe TLV)
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x20, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x1C, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv.
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv)).
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x48, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x44, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OspfAreaIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x40, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x3C, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x1C, // Local Node Descriptors TLV
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for LS Object (Routing Universe TLV,Local Node Descriptors TLV(OSPFareaIDsubTlv,
+ * IgpRouterIdSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x38, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x34, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x14, // Local Node Descriptors TLV
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for LS Object (Routing Universe TLV,Local Node Descriptors TLV(IgpRouterIdSubTlv)).
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x30, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x2C, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x0C, // Local Node Descriptors TLV
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for LS Object (Routing Universe TLV,Local Node Descriptors TLV)
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x24, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x20, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x00 // Local Node Descriptors TLV
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv.
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv.
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv)).
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest9() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x70, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x6C, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest10() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x68, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x64, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x1C, //RemoteNodeDescriptorsTLV
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(OSPFareaIDsubTlv, IgpRouterIdSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest11() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x60, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x5C, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x14, //RemoteNodeDescriptorsTLV
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(IgpRouterIdSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest12() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x58, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x54, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x0c, //RemoteNodeDescriptorsTLV
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV)
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest13() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x4C, // common header
+ (byte) 0xE0, 0x10, 0x00, 0x48, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x00 //RemoteNodeDescriptorsTLV
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv
+ * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest14() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0x90, // common header
+ (byte) 0xE0, 0x10, 0x00, (byte) 0x8C, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
+ 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
+ 0x01, 0x011, 0x01, 0x10
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(
+ * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest15() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0x84, // common header
+ (byte) 0xE0, 0x10, 0x00, (byte) 0x80, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x04, 0x00, 0x10, //LinkDescriptorsTLV
+ 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
+ 0x01, 0x011, 0x01, 0x10
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(IPv4NeighborAddressSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest16() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0x7C, // common header
+ (byte) 0xE0, 0x10, 0x00, (byte) 0x78, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x04, 0x00, 0x08, //LinkDescriptorsTLV
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
+ 0x01, 0x011, 0x01, 0x10
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV)
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest17() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0x74, // common header
+ (byte) 0xE0, 0x10, 0x00, (byte) 0x70, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x04, 0x00, 0x00, //LinkDescriptorsTLV
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv
+ * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest18() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0xC4, // common header
+ (byte) 0xE0, 0x10, 0x00, (byte) 0xC0, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
+ 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ (byte) 0xFF, 0x05, 0x00, 0x30, //NodeAttributesTlv
+ 0x00, 0x0D, 0x00, 0x01, //NodeFlagBitsSubTlv
+ (byte) 0x90, 0x00, 0x00, 0x00,
+ 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x00, 0x0F, 0x00, 0x08, //NodeNameSubTlv
+ 0x08, 0x00, 0x01, 0x09,
+ 0x08, 0x00, 0x01, 0x09,
+ 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
+ 0x00, 0x01, 0x01, 0x02
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv
+ * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(NodeFlagBitsSubTlv
+ * OpaqueNodePropertiesSubTlv, NodeNameSubTlv, ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest19() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0xC4, // common header
+ (byte) 0xE0, 0x10, 0x00, (byte) 0xC0, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
+ 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ (byte) 0xFF, 0x05, 0x00, 0x30, //NodeAttributesTlv
+ 0x00, 0x0D, 0x00, 0x01, //NodeFlagBitsSubTlv
+ (byte) 0x90, 0x00, 0x00, 0x00,
+ 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x00, 0x0F, 0x00, 0x08, //NodeNameSubTlv
+ 0x08, 0x00, 0x01, 0x09,
+ 0x08, 0x00, 0x01, 0x09,
+ 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
+ 0x00, 0x01, 0x01, 0x02
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv
+ * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(OpaqueNodePropertiesSubTlv
+ * NodeNameSubTlv, ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest20() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0xBC, // common header
+ (byte) 0xE0, 0x10, 0x00, (byte) 0xB8, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
+ 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ (byte) 0xFF, 0x05, 0x00, 0x28, //NodeAttributesTlv
+ 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x00, 0x0F, 0x00, 0x08, //NodeNameSubTlv
+ 0x08, 0x00, 0x01, 0x09,
+ 0x08, 0x00, 0x01, 0x09,
+ 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
+ 0x00, 0x01, 0x01, 0x02
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv.
+ * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(OpaqueNodePropertiesSubTlv
+ * ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest21() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0xB0, // common header
+ (byte) 0xE0, 0x10, 0x00, (byte) 0xAC, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
+ 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ (byte) 0xFF, 0x05, 0x00, 0x1C, //NodeAttributesTlv
+ 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
+ 0x00, 0x01, 0x01, 0x02
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv,
+ * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(NodeFlagBitsSubTlv,
+ * OpaqueNodePropertiesSubTlv, NodeNameSubTlv, ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv),
+ * LinkAttributesTlv(IPv4RouterIdOfRemoteNodeSubTlv, IPv6LSRouterIdofRemoteNodeTlv, AdministrativeGroupSubTlv,
+ * TEDefaultMetricSubTlv, MaximumLinkBandwidthSubTlv, MaximumReservableLinkBandwidthSubTlv,
+ * UnreservedBandwidthSubTlv, LinkProtectionTypeSubTlv, MPLSProtocolMaskSubTlv, IgpMetricSubTlv,
+ * SharedRiskLinkGroupSubTlv, OpaqueLinkAttributeSubTlv, LinkNameAttributeSubTlv)).
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest22() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x01, 0x18, // common header
+ (byte) 0xE0, 0x10, 0x01, 0x14, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
+ 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ (byte) 0xFF, 0x05, 0x00, 0x1C, //NodeAttributesTlv
+ 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
+ 0x00, 0x01, 0x01, 0x02,
+ (byte) 0xFF, 0x06, 0x00, 0x64, //LinkAttributesTlv
+ 0x00, 0x13, 0x00, 0x04, //IPv4RouterIdOfRemoteNodeSubTlv
+ 0x00, 0x07, 0x08, 0x00,
+ 0x00, 0x16, 0x00, 0x04, //AdministrativeGroupSubTlv
+ 0x00, 0x09, 0x08, 0x00,
+ 0x00, 0x17, 0x00, 0x04, //MaximumLinkBandwidthSubTlv
+ 0x00, 0x09, 0x00, 0x00,
+ 0x00, 0x18, 0x00, 0x04, //MaximumReservableLinkBandwidthSubTlv
+ 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x19, 0x00, 0x04, //UnreservedBandwidthSubTlv
+ 0x00, 0x00, (byte) 0x90, 0x00,
+ 0x00, 0x1A, 0x00, 0x04, //TEDefaultMetricSubTlv
+ 0x00, (byte) 0x99, 0x09, 0x00,
+ 0x00, 0x1B, 0x00, 0x02, //LinkProtectionTypeSubTlv
+ 0x09, 0x00, 0x00, 0x00,
+ 0x00, 0x1C, 0x00, 0x01, //MPLSProtocolMaskSubTlv
+ (byte) 0x80, 0x00, 0x00, 0x00,
+ 0x00, 0x1D, 0x00, 0x04, //IgpMetricSubTlv
+ 0x09, (byte) 0x89, 0x07, 0x00,
+ 0x00, 0x1E, 0x00, 0x04, //SharedRiskLinkGroupSubTlv
+ 0x04, 0x47, 0x00, 0x03,
+ 0x00, 0x1F, 0x00, 0x08, //OpaqueLinkAttributeSubTlv
+ 0x04, 0x49, 0x00, 0x04,
+ 0x04, 0x47, 0x00, 0x03,
+ 0x00, 0x20, 0x00, 0x04, //LinkNameAttributeSubTlv
+ 0x04, 0x47, 0x00, 0x03
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv,
+ * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(NodeFlagBitsSubTlv,
+ * OpaqueNodePropertiesSubTlv, NodeNameSubTlv, ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv),
+ * LinkAttributesTlv(IPv4RouterIdOfRemoteNodeSubTlv, IPv6LSRouterIdofRemoteNodeTlv, AdministrativeGroupSubTlv,
+ * MaximumLinkBandwidthSubTlv, MaximumReservableLinkBandwidthSubTlv, UnreservedBandwidthSubTlv,
+ * TEDefaultMetricSubTlv, LinkProtectionTypeSubTlv, MPLSProtocolMaskSubTlv, IgpMetricSubTlv,
+ * SharedRiskLinkGroupSubTlv, OpaqueLinkAttributeSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest23() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x01, 0x10, // common header
+ (byte) 0xE0, 0x10, 0x01, 0x0C, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
+ 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ (byte) 0xFF, 0x05, 0x00, 0x1C, //NodeAttributesTlv
+ 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
+ 0x00, 0x01, 0x01, 0x02,
+ (byte) 0xFF, 0x06, 0x00, 0x5C, //LinkAttributesTlv
+ 0x00, 0x13, 0x00, 0x04, //IPv4RouterIdOfRemoteNodeSubTlv
+ 0x00, 0x07, 0x08, 0x00,
+ 0x00, 0x16, 0x00, 0x04, //AdministrativeGroupSubTlv
+ 0x00, 0x09, 0x08, 0x00,
+ 0x00, 0x17, 0x00, 0x04, //MaximumLinkBandwidthSubTlv
+ 0x00, 0x09, 0x00, 0x00,
+ 0x00, 0x18, 0x00, 0x04, //MaximumReservableLinkBandwidthSubTlv
+ 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x19, 0x00, 0x04, //UnreservedBandwidthSubTlv
+ 0x00, 0x00, (byte) 0x90, 0x00,
+ 0x00, 0x1A, 0x00, 0x04, //TEDefaultMetricSubTlv
+ 0x00, (byte) 0x99, 0x09, 0x00,
+ 0x00, 0x1B, 0x00, 0x02, //LinkProtectionTypeSubTlv
+ 0x09, 0x00, 0x00, 0x00,
+ 0x00, 0x1C, 0x00, 0x01, //MPLSProtocolMaskSubTlv
+ (byte) 0x80, 0x00, 0x00, 0x00,
+ 0x00, 0x1D, 0x00, 0x04, //IgpMetricSubTlv
+ 0x09, (byte) 0x89, 0x07, 0x00,
+ 0x00, 0x1E, 0x00, 0x04, //SharedRiskLinkGroupSubTlv
+ 0x04, 0x47, 0x00, 0x03,
+ 0x00, 0x1F, 0x00, 0x08, //OpaqueLinkAttributeSubTlv
+ 0x04, 0x49, 0x00, 0x04,
+ 0x04, 0x47, 0x00, 0x03
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv,
+ * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(NodeFlagBitsSubTlv,
+ * OpaqueNodePropertiesSubTlv, NodeNameSubTlv, ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv),
+ * LinkAttributesTlv(IPv4RouterIdOfRemoteNodeSubTlv, IPv6LSRouterIdofRemoteNodeTlv, AdministrativeGroupSubTlv,
+ * MaximumLinkBandwidthSubTlv, MaximumReservableLinkBandwidthSubTlv, UnreservedBandwidthSubTlv,
+ * TEDefaultMetricSubTlv, LinkProtectionTypeSubTlv, MPLSProtocolMaskSubTlv, IgpMetricSubTlv,
+ * SharedRiskLinkGroupSubTlv)) in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest24() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x01, 0x08, // common header
+ (byte) 0xE0, 0x10, 0x01, 0x04, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
+ 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ (byte) 0xFF, 0x05, 0x00, 0x1C, //NodeAttributesTlv
+ 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
+ 0x00, 0x01, 0x01, 0x02,
+ (byte) 0xFF, 0x06, 0x00, 0x54, //LinkAttributesTlv
+ 0x00, 0x13, 0x00, 0x04, //IPv4RouterIdOfRemoteNodeSubTlv
+ 0x00, 0x07, 0x08, 0x00,
+ 0x00, 0x16, 0x00, 0x04, //AdministrativeGroupSubTlv
+ 0x00, 0x09, 0x08, 0x00,
+ 0x00, 0x17, 0x00, 0x04, //MaximumLinkBandwidthSubTlv
+ 0x00, 0x09, 0x00, 0x00,
+ 0x00, 0x18, 0x00, 0x04, //MaximumReservableLinkBandwidthSubTlv
+ 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x19, 0x00, 0x04, //UnreservedBandwidthSubTlv
+ 0x00, 0x00, (byte) 0x90, 0x00,
+ 0x00, 0x1A, 0x00, 0x04, //TEDefaultMetricSubTlv
+ 0x00, (byte) 0x99, 0x09, 0x00,
+ 0x00, 0x1B, 0x00, 0x02, //LinkProtectionTypeSubTlv
+ 0x09, 0x00, 0x00, 0x00,
+ 0x00, 0x1C, 0x00, 0x01, //MPLSProtocolMaskSubTlv
+ (byte) 0x80, 0x00, 0x00, 0x00,
+ 0x00, 0x1D, 0x00, 0x04, //IgpMetricSubTlv
+ 0x09, (byte) 0x89, 0x07, 0x00,
+ 0x00, 0x1E, 0x00, 0x08, //SharedRiskLinkGroupSubTlv
+ 0x04, 0x47, 0x00, 0x03,
+ 0x04, 0x47, 0x00, 0x03
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
+ * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv,
+ * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(NodeFlagBitsSubTlv,
+ * OpaqueNodePropertiesSubTlv, NodeNameSubTlv, ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv),
+ * LinkAttributesTlv(IPv4RouterIdOfRemoteNodeSubTlv, IPv6LSRouterIdofRemoteNodeTlv, AdministrativeGroupSubTlv,
+ * MaximumLinkBandwidthSubTlv, MaximumReservableLinkBandwidthSubTlv, UnreservedBandwidthSubTlv,
+ * TEDefaultMetricSubTlv, LinkProtectionTypeSubTlv, MPLSProtocolMaskSubTlv, IgpMetricSubTlv))
+ * in PcLSRpt message.
+ */
+ @Test
+ public void lsReportMessageTest25() throws PcepParseException, PcepOutOfBoundMessageException {
+
+ byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0xFC, // common header
+ (byte) 0xE0, 0x10, 0x00, (byte) 0xF8, // LS Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
+ (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
+ 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
+ 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ (byte) 0xFF, 0x05, 0x00, 0x1C, //NodeAttributesTlv
+ 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
+ 0x00, 0x01, 0x01, 0x02,
+ (byte) 0xFF, 0x06, 0x00, 0x48, //LinkAttributesTlv
+ 0x00, 0x13, 0x00, 0x04, //IPv4RouterIdOfRemoteNodeSubTlv
+ 0x00, 0x07, 0x08, 0x00,
+ 0x00, 0x16, 0x00, 0x04, //AdministrativeGroupSubTlv
+ 0x00, 0x09, 0x08, 0x00,
+ 0x00, 0x17, 0x00, 0x04, //MaximumLinkBandwidthSubTlv
+ 0x00, 0x09, 0x00, 0x00,
+ 0x00, 0x18, 0x00, 0x04, //MaximumReservableLinkBandwidthSubTlv
+ 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x19, 0x00, 0x04, //UnreservedBandwidthSubTlv
+ 0x00, 0x00, (byte) 0x90, 0x00,
+ 0x00, 0x1A, 0x00, 0x04, //TEDefaultMetricSubTlv
+ 0x00, (byte) 0x99, 0x09, 0x00,
+ 0x00, 0x1B, 0x00, 0x02, //LinkProtectionTypeSubTlv
+ 0x09, 0x00, 0x00, 0x00,
+ 0x00, 0x1C, 0x00, 0x01, //MPLSProtocolMaskSubTlv
+ (byte) 0x80, 0x00, 0x00, 0x00,
+ 0x00, 0x1D, 0x00, 0x04, //IgpMetricSubTlv
+ 0x09, (byte) 0x89, 0x07, 0x00
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(lsReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+
+ assertThat(message, instanceOf(PcepLSReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(lsReportMsg));
+ }
+}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepLabelUpdateMsgTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepLabelUpdateMsgTest.java
index e1947bd..2256496 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepLabelUpdateMsgTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepLabelUpdateMsgTest.java
@@ -18,6 +18,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -32,15 +33,15 @@
* in PcepLabelUpdate message.
*/
@Test
- public void labelUpdateMessageTest1() throws PcepParseException {
+ public void labelUpdateMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x24, // common header
+ byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x24, // common header
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10,
0x20, 0x10, 0x00, 0x08, // LSP Object Header
0x00, 0x01, 0x00, 0x00,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x66};
@@ -72,18 +73,18 @@
* in PcepLabelUpdate message.
*/
@Test
- public void labelUpdateMessageTest2() throws PcepParseException {
+ public void labelUpdateMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x30, // common header
+ byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x30, // common header
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10,
0x20, 0x10, 0x00, 0x08, // LSP Object Header
0x00, 0x01, 0x00, 0x00,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x66,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x77};
@@ -113,16 +114,16 @@
* in PcepLabelUpdate message.
*/
@Test
- public void labelUpdateMessageTest3() throws PcepParseException {
+ public void labelUpdateMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x24, // common header
+ byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x24, // common header
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x66,
- 0x24, 0x10, 0x00, 0x08, // FEC Object Header
+ (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header
0x0A, 0x0A, 0x0B, 0x0B};
ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
@@ -151,18 +152,18 @@
* in PcepLabelUpdate message.
*/
@Test
- public void labelUpdateMessageTest4() throws PcepParseException {
+ public void labelUpdateMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x50, // common header
+ byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x50, // common header
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10,
0x20, 0x10, 0x00, 0x08, // LSP Object Header
0x00, 0x01, 0x00, 0x00,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x66,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x77,
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
@@ -170,7 +171,7 @@
0x00, 0x00, 0x00, 0x11,
0x20, 0x10, 0x00, 0x08, // LSP Object Header
0x00, 0x02, 0x00, 0x00,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x44};
@@ -200,24 +201,24 @@
* in PcepLabelUpdate message.
*/
@Test
- public void labelUpdateMessageTest5() throws PcepParseException {
+ public void labelUpdateMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x44, // common header
+ byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x44, // common header
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x66,
- 0x24, 0x10, 0x00, 0x08, // FEC Object Header
+ (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header
0x0A, 0x0A, 0x0B, 0x0B,
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x11,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x66,
- 0x24, 0x10, 0x00, 0x08, // FEC Object Header
+ (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header
0x0A, 0x0A, 0x0C, 0x0C};
ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
@@ -246,27 +247,27 @@
* in PcepLabelUpdate message.
*/
@Test
- public void labelUpdateMessageTest6() throws PcepParseException {
+ public void labelUpdateMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x50, // common header
+ byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x50, // common header
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10,
0x20, 0x10, 0x00, 0x08, // LSP Object Header
0x00, 0x01, 0x00, 0x00,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x66,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x77,
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x12,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x66,
- 0x24, 0x10, 0x00, 0x08, // FEC Object Header
+ (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header
0x0A, 0x0A, 0x0D, 0x0D};
ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
@@ -295,26 +296,26 @@
* in PcepLabelUpdate message.
*/
@Test
- public void labelUpdateMessageTest7() throws PcepParseException {
+ public void labelUpdateMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x50, // common header
+ byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x50, // common header
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x12,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x66,
- 0x24, 0x10, 0x00, 0x08, // FEC Object Header
+ (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header
0x0A, 0x0A, 0x0D, 0x0D,
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10,
0x20, 0x10, 0x00, 0x08, // LSP Object Header
0x00, 0x01, 0x00, 0x00,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x66,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x77};
@@ -345,26 +346,26 @@
* in PcepLabelUpdate message.
*/
@Test
- public void labelUpdateMessageTest8() throws PcepParseException {
+ public void labelUpdateMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
- byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x7C, // common header
+ byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x7C, // common header
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x12,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x66,
- 0x24, 0x10, 0x00, 0x08, // FEC Object Header
+ (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header
0x0A, 0x0A, 0x0D, 0x0D,
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10,
0x20, 0x10, 0x00, 0x08, // LSP Object Header
0x00, 0x01, 0x00, 0x00,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x66,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x77,
0x21, 0x10, 0x00, 0x0C, // SRP Object Header
@@ -372,10 +373,10 @@
0x00, 0x00, 0x00, 0x10,
0x20, 0x10, 0x00, 0x08, // LSP Object Header
0x00, 0x01, 0x00, 0x00,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x66,
- 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x77};
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepOpenMsgTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepOpenMsgTest.java
index 6e0a059..eea8a26 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepOpenMsgTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepOpenMsgTest.java
@@ -18,6 +18,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -33,7 +34,7 @@
* PCECC-CAPABILITY-TLV in Pcep Open message.
*/
@Test
- public void openMessageTest1() throws PcepParseException {
+ public void openMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x10, 0x00, 0x20, 0x20, 0x1e, 0x78, (byte) 0xbd,
0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY
@@ -67,7 +68,7 @@
* This test case checks open object with STATEFUL-PCE-CAPABILITY-TLV in Pcep Open message.
*/
@Test
- public void openMessageTest2() throws PcepParseException {
+ public void openMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x14, // common header
0x01, 0x10, 0x00, 0x10, // common object header
@@ -99,7 +100,7 @@
* This test case checks open object with GmplsCapability tlv in Pcep Open message.
*/
@Test
- public void openMessageTest3() throws PcepParseException {
+ public void openMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x14, // common header
0x01, 0x10, 0x00, 0x10, // common object header
@@ -133,7 +134,7 @@
* This test case checks open object with StatefulLspDbVer Tlv in Pcep Open message.
*/
@Test
- public void openMessageTest4() throws PcepParseException {
+ public void openMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x18,
0x01, 0x10, 0x00, 0x14, 0x20, 0x1e, 0x78, 0x20,
@@ -165,7 +166,7 @@
* This test case checks open object with no tlv's in Pcep Open message.
*/
@Test
- public void openMessageTest5() throws PcepParseException {
+ public void openMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x0C,
0x01, 0x10, 0x00, 0x08, 0x20, 0x1e, 0x78, (byte) 0xbd }; // no Tlvs in open messsage
@@ -197,7 +198,7 @@
* with I bit set in Pcep Open message.
*/
@Test
- public void openMessageTest6() throws PcepParseException {
+ public void openMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x11, 0x00, 0x20, //p bit not set & i bit set
0x20, 0x1e, 0x78, (byte) 0xbd,
@@ -233,7 +234,7 @@
* with P bit set in Pcep Open message.
*/
@Test
- public void openMessageTest7() throws PcepParseException {
+ public void openMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x12, 0x00, 0x20, //p bit set & i bit not set
0x20, 0x1e, 0x78, (byte) 0xbd,
@@ -269,7 +270,7 @@
* with P & I bits set in Pcep Open message.
*/
@Test
- public void openMessageTest8() throws PcepParseException {
+ public void openMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
/* OPEN OBJECT (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV, PCECC-CAPABILITY-TLV)
with p bit set & i bit set.
@@ -308,7 +309,7 @@
* with P & I bits set and invalid session id in Pcep Open message.
*/
@Test
- public void openMessageTest9() throws PcepParseException {
+ public void openMessageTest9() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x13, 0x00, 0x20, //p bit set & i bit set
0x20, 0x1e, 0x78, 0x00, //invalid sessionID
@@ -345,7 +346,7 @@
* in Pcep Open message.
*/
@Test
- public void openMessageTest10() throws PcepParseException {
+ public void openMessageTest10() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x1C, // common header
0x01, 0x10, 0x00, 0x18, // common object header
@@ -382,7 +383,7 @@
* PCECC-CAPABILITY-TLV, TED Capability TLV in Pcep Open message.
*/
@Test
- public void openMessageTest11() throws PcepParseException {
+ public void openMessageTest11() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x2C, // common header
0x01, 0x10, 0x00, 0x28, // common object header
@@ -390,7 +391,7 @@
0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV
- 0x00, 0x00, 0x00, 0x03, 0x00, (byte) 0x84, 0x00, 0x04, // TED Capability TLV
+ 0x00, 0x00, 0x00, 0x03, (byte) 0xFF, (byte) 0x00, 0x00, 0x04, // LS Capability TLV
0x00, 0x00, 0x00, 0x00 };
byte[] testOpenMsg = {0};
@@ -412,7 +413,6 @@
buf.readBytes(testOpenMsg, 0, readLen);
assertThat(testOpenMsg, is(openMsg));
-
}
/**
@@ -420,7 +420,7 @@
* PCECC-CAPABILITY-TLV in Pcep Open message.
*/
@Test
- public void openMessageTest12() throws PcepParseException {
+ public void openMessageTest12() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, // common header
0x01, 0x10, 0x00, 0x20, // common object header
@@ -457,7 +457,7 @@
* in Pcep Open message.
*/
@Test
- public void openMessageTest13() throws PcepParseException {
+ public void openMessageTest13() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x1c, // common header
0x01, 0x10, 0x00, 0x18, // common object header
@@ -493,7 +493,7 @@
* This test case checks open object with STATEFUL-PCE-CAPABILITY in Pcep Open message.
*/
@Test
- public void openMessageTest14() throws PcepParseException {
+ public void openMessageTest14() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x14, // common header
0x01, 0x10, 0x00, 0x10, // common object header
@@ -527,7 +527,7 @@
* This test case checks open object with no tlv Pcep Open message.
*/
@Test
- public void openMessageTest15() throws PcepParseException {
+ public void openMessageTest15() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x0c, // common header
0x01, 0x10, 0x00, 0x08, // common object header
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepReportMsgExtTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepReportMsgExtTest.java
index f9921ef..8a78e04 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepReportMsgExtTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepReportMsgExtTest.java
@@ -18,6 +18,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -32,7 +33,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest39() throws PcepParseException {
+ public void reportMessageTest39() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x98,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
@@ -79,7 +80,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest40() throws PcepParseException {
+ public void reportMessageTest40() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x64,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
@@ -120,7 +121,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest41() throws PcepParseException {
+ public void reportMessageTest41() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x8c,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
@@ -166,7 +167,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest42() throws PcepParseException {
+ public void reportMessageTest42() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0xE8,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepReportMsgTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepReportMsgTest.java
index c9e2bc8..ff10078 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepReportMsgTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepReportMsgTest.java
@@ -18,6 +18,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -31,7 +32,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest1() throws PcepParseException {
+ public void reportMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, 0x24,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -66,7 +67,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest2() throws PcepParseException {
+ public void reportMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x7c,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -111,7 +112,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest3() throws PcepParseException {
+ public void reportMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x70,
0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object //LSP Object
@@ -155,7 +156,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest4() throws PcepParseException {
+ public void reportMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x64,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -197,7 +198,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest5() throws PcepParseException {
+ public void reportMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x50,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -237,7 +238,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest6() throws PcepParseException {
+ public void reportMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x6c,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -279,7 +280,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest7() throws PcepParseException {
+ public void reportMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x58,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -318,7 +319,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest8() throws PcepParseException {
+ public void reportMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x70,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -361,7 +362,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest9() throws PcepParseException {
+ public void reportMessageTest9() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x44,
0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object //LSP Object
@@ -399,7 +400,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest10() throws PcepParseException {
+ public void reportMessageTest10() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x74,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -442,7 +443,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest11() throws PcepParseException {
+ public void reportMessageTest11() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x68,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -483,7 +484,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest12() throws PcepParseException {
+ public void reportMessageTest12() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x60,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -523,7 +524,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest13() throws PcepParseException {
+ public void reportMessageTest13() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x68,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -564,7 +565,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest14() throws PcepParseException {
+ public void reportMessageTest14() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x60,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -604,7 +605,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest15() throws PcepParseException {
+ public void reportMessageTest15() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x7C,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -647,7 +648,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest16() throws PcepParseException {
+ public void reportMessageTest16() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x70,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -689,7 +690,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest17() throws PcepParseException {
+ public void reportMessageTest17() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x74,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -731,7 +732,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest18() throws PcepParseException {
+ public void reportMessageTest18() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x68,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -772,7 +773,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest19() throws PcepParseException {
+ public void reportMessageTest19() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x6C,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -813,7 +814,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest20() throws PcepParseException {
+ public void reportMessageTest20() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x88,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -858,7 +859,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest21() throws PcepParseException {
+ public void reportMessageTest21() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xac,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -908,7 +909,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest22() throws PcepParseException {
+ public void reportMessageTest22() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xA0,
0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
@@ -957,7 +958,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest23() throws PcepParseException {
+ public void reportMessageTest23() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x8c,
0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
@@ -1004,7 +1005,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest24() throws PcepParseException {
+ public void reportMessageTest24() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x84,
0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
@@ -1050,7 +1051,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest25() throws PcepParseException {
+ public void reportMessageTest25() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x8c,
0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
@@ -1097,7 +1098,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest26() throws PcepParseException {
+ public void reportMessageTest26() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x58,
0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
@@ -1138,7 +1139,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest27() throws PcepParseException {
+ public void reportMessageTest27() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x44,
0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
@@ -1177,7 +1178,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest28() throws PcepParseException {
+ public void reportMessageTest28() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x6c,
0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
@@ -1219,7 +1220,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest29() throws PcepParseException {
+ public void reportMessageTest29() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x74,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -1262,7 +1263,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest30() throws PcepParseException {
+ public void reportMessageTest30() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xE4,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -1319,7 +1320,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest31() throws PcepParseException {
+ public void reportMessageTest31() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x01, 0x00,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -1379,7 +1380,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest32() throws PcepParseException {
+ public void reportMessageTest32() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x01, (byte) 0x14,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -1441,7 +1442,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest33() throws PcepParseException {
+ public void reportMessageTest33() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x01, (byte) 0x1c,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -1504,7 +1505,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest34() throws PcepParseException {
+ public void reportMessageTest34() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xB4,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
@@ -1554,7 +1555,7 @@
* in PcRpt message.
*/
@Test
- public void reportMessageTest35() throws PcepParseException {
+ public void reportMessageTest35() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x8C,
0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepTEReportMsgTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepTEReportMsgTest.java
deleted file mode 100644
index e401c15..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepTEReportMsgTest.java
+++ /dev/null
@@ -1,1596 +0,0 @@
-/*
- * Copyright 2014-2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.protocol;
-
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.jboss.netty.buffer.ChannelBuffers;
-import org.junit.Test;
-import org.onosproject.pcepio.exceptions.PcepParseException;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.hamcrest.core.Is.is;
-
-public class PcepTEReportMsgTest {
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV, Local TE Node Descriptors TLV(AutonomousSystemTlv)).
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest1() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x28, // common header
- 0x0E, 0x10, 0x00, 0x24, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x08, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystem Tlv
- 0x00, 0x00, 0x00, 0x11};
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
-
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * T E Object (Routing Universe TLV, Local TE Node Descriptors TLV(AutonomousSystemTlv)) with different TE-ID.
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest2() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x28, // common header
- 0x0E, 0x10, 0x00, 0x24, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x08, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11};
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for TE Object (Routing Universe TLV)
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest3() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x1c, // common header
- 0x0E, 0x10, 0x00, 0x18, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv.
- * OSPFareaIDsubTlv, RouterIDSubTlv)).
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest4() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x44, // common header
- 0x0E, 0x10, 0x00, 0x40, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11};
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest5() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x3C, // common header
- 0x0E, 0x10, 0x00, 0x38, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x1C, // Local TE Node Descriptors TLV
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11};
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(OSPFareaIDsubTlv,
- * RouterIDSubTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest6() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x34, // common header
- 0x0E, 0x10, 0x00, 0x30, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x14, // Local TE Node Descriptors TLV
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11};
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(RouterIDSubTlv)).
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest7() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x2C, // common header
- 0x0E, 0x10, 0x00, 0x28, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x0C, // Local TE Node Descriptors TLV
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11};
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for TE Object (Routing Universe TLV,Local TE Node Descriptors TLV)
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest8() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x20, // common header
- 0x0E, 0x10, 0x00, 0x1C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x00 // Local TE Node Descriptors TLV
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv.
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv.
- * OSPFareaIDsubTlv, RouterIDSubTlv)).
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest9() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x6C, // common header
- 0x0E, 0x10, 0x00, 0x68, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest10() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x64, // common header
- 0x0E, 0x10, 0x00, 0x60, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x1C, //RemoteTENodeDescriptorsTLV
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(OSPFareaIDsubTlv, RouterIDSubTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest11() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x5C, // common header
- 0x0E, 0x10, 0x00, 0x58, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x14, //RemoteTENodeDescriptorsTLV
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(RouterIDSubTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest12() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x54, // common header
- 0x0E, 0x10, 0x00, 0x50, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x0c, //RemoteTENodeDescriptorsTLV
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV)
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest13() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x48, // common header
- 0x0E, 0x10, 0x00, 0x44, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x00, //RemoteTENodeDescriptorsTLV
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
- * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest14() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0x8C, // common header
- 0x0E, 0x10, 0x00, (byte) 0x88, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
- 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
- 0x01, 0x11, 0x00, 0x09,
- 0x01, 0x21, 0x00, 0x09,
- 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
- 0x01, 0x01, 0x01, 0x01,
- 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
- 0x01, 0x011, 0x01, 0x10
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(
- * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest15() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0x80, // common header
- 0x0E, 0x10, 0x00, (byte) 0x7C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x04, 0x2E, 0x00, 0x10, //TELinkDescriptorsTLV
- 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
- 0x01, 0x01, 0x01, 0x01,
- 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
- 0x01, 0x011, 0x01, 0x10
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(IPv4NeighborAddressTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest16() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0x78, // common header
- 0x0E, 0x10, 0x00, (byte) 0x74, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x04, 0x2E, 0x00, 0x08, //TELinkDescriptorsTLV
- 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
- 0x01, 0x011, 0x01, 0x10
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV)
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest17() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0x70, // common header
- 0x0E, 0x10, 0x00, (byte) 0x6C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x04, 0x2E, 0x00, 0x00, //TELinkDescriptorsTLV
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
- * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest18() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0xC0, // common header
- 0x0E, 0x10, 0x00, (byte) 0xbC, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
- 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
- 0x01, 0x11, 0x00, 0x09,
- 0x01, 0x21, 0x00, 0x09,
- 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
- 0x01, 0x01, 0x01, 0x01,
- 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x04, (byte) 0xF3, 0x00, 0x30, //TENodeAttributesTlv
- 0x00, 0x0E, 0x00, 0x01, //NodeFlagBitsTlv
- (byte) 0x90, 0x00, 0x00, 0x00,
- 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
- 0x08, 0x00, 0x01, 0x09,
- 0x08, 0x00, 0x01, 0x09,
- 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
- 0x20, 0x01, 0x22, 0x01,
- 0x20, 0x01, 0x22, 0x01,
- 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
- 0x00, 0x01, 0x01, 0x02
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
- * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv
- * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest19() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0xC0, // common header
- 0x0E, 0x10, 0x00, (byte) 0xBC, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
- 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
- 0x01, 0x11, 0x00, 0x09,
- 0x01, 0x21, 0x00, 0x09,
- 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
- 0x01, 0x01, 0x01, 0x01,
- 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x04, (byte) 0xF3, 0x00, 0x30, //TENodeAttributesTlv
- 0x00, 0x0E, 0x00, 0x01, //NodeFlagBitsTlv
- (byte) 0x90, 0x00, 0x00, 0x00,
- 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
- 0x08, 0x00, 0x01, 0x09,
- 0x08, 0x00, 0x01, 0x09,
- 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
- 0x20, 0x01, 0x22, 0x01,
- 0x20, 0x01, 0x22, 0x01,
- 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
- 0x00, 0x01, 0x01, 0x02
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
- * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(OpaqueNodeAttributeTlv
- * NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest20() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0xB8, // common header
- 0x0E, 0x10, 0x00, (byte) 0xB4, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
- 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
- 0x01, 0x11, 0x00, 0x09,
- 0x01, 0x21, 0x00, 0x09,
- 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
- 0x01, 0x01, 0x01, 0x01,
- 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
- 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
- 0x08, 0x00, 0x01, 0x09,
- 0x08, 0x00, 0x01, 0x09,
- 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
- 0x20, 0x01, 0x22, 0x01,
- 0x20, 0x01, 0x22, 0x01,
- 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
- 0x00, 0x01, 0x01, 0x02
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv.
- * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(OpaqueNodeAttributeTlv
- * ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest21() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0xAC, // common header
- 0x0E, 0x10, 0x00, (byte) 0xA8, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
- 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
- 0x01, 0x11, 0x00, 0x09,
- 0x01, 0x21, 0x00, 0x09,
- 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
- 0x01, 0x01, 0x01, 0x01,
- 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x04, (byte) 0xF3, 0x00, 0x1C, //TENodeAttributesTlv
- 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
- 0x20, 0x01, 0x22, 0x01,
- 0x20, 0x01, 0x22, 0x01,
- 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
- 0x00, 0x01, 0x01, 0x02
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv.
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv.
- * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv.
- * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv.
- * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv).
- * TELinkAttributesTlv(IPv4TERouterIdOfRemoteNodeTlv, IPv6TERouterIdofRemoteNodeTlv, AdministrativeGroupTlv.
- * MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv.
- * LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv:, SharedRiskLinkGroupTlv.
- * OpaqueLinkAttributeTlv, LinkNameTlv)).
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest22() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x120, // common header
- 0x0E, 0x10, 0x01, (byte) 0x1C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
- 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
- 0x01, 0x11, 0x00, 0x09,
- 0x01, 0x21, 0x00, 0x09,
- 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
- 0x01, 0x01, 0x01, 0x01,
- 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
- 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
- 0x08, 0x00, 0x01, 0x09,
- 0x08, 0x00, 0x01, 0x09,
- 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
- 0x20, 0x01, 0x22, 0x01,
- 0x20, 0x01, 0x22, 0x01,
- 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
- 0x00, 0x01, 0x01, 0x02,
- 0x07, 0x69, 0x00, 0x64, //TELinkAttributesTlv
- 0x05, 0x3C, 0x00, 0x04, //IPv4TERouterIdOfRemoteNodeTlv
- 0x00, 0x07, 0x08, 0x00,
- 0x00, 0x03, 0x00, 0x04, //AdministrativeGroupTlv
- 0x00, 0x09, 0x08, 0x00,
- 0x00, 0x09, 0x00, 0x04, //MaximumLinkBandwidthTlv
- 0x00, 0x09, 0x00, 0x00,
- 0x00, 0x0a, 0x00, 0x04, //MaximumReservableLinkBandwidthTlv
- 0x00, 0x10, 0x00, 0x00,
- 0x00, 0x0b, 0x00, 0x04, //UnreservedBandwidthTlv
- 0x00, 0x00, (byte) 0x90, 0x00,
- 0x34, 0x58, 0x00, 0x04, //TEDefaultMetricTlv
- 0x00, (byte) 0x99, 0x09, 0x00,
- 0x00, 0x14, 0x00, 0x02, //LinkProtectionTypeTlv
- 0x09, 0x00, 0x00, 0x00,
- 0x04, 0x46, 0x00, 0x01, //MPLSProtocolMaskTlv
- (byte) 0x80, 0x00, 0x00, 0x00,
- 0x04, 0x47, 0x00, 0x03, //IGPMetricTlv
- 0x09, (byte) 0x89, 0x07, 0x00,
- 0x04, 0x48, 0x00, 0x08, //SharedRiskLinkGroupTlv
- 0x04, 0x47, 0x00, 0x03,
- 0x04, 0x47, 0x00, 0x03, //OpaqueLinkAttributeTlv
- 0x04, 0x49, 0x00, 0x04,
- 0x04, 0x47, 0x00, 0x03,
- 0x04, 0x4A, 0x00, 0x04, //LinkNameTlv
- 0x04, 0x47, 0x00, 0x03
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
- * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv
- * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv)
- * TELinkAttributesTlv(IPv4TERouterIdOfRemoteNodeTlv, IPv6TERouterIdofRemoteNodeTlv, AdministrativeGroupTlv
- * MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv
- * LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv:, SharedRiskLinkGroupTlv
- * OpaqueLinkAttributeTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest23() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x118, // common header
- 0x0E, 0x10, 0x01, (byte) 0x14, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
- 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
- 0x01, 0x11, 0x00, 0x09,
- 0x01, 0x21, 0x00, 0x09,
- 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
- 0x01, 0x01, 0x01, 0x01,
- 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
- 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
- 0x08, 0x00, 0x01, 0x09,
- 0x08, 0x00, 0x01, 0x09,
- 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
- 0x20, 0x01, 0x22, 0x01,
- 0x20, 0x01, 0x22, 0x01,
- 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
- 0x00, 0x01, 0x01, 0x02,
- 0x07, 0x69, 0x00, 0x5C, //TELinkAttributesTlv
- 0x05, 0x3C, 0x00, 0x04, //IPv4TERouterIdOfRemoteNodeTlv
- 0x00, 0x07, 0x08, 0x00,
- 0x00, 0x03, 0x00, 0x04, //AdministrativeGroupTlv
- 0x00, 0x09, 0x08, 0x00,
- 0x00, 0x09, 0x00, 0x04, //MaximumLinkBandwidthTlv
- 0x00, 0x09, 0x00, 0x00,
- 0x00, 0x0a, 0x00, 0x04, //MaximumReservableLinkBandwidthTlv
- 0x00, 0x10, 0x00, 0x00,
- 0x00, 0x0b, 0x00, 0x04, //UnreservedBandwidthTlv
- 0x00, 0x00, (byte) 0x90, 0x00,
- 0x34, 0x58, 0x00, 0x04, //TEDefaultMetricTlv
- 0x00, (byte) 0x99, 0x09, 0x00,
- 0x00, 0x14, 0x00, 0x02, //LinkProtectionTypeTlv
- 0x09, 0x00, 0x00, 0x00,
- 0x04, 0x46, 0x00, 0x01, //MPLSProtocolMaskTlv
- (byte) 0x80, 0x00, 0x00, 0x00,
- 0x04, 0x47, 0x00, 0x03, //IGPMetricTlv
- 0x09, (byte) 0x89, 0x07, 0x00,
- 0x04, 0x48, 0x00, 0x08, //SharedRiskLinkGroupTlv
- 0x04, 0x47, 0x00, 0x03,
- 0x04, 0x47, 0x00, 0x03, //OpaqueLinkAttributeTlv
- 0x04, 0x49, 0x00, 0x04,
- 0x04, 0x47, 0x00, 0x03
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
- * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv
- * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv)
- * TELinkAttributesTlv(IPv4TERouterIdOfRemoteNodeTlv, IPv6TERouterIdofRemoteNodeTlv, AdministrativeGroupTlv
- * MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv
- * LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv:, SharedRiskLinkGroupTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest24() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x110, // common header
- 0x0E, 0x10, 0x01, (byte) 0x0C, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
- 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
- 0x01, 0x11, 0x00, 0x09,
- 0x01, 0x21, 0x00, 0x09,
- 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
- 0x01, 0x01, 0x01, 0x01,
- 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
- 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
- 0x08, 0x00, 0x01, 0x09,
- 0x08, 0x00, 0x01, 0x09,
- 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
- 0x20, 0x01, 0x22, 0x01,
- 0x20, 0x01, 0x22, 0x01,
- 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
- 0x00, 0x01, 0x01, 0x02,
- 0x07, 0x69, 0x00, 0x54, //TELinkAttributesTlv
- 0x05, 0x3C, 0x00, 0x04, //IPv4TERouterIdOfRemoteNodeTlv
- 0x00, 0x07, 0x08, 0x00,
- 0x00, 0x03, 0x00, 0x04, //AdministrativeGroupTlv
- 0x00, 0x09, 0x08, 0x00,
- 0x00, 0x09, 0x00, 0x04, //MaximumLinkBandwidthTlv
- 0x00, 0x09, 0x00, 0x00,
- 0x00, 0x0a, 0x00, 0x04, //MaximumReservableLinkBandwidthTlv
- 0x00, 0x10, 0x00, 0x00,
- 0x00, 0x0b, 0x00, 0x04, //UnreservedBandwidthTlv
- 0x00, 0x00, (byte) 0x90, 0x00,
- 0x34, 0x58, 0x00, 0x04, //TEDefaultMetricTlv
- 0x00, (byte) 0x99, 0x09, 0x00,
- 0x00, 0x14, 0x00, 0x02, //LinkProtectionTypeTlv
- 0x09, 0x00, 0x00, 0x00,
- 0x04, 0x46, 0x00, 0x01, //MPLSProtocolMaskTlv
- (byte) 0x80, 0x00, 0x00, 0x00,
- 0x04, 0x47, 0x00, 0x03, //IGPMetricTlv
- 0x09, (byte) 0x89, 0x07, 0x00,
- 0x04, 0x48, 0x00, 0x08, //SharedRiskLinkGroupTlv
- 0x04, 0x47, 0x00, 0x03,
- 0x04, 0x47, 0x00, 0x03
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-
- /**
- * This test case checks for
- * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
- * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
- * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv
- * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv)
- * TELinkAttributesTlv(IPv4TERouterIdOfRemoteNodeTlv, IPv6TERouterIdofRemoteNodeTlv, AdministrativeGroupTlv
- * MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv
- * LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv))
- * in PcTERpt message.
- */
- @Test
- public void teReportMessageTest25() throws PcepParseException {
-
- byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x104, // common header
- 0x0E, 0x10, 0x01, 0x00, // TE Object Header
- 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
- 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
- 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
- 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
- 0x01, 0x11, 0x00, 0x09,
- 0x01, 0x21, 0x00, 0x09,
- 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
- 0x01, 0x01, 0x01, 0x01,
- 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
- 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
- 0x01, 0x011, 0x01, 0x10,
- 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
- 0x08, 0x00, 0x01, 0x09,
- 0x08, 0x00, 0x01, 0x09,
- 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
- 0x20, 0x01, 0x22, 0x01,
- 0x20, 0x01, 0x22, 0x01,
- 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
- 0x00, 0x01, 0x01, 0x02,
- 0x07, 0x69, 0x00, 0x48, //TELinkAttributesTlv
- 0x05, 0x3C, 0x00, 0x04, //IPv4TERouterIdOfRemoteNodeTlv
- 0x00, 0x07, 0x08, 0x00,
- 0x00, 0x03, 0x00, 0x04, //AdministrativeGroupTlv
- 0x00, 0x09, 0x08, 0x00,
- 0x00, 0x09, 0x00, 0x04, //MaximumLinkBandwidthTlv
- 0x00, 0x09, 0x00, 0x00,
- 0x00, 0x0a, 0x00, 0x04, //MaximumReservableLinkBandwidthTlv
- 0x00, 0x10, 0x00, 0x00,
- 0x00, 0x0b, 0x00, 0x04, //UnreservedBandwidthTlv
- 0x00, 0x00, (byte) 0x90, 0x00,
- 0x34, 0x58, 0x00, 0x04, //TEDefaultMetricTlv
- 0x00, (byte) 0x99, 0x09, 0x00,
- 0x00, 0x14, 0x00, 0x02, //LinkProtectionTypeTlv
- 0x09, 0x00, 0x00, 0x00,
- 0x04, 0x46, 0x00, 0x01, //MPLSProtocolMaskTlv
- (byte) 0x80, 0x00, 0x00, 0x00,
- 0x04, 0x47, 0x00, 0x03, //IGPMetricTlv
- 0x09, (byte) 0x89, 0x07, 0x00
- };
-
- ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- buffer.writeBytes(teReportMsg);
-
- PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
- PcepMessage message = null;
-
- message = reader.readFrom(buffer);
-
- byte[] testReportMsg = {0};
-
- assertThat(message, instanceOf(PcepTEReportMsg.class));
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
- message.writeTo(buf);
-
- int readLen = buf.writerIndex();
- testReportMsg = new byte[readLen];
- buf.readBytes(testReportMsg, 0, readLen);
-
- assertThat(testReportMsg, is(teReportMsg));
- }
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepUpdateMsgExtTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepUpdateMsgExtTest.java
index 40234a6..fd21ba2 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepUpdateMsgExtTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepUpdateMsgExtTest.java
@@ -18,6 +18,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -34,7 +35,7 @@
* Metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest1() throws PcepParseException {
+ public void pcepUpdateMsgTest1() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x8c,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -80,7 +81,7 @@
* LSPA, Bandwidth object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest2() throws PcepParseException {
+ public void pcepUpdateMsgTest2() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -121,7 +122,7 @@
* Metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest3() throws PcepParseException {
+ public void pcepUpdateMsgTest3() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -159,7 +160,7 @@
* Metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest4() throws PcepParseException {
+ public void pcepUpdateMsgTest4() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -198,7 +199,7 @@
* Metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest5() throws PcepParseException {
+ public void pcepUpdateMsgTest5() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x60,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -238,7 +239,7 @@
* Metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest6() throws PcepParseException {
+ public void pcepUpdateMsgTest6() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -277,7 +278,7 @@
* bandwidth object Metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest7() throws PcepParseException {
+ public void pcepUpdateMsgTest7() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x64,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -317,7 +318,7 @@
* bandwidth object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest8() throws PcepParseException {
+ public void pcepUpdateMsgTest8() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -357,7 +358,7 @@
* bandwidth object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest9() throws PcepParseException {
+ public void pcepUpdateMsgTest9() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x18, 0x00, 0x00, 0x10, 0x03,
@@ -396,7 +397,7 @@
* bandwidth object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest10() throws PcepParseException {
+ public void pcepUpdateMsgTest10() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -434,7 +435,7 @@
* bandwidth object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest11() throws PcepParseException {
+ public void pcepUpdateMsgTest11() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -473,7 +474,7 @@
* bandwidth object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest12() throws PcepParseException {
+ public void pcepUpdateMsgTest12() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -511,7 +512,7 @@
* bandwidth object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest13() throws PcepParseException {
+ public void pcepUpdateMsgTest13() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -550,7 +551,7 @@
* metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest14() throws PcepParseException {
+ public void pcepUpdateMsgTest14() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x60,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -590,7 +591,7 @@
* metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest15() throws PcepParseException {
+ public void pcepUpdateMsgTest15() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -627,7 +628,7 @@
* metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest16() throws PcepParseException {
+ public void pcepUpdateMsgTest16() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -665,7 +666,7 @@
* metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest17() throws PcepParseException {
+ public void pcepUpdateMsgTest17() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -704,7 +705,7 @@
* metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest18() throws PcepParseException {
+ public void pcepUpdateMsgTest18() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -742,7 +743,7 @@
* metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest19() throws PcepParseException {
+ public void pcepUpdateMsgTest19() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -781,7 +782,7 @@
* Bandwidth , metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest20() throws PcepParseException {
+ public void pcepUpdateMsgTest20() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -820,7 +821,7 @@
* Bandwidth , metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest21() throws PcepParseException {
+ public void pcepUpdateMsgTest21() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -856,7 +857,7 @@
* Bandwidth , metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest22() throws PcepParseException {
+ public void pcepUpdateMsgTest22() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -893,7 +894,7 @@
* Bandwidth , metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest23() throws PcepParseException {
+ public void pcepUpdateMsgTest23() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -931,7 +932,7 @@
* Bandwidth , metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest24() throws PcepParseException {
+ public void pcepUpdateMsgTest24() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -968,7 +969,7 @@
* Bandwidth , metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest25() throws PcepParseException {
+ public void pcepUpdateMsgTest25() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1006,7 +1007,7 @@
* LSPA object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest26() throws PcepParseException {
+ public void pcepUpdateMsgTest26() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -1045,7 +1046,7 @@
* bandwidth object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest27() throws PcepParseException {
+ public void pcepUpdateMsgTest27() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x34,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -1080,7 +1081,7 @@
* metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest28() throws PcepParseException {
+ public void pcepUpdateMsgTest28() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
@@ -1116,7 +1117,7 @@
* lspa object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest29() throws PcepParseException {
+ public void pcepUpdateMsgTest29() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1155,7 +1156,7 @@
* bandwidth object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest30() throws PcepParseException {
+ public void pcepUpdateMsgTest30() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1193,7 +1194,7 @@
* metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest31() throws PcepParseException {
+ public void pcepUpdateMsgTest31() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
@@ -1231,7 +1232,7 @@
* Metric object in PcepUpdate message.
*/
@Test
- public void pcepUpdateMsgTest32() throws PcepParseException {
+ public void pcepUpdateMsgTest32() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x64,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepUpdateMsgTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepUpdateMsgTest.java
index 1db3064..3d0ba27 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepUpdateMsgTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepUpdateMsgTest.java
@@ -18,6 +18,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -29,7 +30,7 @@
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), ERO in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest1() throws PcepParseException {
+ public void pcepUpdateMsgTest1() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x30,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -64,7 +65,7 @@
* SymbolicPathNameTlv, StatefulLspErrorCodeTlv), ERO, LSPA, Metric-list in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest2() throws PcepParseException {
+ public void pcepUpdateMsgTest2() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x94,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -108,7 +109,7 @@
* ERO objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest3() throws PcepParseException {
+ public void pcepUpdateMsgTest3() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x38,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -145,7 +146,7 @@
* SymbolicPathNameTlv), ERO objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest4() throws PcepParseException {
+ public void pcepUpdateMsgTest4() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -183,7 +184,7 @@
* SymbolicPathNameTlv), ERO objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest5() throws PcepParseException {
+ public void pcepUpdateMsgTest5() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -221,7 +222,7 @@
* StatefulLspErrorCodeTlv), ERO objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest6() throws PcepParseException {
+ public void pcepUpdateMsgTest6() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -261,7 +262,7 @@
* StatefulLspErrorCodeTlv), ERO objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest7() throws PcepParseException {
+ public void pcepUpdateMsgTest7() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -299,7 +300,7 @@
* StatefulLspErrorCodeTlv), ERO (IPv4SubObject) objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest8() throws PcepParseException {
+ public void pcepUpdateMsgTest8() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -339,7 +340,7 @@
* StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject) objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest9() throws PcepParseException {
+ public void pcepUpdateMsgTest9() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -380,7 +381,7 @@
* StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject), LSPA objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest10() throws PcepParseException {
+ public void pcepUpdateMsgTest10() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x6c,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -423,7 +424,7 @@
* StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest11() throws PcepParseException {
+ public void pcepUpdateMsgTest11() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -467,7 +468,7 @@
* StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest12() throws PcepParseException {
+ public void pcepUpdateMsgTest12() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -510,7 +511,7 @@
* StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest13() throws PcepParseException {
+ public void pcepUpdateMsgTest13() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -553,7 +554,7 @@
* ERO (IPv4SubObject, IPv4SubObject),LSPA, metric Object objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest14() throws PcepParseException {
+ public void pcepUpdateMsgTest14() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -595,7 +596,7 @@
* ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest15() throws PcepParseException {
+ public void pcepUpdateMsgTest15() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -637,7 +638,7 @@
* ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest16() throws PcepParseException {
+ public void pcepUpdateMsgTest16() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x60,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -678,7 +679,7 @@
* ERO (IPv4SubObject, IPv4SubObject),LSPA objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest17() throws PcepParseException {
+ public void pcepUpdateMsgTest17() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -718,7 +719,7 @@
* ERO (IPv4SubObject, IPv4SubObject),Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest18() throws PcepParseException {
+ public void pcepUpdateMsgTest18() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -757,7 +758,7 @@
* ERO (IPv4SubObject, IPv4SubObject),Metric-list objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest19() throws PcepParseException {
+ public void pcepUpdateMsgTest19() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -797,7 +798,7 @@
* StatefulLspErrorCodeTlv),ERO (IPv4SubObject, IPv4SubObject),LSPA, Bandwidth, Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest20() throws PcepParseException {
+ public void pcepUpdateMsgTest20() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x80,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -842,7 +843,7 @@
* ERO (IPv4SubObject, IPv4SubObject), Bandwidth objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest21() throws PcepParseException {
+ public void pcepUpdateMsgTest21() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -881,7 +882,7 @@
* ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest22() throws PcepParseException {
+ public void pcepUpdateMsgTest22() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5C,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -922,7 +923,7 @@
* ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest23() throws PcepParseException {
+ public void pcepUpdateMsgTest23() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -964,7 +965,7 @@
* ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest24() throws PcepParseException {
+ public void pcepUpdateMsgTest24() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -1007,7 +1008,7 @@
* ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest25() throws PcepParseException {
+ public void pcepUpdateMsgTest25() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -1051,7 +1052,7 @@
* Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest26() throws PcepParseException {
+ public void pcepUpdateMsgTest26() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -1095,7 +1096,7 @@
* Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest27() throws PcepParseException {
+ public void pcepUpdateMsgTest27() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -1140,7 +1141,7 @@
* LSPA, Bandwidth, Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest28() throws PcepParseException {
+ public void pcepUpdateMsgTest28() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x80,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -1185,7 +1186,7 @@
* ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest29() throws PcepParseException {
+ public void pcepUpdateMsgTest29() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -1227,7 +1228,7 @@
* ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest30() throws PcepParseException {
+ public void pcepUpdateMsgTest30() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -1266,7 +1267,7 @@
* ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest31() throws PcepParseException {
+ public void pcepUpdateMsgTest31() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -1306,7 +1307,7 @@
* ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest32() throws PcepParseException {
+ public void pcepUpdateMsgTest32() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -1345,7 +1346,7 @@
* ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest33() throws PcepParseException {
+ public void pcepUpdateMsgTest33() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
@@ -1385,7 +1386,7 @@
* ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
*/
@Test
- public void pcepUpdateMsgTest34() throws PcepParseException {
+ public void pcepUpdateMsgTest34() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x64,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AdministrativeGroupSubTlvTest.java
similarity index 72%
copy from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlvTest.java
copy to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AdministrativeGroupSubTlvTest.java
index eb3a16a..2ec8b4a 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AdministrativeGroupSubTlvTest.java
@@ -19,13 +19,12 @@
import org.junit.Test;
/**
- * Test of the IPv4InterfaceAddressTlv.
+ * Test of the AdministrativeGroupSubTlv.
*/
-public class IPv4InterfaceAddressTlvTest {
-
- private final IPv4InterfaceAddressTlv tlv1 = IPv4InterfaceAddressTlv.of(2);
- private final IPv4InterfaceAddressTlv sameAsTlv1 = IPv4InterfaceAddressTlv.of(2);
- private final IPv4InterfaceAddressTlv tlv2 = IPv4InterfaceAddressTlv.of(3);
+public class AdministrativeGroupSubTlvTest {
+ private final AdministrativeGroupSubTlv tlv1 = AdministrativeGroupSubTlv.of(1);
+ private final AdministrativeGroupSubTlv sameAsTlv1 = AdministrativeGroupSubTlv.of(1);
+ private final AdministrativeGroupSubTlv tlv2 = AdministrativeGroupSubTlv.of(2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AdministrativeGroupTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AdministrativeGroupTlvTest.java
deleted file mode 100644
index 41e8844..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AdministrativeGroupTlvTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-/**
- * Test of the AdministrativeGroupTlv.
- */
-public class AdministrativeGroupTlvTest {
- private final AdministrativeGroupTlv tlv1 = AdministrativeGroupTlv.of(1);
- private final AdministrativeGroupTlv sameAsTlv1 = AdministrativeGroupTlv.of(1);
- private final AdministrativeGroupTlv tlv2 = AdministrativeGroupTlv.of(2);
-
- @Test
- public void basics() {
- new EqualsTester()
- .addEqualityGroup(tlv1, sameAsTlv1)
- .addEqualityGroup(tlv2)
- .testEquals();
- }
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumLinkBandwidthTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AutonomousSystemNumberSubObjectTest.java
similarity index 61%
copy from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumLinkBandwidthTlvTest.java
copy to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AutonomousSystemNumberSubObjectTest.java
index 4e022b8..83bb86f 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumLinkBandwidthTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AutonomousSystemNumberSubObjectTest.java
@@ -19,21 +19,19 @@
import org.junit.Test;
/**
- * Test of the MaximumLinkBandwidthTlv.
+ * Test of the AutonomousSystemNumberSubObject.
*/
-public class MaximumLinkBandwidthTlvTest {
- private final int rawValue1 = 0x0A;
- private final int rawValue2 = 0x0B;
+public class AutonomousSystemNumberSubObjectTest {
- private final MaximumLinkBandwidthTlv tlv1 = new MaximumLinkBandwidthTlv(rawValue1);
- private final MaximumLinkBandwidthTlv sameAsTlv1 = new MaximumLinkBandwidthTlv(rawValue1);
- private final MaximumLinkBandwidthTlv tlv2 = MaximumLinkBandwidthTlv.of(rawValue2);
+ private final AutonomousSystemNumberSubObject subObj1 = AutonomousSystemNumberSubObject.of((short) 2);
+ private final AutonomousSystemNumberSubObject sameAsSubObj1 = AutonomousSystemNumberSubObject.of((short) 2);
+ private final AutonomousSystemNumberSubObject subObj2 = AutonomousSystemNumberSubObject.of((short) 3);
@Test
public void basics() {
new EqualsTester()
- .addEqualityGroup(tlv1, sameAsTlv1)
- .addEqualityGroup(tlv2)
+ .addEqualityGroup(subObj1, sameAsSubObj1)
+ .addEqualityGroup(subObj2)
.testEquals();
}
}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AutonomousSystemSubTlvTest.java
similarity index 73%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AutonomousSystemSubTlvTest.java
index eb3a16a..a959af7 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AutonomousSystemSubTlvTest.java
@@ -19,13 +19,12 @@
import org.junit.Test;
/**
- * Test of the IPv4InterfaceAddressTlv.
+ * Test of the AutonomousSystemSubTlv.
*/
-public class IPv4InterfaceAddressTlvTest {
-
- private final IPv4InterfaceAddressTlv tlv1 = IPv4InterfaceAddressTlv.of(2);
- private final IPv4InterfaceAddressTlv sameAsTlv1 = IPv4InterfaceAddressTlv.of(2);
- private final IPv4InterfaceAddressTlv tlv2 = IPv4InterfaceAddressTlv.of(3);
+public class AutonomousSystemSubTlvTest {
+ private final AutonomousSystemSubTlv tlv1 = AutonomousSystemSubTlv.of(1);
+ private final AutonomousSystemSubTlv sameAsTlv1 = AutonomousSystemSubTlv.of(1);
+ private final AutonomousSystemSubTlv tlv2 = AutonomousSystemSubTlv.of(2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AutonomousSystemTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/BgpLsIdentifierSubTlvTest.java
similarity index 74%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AutonomousSystemTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/BgpLsIdentifierSubTlvTest.java
index 904a71e..222c468 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/AutonomousSystemTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/BgpLsIdentifierSubTlvTest.java
@@ -19,12 +19,12 @@
import org.junit.Test;
/**
- * Test of the AutonomousSystemTlv.
+ * Test of the BgpLsIdentifierSubTlv.
*/
-public class AutonomousSystemTlvTest {
- private final AutonomousSystemTlv tlv1 = AutonomousSystemTlv.of(1);
- private final AutonomousSystemTlv sameAsTlv1 = AutonomousSystemTlv.of(1);
- private final AutonomousSystemTlv tlv2 = AutonomousSystemTlv.of(2);
+public class BgpLsIdentifierSubTlvTest {
+ private final BgpLsIdentifierSubTlv tlv1 = BgpLsIdentifierSubTlv.of(1);
+ private final BgpLsIdentifierSubTlv sameAsTlv1 = BgpLsIdentifierSubTlv.of(1);
+ private final BgpLsIdentifierSubTlv tlv2 = BgpLsIdentifierSubTlv.of(2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/BgpLsIdentifierTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/BgpLsIdentifierTlvTest.java
deleted file mode 100644
index 78137a7..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/BgpLsIdentifierTlvTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-/**
- * Test of the BGPLSidentifierTlv.
- */
-public class BgpLsIdentifierTlvTest {
- private final BgpLsIdentifierTlv tlv1 = BgpLsIdentifierTlv.of(1);
- private final BgpLsIdentifierTlv sameAsTlv1 = BgpLsIdentifierTlv.of(1);
- private final BgpLsIdentifierTlv tlv2 = BgpLsIdentifierTlv.of(2);
-
- @Test
- public void basics() {
- new EqualsTester()
- .addEqualityGroup(tlv1, sameAsTlv1)
- .addEqualityGroup(tlv2)
- .testEquals();
- }
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressSubTlvTest.java
similarity index 71%
copy from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlvTest.java
copy to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressSubTlvTest.java
index eb3a16a..40574a9 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressSubTlvTest.java
@@ -19,13 +19,13 @@
import org.junit.Test;
/**
- * Test of the IPv4InterfaceAddressTlv.
+ * Test of the IPv4InterfaceAddressSubTlv.
*/
-public class IPv4InterfaceAddressTlvTest {
+public class IPv4InterfaceAddressSubTlvTest {
- private final IPv4InterfaceAddressTlv tlv1 = IPv4InterfaceAddressTlv.of(2);
- private final IPv4InterfaceAddressTlv sameAsTlv1 = IPv4InterfaceAddressTlv.of(2);
- private final IPv4InterfaceAddressTlv tlv2 = IPv4InterfaceAddressTlv.of(3);
+ private final IPv4InterfaceAddressSubTlv tlv1 = IPv4InterfaceAddressSubTlv.of(2);
+ private final IPv4InterfaceAddressSubTlv sameAsTlv1 = IPv4InterfaceAddressSubTlv.of(2);
+ private final IPv4InterfaceAddressSubTlv tlv2 = IPv4InterfaceAddressSubTlv.of(3);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4NeighborAddressSubTlvTest.java
similarity index 72%
copy from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlvTest.java
copy to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4NeighborAddressSubTlvTest.java
index eb3a16a..b0d8e2a 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4InterfaceAddressTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4NeighborAddressSubTlvTest.java
@@ -19,13 +19,13 @@
import org.junit.Test;
/**
- * Test of the IPv4InterfaceAddressTlv.
+ * Test of the IPv4NeighborAddressSubTlv.
*/
-public class IPv4InterfaceAddressTlvTest {
+public class IPv4NeighborAddressSubTlvTest {
- private final IPv4InterfaceAddressTlv tlv1 = IPv4InterfaceAddressTlv.of(2);
- private final IPv4InterfaceAddressTlv sameAsTlv1 = IPv4InterfaceAddressTlv.of(2);
- private final IPv4InterfaceAddressTlv tlv2 = IPv4InterfaceAddressTlv.of(3);
+ private final IPv4NeighborAddressSubTlv tlv1 = IPv4NeighborAddressSubTlv.of(2);
+ private final IPv4NeighborAddressSubTlv sameAsTlv1 = IPv4NeighborAddressSubTlv.of(2);
+ private final IPv4NeighborAddressSubTlv tlv2 = IPv4NeighborAddressSubTlv.of(3);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4NeighborAddressTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4NeighborAddressTlvTest.java
deleted file mode 100644
index 5f10b4c..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4NeighborAddressTlvTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-/**
- * Test of the IPv4NeighborAddressTlv.
- */
-public class IPv4NeighborAddressTlvTest {
-
- private final IPv4NeighborAddressTlv tlv1 = IPv4NeighborAddressTlv.of(2);
- private final IPv4NeighborAddressTlv sameAsTlv1 = IPv4NeighborAddressTlv.of(2);
- private final IPv4NeighborAddressTlv tlv2 = IPv4NeighborAddressTlv.of(3);
-
- @Test
- public void basics() {
- new EqualsTester()
- .addEqualityGroup(tlv1, sameAsTlv1)
- .addEqualityGroup(tlv2)
- .testEquals();
- }
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4TERouterIdOfRemoteNodeTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4RouterIdOfLocalNodeSubTlvTest.java
similarity index 70%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4TERouterIdOfRemoteNodeTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4RouterIdOfLocalNodeSubTlvTest.java
index f40ede0..89e1878 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4TERouterIdOfRemoteNodeTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4RouterIdOfLocalNodeSubTlvTest.java
@@ -19,13 +19,13 @@
import org.junit.Test;
/**
- * Test of the IPv4TERouterIdOfRemoteNodeTlv.
+ * Test of the IPv4RouterIdOfLocalNodeSubTlv.
*/
-public class IPv4TERouterIdOfRemoteNodeTlvTest {
+public class IPv4RouterIdOfLocalNodeSubTlvTest {
- private final IPv4TERouterIdOfRemoteNodeTlv tlv1 = IPv4TERouterIdOfRemoteNodeTlv.of(2);
- private final IPv4TERouterIdOfRemoteNodeTlv sameAsTlv1 = IPv4TERouterIdOfRemoteNodeTlv.of(2);
- private final IPv4TERouterIdOfRemoteNodeTlv tlv2 = IPv4TERouterIdOfRemoteNodeTlv.of(3);
+ private final IPv4RouterIdOfLocalNodeSubTlv tlv1 = IPv4RouterIdOfLocalNodeSubTlv.of(2);
+ private final IPv4RouterIdOfLocalNodeSubTlv sameAsTlv1 = IPv4RouterIdOfLocalNodeSubTlv.of(2);
+ private final IPv4RouterIdOfLocalNodeSubTlv tlv2 = IPv4RouterIdOfLocalNodeSubTlv.of(3);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4TERouterIdOfRemoteNodeTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4RouterIdOfRemoteNodeSubTlvTest.java
similarity index 70%
copy from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4TERouterIdOfRemoteNodeTlvTest.java
copy to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4RouterIdOfRemoteNodeSubTlvTest.java
index f40ede0..778d227 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4TERouterIdOfRemoteNodeTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4RouterIdOfRemoteNodeSubTlvTest.java
@@ -19,13 +19,13 @@
import org.junit.Test;
/**
- * Test of the IPv4TERouterIdOfRemoteNodeTlv.
+ * Test of the IPv4RouterIdOfRemoteNodeSubTlv.
*/
-public class IPv4TERouterIdOfRemoteNodeTlvTest {
+public class IPv4RouterIdOfRemoteNodeSubTlvTest {
- private final IPv4TERouterIdOfRemoteNodeTlv tlv1 = IPv4TERouterIdOfRemoteNodeTlv.of(2);
- private final IPv4TERouterIdOfRemoteNodeTlv sameAsTlv1 = IPv4TERouterIdOfRemoteNodeTlv.of(2);
- private final IPv4TERouterIdOfRemoteNodeTlv tlv2 = IPv4TERouterIdOfRemoteNodeTlv.of(3);
+ private final IPv4RouterIdOfRemoteNodeSubTlv tlv1 = IPv4RouterIdOfRemoteNodeSubTlv.of(2);
+ private final IPv4RouterIdOfRemoteNodeSubTlv sameAsTlv1 = IPv4RouterIdOfRemoteNodeSubTlv.of(2);
+ private final IPv4RouterIdOfRemoteNodeSubTlv tlv2 = IPv4RouterIdOfRemoteNodeSubTlv.of(3);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4TERouterIdOfLocalNodeTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4TERouterIdOfLocalNodeTlvTest.java
deleted file mode 100644
index 3880ca7..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4TERouterIdOfLocalNodeTlvTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-/**
- * Test of the IPv4TERouterIdOfLocalNodeTlv.
- */
-public class IPv4TERouterIdOfLocalNodeTlvTest {
-
- private final IPv4TERouterIdOfLocalNodeTlv tlv1 = IPv4TERouterIdOfLocalNodeTlv.of(2);
- private final IPv4TERouterIdOfLocalNodeTlv sameAsTlv1 = IPv4TERouterIdOfLocalNodeTlv.of(2);
- private final IPv4TERouterIdOfLocalNodeTlv tlv2 = IPv4TERouterIdOfLocalNodeTlv.of(3);
-
- @Test
- public void basics() {
- new EqualsTester()
- .addEqualityGroup(tlv1, sameAsTlv1)
- .addEqualityGroup(tlv2)
- .testEquals();
- }
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6InterfaceAddressTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6InterfaceAddressSubTlvTest.java
similarity index 78%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6InterfaceAddressTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6InterfaceAddressSubTlvTest.java
index 0f8e37c..79a3260 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6InterfaceAddressTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6InterfaceAddressSubTlvTest.java
@@ -19,18 +19,18 @@
import org.junit.Test;
/**
- * Test of the IPv6InterfaceAddressTlv.
+ * Test of the IPv6InterfaceAddressSubTlv.
*/
-public class IPv6InterfaceAddressTlvTest {
+public class IPv6InterfaceAddressSubTlvTest {
private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x01};
- private final IPv6InterfaceAddressTlv tlv1 = IPv6InterfaceAddressTlv.of(b1);
- private final IPv6InterfaceAddressTlv sameAsTlv1 = IPv6InterfaceAddressTlv.of(b1);
- private final IPv6InterfaceAddressTlv tlv2 = IPv6InterfaceAddressTlv.of(b2);
+ private final IPv6InterfaceAddressSubTlv tlv1 = IPv6InterfaceAddressSubTlv.of(b1);
+ private final IPv6InterfaceAddressSubTlv sameAsTlv1 = IPv6InterfaceAddressSubTlv.of(b1);
+ private final IPv6InterfaceAddressSubTlv tlv2 = IPv6InterfaceAddressSubTlv.of(b2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6NeighborAddressTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6NeighborAddressSubTlvTest.java
similarity index 79%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6NeighborAddressTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6NeighborAddressSubTlvTest.java
index 57ad769..375ce49 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6NeighborAddressTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6NeighborAddressSubTlvTest.java
@@ -19,18 +19,18 @@
import org.junit.Test;
/**
- * Test of the IPv6NeighborAddressTlv.
+ * Test of the IPv6NeighborAddressSubTlv.
*/
-public class IPv6NeighborAddressTlvTest {
+public class IPv6NeighborAddressSubTlvTest {
private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x01};
- private final IPv6NeighborAddressTlv tlv1 = IPv6NeighborAddressTlv.of(b1);
- private final IPv6NeighborAddressTlv sameAsTlv1 = IPv6NeighborAddressTlv.of(b1);
- private final IPv6NeighborAddressTlv tlv2 = IPv6NeighborAddressTlv.of(b2);
+ private final IPv6NeighborAddressSubTlv tlv1 = IPv6NeighborAddressSubTlv.of(b1);
+ private final IPv6NeighborAddressSubTlv sameAsTlv1 = IPv6NeighborAddressSubTlv.of(b1);
+ private final IPv6NeighborAddressSubTlv tlv2 = IPv6NeighborAddressSubTlv.of(b2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6TERouterIdofRemoteNodeTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6RouterIdofLocalNodeSubTlvTest.java
similarity index 77%
copy from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6TERouterIdofRemoteNodeTlvTest.java
copy to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6RouterIdofLocalNodeSubTlvTest.java
index f382860..6bd63a6 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6TERouterIdofRemoteNodeTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6RouterIdofLocalNodeSubTlvTest.java
@@ -19,18 +19,18 @@
import org.junit.Test;
/**
- * Test of the IPv6TERouterIdofRemoteNodeTlv.
+ * Test of the IPv6RouterIdofLocalNodeSubTlv.
*/
-public class IPv6TERouterIdofRemoteNodeTlvTest {
+public class IPv6RouterIdofLocalNodeSubTlvTest {
private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
- private final IPv6TERouterIdofRemoteNodeTlv tlv1 = IPv6TERouterIdofRemoteNodeTlv.of(b1);
- private final IPv6TERouterIdofRemoteNodeTlv sameAsTlv1 = IPv6TERouterIdofRemoteNodeTlv.of(b1);
- private final IPv6TERouterIdofRemoteNodeTlv tlv2 = IPv6TERouterIdofRemoteNodeTlv.of(b2);
+ private final IPv6RouterIdofLocalNodeSubTlv tlv1 = IPv6RouterIdofLocalNodeSubTlv.of(b1);
+ private final IPv6RouterIdofLocalNodeSubTlv sameAsTlv1 = IPv6RouterIdofLocalNodeSubTlv.of(b1);
+ private final IPv6RouterIdofLocalNodeSubTlv tlv2 = IPv6RouterIdofLocalNodeSubTlv.of(b2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6TERouterIdofRemoteNodeTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6RouterIdofRemoteNodeSubTlvTest.java
similarity index 77%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6TERouterIdofRemoteNodeTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6RouterIdofRemoteNodeSubTlvTest.java
index f382860..eb04558 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6TERouterIdofRemoteNodeTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6RouterIdofRemoteNodeSubTlvTest.java
@@ -19,18 +19,18 @@
import org.junit.Test;
/**
- * Test of the IPv6TERouterIdofRemoteNodeTlv.
+ * Test of the IPv6RouterIdofRemoteNodeSubTlv.
*/
-public class IPv6TERouterIdofRemoteNodeTlvTest {
+public class IPv6RouterIdofRemoteNodeSubTlvTest {
private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
(byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
- private final IPv6TERouterIdofRemoteNodeTlv tlv1 = IPv6TERouterIdofRemoteNodeTlv.of(b1);
- private final IPv6TERouterIdofRemoteNodeTlv sameAsTlv1 = IPv6TERouterIdofRemoteNodeTlv.of(b1);
- private final IPv6TERouterIdofRemoteNodeTlv tlv2 = IPv6TERouterIdofRemoteNodeTlv.of(b2);
+ private final IPv6RouterIdofRemoteNodeSubTlv tlv1 = IPv6RouterIdofRemoteNodeSubTlv.of(b1);
+ private final IPv6RouterIdofRemoteNodeSubTlv sameAsTlv1 = IPv6RouterIdofRemoteNodeSubTlv.of(b1);
+ private final IPv6RouterIdofRemoteNodeSubTlv tlv2 = IPv6RouterIdofRemoteNodeSubTlv.of(b2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6TERouterIdofLocalNodeTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6TERouterIdofLocalNodeTlvTest.java
deleted file mode 100644
index 6516ed3..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv6TERouterIdofLocalNodeTlvTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-/**
- * Test of the IPv6TERouterIdofLocalNodeTlv.
- */
-public class IPv6TERouterIdofLocalNodeTlvTest {
-
- private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
- (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
- private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
- (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
-
- private final IPv6TERouterIdofLocalNodeTlv tlv1 = IPv6TERouterIdofLocalNodeTlv.of(b1);
- private final IPv6TERouterIdofLocalNodeTlv sameAsTlv1 = IPv6TERouterIdofLocalNodeTlv.of(b1);
- private final IPv6TERouterIdofLocalNodeTlv tlv2 = IPv6TERouterIdofLocalNodeTlv.of(b2);
-
- @Test
- public void basics() {
- new EqualsTester()
- .addEqualityGroup(tlv1, sameAsTlv1)
- .addEqualityGroup(tlv2)
- .testEquals();
- }
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IgpMetricTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IgpMetricSubTlvTest.java
similarity index 77%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IgpMetricTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IgpMetricSubTlvTest.java
index 20c9dc7..20945f2 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IgpMetricTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IgpMetricSubTlvTest.java
@@ -19,14 +19,14 @@
import org.junit.Test;
/**
- * Test of the IGPMetricTlv.
+ * Test of the IgpMetricSubTlv.
*/
-public class IgpMetricTlvTest {
+public class IgpMetricSubTlvTest {
private final byte[] b1 = new byte[] {0x01, 0x02};
private final byte[] b2 = new byte[] {0x01, 0x03};
- private final IgpMetricTlv tlv1 = IgpMetricTlv.of(b1, (short) 2);
- private final IgpMetricTlv sameAsTlv1 = IgpMetricTlv.of(b1, (short) 2);
- private final IgpMetricTlv tlv2 = IgpMetricTlv.of(b2, (short) 2);
+ private final IgpMetricSubTlv tlv1 = IgpMetricSubTlv.of(b1, (short) 2);
+ private final IgpMetricSubTlv sameAsTlv1 = IgpMetricSubTlv.of(b1, (short) 2);
+ private final IgpMetricSubTlv tlv2 = IgpMetricSubTlv.of(b2, (short) 2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/RouterIDSubTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IgpRouterIdSubTlvTest.java
similarity index 77%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/RouterIDSubTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IgpRouterIdSubTlvTest.java
index 2f9e18a..5f36f90 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/RouterIDSubTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IgpRouterIdSubTlvTest.java
@@ -19,20 +19,20 @@
import org.junit.Test;
/**
- * Test case for Router ID Sub tlv.
+ * Test case for IgpRouterIdSubTlv.
*/
-public class RouterIDSubTlvTest {
+public class IgpRouterIdSubTlvTest {
private final byte[] value1 = {1, 2 };
private final Short length1 = 2;
- private final RouterIDSubTlv tlv1 = RouterIDSubTlv.of(value1, length1);
+ private final IgpRouterIdSubTlv tlv1 = IgpRouterIdSubTlv.of(value1, length1);
private final Short length2 = 2;
- private final RouterIDSubTlv tlv2 = RouterIDSubTlv.of(value1, length2);
+ private final IgpRouterIdSubTlv tlv2 = IgpRouterIdSubTlv.of(value1, length2);
private final byte[] value3 = {1, 2, 3 };
private final Short length3 = 3;
- private final RouterIDSubTlv tlv3 = RouterIDSubTlv.of(value3, length3);
+ private final IgpRouterIdSubTlv tlv3 = IgpRouterIdSubTlv.of(value3, length3);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IsisAreaIdentifierTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IsisAreaIdentifierSubTlvTest.java
similarity index 74%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IsisAreaIdentifierTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IsisAreaIdentifierSubTlvTest.java
index a5a14c2..1b91fcd 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IsisAreaIdentifierTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IsisAreaIdentifierSubTlvTest.java
@@ -19,16 +19,16 @@
import org.junit.Test;
/**
- * Test of the ISISAreaIdentifierTlv.
+ * Test of the IsisAreaIdentifierSubTlv.
*/
-public class IsisAreaIdentifierTlvTest {
+public class IsisAreaIdentifierSubTlvTest {
private final byte[] b1 = new byte[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
private final byte[] b2 = new byte[] {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 };
- private final IsisAreaIdentifierTlv tlv1 = IsisAreaIdentifierTlv.of(b1, (short) 20);
- private final IsisAreaIdentifierTlv sameAsTlv1 = IsisAreaIdentifierTlv.of(b1, (short) 20);
- private final IsisAreaIdentifierTlv tlv2 = IsisAreaIdentifierTlv.of(b2, (short) 20);
+ private final IsisAreaIdentifierSubTlv tlv1 = IsisAreaIdentifierSubTlv.of(b1, (short) 20);
+ private final IsisAreaIdentifierSubTlv sameAsTlv1 = IsisAreaIdentifierSubTlv.of(b1, (short) 20);
+ private final IsisAreaIdentifierSubTlv tlv2 = IsisAreaIdentifierSubTlv.of(b2, (short) 20);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkAttributesTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkAttributesTlvTest.java
new file mode 100644
index 0000000..8c0cb62
--- /dev/null
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkAttributesTlvTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio.types;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Test case for TE Link Attribute Tlv.
+ */
+public class LinkAttributesTlvTest {
+
+ private final AdministrativeGroupSubTlv administrativeGroupTlv1 = new AdministrativeGroupSubTlv(10);
+ private final MaximumReservableLinkBandwidthSubTlv maximumReservableLinkBandwidthTlv1 =
+ new MaximumReservableLinkBandwidthSubTlv(20);
+
+ private final AdministrativeGroupSubTlv administrativeGroupTlv2 = new AdministrativeGroupSubTlv(20);
+ private final MaximumReservableLinkBandwidthSubTlv maximumReservableLinkBandwidthTlv2 =
+ new MaximumReservableLinkBandwidthSubTlv(30);
+
+ private final List<PcepValueType> llLinkAttributesSubTLV1 = new LinkedList<>();
+ private final boolean a = llLinkAttributesSubTLV1.add(administrativeGroupTlv1);
+ private final boolean b = llLinkAttributesSubTLV1.add(maximumReservableLinkBandwidthTlv1);
+
+ private final List<PcepValueType> llLinkAttributesSubTLV2 = new LinkedList<>();
+
+ private final boolean c = llLinkAttributesSubTLV2.add(administrativeGroupTlv2);
+ private final boolean d = llLinkAttributesSubTLV2.add(maximumReservableLinkBandwidthTlv2);
+
+ private final LinkAttributesTlv tlv1 = LinkAttributesTlv.of(llLinkAttributesSubTLV1);
+ private final LinkAttributesTlv sameAsTlv1 = LinkAttributesTlv.of(llLinkAttributesSubTLV1);
+ private final LinkAttributesTlv tlv2 = LinkAttributesTlv.of(llLinkAttributesSubTLV2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
+ }
+
+}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkDescriptorsTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkDescriptorsTlvTest.java
new file mode 100644
index 0000000..d271595
--- /dev/null
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkDescriptorsTlvTest.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio.types;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Test case for TE link descriptors Tlv.
+ */
+public class LinkDescriptorsTlvTest {
+ private final LinkLocalRemoteIdentifiersSubTlv linkLocalRemoteIdentifiersTlv1 = new
+ LinkLocalRemoteIdentifiersSubTlv(10, 10);
+ private final IPv4InterfaceAddressSubTlv iPv4InterfaceAddressTlv1 = new IPv4InterfaceAddressSubTlv(0x01010101);
+
+ private final LinkLocalRemoteIdentifiersSubTlv linkLocalRemoteIdentifiersTlv2 = new
+ LinkLocalRemoteIdentifiersSubTlv(20, 20);
+ private final IPv4InterfaceAddressSubTlv iPv4InterfaceAddressTlv2 = new IPv4InterfaceAddressSubTlv(0x02020202);
+
+ private final List<PcepValueType> llLinkDescriptorsSubTLVs1 = new LinkedList<>();
+ private final boolean a = llLinkDescriptorsSubTLVs1.add(linkLocalRemoteIdentifiersTlv1);
+ private final boolean b = llLinkDescriptorsSubTLVs1.add(iPv4InterfaceAddressTlv1);
+
+ private final List<PcepValueType> llLinkDescriptorsSubTLVs2 = new LinkedList<>();
+ private final boolean c = llLinkDescriptorsSubTLVs2.add(linkLocalRemoteIdentifiersTlv2);
+ private final boolean d = llLinkDescriptorsSubTLVs2.add(iPv4InterfaceAddressTlv2);
+
+ private final LinkDescriptorsTlv tlv1 = LinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1);
+ private final LinkDescriptorsTlv sameAstlv1 = LinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1);
+ private final LinkDescriptorsTlv tlv2 = LinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAstlv1).addEqualityGroup(tlv2).testEquals();
+ }
+
+}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4TERouterIdOfRemoteNodeTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkLocalRemoteIdentifiersSubTlvTest.java
similarity index 68%
copy from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4TERouterIdOfRemoteNodeTlvTest.java
copy to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkLocalRemoteIdentifiersSubTlvTest.java
index f40ede0..9752874 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/IPv4TERouterIdOfRemoteNodeTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkLocalRemoteIdentifiersSubTlvTest.java
@@ -19,13 +19,13 @@
import org.junit.Test;
/**
- * Test of the IPv4TERouterIdOfRemoteNodeTlv.
+ * Test of the LinkLocalRemoteIdentifiersSubTlv.
*/
-public class IPv4TERouterIdOfRemoteNodeTlvTest {
+public class LinkLocalRemoteIdentifiersSubTlvTest {
- private final IPv4TERouterIdOfRemoteNodeTlv tlv1 = IPv4TERouterIdOfRemoteNodeTlv.of(2);
- private final IPv4TERouterIdOfRemoteNodeTlv sameAsTlv1 = IPv4TERouterIdOfRemoteNodeTlv.of(2);
- private final IPv4TERouterIdOfRemoteNodeTlv tlv2 = IPv4TERouterIdOfRemoteNodeTlv.of(3);
+ private final LinkLocalRemoteIdentifiersSubTlv tlv1 = LinkLocalRemoteIdentifiersSubTlv.of(10, 20);
+ private final LinkLocalRemoteIdentifiersSubTlv sameAsTlv1 = LinkLocalRemoteIdentifiersSubTlv.of(10, 20);
+ private final LinkLocalRemoteIdentifiersSubTlv tlv2 = LinkLocalRemoteIdentifiersSubTlv.of(20, 30);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkLocalRemoteIdentifiersTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkLocalRemoteIdentifiersTlvTest.java
deleted file mode 100644
index e25bda0..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkLocalRemoteIdentifiersTlvTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-/**
- * Test of the LinkLocalRemoteIdentifiersTlv.
- */
-public class LinkLocalRemoteIdentifiersTlvTest {
-
- private final LinkLocalRemoteIdentifiersTlv tlv1 = LinkLocalRemoteIdentifiersTlv.of(10, 20);
- private final LinkLocalRemoteIdentifiersTlv sameAsTlv1 = LinkLocalRemoteIdentifiersTlv.of(10, 20);
- private final LinkLocalRemoteIdentifiersTlv tlv2 = LinkLocalRemoteIdentifiersTlv.of(20, 30);
-
- @Test
- public void basics() {
- new EqualsTester()
- .addEqualityGroup(tlv1, sameAsTlv1)
- .addEqualityGroup(tlv2)
- .testEquals();
- }
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkNameTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkNameAttributeSubTlvTest.java
similarity index 70%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkNameTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkNameAttributeSubTlvTest.java
index 7d9dcb2..697f015 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkNameTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkNameAttributeSubTlvTest.java
@@ -19,15 +19,15 @@
import org.junit.Test;
/**
- * Equality test for LinkNameTlv.
+ * Equality test for LinkNameAttributeSubTlv.
*/
-public class LinkNameTlvTest {
+public class LinkNameAttributeSubTlvTest {
private final byte[] rawValue1 = new byte[] {0x01, 0x00};
private final byte[] rawValue2 = new byte[] {0x02, 0x00};
- private final LinkNameTlv tlv1 = new LinkNameTlv(rawValue1, (short) rawValue1.length);
- private final LinkNameTlv sameAsTlv1 = LinkNameTlv.of(tlv1.getValue(), tlv1.getLength());
- private final LinkNameTlv tlv2 = new LinkNameTlv(rawValue2, (short) 0);
+ private final LinkNameAttributeSubTlv tlv1 = new LinkNameAttributeSubTlv(rawValue1, (short) rawValue1.length);
+ private final LinkNameAttributeSubTlv sameAsTlv1 = LinkNameAttributeSubTlv.of(tlv1.getValue(), tlv1.getLength());
+ private final LinkNameAttributeSubTlv tlv2 = new LinkNameAttributeSubTlv(rawValue2, (short) 0);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MplsProtocolMaskTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkProtectionTypeSubTlvTest.java
similarity index 72%
copy from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MplsProtocolMaskTlvTest.java
copy to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkProtectionTypeSubTlvTest.java
index ff87b7a..412cfcc 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MplsProtocolMaskTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkProtectionTypeSubTlvTest.java
@@ -19,15 +19,15 @@
import org.junit.Test;
/**
- * Test of the MPLSProtocolMaskTlv.
+ * Test of the LinkProtectionTypeSubTlv.
*/
-public class MplsProtocolMaskTlvTest {
+public class LinkProtectionTypeSubTlvTest {
private final byte rawValue1 = 0x0A;
private final byte rawValue2 = 0x0B;
- private final MplsProtocolMaskTlv tlv1 = new MplsProtocolMaskTlv(rawValue1);
- private final MplsProtocolMaskTlv sameAsTlv1 = new MplsProtocolMaskTlv(rawValue1);
- private final MplsProtocolMaskTlv tlv2 = MplsProtocolMaskTlv.of(rawValue2);
+ private final LinkProtectionTypeSubTlv tlv1 = new LinkProtectionTypeSubTlv(rawValue1);
+ private final LinkProtectionTypeSubTlv sameAsTlv1 = new LinkProtectionTypeSubTlv(rawValue1);
+ private final LinkProtectionTypeSubTlv tlv2 = new LinkProtectionTypeSubTlv(rawValue2, (byte) 0);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkProtectionTypeTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkProtectionTypeTlvTest.java
deleted file mode 100644
index 61928f2..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LinkProtectionTypeTlvTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-/**
- * Test of the LinkProtectionTypeTlv.
- */
-public class LinkProtectionTypeTlvTest {
- private final byte rawValue1 = 0x0A;
- private final byte rawValue2 = 0x0B;
-
- private final LinkProtectionTypeTlv tlv1 = new LinkProtectionTypeTlv(rawValue1);
- private final LinkProtectionTypeTlv sameAsTlv1 = new LinkProtectionTypeTlv(rawValue1);
- private final LinkProtectionTypeTlv tlv2 = new LinkProtectionTypeTlv(rawValue2, (byte) 0);
-
- @Test
- public void basics() {
- new EqualsTester()
- .addEqualityGroup(tlv1, sameAsTlv1)
- .addEqualityGroup(tlv2)
- .testEquals();
- }
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LocalNodeDescriptorsTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LocalNodeDescriptorsTlvTest.java
new file mode 100644
index 0000000..2570e66
--- /dev/null
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LocalNodeDescriptorsTlvTest.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio.types;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Test of the LocalNodeDescriptorsTlv.
+ */
+public class LocalNodeDescriptorsTlvTest {
+
+ private final AutonomousSystemSubTlv baAutoSysTlvRawValue1 = new AutonomousSystemSubTlv(1);
+ private final BgpLsIdentifierSubTlv baBgplsIdRawValue1 = new BgpLsIdentifierSubTlv(1);
+
+ private final AutonomousSystemSubTlv baAutoSysTlvRawValue2 = new AutonomousSystemSubTlv(2);
+ private final BgpLsIdentifierSubTlv baBgplsIdRawValue2 = new BgpLsIdentifierSubTlv(2);
+
+ private final List<PcepValueType> llNodeDescriptorSubTLVs1 = new LinkedList<PcepValueType>();
+ private final boolean a = llNodeDescriptorSubTLVs1.add(baAutoSysTlvRawValue1);
+ private final boolean b = llNodeDescriptorSubTLVs1.add(baBgplsIdRawValue1);
+
+ private final List<PcepValueType> llNodeDescriptorSubTLVs2 = new LinkedList<PcepValueType>();
+ private final boolean c = llNodeDescriptorSubTLVs2.add(baAutoSysTlvRawValue2);
+ private final boolean d = llNodeDescriptorSubTLVs2.add(baBgplsIdRawValue2);
+
+ private final LocalNodeDescriptorsTlv tlv1 = LocalNodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
+ private final LocalNodeDescriptorsTlv sameAstlv1 = LocalNodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
+ private final LocalNodeDescriptorsTlv tlv2 = LocalNodeDescriptorsTlv.of(llNodeDescriptorSubTLVs2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAstlv1).addEqualityGroup(tlv2).testEquals();
+ }
+}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LocalTENodeDescriptorsTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LocalTENodeDescriptorsTlvTest.java
deleted file mode 100644
index 17daa75..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LocalTENodeDescriptorsTlvTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-import java.util.LinkedList;
-
-/**
- * Test of the LocalTENodeDescriptorsTlv.
- */
-public class LocalTENodeDescriptorsTlvTest {
-
- private final AutonomousSystemTlv baAutoSysTlvRawValue1 = new AutonomousSystemTlv(1);
- private final BgpLsIdentifierTlv baBgplsIdRawValue1 = new BgpLsIdentifierTlv(1);
-
- private final AutonomousSystemTlv baAutoSysTlvRawValue2 = new AutonomousSystemTlv(2);
- private final BgpLsIdentifierTlv baBgplsIdRawValue2 = new BgpLsIdentifierTlv(2);
-
- private final LinkedList<PcepValueType> llNodeDescriptorSubTLVs1 = new LinkedList<PcepValueType>();
- private final boolean a = llNodeDescriptorSubTLVs1.add(baAutoSysTlvRawValue1);
- private final boolean b = llNodeDescriptorSubTLVs1.add(baBgplsIdRawValue1);
-
- private final LinkedList<PcepValueType> llNodeDescriptorSubTLVs2 = new LinkedList<PcepValueType>();
- private final boolean c = llNodeDescriptorSubTLVs2.add(baAutoSysTlvRawValue2);
- private final boolean d = llNodeDescriptorSubTLVs2.add(baBgplsIdRawValue2);
-
- private final LocalTENodeDescriptorsTlv tlv1 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
- private final LocalTENodeDescriptorsTlv sameAstlv1 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
- private final LocalTENodeDescriptorsTlv tlv2 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs2);
-
- @Test
- public void basics() {
- new EqualsTester().addEqualityGroup(tlv1, sameAstlv1).addEqualityGroup(tlv2).testEquals();
- }
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TedCapabilityTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LsCapabilityTlvTest.java
similarity index 79%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TedCapabilityTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LsCapabilityTlvTest.java
index 18677ca..3766a4d 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TedCapabilityTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/LsCapabilityTlvTest.java
@@ -21,11 +21,11 @@
/**
* Test case for TED Capability tlv.
*/
-public class TedCapabilityTlvTest {
+public class LsCapabilityTlvTest {
- private final TedCapabilityTlv tlv1 = TedCapabilityTlv.of(1);
- private final TedCapabilityTlv tlv2 = TedCapabilityTlv.of(1);
- private final TedCapabilityTlv tlv3 = TedCapabilityTlv.of(2);
+ private final LsCapabilityTlv tlv1 = LsCapabilityTlv.of(1);
+ private final LsCapabilityTlv tlv2 = LsCapabilityTlv.of(1);
+ private final LsCapabilityTlv tlv3 = LsCapabilityTlv.of(2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumLinkBandwidthTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumLinkBandwidthSubTlvTest.java
similarity index 72%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumLinkBandwidthTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumLinkBandwidthSubTlvTest.java
index 4e022b8..d4b9c6b 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumLinkBandwidthTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumLinkBandwidthSubTlvTest.java
@@ -19,15 +19,15 @@
import org.junit.Test;
/**
- * Test of the MaximumLinkBandwidthTlv.
+ * Test of the MaximumLinkBandwidthSubTlv.
*/
-public class MaximumLinkBandwidthTlvTest {
+public class MaximumLinkBandwidthSubTlvTest {
private final int rawValue1 = 0x0A;
private final int rawValue2 = 0x0B;
- private final MaximumLinkBandwidthTlv tlv1 = new MaximumLinkBandwidthTlv(rawValue1);
- private final MaximumLinkBandwidthTlv sameAsTlv1 = new MaximumLinkBandwidthTlv(rawValue1);
- private final MaximumLinkBandwidthTlv tlv2 = MaximumLinkBandwidthTlv.of(rawValue2);
+ private final MaximumLinkBandwidthSubTlv tlv1 = new MaximumLinkBandwidthSubTlv(rawValue1);
+ private final MaximumLinkBandwidthSubTlv sameAsTlv1 = new MaximumLinkBandwidthSubTlv(rawValue1);
+ private final MaximumLinkBandwidthSubTlv tlv2 = MaximumLinkBandwidthSubTlv.of(rawValue2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumLinkBandwidthTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumReservableLinkBandwidthSubTlvTest.java
similarity index 68%
copy from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumLinkBandwidthTlvTest.java
copy to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumReservableLinkBandwidthSubTlvTest.java
index 4e022b8..85e108d 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumLinkBandwidthTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumReservableLinkBandwidthSubTlvTest.java
@@ -19,15 +19,15 @@
import org.junit.Test;
/**
- * Test of the MaximumLinkBandwidthTlv.
+ * Test of the MaximumReservableLinkBandwidthSubTlv.
*/
-public class MaximumLinkBandwidthTlvTest {
+public class MaximumReservableLinkBandwidthSubTlvTest {
private final int rawValue1 = 0x0A;
private final int rawValue2 = 0x0B;
- private final MaximumLinkBandwidthTlv tlv1 = new MaximumLinkBandwidthTlv(rawValue1);
- private final MaximumLinkBandwidthTlv sameAsTlv1 = new MaximumLinkBandwidthTlv(rawValue1);
- private final MaximumLinkBandwidthTlv tlv2 = MaximumLinkBandwidthTlv.of(rawValue2);
+ private final MaximumReservableLinkBandwidthSubTlv tlv1 = new MaximumReservableLinkBandwidthSubTlv(rawValue1);
+ private final MaximumReservableLinkBandwidthSubTlv sameAsTlv1 = new MaximumReservableLinkBandwidthSubTlv(rawValue1);
+ private final MaximumReservableLinkBandwidthSubTlv tlv2 = MaximumReservableLinkBandwidthSubTlv.of(rawValue2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumReservableLinkBandwidthTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumReservableLinkBandwidthTlvTest.java
deleted file mode 100644
index 7b37035..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MaximumReservableLinkBandwidthTlvTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-/**
- * Test of the MaximumReservableLinkBandwidthTlv.
- */
-public class MaximumReservableLinkBandwidthTlvTest {
- private final int rawValue1 = 0x0A;
- private final int rawValue2 = 0x0B;
-
- private final MaximumReservableLinkBandwidthTlv tlv1 = new MaximumReservableLinkBandwidthTlv(rawValue1);
- private final MaximumReservableLinkBandwidthTlv sameAsTlv1 = new MaximumReservableLinkBandwidthTlv(rawValue1);
- private final MaximumReservableLinkBandwidthTlv tlv2 = MaximumReservableLinkBandwidthTlv.of(rawValue2);
-
- @Test
- public void basics() {
- new EqualsTester()
- .addEqualityGroup(tlv1, sameAsTlv1)
- .addEqualityGroup(tlv2)
- .testEquals();
- }
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MplsProtocolMaskTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MplsProtocolMaskSubTlvTest.java
similarity index 73%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MplsProtocolMaskTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MplsProtocolMaskSubTlvTest.java
index ff87b7a..6e396b8 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MplsProtocolMaskTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/MplsProtocolMaskSubTlvTest.java
@@ -19,15 +19,15 @@
import org.junit.Test;
/**
- * Test of the MPLSProtocolMaskTlv.
+ * Test of the MplsProtocolMaskSubTlv.
*/
-public class MplsProtocolMaskTlvTest {
+public class MplsProtocolMaskSubTlvTest {
private final byte rawValue1 = 0x0A;
private final byte rawValue2 = 0x0B;
- private final MplsProtocolMaskTlv tlv1 = new MplsProtocolMaskTlv(rawValue1);
- private final MplsProtocolMaskTlv sameAsTlv1 = new MplsProtocolMaskTlv(rawValue1);
- private final MplsProtocolMaskTlv tlv2 = MplsProtocolMaskTlv.of(rawValue2);
+ private final MplsProtocolMaskSubTlv tlv1 = new MplsProtocolMaskSubTlv(rawValue1);
+ private final MplsProtocolMaskSubTlv sameAsTlv1 = new MplsProtocolMaskSubTlv(rawValue1);
+ private final MplsProtocolMaskSubTlv tlv2 = MplsProtocolMaskSubTlv.of(rawValue2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeAttributesTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeAttributesTlvTest.java
new file mode 100644
index 0000000..2c9664d
--- /dev/null
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeAttributesTlvTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio.types;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Test case for TE Node Attribute tlv.
+ */
+public class NodeAttributesTlvTest {
+
+ private final NodeFlagBitsSubTlv nodeFlagBitsTlv1 = new NodeFlagBitsSubTlv((byte) 10);
+ private final IPv4RouterIdOfLocalNodeSubTlv iPv4TERouterIdOfLocalNodeTlv1 = new
+ IPv4RouterIdOfLocalNodeSubTlv(0x01010101);
+
+ private final NodeFlagBitsSubTlv nodeFlagBitsTlv2 = new NodeFlagBitsSubTlv((byte) 20);
+ private final IPv4RouterIdOfLocalNodeSubTlv iPv4TERouterIdOfLocalNodeTlv2 = new
+ IPv4RouterIdOfLocalNodeSubTlv(0x02020202);
+
+ private final List<PcepValueType> llNodeAttributesSubTLV1 = new LinkedList<>();
+ private final boolean a = llNodeAttributesSubTLV1.add(nodeFlagBitsTlv1);
+ private final boolean b = llNodeAttributesSubTLV1.add(iPv4TERouterIdOfLocalNodeTlv1);
+
+ private final List<PcepValueType> llNodeAttributesSubTLV2 = new LinkedList<>();
+
+ private final boolean c = llNodeAttributesSubTLV2.add(nodeFlagBitsTlv2);
+ private final boolean d = llNodeAttributesSubTLV2.add(iPv4TERouterIdOfLocalNodeTlv2);
+
+ private final NodeAttributesTlv tlv1 = NodeAttributesTlv.of(llNodeAttributesSubTLV1);
+ private final NodeAttributesTlv sameAsTlv1 = NodeAttributesTlv.of(llNodeAttributesSubTLV1);
+ private final NodeAttributesTlv tlv2 = NodeAttributesTlv.of(llNodeAttributesSubTLV2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
+ }
+
+}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeFlagBitsTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeFlagBitsSubTlvTest.java
similarity index 76%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeFlagBitsTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeFlagBitsSubTlvTest.java
index fb90fed..5179a2c 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeFlagBitsTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeFlagBitsSubTlvTest.java
@@ -19,15 +19,15 @@
import org.junit.Test;
/**
- * Test of the NodeFlagBitsTlv.
+ * Test of the NodeFlagBitsSubTlv.
*/
-public class NodeFlagBitsTlvTest {
+public class NodeFlagBitsSubTlvTest {
private final byte rawValue1 = 0x0A;
private final byte rawValue2 = 0x0B;
- private final NodeFlagBitsTlv tlv1 = new NodeFlagBitsTlv(rawValue1);
- private final NodeFlagBitsTlv sameAsTlv1 = new NodeFlagBitsTlv(rawValue1);
- private final NodeFlagBitsTlv tlv2 = NodeFlagBitsTlv.of(rawValue2);
+ private final NodeFlagBitsSubTlv tlv1 = new NodeFlagBitsSubTlv(rawValue1);
+ private final NodeFlagBitsSubTlv sameAsTlv1 = new NodeFlagBitsSubTlv(rawValue1);
+ private final NodeFlagBitsSubTlv tlv2 = NodeFlagBitsSubTlv.of(rawValue2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeNameTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeNameSubTlvTest.java
similarity index 74%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeNameTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeNameSubTlvTest.java
index d6d53d6..c21c986 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeNameTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeNameSubTlvTest.java
@@ -19,15 +19,15 @@
import org.junit.Test;
/**
- * Test of the NodeNameTlv.
+ * Test of the NodeNameSubTlv.
*/
-public class NodeNameTlvTest {
+public class NodeNameSubTlvTest {
private final byte[] rawValue1 = new byte[] {0x01, 0x02};
private final byte[] rawValue2 = new byte[] {0x14, 0x15};
- private final NodeNameTlv tlv1 = new NodeNameTlv(rawValue1, (short) rawValue1.length);
- private final NodeNameTlv sameAsTlv1 = NodeNameTlv.of(tlv1.getValue(), tlv1.getLength());
- private final NodeNameTlv tlv2 = new NodeNameTlv(rawValue2, (short) 0);
+ private final NodeNameSubTlv tlv1 = new NodeNameSubTlv(rawValue1, (short) rawValue1.length);
+ private final NodeNameSubTlv sameAsTlv1 = NodeNameSubTlv.of(tlv1.getValue(), tlv1.getLength());
+ private final NodeNameSubTlv tlv2 = new NodeNameSubTlv(rawValue2, (short) 0);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeNameTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/OpaqueLinkAttributeSubTlvTest.java
similarity index 69%
copy from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeNameTlvTest.java
copy to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/OpaqueLinkAttributeSubTlvTest.java
index d6d53d6..4a4c29e 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/NodeNameTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/OpaqueLinkAttributeSubTlvTest.java
@@ -19,15 +19,17 @@
import org.junit.Test;
/**
- * Test of the NodeNameTlv.
+ * Test of the OpaqueLinkAttributeSubTlv.
*/
-public class NodeNameTlvTest {
+public class OpaqueLinkAttributeSubTlvTest {
private final byte[] rawValue1 = new byte[] {0x01, 0x02};
private final byte[] rawValue2 = new byte[] {0x14, 0x15};
- private final NodeNameTlv tlv1 = new NodeNameTlv(rawValue1, (short) rawValue1.length);
- private final NodeNameTlv sameAsTlv1 = NodeNameTlv.of(tlv1.getValue(), tlv1.getLength());
- private final NodeNameTlv tlv2 = new NodeNameTlv(rawValue2, (short) 0);
+ private final OpaqueLinkAttributeSubTlv tlv1 =
+ new OpaqueLinkAttributeSubTlv(rawValue1, (short) rawValue1.length);
+ private final OpaqueLinkAttributeSubTlv sameAsTlv1 =
+ OpaqueLinkAttributeSubTlv.of(tlv1.getValue(), tlv1.getLength());
+ private final OpaqueLinkAttributeSubTlv tlv2 = new OpaqueLinkAttributeSubTlv(rawValue2, (short) 0);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/OpaqueLinkAttributeTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/OpaqueLinkAttributeTlvTest.java
deleted file mode 100644
index f437fb5..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/OpaqueLinkAttributeTlvTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-/**
- * Test of the OpaqueLinkAttributeTlv.
- */
-public class OpaqueLinkAttributeTlvTest {
- private final byte[] rawValue1 = new byte[] {0x01, 0x02};
- private final byte[] rawValue2 = new byte[] {0x14, 0x15};
-
- private final OpaqueLinkAttributeTlv tlv1 = new OpaqueLinkAttributeTlv(rawValue1, (short) rawValue1.length);
- private final OpaqueLinkAttributeTlv sameAsTlv1 = OpaqueLinkAttributeTlv.of(tlv1.getValue(), tlv1.getLength());
- private final OpaqueLinkAttributeTlv tlv2 = new OpaqueLinkAttributeTlv(rawValue2, (short) 0);
-
- @Test
- public void basics() {
- new EqualsTester()
- .addEqualityGroup(tlv1, sameAsTlv1)
- .addEqualityGroup(tlv2)
- .testEquals();
- }
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/OspfAreaIdSubTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/OspfAreaIdSubTlvTest.java
index 2ea3511..4dc4fdd 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/OspfAreaIdSubTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/OspfAreaIdSubTlvTest.java
@@ -19,7 +19,7 @@
import org.junit.Test;
/**
- * Test of the OSPFareaIDsubTlv.
+ * Test of the OspfAreaIdSubTlv.
*/
public class OspfAreaIdSubTlvTest {
private final int rawValue1 = 0x0A;
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/RemoteNodeDescriptorsTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/RemoteNodeDescriptorsTlvTest.java
new file mode 100644
index 0000000..ee78b57
--- /dev/null
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/RemoteNodeDescriptorsTlvTest.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio.types;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Test case for Remote TE Node Descriptors tlv.
+ */
+public class RemoteNodeDescriptorsTlvTest {
+
+ private final AutonomousSystemSubTlv autonomousSystemTlv1 = new AutonomousSystemSubTlv(10);
+ private final BgpLsIdentifierSubTlv bGPLSidentifierTlv1 = new BgpLsIdentifierSubTlv(20);
+
+ private final AutonomousSystemSubTlv autonomousSystemTlv2 = new AutonomousSystemSubTlv(20);
+ private final BgpLsIdentifierSubTlv bGPLSidentifierTlv2 = new BgpLsIdentifierSubTlv(30);
+
+ private final List<PcepValueType> llRemoteTENodeDescriptorSubTLV1 = new LinkedList<>();
+ private final boolean a = llRemoteTENodeDescriptorSubTLV1.add(autonomousSystemTlv1);
+ private final boolean b = llRemoteTENodeDescriptorSubTLV1.add(bGPLSidentifierTlv1);
+
+ private final List<PcepValueType> llRemoteTENodeDescriptorSubTLV2 = new LinkedList<>();
+ private final boolean c = llRemoteTENodeDescriptorSubTLV2.add(autonomousSystemTlv2);
+ private final boolean d = llRemoteTENodeDescriptorSubTLV2.add(bGPLSidentifierTlv2);
+
+ private final RemoteNodeDescriptorsTlv tlv1 = RemoteNodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
+ private final RemoteNodeDescriptorsTlv sameAsTlv1 =
+ RemoteNodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
+ private final RemoteNodeDescriptorsTlv tlv2 = RemoteNodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
+ }
+
+}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/RemoteTENodeDescriptorsTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/RemoteTENodeDescriptorsTlvTest.java
deleted file mode 100644
index 8e74921..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/RemoteTENodeDescriptorsTlvTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-import java.util.LinkedList;
-
-/**
- * Test case for Remote TE Node Descriptors tlv.
- */
-public class RemoteTENodeDescriptorsTlvTest {
-
- private final AutonomousSystemTlv autonomousSystemTlv1 = new AutonomousSystemTlv(10);
- private final BgpLsIdentifierTlv bGPLSidentifierTlv1 = new BgpLsIdentifierTlv(20);
-
- private final AutonomousSystemTlv autonomousSystemTlv2 = new AutonomousSystemTlv(20);
- private final BgpLsIdentifierTlv bGPLSidentifierTlv2 = new BgpLsIdentifierTlv(30);
-
- private final LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLV1 = new LinkedList<>();
- private final boolean a = llRemoteTENodeDescriptorSubTLV1.add(autonomousSystemTlv1);
- private final boolean b = llRemoteTENodeDescriptorSubTLV1.add(bGPLSidentifierTlv1);
-
- private final LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLV2 = new LinkedList<>();
- private final boolean c = llRemoteTENodeDescriptorSubTLV2.add(autonomousSystemTlv2);
- private final boolean d = llRemoteTENodeDescriptorSubTLV2.add(bGPLSidentifierTlv2);
-
- private final RemoteTENodeDescriptorsTlv tlv1 = RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
- private final RemoteTENodeDescriptorsTlv sameAsTlv1 =
- RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
- private final RemoteTENodeDescriptorsTlv tlv2 = RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV2);
-
- @Test
- public void basics() {
- new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
- }
-
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/SharedRiskLinkGroupTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/SharedRiskLinkGroupSubTlvTest.java
similarity index 72%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/SharedRiskLinkGroupTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/SharedRiskLinkGroupSubTlvTest.java
index 7c8ec57..777ff9c 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/SharedRiskLinkGroupTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/SharedRiskLinkGroupSubTlvTest.java
@@ -19,19 +19,19 @@
import org.junit.Test;
/**
- * Test case for Shared Risk Link Group tlv.
+ * Test case for SharedRiskLinkGroupSubTlv.
*/
-public class SharedRiskLinkGroupTlvTest {
+public class SharedRiskLinkGroupSubTlvTest {
private final int[] raw = {1 };
private final Short hLength = 2;
- private final SharedRiskLinkGroupTlv tlv1 = SharedRiskLinkGroupTlv.of(raw, hLength);
+ private final SharedRiskLinkGroupSubTlv tlv1 = SharedRiskLinkGroupSubTlv.of(raw, hLength);
- private final SharedRiskLinkGroupTlv sameAsTlv1 = SharedRiskLinkGroupTlv.of(raw, hLength);
+ private final SharedRiskLinkGroupSubTlv sameAsTlv1 = SharedRiskLinkGroupSubTlv.of(raw, hLength);
private final int[] raw2 = {2 };
private final Short hLength2 = 3;
- private final SharedRiskLinkGroupTlv tlv2 = SharedRiskLinkGroupTlv.of(raw2, hLength2);
+ private final SharedRiskLinkGroupSubTlv tlv2 = SharedRiskLinkGroupSubTlv.of(raw2, hLength2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TEDefaultMetricTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TEDefaultMetricSubTlvTest.java
similarity index 73%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TEDefaultMetricTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TEDefaultMetricSubTlvTest.java
index c46b0af..ee63621 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TEDefaultMetricTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TEDefaultMetricSubTlvTest.java
@@ -19,13 +19,13 @@
import org.junit.Test;
/**
- * Test case for TE Default Metric tlv.
+ * Test case for TEDefaultMetricSubTlv.
*/
-public class TEDefaultMetricTlvTest {
+public class TEDefaultMetricSubTlvTest {
- private final TEDefaultMetricTlv tlv1 = TEDefaultMetricTlv.of(1);
- private final TEDefaultMetricTlv tlv2 = TEDefaultMetricTlv.of(1);
- private final TEDefaultMetricTlv tlv3 = TEDefaultMetricTlv.of(2);
+ private final TEDefaultMetricSubTlv tlv1 = TEDefaultMetricSubTlv.of(1);
+ private final TEDefaultMetricSubTlv tlv2 = TEDefaultMetricSubTlv.of(1);
+ private final TEDefaultMetricSubTlv tlv3 = TEDefaultMetricSubTlv.of(2);
@Test
public void basics() {
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TELinkAttributesTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TELinkAttributesTlvTest.java
deleted file mode 100644
index 8504a87..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TELinkAttributesTlvTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-import java.util.LinkedList;
-
-/**
- * Test case for TE Link Attribute Tlv.
- */
-public class TELinkAttributesTlvTest {
-
- private final AdministrativeGroupTlv administrativeGroupTlv1 = new AdministrativeGroupTlv(10);
- private final MaximumReservableLinkBandwidthTlv maximumReservableLinkBandwidthTlv1 =
- new MaximumReservableLinkBandwidthTlv(20);
-
- private final AdministrativeGroupTlv administrativeGroupTlv2 = new AdministrativeGroupTlv(20);
- private final MaximumReservableLinkBandwidthTlv maximumReservableLinkBandwidthTlv2 =
- new MaximumReservableLinkBandwidthTlv(30);
-
- private final LinkedList<PcepValueType> llLinkAttributesSubTLV1 = new LinkedList<>();
- private final boolean a = llLinkAttributesSubTLV1.add(administrativeGroupTlv1);
- private final boolean b = llLinkAttributesSubTLV1.add(maximumReservableLinkBandwidthTlv1);
-
- private final LinkedList<PcepValueType> llLinkAttributesSubTLV2 = new LinkedList<>();
-
- private final boolean c = llLinkAttributesSubTLV2.add(administrativeGroupTlv2);
- private final boolean d = llLinkAttributesSubTLV2.add(maximumReservableLinkBandwidthTlv2);
-
- private final TELinkAttributesTlv tlv1 = TELinkAttributesTlv.of(llLinkAttributesSubTLV1);
- private final TELinkAttributesTlv sameAsTlv1 = TELinkAttributesTlv.of(llLinkAttributesSubTLV1);
- private final TELinkAttributesTlv tlv2 = TELinkAttributesTlv.of(llLinkAttributesSubTLV2);
-
- @Test
- public void basics() {
- new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
- }
-
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TELinkDescriptorsTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TELinkDescriptorsTlvTest.java
deleted file mode 100644
index 4e94209..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TELinkDescriptorsTlvTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-import java.util.LinkedList;
-
-/**
- * Test case for TE link descriptors Tlv.
- */
-public class TELinkDescriptorsTlvTest {
- private final LinkLocalRemoteIdentifiersTlv linkLocalRemoteIdentifiersTlv1 = new
- LinkLocalRemoteIdentifiersTlv(10, 10);
- private final IPv4InterfaceAddressTlv iPv4InterfaceAddressTlv1 = new IPv4InterfaceAddressTlv(0x01010101);
-
- private final LinkLocalRemoteIdentifiersTlv linkLocalRemoteIdentifiersTlv2 = new
- LinkLocalRemoteIdentifiersTlv(20, 20);
- private final IPv4InterfaceAddressTlv iPv4InterfaceAddressTlv2 = new IPv4InterfaceAddressTlv(0x02020202);
-
- private final LinkedList<PcepValueType> llLinkDescriptorsSubTLVs1 = new LinkedList<>();
- private final boolean a = llLinkDescriptorsSubTLVs1.add(linkLocalRemoteIdentifiersTlv1);
- private final boolean b = llLinkDescriptorsSubTLVs1.add(iPv4InterfaceAddressTlv1);
-
- private final LinkedList<PcepValueType> llLinkDescriptorsSubTLVs2 = new LinkedList<>();
- private final boolean c = llLinkDescriptorsSubTLVs2.add(linkLocalRemoteIdentifiersTlv2);
- private final boolean d = llLinkDescriptorsSubTLVs2.add(iPv4InterfaceAddressTlv2);
-
- private final TELinkDescriptorsTlv tlv1 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1);
- private final TELinkDescriptorsTlv sameAstlv1 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1);
- private final TELinkDescriptorsTlv tlv2 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs2);
-
- @Test
- public void basics() {
- new EqualsTester().addEqualityGroup(tlv1, sameAstlv1).addEqualityGroup(tlv2).testEquals();
- }
-
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TENodeAttributesTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TENodeAttributesTlvTest.java
deleted file mode 100644
index 28cf27d..0000000
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/TENodeAttributesTlvTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.pcepio.types;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-import java.util.LinkedList;
-
-/**
- * Test case for TE Node Attribute tlv.
- */
-public class TENodeAttributesTlvTest {
-
- private final NodeFlagBitsTlv nodeFlagBitsTlv1 = new NodeFlagBitsTlv((byte) 10);
- private final IPv4TERouterIdOfLocalNodeTlv iPv4TERouterIdOfLocalNodeTlv1 = new
- IPv4TERouterIdOfLocalNodeTlv(0x01010101);
-
- private final NodeFlagBitsTlv nodeFlagBitsTlv2 = new NodeFlagBitsTlv((byte) 20);
- private final IPv4TERouterIdOfLocalNodeTlv iPv4TERouterIdOfLocalNodeTlv2 = new
- IPv4TERouterIdOfLocalNodeTlv(0x02020202);
-
- private final LinkedList<PcepValueType> llNodeAttributesSubTLV1 = new LinkedList<>();
- private final boolean a = llNodeAttributesSubTLV1.add(nodeFlagBitsTlv1);
- private final boolean b = llNodeAttributesSubTLV1.add(iPv4TERouterIdOfLocalNodeTlv1);
-
- private final LinkedList<PcepValueType> llNodeAttributesSubTLV2 = new LinkedList<>();
-
- private final boolean c = llNodeAttributesSubTLV2.add(nodeFlagBitsTlv2);
- private final boolean d = llNodeAttributesSubTLV2.add(iPv4TERouterIdOfLocalNodeTlv2);
-
- private final TENodeAttributesTlv tlv1 = TENodeAttributesTlv.of(llNodeAttributesSubTLV1);
- private final TENodeAttributesTlv sameAsTlv1 = TENodeAttributesTlv.of(llNodeAttributesSubTLV1);
- private final TENodeAttributesTlv tlv2 = TENodeAttributesTlv.of(llNodeAttributesSubTLV2);
-
- @Test
- public void basics() {
- new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
- }
-
-}
diff --git a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/UnreservedBandwidthTlvTest.java b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/UnreservedBandwidthSubTlvTest.java
similarity index 72%
rename from protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/UnreservedBandwidthTlvTest.java
rename to protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/UnreservedBandwidthSubTlvTest.java
index a50fd9f..f33018f 100644
--- a/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/UnreservedBandwidthTlvTest.java
+++ b/protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/types/UnreservedBandwidthSubTlvTest.java
@@ -19,14 +19,14 @@
import org.junit.Test;
/**
- * Unit Test case for Unreserved Bandwidth Tlv.
+ * Unit Test case for UnreservedBandwidthSubTlv.
*/
-public class UnreservedBandwidthTlvTest {
+public class UnreservedBandwidthSubTlvTest {
// Objects of unreserved bandwidth tlv
- private final UnreservedBandwidthTlv tlv1 = UnreservedBandwidthTlv.of(100);
- private final UnreservedBandwidthTlv tlv2 = UnreservedBandwidthTlv.of(100);
- private final UnreservedBandwidthTlv tlv3 = UnreservedBandwidthTlv.of(200);
+ private final UnreservedBandwidthSubTlv tlv1 = UnreservedBandwidthSubTlv.of(100);
+ private final UnreservedBandwidthSubTlv tlv2 = UnreservedBandwidthSubTlv.of(100);
+ private final UnreservedBandwidthSubTlv tlv3 = UnreservedBandwidthSubTlv.of(200);
@Test
public void basics() {