Mahesh Poojary S
Committed by Gerrit Code Review

PCEP modificaton to support PCEP-LS

Change-Id: Ic829dd17b0398ad76ec412b4e8293de564b5b56b
Showing 111 changed files with 3601 additions and 3321 deletions
...@@ -22,6 +22,7 @@ import org.jboss.netty.buffer.ChannelBuffer; ...@@ -22,6 +22,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
22 import org.jboss.netty.channel.Channel; 22 import org.jboss.netty.channel.Channel;
23 import org.jboss.netty.channel.ChannelHandlerContext; 23 import org.jboss.netty.channel.ChannelHandlerContext;
24 import org.jboss.netty.handler.codec.frame.FrameDecoder; 24 import org.jboss.netty.handler.codec.frame.FrameDecoder;
25 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
25 import org.onosproject.pcepio.protocol.PcepFactories; 26 import org.onosproject.pcepio.protocol.PcepFactories;
26 import org.onosproject.pcepio.protocol.PcepMessage; 27 import org.onosproject.pcepio.protocol.PcepMessage;
27 import org.onosproject.pcepio.protocol.PcepMessageReader; 28 import org.onosproject.pcepio.protocol.PcepMessageReader;
...@@ -49,20 +50,31 @@ public class PcepMessageDecoder extends FrameDecoder { ...@@ -49,20 +50,31 @@ public class PcepMessageDecoder extends FrameDecoder {
49 50
50 HexDump.pcepHexDump(buffer); 51 HexDump.pcepHexDump(buffer);
51 52
52 - // Note that a single call to decode results in reading a single 53 + // Buffer can contain multiple messages, also may contain out of bound message.
53 - // PcepMessage from the channel buffer, which is passed on to, and processed 54 + // Read the message one by one from buffer and parse it. If it encountered out of bound message,
54 - // by, the controller (in PcepChannelHandler). 55 + // then mark the reader index and again take the next chunk of messages from the channel
55 - // This is different from earlier behavior (with the original pcepIO), 56 + // and parse again from the marked reader index.
56 - // where we parsed all the messages in the buffer, before passing on
57 - // a list of the parsed messages to the controller.
58 - // The performance *may or may not* not be as good as before.
59 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); 57 PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
60 - List<PcepMessage> msgList = new LinkedList<>(); 58 + List<PcepMessage> msgList = (List<PcepMessage>) ctx.getAttachment();
61 59
62 - while (buffer.readableBytes() > 0) { 60 + if (msgList == null) {
63 - PcepMessage message = reader.readFrom(buffer); 61 + msgList = new LinkedList<>();
64 - msgList.add(message);
65 } 62 }
66 - return msgList; 63 +
64 + try {
65 + while (buffer.readableBytes() > 0) {
66 + buffer.markReaderIndex();
67 + PcepMessage message = reader.readFrom(buffer);
68 + msgList.add(message);
69 + }
70 + ctx.setAttachment(null);
71 + return msgList;
72 + } catch (PcepOutOfBoundMessageException e) {
73 + log.debug("PCEP message decode error");
74 + buffer.resetReaderIndex();
75 + buffer.discardReadBytes();
76 + ctx.setAttachment(msgList);
77 + }
78 + return null;
67 } 79 }
68 } 80 }
......
1 +/*
2 + * Copyright 2015 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
17 +package org.onosproject.pcepio.exceptions;
18 +
19 +/**
20 + * Custom exception for message out-of-bound.
21 + */
22 +public class PcepOutOfBoundMessageException extends Exception {
23 +
24 + private static final long serialVersionUID = 3L;
25 +
26 + /**
27 + * Default constructor to create a new exception.
28 + */
29 + public PcepOutOfBoundMessageException() {
30 + super();
31 + }
32 +
33 + /**
34 + * Constructor to create exception from message and cause.
35 + *
36 + * @param message the detail of exception in string
37 + * @param cause underlying cause of the error
38 + */
39 + public PcepOutOfBoundMessageException(final String message, final Throwable cause) {
40 + super(message, cause);
41 + }
42 +
43 + /**
44 + * Constructor to create exception from message.
45 + *
46 + * @param message the detail of exception in string
47 + */
48 + public PcepOutOfBoundMessageException(final String message) {
49 + super(message);
50 + }
51 +
52 + /**
53 + * Constructor to create exception from cause.
54 + *
55 + * @param cause underlying cause of the error
56 + */
57 + public PcepOutOfBoundMessageException(final Throwable cause) {
58 + super(cause);
59 + }
60 +}
...@@ -21,7 +21,7 @@ package org.onosproject.pcepio.exceptions; ...@@ -21,7 +21,7 @@ package org.onosproject.pcepio.exceptions;
21 */ 21 */
22 public class PcepParseException extends Exception { 22 public class PcepParseException extends Exception {
23 23
24 - private static final long serialVersionUID = 7960991379951448423L; 24 + private static final long serialVersionUID = 1L;
25 private byte errType = 0; 25 private byte errType = 0;
26 private byte errValue = 0; 26 private byte errValue = 0;
27 27
......
...@@ -21,7 +21,7 @@ package org.onosproject.pcepio.exceptions; ...@@ -21,7 +21,7 @@ package org.onosproject.pcepio.exceptions;
21 */ 21 */
22 public class PcepTunnelAttributeException extends Exception { 22 public class PcepTunnelAttributeException extends Exception {
23 23
24 - private static final long serialVersionUID = 7860981378961458434L; 24 + private static final long serialVersionUID = 2L;
25 25
26 /** 26 /**
27 * Default constructor to create a new exception. 27 * Default constructor to create a new exception.
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
15 */ 15 */
16 package org.onosproject.pcepio.protocol; 16 package org.onosproject.pcepio.protocol;
17 17
18 -import java.util.LinkedList; 18 +import java.util.List;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 import org.onosproject.pcepio.exceptions.PcepParseException; 21 import org.onosproject.pcepio.exceptions.PcepParseException;
...@@ -30,42 +30,42 @@ public interface PcepError { ...@@ -30,42 +30,42 @@ public interface PcepError {
30 * 30 *
31 * @return list of type PcepRPObject 31 * @return list of type PcepRPObject
32 */ 32 */
33 - LinkedList<PcepRPObject> getRPObjList(); 33 + List<PcepRPObject> getRPObjList();
34 34
35 /** 35 /**
36 * Sets the RP Objects lists. 36 * Sets the RP Objects lists.
37 * 37 *
38 - * @param llRPObjList list of type PcepRPObject 38 + * @param rpObjList list of type PcepRPObject
39 */ 39 */
40 - void setRPObjList(LinkedList<PcepRPObject> llRPObjList); 40 + void setRPObjList(List<PcepRPObject> rpObjList);
41 41
42 /** 42 /**
43 - * Returns the PcepTEObject List. 43 + * Returns the PcepLSObject List.
44 * 44 *
45 - * @return list of type PcepTEObject 45 + * @return list of type PcepLSObject
46 */ 46 */
47 - LinkedList<PcepTEObject> getTEObjList(); 47 + List<PcepLSObject> getLSObjList();
48 48
49 /** 49 /**
50 - * Sets the TE Objects lists. 50 + * Sets the LS Objects lists.
51 * 51 *
52 - * @param llTEObjList list of type PcepTEObject 52 + * @param lsObjList list of type PcepLSObject
53 */ 53 */
54 - void setTEObjList(LinkedList<PcepTEObject> llTEObjList); 54 + void setLSObjList(List<PcepLSObject> lsObjList);
55 55
56 /** 56 /**
57 * Returns the PcepErrorObject. 57 * Returns the PcepErrorObject.
58 * 58 *
59 * @return list of type PcepErrorObject 59 * @return list of type PcepErrorObject
60 */ 60 */
61 - LinkedList<PcepErrorObject> getErrorObjList(); 61 + List<PcepErrorObject> getErrorObjList();
62 62
63 /** 63 /**
64 * Sets the Error Objects lists. 64 * Sets the Error Objects lists.
65 * 65 *
66 - * @param llErrorObjList list of type PcepErrorObject 66 + * @param errorObjList list of type PcepErrorObject
67 */ 67 */
68 - void setErrorObjList(LinkedList<PcepErrorObject> llErrorObjList); 68 + void setErrorObjList(List<PcepErrorObject> errorObjList);
69 69
70 /** 70 /**
71 * Writes the byte stream of PCEP error to the channel buffer. 71 * Writes the byte stream of PCEP error to the channel buffer.
...@@ -93,44 +93,44 @@ public interface PcepError { ...@@ -93,44 +93,44 @@ public interface PcepError {
93 * 93 *
94 * @return list of type PcepRPObject 94 * @return list of type PcepRPObject
95 */ 95 */
96 - LinkedList<PcepRPObject> getRPObjList(); 96 + List<PcepRPObject> getRPObjList();
97 97
98 /** 98 /**
99 * Sets RP Object lists and returns its builder. 99 * Sets RP Object lists and returns its builder.
100 * 100 *
101 - * @param llRPObjList list of type PcepRpObject 101 + * @param rpObjList list of type PcepRpObject
102 * @return builder by setting Linked list of RP Object 102 * @return builder by setting Linked list of RP Object
103 */ 103 */
104 - Builder setRPObjList(LinkedList<PcepRPObject> llRPObjList); 104 + Builder setRPObjList(List<PcepRPObject> rpObjList);
105 105
106 /** 106 /**
107 - * Returns the PcepTEObject. 107 + * Returns the PcepLSObject.
108 * 108 *
109 - * @return llTEObjList of type PcepTEObject 109 + * @return lsObjList of type PcepLSObject
110 */ 110 */
111 - LinkedList<PcepTEObject> getTEObjList(); 111 + List<PcepLSObject> getLSObjList();
112 112
113 /** 113 /**
114 - * Sets TE Object lists and returns its builder. 114 + * Sets LS Object lists and returns its builder.
115 * 115 *
116 - * @param llTEObjList list of type PcepTEObject 116 + * @param lsObjList list of type PcepLSObject
117 - * @return builder by setting list of type PcepTEObject 117 + * @return builder by setting list of type PcepLSObject
118 */ 118 */
119 - Builder setTEObjList(LinkedList<PcepTEObject> llTEObjList); 119 + Builder setLSObjList(List<PcepLSObject> lsObjList);
120 120
121 /** 121 /**
122 * Returns the PcepErrorObject. 122 * Returns the PcepErrorObject.
123 * 123 *
124 * @return list of type PcepErrorObject 124 * @return list of type PcepErrorObject
125 */ 125 */
126 - LinkedList<PcepErrorObject> getErrorObjList(); 126 + List<PcepErrorObject> getErrorObjList();
127 127
128 /** 128 /**
129 * Sets Error Object lists and returns its builder. 129 * Sets Error Object lists and returns its builder.
130 * 130 *
131 - * @param llErrorObjList list of type PcepErrorObject 131 + * @param errorObjList list of type PcepErrorObject
132 * @return builder by setting list of type PcepErrorObject 132 * @return builder by setting list of type PcepErrorObject
133 */ 133 */
134 - Builder setErrorObjList(LinkedList<PcepErrorObject> llErrorObjList); 134 + Builder setErrorObjList(List<PcepErrorObject> errorObjList);
135 } 135 }
136 } 136 }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
15 */ 15 */
16 package org.onosproject.pcepio.protocol; 16 package org.onosproject.pcepio.protocol;
17 17
18 -import java.util.LinkedList; 18 +import java.util.List;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 import org.onosproject.pcepio.exceptions.PcepParseException; 21 import org.onosproject.pcepio.exceptions.PcepParseException;
...@@ -54,14 +54,14 @@ public interface PcepErrorInfo { ...@@ -54,14 +54,14 @@ public interface PcepErrorInfo {
54 * 54 *
55 * @return list of Error Value in PCEP-ERROR Object 55 * @return list of Error Value in PCEP-ERROR Object
56 */ 56 */
57 - LinkedList<Integer> getErrorValue(); 57 + List<Integer> getErrorValue();
58 58
59 /** 59 /**
60 * Returns Error Type in PCEP-ERROR Object. 60 * Returns Error Type in PCEP-ERROR Object.
61 * 61 *
62 * @return list of Error Type in PCEP-ERROR Object 62 * @return list of Error Type in PCEP-ERROR Object
63 */ 63 */
64 - LinkedList<Integer> getErrorType(); 64 + List<Integer> getErrorType();
65 65
66 /** 66 /**
67 * Builder interface with get and set functions to build ErrorInfo. 67 * Builder interface with get and set functions to build ErrorInfo.
...@@ -80,7 +80,7 @@ public interface PcepErrorInfo { ...@@ -80,7 +80,7 @@ public interface PcepErrorInfo {
80 * 80 *
81 * @return list of PcepError 81 * @return list of PcepError
82 */ 82 */
83 - LinkedList<PcepError> getPcepErrorList(); 83 + List<PcepError> getPcepErrorList();
84 84
85 /** 85 /**
86 * Sets PcepError lists and returns its builder. 86 * Sets PcepError lists and returns its builder.
...@@ -88,6 +88,6 @@ public interface PcepErrorInfo { ...@@ -88,6 +88,6 @@ public interface PcepErrorInfo {
88 * @param llPcepErrorList list of PcepError 88 * @param llPcepErrorList list of PcepError
89 * @return builder by setting list of PcepError. 89 * @return builder by setting list of PcepError.
90 */ 90 */
91 - Builder setPcepErrorList(LinkedList<PcepError> llPcepErrorList); 91 + Builder setPcepErrorList(List<PcepError> llPcepErrorList);
92 } 92 }
93 } 93 }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
17 package org.onosproject.pcepio.protocol; 17 package org.onosproject.pcepio.protocol;
18 18
19 import org.jboss.netty.buffer.ChannelBuffer; 19 import org.jboss.netty.buffer.ChannelBuffer;
20 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
20 import org.onosproject.pcepio.exceptions.PcepParseException; 21 import org.onosproject.pcepio.exceptions.PcepParseException;
21 import org.onosproject.pcepio.protocol.ver1.PcepFactoryVer1; 22 import org.onosproject.pcepio.protocol.ver1.PcepFactoryVer1;
22 import org.slf4j.Logger; 23 import org.slf4j.Logger;
...@@ -54,7 +55,7 @@ public final class PcepFactories { ...@@ -54,7 +55,7 @@ public final class PcepFactories {
54 private static class GenericReader implements PcepMessageReader<PcepMessage> { 55 private static class GenericReader implements PcepMessageReader<PcepMessage> {
55 56
56 @Override 57 @Override
57 - public PcepMessage readFrom(ChannelBuffer bb) throws PcepParseException { 58 + public PcepMessage readFrom(ChannelBuffer bb) throws PcepParseException, PcepOutOfBoundMessageException {
58 59
59 if (!bb.readable()) { 60 if (!bb.readable()) {
60 throw new PcepParseException("Empty message received"); 61 throw new PcepParseException("Empty message received");
......
1 /* 1 /*
2 - * Copyright 2015 Open Networking Laboratory 2 + * Copyright 2016 Open Networking Laboratory
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
15 */ 15 */
16 package org.onosproject.pcepio.protocol; 16 package org.onosproject.pcepio.protocol;
17 17
18 -import java.util.LinkedList; 18 +import java.util.List;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 import org.onosproject.pcepio.exceptions.PcepParseException; 21 import org.onosproject.pcepio.exceptions.PcepParseException;
...@@ -23,218 +23,218 @@ import org.onosproject.pcepio.types.PcepObjectHeader; ...@@ -23,218 +23,218 @@ import org.onosproject.pcepio.types.PcepObjectHeader;
23 import org.onosproject.pcepio.types.PcepValueType; 23 import org.onosproject.pcepio.types.PcepValueType;
24 24
25 /** 25 /**
26 - * Abstraction of an entity providing PCEP TE Object. 26 + * Abstraction of an entity providing PCEP LS Object.
27 */ 27 */
28 -public interface PcepTEObject { 28 +public interface PcepLSObject {
29 29
30 /** 30 /**
31 - * Returns TE object header. 31 + * Returns LS object header.
32 * 32 *
33 - * @return TE object header 33 + * @return LS object header
34 */ 34 */
35 - PcepObjectHeader getTEObjHeader(); 35 + PcepObjectHeader getLSObjHeader();
36 36
37 /** 37 /**
38 - * Sets TE Object header. 38 + * Sets LS Object header.
39 * 39 *
40 - * @param obj TE Object header 40 + * @param obj LS Object header
41 */ 41 */
42 - void setTEObjHeader(PcepObjectHeader obj); 42 + void setLSObjHeader(PcepObjectHeader obj);
43 43
44 /** 44 /**
45 - * Returns ProtocolId in TE Object. 45 + * Returns ProtocolId in LS Object.
46 * 46 *
47 - * @return ProtocolId in TE Object 47 + * @return ProtocolId in LS Object
48 */ 48 */
49 byte getProtocolId(); 49 byte getProtocolId();
50 50
51 /** 51 /**
52 - * Sets ProtocolId in TE Object. 52 + * Sets ProtocolId in LS Object.
53 * 53 *
54 - * @param yProtId ProtocolId in TE Object 54 + * @param protId ProtocolId in LS Object
55 */ 55 */
56 - void setProtocolId(byte yProtId); 56 + void setProtocolId(byte protId);
57 57
58 /** 58 /**
59 - * Returns R flag in TE Object. 59 + * Returns R flag in LS Object.
60 * 60 *
61 - * @return R flag in TE Object 61 + * @return R flag in LS Object
62 */ 62 */
63 - boolean getRFlag(); 63 + boolean getRemoveFlag();
64 64
65 /** 65 /**
66 - * Sets R flag in TE Object. 66 + * Sets R flag in LS Object.
67 * 67 *
68 - * @param bRFlag R flag in TE Object 68 + * @param removeFlag R flag in LS Object
69 */ 69 */
70 - void setRFlag(boolean bRFlag); 70 + void setRemoveFlag(boolean removeFlag);
71 71
72 /** 72 /**
73 - * Returns S flag in TE Object. 73 + * Returns sync flag in LS Object.
74 * 74 *
75 - * @return S flag in TE Object 75 + * @return sync flag in LS Object
76 */ 76 */
77 - boolean getSFlag(); 77 + boolean getSyncFlag();
78 78
79 /** 79 /**
80 - * Sets S flag in TE Object. 80 + * Sets sync flag in LS Object.
81 * 81 *
82 - * @param bSFlag S flag in TE Object 82 + * @param syncFlag sync flag in LS Object
83 */ 83 */
84 - void setSFlag(boolean bSFlag); 84 + void setSyncFlag(boolean syncFlag);
85 85
86 /** 86 /**
87 - * Returns TE ID in TE Object. 87 + * Returns LS ID in LS Object.
88 * 88 *
89 - * @return TE ID in TE Object 89 + * @return LS ID in LS Object
90 */ 90 */
91 - int getTEId(); 91 + long getLSId();
92 92
93 /** 93 /**
94 - * Sets TE ID in TE Object. 94 + * Sets LS ID in LS Object.
95 * 95 *
96 - * @param iTEId TE ID in TE Object 96 + * @param lsId LS ID in LS Object
97 */ 97 */
98 - void setTEId(int iTEId); 98 + void setLSId(long lsId);
99 99
100 /** 100 /**
101 - * Returns list of Optional Tlvs in TE Object. 101 + * Returns list of Optional Tlvs in LS Object.
102 * 102 *
103 * @return list of Optional Tlvs 103 * @return list of Optional Tlvs
104 */ 104 */
105 - LinkedList<PcepValueType> getOptionalTlv(); 105 + List<PcepValueType> getOptionalTlv();
106 106
107 /** 107 /**
108 - * Sets list of Optional Tlvs in TE Object. 108 + * Sets list of Optional Tlvs in LS Object.
109 * 109 *
110 - * @param llOptionalTlv list of Optional Tlvs 110 + * @param optionalTlvList list of Optional Tlvs
111 */ 111 */
112 - void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); 112 + void setOptionalTlv(List<PcepValueType> optionalTlvList);
113 113
114 /** 114 /**
115 - * Writes the TE Object into channel buffer. 115 + * Writes the LS Object into channel buffer.
116 * 116 *
117 * @param bb channel buffer 117 * @param bb channel buffer
118 * @return Returns the writerIndex of this buffer 118 * @return Returns the writerIndex of this buffer
119 - * @throws PcepParseException when obj header is not written to channel buffer 119 + * @throws PcepParseException when object header is not written to channel buffer
120 */ 120 */
121 int write(ChannelBuffer bb) throws PcepParseException; 121 int write(ChannelBuffer bb) throws PcepParseException;
122 122
123 /** 123 /**
124 - * Builder interface with get and set functions to build TE object. 124 + * Builder interface with get and set functions to build LS object.
125 */ 125 */
126 interface Builder { 126 interface Builder {
127 127
128 /** 128 /**
129 - * Builds TE Object. 129 + * Builds LS Object.
130 * 130 *
131 - * @return TE Object 131 + * @return LS Object
132 */ 132 */
133 - PcepTEObject build(); 133 + PcepLSObject build();
134 134
135 /** 135 /**
136 - * Returns TE object header. 136 + * Returns LS object header.
137 * 137 *
138 - * @return TE object header 138 + * @return LS object header
139 */ 139 */
140 - PcepObjectHeader getTEObjHeader(); 140 + PcepObjectHeader getLSObjHeader();
141 141
142 /** 142 /**
143 - * Sets TE object header and returns its builder. 143 + * Sets LS object header and returns its builder.
144 * 144 *
145 - * @param obj TE object header 145 + * @param obj LS object header
146 - * @return Builder by setting TE object header 146 + * @return Builder by setting LS object header
147 */ 147 */
148 - Builder setTEObjHeader(PcepObjectHeader obj); 148 + Builder setLSObjHeader(PcepObjectHeader obj);
149 149
150 /** 150 /**
151 - * Returns ProtocolId in TE Object. 151 + * Returns ProtocolId in LS Object.
152 * 152 *
153 - * @return ProtocolId in TE Object 153 + * @return ProtocolId in LS Object
154 */ 154 */
155 byte getProtocolId(); 155 byte getProtocolId();
156 156
157 /** 157 /**
158 - * Sets ProtocolId in TE Object and returns its builder. 158 + * Sets ProtocolId in LS Object and returns its builder.
159 * 159 *
160 - * @param yProtId ProtocolId in TE Object 160 + * @param protId ProtocolId in LS Object
161 * @return Builder by setting ProtocolId 161 * @return Builder by setting ProtocolId
162 */ 162 */
163 - Builder setProtocolId(byte yProtId); 163 + Builder setProtocolId(byte protId);
164 164
165 /** 165 /**
166 - * Returns R flag in TE Object. 166 + * Returns R flag in LS Object.
167 * 167 *
168 - * @return R flag in TE Object 168 + * @return R flag in LS Object
169 */ 169 */
170 - boolean getRFlag(); 170 + boolean getRemoveFlag();
171 171
172 /** 172 /**
173 - * Sets R flag in TE Object and returns its builder. 173 + * Sets R flag in LS Object and returns its builder.
174 * 174 *
175 - * @param bRFlag R flag in TE Object 175 + * @param removeFlag R flag in LS Object
176 * @return Builder by setting R flag 176 * @return Builder by setting R flag
177 */ 177 */
178 - Builder setRFlag(boolean bRFlag); 178 + Builder setRemoveFlag(boolean removeFlag);
179 179
180 /** 180 /**
181 - * Returns S flag in TE Object. 181 + * Returns sync flag in LS Object.
182 * 182 *
183 - * @return S flag in TE Object 183 + * @return sync flag in LS Object
184 */ 184 */
185 - boolean getSFlag(); 185 + boolean getSyncFlag();
186 186
187 /** 187 /**
188 - * Sets S flag in TE Object and returns its builder. 188 + * Sets sync flag in LS Object and returns its builder.
189 * 189 *
190 - * @param bSFlag S flag in TE Object 190 + * @param syncFlag sync flag in LS Object
191 - * @return Builder by setting S flag 191 + * @return Builder by setting sync flag
192 */ 192 */
193 - Builder setSFlag(boolean bSFlag); 193 + Builder setSyncFlag(boolean syncFlag);
194 194
195 /** 195 /**
196 - * Returns TE ID in TE Object. 196 + * Returns LS ID in LS Object.
197 * 197 *
198 - * @return TE ID in TE Object 198 + * @return LS ID in LS Object
199 */ 199 */
200 - int getTEId(); 200 + long getLSId();
201 201
202 /** 202 /**
203 - * Sets TE ID in TE Object and returns its builder. 203 + * Sets LS ID in LS Object and returns its builder.
204 * 204 *
205 - * @param iTEId TE ID in TE Object 205 + * @param lsId LS ID in LS Object
206 - * @return Builder by setting TE ID 206 + * @return Builder by setting LS ID
207 */ 207 */
208 - Builder setTEId(int iTEId); 208 + Builder setLSId(long lsId);
209 209
210 /** 210 /**
211 - * Returns list of Optional Tlvs in TE Object. 211 + * Returns list of Optional Tlvs in LS Object.
212 * 212 *
213 * @return list of Optional Tlvs 213 * @return list of Optional Tlvs
214 */ 214 */
215 - LinkedList<PcepValueType> getOptionalTlv(); 215 + List<PcepValueType> getOptionalTlv();
216 216
217 /** 217 /**
218 - * Sets list of Optional Tlvs in TE Object and returns its builder. 218 + * Sets list of Optional Tlvs in LS Object and returns its builder.
219 * 219 *
220 - * @param llOptionalTlv list of Optional Tlvs 220 + * @param optionalTlvList list of Optional Tlvs
221 * @return Builder by setting list of Optional Tlvs 221 * @return Builder by setting list of Optional Tlvs
222 */ 222 */
223 - Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); 223 + Builder setOptionalTlv(List<PcepValueType> optionalTlvList);
224 224
225 /** 225 /**
226 - * Sets P flag in TE object header and returns its builder. 226 + * Sets Processing rule flag in LS object header and returns its builder.
227 * 227 *
228 - * @param value boolean value to set P flag 228 + * @param value boolean value to set Processing rule flag
229 - * @return Builder by setting P flag 229 + * @return Builder by setting Processing rule flag
230 */ 230 */
231 Builder setPFlag(boolean value); 231 Builder setPFlag(boolean value);
232 232
233 /** 233 /**
234 - * Sets I flag in TE object header and returns its builder. 234 + * Sets Ignore flag in LS object header and returns its builder.
235 * 235 *
236 - * @param value boolean value to set I flag 236 + * @param value boolean value to set Ignore flag
237 - * @return Builder by setting I flag 237 + * @return Builder by setting Ignore flag
238 */ 238 */
239 Builder setIFlag(boolean value); 239 Builder setIFlag(boolean value);
240 } 240 }
......
...@@ -16,15 +16,15 @@ ...@@ -16,15 +16,15 @@
16 16
17 package org.onosproject.pcepio.protocol; 17 package org.onosproject.pcepio.protocol;
18 18
19 -import java.util.LinkedList; 19 +import java.util.List;
20 20
21 import org.jboss.netty.buffer.ChannelBuffer; 21 import org.jboss.netty.buffer.ChannelBuffer;
22 import org.onosproject.pcepio.exceptions.PcepParseException; 22 import org.onosproject.pcepio.exceptions.PcepParseException;
23 23
24 /** 24 /**
25 - * Abstraction of an entity providing PCEP TE Report Message. 25 + * Abstraction of an entity providing PCEP LS-Report Message.
26 */ 26 */
27 -public interface PcepTEReportMsg extends PcepObject, PcepMessage { 27 +public interface PcepLSReportMsg extends PcepObject, PcepMessage {
28 28
29 @Override 29 @Override
30 PcepVersion getVersion(); 30 PcepVersion getVersion();
...@@ -33,29 +33,29 @@ public interface PcepTEReportMsg extends PcepObject, PcepMessage { ...@@ -33,29 +33,29 @@ public interface PcepTEReportMsg extends PcepObject, PcepMessage {
33 PcepType getType(); 33 PcepType getType();
34 34
35 /** 35 /**
36 - * Returns list of PCEP TE Objects. 36 + * Returns list of PCEP LS Objects.
37 * 37 *
38 - * @return list of PCEP TE Objects 38 + * @return list of PCEP LS Objects
39 */ 39 */
40 - LinkedList<PcepTEObject> getTEReportList(); 40 + List<PcepLSObject> getLSReportList();
41 41
42 /** 42 /**
43 - * Sets list of Optional Tlvs in TE Report Message. 43 + * Sets list of Optional Tlvs in LS-Report Message.
44 * 44 *
45 - * @param llTEReportList list of optional Tlvs 45 + * @param lsReportList list of optional Tlvs
46 */ 46 */
47 - void setTEReportList(LinkedList<PcepTEObject> llTEReportList); 47 + void setLSReportList(List<PcepLSObject> lsReportList);
48 48
49 @Override 49 @Override
50 void writeTo(ChannelBuffer channelBuffer) throws PcepParseException; 50 void writeTo(ChannelBuffer channelBuffer) throws PcepParseException;
51 51
52 /** 52 /**
53 - * Builder interface with get and set functions to build TE Report message. 53 + * Builder interface with get and set functions to build LS-Report message.
54 */ 54 */
55 interface Builder extends PcepMessage.Builder { 55 interface Builder extends PcepMessage.Builder {
56 56
57 @Override 57 @Override
58 - PcepTEReportMsg build(); 58 + PcepLSReportMsg build();
59 59
60 @Override 60 @Override
61 PcepVersion getVersion(); 61 PcepVersion getVersion();
...@@ -64,18 +64,18 @@ public interface PcepTEReportMsg extends PcepObject, PcepMessage { ...@@ -64,18 +64,18 @@ public interface PcepTEReportMsg extends PcepObject, PcepMessage {
64 PcepType getType(); 64 PcepType getType();
65 65
66 /** 66 /**
67 - * Returns list of Optional Tlv in TE Report Message. 67 + * Returns list of LS Object in LS Report Message.
68 * 68 *
69 - * @return list of Optional Tlv 69 + * @return list of LS Objects
70 */ 70 */
71 - LinkedList<PcepTEObject> getTEReportList(); 71 + List<PcepLSObject> getLSReportList();
72 72
73 /** 73 /**
74 - * Sets list of Optional Tlvs and returns its builder. 74 + * Sets list of LS Objects and returns its builder.
75 * 75 *
76 - * @param llTEReportList list of Optional Tlvs 76 + * @param lsReportList list of LS Objects
77 - * @return Builder object for TE report message 77 + * @return Builder object for LS-Report message
78 */ 78 */
79 - Builder setTEReportList(LinkedList<PcepTEObject> llTEReportList); 79 + Builder setLSReportList(List<PcepLSObject> lsReportList);
80 } 80 }
81 } 81 }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
17 package org.onosproject.pcepio.protocol; 17 package org.onosproject.pcepio.protocol;
18 18
19 import org.jboss.netty.buffer.ChannelBuffer; 19 import org.jboss.netty.buffer.ChannelBuffer;
20 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
20 import org.onosproject.pcepio.exceptions.PcepParseException; 21 import org.onosproject.pcepio.exceptions.PcepParseException;
21 22
22 /** 23 /**
...@@ -32,5 +33,5 @@ public interface PcepMessageReader<T> { ...@@ -32,5 +33,5 @@ public interface PcepMessageReader<T> {
32 * @throws PcepParseException while parsing PCEP message. 33 * @throws PcepParseException while parsing PCEP message.
33 * @throws PcepParseException when received message is empty 34 * @throws PcepParseException when received message is empty
34 */ 35 */
35 - T readFrom(ChannelBuffer bb) throws PcepParseException; 36 + T readFrom(ChannelBuffer bb) throws PcepParseException, PcepOutOfBoundMessageException;
36 } 37 }
......
...@@ -22,8 +22,8 @@ package org.onosproject.pcepio.protocol; ...@@ -22,8 +22,8 @@ package org.onosproject.pcepio.protocol;
22 public enum PcepType { 22 public enum PcepType {
23 23
24 NONE(0), OPEN(1), KEEP_ALIVE(2), PATH_COMPUTATION_REQUEST(3), PATH_COMPUTATION_REPLY(4), 24 NONE(0), OPEN(1), KEEP_ALIVE(2), PATH_COMPUTATION_REQUEST(3), PATH_COMPUTATION_REPLY(4),
25 - NOTIFICATION(5), ERROR(6), CLOSE(7), REPORT(10), UPDATE(11), INITIATE(12), LABEL_UPDATE(13), 25 + NOTIFICATION(5), ERROR(6), CLOSE(7), REPORT(10), UPDATE(11), INITIATE(12),
26 - TE_REPORT(14), LABEL_RANGE_RESERV(15), MAX(16), END(17); 26 + LS_REPORT(224), LABEL_RANGE_RESERV(225), LABEL_UPDATE(226), MAX(227), END(228);
27 27
28 int iValue; 28 int iValue;
29 29
......
...@@ -22,7 +22,7 @@ import java.util.ListIterator; ...@@ -22,7 +22,7 @@ import java.util.ListIterator;
22 import org.jboss.netty.buffer.ChannelBuffer; 22 import org.jboss.netty.buffer.ChannelBuffer;
23 import org.onosproject.pcepio.exceptions.PcepParseException; 23 import org.onosproject.pcepio.exceptions.PcepParseException;
24 import org.onosproject.pcepio.protocol.PcepEroObject; 24 import org.onosproject.pcepio.protocol.PcepEroObject;
25 -import org.onosproject.pcepio.types.AutonomousSystemTlv; 25 +import org.onosproject.pcepio.types.AutonomousSystemNumberSubObject;
26 import org.onosproject.pcepio.types.IPv4SubObject; 26 import org.onosproject.pcepio.types.IPv4SubObject;
27 import org.onosproject.pcepio.types.IPv6SubObject; 27 import org.onosproject.pcepio.types.IPv6SubObject;
28 import org.onosproject.pcepio.types.PathKeySubObject; 28 import org.onosproject.pcepio.types.PathKeySubObject;
...@@ -147,32 +147,32 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -147,32 +147,32 @@ public class PcepEroObjectVer1 implements PcepEroObject {
147 public static final int LABEL_SUB_OBJ_TYPE = 3; 147 public static final int LABEL_SUB_OBJ_TYPE = 3;
148 public static final int SR_ERO_SUB_OBJ_TYPE = 96; 148 public static final int SR_ERO_SUB_OBJ_TYPE = 96;
149 public static final int OBJECT_HEADER_LENGTH = 4; 149 public static final int OBJECT_HEADER_LENGTH = 4;
150 - public static final int YTYPE_SHIFT_VALUE = 0x7F; 150 + public static final int TYPE_SHIFT_VALUE = 0x7F;
151 151
152 - static final PcepObjectHeader DEFAULT_ERO_OBJECT_HEADER = new PcepObjectHeader(ERO_OBJ_CLASS, ERO_OBJ_TYPE, 152 + public static final PcepObjectHeader DEFAULT_ERO_OBJECT_HEADER = new PcepObjectHeader(ERO_OBJ_CLASS, ERO_OBJ_TYPE,
153 PcepObjectHeader.REQ_OBJ_OPTIONAL_PROCESS, PcepObjectHeader.RSP_OBJ_PROCESSED, ERO_OBJ_MINIMUM_LENGTH); 153 PcepObjectHeader.REQ_OBJ_OPTIONAL_PROCESS, PcepObjectHeader.RSP_OBJ_PROCESSED, ERO_OBJ_MINIMUM_LENGTH);
154 154
155 private PcepObjectHeader eroObjHeader; 155 private PcepObjectHeader eroObjHeader;
156 - private LinkedList<PcepValueType> llSubObjects = new LinkedList<>(); 156 + private LinkedList<PcepValueType> subObjectList = new LinkedList<>();
157 157
158 /** 158 /**
159 * reset variables. 159 * reset variables.
160 */ 160 */
161 public PcepEroObjectVer1() { 161 public PcepEroObjectVer1() {
162 this.eroObjHeader = null; 162 this.eroObjHeader = null;
163 - this.llSubObjects = null; 163 + this.subObjectList = null;
164 } 164 }
165 165
166 /** 166 /**
167 * Constructor to initialize parameters of ERO object. 167 * Constructor to initialize parameters of ERO object.
168 * 168 *
169 * @param eroObjHeader ERO object header 169 * @param eroObjHeader ERO object header
170 - * @param llSubObjects list of sub objects. 170 + * @param subObjectList list of sub objects.
171 */ 171 */
172 - public PcepEroObjectVer1(PcepObjectHeader eroObjHeader, LinkedList<PcepValueType> llSubObjects) { 172 + public PcepEroObjectVer1(PcepObjectHeader eroObjHeader, LinkedList<PcepValueType> subObjectList) {
173 173
174 this.eroObjHeader = eroObjHeader; 174 this.eroObjHeader = eroObjHeader;
175 - this.llSubObjects = llSubObjects; 175 + this.subObjectList = subObjectList;
176 } 176 }
177 177
178 /** 178 /**
...@@ -195,12 +195,12 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -195,12 +195,12 @@ public class PcepEroObjectVer1 implements PcepEroObject {
195 195
196 @Override 196 @Override
197 public LinkedList<PcepValueType> getSubObjects() { 197 public LinkedList<PcepValueType> getSubObjects() {
198 - return this.llSubObjects; 198 + return this.subObjectList;
199 } 199 }
200 200
201 @Override 201 @Override
202 - public void setSubObjects(LinkedList<PcepValueType> llSubObjects) { 202 + public void setSubObjects(LinkedList<PcepValueType> subObjectList) {
203 - this.llSubObjects = llSubObjects; 203 + this.subObjectList = subObjectList;
204 } 204 }
205 205
206 /** 206 /**
...@@ -213,7 +213,7 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -213,7 +213,7 @@ public class PcepEroObjectVer1 implements PcepEroObject {
213 public static PcepEroObject read(ChannelBuffer cb) throws PcepParseException { 213 public static PcepEroObject read(ChannelBuffer cb) throws PcepParseException {
214 214
215 PcepObjectHeader eroObjHeader; 215 PcepObjectHeader eroObjHeader;
216 - LinkedList<PcepValueType> llSubObjects = new LinkedList<>(); 216 + LinkedList<PcepValueType> subObjectList = new LinkedList<>();
217 217
218 eroObjHeader = PcepObjectHeader.read(cb); 218 eroObjHeader = PcepObjectHeader.read(cb);
219 219
...@@ -225,9 +225,9 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -225,9 +225,9 @@ public class PcepEroObjectVer1 implements PcepEroObject {
225 225
226 if (eroObjHeader.getObjLen() > OBJECT_HEADER_LENGTH) { 226 if (eroObjHeader.getObjLen() > OBJECT_HEADER_LENGTH) {
227 ChannelBuffer tempCb = cb.readBytes(eroObjHeader.getObjLen() - OBJECT_HEADER_LENGTH); 227 ChannelBuffer tempCb = cb.readBytes(eroObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
228 - llSubObjects = parseSubObjects(tempCb); 228 + subObjectList = parseSubObjects(tempCb);
229 } 229 }
230 - return new PcepEroObjectVer1(eroObjHeader, llSubObjects); 230 + return new PcepEroObjectVer1(eroObjHeader, subObjectList);
231 } 231 }
232 232
233 /** 233 /**
...@@ -239,18 +239,18 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -239,18 +239,18 @@ public class PcepEroObjectVer1 implements PcepEroObject {
239 */ 239 */
240 protected static LinkedList<PcepValueType> parseSubObjects(ChannelBuffer cb) throws PcepParseException { 240 protected static LinkedList<PcepValueType> parseSubObjects(ChannelBuffer cb) throws PcepParseException {
241 241
242 - LinkedList<PcepValueType> llSubObjects = new LinkedList<>(); 242 + LinkedList<PcepValueType> subObjectList = new LinkedList<>();
243 243
244 while (0 < cb.readableBytes()) { 244 while (0 < cb.readableBytes()) {
245 245
246 //check the Type of the TLV 246 //check the Type of the TLV
247 - byte yType = cb.readByte(); 247 + short type = cb.readByte();
248 - yType = (byte) (yType & (YTYPE_SHIFT_VALUE)); 248 + type = (short) (type & (TYPE_SHIFT_VALUE));
249 byte hLength = cb.readByte(); 249 byte hLength = cb.readByte();
250 250
251 PcepValueType subObj; 251 PcepValueType subObj;
252 252
253 - switch (yType) { 253 + switch (type) {
254 254
255 case IPv4SubObject.TYPE: 255 case IPv4SubObject.TYPE:
256 subObj = IPv4SubObject.read(cb); 256 subObj = IPv4SubObject.read(cb);
...@@ -260,8 +260,8 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -260,8 +260,8 @@ public class PcepEroObjectVer1 implements PcepEroObject {
260 cb.readBytes(ipv6Value, 0, IPv6SubObject.VALUE_LENGTH); 260 cb.readBytes(ipv6Value, 0, IPv6SubObject.VALUE_LENGTH);
261 subObj = new IPv6SubObject(ipv6Value); 261 subObj = new IPv6SubObject(ipv6Value);
262 break; 262 break;
263 - case AutonomousSystemTlv.TYPE: 263 + case AutonomousSystemNumberSubObject.TYPE:
264 - subObj = AutonomousSystemTlv.read(cb); 264 + subObj = AutonomousSystemNumberSubObject.read(cb);
265 break; 265 break;
266 case PathKeySubObject.TYPE: 266 case PathKeySubObject.TYPE:
267 subObj = PathKeySubObject.read(cb); 267 subObj = PathKeySubObject.read(cb);
...@@ -270,7 +270,7 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -270,7 +270,7 @@ public class PcepEroObjectVer1 implements PcepEroObject {
270 subObj = SrEroSubObject.read(cb); 270 subObj = SrEroSubObject.read(cb);
271 break; 271 break;
272 default: 272 default:
273 - throw new PcepParseException("Unexpected sub object. Type: " + (int) yType); 273 + throw new PcepParseException("Unexpected sub object. Type: " + (int) type);
274 } 274 }
275 // Check for the padding 275 // Check for the padding
276 int pad = hLength % 4; 276 int pad = hLength % 4;
...@@ -281,12 +281,12 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -281,12 +281,12 @@ public class PcepEroObjectVer1 implements PcepEroObject {
281 } 281 }
282 } 282 }
283 283
284 - llSubObjects.add(subObj); 284 + subObjectList.add(subObj);
285 } 285 }
286 if (0 < cb.readableBytes()) { 286 if (0 < cb.readableBytes()) {
287 throw new PcepParseException("Subobject parsing error. Extra bytes received."); 287 throw new PcepParseException("Subobject parsing error. Extra bytes received.");
288 } 288 }
289 - return llSubObjects; 289 + return subObjectList;
290 } 290 }
291 291
292 @Override 292 @Override
...@@ -301,7 +301,7 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -301,7 +301,7 @@ public class PcepEroObjectVer1 implements PcepEroObject {
301 throw new PcepParseException("Failed to write ERO object header. Index " + objLenIndex); 301 throw new PcepParseException("Failed to write ERO object header. Index " + objLenIndex);
302 } 302 }
303 303
304 - ListIterator<PcepValueType> listIterator = llSubObjects.listIterator(); 304 + ListIterator<PcepValueType> listIterator = subObjectList.listIterator();
305 305
306 while (listIterator.hasNext()) { 306 while (listIterator.hasNext()) {
307 listIterator.next().write(cb); 307 listIterator.next().write(cb);
...@@ -342,7 +342,7 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -342,7 +342,7 @@ public class PcepEroObjectVer1 implements PcepEroObject {
342 private boolean bIFlag; 342 private boolean bIFlag;
343 343
344 private PcepObjectHeader eroObjHeader; 344 private PcepObjectHeader eroObjHeader;
345 - LinkedList<PcepValueType> llSubObjects = new LinkedList<>(); 345 + LinkedList<PcepValueType> subObjectList = new LinkedList<>();
346 346
347 @Override 347 @Override
348 public PcepEroObject build() { 348 public PcepEroObject build() {
...@@ -357,7 +357,7 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -357,7 +357,7 @@ public class PcepEroObjectVer1 implements PcepEroObject {
357 eroObjHeader.setIFlag(bIFlag); 357 eroObjHeader.setIFlag(bIFlag);
358 } 358 }
359 359
360 - return new PcepEroObjectVer1(eroObjHeader, this.llSubObjects); 360 + return new PcepEroObjectVer1(eroObjHeader, this.subObjectList);
361 } 361 }
362 362
363 @Override 363 @Override
...@@ -374,12 +374,12 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -374,12 +374,12 @@ public class PcepEroObjectVer1 implements PcepEroObject {
374 374
375 @Override 375 @Override
376 public LinkedList<PcepValueType> getSubObjects() { 376 public LinkedList<PcepValueType> getSubObjects() {
377 - return this.llSubObjects; 377 + return this.subObjectList;
378 } 378 }
379 379
380 @Override 380 @Override
381 - public Builder setSubObjects(LinkedList<PcepValueType> llSubObjects) { 381 + public Builder setSubObjects(LinkedList<PcepValueType> subObjectList) {
382 - this.llSubObjects = llSubObjects; 382 + this.subObjectList = subObjectList;
383 return this; 383 return this;
384 } 384 }
385 385
...@@ -400,8 +400,9 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -400,8 +400,9 @@ public class PcepEroObjectVer1 implements PcepEroObject {
400 400
401 @Override 401 @Override
402 public String toString() { 402 public String toString() {
403 - return MoreObjects.toStringHelper(getClass()) 403 + return MoreObjects.toStringHelper(getClass()).omitNullValues()
404 - .add("EroObjHeader", eroObjHeader).add("SubObjects", llSubObjects) 404 + .add("EroObjHeader", eroObjHeader)
405 + .add("SubObjects", subObjectList)
405 .toString(); 406 .toString();
406 } 407 }
407 } 408 }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
16 package org.onosproject.pcepio.protocol.ver1; 16 package org.onosproject.pcepio.protocol.ver1;
17 17
18 import java.util.LinkedList; 18 import java.util.LinkedList;
19 +import java.util.List;
19 import java.util.ListIterator; 20 import java.util.ListIterator;
20 21
21 import org.jboss.netty.buffer.ChannelBuffer; 22 import org.jboss.netty.buffer.ChannelBuffer;
...@@ -24,7 +25,7 @@ import org.onosproject.pcepio.protocol.PcepError; ...@@ -24,7 +25,7 @@ import org.onosproject.pcepio.protocol.PcepError;
24 import org.onosproject.pcepio.protocol.PcepErrorInfo; 25 import org.onosproject.pcepio.protocol.PcepErrorInfo;
25 import org.onosproject.pcepio.protocol.PcepErrorObject; 26 import org.onosproject.pcepio.protocol.PcepErrorObject;
26 import org.onosproject.pcepio.protocol.PcepRPObject; 27 import org.onosproject.pcepio.protocol.PcepRPObject;
27 -import org.onosproject.pcepio.protocol.PcepTEObject; 28 +import org.onosproject.pcepio.protocol.PcepLSObject;
28 import org.onosproject.pcepio.types.PcepObjectHeader; 29 import org.onosproject.pcepio.types.PcepObjectHeader;
29 import org.slf4j.Logger; 30 import org.slf4j.Logger;
30 import org.slf4j.LoggerFactory; 31 import org.slf4j.LoggerFactory;
...@@ -33,26 +34,26 @@ import com.google.common.base.MoreObjects; ...@@ -33,26 +34,26 @@ import com.google.common.base.MoreObjects;
33 34
34 /** 35 /**
35 * Provides PCEP Error Info. 36 * Provides PCEP Error Info.
36 - * Reference :PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02. 37 + * Reference : draft-dhodylee-pce-pcep-ls-01, section 8.2.
37 */ 38 */
38 public class PcepErrorInfoVer1 implements PcepErrorInfo { 39 public class PcepErrorInfoVer1 implements PcepErrorInfo {
39 40
40 protected static final Logger log = LoggerFactory.getLogger(PcepErrorInfoVer1.class); 41 protected static final Logger log = LoggerFactory.getLogger(PcepErrorInfoVer1.class);
41 //Error list is optional 42 //Error list is optional
42 - private LinkedList<PcepError> errList; 43 + private List<PcepError> errList;
43 44
44 /** 45 /**
45 * Constructor to add PCEP error object to the list. 46 * Constructor to add PCEP error object to the list.
46 * 47 *
47 * @param llRPObjList list of PCEP RP object 48 * @param llRPObjList list of PCEP RP object
48 - * @param llTEObjList list of PCEP TE object 49 + * @param llLSObjList list of PCEP LS object
49 * @param llErrObjList list of PCEP error object 50 * @param llErrObjList list of PCEP error object
50 */ 51 */
51 - public PcepErrorInfoVer1(LinkedList<PcepRPObject> llRPObjList, LinkedList<PcepTEObject> llTEObjList, 52 + public PcepErrorInfoVer1(List<PcepRPObject> llRPObjList, List<PcepLSObject> llLSObjList,
52 - LinkedList<PcepErrorObject> llErrObjList) { 53 + List<PcepErrorObject> llErrObjList) {
53 this.errList = new LinkedList<>(); 54 this.errList = new LinkedList<>();
54 if ((llErrObjList != null) && (!llErrObjList.isEmpty())) { 55 if ((llErrObjList != null) && (!llErrObjList.isEmpty())) {
55 - this.errList.add(new PcepErrorVer1(llRPObjList, llTEObjList, llErrObjList)); 56 + this.errList.add(new PcepErrorVer1(llRPObjList, llLSObjList, llErrObjList));
56 } 57 }
57 } 58 }
58 59
...@@ -61,7 +62,7 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo { ...@@ -61,7 +62,7 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo {
61 * 62 *
62 * @param errll linked list or pcep error 63 * @param errll linked list or pcep error
63 */ 64 */
64 - public PcepErrorInfoVer1(LinkedList<PcepError> errll) { 65 + public PcepErrorInfoVer1(List<PcepError> errll) {
65 this.errList = errll; 66 this.errList = errll;
66 } 67 }
67 68
...@@ -79,7 +80,7 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo { ...@@ -79,7 +80,7 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo {
79 tempObjHeader = PcepObjectHeader.read(cb); 80 tempObjHeader = PcepObjectHeader.read(cb);
80 cb.resetReaderIndex(); 81 cb.resetReaderIndex();
81 byte yObjClass = tempObjHeader.getObjClass(); 82 byte yObjClass = tempObjHeader.getObjClass();
82 - if ((yObjClass != PcepRPObjectVer1.RP_OBJ_CLASS) && (yObjClass != PcepTEObjectVer1.TE_OBJ_CLASS) 83 + if ((yObjClass != PcepRPObjectVer1.RP_OBJ_CLASS) && (yObjClass != PcepLSObjectVer1.LS_OBJ_CLASS)
83 && (yObjClass != PcepErrorObjectVer1.ERROR_OBJ_CLASS)) { 84 && (yObjClass != PcepErrorObjectVer1.ERROR_OBJ_CLASS)) {
84 throw new PcepParseException("Unknown Object is present in PCEP-ERROR. Object Class: " + yObjClass); 85 throw new PcepParseException("Unknown Object is present in PCEP-ERROR. Object Class: " + yObjClass);
85 } 86 }
...@@ -96,7 +97,7 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo { ...@@ -96,7 +97,7 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo {
96 PcepError pcepError = listIterator.next(); 97 PcepError pcepError = listIterator.next();
97 98
98 //RP Object list is optional 99 //RP Object list is optional
99 - LinkedList<PcepRPObject> llRPObjList = pcepError.getRPObjList(); 100 + List<PcepRPObject> llRPObjList = pcepError.getRPObjList();
100 if (llRPObjList != null) { 101 if (llRPObjList != null) {
101 ListIterator<PcepRPObject> rpListIterator = llRPObjList.listIterator(); 102 ListIterator<PcepRPObject> rpListIterator = llRPObjList.listIterator();
102 while (rpListIterator.hasNext()) { 103 while (rpListIterator.hasNext()) {
...@@ -104,10 +105,10 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo { ...@@ -104,10 +105,10 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo {
104 } 105 }
105 } 106 }
106 107
107 - //TE Object list is optional 108 + //LS Object list is optional
108 - LinkedList<PcepTEObject> llTEObjList = pcepError.getTEObjList(); 109 + List<PcepLSObject> llLSObjList = pcepError.getLSObjList();
109 - if (llTEObjList != null) { 110 + if (llLSObjList != null) {
110 - ListIterator<PcepTEObject> teListIterator = llTEObjList.listIterator(); 111 + ListIterator<PcepLSObject> teListIterator = llLSObjList.listIterator();
111 while (teListIterator.hasNext()) { 112 while (teListIterator.hasNext()) {
112 teListIterator.next().write(cb); 113 teListIterator.next().write(cb);
113 } 114 }
...@@ -116,7 +117,7 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo { ...@@ -116,7 +117,7 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo {
116 // <error-obj-list> is mandatory 117 // <error-obj-list> is mandatory
117 boolean bIsErrorObjListFound = false; 118 boolean bIsErrorObjListFound = false;
118 119
119 - LinkedList<PcepErrorObject> llErrObjList = pcepError.getErrorObjList(); 120 + List<PcepErrorObject> llErrObjList = pcepError.getErrorObjList();
120 if (llErrObjList != null) { 121 if (llErrObjList != null) {
121 ListIterator<PcepErrorObject> errObjListIterator = llErrObjList.listIterator(); 122 ListIterator<PcepErrorObject> errObjListIterator = llErrObjList.listIterator();
122 while (errObjListIterator.hasNext()) { 123 while (errObjListIterator.hasNext()) {
...@@ -132,14 +133,14 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo { ...@@ -132,14 +133,14 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo {
132 } 133 }
133 134
134 @Override 135 @Override
135 - public LinkedList<Integer> getErrorType() { 136 + public List<Integer> getErrorType() {
136 - LinkedList<Integer> errorType = new LinkedList<>(); 137 + List<Integer> errorType = new LinkedList<>();
137 ListIterator<PcepError> listIterator = errList.listIterator(); 138 ListIterator<PcepError> listIterator = errList.listIterator();
138 PcepErrorObject errObj; 139 PcepErrorObject errObj;
139 int error; 140 int error;
140 while (listIterator.hasNext()) { 141 while (listIterator.hasNext()) {
141 PcepError pcepError = listIterator.next(); 142 PcepError pcepError = listIterator.next();
142 - LinkedList<PcepErrorObject> llErrObjList = pcepError.getErrorObjList(); 143 + List<PcepErrorObject> llErrObjList = pcepError.getErrorObjList();
143 if (llErrObjList != null) { 144 if (llErrObjList != null) {
144 ListIterator<PcepErrorObject> errObjListIterator = llErrObjList.listIterator(); 145 ListIterator<PcepErrorObject> errObjListIterator = llErrObjList.listIterator();
145 while (errObjListIterator.hasNext()) { 146 while (errObjListIterator.hasNext()) {
...@@ -153,14 +154,14 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo { ...@@ -153,14 +154,14 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo {
153 } 154 }
154 155
155 @Override 156 @Override
156 - public LinkedList<Integer> getErrorValue() { 157 + public List<Integer> getErrorValue() {
157 - LinkedList<Integer> errorValue = new LinkedList<>(); 158 + List<Integer> errorValue = new LinkedList<>();
158 ListIterator<PcepError> listIterator = errList.listIterator(); 159 ListIterator<PcepError> listIterator = errList.listIterator();
159 PcepErrorObject errObj; 160 PcepErrorObject errObj;
160 int error; 161 int error;
161 while (listIterator.hasNext()) { 162 while (listIterator.hasNext()) {
162 PcepError pcepError = listIterator.next(); 163 PcepError pcepError = listIterator.next();
163 - LinkedList<PcepErrorObject> llErrObjList = pcepError.getErrorObjList(); 164 + List<PcepErrorObject> llErrObjList = pcepError.getErrorObjList();
164 if (llErrObjList != null) { 165 if (llErrObjList != null) {
165 ListIterator<PcepErrorObject> errObjListIterator = llErrObjList.listIterator(); 166 ListIterator<PcepErrorObject> errObjListIterator = llErrObjList.listIterator();
166 while (errObjListIterator.hasNext()) { 167 while (errObjListIterator.hasNext()) {
...@@ -177,7 +178,7 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo { ...@@ -177,7 +178,7 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo {
177 * Builder class for PCEP error info. 178 * Builder class for PCEP error info.
178 */ 179 */
179 public static class Builder implements PcepErrorInfo.Builder { 180 public static class Builder implements PcepErrorInfo.Builder {
180 - private LinkedList<PcepError> errll; 181 + private List<PcepError> errll;
181 182
182 @Override 183 @Override
183 public PcepErrorInfo build() { 184 public PcepErrorInfo build() {
...@@ -185,12 +186,12 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo { ...@@ -185,12 +186,12 @@ public class PcepErrorInfoVer1 implements PcepErrorInfo {
185 } 186 }
186 187
187 @Override 188 @Override
188 - public LinkedList<PcepError> getPcepErrorList() { 189 + public List<PcepError> getPcepErrorList() {
189 return this.errll; 190 return this.errll;
190 } 191 }
191 192
192 @Override 193 @Override
193 - public Builder setPcepErrorList(LinkedList<PcepError> errll) { 194 + public Builder setPcepErrorList(List<PcepError> errll) {
194 this.errll = errll; 195 this.errll = errll;
195 return this; 196 return this;
196 } 197 }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
16 package org.onosproject.pcepio.protocol.ver1; 16 package org.onosproject.pcepio.protocol.ver1;
17 17
18 import java.util.LinkedList; 18 import java.util.LinkedList;
19 +import java.util.List;
19 20
20 import org.jboss.netty.buffer.ChannelBuffer; 21 import org.jboss.netty.buffer.ChannelBuffer;
21 import org.onosproject.pcepio.exceptions.PcepParseException; 22 import org.onosproject.pcepio.exceptions.PcepParseException;
...@@ -42,6 +43,7 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg { ...@@ -42,6 +43,7 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg {
42 43
43 /* 44 /*
44 * PCE Error message format. 45 * PCE Error message format.
46 + Reference: draft-dhodylee-pce-pcep-ls-01, section 8.2.
45 47
46 <PCErr Message> ::= <Common Header> 48 <PCErr Message> ::= <Common Header>
47 ( <error-obj-list> [<Open>] ) | <error> 49 ( <error-obj-list> [<Open>] ) | <error>
...@@ -49,12 +51,12 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg { ...@@ -49,12 +51,12 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg {
49 51
50 <error-obj-list> ::=<PCEP-ERROR>[<error-obj-list>] 52 <error-obj-list> ::=<PCEP-ERROR>[<error-obj-list>]
51 53
52 - <error> ::=[<request-id-list> | <te-id-list>] 54 + <error> ::=[<request-id-list> | <ls-id-list>]
53 <error-obj-list> 55 <error-obj-list>
54 56
55 <request-id-list> ::=<RP>[<request-id-list>] 57 <request-id-list> ::=<RP>[<request-id-list>]
56 58
57 - <te-id-list> ::=<TE>[<te-id-list>] 59 + <ls-id-list> ::=<LS>[<ls-id-list>]
58 60
59 <error-list> ::=<error>[<error-list>] 61 <error-list> ::=<error>[<error-list>]
60 */ 62 */
...@@ -71,7 +73,7 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg { ...@@ -71,7 +73,7 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg {
71 public static final PcepErrorMsgVer1.Reader READER = new Reader(); 73 public static final PcepErrorMsgVer1.Reader READER = new Reader();
72 74
73 /** 75 /**
74 - * constructor to initialize variables. 76 + * Constructor to initialize variables.
75 */ 77 */
76 public PcepErrorMsgVer1() { 78 public PcepErrorMsgVer1() {
77 errObjListWithOpen = null; 79 errObjListWithOpen = null;
...@@ -128,7 +130,7 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg { ...@@ -128,7 +130,7 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg {
128 //parse <PCErr Message> 130 //parse <PCErr Message>
129 parsePCErrMsg(cb); 131 parsePCErrMsg(cb);
130 132
131 - // If other than RP or TE or PCEP-ERROR present then it is error. 133 + // If other than RP or LS or PCEP-ERROR present then it is error.
132 if (0 < cb.readableBytes()) { 134 if (0 < cb.readableBytes()) {
133 PcepObjectHeader tempObjHeader = PcepObjectHeader.read(cb); 135 PcepObjectHeader tempObjHeader = PcepObjectHeader.read(cb);
134 throw new PcepParseException("Unexpected Object found. Object Class : " + tempObjHeader.getObjClass()); 136 throw new PcepParseException("Unexpected Object found. Object Class : " + tempObjHeader.getObjClass());
...@@ -147,10 +149,10 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg { ...@@ -147,10 +149,10 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg {
147 public void parsePCErrMsg(ChannelBuffer cb) throws PcepParseException { 149 public void parsePCErrMsg(ChannelBuffer cb) throws PcepParseException {
148 //If PCEP-ERROR list is followed by OPEN Object then store into ErrorObjListWithOpen. 150 //If PCEP-ERROR list is followed by OPEN Object then store into ErrorObjListWithOpen.
149 // ( <error-obj-list> [<Open>] 151 // ( <error-obj-list> [<Open>]
150 - //If PCEP-ERROR list is followed by RP or TE Object then store into errInfo. <error> [<error-list>] 152 + //If PCEP-ERROR list is followed by RP or LS Object then store into errInfo. <error> [<error-list>]
151 //If only PCEP-ERROR list is present then store into ErrorObjListWithOpen. 153 //If only PCEP-ERROR list is present then store into ErrorObjListWithOpen.
152 PcepObjectHeader tempObjHeader; 154 PcepObjectHeader tempObjHeader;
153 - LinkedList<PcepErrorObject> llErrObjList; 155 + List<PcepErrorObject> llErrObjList;
154 156
155 if (0 >= cb.readableBytes()) { 157 if (0 >= cb.readableBytes()) {
156 throw new PcepParseException("PCEP-ERROR message came with empty objects."); 158 throw new PcepParseException("PCEP-ERROR message came with empty objects.");
...@@ -171,9 +173,9 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg { ...@@ -171,9 +173,9 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg {
171 PcepOpenObject pcepOpenObj = PcepOpenObjectVer1.read(cb); 173 PcepOpenObject pcepOpenObj = PcepOpenObjectVer1.read(cb);
172 this.errObjListWithOpen = new ErrorObjListWithOpen(llErrObjList, pcepOpenObj); 174 this.errObjListWithOpen = new ErrorObjListWithOpen(llErrObjList, pcepOpenObj);
173 175
174 - } else if ((tempObjHeader != null) //check whether RP or TE Object is present. 176 + } else if ((tempObjHeader != null) //check whether RP or LS Object is present.
175 && ((tempObjHeader.getObjClass() == PcepRPObjectVer1.RP_OBJ_CLASS) 177 && ((tempObjHeader.getObjClass() == PcepRPObjectVer1.RP_OBJ_CLASS)
176 - || (tempObjHeader.getObjClass() == PcepTEObjectVer1.TE_OBJ_CLASS))) { 178 + || (tempObjHeader.getObjClass() == PcepLSObjectVer1.LS_OBJ_CLASS))) {
177 179
178 this.errInfo = new PcepErrorInfoVer1(null, null, llErrObjList); 180 this.errInfo = new PcepErrorInfoVer1(null, null, llErrObjList);
179 this.errInfo.read(cb); 181 this.errInfo.read(cb);
...@@ -194,7 +196,7 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg { ...@@ -194,7 +196,7 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg {
194 * @throws PcepParseException if mandatory fields are missing 196 * @throws PcepParseException if mandatory fields are missing
195 * @return error object header 197 * @return error object header
196 */ 198 */
197 - public PcepObjectHeader parseErrorObjectList(LinkedList<PcepErrorObject> llErrObjList, ChannelBuffer cb) 199 + public PcepObjectHeader parseErrorObjectList(List<PcepErrorObject> llErrObjList, ChannelBuffer cb)
198 throws PcepParseException { 200 throws PcepParseException {
199 PcepObjectHeader tempObjHeader = null; 201 PcepObjectHeader tempObjHeader = null;
200 202
...@@ -337,8 +339,8 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg { ...@@ -337,8 +339,8 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg {
337 * 339 *
338 * @return error types list 340 * @return error types list
339 */ 341 */
340 - public LinkedList<Integer> getErrorType() { 342 + public List<Integer> getErrorType() {
341 - LinkedList<Integer> llErrorType = new LinkedList<>(); 343 + List<Integer> llErrorType = new LinkedList<>();
342 if ((errObjListWithOpen != null) 344 if ((errObjListWithOpen != null)
343 && (errObjListWithOpen.isErrorObjListWithOpenPresent())) { 345 && (errObjListWithOpen.isErrorObjListWithOpenPresent())) {
344 llErrorType = errObjListWithOpen.getErrorType(); 346 llErrorType = errObjListWithOpen.getErrorType();
...@@ -354,8 +356,8 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg { ...@@ -354,8 +356,8 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg {
354 * 356 *
355 * @return error value list 357 * @return error value list
356 */ 358 */
357 - public LinkedList<Integer> getErrorValue() { 359 + public List<Integer> getErrorValue() {
358 - LinkedList<Integer> llErrorValue = new LinkedList<>(); 360 + List<Integer> llErrorValue = new LinkedList<>();
359 if ((errObjListWithOpen != null) 361 if ((errObjListWithOpen != null)
360 && (errObjListWithOpen.isErrorObjListWithOpenPresent())) { 362 && (errObjListWithOpen.isErrorObjListWithOpenPresent())) {
361 llErrorValue = errObjListWithOpen.getErrorValue(); 363 llErrorValue = errObjListWithOpen.getErrorValue();
...@@ -368,7 +370,7 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg { ...@@ -368,7 +370,7 @@ public class PcepErrorMsgVer1 implements PcepErrorMsg {
368 370
369 @Override 371 @Override
370 public String toString() { 372 public String toString() {
371 - ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass()); 373 + ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass()).omitNullValues();
372 374
373 if ((errObjListWithOpen != null) 375 if ((errObjListWithOpen != null)
374 && (errObjListWithOpen.isErrorObjListWithOpenPresent())) { 376 && (errObjListWithOpen.isErrorObjListWithOpenPresent())) {
......
...@@ -60,25 +60,25 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { ...@@ -60,25 +60,25 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
60 ERROR_OBJ_MINIMUM_LENGTH); 60 ERROR_OBJ_MINIMUM_LENGTH);
61 61
62 private PcepObjectHeader errorObjHeader; 62 private PcepObjectHeader errorObjHeader;
63 - private byte yErrorType; 63 + private byte errorType;
64 - private byte yErrorValue; 64 + private byte errorValue;
65 - private LinkedList<PcepValueType> llOptionalTlv; // Optional TLV 65 + private LinkedList<PcepValueType> optionalTlv; // Optional TLV
66 66
67 /** 67 /**
68 * Constructor to initialize variables. 68 * Constructor to initialize variables.
69 * 69 *
70 * @param errorObjHeader ERROR Object header 70 * @param errorObjHeader ERROR Object header
71 - * @param yErrorType Error Type 71 + * @param errorType Error Type
72 - * @param yErrorValue Error Value 72 + * @param errorValue Error Value
73 - * @param llOptionalTlv list of optional TLV 73 + * @param optionalTlv list of optional TLV
74 */ 74 */
75 75
76 - public PcepErrorObjectVer1(PcepObjectHeader errorObjHeader, byte yErrorType, byte yErrorValue, 76 + public PcepErrorObjectVer1(PcepObjectHeader errorObjHeader, byte errorType, byte errorValue,
77 - LinkedList<PcepValueType> llOptionalTlv) { 77 + LinkedList<PcepValueType> optionalTlv) {
78 this.errorObjHeader = errorObjHeader; 78 this.errorObjHeader = errorObjHeader;
79 - this.yErrorType = yErrorType; 79 + this.errorType = errorType;
80 - this.yErrorValue = yErrorValue; 80 + this.errorValue = errorValue;
81 - this.llOptionalTlv = llOptionalTlv; 81 + this.optionalTlv = optionalTlv;
82 } 82 }
83 83
84 /** 84 /**
...@@ -91,13 +91,13 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { ...@@ -91,13 +91,13 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
91 } 91 }
92 92
93 @Override 93 @Override
94 - public void setErrorType(byte yErrorType) { 94 + public void setErrorType(byte errorType) {
95 - this.yErrorType = yErrorType; 95 + this.errorType = errorType;
96 } 96 }
97 97
98 @Override 98 @Override
99 - public void setErrorValue(byte yErrorValue) { 99 + public void setErrorValue(byte errorValue) {
100 - this.yErrorValue = yErrorValue; 100 + this.errorValue = errorValue;
101 } 101 }
102 102
103 /** 103 /**
...@@ -111,22 +111,22 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { ...@@ -111,22 +111,22 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
111 111
112 @Override 112 @Override
113 public int getErrorType() { 113 public int getErrorType() {
114 - return this.yErrorType; 114 + return this.errorType;
115 } 115 }
116 116
117 @Override 117 @Override
118 public byte getErrorValue() { 118 public byte getErrorValue() {
119 - return this.yErrorValue; 119 + return this.errorValue;
120 } 120 }
121 121
122 @Override 122 @Override
123 public LinkedList<PcepValueType> getOptionalTlv() { 123 public LinkedList<PcepValueType> getOptionalTlv() {
124 - return this.llOptionalTlv; 124 + return this.optionalTlv;
125 } 125 }
126 126
127 @Override 127 @Override
128 - public void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv) { 128 + public void setOptionalTlv(LinkedList<PcepValueType> optionalTlv) {
129 - this.llOptionalTlv = llOptionalTlv; 129 + this.optionalTlv = optionalTlv;
130 } 130 }
131 131
132 /** 132 /**
...@@ -138,9 +138,9 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { ...@@ -138,9 +138,9 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
138 public static PcepErrorObject read(ChannelBuffer cb) { 138 public static PcepErrorObject read(ChannelBuffer cb) {
139 139
140 PcepObjectHeader errorObjHeader; 140 PcepObjectHeader errorObjHeader;
141 - byte yErrorType; 141 + byte errorType;
142 - byte yErrorValue; 142 + byte errorValue;
143 - LinkedList<PcepValueType> llOptionalTlv; 143 + LinkedList<PcepValueType> optionalTlv;
144 144
145 errorObjHeader = PcepObjectHeader.read(cb); 145 errorObjHeader = PcepObjectHeader.read(cb);
146 146
...@@ -148,12 +148,12 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { ...@@ -148,12 +148,12 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
148 ChannelBuffer tempCb = cb.readBytes(errorObjHeader.getObjLen() - OBJECT_HEADER_LENGTH); 148 ChannelBuffer tempCb = cb.readBytes(errorObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
149 tempCb.readByte(); //ignore Reserved 149 tempCb.readByte(); //ignore Reserved
150 tempCb.readByte(); //ignore Flags 150 tempCb.readByte(); //ignore Flags
151 - yErrorType = tempCb.readByte(); 151 + errorType = tempCb.readByte();
152 - yErrorValue = tempCb.readByte(); 152 + errorValue = tempCb.readByte();
153 153
154 - llOptionalTlv = parseOptionalTlv(tempCb); 154 + optionalTlv = parseOptionalTlv(tempCb);
155 155
156 - return new PcepErrorObjectVer1(errorObjHeader, yErrorType, yErrorValue, llOptionalTlv); 156 + return new PcepErrorObjectVer1(errorObjHeader, errorType, errorValue, optionalTlv);
157 } 157 }
158 158
159 /** 159 /**
...@@ -189,8 +189,8 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { ...@@ -189,8 +189,8 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
189 //write Flags 189 //write Flags
190 cb.writeByte(0); 190 cb.writeByte(0);
191 //write ErrorType and ErrorValue 191 //write ErrorType and ErrorValue
192 - cb.writeByte(this.yErrorType); 192 + cb.writeByte(this.errorType);
193 - cb.writeByte(this.yErrorValue); 193 + cb.writeByte(this.errorValue);
194 194
195 // Add optional TLV 195 // Add optional TLV
196 packOptionalTlv(cb); 196 packOptionalTlv(cb);
...@@ -222,7 +222,7 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { ...@@ -222,7 +222,7 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
222 */ 222 */
223 protected int packOptionalTlv(ChannelBuffer cb) { 223 protected int packOptionalTlv(ChannelBuffer cb) {
224 224
225 - ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator(); 225 + ListIterator<PcepValueType> listIterator = optionalTlv.listIterator();
226 int startIndex = cb.writerIndex(); 226 int startIndex = cb.writerIndex();
227 while (listIterator.hasNext()) { 227 while (listIterator.hasNext()) {
228 PcepValueType tlv = listIterator.next(); 228 PcepValueType tlv = listIterator.next();
...@@ -245,8 +245,8 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { ...@@ -245,8 +245,8 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
245 private boolean bIsHeaderSet = false; 245 private boolean bIsHeaderSet = false;
246 246
247 private PcepObjectHeader errorObjHeader; 247 private PcepObjectHeader errorObjHeader;
248 - private byte yErrorType; 248 + private byte errorType;
249 - private byte yErrorValue; 249 + private byte errorValue;
250 250
251 private boolean bIsPFlagSet = false; 251 private boolean bIsPFlagSet = false;
252 private boolean bPFlag; 252 private boolean bPFlag;
...@@ -254,7 +254,7 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { ...@@ -254,7 +254,7 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
254 private boolean bIsIFlagSet = false; 254 private boolean bIsIFlagSet = false;
255 private boolean bIFlag; 255 private boolean bIFlag;
256 256
257 - private LinkedList<PcepValueType> llOptionalTlv = new LinkedList<>(); 257 + private LinkedList<PcepValueType> optionalTlv = new LinkedList<>();
258 258
259 @Override 259 @Override
260 public PcepErrorObject build() { 260 public PcepErrorObject build() {
...@@ -269,7 +269,7 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { ...@@ -269,7 +269,7 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
269 errorObjHeader.setIFlag(bIFlag); 269 errorObjHeader.setIFlag(bIFlag);
270 } 270 }
271 271
272 - return new PcepErrorObjectVer1(errorObjHeader, yErrorType, yErrorValue, llOptionalTlv); 272 + return new PcepErrorObjectVer1(errorObjHeader, errorType, errorValue, optionalTlv);
273 } 273 }
274 274
275 @Override 275 @Override
...@@ -286,35 +286,35 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { ...@@ -286,35 +286,35 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
286 286
287 @Override 287 @Override
288 public int getErrorType() { 288 public int getErrorType() {
289 - return this.yErrorType; 289 + return this.errorType;
290 } 290 }
291 291
292 @Override 292 @Override
293 public Builder setErrorType(byte value) { 293 public Builder setErrorType(byte value) {
294 - this.yErrorType = value; 294 + this.errorType = value;
295 return this; 295 return this;
296 } 296 }
297 297
298 @Override 298 @Override
299 public byte getErrorValue() { 299 public byte getErrorValue() {
300 - return this.yErrorValue; 300 + return this.errorValue;
301 } 301 }
302 302
303 @Override 303 @Override
304 public Builder setErrorValue(byte value) { 304 public Builder setErrorValue(byte value) {
305 - this.yErrorValue = value; 305 + this.errorValue = value;
306 return this; 306 return this;
307 } 307 }
308 308
309 @Override 309 @Override
310 - public Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv) { 310 + public Builder setOptionalTlv(LinkedList<PcepValueType> optionalTlv) {
311 - this.llOptionalTlv = llOptionalTlv; 311 + this.optionalTlv = optionalTlv;
312 return this; 312 return this;
313 } 313 }
314 314
315 @Override 315 @Override
316 public LinkedList<PcepValueType> getOptionalTlv() { 316 public LinkedList<PcepValueType> getOptionalTlv() {
317 - return this.llOptionalTlv; 317 + return this.optionalTlv;
318 } 318 }
319 319
320 @Override 320 @Override
...@@ -335,7 +335,7 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { ...@@ -335,7 +335,7 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
335 @Override 335 @Override
336 public String toString() { 336 public String toString() {
337 return MoreObjects.toStringHelper(getClass()) 337 return MoreObjects.toStringHelper(getClass())
338 - .add("ObjectHeader", errorObjHeader).add("ErrorType", yErrorType) 338 + .add("ObjectHeader", errorObjHeader).add("ErrorType", errorType)
339 - .add("ErrorValue", yErrorValue).add("OptionalTlv", llOptionalTlv).toString(); 339 + .add("ErrorValue", errorValue).add("OptionalTlv", optionalTlv).toString();
340 } 340 }
341 } 341 }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
16 package org.onosproject.pcepio.protocol.ver1; 16 package org.onosproject.pcepio.protocol.ver1;
17 17
18 import java.util.LinkedList; 18 import java.util.LinkedList;
19 +import java.util.List;
19 import java.util.ListIterator; 20 import java.util.ListIterator;
20 21
21 import org.jboss.netty.buffer.ChannelBuffer; 22 import org.jboss.netty.buffer.ChannelBuffer;
...@@ -23,7 +24,7 @@ import org.onosproject.pcepio.exceptions.PcepParseException; ...@@ -23,7 +24,7 @@ import org.onosproject.pcepio.exceptions.PcepParseException;
23 import org.onosproject.pcepio.protocol.PcepError; 24 import org.onosproject.pcepio.protocol.PcepError;
24 import org.onosproject.pcepio.protocol.PcepErrorObject; 25 import org.onosproject.pcepio.protocol.PcepErrorObject;
25 import org.onosproject.pcepio.protocol.PcepRPObject; 26 import org.onosproject.pcepio.protocol.PcepRPObject;
26 -import org.onosproject.pcepio.protocol.PcepTEObject; 27 +import org.onosproject.pcepio.protocol.PcepLSObject;
27 import org.onosproject.pcepio.types.PcepObjectHeader; 28 import org.onosproject.pcepio.types.PcepObjectHeader;
28 import org.slf4j.Logger; 29 import org.slf4j.Logger;
29 import org.slf4j.LoggerFactory; 30 import org.slf4j.LoggerFactory;
...@@ -31,30 +32,30 @@ import org.slf4j.LoggerFactory; ...@@ -31,30 +32,30 @@ import org.slf4j.LoggerFactory;
31 import com.google.common.base.MoreObjects; 32 import com.google.common.base.MoreObjects;
32 33
33 /** 34 /**
34 - * Provides PcepError list which contains RP or TE objects. 35 + * Provides PcepError list which contains RP or LS objects.
35 - * Reference:PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02. 36 + * Reference: draft-dhodylee-pce-pcep-ls-01, section 8.2.
36 */ 37 */
37 public class PcepErrorVer1 implements PcepError { 38 public class PcepErrorVer1 implements PcepError {
38 39
39 /* 40 /*
40 - <error>::=[<request-id-list> | <te-id-list>] 41 + <error>::=[<request-id-list> | <ls-id-list>]
41 <error-obj-list> 42 <error-obj-list>
42 43
43 <request-id-list>::=<RP>[<request-id-list>] 44 <request-id-list>::=<RP>[<request-id-list>]
44 45
45 - <te-id-list>::=<TE>[<te-id-list>] 46 + <ls-id-list>::=<LS>[<ls-id-list>]
46 */ 47 */
47 48
48 protected static final Logger log = LoggerFactory.getLogger(PcepErrorVer1.class); 49 protected static final Logger log = LoggerFactory.getLogger(PcepErrorVer1.class);
49 50
50 private boolean isErroInfoSet; 51 private boolean isErroInfoSet;
51 //PcepErrorObject list 52 //PcepErrorObject list
52 - private LinkedList<PcepErrorObject> llErrObjList; 53 + private List<PcepErrorObject> errObjList;
53 //PcepRPObject list 54 //PcepRPObject list
54 - private LinkedList<PcepRPObject> llRPObjList; 55 + private List<PcepRPObject> rpObjList;
55 - //PcepTEObject list 56 + //PcepLSObject list
56 - private LinkedList<PcepTEObject> llTEObjList; 57 + private List<PcepLSObject> lsObjList;
57 - private boolean isTEObjListSet; 58 + private boolean isLSObjListSet;
58 59
59 public static final int OBJECT_HEADER_LENGTH = 4; 60 public static final int OBJECT_HEADER_LENGTH = 4;
60 61
...@@ -62,49 +63,49 @@ public class PcepErrorVer1 implements PcepError { ...@@ -62,49 +63,49 @@ public class PcepErrorVer1 implements PcepError {
62 * Constructor to initialize variable. 63 * Constructor to initialize variable.
63 */ 64 */
64 public PcepErrorVer1() { 65 public PcepErrorVer1() {
65 - this.llRPObjList = null; 66 + this.rpObjList = null;
66 - this.llTEObjList = null; 67 + this.lsObjList = null;
67 - this.llErrObjList = null; 68 + this.errObjList = null;
68 } 69 }
69 70
70 /** 71 /**
71 * Constructor to initialize variable. 72 * Constructor to initialize variable.
72 * 73 *
73 - * @param llRPObjList list of PcepRPObject 74 + * @param rpObjList list of PcepRPObject
74 - * @param llTEObjList list of PcepTEObject 75 + * @param lsObjList list of PcepLSObject
75 - * @param llErrObjListObjList list of PcepErrorObject 76 + * @param errObjListObjList list of PcepErrorObject
76 */ 77 */
77 - public PcepErrorVer1(LinkedList<PcepRPObject> llRPObjList, LinkedList<PcepTEObject> llTEObjList, 78 + public PcepErrorVer1(List<PcepRPObject> rpObjList, List<PcepLSObject> lsObjList,
78 - LinkedList<PcepErrorObject> llErrObjListObjList) { 79 + List<PcepErrorObject> errObjListObjList) {
79 - this.llRPObjList = llRPObjList; 80 + this.rpObjList = rpObjList;
80 - this.llTEObjList = llTEObjList; 81 + this.lsObjList = lsObjList;
81 - this.llErrObjList = llErrObjListObjList; 82 + this.errObjList = errObjListObjList;
82 } 83 }
83 84
84 /** 85 /**
85 * Constructor to initialize PcepError. 86 * Constructor to initialize PcepError.
86 * 87 *
87 - * @param llErrObjList list of PcepErrorObject 88 + * @param errObjList list of PcepErrorObject
88 */ 89 */
89 - public PcepErrorVer1(LinkedList<PcepErrorObject> llErrObjList) { 90 + public PcepErrorVer1(List<PcepErrorObject> errObjList) {
90 - this.llRPObjList = null; 91 + this.rpObjList = null;
91 - this.llTEObjList = null; 92 + this.lsObjList = null;
92 - this.llErrObjList = llErrObjList; 93 + this.errObjList = errObjList;
93 } 94 }
94 95
95 @Override 96 @Override
96 - public LinkedList<PcepRPObject> getRPObjList() { 97 + public List<PcepRPObject> getRPObjList() {
97 - return this.llRPObjList; 98 + return this.rpObjList;
98 } 99 }
99 100
100 @Override 101 @Override
101 - public LinkedList<PcepTEObject> getTEObjList() { 102 + public List<PcepLSObject> getLSObjList() {
102 - return this.llTEObjList; 103 + return this.lsObjList;
103 } 104 }
104 105
105 @Override 106 @Override
106 - public LinkedList<PcepErrorObject> getErrorObjList() { 107 + public List<PcepErrorObject> getErrorObjList() {
107 - return this.llErrObjList; 108 + return this.errObjList;
108 } 109 }
109 110
110 /** 111 /**
...@@ -117,7 +118,7 @@ public class PcepErrorVer1 implements PcepError { ...@@ -117,7 +118,7 @@ public class PcepErrorVer1 implements PcepError {
117 byte yObjClass; 118 byte yObjClass;
118 byte yObjType; 119 byte yObjType;
119 120
120 - llRPObjList = new LinkedList<>(); 121 + rpObjList = new LinkedList<>();
121 122
122 // caller should verify for RP object 123 // caller should verify for RP object
123 if (cb.readableBytes() < OBJECT_HEADER_LENGTH) { 124 if (cb.readableBytes() < OBJECT_HEADER_LENGTH) {
...@@ -133,7 +134,7 @@ public class PcepErrorVer1 implements PcepError { ...@@ -133,7 +134,7 @@ public class PcepErrorVer1 implements PcepError {
133 PcepRPObject rpObj; 134 PcepRPObject rpObj;
134 while ((yObjClass == PcepRPObjectVer1.RP_OBJ_CLASS) && (yObjType == PcepRPObjectVer1.RP_OBJ_TYPE)) { 135 while ((yObjClass == PcepRPObjectVer1.RP_OBJ_CLASS) && (yObjType == PcepRPObjectVer1.RP_OBJ_TYPE)) {
135 rpObj = PcepRPObjectVer1.read(cb); 136 rpObj = PcepRPObjectVer1.read(cb);
136 - llRPObjList.add(rpObj); 137 + rpObjList.add(rpObj);
137 138
138 if (cb.readableBytes() > OBJECT_HEADER_LENGTH) { 139 if (cb.readableBytes() > OBJECT_HEADER_LENGTH) {
139 cb.markReaderIndex(); 140 cb.markReaderIndex();
...@@ -148,20 +149,20 @@ public class PcepErrorVer1 implements PcepError { ...@@ -148,20 +149,20 @@ public class PcepErrorVer1 implements PcepError {
148 } 149 }
149 150
150 /** 151 /**
151 - * Parse TE List from the channel buffer. 152 + * Parse LS List from the channel buffer.
152 * 153 *
153 * @param cb of type channel buffer 154 * @param cb of type channel buffer
154 * @throws PcepParseException if mandatory fields are missing 155 * @throws PcepParseException if mandatory fields are missing
155 */ 156 */
156 - public void parseTEList(ChannelBuffer cb) throws PcepParseException { 157 + public void parseLSList(ChannelBuffer cb) throws PcepParseException {
157 byte yObjClass; 158 byte yObjClass;
158 byte yObjType; 159 byte yObjType;
159 160
160 - llTEObjList = new LinkedList<>(); 161 + lsObjList = new LinkedList<>();
161 162
162 - // caller should verify for TE object 163 + // caller should verify for LS object
163 if (cb.readableBytes() < OBJECT_HEADER_LENGTH) { 164 if (cb.readableBytes() < OBJECT_HEADER_LENGTH) {
164 - log.debug("Unable to find TE Object"); 165 + log.debug("Unable to find LS Object");
165 return; 166 return;
166 } 167 }
167 168
...@@ -170,11 +171,11 @@ public class PcepErrorVer1 implements PcepError { ...@@ -170,11 +171,11 @@ public class PcepErrorVer1 implements PcepError {
170 cb.resetReaderIndex(); 171 cb.resetReaderIndex();
171 yObjClass = tempObjHeader.getObjClass(); 172 yObjClass = tempObjHeader.getObjClass();
172 yObjType = tempObjHeader.getObjType(); 173 yObjType = tempObjHeader.getObjType();
173 - PcepTEObject teObj; 174 + PcepLSObject lsObj;
174 - while ((yObjClass == PcepTEObjectVer1.TE_OBJ_CLASS) && ((yObjType == PcepTEObjectVer1.TE_OBJ_TYPE_NODE_VALUE) 175 + while ((yObjClass == PcepLSObjectVer1.LS_OBJ_CLASS) && ((yObjType == PcepLSObjectVer1.LS_OBJ_TYPE_NODE_VALUE)
175 - || (yObjType == PcepTEObjectVer1.TE_OBJ_TYPE_LINK_VALUE))) { 176 + || (yObjType == PcepLSObjectVer1.LS_OBJ_TYPE_LINK_VALUE))) {
176 - teObj = PcepTEObjectVer1.read(cb); 177 + lsObj = PcepLSObjectVer1.read(cb);
177 - llTEObjList.add(teObj); 178 + lsObjList.add(lsObj);
178 179
179 if (cb.readableBytes() > OBJECT_HEADER_LENGTH) { 180 if (cb.readableBytes() > OBJECT_HEADER_LENGTH) {
180 cb.markReaderIndex(); 181 cb.markReaderIndex();
...@@ -199,7 +200,7 @@ public class PcepErrorVer1 implements PcepError { ...@@ -199,7 +200,7 @@ public class PcepErrorVer1 implements PcepError {
199 byte yObjType; 200 byte yObjType;
200 boolean bIsErrorObjFound = false; 201 boolean bIsErrorObjFound = false;
201 202
202 - llErrObjList = new LinkedList<>(); 203 + errObjList = new LinkedList<>();
203 204
204 // caller should verify for RP object 205 // caller should verify for RP object
205 if (cb.readableBytes() < OBJECT_HEADER_LENGTH) { 206 if (cb.readableBytes() < OBJECT_HEADER_LENGTH) {
...@@ -214,7 +215,7 @@ public class PcepErrorVer1 implements PcepError { ...@@ -214,7 +215,7 @@ public class PcepErrorVer1 implements PcepError {
214 PcepErrorObject errorObject; 215 PcepErrorObject errorObject;
215 while ((yObjClass == PcepErrorObjectVer1.ERROR_OBJ_CLASS) && (yObjType == PcepErrorObjectVer1.ERROR_OBJ_TYPE)) { 216 while ((yObjClass == PcepErrorObjectVer1.ERROR_OBJ_CLASS) && (yObjType == PcepErrorObjectVer1.ERROR_OBJ_TYPE)) {
216 errorObject = PcepErrorObjectVer1.read(cb); 217 errorObject = PcepErrorObjectVer1.read(cb);
217 - llErrObjList.add(errorObject); 218 + errObjList.add(errorObject);
218 bIsErrorObjFound = true; 219 bIsErrorObjFound = true;
219 220
220 if (cb.readableBytes() > OBJECT_HEADER_LENGTH) { 221 if (cb.readableBytes() > OBJECT_HEADER_LENGTH) {
...@@ -252,14 +253,14 @@ public class PcepErrorVer1 implements PcepError { ...@@ -252,14 +253,14 @@ public class PcepErrorVer1 implements PcepError {
252 cb.resetReaderIndex(); 253 cb.resetReaderIndex();
253 byte yObjClass = tempObjHeader.getObjClass(); 254 byte yObjClass = tempObjHeader.getObjClass();
254 255
255 - //If RPlist present then store it.RPList and TEList are optional 256 + //If RPlist present then store it.RPList and LSList are optional
256 if (yObjClass == PcepRPObjectVer1.RP_OBJ_CLASS) { 257 if (yObjClass == PcepRPObjectVer1.RP_OBJ_CLASS) {
257 log.debug("RP_LIST"); 258 log.debug("RP_LIST");
258 pcepError.parseRPList(cb); 259 pcepError.parseRPList(cb);
259 yObjClass = checkNextObject(cb); 260 yObjClass = checkNextObject(cb);
260 - } else if (yObjClass == PcepTEObjectVer1.TE_OBJ_CLASS) { 261 + } else if (yObjClass == PcepLSObjectVer1.LS_OBJ_CLASS) {
261 - log.debug("TE_LIST"); 262 + log.debug("LS_LIST");
262 - pcepError.parseTEList(cb); 263 + pcepError.parseLSList(cb);
263 yObjClass = checkNextObject(cb); 264 yObjClass = checkNextObject(cb);
264 } 265 }
265 266
...@@ -301,21 +302,21 @@ public class PcepErrorVer1 implements PcepError { ...@@ -301,21 +302,21 @@ public class PcepErrorVer1 implements PcepError {
301 302
302 // RPlist is optional 303 // RPlist is optional
303 if (this.isErroInfoSet) { 304 if (this.isErroInfoSet) {
304 - ListIterator<PcepRPObject> rpObjlistIterator = this.llRPObjList.listIterator(); 305 + ListIterator<PcepRPObject> rpObjlistIterator = this.rpObjList.listIterator();
305 while (rpObjlistIterator.hasNext()) { 306 while (rpObjlistIterator.hasNext()) {
306 rpObjlistIterator.next().write(cb); 307 rpObjlistIterator.next().write(cb);
307 } 308 }
308 } 309 }
309 310
310 - // TElist is optional 311 + // LSlist is optional
311 - if (this.isTEObjListSet) { 312 + if (this.isLSObjListSet) {
312 - ListIterator<PcepTEObject> teObjlistIterator = this.llTEObjList.listIterator(); 313 + ListIterator<PcepLSObject> teObjlistIterator = this.lsObjList.listIterator();
313 while (teObjlistIterator.hasNext()) { 314 while (teObjlistIterator.hasNext()) {
314 teObjlistIterator.next().write(cb); 315 teObjlistIterator.next().write(cb);
315 } 316 }
316 } 317 }
317 //ErrList is mandatory 318 //ErrList is mandatory
318 - ListIterator<PcepErrorObject> errlistIterator = this.llErrObjList.listIterator(); 319 + ListIterator<PcepErrorObject> errlistIterator = this.errObjList.listIterator();
319 while (errlistIterator.hasNext()) { 320 while (errlistIterator.hasNext()) {
320 errlistIterator.next().write(cb); 321 errlistIterator.next().write(cb);
321 } 322 }
...@@ -328,72 +329,72 @@ public class PcepErrorVer1 implements PcepError { ...@@ -328,72 +329,72 @@ public class PcepErrorVer1 implements PcepError {
328 */ 329 */
329 public static class Builder implements PcepError.Builder { 330 public static class Builder implements PcepError.Builder {
330 331
331 - private LinkedList<PcepRPObject> llRPObjList; 332 + private List<PcepRPObject> rpObjList;
332 - private LinkedList<PcepTEObject> llTEObjList; 333 + private List<PcepLSObject> lsObjList;
333 - private LinkedList<PcepErrorObject> llErrObjList; 334 + private List<PcepErrorObject> errObjList;
334 335
335 @Override 336 @Override
336 public PcepError build() { 337 public PcepError build() {
337 - return new PcepErrorVer1(llRPObjList, llTEObjList, llErrObjList); 338 + return new PcepErrorVer1(rpObjList, lsObjList, errObjList);
338 } 339 }
339 340
340 @Override 341 @Override
341 - public LinkedList<PcepRPObject> getRPObjList() { 342 + public List<PcepRPObject> getRPObjList() {
342 - return this.llRPObjList; 343 + return this.rpObjList;
343 } 344 }
344 345
345 @Override 346 @Override
346 - public Builder setRPObjList(LinkedList<PcepRPObject> llRPObjList) { 347 + public Builder setRPObjList(List<PcepRPObject> rpObjList) {
347 - this.llRPObjList = llRPObjList; 348 + this.rpObjList = rpObjList;
348 return this; 349 return this;
349 } 350 }
350 351
351 @Override 352 @Override
352 - public LinkedList<PcepTEObject> getTEObjList() { 353 + public List<PcepLSObject> getLSObjList() {
353 - return this.llTEObjList; 354 + return this.lsObjList;
354 } 355 }
355 356
356 @Override 357 @Override
357 - public Builder setTEObjList(LinkedList<PcepTEObject> llTEObjList) { 358 + public Builder setLSObjList(List<PcepLSObject> lsObjList) {
358 - this.llTEObjList = llTEObjList; 359 + this.lsObjList = lsObjList;
359 return this; 360 return this;
360 } 361 }
361 362
362 @Override 363 @Override
363 - public LinkedList<PcepErrorObject> getErrorObjList() { 364 + public List<PcepErrorObject> getErrorObjList() {
364 - return this.llErrObjList; 365 + return this.errObjList;
365 } 366 }
366 367
367 @Override 368 @Override
368 - public Builder setErrorObjList(LinkedList<PcepErrorObject> llErrObjList) { 369 + public Builder setErrorObjList(List<PcepErrorObject> errObjList) {
369 - this.llErrObjList = llErrObjList; 370 + this.errObjList = errObjList;
370 return this; 371 return this;
371 } 372 }
372 373
373 } 374 }
374 375
375 @Override 376 @Override
376 - public void setRPObjList(LinkedList<PcepRPObject> llRPObjList) { 377 + public void setRPObjList(List<PcepRPObject> rpObjList) {
377 - this.llRPObjList = llRPObjList; 378 + this.rpObjList = rpObjList;
378 } 379 }
379 380
380 @Override 381 @Override
381 - public void setTEObjList(LinkedList<PcepTEObject> llTEObjList) { 382 + public void setLSObjList(List<PcepLSObject> lsObjList) {
382 - this.llTEObjList = llTEObjList; 383 + this.lsObjList = lsObjList;
383 } 384 }
384 385
385 @Override 386 @Override
386 - public void setErrorObjList(LinkedList<PcepErrorObject> llErrObjList) { 387 + public void setErrorObjList(List<PcepErrorObject> errObjList) {
387 - this.llErrObjList = llErrObjList; 388 + this.errObjList = errObjList;
388 } 389 }
389 390
390 @Override 391 @Override
391 public String toString() { 392 public String toString() {
392 return MoreObjects.toStringHelper(getClass()) 393 return MoreObjects.toStringHelper(getClass())
393 .omitNullValues() 394 .omitNullValues()
394 - .add("RpObjectList", llRPObjList) 395 + .add("RpObjectList", rpObjList)
395 - .add("TeObjectList", llTEObjList) 396 + .add("LsObjectList", lsObjList)
396 - .add("ErrorObjectList", llErrObjList) 397 + .add("ErrorObjectList", errObjList)
397 .toString(); 398 .toString();
398 } 399 }
399 } 400 }
......
...@@ -47,12 +47,12 @@ public class PcepFecObjectIPv4AdjacencyVer1 implements PcepFecObjectIPv4Adjacenc ...@@ -47,12 +47,12 @@ public class PcepFecObjectIPv4AdjacencyVer1 implements PcepFecObjectIPv4Adjacenc
47 protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv4AdjacencyVer1.class); 47 protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv4AdjacencyVer1.class);
48 48
49 public static final byte FEC_OBJ_TYPE = 3; 49 public static final byte FEC_OBJ_TYPE = 3;
50 - public static final byte FEC_OBJ_CLASS = 36; //to be defined 50 + public static final byte FEC_OBJ_CLASS = (byte) 226;
51 public static final byte FEC_OBJECT_VERSION = 1; 51 public static final byte FEC_OBJECT_VERSION = 1;
52 public static final short FEC_OBJ_MINIMUM_LENGTH = 12; 52 public static final short FEC_OBJ_MINIMUM_LENGTH = 12;
53 public static final int MINIMUM_COMMON_HEADER_LENGTH = 4; 53 public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
54 54
55 - static final PcepObjectHeader DEFAULT_FEC_OBJECT_HEADER = new PcepObjectHeader(FEC_OBJ_CLASS, FEC_OBJ_TYPE, 55 + public static final PcepObjectHeader DEFAULT_FEC_OBJECT_HEADER = new PcepObjectHeader(FEC_OBJ_CLASS, FEC_OBJ_TYPE,
56 PcepObjectHeader.REQ_OBJ_OPTIONAL_PROCESS, PcepObjectHeader.RSP_OBJ_PROCESSED, FEC_OBJ_MINIMUM_LENGTH); 56 PcepObjectHeader.REQ_OBJ_OPTIONAL_PROCESS, PcepObjectHeader.RSP_OBJ_PROCESSED, FEC_OBJ_MINIMUM_LENGTH);
57 57
58 private PcepObjectHeader fecObjHeader; 58 private PcepObjectHeader fecObjHeader;
......
...@@ -51,7 +51,7 @@ public class PcepFecObjectIPv4UnnumberedAdjacencyVer1 implements PcepFecObjectIP ...@@ -51,7 +51,7 @@ public class PcepFecObjectIPv4UnnumberedAdjacencyVer1 implements PcepFecObjectIP
51 protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv4UnnumberedAdjacencyVer1.class); 51 protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv4UnnumberedAdjacencyVer1.class);
52 52
53 public static final byte FEC_OBJ_TYPE = 5; 53 public static final byte FEC_OBJ_TYPE = 5;
54 - public static final byte FEC_OBJ_CLASS = 63; //to be defined 54 + public static final byte FEC_OBJ_CLASS = (byte) 226;
55 public static final byte FEC_OBJECT_VERSION = 1; 55 public static final byte FEC_OBJECT_VERSION = 1;
56 public static final short FEC_OBJ_MINIMUM_LENGTH = 20; 56 public static final short FEC_OBJ_MINIMUM_LENGTH = 20;
57 public static final int MINIMUM_COMMON_HEADER_LENGTH = 4; 57 public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
......
...@@ -45,7 +45,7 @@ public class PcepFecObjectIPv4Ver1 implements PcepFecObjectIPv4 { ...@@ -45,7 +45,7 @@ public class PcepFecObjectIPv4Ver1 implements PcepFecObjectIPv4 {
45 protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv4Ver1.class); 45 protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv4Ver1.class);
46 46
47 public static final byte FEC_OBJ_TYPE = 1; 47 public static final byte FEC_OBJ_TYPE = 1;
48 - public static final byte FEC_OBJ_CLASS = 63; //to be defined 48 + public static final byte FEC_OBJ_CLASS = (byte) 226;
49 public static final byte FEC_OBJECT_VERSION = 1; 49 public static final byte FEC_OBJECT_VERSION = 1;
50 public static final short FEC_OBJ_MINIMUM_LENGTH = 8; 50 public static final short FEC_OBJ_MINIMUM_LENGTH = 8;
51 public static final int MINIMUM_COMMON_HEADER_LENGTH = 4; 51 public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
......
...@@ -51,7 +51,7 @@ public class PcepFecObjectIPv6AdjacencyVer1 implements PcepFecObjectIPv6Adjacenc ...@@ -51,7 +51,7 @@ public class PcepFecObjectIPv6AdjacencyVer1 implements PcepFecObjectIPv6Adjacenc
51 protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv6AdjacencyVer1.class); 51 protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv6AdjacencyVer1.class);
52 52
53 public static final byte FEC_OBJ_TYPE = 4; 53 public static final byte FEC_OBJ_TYPE = 4;
54 - public static final byte FEC_OBJ_CLASS = 63; //to be defined 54 + public static final byte FEC_OBJ_CLASS = (byte) 226;
55 public static final byte FEC_OBJECT_VERSION = 1; 55 public static final byte FEC_OBJECT_VERSION = 1;
56 public static final short FEC_OBJ_MINIMUM_LENGTH = 36; 56 public static final short FEC_OBJ_MINIMUM_LENGTH = 36;
57 public static final int MINIMUM_COMMON_HEADER_LENGTH = 4; 57 public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
......
...@@ -47,7 +47,7 @@ public class PcepFecObjectIPv6Ver1 implements PcepFecObjectIPv6 { ...@@ -47,7 +47,7 @@ public class PcepFecObjectIPv6Ver1 implements PcepFecObjectIPv6 {
47 protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv6Ver1.class); 47 protected static final Logger log = LoggerFactory.getLogger(PcepFecObjectIPv6Ver1.class);
48 48
49 public static final byte FEC_OBJ_TYPE = 2; 49 public static final byte FEC_OBJ_TYPE = 2;
50 - public static final byte FEC_OBJ_CLASS = 63; //to be defined 50 + public static final byte FEC_OBJ_CLASS = (byte) 226;
51 public static final byte FEC_OBJECT_VERSION = 1; 51 public static final byte FEC_OBJECT_VERSION = 1;
52 public static final short FEC_OBJ_MINIMUM_LENGTH = 20; 52 public static final short FEC_OBJ_MINIMUM_LENGTH = 20;
53 public static final int MINIMUM_COMMON_HEADER_LENGTH = 4; 53 public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
......
...@@ -16,70 +16,75 @@ ...@@ -16,70 +16,75 @@
16 16
17 package org.onosproject.pcepio.protocol.ver1; 17 package org.onosproject.pcepio.protocol.ver1;
18 18
19 +import java.util.List;
19 import java.util.LinkedList; 20 import java.util.LinkedList;
20 import java.util.ListIterator; 21 import java.util.ListIterator;
21 22
22 import org.jboss.netty.buffer.ChannelBuffer; 23 import org.jboss.netty.buffer.ChannelBuffer;
23 import org.onosproject.pcepio.exceptions.PcepParseException; 24 import org.onosproject.pcepio.exceptions.PcepParseException;
24 -import org.onosproject.pcepio.protocol.PcepTEObject; 25 +import org.onosproject.pcepio.protocol.PcepLSObject;
25 -import org.onosproject.pcepio.types.LocalTENodeDescriptorsTlv; 26 +import org.onosproject.pcepio.types.LocalNodeDescriptorsTlv;
26 import org.onosproject.pcepio.types.PcepObjectHeader; 27 import org.onosproject.pcepio.types.PcepObjectHeader;
27 import org.onosproject.pcepio.types.PcepValueType; 28 import org.onosproject.pcepio.types.PcepValueType;
28 -import org.onosproject.pcepio.types.RemoteTENodeDescriptorsTlv; 29 +import org.onosproject.pcepio.types.RemoteNodeDescriptorsTlv;
29 import org.onosproject.pcepio.types.RoutingUniverseTlv; 30 import org.onosproject.pcepio.types.RoutingUniverseTlv;
30 -import org.onosproject.pcepio.types.TELinkAttributesTlv; 31 +import org.onosproject.pcepio.types.LinkAttributesTlv;
31 -import org.onosproject.pcepio.types.TELinkDescriptorsTlv; 32 +import org.onosproject.pcepio.types.LinkDescriptorsTlv;
32 -import org.onosproject.pcepio.types.TENodeAttributesTlv; 33 +import org.onosproject.pcepio.types.NodeAttributesTlv;
33 import org.slf4j.Logger; 34 import org.slf4j.Logger;
34 import org.slf4j.LoggerFactory; 35 import org.slf4j.LoggerFactory;
35 36
36 import com.google.common.base.MoreObjects; 37 import com.google.common.base.MoreObjects;
37 38
38 /** 39 /**
39 - * Provides PCEP TE Object. 40 + * Provides PCEP LS (link-state) object.
40 */ 41 */
41 -public class PcepTEObjectVer1 implements PcepTEObject { 42 +public class PcepLSObjectVer1 implements PcepLSObject {
42 /* 43 /*
43 * 44 *
44 - reference: PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02. 45 + reference: draft-dhodylee-pce-pcep-ls-01, section 9.2.
45 - TE Object-Class is [TBD6].
46 46
47 - Two Object-Type values are defined for the TE object: 47 + Two Object-Type values are defined for the LS object:
48 48
49 - o TE Node: TE Object-Type is 1. 49 + o LS Node: LS Object-Type is 1.
50 50
51 - o TE Link: TE Object-Type is 2. 51 + o LS Link: LS Object-Type is 2.
52 52
53 - The format of the TE object body is as follows: 53 + o LS IPv4 Topology Prefix: LS Object-Type is 3.
54 +
55 + o LS IPv6 Topology Prefix: LS Object-Type is 4.
56 +
57 + The format of the LS object body is as follows:
54 58
55 0 1 2 3 59 0 1 2 3
56 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 60 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
57 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 61 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
58 | Protocol-ID | Flag |R|S| 62 | Protocol-ID | Flag |R|S|
59 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 63 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
60 - | TE-ID | 64 + | LS-ID |
65 + | |
61 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 66 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
62 // TLVs // 67 // TLVs //
63 | | 68 | |
64 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 69 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
65 */ 70 */
66 71
67 - protected static final Logger log = LoggerFactory.getLogger(PcepTEObjectVer1.class); 72 + protected static final Logger log = LoggerFactory.getLogger(PcepLSObjectVer1.class);
68 73
69 - public static final byte TE_OBJ_TYPE_NODE_VALUE = 1; 74 + public static final byte LS_OBJ_TYPE_NODE_VALUE = 1;
70 - public static final byte TE_OBJ_TYPE_LINK_VALUE = 2; 75 + public static final byte LS_OBJ_TYPE_LINK_VALUE = 2;
71 76
72 - public static final byte TE_OBJ_CLASS = 101; //TBD6 in RFC. 77 + public static final byte LS_OBJ_CLASS = (byte) 224;
73 - public static final byte TE_OBJECT_VERSION = 1; 78 + public static final byte LS_OBJECT_VERSION = 1;
74 79
75 - // TE_OBJ_MINIMUM_LENGTH = TEObjectHeaderLen(4)+ TEObjectLen(8) 80 + // LS_OBJ_MINIMUM_LENGTH = LSObjectHeaderLen(4) + LSObjectLen(8)
76 - public static final short TE_OBJ_MINIMUM_LENGTH = 12; 81 + public static final short LS_OBJ_MINIMUM_LENGTH = 12;
77 82
78 - // Signaled ,all default values to be checked. 83 + // Signaled, all default values to be checked.
79 public static final byte DEFAULT_PROTOCOL_ID = 1; //IS-IS Level 1 84 public static final byte DEFAULT_PROTOCOL_ID = 1; //IS-IS Level 1
80 public static final boolean DEFAULT_R_FLAG = false; 85 public static final boolean DEFAULT_R_FLAG = false;
81 public static final boolean DEFAULT_S_FLAG = false; 86 public static final boolean DEFAULT_S_FLAG = false;
82 - public static final int DEFAULT_TE_ID = 0; 87 + public static final int DEFAULT_LS_ID = 0;
83 88
84 public static final int OBJECT_HEADER_LENGTH = 4; 89 public static final int OBJECT_HEADER_LENGTH = 4;
85 public static final int RIGHT_SHIFT_ONE = 1; 90 public static final int RIGHT_SHIFT_ONE = 1;
...@@ -89,137 +94,137 @@ public class PcepTEObjectVer1 implements PcepTEObject { ...@@ -89,137 +94,137 @@ public class PcepTEObjectVer1 implements PcepTEObject {
89 public static final int MINIMUM_COMMON_HEADER_LENGTH = 4; 94 public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
90 public static final int MINIMUM_TLV_HEADER_LENGTH = 4; 95 public static final int MINIMUM_TLV_HEADER_LENGTH = 4;
91 96
92 - public static final PcepObjectHeader DEFAULT_TE_OBJECT_HEADER = new PcepObjectHeader(TE_OBJ_CLASS, 97 + public static final PcepObjectHeader DEFAULT_LS_OBJECT_HEADER = new PcepObjectHeader(LS_OBJ_CLASS,
93 - TE_OBJ_TYPE_NODE_VALUE, PcepObjectHeader.REQ_OBJ_OPTIONAL_PROCESS, PcepObjectHeader.RSP_OBJ_PROCESSED, 98 + LS_OBJ_TYPE_NODE_VALUE, PcepObjectHeader.REQ_OBJ_OPTIONAL_PROCESS, PcepObjectHeader.RSP_OBJ_PROCESSED,
94 - TE_OBJ_MINIMUM_LENGTH); 99 + LS_OBJ_MINIMUM_LENGTH);
95 100
96 - private PcepObjectHeader teObjHeader; 101 + private PcepObjectHeader lsObjHeader;
97 - private byte yProtocolId; 102 + private byte protocolId;
98 // 2-flags 103 // 2-flags
99 - private boolean bRFlag; 104 + private boolean removeFlag;
100 - private boolean bSFlag; 105 + private boolean syncFlag;
101 - private int iTEId; 106 + private long lsId; //link-state identifier
102 // Optional TLV 107 // Optional TLV
103 - private LinkedList<PcepValueType> llOptionalTlv; 108 + private List<PcepValueType> optionalTlvList;
104 109
105 /** 110 /**
106 * Constructor to initialize variables. 111 * Constructor to initialize variables.
107 * 112 *
108 - * @param teObjHeader TE Object header 113 + * @param lsObjHeader LS Object header
109 - * @param yProtocolId Protocol-ID 114 + * @param protocolId Protocol-ID
110 - * @param bRFlag R-flag 115 + * @param removeFlag R-flag
111 - * @param bSFlag S-flag 116 + * @param syncFlag S-flag
112 - * @param iTEId TE-ID 117 + * @param lsId LS-ID
113 - * @param llOptionalTlv linked list of Optional TLV 118 + * @param optionalTlvList linked list of Optional TLV
114 */ 119 */
115 - public PcepTEObjectVer1(PcepObjectHeader teObjHeader, byte yProtocolId, boolean bRFlag, boolean bSFlag, int iTEId, 120 + public PcepLSObjectVer1(PcepObjectHeader lsObjHeader, byte protocolId, boolean removeFlag,
116 - LinkedList<PcepValueType> llOptionalTlv) { 121 + boolean syncFlag, long lsId, List<PcepValueType> optionalTlvList) {
117 - 122 +
118 - this.teObjHeader = teObjHeader; 123 + this.lsObjHeader = lsObjHeader;
119 - this.yProtocolId = yProtocolId; 124 + this.protocolId = protocolId;
120 - this.bRFlag = bRFlag; 125 + this.removeFlag = removeFlag;
121 - this.bSFlag = bSFlag; 126 + this.syncFlag = syncFlag;
122 - this.iTEId = iTEId; 127 + this.lsId = lsId;
123 - this.llOptionalTlv = llOptionalTlv; 128 + this.optionalTlvList = optionalTlvList;
124 } 129 }
125 130
126 @Override 131 @Override
127 - public PcepObjectHeader getTEObjHeader() { 132 + public PcepObjectHeader getLSObjHeader() {
128 - return this.teObjHeader; 133 + return this.lsObjHeader;
129 } 134 }
130 135
131 @Override 136 @Override
132 - public void setTEObjHeader(PcepObjectHeader obj) { 137 + public void setLSObjHeader(PcepObjectHeader obj) {
133 - this.teObjHeader = obj; 138 + this.lsObjHeader = obj;
134 } 139 }
135 140
136 @Override 141 @Override
137 public byte getProtocolId() { 142 public byte getProtocolId() {
138 - return this.yProtocolId; 143 + return this.protocolId;
139 } 144 }
140 145
141 @Override 146 @Override
142 - public void setProtocolId(byte yProtId) { 147 + public void setProtocolId(byte protId) {
143 - this.yProtocolId = yProtId; 148 + this.protocolId = protId;
144 } 149 }
145 150
146 @Override 151 @Override
147 - public boolean getRFlag() { 152 + public boolean getRemoveFlag() {
148 - return this.bRFlag; 153 + return this.removeFlag;
149 } 154 }
150 155
151 @Override 156 @Override
152 - public void setRFlag(boolean bRFlag) { 157 + public void setRemoveFlag(boolean removeFlag) {
153 - this.bRFlag = bRFlag; 158 + this.removeFlag = removeFlag;
154 } 159 }
155 160
156 @Override 161 @Override
157 - public boolean getSFlag() { 162 + public boolean getSyncFlag() {
158 - return this.bSFlag; 163 + return this.syncFlag;
159 } 164 }
160 165
161 @Override 166 @Override
162 - public void setSFlag(boolean bSFlag) { 167 + public void setSyncFlag(boolean syncFlag) {
163 - this.bSFlag = bSFlag; 168 + this.syncFlag = syncFlag;
164 } 169 }
165 170
166 @Override 171 @Override
167 - public int getTEId() { 172 + public long getLSId() {
168 - return this.iTEId; 173 + return this.lsId;
169 } 174 }
170 175
171 @Override 176 @Override
172 - public void setTEId(int iTEId) { 177 + public void setLSId(long lsId) {
173 - this.iTEId = iTEId; 178 + this.lsId = lsId;
174 } 179 }
175 180
176 @Override 181 @Override
177 - public LinkedList<PcepValueType> getOptionalTlv() { 182 + public List<PcepValueType> getOptionalTlv() {
178 - return this.llOptionalTlv; 183 + return this.optionalTlvList;
179 } 184 }
180 185
181 @Override 186 @Override
182 - public void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv) { 187 + public void setOptionalTlv(List<PcepValueType> optionalTlvList) {
183 - this.llOptionalTlv = llOptionalTlv; 188 + this.optionalTlvList = optionalTlvList;
184 } 189 }
185 190
186 /** 191 /**
187 - * Reads from the channel buffer and returns Object of PcepTEObject. 192 + * Reads from the channel buffer and returns Object of PcepLSObject.
188 * 193 *
189 * @param cb of type channel buffer 194 * @param cb of type channel buffer
190 - * @return Object of PcepTEObject 195 + * @return Object of PcepLSObject
191 * @throws PcepParseException if mandatory fields are missing 196 * @throws PcepParseException if mandatory fields are missing
192 */ 197 */
193 - public static PcepTEObject read(ChannelBuffer cb) throws PcepParseException { 198 + public static PcepLSObject read(ChannelBuffer cb) throws PcepParseException {
194 log.debug("read"); 199 log.debug("read");
195 200
196 - PcepObjectHeader teObjHeader; 201 + PcepObjectHeader lsObjHeader;
197 - byte yProtocolId; 202 + byte protocolId;
198 // 2-flags 203 // 2-flags
199 - boolean bRFlag; 204 + boolean removeFlag;
200 - boolean bSFlag; 205 + boolean syncFlag;
201 - int iTEId; 206 + long lsId;
202 - LinkedList<PcepValueType> llOptionalTlv; 207 + List<PcepValueType> optionalTlvList;
203 208
204 - teObjHeader = PcepObjectHeader.read(cb); 209 + lsObjHeader = PcepObjectHeader.read(cb);
205 210
206 - //take only TEObject buffer. 211 + //take only LSObject buffer.
207 - ChannelBuffer tempCb = cb.readBytes(teObjHeader.getObjLen() - OBJECT_HEADER_LENGTH); 212 + ChannelBuffer tempCb = cb.readBytes(lsObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
208 213
209 - yProtocolId = tempCb.readByte(); 214 + protocolId = tempCb.readByte();
210 //ignore first two bytes of Flags 215 //ignore first two bytes of Flags
211 tempCb.readShort(); 216 tempCb.readShort();
212 217
213 Integer iTemp = (int) tempCb.readByte(); //read 3rd byte Flag 218 Integer iTemp = (int) tempCb.readByte(); //read 3rd byte Flag
214 - bSFlag = (iTemp & FLAG_SET_S_FLAG) == FLAG_SET_S_FLAG; 219 + syncFlag = (iTemp & FLAG_SET_S_FLAG) == FLAG_SET_S_FLAG;
215 - bRFlag = (iTemp & FLAG_SET_R_FLAG) == FLAG_SET_R_FLAG; 220 + removeFlag = (iTemp & FLAG_SET_R_FLAG) == FLAG_SET_R_FLAG;
216 221
217 - iTEId = tempCb.readInt(); 222 + lsId = tempCb.readLong();
218 223
219 // parse optional TLV 224 // parse optional TLV
220 - llOptionalTlv = parseOptionalTlv(tempCb); 225 + optionalTlvList = parseOptionalTlv(tempCb);
221 226
222 - return new PcepTEObjectVer1(teObjHeader, yProtocolId, bRFlag, bSFlag, iTEId, llOptionalTlv); 227 + return new PcepLSObjectVer1(lsObjHeader, protocolId, removeFlag, syncFlag, lsId, optionalTlvList);
223 } 228 }
224 229
225 @Override 230 @Override
...@@ -227,30 +232,30 @@ public class PcepTEObjectVer1 implements PcepTEObject { ...@@ -227,30 +232,30 @@ public class PcepTEObjectVer1 implements PcepTEObject {
227 232
228 //write Object header 233 //write Object header
229 int objStartIndex = cb.writerIndex(); 234 int objStartIndex = cb.writerIndex();
230 - int objLenIndex = teObjHeader.write(cb); 235 + int objLenIndex = lsObjHeader.write(cb);
231 236
232 if (objLenIndex <= 0) { 237 if (objLenIndex <= 0) {
233 throw new PcepParseException("ObjectLength Index is " + objLenIndex); 238 throw new PcepParseException("ObjectLength Index is " + objLenIndex);
234 } 239 }
235 240
236 //write Protocol ID 241 //write Protocol ID
237 - cb.writeByte(this.yProtocolId); 242 + cb.writeByte(this.protocolId);
238 243
239 //write Flag 244 //write Flag
240 cb.writeShort(0); 245 cb.writeShort(0);
241 246
242 byte bTemp = 0; 247 byte bTemp = 0;
243 - if (bSFlag) { 248 + if (syncFlag) {
244 bTemp = FLAG_SET_S_FLAG; 249 bTemp = FLAG_SET_S_FLAG;
245 } 250 }
246 251
247 - if (bRFlag) { 252 + if (removeFlag) {
248 bTemp = (byte) (bTemp | FLAG_SET_R_FLAG); 253 bTemp = (byte) (bTemp | FLAG_SET_R_FLAG);
249 } 254 }
250 cb.writeByte(bTemp); 255 cb.writeByte(bTemp);
251 256
252 - //write TEId 257 + //write LSId
253 - cb.writeInt(iTEId); 258 + cb.writeLong(lsId);
254 259
255 // Add optional TLV 260 // Add optional TLV
256 packOptionalTlv(cb); 261 packOptionalTlv(cb);
...@@ -259,7 +264,7 @@ public class PcepTEObjectVer1 implements PcepTEObject { ...@@ -259,7 +264,7 @@ public class PcepTEObjectVer1 implements PcepTEObject {
259 int length = cb.writerIndex() - objStartIndex; 264 int length = cb.writerIndex() - objStartIndex;
260 265
261 //will be helpful during print(). 266 //will be helpful during print().
262 - teObjHeader.setObjLen((short) length); 267 + lsObjHeader.setObjLen((short) length);
263 268
264 cb.setShort(objLenIndex, (short) length); 269 cb.setShort(objLenIndex, (short) length);
265 270
...@@ -273,9 +278,9 @@ public class PcepTEObjectVer1 implements PcepTEObject { ...@@ -273,9 +278,9 @@ public class PcepTEObjectVer1 implements PcepTEObject {
273 * @return Linked list of PCEP Value Type 278 * @return Linked list of PCEP Value Type
274 * @throws PcepParseException if mandatory fields are missing 279 * @throws PcepParseException if mandatory fields are missing
275 */ 280 */
276 - protected static LinkedList<PcepValueType> parseOptionalTlv(ChannelBuffer cb) throws PcepParseException { 281 + protected static List<PcepValueType> parseOptionalTlv(ChannelBuffer cb) throws PcepParseException {
277 282
278 - LinkedList<PcepValueType> llOutOptionalTlv; 283 + List<PcepValueType> llOutOptionalTlv;
279 284
280 llOutOptionalTlv = new LinkedList<>(); 285 llOutOptionalTlv = new LinkedList<>();
281 286
...@@ -292,20 +297,20 @@ public class PcepTEObjectVer1 implements PcepTEObject { ...@@ -292,20 +297,20 @@ public class PcepTEObjectVer1 implements PcepTEObject {
292 lValue = cb.readLong(); 297 lValue = cb.readLong();
293 tlv = new RoutingUniverseTlv(lValue); 298 tlv = new RoutingUniverseTlv(lValue);
294 break; 299 break;
295 - case LocalTENodeDescriptorsTlv.TYPE: 300 + case LocalNodeDescriptorsTlv.TYPE:
296 - tlv = LocalTENodeDescriptorsTlv.read(cb, hLength); 301 + tlv = LocalNodeDescriptorsTlv.read(cb, hLength);
297 break; 302 break;
298 - case RemoteTENodeDescriptorsTlv.TYPE: 303 + case RemoteNodeDescriptorsTlv.TYPE:
299 - tlv = RemoteTENodeDescriptorsTlv.read(cb, hLength); 304 + tlv = RemoteNodeDescriptorsTlv.read(cb, hLength);
300 break; 305 break;
301 - case TELinkDescriptorsTlv.TYPE: 306 + case LinkDescriptorsTlv.TYPE:
302 - tlv = TELinkDescriptorsTlv.read(cb, hLength); 307 + tlv = LinkDescriptorsTlv.read(cb, hLength);
303 break; 308 break;
304 - case TENodeAttributesTlv.TYPE: 309 + case NodeAttributesTlv.TYPE:
305 - tlv = TENodeAttributesTlv.read(cb, hLength); 310 + tlv = NodeAttributesTlv.read(cb, hLength);
306 break; 311 break;
307 - case TELinkAttributesTlv.TYPE: 312 + case LinkAttributesTlv.TYPE:
308 - tlv = TELinkAttributesTlv.read(cb, hLength); 313 + tlv = LinkAttributesTlv.read(cb, hLength);
309 break; 314 break;
310 default: 315 default:
311 throw new PcepParseException("Unsupported TLV type :" + hType); 316 throw new PcepParseException("Unsupported TLV type :" + hType);
...@@ -338,7 +343,7 @@ public class PcepTEObjectVer1 implements PcepTEObject { ...@@ -338,7 +343,7 @@ public class PcepTEObjectVer1 implements PcepTEObject {
338 */ 343 */
339 protected int packOptionalTlv(ChannelBuffer cb) { 344 protected int packOptionalTlv(ChannelBuffer cb) {
340 345
341 - ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator(); 346 + ListIterator<PcepValueType> listIterator = optionalTlvList.listIterator();
342 347
343 while (listIterator.hasNext()) { 348 while (listIterator.hasNext()) {
344 PcepValueType tlv = listIterator.next(); 349 PcepValueType tlv = listIterator.next();
...@@ -363,144 +368,143 @@ public class PcepTEObjectVer1 implements PcepTEObject { ...@@ -363,144 +368,143 @@ public class PcepTEObjectVer1 implements PcepTEObject {
363 } 368 }
364 369
365 /** 370 /**
366 - * Builder class for PCEP te object. 371 + * Builder class for PCEP LS (link-state) object.
367 */ 372 */
368 - public static class Builder implements PcepTEObject.Builder { 373 + public static class Builder implements PcepLSObject.Builder {
369 - private boolean bIsHeaderSet = false; 374 + private boolean isHeaderSet = false;
370 - private boolean bIsProtocolIdSet = false; 375 + private boolean isProtocolIdSet = false;
371 - private boolean bIsRFlagSet = false; 376 + private boolean isRemoveFlagSet = false;
372 - private boolean bIsSFlagSet = false; 377 + private boolean isSyncFlagSet = false;
373 - private boolean bIsTEIdSet = false; 378 + private boolean isLSIdSet = false;
374 - 379 +
375 - private PcepObjectHeader teObjHeader; 380 + private PcepObjectHeader lsObjHeader;
376 - private byte yProtocolId; 381 + private byte protocolId;
377 - private boolean bRFlag; 382 + private boolean removeFlag;
378 - private boolean bSFlag; 383 + private boolean syncFlag;
379 - private int iTEId; 384 + private long lsId;
380 - private LinkedList<PcepValueType> llOptionalTlv = new LinkedList<>(); 385 + private List<PcepValueType> optionalTlvList = new LinkedList<>();
381 - 386 +
382 - private boolean bIsPFlagSet = false; 387 + private boolean isProcRuleFlagSet = false;
383 - private boolean bPFlag; 388 + private boolean procRuleFlag; //Processing rule flag
384 - 389 +
385 - private boolean bIsIFlagSet = false; 390 + private boolean isIgnoreFlagSet = false;
386 - private boolean bIFlag; 391 + private boolean ignoreFlag;
387 392
388 @Override 393 @Override
389 - public PcepTEObject build() { 394 + public PcepLSObject build() {
390 - PcepObjectHeader teObjHeader = this.bIsHeaderSet ? this.teObjHeader : DEFAULT_TE_OBJECT_HEADER; 395 + PcepObjectHeader lsObjHeader = this.isHeaderSet ? this.lsObjHeader : DEFAULT_LS_OBJECT_HEADER;
391 396
392 - byte yProtocolId = this.bIsProtocolIdSet ? this.yProtocolId : DEFAULT_PROTOCOL_ID; 397 + byte protocolId = this.isProtocolIdSet ? this.protocolId : DEFAULT_PROTOCOL_ID;
393 - boolean bRFlag = this.bIsRFlagSet ? this.bRFlag : DEFAULT_R_FLAG; 398 + boolean removeFlag = this.isRemoveFlagSet ? this.removeFlag : DEFAULT_R_FLAG;
394 - boolean bSFlag = this.bIsSFlagSet ? this.bSFlag : DEFAULT_S_FLAG; 399 + boolean syncFlag = this.isSyncFlagSet ? this.syncFlag : DEFAULT_S_FLAG;
395 - int iTEId = this.bIsTEIdSet ? this.iTEId : DEFAULT_TE_ID; 400 + long lsId = this.isLSIdSet ? this.lsId : DEFAULT_LS_ID;
396 401
397 - if (bIsPFlagSet) { 402 + if (isProcRuleFlagSet) {
398 - teObjHeader.setPFlag(bPFlag); 403 + lsObjHeader.setPFlag(procRuleFlag);
399 } 404 }
400 405
401 - if (bIsIFlagSet) { 406 + if (isIgnoreFlagSet) {
402 - teObjHeader.setIFlag(bIFlag); 407 + lsObjHeader.setIFlag(ignoreFlag);
403 } 408 }
404 409
405 - return new PcepTEObjectVer1(teObjHeader, yProtocolId, bRFlag, bSFlag, iTEId, llOptionalTlv); 410 + return new PcepLSObjectVer1(lsObjHeader, protocolId, removeFlag, syncFlag, lsId, optionalTlvList);
406 411
407 } 412 }
408 413
409 @Override 414 @Override
410 - public PcepObjectHeader getTEObjHeader() { 415 + public PcepObjectHeader getLSObjHeader() {
411 - return this.teObjHeader; 416 + return this.lsObjHeader;
412 } 417 }
413 418
414 @Override 419 @Override
415 - public Builder setTEObjHeader(PcepObjectHeader obj) { 420 + public Builder setLSObjHeader(PcepObjectHeader obj) {
416 - this.teObjHeader = obj; 421 + this.lsObjHeader = obj;
417 - this.bIsHeaderSet = true; 422 + this.isHeaderSet = true;
418 return this; 423 return this;
419 } 424 }
420 425
421 @Override 426 @Override
422 public byte getProtocolId() { 427 public byte getProtocolId() {
423 - return this.yProtocolId; 428 + return this.protocolId;
424 } 429 }
425 430
426 @Override 431 @Override
427 - public Builder setProtocolId(byte yProtId) { 432 + public Builder setProtocolId(byte protId) {
428 - this.yProtocolId = yProtId; 433 + this.protocolId = protId;
429 - this.bIsProtocolIdSet = true; 434 + this.isProtocolIdSet = true;
430 return this; 435 return this;
431 } 436 }
432 437
433 @Override 438 @Override
434 - public boolean getRFlag() { 439 + public boolean getRemoveFlag() {
435 - return this.bRFlag; 440 + return this.removeFlag;
436 } 441 }
437 442
438 @Override 443 @Override
439 - public Builder setRFlag(boolean bRFlag) { 444 + public Builder setRemoveFlag(boolean removeFlag) {
440 - this.bRFlag = bRFlag; 445 + this.removeFlag = removeFlag;
441 - this.bIsRFlagSet = true; 446 + this.isRemoveFlagSet = true;
442 return this; 447 return this;
443 } 448 }
444 449
445 @Override 450 @Override
446 - public boolean getSFlag() { 451 + public boolean getSyncFlag() {
447 - return this.bSFlag; 452 + return this.syncFlag;
448 } 453 }
449 454
450 @Override 455 @Override
451 - public Builder setSFlag(boolean bSFlag) { 456 + public Builder setSyncFlag(boolean syncFlag) {
452 - this.bSFlag = bSFlag; 457 + this.syncFlag = syncFlag;
453 - this.bIsSFlagSet = true; 458 + this.isSyncFlagSet = true;
454 return this; 459 return this;
455 } 460 }
456 461
457 @Override 462 @Override
458 - public int getTEId() { 463 + public long getLSId() {
459 - return this.iTEId; 464 + return this.lsId;
460 } 465 }
461 466
462 @Override 467 @Override
463 - public Builder setTEId(int iTEId) { 468 + public Builder setLSId(long lsId) {
464 - this.iTEId = iTEId; 469 + this.lsId = lsId;
465 - this.bIsTEIdSet = true; 470 + this.isLSIdSet = true;
466 return this; 471 return this;
467 } 472 }
468 473
469 @Override 474 @Override
470 - public LinkedList<PcepValueType> getOptionalTlv() { 475 + public List<PcepValueType> getOptionalTlv() {
471 - return this.llOptionalTlv; 476 + return this.optionalTlvList;
472 } 477 }
473 478
474 @Override 479 @Override
475 - public Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv) { 480 + public Builder setOptionalTlv(List<PcepValueType> optionalTlvList) {
476 - this.llOptionalTlv = llOptionalTlv; 481 + this.optionalTlvList = optionalTlvList;
477 return this; 482 return this;
478 } 483 }
479 484
480 @Override 485 @Override
481 public Builder setPFlag(boolean value) { 486 public Builder setPFlag(boolean value) {
482 - this.bPFlag = value; 487 + this.procRuleFlag = value;
483 - this.bIsPFlagSet = true; 488 + this.isProcRuleFlagSet = true;
484 return this; 489 return this;
485 } 490 }
486 491
487 @Override 492 @Override
488 public Builder setIFlag(boolean value) { 493 public Builder setIFlag(boolean value) {
489 - this.bIFlag = value; 494 + this.ignoreFlag = value;
490 - this.bIsIFlagSet = true; 495 + this.isIgnoreFlagSet = true;
491 return this; 496 return this;
492 } 497 }
493 } 498 }
494 499
495 @Override 500 @Override
496 public String toString() { 501 public String toString() {
497 - return MoreObjects.toStringHelper(getClass()) 502 + return MoreObjects.toStringHelper(getClass()).omitNullValues()
498 - .add("ObjectHeader", teObjHeader) 503 + .add("ObjectHeader", lsObjHeader)
499 - .add("ProtocolId", yProtocolId) 504 + .add("ProtocolId", protocolId)
500 - .add("RFlag", (bRFlag) ? 1 : 0) 505 + .add("RFlag", (removeFlag) ? 1 : 0)
501 - .add("SFlag", (bSFlag) ? 1 : 0) 506 + .add("SFlag", (syncFlag) ? 1 : 0)
502 - .add("TeId", iTEId) 507 + .add("LsId", lsId)
503 - .add("OptionalTlv", llOptionalTlv) 508 + .add("OptionalTlv", optionalTlvList).toString();
504 - .toString();
505 } 509 }
506 } 510 }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
16 16
17 package org.onosproject.pcepio.protocol.ver1; 17 package org.onosproject.pcepio.protocol.ver1;
18 18
19 +import java.util.List;
19 import java.util.LinkedList; 20 import java.util.LinkedList;
20 import java.util.ListIterator; 21 import java.util.ListIterator;
21 22
...@@ -23,8 +24,8 @@ import org.jboss.netty.buffer.ChannelBuffer; ...@@ -23,8 +24,8 @@ import org.jboss.netty.buffer.ChannelBuffer;
23 import org.onosproject.pcepio.exceptions.PcepParseException; 24 import org.onosproject.pcepio.exceptions.PcepParseException;
24 import org.onosproject.pcepio.protocol.PcepMessageReader; 25 import org.onosproject.pcepio.protocol.PcepMessageReader;
25 import org.onosproject.pcepio.protocol.PcepMessageWriter; 26 import org.onosproject.pcepio.protocol.PcepMessageWriter;
26 -import org.onosproject.pcepio.protocol.PcepTEObject; 27 +import org.onosproject.pcepio.protocol.PcepLSObject;
27 -import org.onosproject.pcepio.protocol.PcepTEReportMsg; 28 +import org.onosproject.pcepio.protocol.PcepLSReportMsg;
28 import org.onosproject.pcepio.protocol.PcepType; 29 import org.onosproject.pcepio.protocol.PcepType;
29 import org.onosproject.pcepio.protocol.PcepVersion; 30 import org.onosproject.pcepio.protocol.PcepVersion;
30 import org.slf4j.Logger; 31 import org.slf4j.Logger;
...@@ -33,43 +34,43 @@ import org.slf4j.LoggerFactory; ...@@ -33,43 +34,43 @@ import org.slf4j.LoggerFactory;
33 import com.google.common.base.MoreObjects; 34 import com.google.common.base.MoreObjects;
34 35
35 /** 36 /**
36 - * Provides PCEP TE Report Message. 37 + * Provides PCEP LS (link-state) Report Message.
37 */ 38 */
38 -class PcepTEReportMsgVer1 implements PcepTEReportMsg { 39 +class PcepLSReportMsgVer1 implements PcepLSReportMsg {
39 40
40 /* 41 /*
41 - * Ref : draft-dhodylee-pce-pcep-te-data-extn-02, section 8.1 42 + * Ref : draft-dhodylee-pce-pcep-ls-01, section 8.1
42 43
43 - <TERpt Message> ::= <Common Header> 44 + <LSRpt Message> ::= <Common Header>
44 - <te-report-list> 45 + <ls-report-list>
45 Where: 46 Where:
46 - <te-report-list> ::= <TE>[<te-report-list>] 47 + <ls-report-list> ::= <LS>[<ls-report-list>]
47 */ 48 */
48 49
49 - private static final Logger log = LoggerFactory.getLogger(PcepTEReportMsgVer1.class); 50 + private static final Logger log = LoggerFactory.getLogger(PcepLSReportMsgVer1.class);
50 - //PACKET_MINIMUM_LENGTH = CommonHeaderLen(4)+TEObjMinLen(12) 51 + //PACKET_MINIMUM_LENGTH = CommonHeaderLen(4)+LSObjMinLen(12)
51 public static final int PACKET_MINIMUM_LENGTH = 16; 52 public static final int PACKET_MINIMUM_LENGTH = 16;
52 - public static final PcepType MSG_TYPE = PcepType.TE_REPORT; 53 + public static final PcepType MSG_TYPE = PcepType.LS_REPORT;
53 - // <te-report-list> 54 + // <ls-report-list>
54 - private LinkedList<PcepTEObject> teReportList; 55 + private List<PcepLSObject> lsReportList;
55 56
56 - public static final PcepTEReportMsgVer1.Reader READER = new Reader(); 57 + public static final PcepLSReportMsgVer1.Reader READER = new Reader();
57 58
58 /** 59 /**
59 - * Reader class for reading PCPE te report message form channel buffer. 60 + * Reader class for reading PCEP LS-Report message form channel buffer.
60 */ 61 */
61 - static class Reader implements PcepMessageReader<PcepTEReportMsg> { 62 + static class Reader implements PcepMessageReader<PcepLSReportMsg> {
62 63
63 - LinkedList<PcepTEObject> teReportList; 64 + List<PcepLSObject> lsReportList;
64 65
65 @Override 66 @Override
66 - public PcepTEReportMsg readFrom(ChannelBuffer cb) throws PcepParseException { 67 + public PcepLSReportMsg readFrom(ChannelBuffer cb) throws PcepParseException {
67 68
68 if (cb.readableBytes() < PACKET_MINIMUM_LENGTH) { 69 if (cb.readableBytes() < PACKET_MINIMUM_LENGTH) {
69 return null; 70 return null;
70 } 71 }
71 72
72 - teReportList = new LinkedList<>(); 73 + lsReportList = new LinkedList<>();
73 74
74 byte version = cb.readByte(); 75 byte version = cb.readByte();
75 version = (byte) (version >> PcepMessageVer1.SHIFT_FLAG); 76 version = (byte) (version >> PcepMessageVer1.SHIFT_FLAG);
...@@ -79,7 +80,7 @@ class PcepTEReportMsgVer1 implements PcepTEReportMsg { ...@@ -79,7 +80,7 @@ class PcepTEReportMsgVer1 implements PcepTEReportMsg {
79 80
80 byte type = cb.readByte(); 81 byte type = cb.readByte();
81 if (type != MSG_TYPE.getType()) { 82 if (type != MSG_TYPE.getType()) {
82 - throw new PcepParseException("Wrong type. Expected=PcepType.TE_REPORT(14), got=" + type); 83 + throw new PcepParseException("Wrong type. Expected=PcepType.LS_REPORT(224), got=" + type);
83 } 84 }
84 85
85 short length = cb.readShort(); 86 short length = cb.readShort();
...@@ -88,45 +89,45 @@ class PcepTEReportMsgVer1 implements PcepTEReportMsg { ...@@ -88,45 +89,45 @@ class PcepTEReportMsgVer1 implements PcepTEReportMsg {
88 "Wrong length. Expected to be >= " + PACKET_MINIMUM_LENGTH + ", is: " + length); 89 "Wrong length. Expected to be >= " + PACKET_MINIMUM_LENGTH + ", is: " + length);
89 } 90 }
90 91
91 - // Parse state report list 92 + // Parse <ls-report-list>
92 - parseTEReportList(cb); 93 + parseLSReportList(cb);
93 94
94 - return new PcepTEReportMsgVer1(teReportList); 95 + return new PcepLSReportMsgVer1(lsReportList);
95 } 96 }
96 97
97 /** 98 /**
98 - * Parse te-report-list. 99 + * Parse ls-report-list.
99 * 100 *
100 * @param cb input Channel Buffer 101 * @param cb input Channel Buffer
101 - * @throws PcepParseException when fails to parse TE Report list. 102 + * @throws PcepParseException when fails to parse LS-Report list.
102 */ 103 */
103 - public void parseTEReportList(ChannelBuffer cb) throws PcepParseException { 104 + public void parseLSReportList(ChannelBuffer cb) throws PcepParseException {
104 - // <te-report-list> ::= <TE>[<te-report-list>] 105 + // <ls-report-list> ::= <LS>[<ls-report-list>]
105 106
106 while (0 < cb.readableBytes()) { 107 while (0 < cb.readableBytes()) {
107 - //store TE objectS 108 + //store LS objects
108 - if (!teReportList.add(PcepTEObjectVer1.read(cb))) { 109 + if (!lsReportList.add(PcepLSObjectVer1.read(cb))) {
109 - throw new PcepParseException("Failed to add TE object to TE report list"); 110 + throw new PcepParseException("Failed to add LS object to LS-Report list");
110 } 111 }
111 } 112 }
112 } 113 }
113 } 114 }
114 115
115 /** 116 /**
116 - * Constructor to initialize TE Report List. 117 + * Constructor to initialize LS-Report list.
117 * 118 *
118 - * @param teReportList list of PCEP TE Object 119 + * @param lsReportList list of PCEP LS Object
119 */ 120 */
120 - PcepTEReportMsgVer1(LinkedList<PcepTEObject> teReportList) { 121 + PcepLSReportMsgVer1(List<PcepLSObject> lsReportList) {
121 - this.teReportList = teReportList; 122 + this.lsReportList = lsReportList;
122 } 123 }
123 124
124 /** 125 /**
125 - * Builder class for PCEP te report message. 126 + * Builder class for PCEP LS-Report message.
126 */ 127 */
127 - static class Builder implements PcepTEReportMsg.Builder { 128 + static class Builder implements PcepLSReportMsg.Builder {
128 - // PCEP TE Report message fields 129 + // PCEP LS Report message fields
129 - LinkedList<PcepTEObject> teReportList; 130 + List<PcepLSObject> lsReportList;
130 131
131 @Override 132 @Override
132 public PcepVersion getVersion() { 133 public PcepVersion getVersion() {
...@@ -135,22 +136,22 @@ class PcepTEReportMsgVer1 implements PcepTEReportMsg { ...@@ -135,22 +136,22 @@ class PcepTEReportMsgVer1 implements PcepTEReportMsg {
135 136
136 @Override 137 @Override
137 public PcepType getType() { 138 public PcepType getType() {
138 - return PcepType.TE_REPORT; 139 + return PcepType.LS_REPORT;
139 } 140 }
140 141
141 @Override 142 @Override
142 - public PcepTEReportMsg build() { 143 + public PcepLSReportMsg build() {
143 - return new PcepTEReportMsgVer1(this.teReportList); 144 + return new PcepLSReportMsgVer1(this.lsReportList);
144 } 145 }
145 146
146 @Override 147 @Override
147 - public LinkedList<PcepTEObject> getTEReportList() { 148 + public List<PcepLSObject> getLSReportList() {
148 - return this.teReportList; 149 + return this.lsReportList;
149 } 150 }
150 151
151 @Override 152 @Override
152 - public Builder setTEReportList(LinkedList<PcepTEObject> ll) { 153 + public Builder setLSReportList(List<PcepLSObject> ll) {
153 - this.teReportList = ll; 154 + this.lsReportList = ll;
154 return this; 155 return this;
155 } 156 }
156 } 157 }
...@@ -163,12 +164,12 @@ class PcepTEReportMsgVer1 implements PcepTEReportMsg { ...@@ -163,12 +164,12 @@ class PcepTEReportMsgVer1 implements PcepTEReportMsg {
163 static final Writer WRITER = new Writer(); 164 static final Writer WRITER = new Writer();
164 165
165 /** 166 /**
166 - * Writer class for writing PCEP te report message to channel buffer. 167 + * Writer class for writing PCEP LS-Report message to channel buffer.
167 */ 168 */
168 - static class Writer implements PcepMessageWriter<PcepTEReportMsgVer1> { 169 + static class Writer implements PcepMessageWriter<PcepLSReportMsgVer1> {
169 170
170 @Override 171 @Override
171 - public void write(ChannelBuffer bb, PcepTEReportMsgVer1 message) throws PcepParseException { 172 + public void write(ChannelBuffer bb, PcepLSReportMsgVer1 message) throws PcepParseException {
172 173
173 int startIndex = bb.writerIndex(); 174 int startIndex = bb.writerIndex();
174 175
...@@ -183,11 +184,11 @@ class PcepTEReportMsgVer1 implements PcepTEReportMsg { ...@@ -183,11 +184,11 @@ class PcepTEReportMsgVer1 implements PcepTEReportMsg {
183 int msgLenIndex = bb.writerIndex(); 184 int msgLenIndex = bb.writerIndex();
184 bb.writeShort((short) 0); 185 bb.writeShort((short) 0);
185 186
186 - ListIterator<PcepTEObject> listIterator = message.teReportList.listIterator(); 187 + ListIterator<PcepLSObject> listIterator = message.lsReportList.listIterator();
187 188
188 while (listIterator.hasNext()) { 189 while (listIterator.hasNext()) {
189 - PcepTEObject teObj = listIterator.next(); 190 + PcepLSObject lsObj = listIterator.next();
190 - teObj.write(bb); 191 + lsObj.write(bb);
191 } 192 }
192 193
193 // update message length field 194 // update message length field
...@@ -207,19 +208,19 @@ class PcepTEReportMsgVer1 implements PcepTEReportMsg { ...@@ -207,19 +208,19 @@ class PcepTEReportMsgVer1 implements PcepTEReportMsg {
207 } 208 }
208 209
209 @Override 210 @Override
210 - public LinkedList<PcepTEObject> getTEReportList() { 211 + public List<PcepLSObject> getLSReportList() {
211 - return this.teReportList; 212 + return this.lsReportList;
212 } 213 }
213 214
214 @Override 215 @Override
215 - public void setTEReportList(LinkedList<PcepTEObject> ll) { 216 + public void setLSReportList(List<PcepLSObject> ll) {
216 - this.teReportList = ll; 217 + this.lsReportList = ll;
217 } 218 }
218 219
219 @Override 220 @Override
220 public String toString() { 221 public String toString() {
221 return MoreObjects.toStringHelper(getClass()) 222 return MoreObjects.toStringHelper(getClass())
222 - .add("TeReportList", teReportList) 223 + .add("LSReportList", lsReportList)
223 .toString(); 224 .toString();
224 } 225 }
225 } 226 }
......
...@@ -56,7 +56,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { ...@@ -56,7 +56,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject {
56 protected static final Logger log = LoggerFactory.getLogger(PcepLspObjectVer1.class); 56 protected static final Logger log = LoggerFactory.getLogger(PcepLspObjectVer1.class);
57 57
58 public static final byte LABEL_OBJ_TYPE = 1; 58 public static final byte LABEL_OBJ_TYPE = 1;
59 - public static final byte LABEL_OBJ_CLASS = 35; //TBD : to be defined 59 + public static final byte LABEL_OBJ_CLASS = (byte) 225;
60 public static final byte LABEL_OBJECT_VERSION = 1; 60 public static final byte LABEL_OBJECT_VERSION = 1;
61 public static final byte OBJECT_HEADER_LENGTH = 4; 61 public static final byte OBJECT_HEADER_LENGTH = 4;
62 public static final boolean DEFAULT_OFLAG = false; 62 public static final boolean DEFAULT_OFLAG = false;
......
...@@ -17,10 +17,12 @@ ...@@ -17,10 +17,12 @@
17 package org.onosproject.pcepio.protocol.ver1; 17 package org.onosproject.pcepio.protocol.ver1;
18 18
19 import org.jboss.netty.buffer.ChannelBuffer; 19 import org.jboss.netty.buffer.ChannelBuffer;
20 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
20 import org.onosproject.pcepio.exceptions.PcepParseException; 21 import org.onosproject.pcepio.exceptions.PcepParseException;
21 import org.onosproject.pcepio.protocol.PcepFactories; 22 import org.onosproject.pcepio.protocol.PcepFactories;
22 import org.onosproject.pcepio.protocol.PcepMessage; 23 import org.onosproject.pcepio.protocol.PcepMessage;
23 import org.onosproject.pcepio.protocol.PcepMessageReader; 24 import org.onosproject.pcepio.protocol.PcepMessageReader;
25 +import org.onosproject.pcepio.protocol.PcepType;
24 import org.onosproject.pcepio.types.PcepErrorDetailInfo; 26 import org.onosproject.pcepio.types.PcepErrorDetailInfo;
25 import org.slf4j.Logger; 27 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 28 import org.slf4j.LoggerFactory;
...@@ -33,21 +35,11 @@ public abstract class PcepMessageVer1 { ...@@ -33,21 +35,11 @@ public abstract class PcepMessageVer1 {
33 protected static final Logger log = LoggerFactory.getLogger(PcepFactories.class); 35 protected static final Logger log = LoggerFactory.getLogger(PcepFactories.class);
34 36
35 // version: 1.0 37 // version: 1.0
36 - static final byte WIRE_VERSION = 1; 38 + public static final byte WIRE_VERSION = 1;
37 - static final int MINIMUM_LENGTH = 4; 39 + public static final int MINIMUM_LENGTH = 4;
38 - static final int PACKET_VERSION = 1; 40 + public static final int PACKET_VERSION = 1;
39 - static final byte OPEN_MSG_TYPE = 0x1;
40 - static final byte KEEPALIVE_MSG_TYPE = 0x2;
41 - static final byte REPORT_MSG_TYPE = 0xa;
42 - static final byte TE_REPORT_MSG_TYPE = 0xe;
43 - static final byte UPDATE_MSG_TYPE = 0xb;
44 - static final byte INITIATE_MSG_TYPE = 0xc;
45 - static final byte CLOSE_MSG_TYPE = 0x7;
46 - static final byte ERROR_MSG_TYPE = 0x6;
47 - static final byte LABEL_UPDATE_MSG_TYPE = 0xD;
48 - static final byte LABEL_RANGE_RESV_MSG_TYPE = 0xF;
49 public static final int SHIFT_FLAG = 5; 41 public static final int SHIFT_FLAG = 5;
50 - static final int MINIMUM_COMMON_HEADER_LENGTH = 4; 42 + public static final int MINIMUM_COMMON_HEADER_LENGTH = 4;
51 43
52 public static final PcepMessageVer1.Reader READER = new Reader(); 44 public static final PcepMessageVer1.Reader READER = new Reader();
53 45
...@@ -56,7 +48,7 @@ public abstract class PcepMessageVer1 { ...@@ -56,7 +48,7 @@ public abstract class PcepMessageVer1 {
56 */ 48 */
57 static class Reader implements PcepMessageReader<PcepMessage> { 49 static class Reader implements PcepMessageReader<PcepMessage> {
58 @Override 50 @Override
59 - public PcepMessage readFrom(ChannelBuffer cb) throws PcepParseException { 51 + public PcepMessage readFrom(ChannelBuffer cb) throws PcepParseException, PcepOutOfBoundMessageException {
60 52
61 if (cb.readableBytes() < MINIMUM_LENGTH) { 53 if (cb.readableBytes() < MINIMUM_LENGTH) {
62 throw new PcepParseException("Packet should have minimum length: " + MINIMUM_LENGTH); 54 throw new PcepParseException("Packet should have minimum length: " + MINIMUM_LENGTH);
...@@ -75,53 +67,43 @@ public abstract class PcepMessageVer1 { ...@@ -75,53 +67,43 @@ public abstract class PcepMessageVer1 {
75 short length = cb.readShort(); 67 short length = cb.readShort();
76 cb.readerIndex(start); 68 cb.readerIndex(start);
77 69
78 - switch (type) { 70 + // Check the out-of-bound message.
71 + // If the message is out-of-bound then throw PcepOutOfBoundException.
72 + if ((length - MINIMUM_COMMON_HEADER_LENGTH) > cb.readableBytes()) {
73 + throw new PcepOutOfBoundMessageException("Message is out-of-bound.");
74 + }
79 75
80 - case OPEN_MSG_TYPE: 76 + if (type == (byte) PcepType.OPEN.getType()) {
81 log.debug("OPEN MESSAGE is received"); 77 log.debug("OPEN MESSAGE is received");
82 - // message type value 1 means it is open message
83 return PcepOpenMsgVer1.READER.readFrom(cb.readBytes(length)); 78 return PcepOpenMsgVer1.READER.readFrom(cb.readBytes(length));
84 - case KEEPALIVE_MSG_TYPE: 79 + } else if (type == (byte) PcepType.KEEP_ALIVE.getType()) {
85 log.debug("KEEPALIVE MESSAGE is received"); 80 log.debug("KEEPALIVE MESSAGE is received");
86 - // message type value 2 means it is Keepalive message
87 return PcepKeepaliveMsgVer1.READER.readFrom(cb.readBytes(length)); 81 return PcepKeepaliveMsgVer1.READER.readFrom(cb.readBytes(length));
88 - case ERROR_MSG_TYPE: 82 + } else if (type == (byte) PcepType.ERROR.getType()) {
89 log.debug("ERROR MESSAGE is received"); 83 log.debug("ERROR MESSAGE is received");
90 - // message type value 6 means it is error message
91 return PcepErrorMsgVer1.READER.readFrom(cb.readBytes(length)); 84 return PcepErrorMsgVer1.READER.readFrom(cb.readBytes(length));
92 - case REPORT_MSG_TYPE: 85 + } else if (type == (byte) PcepType.CLOSE.getType()) {
86 + log.debug("CLOSE MESSAGE is received");
87 + return PcepCloseMsgVer1.READER.readFrom(cb.readBytes(length));
88 + } else if (type == (byte) PcepType.REPORT.getType()) {
93 log.debug("REPORT MESSAGE is received"); 89 log.debug("REPORT MESSAGE is received");
94 - // message type value 10 means it is Report message
95 - // return
96 return PcepReportMsgVer1.READER.readFrom(cb.readBytes(length)); 90 return PcepReportMsgVer1.READER.readFrom(cb.readBytes(length));
97 - case UPDATE_MSG_TYPE: 91 + } else if (type == (byte) PcepType.UPDATE.getType()) {
98 log.debug("UPDATE MESSAGE is received"); 92 log.debug("UPDATE MESSAGE is received");
99 - //message type value 11 means it is Update message
100 return PcepUpdateMsgVer1.READER.readFrom(cb.readBytes(length)); 93 return PcepUpdateMsgVer1.READER.readFrom(cb.readBytes(length));
101 - case INITIATE_MSG_TYPE: 94 + } else if (type == (byte) PcepType.INITIATE.getType()) {
102 log.debug("INITIATE MESSAGE is received"); 95 log.debug("INITIATE MESSAGE is received");
103 - //message type value 12 means it is PcInitiate message
104 return PcepInitiateMsgVer1.READER.readFrom(cb.readBytes(length)); 96 return PcepInitiateMsgVer1.READER.readFrom(cb.readBytes(length));
105 - case CLOSE_MSG_TYPE: 97 + } else if (type == (byte) PcepType.LS_REPORT.getType()) {
106 - log.debug("CLOSE MESSAGE is received"); 98 + log.debug("LS REPORT MESSAGE is received");
107 - // message type value 7 means it is Close message 99 + return PcepLSReportMsgVer1.READER.readFrom(cb.readBytes(length));
108 - return PcepCloseMsgVer1.READER.readFrom(cb.readBytes(length)); 100 + } else if (type == (byte) PcepType.LABEL_RANGE_RESERV.getType()) {
109 - case TE_REPORT_MSG_TYPE:
110 - log.debug("TE REPORT MESSAGE is received");
111 - // message type value 14 means it is TE REPORT message
112 - // return
113 - return PcepTEReportMsgVer1.READER.readFrom(cb.readBytes(length));
114 - case LABEL_UPDATE_MSG_TYPE:
115 - log.debug("LABEL UPDATE MESSAGE is received");
116 - // message type value 13 means it is LABEL UPDATE message
117 - // return
118 - return PcepLabelUpdateMsgVer1.READER.readFrom(cb.readBytes(length));
119 - case LABEL_RANGE_RESV_MSG_TYPE:
120 log.debug("LABEL RANGE RESERVE MESSAGE is received"); 101 log.debug("LABEL RANGE RESERVE MESSAGE is received");
121 - // message type value 15 means it is LABEL RANGE RESERVE message
122 - // return
123 return PcepLabelRangeResvMsgVer1.READER.readFrom(cb.readBytes(length)); 102 return PcepLabelRangeResvMsgVer1.READER.readFrom(cb.readBytes(length));
124 - default: 103 + } else if (type == (byte) PcepType.LABEL_UPDATE.getType()) {
104 + log.debug("LABEL UPDATE MESSAGE is received");
105 + return PcepLabelUpdateMsgVer1.READER.readFrom(cb.readBytes(length));
106 + } else {
125 throw new PcepParseException("ERROR: UNKNOWN MESSAGE is received. Msg Type: " + type); 107 throw new PcepParseException("ERROR: UNKNOWN MESSAGE is received. Msg Type: " + type);
126 } 108 }
127 } catch (IndexOutOfBoundsException e) { 109 } catch (IndexOutOfBoundsException e) {
......
...@@ -31,7 +31,7 @@ import org.onosproject.pcepio.types.PcepObjectHeader; ...@@ -31,7 +31,7 @@ import org.onosproject.pcepio.types.PcepObjectHeader;
31 import org.onosproject.pcepio.types.PcepValueType; 31 import org.onosproject.pcepio.types.PcepValueType;
32 import org.onosproject.pcepio.types.StatefulLspDbVerTlv; 32 import org.onosproject.pcepio.types.StatefulLspDbVerTlv;
33 import org.onosproject.pcepio.types.StatefulPceCapabilityTlv; 33 import org.onosproject.pcepio.types.StatefulPceCapabilityTlv;
34 -import org.onosproject.pcepio.types.TedCapabilityTlv; 34 +import org.onosproject.pcepio.types.LsCapabilityTlv;
35 import org.slf4j.Logger; 35 import org.slf4j.Logger;
36 import org.slf4j.LoggerFactory; 36 import org.slf4j.LoggerFactory;
37 37
...@@ -252,13 +252,13 @@ public class PcepOpenObjectVer1 implements PcepOpenObject { ...@@ -252,13 +252,13 @@ public class PcepOpenObjectVer1 implements PcepOpenObject {
252 long lValue = cb.readLong(); 252 long lValue = cb.readLong();
253 tlv = new StatefulLspDbVerTlv(lValue); 253 tlv = new StatefulLspDbVerTlv(lValue);
254 break; 254 break;
255 - case TedCapabilityTlv.TYPE: 255 + case LsCapabilityTlv.TYPE:
256 - log.debug("TedCapabilityTlv"); 256 + log.debug("LsCapabilityTlv");
257 - if (TedCapabilityTlv.LENGTH != hLength) { 257 + if (LsCapabilityTlv.LENGTH != hLength) {
258 - throw new PcepParseException("Invalid length received for TedCapabilityTlv."); 258 + throw new PcepParseException("Invalid length received for LsCapabilityTlv.");
259 } 259 }
260 iValue = cb.readInt(); 260 iValue = cb.readInt();
261 - tlv = new TedCapabilityTlv(iValue); 261 + tlv = new LsCapabilityTlv(iValue);
262 break; 262 break;
263 case PcepLabelDbVerTlv.TYPE: 263 case PcepLabelDbVerTlv.TYPE:
264 log.debug("PcepLabelDbVerTlv"); 264 log.debug("PcepLabelDbVerTlv");
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides Administrative Group Tlv which contains value (32 Bit ). 28 * Provides Administrative Group Tlv which contains value (32 Bit ).
29 */ 29 */
30 -public class AdministrativeGroupTlv implements PcepValueType { 30 +public class AdministrativeGroupSubTlv implements PcepValueType {
31 31
32 /* REFERENCE :[RFC5305]/3.1 32 /* REFERENCE :[RFC5305]/3.1
33 * 0 1 2 3 33 * 0 1 2 3
...@@ -39,9 +39,9 @@ public class AdministrativeGroupTlv implements PcepValueType { ...@@ -39,9 +39,9 @@ public class AdministrativeGroupTlv implements PcepValueType {
39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 */ 40 */
41 41
42 - protected static final Logger log = LoggerFactory.getLogger(AdministrativeGroupTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(AdministrativeGroupSubTlv.class);
43 43
44 - public static final short TYPE = 3; //TDB33 44 + public static final short TYPE = 22;
45 public static final short LENGTH = 4; 45 public static final short LENGTH = 4;
46 46
47 private final int rawValue; 47 private final int rawValue;
...@@ -51,7 +51,7 @@ public class AdministrativeGroupTlv implements PcepValueType { ...@@ -51,7 +51,7 @@ public class AdministrativeGroupTlv implements PcepValueType {
51 * 51 *
52 * @param rawValue of Administrative-Group-Tlv. 52 * @param rawValue of Administrative-Group-Tlv.
53 */ 53 */
54 - public AdministrativeGroupTlv(int rawValue) { 54 + public AdministrativeGroupSubTlv(int rawValue) {
55 this.rawValue = rawValue; 55 this.rawValue = rawValue;
56 } 56 }
57 57
...@@ -61,8 +61,8 @@ public class AdministrativeGroupTlv implements PcepValueType { ...@@ -61,8 +61,8 @@ public class AdministrativeGroupTlv implements PcepValueType {
61 * @param raw value. 61 * @param raw value.
62 * @return object of Administrative-Group-Tlv 62 * @return object of Administrative-Group-Tlv
63 */ 63 */
64 - public static AdministrativeGroupTlv of(final int raw) { 64 + public static AdministrativeGroupSubTlv of(final int raw) {
65 - return new AdministrativeGroupTlv(raw); 65 + return new AdministrativeGroupSubTlv(raw);
66 } 66 }
67 67
68 /** 68 /**
...@@ -99,8 +99,8 @@ public class AdministrativeGroupTlv implements PcepValueType { ...@@ -99,8 +99,8 @@ public class AdministrativeGroupTlv implements PcepValueType {
99 if (this == obj) { 99 if (this == obj) {
100 return true; 100 return true;
101 } 101 }
102 - if (obj instanceof AdministrativeGroupTlv) { 102 + if (obj instanceof AdministrativeGroupSubTlv) {
103 - AdministrativeGroupTlv other = (AdministrativeGroupTlv) obj; 103 + AdministrativeGroupSubTlv other = (AdministrativeGroupSubTlv) obj;
104 return Objects.equals(rawValue, other.rawValue); 104 return Objects.equals(rawValue, other.rawValue);
105 } 105 }
106 return false; 106 return false;
...@@ -121,8 +121,8 @@ public class AdministrativeGroupTlv implements PcepValueType { ...@@ -121,8 +121,8 @@ public class AdministrativeGroupTlv implements PcepValueType {
121 * @param c input channel buffer 121 * @param c input channel buffer
122 * @return object of Administrative-Group-Tlv 122 * @return object of Administrative-Group-Tlv
123 */ 123 */
124 - public static AdministrativeGroupTlv read(ChannelBuffer c) { 124 + public static AdministrativeGroupSubTlv read(ChannelBuffer c) {
125 - return AdministrativeGroupTlv.of(c.readInt()); 125 + return AdministrativeGroupSubTlv.of(c.readInt());
126 } 126 }
127 127
128 @Override 128 @Override
......
1 +/*
2 + * Copyright 2015 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
17 +/**
18 + * @author b00295750
19 + *
20 + */
21 +package org.onosproject.pcepio.types;
22 +
23 +import java.util.Objects;
24 +
25 +import org.jboss.netty.buffer.ChannelBuffer;
26 +import org.onosproject.pcepio.protocol.PcepVersion;
27 +import org.slf4j.Logger;
28 +import org.slf4j.LoggerFactory;
29 +
30 +import com.google.common.base.MoreObjects;
31 +
32 +/**
33 + * Provides Autonomous system number sub object.
34 + */
35 +public class AutonomousSystemNumberSubObject implements PcepValueType {
36 +
37 + /*Reference : RFC 3209 : 4.3.3.4
38 + * 0 1 2 3
39 + 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 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 + |L| Type | Length | AS number (2-octet) |
42 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
43 + */
44 + protected static final Logger log = LoggerFactory.getLogger(AutonomousSystemNumberSubObject.class);
45 +
46 + public static final byte TYPE = (byte) 0x32;
47 + public static final byte LENGTH = 4;
48 + public static final byte VALUE_LENGTH = 2;
49 + public static final byte OBJ_LENGTH = 4;
50 + public static final byte LBIT = 0;
51 + public static final int SHIFT_LBIT_POSITION = 7;
52 + private short asNumber;
53 +
54 + /**
55 + * Constructor to initialize AS number.
56 + *
57 + * @param asNumber AS number
58 + */
59 + public AutonomousSystemNumberSubObject(short asNumber) {
60 + this.asNumber = asNumber;
61 + }
62 +
63 + /**
64 + * Returns a new instance of AutonomousSystemNumberSubObject.
65 + *
66 + * @param asNumber AS number
67 + * @return object of AutonomousSystemNumberSubObject
68 + */
69 + public static AutonomousSystemNumberSubObject of(short asNumber) {
70 + return new AutonomousSystemNumberSubObject(asNumber);
71 + }
72 +
73 + /**
74 + * Returns value of AS number.
75 + *
76 + * @return value of AS number
77 + */
78 + public short getAsNumber() {
79 + return asNumber;
80 + }
81 +
82 + @Override
83 + public PcepVersion getVersion() {
84 + return PcepVersion.PCEP_1;
85 + }
86 +
87 + @Override
88 + public short getType() {
89 + return TYPE;
90 + }
91 +
92 + @Override
93 + public short getLength() {
94 + return LENGTH;
95 + }
96 +
97 + @Override
98 + public int hashCode() {
99 + return Objects.hash(asNumber);
100 + }
101 +
102 + @Override
103 + public boolean equals(Object obj) {
104 + if (this == obj) {
105 + return true;
106 + }
107 + if (obj instanceof AutonomousSystemNumberSubObject) {
108 + AutonomousSystemNumberSubObject other = (AutonomousSystemNumberSubObject) obj;
109 + return Objects.equals(this.asNumber, other.asNumber);
110 + }
111 + return false;
112 + }
113 +
114 + /**
115 + * Reads the channel buffer and returns object of AutonomousSystemNumberSubObject.
116 + *
117 + * @param c type of channel buffer
118 + * @return object of AutonomousSystemNumberSubObject
119 + */
120 + public static PcepValueType read(ChannelBuffer c) {
121 + short asNumber = c.readShort();
122 + return new AutonomousSystemNumberSubObject(asNumber);
123 + }
124 +
125 + @Override
126 + public int write(ChannelBuffer c) {
127 + int iLenStartIndex = c.writerIndex();
128 + byte bValue = LBIT;
129 + bValue = (byte) (bValue << SHIFT_LBIT_POSITION);
130 + bValue = (byte) (bValue | TYPE);
131 + c.writeByte(bValue);
132 + c.writeByte(OBJ_LENGTH);
133 + c.writeShort(asNumber);
134 +
135 + return c.writerIndex() - iLenStartIndex;
136 + }
137 +
138 + @Override
139 + public String toString() {
140 + return MoreObjects.toStringHelper(getClass())
141 + .add("Type", TYPE)
142 + .add("Length", LENGTH)
143 + .add("AsNumber", asNumber)
144 + .toString();
145 + }
146 +}
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides Autonomous-System-Tlv which contains opaque value (32 Bit AS Number). 28 * Provides Autonomous-System-Tlv which contains opaque value (32 Bit AS Number).
29 */ 29 */
30 -public class AutonomousSystemTlv implements PcepValueType { 30 +public class AutonomousSystemSubTlv implements PcepValueType {
31 31
32 /* Reference :RFC3209 32 /* Reference :RFC3209
33 * 0 1 2 3 33 * 0 1 2 3
...@@ -39,9 +39,9 @@ public class AutonomousSystemTlv implements PcepValueType { ...@@ -39,9 +39,9 @@ public class AutonomousSystemTlv implements PcepValueType {
39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 */ 40 */
41 41
42 - protected static final Logger log = LoggerFactory.getLogger(AutonomousSystemTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(AutonomousSystemSubTlv.class);
43 43
44 - public static final short TYPE = 100; //TODD:change this TBD10 44 + public static final short TYPE = 1;
45 public static final short LENGTH = 4; 45 public static final short LENGTH = 4;
46 46
47 private final int rawValue; 47 private final int rawValue;
...@@ -51,7 +51,7 @@ public class AutonomousSystemTlv implements PcepValueType { ...@@ -51,7 +51,7 @@ public class AutonomousSystemTlv implements PcepValueType {
51 * 51 *
52 * @param rawValue Autonomous-System-Tlv 52 * @param rawValue Autonomous-System-Tlv
53 */ 53 */
54 - public AutonomousSystemTlv(int rawValue) { 54 + public AutonomousSystemSubTlv(int rawValue) {
55 this.rawValue = rawValue; 55 this.rawValue = rawValue;
56 } 56 }
57 57
...@@ -61,8 +61,8 @@ public class AutonomousSystemTlv implements PcepValueType { ...@@ -61,8 +61,8 @@ public class AutonomousSystemTlv implements PcepValueType {
61 * @param raw value of opaque. 61 * @param raw value of opaque.
62 * @return object of Autonomous-System-Tlv 62 * @return object of Autonomous-System-Tlv
63 */ 63 */
64 - public static AutonomousSystemTlv of(final int raw) { 64 + public static AutonomousSystemSubTlv of(final int raw) {
65 - return new AutonomousSystemTlv(raw); 65 + return new AutonomousSystemSubTlv(raw);
66 } 66 }
67 67
68 /** 68 /**
...@@ -99,8 +99,8 @@ public class AutonomousSystemTlv implements PcepValueType { ...@@ -99,8 +99,8 @@ public class AutonomousSystemTlv implements PcepValueType {
99 if (this == obj) { 99 if (this == obj) {
100 return true; 100 return true;
101 } 101 }
102 - if (obj instanceof AutonomousSystemTlv) { 102 + if (obj instanceof AutonomousSystemSubTlv) {
103 - AutonomousSystemTlv other = (AutonomousSystemTlv) obj; 103 + AutonomousSystemSubTlv other = (AutonomousSystemSubTlv) obj;
104 return Objects.equals(rawValue, other.rawValue); 104 return Objects.equals(rawValue, other.rawValue);
105 } 105 }
106 return false; 106 return false;
...@@ -121,8 +121,8 @@ public class AutonomousSystemTlv implements PcepValueType { ...@@ -121,8 +121,8 @@ public class AutonomousSystemTlv implements PcepValueType {
121 * @param c input channel buffer 121 * @param c input channel buffer
122 * @return object of Autonomous-System-Tlv 122 * @return object of Autonomous-System-Tlv
123 */ 123 */
124 - public static AutonomousSystemTlv read(ChannelBuffer c) { 124 + public static AutonomousSystemSubTlv read(ChannelBuffer c) {
125 - return AutonomousSystemTlv.of(c.readInt()); 125 + return AutonomousSystemSubTlv.of(c.readInt());
126 } 126 }
127 127
128 @Override 128 @Override
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides BGP LS identifier which contains opaque value (32 Bit ID). 28 * Provides BGP LS identifier which contains opaque value (32 Bit ID).
29 */ 29 */
30 -public class BgpLsIdentifierTlv implements PcepValueType { 30 +public class BgpLsIdentifierSubTlv implements PcepValueType {
31 31
32 /* Reference :draft-ietf-idr-ls-distribution-10 32 /* Reference :draft-ietf-idr-ls-distribution-10
33 * 0 1 2 3 33 * 0 1 2 3
...@@ -39,9 +39,9 @@ public class BgpLsIdentifierTlv implements PcepValueType { ...@@ -39,9 +39,9 @@ public class BgpLsIdentifierTlv implements PcepValueType {
39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 */ 40 */
41 41
42 - protected static final Logger log = LoggerFactory.getLogger(BgpLsIdentifierTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(BgpLsIdentifierSubTlv.class);
43 43
44 - public static final short TYPE = 17; //TODD:change this TBD11 44 + public static final short TYPE = 2;
45 public static final short LENGTH = 4; 45 public static final short LENGTH = 4;
46 46
47 private final int rawValue; 47 private final int rawValue;
...@@ -51,7 +51,7 @@ public class BgpLsIdentifierTlv implements PcepValueType { ...@@ -51,7 +51,7 @@ public class BgpLsIdentifierTlv implements PcepValueType {
51 * 51 *
52 * @param rawValue BGP LS identifier Tlv 52 * @param rawValue BGP LS identifier Tlv
53 */ 53 */
54 - public BgpLsIdentifierTlv(int rawValue) { 54 + public BgpLsIdentifierSubTlv(int rawValue) {
55 this.rawValue = rawValue; 55 this.rawValue = rawValue;
56 } 56 }
57 57
...@@ -61,8 +61,8 @@ public class BgpLsIdentifierTlv implements PcepValueType { ...@@ -61,8 +61,8 @@ public class BgpLsIdentifierTlv implements PcepValueType {
61 * @param raw value 61 * @param raw value
62 * @return object of BGPLSidentifierTlv 62 * @return object of BGPLSidentifierTlv
63 */ 63 */
64 - public static BgpLsIdentifierTlv of(final int raw) { 64 + public static BgpLsIdentifierSubTlv of(final int raw) {
65 - return new BgpLsIdentifierTlv(raw); 65 + return new BgpLsIdentifierSubTlv(raw);
66 } 66 }
67 67
68 /** 68 /**
...@@ -99,8 +99,8 @@ public class BgpLsIdentifierTlv implements PcepValueType { ...@@ -99,8 +99,8 @@ public class BgpLsIdentifierTlv implements PcepValueType {
99 if (this == obj) { 99 if (this == obj) {
100 return true; 100 return true;
101 } 101 }
102 - if (obj instanceof BgpLsIdentifierTlv) { 102 + if (obj instanceof BgpLsIdentifierSubTlv) {
103 - BgpLsIdentifierTlv other = (BgpLsIdentifierTlv) obj; 103 + BgpLsIdentifierSubTlv other = (BgpLsIdentifierSubTlv) obj;
104 return Objects.equals(rawValue, other.rawValue); 104 return Objects.equals(rawValue, other.rawValue);
105 } 105 }
106 return false; 106 return false;
...@@ -121,8 +121,8 @@ public class BgpLsIdentifierTlv implements PcepValueType { ...@@ -121,8 +121,8 @@ public class BgpLsIdentifierTlv implements PcepValueType {
121 * @param c input channel buffer 121 * @param c input channel buffer
122 * @return object of BGP LS identifier Tlv 122 * @return object of BGP LS identifier Tlv
123 */ 123 */
124 - public static BgpLsIdentifierTlv read(ChannelBuffer c) { 124 + public static BgpLsIdentifierSubTlv read(ChannelBuffer c) {
125 - return BgpLsIdentifierTlv.of(c.readInt()); 125 + return BgpLsIdentifierSubTlv.of(c.readInt());
126 } 126 }
127 127
128 @Override 128 @Override
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
16 package org.onosproject.pcepio.types; 16 package org.onosproject.pcepio.types;
17 17
18 import java.util.LinkedList; 18 import java.util.LinkedList;
19 +import java.util.List;
19 import java.util.ListIterator; 20 import java.util.ListIterator;
20 21
21 import org.jboss.netty.buffer.ChannelBuffer; 22 import org.jboss.netty.buffer.ChannelBuffer;
...@@ -32,7 +33,7 @@ import com.google.common.base.MoreObjects; ...@@ -32,7 +33,7 @@ import com.google.common.base.MoreObjects;
32 */ 33 */
33 public class ErrorObjListWithOpen { 34 public class ErrorObjListWithOpen {
34 //errorObjList is mandatory 35 //errorObjList is mandatory
35 - private LinkedList<PcepErrorObject> llerrorObjList; 36 + private List<PcepErrorObject> llerrorObjList;
36 // openObject is optional 37 // openObject is optional
37 private PcepOpenObject openObject; 38 private PcepOpenObject openObject;
38 // flag to check if open object is set or not 39 // flag to check if open object is set or not
...@@ -45,7 +46,7 @@ public class ErrorObjListWithOpen { ...@@ -45,7 +46,7 @@ public class ErrorObjListWithOpen {
45 * @param errObj ERROR object list 46 * @param errObj ERROR object list
46 * @param openObj OPEN object 47 * @param openObj OPEN object
47 */ 48 */
48 - public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj, PcepOpenObject openObj) { 49 + public ErrorObjListWithOpen(List<PcepErrorObject> errObj, PcepOpenObject openObj) {
49 this.llerrorObjList = errObj; 50 this.llerrorObjList = errObj;
50 this.openObject = openObj; 51 this.openObject = openObj;
51 if (openObj != null) { 52 if (openObj != null) {
...@@ -60,7 +61,7 @@ public class ErrorObjListWithOpen { ...@@ -60,7 +61,7 @@ public class ErrorObjListWithOpen {
60 * 61 *
61 * @param errObj ERROR Object list 62 * @param errObj ERROR Object list
62 */ 63 */
63 - public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj) { 64 + public ErrorObjListWithOpen(List<PcepErrorObject> errObj) {
64 this.llerrorObjList = errObj; 65 this.llerrorObjList = errObj;
65 this.openObject = null; 66 this.openObject = null;
66 isOpenObjectSet = false; 67 isOpenObjectSet = false;
...@@ -71,8 +72,8 @@ public class ErrorObjListWithOpen { ...@@ -71,8 +72,8 @@ public class ErrorObjListWithOpen {
71 * 72 *
72 * @return error types list 73 * @return error types list
73 */ 74 */
74 - public LinkedList<Integer> getErrorType() { 75 + public List<Integer> getErrorType() {
75 - LinkedList<Integer> errorType = new LinkedList<>(); 76 + List<Integer> errorType = new LinkedList<>();
76 if (llerrorObjList != null) { 77 if (llerrorObjList != null) {
77 ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator(); 78 ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator();
78 int error; 79 int error;
...@@ -91,8 +92,8 @@ public class ErrorObjListWithOpen { ...@@ -91,8 +92,8 @@ public class ErrorObjListWithOpen {
91 * 92 *
92 * @return error values list 93 * @return error values list
93 */ 94 */
94 - public LinkedList<Integer> getErrorValue() { 95 + public List<Integer> getErrorValue() {
95 - LinkedList<Integer> errorValue = new LinkedList<>(); 96 + List<Integer> errorValue = new LinkedList<>();
96 if (llerrorObjList != null) { 97 if (llerrorObjList != null) {
97 ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator(); 98 ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator();
98 int error; 99 int error;
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides IPv4 Interface Address . 28 * Provides IPv4 Interface Address .
29 */ 29 */
30 -public class IPv4InterfaceAddressTlv implements PcepValueType { 30 +public class IPv4InterfaceAddressSubTlv implements PcepValueType {
31 31
32 /* 32 /*
33 * reference :[RFC5305]/3.2 33 * reference :[RFC5305]/3.2
...@@ -40,9 +40,9 @@ public class IPv4InterfaceAddressTlv implements PcepValueType { ...@@ -40,9 +40,9 @@ public class IPv4InterfaceAddressTlv implements PcepValueType {
40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 */ 41 */
42 42
43 - protected static final Logger log = LoggerFactory.getLogger(IPv4InterfaceAddressTlv.class); 43 + protected static final Logger log = LoggerFactory.getLogger(IPv4InterfaceAddressSubTlv.class);
44 44
45 - public static final short TYPE = 6; 45 + public static final short TYPE = 7;
46 public static final short LENGTH = 4; 46 public static final short LENGTH = 4;
47 47
48 private final int rawValue; 48 private final int rawValue;
...@@ -52,7 +52,7 @@ public class IPv4InterfaceAddressTlv implements PcepValueType { ...@@ -52,7 +52,7 @@ public class IPv4InterfaceAddressTlv implements PcepValueType {
52 * 52 *
53 * @param rawValue of IPv4-Interface-Address. 53 * @param rawValue of IPv4-Interface-Address.
54 */ 54 */
55 - public IPv4InterfaceAddressTlv(int rawValue) { 55 + public IPv4InterfaceAddressSubTlv(int rawValue) {
56 this.rawValue = rawValue; 56 this.rawValue = rawValue;
57 } 57 }
58 58
...@@ -62,8 +62,8 @@ public class IPv4InterfaceAddressTlv implements PcepValueType { ...@@ -62,8 +62,8 @@ public class IPv4InterfaceAddressTlv implements PcepValueType {
62 * @param raw value of IPv4-Interface-Address 62 * @param raw value of IPv4-Interface-Address
63 * @return object of IPv4-Interface-Address-Tlv 63 * @return object of IPv4-Interface-Address-Tlv
64 */ 64 */
65 - public static IPv4InterfaceAddressTlv of(final int raw) { 65 + public static IPv4InterfaceAddressSubTlv of(final int raw) {
66 - return new IPv4InterfaceAddressTlv(raw); 66 + return new IPv4InterfaceAddressSubTlv(raw);
67 } 67 }
68 68
69 /** 69 /**
...@@ -100,8 +100,8 @@ public class IPv4InterfaceAddressTlv implements PcepValueType { ...@@ -100,8 +100,8 @@ public class IPv4InterfaceAddressTlv implements PcepValueType {
100 if (this == obj) { 100 if (this == obj) {
101 return true; 101 return true;
102 } 102 }
103 - if (obj instanceof IPv4InterfaceAddressTlv) { 103 + if (obj instanceof IPv4InterfaceAddressSubTlv) {
104 - IPv4InterfaceAddressTlv other = (IPv4InterfaceAddressTlv) obj; 104 + IPv4InterfaceAddressSubTlv other = (IPv4InterfaceAddressSubTlv) obj;
105 return Objects.equals(rawValue, other.rawValue); 105 return Objects.equals(rawValue, other.rawValue);
106 } 106 }
107 return false; 107 return false;
...@@ -122,8 +122,8 @@ public class IPv4InterfaceAddressTlv implements PcepValueType { ...@@ -122,8 +122,8 @@ public class IPv4InterfaceAddressTlv implements PcepValueType {
122 * @param c input channel buffer 122 * @param c input channel buffer
123 * @return object of IPv4-Interface-Address-Tlv 123 * @return object of IPv4-Interface-Address-Tlv
124 */ 124 */
125 - public static IPv4InterfaceAddressTlv read(ChannelBuffer c) { 125 + public static IPv4InterfaceAddressSubTlv read(ChannelBuffer c) {
126 - return IPv4InterfaceAddressTlv.of(c.readInt()); 126 + return IPv4InterfaceAddressSubTlv.of(c.readInt());
127 } 127 }
128 128
129 @Override 129 @Override
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides IPv4 Neighbor Address . 28 * Provides IPv4 Neighbor Address .
29 */ 29 */
30 -public class IPv4NeighborAddressTlv implements PcepValueType { 30 +public class IPv4NeighborAddressSubTlv implements PcepValueType {
31 31
32 /* Reference :[RFC5305]/3.3 32 /* Reference :[RFC5305]/3.3
33 0 1 2 3 33 0 1 2 3
...@@ -39,7 +39,7 @@ public class IPv4NeighborAddressTlv implements PcepValueType { ...@@ -39,7 +39,7 @@ public class IPv4NeighborAddressTlv implements PcepValueType {
39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 */ 40 */
41 41
42 - protected static final Logger log = LoggerFactory.getLogger(IPv4NeighborAddressTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(IPv4NeighborAddressSubTlv.class);
43 43
44 public static final short TYPE = 8; 44 public static final short TYPE = 8;
45 public static final short LENGTH = 4; 45 public static final short LENGTH = 4;
...@@ -51,7 +51,7 @@ public class IPv4NeighborAddressTlv implements PcepValueType { ...@@ -51,7 +51,7 @@ public class IPv4NeighborAddressTlv implements PcepValueType {
51 * 51 *
52 * @param rawValue IPv4-Neighbor-Address-Tlv 52 * @param rawValue IPv4-Neighbor-Address-Tlv
53 */ 53 */
54 - public IPv4NeighborAddressTlv(int rawValue) { 54 + public IPv4NeighborAddressSubTlv(int rawValue) {
55 log.debug("IPv4NeighborAddressTlv"); 55 log.debug("IPv4NeighborAddressTlv");
56 this.rawValue = rawValue; 56 this.rawValue = rawValue;
57 } 57 }
...@@ -62,8 +62,8 @@ public class IPv4NeighborAddressTlv implements PcepValueType { ...@@ -62,8 +62,8 @@ public class IPv4NeighborAddressTlv implements PcepValueType {
62 * @param raw value of IPv4-Neighbor-Address 62 * @param raw value of IPv4-Neighbor-Address
63 * @return object of IPv4NeighborAddressTlv 63 * @return object of IPv4NeighborAddressTlv
64 */ 64 */
65 - public static IPv4NeighborAddressTlv of(final int raw) { 65 + public static IPv4NeighborAddressSubTlv of(final int raw) {
66 - return new IPv4NeighborAddressTlv(raw); 66 + return new IPv4NeighborAddressSubTlv(raw);
67 } 67 }
68 68
69 /** 69 /**
...@@ -100,8 +100,8 @@ public class IPv4NeighborAddressTlv implements PcepValueType { ...@@ -100,8 +100,8 @@ public class IPv4NeighborAddressTlv implements PcepValueType {
100 if (this == obj) { 100 if (this == obj) {
101 return true; 101 return true;
102 } 102 }
103 - if (obj instanceof IPv4NeighborAddressTlv) { 103 + if (obj instanceof IPv4NeighborAddressSubTlv) {
104 - IPv4NeighborAddressTlv other = (IPv4NeighborAddressTlv) obj; 104 + IPv4NeighborAddressSubTlv other = (IPv4NeighborAddressSubTlv) obj;
105 return Objects.equals(rawValue, other.rawValue); 105 return Objects.equals(rawValue, other.rawValue);
106 } 106 }
107 return false; 107 return false;
...@@ -122,8 +122,8 @@ public class IPv4NeighborAddressTlv implements PcepValueType { ...@@ -122,8 +122,8 @@ public class IPv4NeighborAddressTlv implements PcepValueType {
122 * @param c input channel buffer 122 * @param c input channel buffer
123 * @return object of IPv4-Neighbor-Address-Tlv 123 * @return object of IPv4-Neighbor-Address-Tlv
124 */ 124 */
125 - public static IPv4NeighborAddressTlv read(ChannelBuffer c) { 125 + public static IPv4NeighborAddressSubTlv read(ChannelBuffer c) {
126 - return IPv4NeighborAddressTlv.of(c.readInt()); 126 + return IPv4NeighborAddressSubTlv.of(c.readInt());
127 } 127 }
128 128
129 @Override 129 @Override
......
...@@ -25,9 +25,9 @@ import org.slf4j.LoggerFactory; ...@@ -25,9 +25,9 @@ import org.slf4j.LoggerFactory;
25 import com.google.common.base.MoreObjects; 25 import com.google.common.base.MoreObjects;
26 26
27 /** 27 /**
28 - * Provides IPv4 TE Router Id Of Local Node. 28 + * Provides IPv4 Router Id Of Local Node.
29 */ 29 */
30 -public class IPv4TERouterIdOfLocalNodeTlv implements PcepValueType { 30 +public class IPv4RouterIdOfLocalNodeSubTlv implements PcepValueType {
31 31
32 /* Reference:[RFC5305]/4.3 32 /* Reference:[RFC5305]/4.3
33 * 0 1 2 3 33 * 0 1 2 3
...@@ -35,13 +35,13 @@ public class IPv4TERouterIdOfLocalNodeTlv implements PcepValueType { ...@@ -35,13 +35,13 @@ public class IPv4TERouterIdOfLocalNodeTlv implements PcepValueType {
35 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 35 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
36 | Type=[TDB25] | Length=4 | 36 | Type=[TDB25] | Length=4 |
37 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 37 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
38 - | IPv4 TE Router Id Of Local Node | 38 + | IPv4 Router Id Of Local Node |
39 +-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+- 39 +-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-
40 */ 40 */
41 41
42 - protected static final Logger log = LoggerFactory.getLogger(IPv4TERouterIdOfLocalNodeTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(IPv4RouterIdOfLocalNodeSubTlv.class);
43 43
44 - public static final short TYPE = 134; //TDB25 44 + public static final short TYPE = 17;
45 public static final short LENGTH = 4; 45 public static final short LENGTH = 4;
46 46
47 private final int rawValue; 47 private final int rawValue;
...@@ -49,26 +49,26 @@ public class IPv4TERouterIdOfLocalNodeTlv implements PcepValueType { ...@@ -49,26 +49,26 @@ public class IPv4TERouterIdOfLocalNodeTlv implements PcepValueType {
49 /** 49 /**
50 * Constructor to initialize rawValue. 50 * Constructor to initialize rawValue.
51 * 51 *
52 - * @param rawValue IPv4-TE-RouterId-Of-Local-Node-Tlv 52 + * @param rawValue IPv4-RouterId-Of-Local-Node-Tlv
53 */ 53 */
54 - public IPv4TERouterIdOfLocalNodeTlv(int rawValue) { 54 + public IPv4RouterIdOfLocalNodeSubTlv(int rawValue) {
55 this.rawValue = rawValue; 55 this.rawValue = rawValue;
56 } 56 }
57 57
58 /** 58 /**
59 - * Returns newly created IPv4TERouterIdOfLocalNodeTlv object. 59 + * Returns newly created IPv4RouterIdOfLocalNodeTlv object.
60 * 60 *
61 - * @param raw value of IPv4-TE-RouterId-Of-Local-Node 61 + * @param raw value of IPv4-RouterId-Of-Local-Node
62 - * @return object of IPv4TERouterIdOfLocalNodeTlv 62 + * @return object of IPv4RouterIdOfLocalNodeTlv
63 */ 63 */
64 - public static IPv4TERouterIdOfLocalNodeTlv of(final int raw) { 64 + public static IPv4RouterIdOfLocalNodeSubTlv of(final int raw) {
65 - return new IPv4TERouterIdOfLocalNodeTlv(raw); 65 + return new IPv4RouterIdOfLocalNodeSubTlv(raw);
66 } 66 }
67 67
68 /** 68 /**
69 - * Returns value of IPv4 TE Router Id Of Local Node. 69 + * Returns value of IPv4 Router Id Of Local Node.
70 * 70 *
71 - * @return rawValue IPv4 TE Router Id Of Local Node 71 + * @return rawValue IPv4 Router Id Of Local Node
72 */ 72 */
73 public int getInt() { 73 public int getInt() {
74 return rawValue; 74 return rawValue;
...@@ -99,8 +99,8 @@ public class IPv4TERouterIdOfLocalNodeTlv implements PcepValueType { ...@@ -99,8 +99,8 @@ public class IPv4TERouterIdOfLocalNodeTlv implements PcepValueType {
99 if (this == obj) { 99 if (this == obj) {
100 return true; 100 return true;
101 } 101 }
102 - if (obj instanceof IPv4TERouterIdOfLocalNodeTlv) { 102 + if (obj instanceof IPv4RouterIdOfLocalNodeSubTlv) {
103 - IPv4TERouterIdOfLocalNodeTlv other = (IPv4TERouterIdOfLocalNodeTlv) obj; 103 + IPv4RouterIdOfLocalNodeSubTlv other = (IPv4RouterIdOfLocalNodeSubTlv) obj;
104 return Objects.equals(rawValue, other.rawValue); 104 return Objects.equals(rawValue, other.rawValue);
105 } 105 }
106 return false; 106 return false;
...@@ -116,13 +116,13 @@ public class IPv4TERouterIdOfLocalNodeTlv implements PcepValueType { ...@@ -116,13 +116,13 @@ public class IPv4TERouterIdOfLocalNodeTlv implements PcepValueType {
116 } 116 }
117 117
118 /** 118 /**
119 - * Reads the channel buffer and returns object of IPv4TERouterIdOfLocalNodeTlv. 119 + * Reads the channel buffer and returns object of IPv4RouterIdOfLocalNodeTlv.
120 * 120 *
121 * @param c input channel buffer 121 * @param c input channel buffer
122 - * @return object of IPv4TERouterIdOfLocalNodeTlv 122 + * @return object of IPv4RouterIdOfLocalNodeTlv
123 */ 123 */
124 - public static IPv4TERouterIdOfLocalNodeTlv read(ChannelBuffer c) { 124 + public static IPv4RouterIdOfLocalNodeSubTlv read(ChannelBuffer c) {
125 - return IPv4TERouterIdOfLocalNodeTlv.of(c.readInt()); 125 + return IPv4RouterIdOfLocalNodeSubTlv.of(c.readInt());
126 } 126 }
127 127
128 @Override 128 @Override
......
...@@ -25,9 +25,9 @@ import org.slf4j.LoggerFactory; ...@@ -25,9 +25,9 @@ import org.slf4j.LoggerFactory;
25 import com.google.common.base.MoreObjects; 25 import com.google.common.base.MoreObjects;
26 26
27 /** 27 /**
28 - * Provides IPv4 TE Router Id Of Remote Node. 28 + * Provides IPv4 Router Id Of Remote Node.
29 */ 29 */
30 -public class IPv4TERouterIdOfRemoteNodeTlv implements PcepValueType { 30 +public class IPv4RouterIdOfRemoteNodeSubTlv implements PcepValueType {
31 31
32 /* Reference :[RFC5305]/4.3 32 /* Reference :[RFC5305]/4.3
33 * 0 1 2 3 33 * 0 1 2 3
...@@ -35,13 +35,13 @@ public class IPv4TERouterIdOfRemoteNodeTlv implements PcepValueType { ...@@ -35,13 +35,13 @@ public class IPv4TERouterIdOfRemoteNodeTlv implements PcepValueType {
35 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 35 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
36 | Type=[TDB28] | Length=4 | 36 | Type=[TDB28] | Length=4 |
37 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 37 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
38 - | IPv4 TE Router Id Of Remote Node | 38 + | IPv4 Router Id Of Remote Node |
39 +-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+- 39 +-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-
40 */ 40 */
41 41
42 - protected static final Logger log = LoggerFactory.getLogger(IPv4TERouterIdOfRemoteNodeTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(IPv4RouterIdOfRemoteNodeSubTlv.class);
43 43
44 - public static final short TYPE = 1340; //TDB28 44 + public static final short TYPE = 19;
45 public static final short LENGTH = 4; 45 public static final short LENGTH = 4;
46 46
47 private final int rawValue; 47 private final int rawValue;
...@@ -49,27 +49,27 @@ public class IPv4TERouterIdOfRemoteNodeTlv implements PcepValueType { ...@@ -49,27 +49,27 @@ public class IPv4TERouterIdOfRemoteNodeTlv implements PcepValueType {
49 /** 49 /**
50 * Constructor to initialize rawValue. 50 * Constructor to initialize rawValue.
51 * 51 *
52 - * @param rawValue IPv4 TE RouterId Of Remote Node Tlv 52 + * @param rawValue IPv4 RouterId Of Remote Node Tlv
53 */ 53 */
54 - public IPv4TERouterIdOfRemoteNodeTlv(int rawValue) { 54 + public IPv4RouterIdOfRemoteNodeSubTlv(int rawValue) {
55 - log.debug("IPv4TERouterIdOfRemoteNodeTlv"); 55 + log.debug("IPv4RouterIdOfRemoteNodeTlv");
56 this.rawValue = rawValue; 56 this.rawValue = rawValue;
57 } 57 }
58 58
59 /** 59 /**
60 - * Returns newly created IPv4TERouterIdOfRemoteNodeTlv object. 60 + * Returns newly created IPv4RouterIdOfRemoteNodeTlv object.
61 * 61 *
62 - * @param raw IPv4 TE RouterId Of Remote Node 62 + * @param raw IPv4 RouterId Of Remote Node
63 - * @return object of IPv4TERouterIdOfRemoteNodeTlv 63 + * @return object of IPv4RouterIdOfRemoteNodeTlv
64 */ 64 */
65 - public static IPv4TERouterIdOfRemoteNodeTlv of(final int raw) { 65 + public static IPv4RouterIdOfRemoteNodeSubTlv of(final int raw) {
66 - return new IPv4TERouterIdOfRemoteNodeTlv(raw); 66 + return new IPv4RouterIdOfRemoteNodeSubTlv(raw);
67 } 67 }
68 68
69 /** 69 /**
70 - * Returns value of IPv4 TE Router Id Of Remote Node. 70 + * Returns value of IPv4 Router Id Of Remote Node.
71 * 71 *
72 - * @return rawValue IPv4 TE Router Id Of Remote Node 72 + * @return rawValue IPv4 Router Id Of Remote Node
73 */ 73 */
74 public int getInt() { 74 public int getInt() {
75 return rawValue; 75 return rawValue;
...@@ -100,8 +100,8 @@ public class IPv4TERouterIdOfRemoteNodeTlv implements PcepValueType { ...@@ -100,8 +100,8 @@ public class IPv4TERouterIdOfRemoteNodeTlv implements PcepValueType {
100 if (this == obj) { 100 if (this == obj) {
101 return true; 101 return true;
102 } 102 }
103 - if (obj instanceof IPv4TERouterIdOfRemoteNodeTlv) { 103 + if (obj instanceof IPv4RouterIdOfRemoteNodeSubTlv) {
104 - IPv4TERouterIdOfRemoteNodeTlv other = (IPv4TERouterIdOfRemoteNodeTlv) obj; 104 + IPv4RouterIdOfRemoteNodeSubTlv other = (IPv4RouterIdOfRemoteNodeSubTlv) obj;
105 return Objects.equals(rawValue, other.rawValue); 105 return Objects.equals(rawValue, other.rawValue);
106 } 106 }
107 return false; 107 return false;
...@@ -117,13 +117,13 @@ public class IPv4TERouterIdOfRemoteNodeTlv implements PcepValueType { ...@@ -117,13 +117,13 @@ public class IPv4TERouterIdOfRemoteNodeTlv implements PcepValueType {
117 } 117 }
118 118
119 /** 119 /**
120 - * Reads the channel buffer and returns object of IPv4TERouterIdOfRemoteNodeTlv. 120 + * Reads the channel buffer and returns object of IPv4RouterIdOfRemoteNodeTlv.
121 * 121 *
122 * @param c input channel buffer 122 * @param c input channel buffer
123 - * @return object of IPv4TERouterIdOfRemoteNodeTlv 123 + * @return object of IPv4RouterIdOfRemoteNodeTlv
124 */ 124 */
125 - public static IPv4TERouterIdOfRemoteNodeTlv read(ChannelBuffer c) { 125 + public static IPv4RouterIdOfRemoteNodeSubTlv read(ChannelBuffer c) {
126 - return IPv4TERouterIdOfRemoteNodeTlv.of(c.readInt()); 126 + return IPv4RouterIdOfRemoteNodeSubTlv.of(c.readInt());
127 } 127 }
128 128
129 @Override 129 @Override
......
...@@ -27,22 +27,22 @@ import java.util.Arrays; ...@@ -27,22 +27,22 @@ import java.util.Arrays;
27 /** 27 /**
28 * Provides IPv6 Interface Address. REFERENCE :[RFC6119]/4.2. 28 * Provides IPv6 Interface Address. REFERENCE :[RFC6119]/4.2.
29 */ 29 */
30 -public class IPv6InterfaceAddressTlv implements PcepValueType { 30 +public class IPv6InterfaceAddressSubTlv implements PcepValueType {
31 31
32 - protected static final Logger log = LoggerFactory.getLogger(IPv6InterfaceAddressTlv.class); 32 + protected static final Logger log = LoggerFactory.getLogger(IPv6InterfaceAddressSubTlv.class);
33 33
34 - public static final short TYPE = 12; //TDB18 34 + public static final short TYPE = 9;
35 public static final short LENGTH = 20; 35 public static final short LENGTH = 20;
36 public static final byte VALUE_LENGTH = 18; 36 public static final byte VALUE_LENGTH = 18;
37 37
38 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}; 38 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};
39 - public static final IPv6InterfaceAddressTlv NONE = new IPv6InterfaceAddressTlv(NONE_VAL); 39 + public static final IPv6InterfaceAddressSubTlv NONE = new IPv6InterfaceAddressSubTlv(NONE_VAL);
40 40
41 private static final byte[] NO_MASK_VAL = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, 41 private static final byte[] NO_MASK_VAL = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
42 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, 42 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
43 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; 43 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
44 - public static final IPv6InterfaceAddressTlv NO_MASK = new IPv6InterfaceAddressTlv(NO_MASK_VAL); 44 + public static final IPv6InterfaceAddressSubTlv NO_MASK = new IPv6InterfaceAddressSubTlv(NO_MASK_VAL);
45 - public static final IPv6InterfaceAddressTlv FULL_MASK = NONE; 45 + public static final IPv6InterfaceAddressSubTlv FULL_MASK = NONE;
46 46
47 private final byte[] rawValue; 47 private final byte[] rawValue;
48 48
...@@ -51,7 +51,7 @@ public class IPv6InterfaceAddressTlv implements PcepValueType { ...@@ -51,7 +51,7 @@ public class IPv6InterfaceAddressTlv implements PcepValueType {
51 * 51 *
52 * @param rawValue IPv6 Interface Address Tlv 52 * @param rawValue IPv6 Interface Address Tlv
53 */ 53 */
54 - public IPv6InterfaceAddressTlv(byte[] rawValue) { 54 + public IPv6InterfaceAddressSubTlv(byte[] rawValue) {
55 log.debug("IPv6InterfaceAddressTlv"); 55 log.debug("IPv6InterfaceAddressTlv");
56 this.rawValue = rawValue; 56 this.rawValue = rawValue;
57 } 57 }
...@@ -62,7 +62,7 @@ public class IPv6InterfaceAddressTlv implements PcepValueType { ...@@ -62,7 +62,7 @@ public class IPv6InterfaceAddressTlv implements PcepValueType {
62 * @param raw IPv6 Interface Address 62 * @param raw IPv6 Interface Address
63 * @return object of IPv6InterfaceAddressTlv 63 * @return object of IPv6InterfaceAddressTlv
64 */ 64 */
65 - public static IPv6InterfaceAddressTlv of(final byte[] raw) { 65 + public static IPv6InterfaceAddressSubTlv of(final byte[] raw) {
66 //check NONE_VAL 66 //check NONE_VAL
67 boolean bFoundNone = true; 67 boolean bFoundNone = true;
68 //value starts from 3rd byte. 68 //value starts from 3rd byte.
...@@ -88,7 +88,7 @@ public class IPv6InterfaceAddressTlv implements PcepValueType { ...@@ -88,7 +88,7 @@ public class IPv6InterfaceAddressTlv implements PcepValueType {
88 return NO_MASK; 88 return NO_MASK;
89 } 89 }
90 90
91 - return new IPv6InterfaceAddressTlv(raw); 91 + return new IPv6InterfaceAddressSubTlv(raw);
92 } 92 }
93 93
94 /** 94 /**
...@@ -134,8 +134,8 @@ public class IPv6InterfaceAddressTlv implements PcepValueType { ...@@ -134,8 +134,8 @@ public class IPv6InterfaceAddressTlv implements PcepValueType {
134 if (this == obj) { 134 if (this == obj) {
135 return true; 135 return true;
136 } 136 }
137 - if (obj instanceof IPv6InterfaceAddressTlv) { 137 + if (obj instanceof IPv6InterfaceAddressSubTlv) {
138 - IPv6InterfaceAddressTlv other = (IPv6InterfaceAddressTlv) obj; 138 + IPv6InterfaceAddressSubTlv other = (IPv6InterfaceAddressSubTlv) obj;
139 return Arrays.equals(rawValue, other.rawValue); 139 return Arrays.equals(rawValue, other.rawValue);
140 } 140 }
141 return false; 141 return false;
...@@ -156,10 +156,10 @@ public class IPv6InterfaceAddressTlv implements PcepValueType { ...@@ -156,10 +156,10 @@ public class IPv6InterfaceAddressTlv implements PcepValueType {
156 * @param c input channel buffer 156 * @param c input channel buffer
157 * @return object of IPv6InterfaceAddressTlv 157 * @return object of IPv6InterfaceAddressTlv
158 */ 158 */
159 - public static IPv6InterfaceAddressTlv read20Bytes(ChannelBuffer c) { 159 + public static IPv6InterfaceAddressSubTlv read20Bytes(ChannelBuffer c) {
160 byte[] yTemp = new byte[20]; 160 byte[] yTemp = new byte[20];
161 c.readBytes(yTemp, 0, 20); 161 c.readBytes(yTemp, 0, 20);
162 - return IPv6InterfaceAddressTlv.of(yTemp); 162 + return IPv6InterfaceAddressSubTlv.of(yTemp);
163 } 163 }
164 164
165 @Override 165 @Override
......
...@@ -27,21 +27,21 @@ import java.util.Arrays; ...@@ -27,21 +27,21 @@ import java.util.Arrays;
27 /** 27 /**
28 * Provides IPv6 Neighbor Address. Reference :[RFC6119]/4.3. 28 * Provides IPv6 Neighbor Address. Reference :[RFC6119]/4.3.
29 */ 29 */
30 -public class IPv6NeighborAddressTlv implements PcepValueType { 30 +public class IPv6NeighborAddressSubTlv implements PcepValueType {
31 - protected static final Logger log = LoggerFactory.getLogger(IPv6NeighborAddressTlv.class); 31 + protected static final Logger log = LoggerFactory.getLogger(IPv6NeighborAddressSubTlv.class);
32 32
33 - public static final short TYPE = 13; // TDB19 33 + public static final short TYPE = 10;
34 public static final short LENGTH = 20; 34 public static final short LENGTH = 20;
35 public static final byte VALUE_LENGTH = 18; 35 public static final byte VALUE_LENGTH = 18;
36 36
37 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}; 37 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};
38 - public static final IPv6NeighborAddressTlv NONE = new IPv6NeighborAddressTlv(NONE_VAL); 38 + public static final IPv6NeighborAddressSubTlv NONE = new IPv6NeighborAddressSubTlv(NONE_VAL);
39 39
40 private static final byte[] NO_MASK_VAL = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, 40 private static final byte[] NO_MASK_VAL = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
41 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, 41 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
42 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; 42 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
43 - public static final IPv6NeighborAddressTlv NO_MASK = new IPv6NeighborAddressTlv(NO_MASK_VAL); 43 + public static final IPv6NeighborAddressSubTlv NO_MASK = new IPv6NeighborAddressSubTlv(NO_MASK_VAL);
44 - public static final IPv6NeighborAddressTlv FULL_MASK = NONE; 44 + public static final IPv6NeighborAddressSubTlv FULL_MASK = NONE;
45 45
46 private final byte[] rawValue; 46 private final byte[] rawValue;
47 47
...@@ -50,7 +50,7 @@ public class IPv6NeighborAddressTlv implements PcepValueType { ...@@ -50,7 +50,7 @@ public class IPv6NeighborAddressTlv implements PcepValueType {
50 * 50 *
51 * @param rawValue IPv6 Neighbor Address Tlv 51 * @param rawValue IPv6 Neighbor Address Tlv
52 */ 52 */
53 - public IPv6NeighborAddressTlv(byte[] rawValue) { 53 + public IPv6NeighborAddressSubTlv(byte[] rawValue) {
54 this.rawValue = rawValue; 54 this.rawValue = rawValue;
55 } 55 }
56 56
...@@ -60,7 +60,7 @@ public class IPv6NeighborAddressTlv implements PcepValueType { ...@@ -60,7 +60,7 @@ public class IPv6NeighborAddressTlv implements PcepValueType {
60 * @param raw IPv6 Neighbor Address 60 * @param raw IPv6 Neighbor Address
61 * @return object of IPv6 Neighbor Address Tlv 61 * @return object of IPv6 Neighbor Address Tlv
62 */ 62 */
63 - public static IPv6NeighborAddressTlv of(final byte[] raw) { 63 + public static IPv6NeighborAddressSubTlv of(final byte[] raw) {
64 //check NONE_VAL 64 //check NONE_VAL
65 boolean bFoundNone = true; 65 boolean bFoundNone = true;
66 //value starts from 3rd byte. 66 //value starts from 3rd byte.
...@@ -86,7 +86,7 @@ public class IPv6NeighborAddressTlv implements PcepValueType { ...@@ -86,7 +86,7 @@ public class IPv6NeighborAddressTlv implements PcepValueType {
86 return NO_MASK; 86 return NO_MASK;
87 } 87 }
88 88
89 - return new IPv6NeighborAddressTlv(raw); 89 + return new IPv6NeighborAddressSubTlv(raw);
90 } 90 }
91 91
92 /** 92 /**
...@@ -132,8 +132,8 @@ public class IPv6NeighborAddressTlv implements PcepValueType { ...@@ -132,8 +132,8 @@ public class IPv6NeighborAddressTlv implements PcepValueType {
132 if (this == obj) { 132 if (this == obj) {
133 return true; 133 return true;
134 } 134 }
135 - if (obj instanceof IPv6NeighborAddressTlv) { 135 + if (obj instanceof IPv6NeighborAddressSubTlv) {
136 - IPv6NeighborAddressTlv other = (IPv6NeighborAddressTlv) obj; 136 + IPv6NeighborAddressSubTlv other = (IPv6NeighborAddressSubTlv) obj;
137 return Arrays.equals(rawValue, other.rawValue); 137 return Arrays.equals(rawValue, other.rawValue);
138 } 138 }
139 return false; 139 return false;
...@@ -154,10 +154,10 @@ public class IPv6NeighborAddressTlv implements PcepValueType { ...@@ -154,10 +154,10 @@ public class IPv6NeighborAddressTlv implements PcepValueType {
154 * @param c input channel buffer 154 * @param c input channel buffer
155 * @return object of IPv6NeighborAddressTlv 155 * @return object of IPv6NeighborAddressTlv
156 */ 156 */
157 - public static IPv6NeighborAddressTlv read20Bytes(ChannelBuffer c) { 157 + public static IPv6NeighborAddressSubTlv read20Bytes(ChannelBuffer c) {
158 byte[] yTemp = new byte[20]; 158 byte[] yTemp = new byte[20];
159 c.readBytes(yTemp, 0, 20); 159 c.readBytes(yTemp, 0, 20);
160 - return IPv6NeighborAddressTlv.of(yTemp); 160 + return IPv6NeighborAddressSubTlv.of(yTemp);
161 } 161 }
162 162
163 @Override 163 @Override
......
...@@ -27,40 +27,40 @@ import java.util.Arrays; ...@@ -27,40 +27,40 @@ import java.util.Arrays;
27 /** 27 /**
28 * Provides IPv6 TE Router Id of Local Node. Reference :[RFC6119]/4.1. 28 * Provides IPv6 TE Router Id of Local Node. Reference :[RFC6119]/4.1.
29 */ 29 */
30 -public class IPv6TERouterIdofLocalNodeTlv implements PcepValueType { 30 +public class IPv6RouterIdofLocalNodeSubTlv implements PcepValueType {
31 - protected static final Logger log = LoggerFactory.getLogger(IPv6TERouterIdofLocalNodeTlv.class); 31 + protected static final Logger log = LoggerFactory.getLogger(IPv6RouterIdofLocalNodeSubTlv.class);
32 32
33 - public static final short TYPE = 140; //TDB26 33 + public static final short TYPE = 18;
34 public static final short LENGTH = 20; 34 public static final short LENGTH = 20;
35 public static final byte VALUE_LENGTH = 18; 35 public static final byte VALUE_LENGTH = 18;
36 36
37 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 }; 37 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 };
38 - public static final IPv6TERouterIdofLocalNodeTlv NONE = new IPv6TERouterIdofLocalNodeTlv(NONE_VAL); 38 + public static final IPv6RouterIdofLocalNodeSubTlv NONE = new IPv6RouterIdofLocalNodeSubTlv(NONE_VAL);
39 39
40 private static final byte[] NO_MASK_VAL = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, 40 private static final byte[] NO_MASK_VAL = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
41 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, 41 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
42 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF }; 42 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF };
43 - public static final IPv6TERouterIdofLocalNodeTlv NO_MASK = new IPv6TERouterIdofLocalNodeTlv(NO_MASK_VAL); 43 + public static final IPv6RouterIdofLocalNodeSubTlv NO_MASK = new IPv6RouterIdofLocalNodeSubTlv(NO_MASK_VAL);
44 - public static final IPv6TERouterIdofLocalNodeTlv FULL_MASK = NONE; 44 + public static final IPv6RouterIdofLocalNodeSubTlv FULL_MASK = NONE;
45 45
46 private final byte[] rawValue; 46 private final byte[] rawValue;
47 47
48 /** 48 /**
49 * Constructor to initialize rawValue. 49 * Constructor to initialize rawValue.
50 * 50 *
51 - * @param rawValue IPv6TERouterIdofLocalNodeTlv 51 + * @param rawValue IPv6RouterIdofLocalNodeTlv
52 */ 52 */
53 - public IPv6TERouterIdofLocalNodeTlv(byte[] rawValue) { 53 + public IPv6RouterIdofLocalNodeSubTlv(byte[] rawValue) {
54 this.rawValue = rawValue; 54 this.rawValue = rawValue;
55 } 55 }
56 56
57 /** 57 /**
58 - * Returns newly created IPv6TERouterIdofLocalNodeTlv object. 58 + * Returns newly created IPv6RouterIdofLocalNodeTlv object.
59 * 59 *
60 * @param raw IPv6 TE Router Id of Local Node 60 * @param raw IPv6 TE Router Id of Local Node
61 - * @return object of IPv6TERouterIdofLocalNodeTlv 61 + * @return object of IPv6RouterIdofLocalNodeTlv
62 */ 62 */
63 - public static IPv6TERouterIdofLocalNodeTlv of(final byte[] raw) { 63 + public static IPv6RouterIdofLocalNodeSubTlv of(final byte[] raw) {
64 //check NONE_VAL 64 //check NONE_VAL
65 boolean bFoundNone = true; 65 boolean bFoundNone = true;
66 //value starts from 3rd byte. 66 //value starts from 3rd byte.
...@@ -86,7 +86,7 @@ public class IPv6TERouterIdofLocalNodeTlv implements PcepValueType { ...@@ -86,7 +86,7 @@ public class IPv6TERouterIdofLocalNodeTlv implements PcepValueType {
86 return NO_MASK; 86 return NO_MASK;
87 } 87 }
88 88
89 - return new IPv6TERouterIdofLocalNodeTlv(raw); 89 + return new IPv6RouterIdofLocalNodeSubTlv(raw);
90 } 90 }
91 91
92 /** 92 /**
...@@ -132,8 +132,8 @@ public class IPv6TERouterIdofLocalNodeTlv implements PcepValueType { ...@@ -132,8 +132,8 @@ public class IPv6TERouterIdofLocalNodeTlv implements PcepValueType {
132 if (this == obj) { 132 if (this == obj) {
133 return true; 133 return true;
134 } 134 }
135 - if (obj instanceof IPv6TERouterIdofLocalNodeTlv) { 135 + if (obj instanceof IPv6RouterIdofLocalNodeSubTlv) {
136 - IPv6TERouterIdofLocalNodeTlv other = (IPv6TERouterIdofLocalNodeTlv) obj; 136 + IPv6RouterIdofLocalNodeSubTlv other = (IPv6RouterIdofLocalNodeSubTlv) obj;
137 return Arrays.equals(rawValue, other.rawValue); 137 return Arrays.equals(rawValue, other.rawValue);
138 } 138 }
139 return false; 139 return false;
...@@ -149,15 +149,15 @@ public class IPv6TERouterIdofLocalNodeTlv implements PcepValueType { ...@@ -149,15 +149,15 @@ public class IPv6TERouterIdofLocalNodeTlv implements PcepValueType {
149 } 149 }
150 150
151 /** 151 /**
152 - * Reads the channel buffer and returns object of IPv6TERouterIdofLocalNodeTlv. 152 + * Reads the channel buffer and returns object of IPv6RouterIdofLocalNodeTlv.
153 * 153 *
154 * @param c input channel buffer 154 * @param c input channel buffer
155 - * @return object of IPv6TERouterIdofLocalNodeTlv 155 + * @return object of IPv6RouterIdofLocalNodeTlv
156 */ 156 */
157 - public static IPv6TERouterIdofLocalNodeTlv read20Bytes(ChannelBuffer c) { 157 + public static IPv6RouterIdofLocalNodeSubTlv read20Bytes(ChannelBuffer c) {
158 byte[] yTemp = new byte[20]; 158 byte[] yTemp = new byte[20];
159 c.readBytes(yTemp, 0, 20); 159 c.readBytes(yTemp, 0, 20);
160 - return IPv6TERouterIdofLocalNodeTlv.of(yTemp); 160 + return IPv6RouterIdofLocalNodeSubTlv.of(yTemp);
161 } 161 }
162 162
163 @Override 163 @Override
......
...@@ -27,41 +27,41 @@ import java.util.Arrays; ...@@ -27,41 +27,41 @@ import java.util.Arrays;
27 /** 27 /**
28 * Provides IPv6 TE Router Id of Remote Node. Reference :[RFC6119]/4.1. 28 * Provides IPv6 TE Router Id of Remote Node. Reference :[RFC6119]/4.1.
29 */ 29 */
30 -public class IPv6TERouterIdofRemoteNodeTlv implements PcepValueType { 30 +public class IPv6RouterIdofRemoteNodeSubTlv implements PcepValueType {
31 - protected static final Logger log = LoggerFactory.getLogger(IPv6TERouterIdofRemoteNodeTlv.class); 31 + protected static final Logger log = LoggerFactory.getLogger(IPv6RouterIdofRemoteNodeSubTlv.class);
32 32
33 - public static final short TYPE = 1400; //TDB29 33 + public static final short TYPE = 20;
34 public static final short LENGTH = 20; 34 public static final short LENGTH = 20;
35 public static final byte VALUE_LENGTH = 18; 35 public static final byte VALUE_LENGTH = 18;
36 36
37 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}; 37 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};
38 - public static final IPv6TERouterIdofRemoteNodeTlv NONE = new IPv6TERouterIdofRemoteNodeTlv(NONE_VAL); 38 + public static final IPv6RouterIdofRemoteNodeSubTlv NONE = new IPv6RouterIdofRemoteNodeSubTlv(NONE_VAL);
39 39
40 private static final byte[] NO_MASK_VAL = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, 40 private static final byte[] NO_MASK_VAL = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
41 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, 41 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
42 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; 42 (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
43 - public static final IPv6TERouterIdofRemoteNodeTlv NO_MASK = new IPv6TERouterIdofRemoteNodeTlv(NO_MASK_VAL); 43 + public static final IPv6RouterIdofRemoteNodeSubTlv NO_MASK = new IPv6RouterIdofRemoteNodeSubTlv(NO_MASK_VAL);
44 - public static final IPv6TERouterIdofRemoteNodeTlv FULL_MASK = NONE; 44 + public static final IPv6RouterIdofRemoteNodeSubTlv FULL_MASK = NONE;
45 45
46 private final byte[] rawValue; 46 private final byte[] rawValue;
47 47
48 /** 48 /**
49 * constructor to initialize rawValue. 49 * constructor to initialize rawValue.
50 * 50 *
51 - * @param rawValue IPv6TERouterIdofRemoteNodeTlv 51 + * @param rawValue IPv6RouterIdofRemoteNodeTlv
52 */ 52 */
53 - public IPv6TERouterIdofRemoteNodeTlv(byte[] rawValue) { 53 + public IPv6RouterIdofRemoteNodeSubTlv(byte[] rawValue) {
54 - log.debug("IPv6TERouterIdofRemoteNodeTlv"); 54 + log.debug("IPv6RouterIdofRemoteNodeTlv");
55 this.rawValue = rawValue; 55 this.rawValue = rawValue;
56 } 56 }
57 57
58 /** 58 /**
59 - * Returns newly created IPv6TERouterIdofRemoteNodeTlv object. 59 + * Returns newly created IPv6RouterIdofRemoteNodeTlv object.
60 * 60 *
61 * @param raw IPv6 TE Router Id of RemoteNode 61 * @param raw IPv6 TE Router Id of RemoteNode
62 - * @return object of IPv6TERouterIdofRemoteNodeTlv 62 + * @return object of IPv6RouterIdofRemoteNodeTlv
63 */ 63 */
64 - public static IPv6TERouterIdofRemoteNodeTlv of(final byte[] raw) { 64 + public static IPv6RouterIdofRemoteNodeSubTlv of(final byte[] raw) {
65 //check NONE_VAL 65 //check NONE_VAL
66 boolean bFoundNone = true; 66 boolean bFoundNone = true;
67 //value starts from 3rd byte. 67 //value starts from 3rd byte.
...@@ -87,7 +87,7 @@ public class IPv6TERouterIdofRemoteNodeTlv implements PcepValueType { ...@@ -87,7 +87,7 @@ public class IPv6TERouterIdofRemoteNodeTlv implements PcepValueType {
87 return NO_MASK; 87 return NO_MASK;
88 } 88 }
89 89
90 - return new IPv6TERouterIdofRemoteNodeTlv(raw); 90 + return new IPv6RouterIdofRemoteNodeSubTlv(raw);
91 } 91 }
92 92
93 /** 93 /**
...@@ -124,8 +124,8 @@ public class IPv6TERouterIdofRemoteNodeTlv implements PcepValueType { ...@@ -124,8 +124,8 @@ public class IPv6TERouterIdofRemoteNodeTlv implements PcepValueType {
124 if (this == obj) { 124 if (this == obj) {
125 return true; 125 return true;
126 } 126 }
127 - if (obj instanceof IPv6TERouterIdofRemoteNodeTlv) { 127 + if (obj instanceof IPv6RouterIdofRemoteNodeSubTlv) {
128 - IPv6TERouterIdofRemoteNodeTlv other = (IPv6TERouterIdofRemoteNodeTlv) obj; 128 + IPv6RouterIdofRemoteNodeSubTlv other = (IPv6RouterIdofRemoteNodeSubTlv) obj;
129 return Arrays.equals(rawValue, other.rawValue); 129 return Arrays.equals(rawValue, other.rawValue);
130 } 130 }
131 return false; 131 return false;
...@@ -141,15 +141,15 @@ public class IPv6TERouterIdofRemoteNodeTlv implements PcepValueType { ...@@ -141,15 +141,15 @@ public class IPv6TERouterIdofRemoteNodeTlv implements PcepValueType {
141 } 141 }
142 142
143 /** 143 /**
144 - * Reads the channel buffer and returns object of IPv6TERouterIdofRemoteNodeTlv. 144 + * Reads the channel buffer and returns object of IPv6RouterIdofRemoteNodeTlv.
145 * 145 *
146 * @param c input channel buffer 146 * @param c input channel buffer
147 - * @return object of IPv6TERouterIdofRemoteNodeTlv 147 + * @return object of IPv6RouterIdofRemoteNodeTlv
148 */ 148 */
149 - public static IPv6TERouterIdofRemoteNodeTlv read20Bytes(ChannelBuffer c) { 149 + public static IPv6RouterIdofRemoteNodeSubTlv read20Bytes(ChannelBuffer c) {
150 byte[] yTemp = new byte[20]; 150 byte[] yTemp = new byte[20];
151 c.readBytes(yTemp, 0, 20); 151 c.readBytes(yTemp, 0, 20);
152 - return IPv6TERouterIdofRemoteNodeTlv.of(yTemp); 152 + return IPv6RouterIdofRemoteNodeSubTlv.of(yTemp);
153 } 153 }
154 154
155 @Override 155 @Override
......
...@@ -27,7 +27,7 @@ import java.util.Arrays; ...@@ -27,7 +27,7 @@ import java.util.Arrays;
27 /** 27 /**
28 * Provides IGP Link Metric . 28 * Provides IGP Link Metric .
29 */ 29 */
30 -public class IgpMetricTlv implements PcepValueType { 30 +public class IgpMetricSubTlv implements PcepValueType {
31 31
32 /* Reference :[I-D.ietf-idr-ls-distribution] /3.3.2.4 32 /* Reference :[I-D.ietf-idr-ls-distribution] /3.3.2.4
33 * 0 1 2 3 33 * 0 1 2 3
...@@ -39,9 +39,9 @@ public class IgpMetricTlv implements PcepValueType { ...@@ -39,9 +39,9 @@ public class IgpMetricTlv implements PcepValueType {
39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 */ 40 */
41 41
42 - protected static final Logger log = LoggerFactory.getLogger(IgpMetricTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(IgpMetricSubTlv.class);
43 43
44 - public static final short TYPE = 1095; //TODO:NEED TO HANDLE TDB40 44 + public static final short TYPE = 29;
45 private short hLength; 45 private short hLength;
46 46
47 private final byte[] rawValue; 47 private final byte[] rawValue;
...@@ -52,7 +52,7 @@ public class IgpMetricTlv implements PcepValueType { ...@@ -52,7 +52,7 @@ public class IgpMetricTlv implements PcepValueType {
52 * @param rawValue IGP Link Metric 52 * @param rawValue IGP Link Metric
53 * @param hLength length 53 * @param hLength length
54 */ 54 */
55 - public IgpMetricTlv(byte[] rawValue, short hLength) { 55 + public IgpMetricSubTlv(byte[] rawValue, short hLength) {
56 this.rawValue = rawValue; 56 this.rawValue = rawValue;
57 this.hLength = hLength; 57 this.hLength = hLength;
58 } 58 }
...@@ -64,8 +64,8 @@ public class IgpMetricTlv implements PcepValueType { ...@@ -64,8 +64,8 @@ public class IgpMetricTlv implements PcepValueType {
64 * @param hLength length 64 * @param hLength length
65 * @return object of IGPMetricTlv 65 * @return object of IGPMetricTlv
66 */ 66 */
67 - public static IgpMetricTlv of(final byte[] raw, short hLength) { 67 + public static IgpMetricSubTlv of(final byte[] raw, short hLength) {
68 - return new IgpMetricTlv(raw, hLength); 68 + return new IgpMetricSubTlv(raw, hLength);
69 } 69 }
70 70
71 /** 71 /**
...@@ -102,8 +102,8 @@ public class IgpMetricTlv implements PcepValueType { ...@@ -102,8 +102,8 @@ public class IgpMetricTlv implements PcepValueType {
102 if (this == obj) { 102 if (this == obj) {
103 return true; 103 return true;
104 } 104 }
105 - if (obj instanceof IgpMetricTlv) { 105 + if (obj instanceof IgpMetricSubTlv) {
106 - IgpMetricTlv other = (IgpMetricTlv) obj; 106 + IgpMetricSubTlv other = (IgpMetricSubTlv) obj;
107 return Arrays.equals(rawValue, other.rawValue); 107 return Arrays.equals(rawValue, other.rawValue);
108 } 108 }
109 return false; 109 return false;
...@@ -128,7 +128,7 @@ public class IgpMetricTlv implements PcepValueType { ...@@ -128,7 +128,7 @@ public class IgpMetricTlv implements PcepValueType {
128 public static PcepValueType read(ChannelBuffer c, short hLength) { 128 public static PcepValueType read(ChannelBuffer c, short hLength) {
129 byte[] iIgpMetric = new byte[hLength]; 129 byte[] iIgpMetric = new byte[hLength];
130 c.readBytes(iIgpMetric, 0, hLength); 130 c.readBytes(iIgpMetric, 0, hLength);
131 - return new IgpMetricTlv(iIgpMetric, hLength); 131 + return new IgpMetricSubTlv(iIgpMetric, hLength);
132 } 132 }
133 133
134 @Override 134 @Override
......
...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects.ToStringHelper; ...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects.ToStringHelper;
28 /** 28 /**
29 * Provides router id. 29 * Provides router id.
30 */ 30 */
31 -public class RouterIDSubTlv implements PcepValueType { 31 +public class IgpRouterIdSubTlv implements PcepValueType {
32 32
33 /* reference :I-D.ietf-idr-ls-distribution. 33 /* reference :I-D.ietf-idr-ls-distribution.
34 * 0 1 2 3 34 * 0 1 2 3
...@@ -40,9 +40,9 @@ public class RouterIDSubTlv implements PcepValueType { ...@@ -40,9 +40,9 @@ public class RouterIDSubTlv implements PcepValueType {
40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 */ 41 */
42 42
43 - protected static final Logger log = LoggerFactory.getLogger(RouterIDSubTlv.class); 43 + protected static final Logger log = LoggerFactory.getLogger(IgpRouterIdSubTlv.class);
44 44
45 - public static final short TYPE = 1000; //TODD:change this TBD13 45 + public static final short TYPE = 4;
46 private final short hLength; 46 private final short hLength;
47 47
48 private final byte[] rawValue; 48 private final byte[] rawValue;
...@@ -53,7 +53,7 @@ public class RouterIDSubTlv implements PcepValueType { ...@@ -53,7 +53,7 @@ public class RouterIDSubTlv implements PcepValueType {
53 * @param rawValue raw value 53 * @param rawValue raw value
54 * @param hLength length 54 * @param hLength length
55 */ 55 */
56 - public RouterIDSubTlv(byte[] rawValue, short hLength) { 56 + public IgpRouterIdSubTlv(byte[] rawValue, short hLength) {
57 this.rawValue = rawValue; 57 this.rawValue = rawValue;
58 if (0 == hLength) { 58 if (0 == hLength) {
59 this.hLength = (short) rawValue.length; 59 this.hLength = (short) rawValue.length;
...@@ -69,8 +69,8 @@ public class RouterIDSubTlv implements PcepValueType { ...@@ -69,8 +69,8 @@ public class RouterIDSubTlv implements PcepValueType {
69 * @param hLength length 69 * @param hLength length
70 * @return object of Router ID Sub Tlv 70 * @return object of Router ID Sub Tlv
71 */ 71 */
72 - public static RouterIDSubTlv of(final byte[] raw, short hLength) { 72 + public static IgpRouterIdSubTlv of(final byte[] raw, short hLength) {
73 - return new RouterIDSubTlv(raw, hLength); 73 + return new IgpRouterIdSubTlv(raw, hLength);
74 } 74 }
75 75
76 /** 76 /**
...@@ -107,8 +107,8 @@ public class RouterIDSubTlv implements PcepValueType { ...@@ -107,8 +107,8 @@ public class RouterIDSubTlv implements PcepValueType {
107 if (this == obj) { 107 if (this == obj) {
108 return true; 108 return true;
109 } 109 }
110 - if (obj instanceof RouterIDSubTlv) { 110 + if (obj instanceof IgpRouterIdSubTlv) {
111 - RouterIDSubTlv other = (RouterIDSubTlv) obj; 111 + IgpRouterIdSubTlv other = (IgpRouterIdSubTlv) obj;
112 return Arrays.equals(this.rawValue, other.rawValue); 112 return Arrays.equals(this.rawValue, other.rawValue);
113 } 113 }
114 return false; 114 return false;
...@@ -124,16 +124,16 @@ public class RouterIDSubTlv implements PcepValueType { ...@@ -124,16 +124,16 @@ public class RouterIDSubTlv implements PcepValueType {
124 } 124 }
125 125
126 /** 126 /**
127 - * Reads channel buffer and returns object of RouterIDSubTlv. 127 + * Reads channel buffer and returns object of IgpRouterIDTlv.
128 * 128 *
129 * @param c input channel buffer 129 * @param c input channel buffer
130 * @param hLength length 130 * @param hLength length
131 - * @return object of RouterIDSubTlv 131 + * @return object of IgpRouterIDTlv
132 */ 132 */
133 public static PcepValueType read(ChannelBuffer c, short hLength) { 133 public static PcepValueType read(ChannelBuffer c, short hLength) {
134 byte[] iOpaqueValue = new byte[hLength]; 134 byte[] iOpaqueValue = new byte[hLength];
135 c.readBytes(iOpaqueValue, 0, hLength); 135 c.readBytes(iOpaqueValue, 0, hLength);
136 - return new RouterIDSubTlv(iOpaqueValue, hLength); 136 + return new IgpRouterIdSubTlv(iOpaqueValue, hLength);
137 } 137 }
138 138
139 @Override 139 @Override
......
...@@ -28,7 +28,7 @@ import java.util.Objects; ...@@ -28,7 +28,7 @@ import java.util.Objects;
28 /** 28 /**
29 * Provides ISIS Area Identifier. 29 * Provides ISIS Area Identifier.
30 */ 30 */
31 -public class IsisAreaIdentifierTlv implements PcepValueType { 31 +public class IsisAreaIdentifierSubTlv implements PcepValueType {
32 32
33 /* Reference :[I-D.ietf-idr- ls-distribution]/3.3.1.2 33 /* Reference :[I-D.ietf-idr- ls-distribution]/3.3.1.2
34 * 0 1 2 3 34 * 0 1 2 3
...@@ -40,9 +40,9 @@ public class IsisAreaIdentifierTlv implements PcepValueType { ...@@ -40,9 +40,9 @@ public class IsisAreaIdentifierTlv implements PcepValueType {
40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 */ 41 */
42 42
43 - protected static final Logger log = LoggerFactory.getLogger(IsisAreaIdentifierTlv.class); 43 + protected static final Logger log = LoggerFactory.getLogger(IsisAreaIdentifierSubTlv.class);
44 44
45 - public static final short TYPE = 107; //TODO:NEED TO HANDLE TBD24 45 + public static final short TYPE = 16;
46 private short hLength; 46 private short hLength;
47 47
48 private final byte[] rawValue; 48 private final byte[] rawValue;
...@@ -53,7 +53,7 @@ public class IsisAreaIdentifierTlv implements PcepValueType { ...@@ -53,7 +53,7 @@ public class IsisAreaIdentifierTlv implements PcepValueType {
53 * @param rawValue ISIS-Area-Identifier 53 * @param rawValue ISIS-Area-Identifier
54 * @param hLength length 54 * @param hLength length
55 */ 55 */
56 - public IsisAreaIdentifierTlv(byte[] rawValue, short hLength) { 56 + public IsisAreaIdentifierSubTlv(byte[] rawValue, short hLength) {
57 log.debug("ISISAreaIdentifierTlv"); 57 log.debug("ISISAreaIdentifierTlv");
58 this.rawValue = rawValue; 58 this.rawValue = rawValue;
59 if (0 == hLength) { 59 if (0 == hLength) {
...@@ -70,8 +70,8 @@ public class IsisAreaIdentifierTlv implements PcepValueType { ...@@ -70,8 +70,8 @@ public class IsisAreaIdentifierTlv implements PcepValueType {
70 * @param hLength length 70 * @param hLength length
71 * @return object of ISISAreaIdentifierTlv 71 * @return object of ISISAreaIdentifierTlv
72 */ 72 */
73 - public static IsisAreaIdentifierTlv of(final byte[] raw, short hLength) { 73 + public static IsisAreaIdentifierSubTlv of(final byte[] raw, short hLength) {
74 - return new IsisAreaIdentifierTlv(raw, hLength); 74 + return new IsisAreaIdentifierSubTlv(raw, hLength);
75 } 75 }
76 76
77 /** 77 /**
...@@ -108,8 +108,8 @@ public class IsisAreaIdentifierTlv implements PcepValueType { ...@@ -108,8 +108,8 @@ public class IsisAreaIdentifierTlv implements PcepValueType {
108 if (this == obj) { 108 if (this == obj) {
109 return true; 109 return true;
110 } 110 }
111 - if (obj instanceof IsisAreaIdentifierTlv) { 111 + if (obj instanceof IsisAreaIdentifierSubTlv) {
112 - IsisAreaIdentifierTlv other = (IsisAreaIdentifierTlv) obj; 112 + IsisAreaIdentifierSubTlv other = (IsisAreaIdentifierSubTlv) obj;
113 return Objects.equals(hLength, other.hLength) && Arrays.equals(rawValue, other.rawValue); 113 return Objects.equals(hLength, other.hLength) && Arrays.equals(rawValue, other.rawValue);
114 } 114 }
115 return false; 115 return false;
...@@ -134,7 +134,7 @@ public class IsisAreaIdentifierTlv implements PcepValueType { ...@@ -134,7 +134,7 @@ public class IsisAreaIdentifierTlv implements PcepValueType {
134 public static PcepValueType read(ChannelBuffer c, short hLength) { 134 public static PcepValueType read(ChannelBuffer c, short hLength) {
135 byte[] iIsisAreaIdentifier = new byte[hLength]; 135 byte[] iIsisAreaIdentifier = new byte[hLength];
136 c.readBytes(iIsisAreaIdentifier, 0, hLength); 136 c.readBytes(iIsisAreaIdentifier, 0, hLength);
137 - return new IsisAreaIdentifierTlv(iIsisAreaIdentifier, hLength); 137 + return new IsisAreaIdentifierSubTlv(iIsisAreaIdentifier, hLength);
138 } 138 }
139 139
140 @Override 140 @Override
......
...@@ -17,6 +17,7 @@ package org.onosproject.pcepio.types; ...@@ -17,6 +17,7 @@ package org.onosproject.pcepio.types;
17 17
18 import java.util.Iterator; 18 import java.util.Iterator;
19 import java.util.LinkedList; 19 import java.util.LinkedList;
20 +import java.util.List;
20 import java.util.ListIterator; 21 import java.util.ListIterator;
21 import java.util.Objects; 22 import java.util.Objects;
22 23
...@@ -29,12 +30,12 @@ import org.slf4j.LoggerFactory; ...@@ -29,12 +30,12 @@ import org.slf4j.LoggerFactory;
29 import com.google.common.base.MoreObjects; 30 import com.google.common.base.MoreObjects;
30 31
31 /** 32 /**
32 - * Provides TELinkAttributesTlv. 33 + * Provides LinkAttributesTlv.
33 */ 34 */
34 -public class TELinkAttributesTlv implements PcepValueType { 35 +public class LinkAttributesTlv implements PcepValueType {
35 36
36 /* 37 /*
37 - * Reference :PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02 38 + * Reference :draft-dhodylee-pce-pcep-ls-01, section 9.2.8.2.
38 * 0 1 2 3 39 * 0 1 2 3
39 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 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 41 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
...@@ -46,22 +47,22 @@ public class TELinkAttributesTlv implements PcepValueType { ...@@ -46,22 +47,22 @@ public class TELinkAttributesTlv implements PcepValueType {
46 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 47 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
47 */ 48 */
48 49
49 - protected static final Logger log = LoggerFactory.getLogger(TELinkAttributesTlv.class); 50 + protected static final Logger log = LoggerFactory.getLogger(LinkAttributesTlv.class);
50 51
51 - public static final short TYPE = 1897; //TODD:change this TBD27 52 + public static final short TYPE = (short) 65286;
52 public short hLength; 53 public short hLength;
53 54
54 public static final int TLV_HEADER_LENGTH = 4; 55 public static final int TLV_HEADER_LENGTH = 4;
55 56
56 // LinkDescriptors Sub-TLVs (variable) 57 // LinkDescriptors Sub-TLVs (variable)
57 - private LinkedList<PcepValueType> llLinkAttributesSubTLVs; 58 + private List<PcepValueType> llLinkAttributesSubTLVs;
58 59
59 /** 60 /**
60 * Constructor to initialize Link Attributes Sub TLVs. 61 * Constructor to initialize Link Attributes Sub TLVs.
61 * 62 *
62 * @param llLinkAttributesSubTLVs linked list of PcepValueType 63 * @param llLinkAttributesSubTLVs linked list of PcepValueType
63 */ 64 */
64 - public TELinkAttributesTlv(LinkedList<PcepValueType> llLinkAttributesSubTLVs) { 65 + public LinkAttributesTlv(List<PcepValueType> llLinkAttributesSubTLVs) {
65 this.llLinkAttributesSubTLVs = llLinkAttributesSubTLVs; 66 this.llLinkAttributesSubTLVs = llLinkAttributesSubTLVs;
66 } 67 }
67 68
...@@ -69,10 +70,10 @@ public class TELinkAttributesTlv implements PcepValueType { ...@@ -69,10 +70,10 @@ public class TELinkAttributesTlv implements PcepValueType {
69 * Returns object of TE Link Attributes TLV. 70 * Returns object of TE Link Attributes TLV.
70 * 71 *
71 * @param llLinkAttributesSubTLVs linked list of Link Attribute of Sub TLV 72 * @param llLinkAttributesSubTLVs linked list of Link Attribute of Sub TLV
72 - * @return object of TELinkAttributesTlv 73 + * @return object of LinkAttributesTlv
73 */ 74 */
74 - public static TELinkAttributesTlv of(final LinkedList<PcepValueType> llLinkAttributesSubTLVs) { 75 + public static LinkAttributesTlv of(final List<PcepValueType> llLinkAttributesSubTLVs) {
75 - return new TELinkAttributesTlv(llLinkAttributesSubTLVs); 76 + return new LinkAttributesTlv(llLinkAttributesSubTLVs);
76 } 77 }
77 78
78 /** 79 /**
...@@ -80,7 +81,7 @@ public class TELinkAttributesTlv implements PcepValueType { ...@@ -80,7 +81,7 @@ public class TELinkAttributesTlv implements PcepValueType {
80 * 81 *
81 * @return llLinkAttributesSubTLVs linked list of Link Attribute of Sub TLV 82 * @return llLinkAttributesSubTLVs linked list of Link Attribute of Sub TLV
82 */ 83 */
83 - public LinkedList<PcepValueType> getllLinkAttributesSubTLVs() { 84 + public List<PcepValueType> getllLinkAttributesSubTLVs() {
84 return llLinkAttributesSubTLVs; 85 return llLinkAttributesSubTLVs;
85 } 86 }
86 87
...@@ -117,13 +118,13 @@ public class TELinkAttributesTlv implements PcepValueType { ...@@ -117,13 +118,13 @@ public class TELinkAttributesTlv implements PcepValueType {
117 * the size, if both are same then we should check for the subtlv objects otherwise 118 * the size, if both are same then we should check for the subtlv objects otherwise
118 * we should return false. 119 * we should return false.
119 */ 120 */
120 - if (obj instanceof TELinkAttributesTlv) { 121 + if (obj instanceof LinkAttributesTlv) {
121 int countObjSubTlv = 0; 122 int countObjSubTlv = 0;
122 int countOtherSubTlv = 0; 123 int countOtherSubTlv = 0;
123 boolean isCommonSubTlv = true; 124 boolean isCommonSubTlv = true;
124 - TELinkAttributesTlv other = (TELinkAttributesTlv) obj; 125 + LinkAttributesTlv other = (LinkAttributesTlv) obj;
125 - Iterator<PcepValueType> objListIterator = ((TELinkAttributesTlv) obj).llLinkAttributesSubTLVs.iterator(); 126 + Iterator<PcepValueType> objListIterator = ((LinkAttributesTlv) obj).llLinkAttributesSubTLVs.iterator();
126 - countObjSubTlv = ((TELinkAttributesTlv) obj).llLinkAttributesSubTLVs.size(); 127 + countObjSubTlv = ((LinkAttributesTlv) obj).llLinkAttributesSubTLVs.size();
127 countOtherSubTlv = other.llLinkAttributesSubTLVs.size(); 128 countOtherSubTlv = other.llLinkAttributesSubTLVs.size();
128 if (countObjSubTlv != countOtherSubTlv) { 129 if (countObjSubTlv != countOtherSubTlv) {
129 return false; 130 return false;
...@@ -180,13 +181,13 @@ public class TELinkAttributesTlv implements PcepValueType { ...@@ -180,13 +181,13 @@ public class TELinkAttributesTlv implements PcepValueType {
180 * 181 *
181 * @param c input channel buffer 182 * @param c input channel buffer
182 * @param hLength length 183 * @param hLength length
183 - * @return object of TELinkAttributesTlv 184 + * @return object of LinkAttributesTlv
184 * @throws PcepParseException if mandatory fields are missing 185 * @throws PcepParseException if mandatory fields are missing
185 */ 186 */
186 public static PcepValueType read(ChannelBuffer c, short hLength) throws PcepParseException { 187 public static PcepValueType read(ChannelBuffer c, short hLength) throws PcepParseException {
187 188
188 // Node Descriptor Sub-TLVs (variable) 189 // Node Descriptor Sub-TLVs (variable)
189 - LinkedList<PcepValueType> llLinkAttributesSubTLVs = new LinkedList<>(); 190 + List<PcepValueType> llLinkAttributesSubTLVs = new LinkedList<>();
190 191
191 ChannelBuffer tempCb = c.readBytes(hLength); 192 ChannelBuffer tempCb = c.readBytes(hLength);
192 193
...@@ -198,65 +199,65 @@ public class TELinkAttributesTlv implements PcepValueType { ...@@ -198,65 +199,65 @@ public class TELinkAttributesTlv implements PcepValueType {
198 short length = tempCb.readShort(); 199 short length = tempCb.readShort();
199 switch (hType) { 200 switch (hType) {
200 201
201 - case IPv4TERouterIdOfLocalNodeTlv.TYPE: 202 + case IPv4RouterIdOfLocalNodeSubTlv.TYPE:
202 iValue = tempCb.readInt(); 203 iValue = tempCb.readInt();
203 - tlv = new IPv4TERouterIdOfLocalNodeTlv(iValue); 204 + tlv = new IPv4RouterIdOfLocalNodeSubTlv(iValue);
204 break; 205 break;
205 - case IPv6TERouterIdofLocalNodeTlv.TYPE: 206 + case IPv6RouterIdofLocalNodeSubTlv.TYPE:
206 - byte[] ipv6LValue = new byte[IPv6TERouterIdofLocalNodeTlv.VALUE_LENGTH]; 207 + byte[] ipv6LValue = new byte[IPv6RouterIdofLocalNodeSubTlv.VALUE_LENGTH];
207 - tempCb.readBytes(ipv6LValue, 0, IPv6TERouterIdofLocalNodeTlv.VALUE_LENGTH); 208 + tempCb.readBytes(ipv6LValue, 0, IPv6RouterIdofLocalNodeSubTlv.VALUE_LENGTH);
208 - tlv = new IPv6TERouterIdofLocalNodeTlv(ipv6LValue); 209 + tlv = new IPv6RouterIdofLocalNodeSubTlv(ipv6LValue);
209 break; 210 break;
210 - case IPv4TERouterIdOfRemoteNodeTlv.TYPE: 211 + case IPv4RouterIdOfRemoteNodeSubTlv.TYPE:
211 iValue = tempCb.readInt(); 212 iValue = tempCb.readInt();
212 - tlv = new IPv4TERouterIdOfRemoteNodeTlv(iValue); 213 + tlv = new IPv4RouterIdOfRemoteNodeSubTlv(iValue);
213 break; 214 break;
214 - case IPv6TERouterIdofRemoteNodeTlv.TYPE: 215 + case IPv6RouterIdofRemoteNodeSubTlv.TYPE:
215 - byte[] ipv6RValue = new byte[IPv6TERouterIdofRemoteNodeTlv.VALUE_LENGTH]; 216 + byte[] ipv6RValue = new byte[IPv6RouterIdofRemoteNodeSubTlv.VALUE_LENGTH];
216 - tempCb.readBytes(ipv6RValue, 0, IPv6TERouterIdofRemoteNodeTlv.VALUE_LENGTH); 217 + tempCb.readBytes(ipv6RValue, 0, IPv6RouterIdofRemoteNodeSubTlv.VALUE_LENGTH);
217 - tlv = new IPv6TERouterIdofRemoteNodeTlv(ipv6RValue); 218 + tlv = new IPv6RouterIdofRemoteNodeSubTlv(ipv6RValue);
218 break; 219 break;
219 - case LinkLocalRemoteIdentifiersTlv.TYPE: 220 + case LinkLocalRemoteIdentifiersSubTlv.TYPE:
220 - tlv = LinkLocalRemoteIdentifiersTlv.read(tempCb); 221 + tlv = LinkLocalRemoteIdentifiersSubTlv.read(tempCb);
221 break; 222 break;
222 - case AdministrativeGroupTlv.TYPE: 223 + case AdministrativeGroupSubTlv.TYPE:
223 iValue = tempCb.readInt(); 224 iValue = tempCb.readInt();
224 - tlv = new AdministrativeGroupTlv(iValue); 225 + tlv = new AdministrativeGroupSubTlv(iValue);
225 break; 226 break;
226 - case MaximumLinkBandwidthTlv.TYPE: 227 + case MaximumLinkBandwidthSubTlv.TYPE:
227 iValue = tempCb.readInt(); 228 iValue = tempCb.readInt();
228 - tlv = new MaximumLinkBandwidthTlv(iValue); 229 + tlv = new MaximumLinkBandwidthSubTlv(iValue);
229 break; 230 break;
230 - case MaximumReservableLinkBandwidthTlv.TYPE: 231 + case MaximumReservableLinkBandwidthSubTlv.TYPE:
231 iValue = tempCb.readInt(); 232 iValue = tempCb.readInt();
232 - tlv = new MaximumReservableLinkBandwidthTlv(iValue); 233 + tlv = new MaximumReservableLinkBandwidthSubTlv(iValue);
233 break; 234 break;
234 - case UnreservedBandwidthTlv.TYPE: 235 + case UnreservedBandwidthSubTlv.TYPE:
235 iValue = tempCb.readInt(); 236 iValue = tempCb.readInt();
236 - tlv = new UnreservedBandwidthTlv(iValue); 237 + tlv = new UnreservedBandwidthSubTlv(iValue);
237 break; 238 break;
238 - case TEDefaultMetricTlv.TYPE: 239 + case TEDefaultMetricSubTlv.TYPE:
239 iValue = tempCb.readInt(); 240 iValue = tempCb.readInt();
240 - tlv = new TEDefaultMetricTlv(iValue); 241 + tlv = new TEDefaultMetricSubTlv(iValue);
241 break; 242 break;
242 - case LinkProtectionTypeTlv.TYPE: 243 + case LinkProtectionTypeSubTlv.TYPE:
243 - tlv = LinkProtectionTypeTlv.read(tempCb); 244 + tlv = LinkProtectionTypeSubTlv.read(tempCb);
244 break; 245 break;
245 - case MplsProtocolMaskTlv.TYPE: 246 + case MplsProtocolMaskSubTlv.TYPE:
246 byte cValue = tempCb.readByte(); 247 byte cValue = tempCb.readByte();
247 - tlv = new MplsProtocolMaskTlv(cValue); 248 + tlv = new MplsProtocolMaskSubTlv(cValue);
248 break; 249 break;
249 - case IgpMetricTlv.TYPE: 250 + case IgpMetricSubTlv.TYPE:
250 - tlv = IgpMetricTlv.read(tempCb, length); 251 + tlv = IgpMetricSubTlv.read(tempCb, length);
251 break; 252 break;
252 - case SharedRiskLinkGroupTlv.TYPE: 253 + case SharedRiskLinkGroupSubTlv.TYPE:
253 - tlv = SharedRiskLinkGroupTlv.read(tempCb, length); 254 + tlv = SharedRiskLinkGroupSubTlv.read(tempCb, length);
254 break; 255 break;
255 - case OpaqueLinkAttributeTlv.TYPE: 256 + case OpaqueLinkAttributeSubTlv.TYPE:
256 - tlv = OpaqueLinkAttributeTlv.read(tempCb, length); 257 + tlv = OpaqueLinkAttributeSubTlv.read(tempCb, length);
257 break; 258 break;
258 - case LinkNameTlv.TYPE: 259 + case LinkNameAttributeSubTlv.TYPE:
259 - tlv = LinkNameTlv.read(tempCb, length); 260 + tlv = LinkNameAttributeSubTlv.read(tempCb, length);
260 break; 261 break;
261 default: 262 default:
262 throw new PcepParseException("Unsupported Sub TLV type :" + hType); 263 throw new PcepParseException("Unsupported Sub TLV type :" + hType);
...@@ -278,7 +279,7 @@ public class TELinkAttributesTlv implements PcepValueType { ...@@ -278,7 +279,7 @@ public class TELinkAttributesTlv implements PcepValueType {
278 throw new PcepParseException("Sub Tlv parsing error. Extra bytes received."); 279 throw new PcepParseException("Sub Tlv parsing error. Extra bytes received.");
279 } 280 }
280 281
281 - return new TELinkAttributesTlv(llLinkAttributesSubTLVs); 282 + return new LinkAttributesTlv(llLinkAttributesSubTLVs);
282 } 283 }
283 284
284 @Override 285 @Override
......
...@@ -17,6 +17,7 @@ package org.onosproject.pcepio.types; ...@@ -17,6 +17,7 @@ package org.onosproject.pcepio.types;
17 17
18 import java.util.Iterator; 18 import java.util.Iterator;
19 import java.util.LinkedList; 19 import java.util.LinkedList;
20 +import java.util.List;
20 import java.util.ListIterator; 21 import java.util.ListIterator;
21 import java.util.Objects; 22 import java.util.Objects;
22 23
...@@ -31,10 +32,10 @@ import com.google.common.base.MoreObjects; ...@@ -31,10 +32,10 @@ import com.google.common.base.MoreObjects;
31 /** 32 /**
32 * Provides TE Link Descriptors TLV. 33 * Provides TE Link Descriptors TLV.
33 */ 34 */
34 -public class TELinkDescriptorsTlv implements PcepValueType { 35 +public class LinkDescriptorsTlv implements PcepValueType {
35 36
36 /* 37 /*
37 - * Reference: PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02 38 + * Reference: draft-dhodylee-pce-pcep-ls-01, section 9.2.6.
38 * 0 1 2 3 39 * 0 1 2 3
39 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 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 41 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
...@@ -47,33 +48,33 @@ public class TELinkDescriptorsTlv implements PcepValueType { ...@@ -47,33 +48,33 @@ public class TELinkDescriptorsTlv implements PcepValueType {
47 48
48 */ 49 */
49 50
50 - protected static final Logger log = LoggerFactory.getLogger(TELinkDescriptorsTlv.class); 51 + protected static final Logger log = LoggerFactory.getLogger(LinkDescriptorsTlv.class);
51 52
52 - public static final short TYPE = 1070; //TODD:change this TBD14 53 + public static final short TYPE = (short) 65284;
53 public short hLength; 54 public short hLength;
54 55
55 public static final int TLV_HEADER_LENGTH = 4; 56 public static final int TLV_HEADER_LENGTH = 4;
56 57
57 // LinkDescriptors Sub-TLVs (variable) 58 // LinkDescriptors Sub-TLVs (variable)
58 - private LinkedList<PcepValueType> llLinkDescriptorsSubTLVs; 59 + private List<PcepValueType> llLinkDescriptorsSubTLVs;
59 60
60 /** 61 /**
61 * Constructor to initialize llLinkDescriptorsSubTLVs. 62 * Constructor to initialize llLinkDescriptorsSubTLVs.
62 * 63 *
63 * @param llLinkDescriptorsSubTLVs of PcepValueType 64 * @param llLinkDescriptorsSubTLVs of PcepValueType
64 */ 65 */
65 - public TELinkDescriptorsTlv(LinkedList<PcepValueType> llLinkDescriptorsSubTLVs) { 66 + public LinkDescriptorsTlv(List<PcepValueType> llLinkDescriptorsSubTLVs) {
66 this.llLinkDescriptorsSubTLVs = llLinkDescriptorsSubTLVs; 67 this.llLinkDescriptorsSubTLVs = llLinkDescriptorsSubTLVs;
67 } 68 }
68 69
69 /** 70 /**
70 - * Returns object of TELinkDescriptorsTLV. 71 + * Returns object of LinkDescriptorsTlv.
71 * 72 *
72 * @param llLinkDescriptorsSubTLVs of PcepValueType 73 * @param llLinkDescriptorsSubTLVs of PcepValueType
73 - * @return object of TELinkDescriptorsTLV 74 + * @return object of LinkDescriptorsTlv
74 */ 75 */
75 - public static TELinkDescriptorsTlv of(final LinkedList<PcepValueType> llLinkDescriptorsSubTLVs) { 76 + public static LinkDescriptorsTlv of(final List<PcepValueType> llLinkDescriptorsSubTLVs) {
76 - return new TELinkDescriptorsTlv(llLinkDescriptorsSubTLVs); 77 + return new LinkDescriptorsTlv(llLinkDescriptorsSubTLVs);
77 } 78 }
78 79
79 /** 80 /**
...@@ -81,7 +82,7 @@ public class TELinkDescriptorsTlv implements PcepValueType { ...@@ -81,7 +82,7 @@ public class TELinkDescriptorsTlv implements PcepValueType {
81 * 82 *
82 * @return llLinkDescriptorsSubTLVs linked list of Link Attribute of Sub TLV 83 * @return llLinkDescriptorsSubTLVs linked list of Link Attribute of Sub TLV
83 */ 84 */
84 - public LinkedList<PcepValueType> getllLinkDescriptorsSubTLVs() { 85 + public List<PcepValueType> getllLinkDescriptorsSubTLVs() {
85 return llLinkDescriptorsSubTLVs; 86 return llLinkDescriptorsSubTLVs;
86 } 87 }
87 88
...@@ -118,13 +119,13 @@ public class TELinkDescriptorsTlv implements PcepValueType { ...@@ -118,13 +119,13 @@ public class TELinkDescriptorsTlv implements PcepValueType {
118 * the size, if both are same then we should check for the subtlv objects otherwise 119 * the size, if both are same then we should check for the subtlv objects otherwise
119 * we should return false. 120 * we should return false.
120 */ 121 */
121 - if (obj instanceof TELinkDescriptorsTlv) { 122 + if (obj instanceof LinkDescriptorsTlv) {
122 int countObjSubTlv = 0; 123 int countObjSubTlv = 0;
123 int countOtherSubTlv = 0; 124 int countOtherSubTlv = 0;
124 boolean isCommonSubTlv = true; 125 boolean isCommonSubTlv = true;
125 - TELinkDescriptorsTlv other = (TELinkDescriptorsTlv) obj; 126 + LinkDescriptorsTlv other = (LinkDescriptorsTlv) obj;
126 - Iterator<PcepValueType> objListIterator = ((TELinkDescriptorsTlv) obj).llLinkDescriptorsSubTLVs.iterator(); 127 + Iterator<PcepValueType> objListIterator = ((LinkDescriptorsTlv) obj).llLinkDescriptorsSubTLVs.iterator();
127 - countObjSubTlv = ((TELinkDescriptorsTlv) obj).llLinkDescriptorsSubTLVs.size(); 128 + countObjSubTlv = ((LinkDescriptorsTlv) obj).llLinkDescriptorsSubTLVs.size();
128 countOtherSubTlv = other.llLinkDescriptorsSubTLVs.size(); 129 countOtherSubTlv = other.llLinkDescriptorsSubTLVs.size();
129 if (countObjSubTlv != countOtherSubTlv) { 130 if (countObjSubTlv != countOtherSubTlv) {
130 return false; 131 return false;
...@@ -173,17 +174,17 @@ public class TELinkDescriptorsTlv implements PcepValueType { ...@@ -173,17 +174,17 @@ public class TELinkDescriptorsTlv implements PcepValueType {
173 } 174 }
174 175
175 /** 176 /**
176 - * Reads channel buffer and returns object of TELinkDescriptorsTLV. 177 + * Reads channel buffer and returns object of LinkDescriptorsTlv.
177 * 178 *
178 * @param c input channel buffer 179 * @param c input channel buffer
179 * @param length length 180 * @param length length
180 - * @return object of TELinkDescriptorsTLV 181 + * @return object of LinkDescriptorsTlv
181 * @throws PcepParseException if mandatory fields are missing 182 * @throws PcepParseException if mandatory fields are missing
182 */ 183 */
183 public static PcepValueType read(ChannelBuffer c, short length) throws PcepParseException { 184 public static PcepValueType read(ChannelBuffer c, short length) throws PcepParseException {
184 185
185 // Node Descriptor Sub-TLVs (variable) 186 // Node Descriptor Sub-TLVs (variable)
186 - LinkedList<PcepValueType> llLinkDescriptorsSubTLVs = new LinkedList<>(); 187 + List<PcepValueType> llLinkDescriptorsSubTLVs = new LinkedList<>();
187 188
188 ChannelBuffer tempCb = c.readBytes(length); 189 ChannelBuffer tempCb = c.readBytes(length);
189 190
...@@ -196,26 +197,26 @@ public class TELinkDescriptorsTlv implements PcepValueType { ...@@ -196,26 +197,26 @@ public class TELinkDescriptorsTlv implements PcepValueType {
196 log.debug("sub Tlv Length" + hLength); 197 log.debug("sub Tlv Length" + hLength);
197 switch (hType) { 198 switch (hType) {
198 199
199 - case LinkLocalRemoteIdentifiersTlv.TYPE: 200 + case LinkLocalRemoteIdentifiersSubTlv.TYPE:
200 - tlv = LinkLocalRemoteIdentifiersTlv.read(tempCb); 201 + tlv = LinkLocalRemoteIdentifiersSubTlv.read(tempCb);
201 break; 202 break;
202 - case IPv4InterfaceAddressTlv.TYPE: 203 + case IPv4InterfaceAddressSubTlv.TYPE:
203 iValue = tempCb.readInt(); 204 iValue = tempCb.readInt();
204 - tlv = new IPv4InterfaceAddressTlv(iValue); 205 + tlv = new IPv4InterfaceAddressSubTlv(iValue);
205 break; 206 break;
206 - case IPv4NeighborAddressTlv.TYPE: 207 + case IPv4NeighborAddressSubTlv.TYPE:
207 iValue = tempCb.readInt(); 208 iValue = tempCb.readInt();
208 - tlv = new IPv4NeighborAddressTlv(iValue); 209 + tlv = new IPv4NeighborAddressSubTlv(iValue);
209 break; 210 break;
210 - case IPv6InterfaceAddressTlv.TYPE: 211 + case IPv6InterfaceAddressSubTlv.TYPE:
211 - byte[] ipv6Value = new byte[IPv6InterfaceAddressTlv.VALUE_LENGTH]; 212 + byte[] ipv6Value = new byte[IPv6InterfaceAddressSubTlv.VALUE_LENGTH];
212 - tempCb.readBytes(ipv6Value, 0, IPv6InterfaceAddressTlv.VALUE_LENGTH); 213 + tempCb.readBytes(ipv6Value, 0, IPv6InterfaceAddressSubTlv.VALUE_LENGTH);
213 - tlv = new IPv6InterfaceAddressTlv(ipv6Value); 214 + tlv = new IPv6InterfaceAddressSubTlv(ipv6Value);
214 break; 215 break;
215 - case IPv6NeighborAddressTlv.TYPE: 216 + case IPv6NeighborAddressSubTlv.TYPE:
216 - byte[] ipv6NeighborAdd = new byte[IPv6NeighborAddressTlv.VALUE_LENGTH]; 217 + byte[] ipv6NeighborAdd = new byte[IPv6NeighborAddressSubTlv.VALUE_LENGTH];
217 - tempCb.readBytes(ipv6NeighborAdd, 0, IPv6NeighborAddressTlv.VALUE_LENGTH); 218 + tempCb.readBytes(ipv6NeighborAdd, 0, IPv6NeighborAddressSubTlv.VALUE_LENGTH);
218 - tlv = new IPv6NeighborAddressTlv(ipv6NeighborAdd); 219 + tlv = new IPv6NeighborAddressSubTlv(ipv6NeighborAdd);
219 break; 220 break;
220 default: 221 default:
221 throw new PcepParseException("Unsupported Sub TLV type:" + hType); 222 throw new PcepParseException("Unsupported Sub TLV type:" + hType);
...@@ -237,7 +238,7 @@ public class TELinkDescriptorsTlv implements PcepValueType { ...@@ -237,7 +238,7 @@ public class TELinkDescriptorsTlv implements PcepValueType {
237 238
238 throw new PcepParseException("Sub Tlv parsing error. Extra bytes received."); 239 throw new PcepParseException("Sub Tlv parsing error. Extra bytes received.");
239 } 240 }
240 - return new TELinkDescriptorsTlv(llLinkDescriptorsSubTLVs); 241 + return new LinkDescriptorsTlv(llLinkDescriptorsSubTLVs);
241 } 242 }
242 243
243 @Override 244 @Override
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides Local and remote Link Identifiers. 28 * Provides Local and remote Link Identifiers.
29 */ 29 */
30 -public class LinkLocalRemoteIdentifiersTlv implements PcepValueType { 30 +public class LinkLocalRemoteIdentifiersSubTlv implements PcepValueType {
31 31
32 /* Reference :RFC5307 32 /* Reference :RFC5307
33 * 0 1 2 3 33 * 0 1 2 3
...@@ -41,9 +41,9 @@ public class LinkLocalRemoteIdentifiersTlv implements PcepValueType { ...@@ -41,9 +41,9 @@ public class LinkLocalRemoteIdentifiersTlv implements PcepValueType {
41 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 41 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
42 42
43 */ 43 */
44 - protected static final Logger log = LoggerFactory.getLogger(LinkLocalRemoteIdentifiersTlv.class); 44 + protected static final Logger log = LoggerFactory.getLogger(LinkLocalRemoteIdentifiersSubTlv.class);
45 45
46 - public static final short TYPE = 4; 46 + public static final short TYPE = 6;
47 public static final short LENGTH = 8; 47 public static final short LENGTH = 8;
48 private final int iLinkLocalIdentifier; 48 private final int iLinkLocalIdentifier;
49 private final int iLinkRemoteIdentifier; 49 private final int iLinkRemoteIdentifier;
...@@ -54,7 +54,7 @@ public class LinkLocalRemoteIdentifiersTlv implements PcepValueType { ...@@ -54,7 +54,7 @@ public class LinkLocalRemoteIdentifiersTlv implements PcepValueType {
54 * @param iLinkLocalIdentifier Link Local identifier 54 * @param iLinkLocalIdentifier Link Local identifier
55 * @param iLinkRemoteIdentifier Link Remote identifier 55 * @param iLinkRemoteIdentifier Link Remote identifier
56 */ 56 */
57 - public LinkLocalRemoteIdentifiersTlv(int iLinkLocalIdentifier, int iLinkRemoteIdentifier) { 57 + public LinkLocalRemoteIdentifiersSubTlv(int iLinkLocalIdentifier, int iLinkRemoteIdentifier) {
58 this.iLinkLocalIdentifier = iLinkLocalIdentifier; 58 this.iLinkLocalIdentifier = iLinkLocalIdentifier;
59 this.iLinkRemoteIdentifier = iLinkRemoteIdentifier; 59 this.iLinkRemoteIdentifier = iLinkRemoteIdentifier;
60 } 60 }
...@@ -66,8 +66,8 @@ public class LinkLocalRemoteIdentifiersTlv implements PcepValueType { ...@@ -66,8 +66,8 @@ public class LinkLocalRemoteIdentifiersTlv implements PcepValueType {
66 * @param iLinkRemoteIdentifier Link Remote identifier 66 * @param iLinkRemoteIdentifier Link Remote identifier
67 * @return object of LinkLocalRemoteIdentifiersTlv 67 * @return object of LinkLocalRemoteIdentifiersTlv
68 */ 68 */
69 - public static LinkLocalRemoteIdentifiersTlv of(int iLinkLocalIdentifier, int iLinkRemoteIdentifier) { 69 + public static LinkLocalRemoteIdentifiersSubTlv of(int iLinkLocalIdentifier, int iLinkRemoteIdentifier) {
70 - return new LinkLocalRemoteIdentifiersTlv(iLinkLocalIdentifier, iLinkRemoteIdentifier); 70 + return new LinkLocalRemoteIdentifiersSubTlv(iLinkLocalIdentifier, iLinkRemoteIdentifier);
71 } 71 }
72 72
73 /** 73 /**
...@@ -113,8 +113,8 @@ public class LinkLocalRemoteIdentifiersTlv implements PcepValueType { ...@@ -113,8 +113,8 @@ public class LinkLocalRemoteIdentifiersTlv implements PcepValueType {
113 if (this == obj) { 113 if (this == obj) {
114 return true; 114 return true;
115 } 115 }
116 - if (obj instanceof LinkLocalRemoteIdentifiersTlv) { 116 + if (obj instanceof LinkLocalRemoteIdentifiersSubTlv) {
117 - LinkLocalRemoteIdentifiersTlv other = (LinkLocalRemoteIdentifiersTlv) obj; 117 + LinkLocalRemoteIdentifiersSubTlv other = (LinkLocalRemoteIdentifiersSubTlv) obj;
118 return Objects.equals(iLinkLocalIdentifier, other.iLinkLocalIdentifier) 118 return Objects.equals(iLinkLocalIdentifier, other.iLinkLocalIdentifier)
119 && Objects.equals(iLinkRemoteIdentifier, other.iLinkRemoteIdentifier); 119 && Objects.equals(iLinkRemoteIdentifier, other.iLinkRemoteIdentifier);
120 } 120 }
...@@ -140,7 +140,7 @@ public class LinkLocalRemoteIdentifiersTlv implements PcepValueType { ...@@ -140,7 +140,7 @@ public class LinkLocalRemoteIdentifiersTlv implements PcepValueType {
140 public static PcepValueType read(ChannelBuffer c) { 140 public static PcepValueType read(ChannelBuffer c) {
141 int iLinkLocalIdentifier = c.readInt(); 141 int iLinkLocalIdentifier = c.readInt();
142 int iLinkRemoteIdentifier = c.readInt(); 142 int iLinkRemoteIdentifier = c.readInt();
143 - return new LinkLocalRemoteIdentifiersTlv(iLinkLocalIdentifier, iLinkRemoteIdentifier); 143 + return new LinkLocalRemoteIdentifiersSubTlv(iLinkLocalIdentifier, iLinkRemoteIdentifier);
144 } 144 }
145 145
146 @Override 146 @Override
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects.ToStringHelper; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects.ToStringHelper;
27 /** 27 /**
28 * Provides the Link Name. 28 * Provides the Link Name.
29 */ 29 */
30 -public class LinkNameTlv implements PcepValueType { 30 +public class LinkNameAttributeSubTlv implements PcepValueType {
31 31
32 /* Reference :[I-D.ietf-idr- ls-distribution] /3.3.2.7 32 /* Reference :[I-D.ietf-idr- ls-distribution] /3.3.2.7
33 * Link name tlv format. 33 * Link name tlv format.
...@@ -40,9 +40,9 @@ public class LinkNameTlv implements PcepValueType { ...@@ -40,9 +40,9 @@ public class LinkNameTlv implements PcepValueType {
40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 */ 41 */
42 42
43 - protected static final Logger log = LoggerFactory.getLogger(LinkNameTlv.class); 43 + protected static final Logger log = LoggerFactory.getLogger(LinkNameAttributeSubTlv.class);
44 44
45 - public static final short TYPE = 1098; //TODO:NEED TO HANDLE TDB43 45 + public static final short TYPE = 32;
46 private short hLength; 46 private short hLength;
47 47
48 private final byte[] rawValue; 48 private final byte[] rawValue;
...@@ -53,7 +53,7 @@ public class LinkNameTlv implements PcepValueType { ...@@ -53,7 +53,7 @@ public class LinkNameTlv implements PcepValueType {
53 * @param rawValue Link-Name 53 * @param rawValue Link-Name
54 * @param hLength length 54 * @param hLength length
55 */ 55 */
56 - public LinkNameTlv(byte[] rawValue, short hLength) { 56 + public LinkNameAttributeSubTlv(byte[] rawValue, short hLength) {
57 this.rawValue = rawValue; 57 this.rawValue = rawValue;
58 if (0 == hLength) { 58 if (0 == hLength) {
59 this.hLength = (short) rawValue.length; 59 this.hLength = (short) rawValue.length;
...@@ -69,8 +69,8 @@ public class LinkNameTlv implements PcepValueType { ...@@ -69,8 +69,8 @@ public class LinkNameTlv implements PcepValueType {
69 * @param hLength length 69 * @param hLength length
70 * @return object of LinkNameTlv 70 * @return object of LinkNameTlv
71 */ 71 */
72 - public static LinkNameTlv of(final byte[] raw, short hLength) { 72 + public static LinkNameAttributeSubTlv of(final byte[] raw, short hLength) {
73 - return new LinkNameTlv(raw, hLength); 73 + return new LinkNameAttributeSubTlv(raw, hLength);
74 } 74 }
75 75
76 /** 76 /**
...@@ -107,8 +107,8 @@ public class LinkNameTlv implements PcepValueType { ...@@ -107,8 +107,8 @@ public class LinkNameTlv implements PcepValueType {
107 if (this == obj) { 107 if (this == obj) {
108 return true; 108 return true;
109 } 109 }
110 - if (obj instanceof LinkNameTlv) { 110 + if (obj instanceof LinkNameAttributeSubTlv) {
111 - LinkNameTlv other = (LinkNameTlv) obj; 111 + LinkNameAttributeSubTlv other = (LinkNameAttributeSubTlv) obj;
112 return Arrays.equals(this.rawValue, other.rawValue); 112 return Arrays.equals(this.rawValue, other.rawValue);
113 } 113 }
114 return false; 114 return false;
...@@ -133,7 +133,7 @@ public class LinkNameTlv implements PcepValueType { ...@@ -133,7 +133,7 @@ public class LinkNameTlv implements PcepValueType {
133 public static PcepValueType read(ChannelBuffer c, short hLength) { 133 public static PcepValueType read(ChannelBuffer c, short hLength) {
134 byte[] linkName = new byte[hLength]; 134 byte[] linkName = new byte[hLength];
135 c.readBytes(linkName, 0, hLength); 135 c.readBytes(linkName, 0, hLength);
136 - return new LinkNameTlv(linkName, hLength); 136 + return new LinkNameAttributeSubTlv(linkName, hLength);
137 } 137 }
138 138
139 @Override 139 @Override
......
...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects; ...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects;
28 * Provide Link Protection Type. 28 * Provide Link Protection Type.
29 */ 29 */
30 30
31 -public class LinkProtectionTypeTlv implements PcepValueType { 31 +public class LinkProtectionTypeSubTlv implements PcepValueType {
32 32
33 /* Reference :[RFC5307]/1.2 33 /* Reference :[RFC5307]/1.2
34 * 0 1 2 3 34 * 0 1 2 3
...@@ -39,9 +39,9 @@ public class LinkProtectionTypeTlv implements PcepValueType { ...@@ -39,9 +39,9 @@ public class LinkProtectionTypeTlv implements PcepValueType {
39 |Protection Cap | Reserved | 39 |Protection Cap | Reserved |
40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 */ 41 */
42 - protected static final Logger log = LoggerFactory.getLogger(LinkProtectionTypeTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(LinkProtectionTypeSubTlv.class);
43 43
44 - public static final short TYPE = 20; //TDB38 44 + public static final short TYPE = 27;
45 public static final short LENGTH = 2; 45 public static final short LENGTH = 2;
46 private final byte protectionCap; 46 private final byte protectionCap;
47 private final byte reserved; 47 private final byte reserved;
...@@ -51,7 +51,7 @@ public class LinkProtectionTypeTlv implements PcepValueType { ...@@ -51,7 +51,7 @@ public class LinkProtectionTypeTlv implements PcepValueType {
51 * 51 *
52 * @param protectionCap Protection Cap 52 * @param protectionCap Protection Cap
53 */ 53 */
54 - public LinkProtectionTypeTlv(byte protectionCap) { 54 + public LinkProtectionTypeSubTlv(byte protectionCap) {
55 this.protectionCap = protectionCap; 55 this.protectionCap = protectionCap;
56 this.reserved = 0; 56 this.reserved = 0;
57 } 57 }
...@@ -62,7 +62,7 @@ public class LinkProtectionTypeTlv implements PcepValueType { ...@@ -62,7 +62,7 @@ public class LinkProtectionTypeTlv implements PcepValueType {
62 * @param protectionCap Protection Cap 62 * @param protectionCap Protection Cap
63 * @param reserved Reserved value 63 * @param reserved Reserved value
64 */ 64 */
65 - public LinkProtectionTypeTlv(byte protectionCap, byte reserved) { 65 + public LinkProtectionTypeSubTlv(byte protectionCap, byte reserved) {
66 this.protectionCap = protectionCap; 66 this.protectionCap = protectionCap;
67 this.reserved = reserved; 67 this.reserved = reserved;
68 } 68 }
...@@ -101,8 +101,8 @@ public class LinkProtectionTypeTlv implements PcepValueType { ...@@ -101,8 +101,8 @@ public class LinkProtectionTypeTlv implements PcepValueType {
101 if (this == obj) { 101 if (this == obj) {
102 return true; 102 return true;
103 } 103 }
104 - if (obj instanceof LinkProtectionTypeTlv) { 104 + if (obj instanceof LinkProtectionTypeSubTlv) {
105 - LinkProtectionTypeTlv other = (LinkProtectionTypeTlv) obj; 105 + LinkProtectionTypeSubTlv other = (LinkProtectionTypeSubTlv) obj;
106 return Objects.equals(protectionCap, other.protectionCap) && Objects.equals(reserved, other.reserved); 106 return Objects.equals(protectionCap, other.protectionCap) && Objects.equals(reserved, other.reserved);
107 } 107 }
108 108
...@@ -128,7 +128,7 @@ public class LinkProtectionTypeTlv implements PcepValueType { ...@@ -128,7 +128,7 @@ public class LinkProtectionTypeTlv implements PcepValueType {
128 public static PcepValueType read(ChannelBuffer c) { 128 public static PcepValueType read(ChannelBuffer c) {
129 byte protectionCap = c.readByte(); 129 byte protectionCap = c.readByte();
130 byte reserved = c.readByte(); 130 byte reserved = c.readByte();
131 - return new LinkProtectionTypeTlv(protectionCap, reserved); 131 + return new LinkProtectionTypeSubTlv(protectionCap, reserved);
132 } 132 }
133 133
134 @Override 134 @Override
......
...@@ -17,6 +17,7 @@ package org.onosproject.pcepio.types; ...@@ -17,6 +17,7 @@ package org.onosproject.pcepio.types;
17 17
18 import java.util.Iterator; 18 import java.util.Iterator;
19 import java.util.LinkedList; 19 import java.util.LinkedList;
20 +import java.util.List;
20 import java.util.ListIterator; 21 import java.util.ListIterator;
21 import java.util.Objects; 22 import java.util.Objects;
22 23
...@@ -31,9 +32,9 @@ import com.google.common.base.MoreObjects; ...@@ -31,9 +32,9 @@ import com.google.common.base.MoreObjects;
31 /** 32 /**
32 * Provides Local TE Node Descriptors TLV which contains Node Descriptor Sub-TLVs. 33 * Provides Local TE Node Descriptors TLV which contains Node Descriptor Sub-TLVs.
33 */ 34 */
34 -public class LocalTENodeDescriptorsTlv implements PcepValueType { 35 +public class LocalNodeDescriptorsTlv implements PcepValueType {
35 36
36 - /* REFERENCE :draft-ietf-idr-ls-distribution-10 37 + /* REFERENCE :draft-dhodylee-pce-pcep-ls-01, section 9.2.2
37 * 0 1 2 3 38 * 0 1 2 3
38 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 39 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
...@@ -46,32 +47,32 @@ public class LocalTENodeDescriptorsTlv implements PcepValueType { ...@@ -46,32 +47,32 @@ public class LocalTENodeDescriptorsTlv implements PcepValueType {
46 Note: Length is including header here. Refer Routing Universe TLV. 47 Note: Length is including header here. Refer Routing Universe TLV.
47 */ 48 */
48 49
49 - protected static final Logger log = LoggerFactory.getLogger(LocalTENodeDescriptorsTlv.class); 50 + protected static final Logger log = LoggerFactory.getLogger(LocalNodeDescriptorsTlv.class);
50 51
51 - public static final short TYPE = 1637; //TODD:change this TBD8 52 + public static final short TYPE = (short) 65282;
52 public short hLength; 53 public short hLength;
53 54
54 public static final int TLV_HEADER_LENGTH = 4; 55 public static final int TLV_HEADER_LENGTH = 4;
55 // Node Descriptor Sub-TLVs (variable) 56 // Node Descriptor Sub-TLVs (variable)
56 - private LinkedList<PcepValueType> llNodeDescriptorSubTLVs; 57 + private List<PcepValueType> llNodeDescriptorSubTLVs;
57 58
58 /** 59 /**
59 * Constructor to initialize llNodeDescriptorSubTLVs. 60 * Constructor to initialize llNodeDescriptorSubTLVs.
60 * 61 *
61 - * @param llNodeDescriptorSubTLVs LinkedList of PcepValueType 62 + * @param llNodeDescriptorSubTLVs List of PcepValueType
62 */ 63 */
63 - public LocalTENodeDescriptorsTlv(LinkedList<PcepValueType> llNodeDescriptorSubTLVs) { 64 + public LocalNodeDescriptorsTlv(List<PcepValueType> llNodeDescriptorSubTLVs) {
64 this.llNodeDescriptorSubTLVs = llNodeDescriptorSubTLVs; 65 this.llNodeDescriptorSubTLVs = llNodeDescriptorSubTLVs;
65 } 66 }
66 67
67 /** 68 /**
68 - * Returns a new object of LocalTENodeDescriptorsTLV. 69 + * Returns a new object of LocalNodeDescriptorsTLV.
69 * 70 *
70 * @param llNodeDescriptorSubTLVs linked list of Node Descriptor Sub TLVs 71 * @param llNodeDescriptorSubTLVs linked list of Node Descriptor Sub TLVs
71 - * @return object of LocalTENodeDescriptorsTLV 72 + * @return object of LocalNodeDescriptorsTLV
72 */ 73 */
73 - public static LocalTENodeDescriptorsTlv of(final LinkedList<PcepValueType> llNodeDescriptorSubTLVs) { 74 + public static LocalNodeDescriptorsTlv of(final List<PcepValueType> llNodeDescriptorSubTLVs) {
74 - return new LocalTENodeDescriptorsTlv(llNodeDescriptorSubTLVs); 75 + return new LocalNodeDescriptorsTlv(llNodeDescriptorSubTLVs);
75 } 76 }
76 77
77 /** 78 /**
...@@ -79,7 +80,7 @@ public class LocalTENodeDescriptorsTlv implements PcepValueType { ...@@ -79,7 +80,7 @@ public class LocalTENodeDescriptorsTlv implements PcepValueType {
79 * 80 *
80 * @return llNodeDescriptorSubTLVs linked list of Node Descriptor Sub TLV 81 * @return llNodeDescriptorSubTLVs linked list of Node Descriptor Sub TLV
81 */ 82 */
82 - public LinkedList<PcepValueType> getllNodeDescriptorSubTLVs() { 83 + public List<PcepValueType> getllNodeDescriptorSubTLVs() {
83 return llNodeDescriptorSubTLVs; 84 return llNodeDescriptorSubTLVs;
84 } 85 }
85 86
...@@ -117,14 +118,14 @@ public class LocalTENodeDescriptorsTlv implements PcepValueType { ...@@ -117,14 +118,14 @@ public class LocalTENodeDescriptorsTlv implements PcepValueType {
117 * the size, if both are same then we should check for the subtlv objects otherwise 118 * the size, if both are same then we should check for the subtlv objects otherwise
118 * we should return false. 119 * we should return false.
119 */ 120 */
120 - if (obj instanceof LocalTENodeDescriptorsTlv) { 121 + if (obj instanceof LocalNodeDescriptorsTlv) {
121 int countObjSubTlv = 0; 122 int countObjSubTlv = 0;
122 int countOtherSubTlv = 0; 123 int countOtherSubTlv = 0;
123 boolean isCommonSubTlv = true; 124 boolean isCommonSubTlv = true;
124 - LocalTENodeDescriptorsTlv other = (LocalTENodeDescriptorsTlv) obj; 125 + LocalNodeDescriptorsTlv other = (LocalNodeDescriptorsTlv) obj;
125 - Iterator<PcepValueType> objListIterator = ((LocalTENodeDescriptorsTlv) obj).llNodeDescriptorSubTLVs 126 + Iterator<PcepValueType> objListIterator = ((LocalNodeDescriptorsTlv) obj).llNodeDescriptorSubTLVs
126 .iterator(); 127 .iterator();
127 - countObjSubTlv = ((LocalTENodeDescriptorsTlv) obj).llNodeDescriptorSubTLVs.size(); 128 + countObjSubTlv = ((LocalNodeDescriptorsTlv) obj).llNodeDescriptorSubTLVs.size();
128 countOtherSubTlv = other.llNodeDescriptorSubTLVs.size(); 129 countOtherSubTlv = other.llNodeDescriptorSubTLVs.size();
129 if (countObjSubTlv != countOtherSubTlv) { 130 if (countObjSubTlv != countOtherSubTlv) {
130 return false; 131 return false;
...@@ -184,7 +185,7 @@ public class LocalTENodeDescriptorsTlv implements PcepValueType { ...@@ -184,7 +185,7 @@ public class LocalTENodeDescriptorsTlv implements PcepValueType {
184 public static PcepValueType read(ChannelBuffer c, short hLength) throws PcepParseException { 185 public static PcepValueType read(ChannelBuffer c, short hLength) throws PcepParseException {
185 186
186 // Node Descriptor Sub-TLVs (variable) 187 // Node Descriptor Sub-TLVs (variable)
187 - LinkedList<PcepValueType> llNodeDescriptorSubTLVs = new LinkedList<>(); 188 + List<PcepValueType> llNodeDescriptorSubTLVs = new LinkedList<>();
188 189
189 ChannelBuffer tempCb = c.readBytes(hLength); 190 ChannelBuffer tempCb = c.readBytes(hLength);
190 191
...@@ -197,20 +198,20 @@ public class LocalTENodeDescriptorsTlv implements PcepValueType { ...@@ -197,20 +198,20 @@ public class LocalTENodeDescriptorsTlv implements PcepValueType {
197 198
198 switch (hType) { 199 switch (hType) {
199 200
200 - case AutonomousSystemTlv.TYPE: 201 + case AutonomousSystemSubTlv.TYPE:
201 iValue = tempCb.readInt(); 202 iValue = tempCb.readInt();
202 - tlv = new AutonomousSystemTlv(iValue); 203 + tlv = new AutonomousSystemSubTlv(iValue);
203 break; 204 break;
204 - case BgpLsIdentifierTlv.TYPE: 205 + case BgpLsIdentifierSubTlv.TYPE:
205 iValue = tempCb.readInt(); 206 iValue = tempCb.readInt();
206 - tlv = new BgpLsIdentifierTlv(iValue); 207 + tlv = new BgpLsIdentifierSubTlv(iValue);
207 break; 208 break;
208 case OspfAreaIdSubTlv.TYPE: 209 case OspfAreaIdSubTlv.TYPE:
209 iValue = tempCb.readInt(); 210 iValue = tempCb.readInt();
210 tlv = new OspfAreaIdSubTlv(iValue); 211 tlv = new OspfAreaIdSubTlv(iValue);
211 break; 212 break;
212 - case RouterIDSubTlv.TYPE: 213 + case IgpRouterIdSubTlv.TYPE:
213 - tlv = RouterIDSubTlv.read(tempCb, length); 214 + tlv = IgpRouterIdSubTlv.read(tempCb, length);
214 break; 215 break;
215 216
216 default: 217 default:
...@@ -232,7 +233,7 @@ public class LocalTENodeDescriptorsTlv implements PcepValueType { ...@@ -232,7 +233,7 @@ public class LocalTENodeDescriptorsTlv implements PcepValueType {
232 if (0 < tempCb.readableBytes()) { 233 if (0 < tempCb.readableBytes()) {
233 throw new PcepParseException("Sub Tlv parsing error. Extra bytes received."); 234 throw new PcepParseException("Sub Tlv parsing error. Extra bytes received.");
234 } 235 }
235 - return new LocalTENodeDescriptorsTlv(llNodeDescriptorSubTLVs); 236 + return new LocalNodeDescriptorsTlv(llNodeDescriptorSubTLVs);
236 } 237 }
237 238
238 @Override 239 @Override
......
...@@ -27,10 +27,10 @@ import com.google.common.base.MoreObjects; ...@@ -27,10 +27,10 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides TED Capability Tlv. 28 * Provides TED Capability Tlv.
29 */ 29 */
30 -public class TedCapabilityTlv implements PcepValueType { 30 +public class LsCapabilityTlv implements PcepValueType {
31 31
32 /* 32 /*
33 - * Reference :PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02 33 + * Reference :draft-dhodylee-pce-pcep-ls-01, section 9.1.1.
34 * 0 1 2 3 34 * 0 1 2 3
35 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 35 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
36 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 36 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
...@@ -40,14 +40,14 @@ public class TedCapabilityTlv implements PcepValueType { ...@@ -40,14 +40,14 @@ public class TedCapabilityTlv implements PcepValueType {
40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 */ 41 */
42 42
43 - protected static final Logger log = LoggerFactory.getLogger(TedCapabilityTlv.class); 43 + protected static final Logger log = LoggerFactory.getLogger(LsCapabilityTlv.class);
44 44
45 - public static final short TYPE = 132; //TODO: need to change this TBD5 45 + public static final short TYPE = (short) 65280;
46 public static final short LENGTH = 4; 46 public static final short LENGTH = 4;
47 public static final int SET = 1; 47 public static final int SET = 1;
48 public static final byte RFLAG_CHECK = 0x01; 48 public static final byte RFLAG_CHECK = 0x01;
49 49
50 - private final boolean bRFlag; 50 + private final boolean rFlag;
51 private final int rawValue; 51 private final int rawValue;
52 private final boolean isRawValueSet; 52 private final boolean isRawValueSet;
53 53
...@@ -56,26 +56,26 @@ public class TedCapabilityTlv implements PcepValueType { ...@@ -56,26 +56,26 @@ public class TedCapabilityTlv implements PcepValueType {
56 * 56 *
57 * @param rawValue Flags 57 * @param rawValue Flags
58 */ 58 */
59 - public TedCapabilityTlv(final int rawValue) { 59 + public LsCapabilityTlv(final int rawValue) {
60 this.rawValue = rawValue; 60 this.rawValue = rawValue;
61 this.isRawValueSet = true; 61 this.isRawValueSet = true;
62 int temp = rawValue; 62 int temp = rawValue;
63 temp = temp & RFLAG_CHECK; 63 temp = temp & RFLAG_CHECK;
64 if (temp == SET) { 64 if (temp == SET) {
65 - this.bRFlag = true; 65 + this.rFlag = true;
66 } else { 66 } else {
67 - this.bRFlag = false; 67 + this.rFlag = false;
68 } 68 }
69 69
70 } 70 }
71 71
72 /** 72 /**
73 - * Constructor to initialize bRFlag. 73 + * Constructor to initialize rFlag.
74 * 74 *
75 - * @param bRFlag R-flag 75 + * @param rFlag R-flag
76 */ 76 */
77 - public TedCapabilityTlv(boolean bRFlag) { 77 + public LsCapabilityTlv(boolean rFlag) {
78 - this.bRFlag = bRFlag; 78 + this.rFlag = rFlag;
79 this.rawValue = 0; 79 this.rawValue = 0;
80 this.isRawValueSet = false; 80 this.isRawValueSet = false;
81 } 81 }
...@@ -83,20 +83,20 @@ public class TedCapabilityTlv implements PcepValueType { ...@@ -83,20 +83,20 @@ public class TedCapabilityTlv implements PcepValueType {
83 /** 83 /**
84 * Returns R-flag. 84 * Returns R-flag.
85 * 85 *
86 - * @return bRFlag 86 + * @return rFlag
87 */ 87 */
88 - public boolean getbRFlag() { 88 + public boolean getrFlag() {
89 - return bRFlag; 89 + return rFlag;
90 } 90 }
91 91
92 /** 92 /**
93 - * Returns an object of TedCapabilityTlv. 93 + * Returns an object of LsCapabilityTlv.
94 * 94 *
95 * @param raw value Flags 95 * @param raw value Flags
96 - * @return object of TedCapabilityTlv 96 + * @return object of LsCapabilityTlv
97 */ 97 */
98 - public static TedCapabilityTlv of(final int raw) { 98 + public static LsCapabilityTlv of(final int raw) {
99 - return new TedCapabilityTlv(raw); 99 + return new LsCapabilityTlv(raw);
100 } 100 }
101 101
102 @Override 102 @Override
...@@ -123,7 +123,7 @@ public class TedCapabilityTlv implements PcepValueType { ...@@ -123,7 +123,7 @@ public class TedCapabilityTlv implements PcepValueType {
123 if (isRawValueSet) { 123 if (isRawValueSet) {
124 return Objects.hash(rawValue); 124 return Objects.hash(rawValue);
125 } else { 125 } else {
126 - return Objects.hash(bRFlag); 126 + return Objects.hash(rFlag);
127 } 127 }
128 } 128 }
129 129
...@@ -132,12 +132,12 @@ public class TedCapabilityTlv implements PcepValueType { ...@@ -132,12 +132,12 @@ public class TedCapabilityTlv implements PcepValueType {
132 if (this == obj) { 132 if (this == obj) {
133 return true; 133 return true;
134 } 134 }
135 - if (obj instanceof TedCapabilityTlv) { 135 + if (obj instanceof LsCapabilityTlv) {
136 - TedCapabilityTlv other = (TedCapabilityTlv) obj; 136 + LsCapabilityTlv other = (LsCapabilityTlv) obj;
137 if (isRawValueSet) { 137 if (isRawValueSet) {
138 return Objects.equals(this.rawValue, other.rawValue); 138 return Objects.equals(this.rawValue, other.rawValue);
139 } else { 139 } else {
140 - return Objects.equals(this.bRFlag, other.bRFlag); 140 + return Objects.equals(this.rFlag, other.rFlag);
141 } 141 }
142 } 142 }
143 return false; 143 return false;
...@@ -152,7 +152,7 @@ public class TedCapabilityTlv implements PcepValueType { ...@@ -152,7 +152,7 @@ public class TedCapabilityTlv implements PcepValueType {
152 if (isRawValueSet) { 152 if (isRawValueSet) {
153 c.writeInt(rawValue); 153 c.writeInt(rawValue);
154 } else { 154 } else {
155 - if (bRFlag) { 155 + if (rFlag) {
156 temp = temp | RFLAG_CHECK; 156 temp = temp | RFLAG_CHECK;
157 } 157 }
158 c.writeInt(temp); 158 c.writeInt(temp);
...@@ -161,13 +161,13 @@ public class TedCapabilityTlv implements PcepValueType { ...@@ -161,13 +161,13 @@ public class TedCapabilityTlv implements PcepValueType {
161 } 161 }
162 162
163 /** 163 /**
164 - * Reads channel buffer and returns object of TedCapabilityTlv. 164 + * Reads channel buffer and returns object of LsCapabilityTlv.
165 * 165 *
166 * @param c input channel buffer 166 * @param c input channel buffer
167 - * @return object of TedCapabilityTlv 167 + * @return object of LsCapabilityTlv
168 */ 168 */
169 - public static TedCapabilityTlv read(ChannelBuffer c) { 169 + public static LsCapabilityTlv read(ChannelBuffer c) {
170 - return TedCapabilityTlv.of(c.readInt()); 170 + return LsCapabilityTlv.of(c.readInt());
171 } 171 }
172 172
173 @Override 173 @Override
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provide the Maximum Link Bandwidth. 28 * Provide the Maximum Link Bandwidth.
29 */ 29 */
30 -public class MaximumLinkBandwidthTlv implements PcepValueType { 30 +public class MaximumLinkBandwidthSubTlv implements PcepValueType {
31 31
32 /* Reference :[RFC5305]/3.3. 32 /* Reference :[RFC5305]/3.3.
33 * 0 1 2 3 33 * 0 1 2 3
...@@ -39,9 +39,9 @@ public class MaximumLinkBandwidthTlv implements PcepValueType { ...@@ -39,9 +39,9 @@ public class MaximumLinkBandwidthTlv implements PcepValueType {
39 +-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+- 39 +-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-
40 */ 40 */
41 41
42 - protected static final Logger log = LoggerFactory.getLogger(MaximumLinkBandwidthTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(MaximumLinkBandwidthSubTlv.class);
43 43
44 - public static final short TYPE = 9; //TDB34 44 + public static final short TYPE = 23;
45 public static final short LENGTH = 4; 45 public static final short LENGTH = 4;
46 46
47 private final int rawValue; 47 private final int rawValue;
...@@ -52,7 +52,7 @@ public class MaximumLinkBandwidthTlv implements PcepValueType { ...@@ -52,7 +52,7 @@ public class MaximumLinkBandwidthTlv implements PcepValueType {
52 * @param rawValue Maximum-Link-Bandwidth 52 * @param rawValue Maximum-Link-Bandwidth
53 */ 53 */
54 54
55 - public MaximumLinkBandwidthTlv(int rawValue) { 55 + public MaximumLinkBandwidthSubTlv(int rawValue) {
56 this.rawValue = rawValue; 56 this.rawValue = rawValue;
57 } 57 }
58 58
...@@ -62,8 +62,8 @@ public class MaximumLinkBandwidthTlv implements PcepValueType { ...@@ -62,8 +62,8 @@ public class MaximumLinkBandwidthTlv implements PcepValueType {
62 * @param raw value of Maximum-Link-Bandwidth 62 * @param raw value of Maximum-Link-Bandwidth
63 * @return object of MaximumLinkBandwidthTlv 63 * @return object of MaximumLinkBandwidthTlv
64 */ 64 */
65 - public static MaximumLinkBandwidthTlv of(final int raw) { 65 + public static MaximumLinkBandwidthSubTlv of(final int raw) {
66 - return new MaximumLinkBandwidthTlv(raw); 66 + return new MaximumLinkBandwidthSubTlv(raw);
67 } 67 }
68 68
69 /** 69 /**
...@@ -100,8 +100,8 @@ public class MaximumLinkBandwidthTlv implements PcepValueType { ...@@ -100,8 +100,8 @@ public class MaximumLinkBandwidthTlv implements PcepValueType {
100 if (this == obj) { 100 if (this == obj) {
101 return true; 101 return true;
102 } 102 }
103 - if (obj instanceof MaximumLinkBandwidthTlv) { 103 + if (obj instanceof MaximumLinkBandwidthSubTlv) {
104 - MaximumLinkBandwidthTlv other = (MaximumLinkBandwidthTlv) obj; 104 + MaximumLinkBandwidthSubTlv other = (MaximumLinkBandwidthSubTlv) obj;
105 return Objects.equals(rawValue, other.rawValue); 105 return Objects.equals(rawValue, other.rawValue);
106 } 106 }
107 return false; 107 return false;
...@@ -122,8 +122,8 @@ public class MaximumLinkBandwidthTlv implements PcepValueType { ...@@ -122,8 +122,8 @@ public class MaximumLinkBandwidthTlv implements PcepValueType {
122 * @param c input channel buffer 122 * @param c input channel buffer
123 * @return object of MaximumLinkBandwidthTlv 123 * @return object of MaximumLinkBandwidthTlv
124 */ 124 */
125 - public static MaximumLinkBandwidthTlv read(ChannelBuffer c) { 125 + public static MaximumLinkBandwidthSubTlv read(ChannelBuffer c) {
126 - return MaximumLinkBandwidthTlv.of(c.readInt()); 126 + return MaximumLinkBandwidthSubTlv.of(c.readInt());
127 } 127 }
128 128
129 @Override 129 @Override
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provide the Maximum Reservable Link Bandwidth. 28 * Provide the Maximum Reservable Link Bandwidth.
29 */ 29 */
30 -public class MaximumReservableLinkBandwidthTlv implements PcepValueType { 30 +public class MaximumReservableLinkBandwidthSubTlv implements PcepValueType {
31 31
32 /* Reference :[RFC5305]/3.5. 32 /* Reference :[RFC5305]/3.5.
33 * 0 1 2 3 33 * 0 1 2 3
...@@ -39,9 +39,9 @@ public class MaximumReservableLinkBandwidthTlv implements PcepValueType { ...@@ -39,9 +39,9 @@ public class MaximumReservableLinkBandwidthTlv implements PcepValueType {
39 +-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+- 39 +-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-++-+-+-+-
40 */ 40 */
41 41
42 - protected static final Logger log = LoggerFactory.getLogger(MaximumReservableLinkBandwidthTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(MaximumReservableLinkBandwidthSubTlv.class);
43 43
44 - public static final short TYPE = 10; // TDB35 44 + public static final short TYPE = 24;
45 public static final short LENGTH = 4; 45 public static final short LENGTH = 4;
46 46
47 private final int rawValue; 47 private final int rawValue;
...@@ -51,7 +51,7 @@ public class MaximumReservableLinkBandwidthTlv implements PcepValueType { ...@@ -51,7 +51,7 @@ public class MaximumReservableLinkBandwidthTlv implements PcepValueType {
51 * 51 *
52 * @param rawValue MaximumReservableLinkBandwidth 52 * @param rawValue MaximumReservableLinkBandwidth
53 */ 53 */
54 - public MaximumReservableLinkBandwidthTlv(int rawValue) { 54 + public MaximumReservableLinkBandwidthSubTlv(int rawValue) {
55 log.debug("MaximumReservableLinkBandwidthTlv"); 55 log.debug("MaximumReservableLinkBandwidthTlv");
56 this.rawValue = rawValue; 56 this.rawValue = rawValue;
57 } 57 }
...@@ -62,8 +62,8 @@ public class MaximumReservableLinkBandwidthTlv implements PcepValueType { ...@@ -62,8 +62,8 @@ public class MaximumReservableLinkBandwidthTlv implements PcepValueType {
62 * @param raw MaximumReservableLinkBandwidth 62 * @param raw MaximumReservableLinkBandwidth
63 * @return object of MaximumReservableLinkBandwidthTlv 63 * @return object of MaximumReservableLinkBandwidthTlv
64 */ 64 */
65 - public static MaximumReservableLinkBandwidthTlv of(final int raw) { 65 + public static MaximumReservableLinkBandwidthSubTlv of(final int raw) {
66 - return new MaximumReservableLinkBandwidthTlv(raw); 66 + return new MaximumReservableLinkBandwidthSubTlv(raw);
67 } 67 }
68 68
69 /** 69 /**
...@@ -99,8 +99,8 @@ public class MaximumReservableLinkBandwidthTlv implements PcepValueType { ...@@ -99,8 +99,8 @@ public class MaximumReservableLinkBandwidthTlv implements PcepValueType {
99 if (this == obj) { 99 if (this == obj) {
100 return true; 100 return true;
101 } 101 }
102 - if (obj instanceof MaximumReservableLinkBandwidthTlv) { 102 + if (obj instanceof MaximumReservableLinkBandwidthSubTlv) {
103 - MaximumReservableLinkBandwidthTlv other = (MaximumReservableLinkBandwidthTlv) obj; 103 + MaximumReservableLinkBandwidthSubTlv other = (MaximumReservableLinkBandwidthSubTlv) obj;
104 return Objects.equals(this.rawValue, other.rawValue); 104 return Objects.equals(this.rawValue, other.rawValue);
105 } 105 }
106 return false; 106 return false;
...@@ -121,8 +121,8 @@ public class MaximumReservableLinkBandwidthTlv implements PcepValueType { ...@@ -121,8 +121,8 @@ public class MaximumReservableLinkBandwidthTlv implements PcepValueType {
121 * @param c input channel buffer 121 * @param c input channel buffer
122 * @return object of MaximumReservableLinkBandwidthTlv 122 * @return object of MaximumReservableLinkBandwidthTlv
123 */ 123 */
124 - public static MaximumReservableLinkBandwidthTlv read(ChannelBuffer c) { 124 + public static MaximumReservableLinkBandwidthSubTlv read(ChannelBuffer c) {
125 - return MaximumReservableLinkBandwidthTlv.of(c.readInt()); 125 + return MaximumReservableLinkBandwidthSubTlv.of(c.readInt());
126 } 126 }
127 127
128 @Override 128 @Override
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides MPLS Protocol Mask. 28 * Provides MPLS Protocol Mask.
29 */ 29 */
30 -public class MplsProtocolMaskTlv implements PcepValueType { 30 +public class MplsProtocolMaskSubTlv implements PcepValueType {
31 31
32 /* Reference :[I-D.ietf-idr-ls-distribution]/3.3.2.2 32 /* Reference :[I-D.ietf-idr-ls-distribution]/3.3.2.2
33 * 0 1 2 3 33 * 0 1 2 3
...@@ -38,9 +38,9 @@ public class MplsProtocolMaskTlv implements PcepValueType { ...@@ -38,9 +38,9 @@ public class MplsProtocolMaskTlv implements PcepValueType {
38 |L|R| Reserved | 38 |L|R| Reserved |
39 +-+-+-+-+-+-+-+-+ 39 +-+-+-+-+-+-+-+-+
40 */ 40 */
41 - protected static final Logger log = LoggerFactory.getLogger(MplsProtocolMaskTlv.class); 41 + protected static final Logger log = LoggerFactory.getLogger(MplsProtocolMaskSubTlv.class);
42 42
43 - public static final short TYPE = 1094; //TDB39 43 + public static final short TYPE = 28;
44 public static final short LENGTH = 1; 44 public static final short LENGTH = 1;
45 public static final byte LFLAG_SET = (byte) 0x80; 45 public static final byte LFLAG_SET = (byte) 0x80;
46 public static final byte RFLAG_SET = 0x40; 46 public static final byte RFLAG_SET = 0x40;
...@@ -55,7 +55,7 @@ public class MplsProtocolMaskTlv implements PcepValueType { ...@@ -55,7 +55,7 @@ public class MplsProtocolMaskTlv implements PcepValueType {
55 * 55 *
56 * @param rawValue MPLS Protocol Mask Flag Bits 56 * @param rawValue MPLS Protocol Mask Flag Bits
57 */ 57 */
58 - public MplsProtocolMaskTlv(byte rawValue) { 58 + public MplsProtocolMaskSubTlv(byte rawValue) {
59 this.rawValue = rawValue; 59 this.rawValue = rawValue;
60 this.isRawValueSet = true; 60 this.isRawValueSet = true;
61 this.bLFlag = (rawValue & LFLAG_SET) == LFLAG_SET; 61 this.bLFlag = (rawValue & LFLAG_SET) == LFLAG_SET;
...@@ -68,7 +68,7 @@ public class MplsProtocolMaskTlv implements PcepValueType { ...@@ -68,7 +68,7 @@ public class MplsProtocolMaskTlv implements PcepValueType {
68 * @param bLFlag L-flag 68 * @param bLFlag L-flag
69 * @param bRFlag R-flag 69 * @param bRFlag R-flag
70 */ 70 */
71 - public MplsProtocolMaskTlv(boolean bLFlag, boolean bRFlag) { 71 + public MplsProtocolMaskSubTlv(boolean bLFlag, boolean bRFlag) {
72 this.bLFlag = bLFlag; 72 this.bLFlag = bLFlag;
73 this.bRFlag = bRFlag; 73 this.bRFlag = bRFlag;
74 this.rawValue = 0; 74 this.rawValue = 0;
...@@ -81,8 +81,8 @@ public class MplsProtocolMaskTlv implements PcepValueType { ...@@ -81,8 +81,8 @@ public class MplsProtocolMaskTlv implements PcepValueType {
81 * @param raw MPLS Protocol Mask Tlv 81 * @param raw MPLS Protocol Mask Tlv
82 * @return new object of MPLS Protocol Mask Tlv 82 * @return new object of MPLS Protocol Mask Tlv
83 */ 83 */
84 - public static MplsProtocolMaskTlv of(final byte raw) { 84 + public static MplsProtocolMaskSubTlv of(final byte raw) {
85 - return new MplsProtocolMaskTlv(raw); 85 + return new MplsProtocolMaskSubTlv(raw);
86 } 86 }
87 87
88 /** 88 /**
...@@ -141,8 +141,8 @@ public class MplsProtocolMaskTlv implements PcepValueType { ...@@ -141,8 +141,8 @@ public class MplsProtocolMaskTlv implements PcepValueType {
141 if (this == obj) { 141 if (this == obj) {
142 return true; 142 return true;
143 } 143 }
144 - if (obj instanceof MplsProtocolMaskTlv) { 144 + if (obj instanceof MplsProtocolMaskSubTlv) {
145 - MplsProtocolMaskTlv other = (MplsProtocolMaskTlv) obj; 145 + MplsProtocolMaskSubTlv other = (MplsProtocolMaskSubTlv) obj;
146 if (isRawValueSet) { 146 if (isRawValueSet) {
147 return Objects.equals(this.rawValue, other.rawValue); 147 return Objects.equals(this.rawValue, other.rawValue);
148 } else { 148 } else {
...@@ -186,7 +186,7 @@ public class MplsProtocolMaskTlv implements PcepValueType { ...@@ -186,7 +186,7 @@ public class MplsProtocolMaskTlv implements PcepValueType {
186 bLFlag = (temp & LFLAG_SET) == LFLAG_SET; 186 bLFlag = (temp & LFLAG_SET) == LFLAG_SET;
187 bRFlag = (temp & RFLAG_SET) == RFLAG_SET; 187 bRFlag = (temp & RFLAG_SET) == RFLAG_SET;
188 188
189 - return new MplsProtocolMaskTlv(bLFlag, bRFlag); 189 + return new MplsProtocolMaskSubTlv(bLFlag, bRFlag);
190 } 190 }
191 191
192 @Override 192 @Override
......
...@@ -17,6 +17,7 @@ package org.onosproject.pcepio.types; ...@@ -17,6 +17,7 @@ package org.onosproject.pcepio.types;
17 17
18 import java.util.Iterator; 18 import java.util.Iterator;
19 import java.util.LinkedList; 19 import java.util.LinkedList;
20 +import java.util.List;
20 import java.util.ListIterator; 21 import java.util.ListIterator;
21 import java.util.Objects; 22 import java.util.Objects;
22 23
...@@ -31,7 +32,7 @@ import com.google.common.base.MoreObjects; ...@@ -31,7 +32,7 @@ import com.google.common.base.MoreObjects;
31 /** 32 /**
32 * Provides TE Node Attributes Tlv. 33 * Provides TE Node Attributes Tlv.
33 */ 34 */
34 -public class TENodeAttributesTlv implements PcepValueType { 35 +public class NodeAttributesTlv implements PcepValueType {
35 /* 36 /*
36 * Reference :PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02 37 * Reference :PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02
37 * 38 *
...@@ -48,32 +49,32 @@ public class TENodeAttributesTlv implements PcepValueType { ...@@ -48,32 +49,32 @@ public class TENodeAttributesTlv implements PcepValueType {
48 49
49 */ 50 */
50 51
51 - protected static final Logger log = LoggerFactory.getLogger(TENodeAttributesTlv.class); 52 + protected static final Logger log = LoggerFactory.getLogger(NodeAttributesTlv.class);
52 53
53 - public static final short TYPE = 1267; //TODD:change this TBD20 54 + public static final short TYPE = (short) 65285;
54 public short hLength; 55 public short hLength;
55 56
56 public static final int TLV_HEADER_LENGTH = 4; 57 public static final int TLV_HEADER_LENGTH = 4;
57 // LinkDescriptors Sub-TLVs (variable) 58 // LinkDescriptors Sub-TLVs (variable)
58 - private LinkedList<PcepValueType> llNodeAttributesSubTLVs; 59 + private List<PcepValueType> llNodeAttributesSubTLVs;
59 60
60 /** 61 /**
61 * Constructor to initialize llNodeAttributesSubTLVs. 62 * Constructor to initialize llNodeAttributesSubTLVs.
62 * 63 *
63 * @param llNodeAttributesSubTLVs linked list of Node Attributes Sub-TLVs 64 * @param llNodeAttributesSubTLVs linked list of Node Attributes Sub-TLVs
64 */ 65 */
65 - public TENodeAttributesTlv(LinkedList<PcepValueType> llNodeAttributesSubTLVs) { 66 + public NodeAttributesTlv(List<PcepValueType> llNodeAttributesSubTLVs) {
66 this.llNodeAttributesSubTLVs = llNodeAttributesSubTLVs; 67 this.llNodeAttributesSubTLVs = llNodeAttributesSubTLVs;
67 } 68 }
68 69
69 /** 70 /**
70 - * Returns object of TENodeAttributesTlv. 71 + * Returns object of NodeAttributesTlv.
71 * 72 *
72 - * @param llNodeAttributesSubTLVs LinkedList of PcepValueType 73 + * @param llNodeAttributesSubTLVs List of PcepValueType
73 - * @return object of TENodeAttributesTlv 74 + * @return object of NodeAttributesTlv
74 */ 75 */
75 - public static TENodeAttributesTlv of(LinkedList<PcepValueType> llNodeAttributesSubTLVs) { 76 + public static NodeAttributesTlv of(List<PcepValueType> llNodeAttributesSubTLVs) {
76 - return new TENodeAttributesTlv(llNodeAttributesSubTLVs); 77 + return new NodeAttributesTlv(llNodeAttributesSubTLVs);
77 } 78 }
78 79
79 /** 80 /**
...@@ -81,7 +82,7 @@ public class TENodeAttributesTlv implements PcepValueType { ...@@ -81,7 +82,7 @@ public class TENodeAttributesTlv implements PcepValueType {
81 * 82 *
82 * @return llNodeAttributesSubTLVs linked list of Node Attributes Sub-TLVs 83 * @return llNodeAttributesSubTLVs linked list of Node Attributes Sub-TLVs
83 */ 84 */
84 - public LinkedList<PcepValueType> getllNodeAttributesSubTLVs() { 85 + public List<PcepValueType> getllNodeAttributesSubTLVs() {
85 return llNodeAttributesSubTLVs; 86 return llNodeAttributesSubTLVs;
86 } 87 }
87 88
...@@ -118,13 +119,13 @@ public class TENodeAttributesTlv implements PcepValueType { ...@@ -118,13 +119,13 @@ public class TENodeAttributesTlv implements PcepValueType {
118 * the size, if both are same then we should check for the subtlv objects otherwise 119 * the size, if both are same then we should check for the subtlv objects otherwise
119 * we should return false. 120 * we should return false.
120 */ 121 */
121 - if (obj instanceof TENodeAttributesTlv) { 122 + if (obj instanceof NodeAttributesTlv) {
122 int countObjSubTlv = 0; 123 int countObjSubTlv = 0;
123 int countOtherSubTlv = 0; 124 int countOtherSubTlv = 0;
124 boolean isCommonSubTlv = true; 125 boolean isCommonSubTlv = true;
125 - TENodeAttributesTlv other = (TENodeAttributesTlv) obj; 126 + NodeAttributesTlv other = (NodeAttributesTlv) obj;
126 - Iterator<PcepValueType> objListIterator = ((TENodeAttributesTlv) obj).llNodeAttributesSubTLVs.iterator(); 127 + Iterator<PcepValueType> objListIterator = ((NodeAttributesTlv) obj).llNodeAttributesSubTLVs.iterator();
127 - countObjSubTlv = ((TENodeAttributesTlv) obj).llNodeAttributesSubTLVs.size(); 128 + countObjSubTlv = ((NodeAttributesTlv) obj).llNodeAttributesSubTLVs.size();
128 countOtherSubTlv = other.llNodeAttributesSubTLVs.size(); 129 countOtherSubTlv = other.llNodeAttributesSubTLVs.size();
129 if (countObjSubTlv != countOtherSubTlv) { 130 if (countObjSubTlv != countOtherSubTlv) {
130 return false; 131 return false;
...@@ -173,17 +174,17 @@ public class TENodeAttributesTlv implements PcepValueType { ...@@ -173,17 +174,17 @@ public class TENodeAttributesTlv implements PcepValueType {
173 } 174 }
174 175
175 /** 176 /**
176 - * Reads the channel buffer and returns object of TENodeAttributesTlv. 177 + * Reads the channel buffer and returns object of NodeAttributesTlv.
177 * 178 *
178 * @param c input channel buffer 179 * @param c input channel buffer
179 * @param hLength length 180 * @param hLength length
180 - * @return object of TENodeAttributesTlv 181 + * @return object of NodeAttributesTlv
181 * @throws PcepParseException if mandatory fields are missing 182 * @throws PcepParseException if mandatory fields are missing
182 */ 183 */
183 public static PcepValueType read(ChannelBuffer c, short hLength) throws PcepParseException { 184 public static PcepValueType read(ChannelBuffer c, short hLength) throws PcepParseException {
184 185
185 // Node Descriptor Sub-TLVs (variable) 186 // Node Descriptor Sub-TLVs (variable)
186 - LinkedList<PcepValueType> llNodeAttributesSubTLVs = new LinkedList<>(); 187 + List<PcepValueType> llNodeAttributesSubTLVs = new LinkedList<>();
187 188
188 ChannelBuffer tempCb = c.readBytes(hLength); 189 ChannelBuffer tempCb = c.readBytes(hLength);
189 190
...@@ -194,27 +195,27 @@ public class TENodeAttributesTlv implements PcepValueType { ...@@ -194,27 +195,27 @@ public class TENodeAttributesTlv implements PcepValueType {
194 short length = tempCb.readShort(); 195 short length = tempCb.readShort();
195 switch (hType) { 196 switch (hType) {
196 197
197 - case NodeFlagBitsTlv.TYPE: 198 + case NodeFlagBitsSubTlv.TYPE:
198 byte cValue = tempCb.readByte(); 199 byte cValue = tempCb.readByte();
199 - tlv = new NodeFlagBitsTlv(cValue); 200 + tlv = new NodeFlagBitsSubTlv(cValue);
200 break; 201 break;
201 - case OpaqueNodeAttributeTlv.TYPE: 202 + case OpaqueNodePropertiesSubTlv.TYPE:
202 - tlv = OpaqueNodeAttributeTlv.read(tempCb, length); 203 + tlv = OpaqueNodePropertiesSubTlv.read(tempCb, length);
203 break; 204 break;
204 - case NodeNameTlv.TYPE: 205 + case NodeNameSubTlv.TYPE:
205 - tlv = NodeNameTlv.read(tempCb, length); 206 + tlv = NodeNameSubTlv.read(tempCb, length);
206 break; 207 break;
207 - case IsisAreaIdentifierTlv.TYPE: 208 + case IsisAreaIdentifierSubTlv.TYPE:
208 - tlv = IsisAreaIdentifierTlv.read(tempCb, length); 209 + tlv = IsisAreaIdentifierSubTlv.read(tempCb, length);
209 break; 210 break;
210 - case IPv4TERouterIdOfLocalNodeTlv.TYPE: 211 + case IPv4RouterIdOfLocalNodeSubTlv.TYPE:
211 iValue = tempCb.readInt(); 212 iValue = tempCb.readInt();
212 - tlv = new IPv4TERouterIdOfLocalNodeTlv(iValue); 213 + tlv = new IPv4RouterIdOfLocalNodeSubTlv(iValue);
213 break; 214 break;
214 - case IPv6TERouterIdofLocalNodeTlv.TYPE: 215 + case IPv6RouterIdofLocalNodeSubTlv.TYPE:
215 - byte[] ipv6Value = new byte[IPv6TERouterIdofLocalNodeTlv.VALUE_LENGTH]; 216 + byte[] ipv6Value = new byte[IPv6RouterIdofLocalNodeSubTlv.VALUE_LENGTH];
216 - tempCb.readBytes(ipv6Value, 0, IPv6TERouterIdofLocalNodeTlv.VALUE_LENGTH); 217 + tempCb.readBytes(ipv6Value, 0, IPv6RouterIdofLocalNodeSubTlv.VALUE_LENGTH);
217 - tlv = new IPv6TERouterIdofLocalNodeTlv(ipv6Value); 218 + tlv = new IPv6RouterIdofLocalNodeSubTlv(ipv6Value);
218 break; 219 break;
219 default: 220 default:
220 throw new PcepParseException("Unsupported Sub TLV type :" + hType); 221 throw new PcepParseException("Unsupported Sub TLV type :" + hType);
...@@ -236,7 +237,7 @@ public class TENodeAttributesTlv implements PcepValueType { ...@@ -236,7 +237,7 @@ public class TENodeAttributesTlv implements PcepValueType {
236 237
237 throw new PcepParseException("Sub Tlv parsing error. Extra bytes received."); 238 throw new PcepParseException("Sub Tlv parsing error. Extra bytes received.");
238 } 239 }
239 - return new TENodeAttributesTlv(llNodeAttributesSubTLVs); 240 + return new NodeAttributesTlv(llNodeAttributesSubTLVs);
240 } 241 }
241 242
242 @Override 243 @Override
......
...@@ -26,7 +26,7 @@ import com.google.common.base.MoreObjects; ...@@ -26,7 +26,7 @@ import com.google.common.base.MoreObjects;
26 /** 26 /**
27 * Provide node Flags bits. 27 * Provide node Flags bits.
28 */ 28 */
29 -public class NodeFlagBitsTlv implements PcepValueType { 29 +public class NodeFlagBitsSubTlv implements PcepValueType {
30 30
31 /* Reference :[I-D.ietf-idr- ls-distribution] /3.3.1.1 31 /* Reference :[I-D.ietf-idr- ls-distribution] /3.3.1.1
32 * 0 1 2 3 32 * 0 1 2 3
...@@ -38,9 +38,9 @@ public class NodeFlagBitsTlv implements PcepValueType { ...@@ -38,9 +38,9 @@ public class NodeFlagBitsTlv implements PcepValueType {
38 +-+-+-+-+-+-+-+-+-+ 38 +-+-+-+-+-+-+-+-+-+
39 */ 39 */
40 40
41 - protected static final Logger log = LoggerFactory.getLogger(NodeFlagBitsTlv.class); 41 + protected static final Logger log = LoggerFactory.getLogger(NodeFlagBitsSubTlv.class);
42 42
43 - public static final short TYPE = 14; 43 + public static final short TYPE = 13;
44 public static final short LENGTH = 1; 44 public static final short LENGTH = 1;
45 public static final int SET = 1; 45 public static final int SET = 1;
46 public static final byte OFLAG_SET = (byte) 0x80; 46 public static final byte OFLAG_SET = (byte) 0x80;
...@@ -60,7 +60,7 @@ public class NodeFlagBitsTlv implements PcepValueType { ...@@ -60,7 +60,7 @@ public class NodeFlagBitsTlv implements PcepValueType {
60 * 60 *
61 * @param rawValue of Node Flag Bits TLV 61 * @param rawValue of Node Flag Bits TLV
62 */ 62 */
63 - public NodeFlagBitsTlv(byte rawValue) { 63 + public NodeFlagBitsSubTlv(byte rawValue) {
64 this.rawValue = rawValue; 64 this.rawValue = rawValue;
65 isRawValueSet = true; 65 isRawValueSet = true;
66 this.bOFlag = (rawValue & OFLAG_SET) == OFLAG_SET; 66 this.bOFlag = (rawValue & OFLAG_SET) == OFLAG_SET;
...@@ -77,7 +77,7 @@ public class NodeFlagBitsTlv implements PcepValueType { ...@@ -77,7 +77,7 @@ public class NodeFlagBitsTlv implements PcepValueType {
77 * @param bEFlag E-flag 77 * @param bEFlag E-flag
78 * @param bBFlag B-flag 78 * @param bBFlag B-flag
79 */ 79 */
80 - public NodeFlagBitsTlv(boolean bOFlag, boolean bTFlag, boolean bEFlag, boolean bBFlag) { 80 + public NodeFlagBitsSubTlv(boolean bOFlag, boolean bTFlag, boolean bEFlag, boolean bBFlag) {
81 this.bOFlag = bOFlag; 81 this.bOFlag = bOFlag;
82 this.bTFlag = bTFlag; 82 this.bTFlag = bTFlag;
83 this.bEFlag = bEFlag; 83 this.bEFlag = bEFlag;
...@@ -92,8 +92,8 @@ public class NodeFlagBitsTlv implements PcepValueType { ...@@ -92,8 +92,8 @@ public class NodeFlagBitsTlv implements PcepValueType {
92 * @param raw of Node Flag Bits TLV 92 * @param raw of Node Flag Bits TLV
93 * @return new object of NodeFlagBitsTlv 93 * @return new object of NodeFlagBitsTlv
94 */ 94 */
95 - public static NodeFlagBitsTlv of(final byte raw) { 95 + public static NodeFlagBitsSubTlv of(final byte raw) {
96 - return new NodeFlagBitsTlv(raw); 96 + return new NodeFlagBitsSubTlv(raw);
97 } 97 }
98 98
99 /** 99 /**
...@@ -170,8 +170,8 @@ public class NodeFlagBitsTlv implements PcepValueType { ...@@ -170,8 +170,8 @@ public class NodeFlagBitsTlv implements PcepValueType {
170 if (this == obj) { 170 if (this == obj) {
171 return true; 171 return true;
172 } 172 }
173 - if (obj instanceof NodeFlagBitsTlv) { 173 + if (obj instanceof NodeFlagBitsSubTlv) {
174 - NodeFlagBitsTlv other = (NodeFlagBitsTlv) obj; 174 + NodeFlagBitsSubTlv other = (NodeFlagBitsSubTlv) obj;
175 if (isRawValueSet) { 175 if (isRawValueSet) {
176 return Objects.equals(this.rawValue, other.rawValue); 176 return Objects.equals(this.rawValue, other.rawValue);
177 } else { 177 } else {
...@@ -216,7 +216,7 @@ public class NodeFlagBitsTlv implements PcepValueType { ...@@ -216,7 +216,7 @@ public class NodeFlagBitsTlv implements PcepValueType {
216 */ 216 */
217 public static PcepValueType read(ChannelBuffer c) { 217 public static PcepValueType read(ChannelBuffer c) {
218 218
219 - return NodeFlagBitsTlv.of(c.readByte()); 219 + return NodeFlagBitsSubTlv.of(c.readByte());
220 } 220 }
221 221
222 @Override 222 @Override
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects.ToStringHelper; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects.ToStringHelper;
27 /** 27 /**
28 * Provide the name for the node. 28 * Provide the name for the node.
29 */ 29 */
30 -public class NodeNameTlv implements PcepValueType { 30 +public class NodeNameSubTlv implements PcepValueType {
31 31
32 /* reference :[I-D.ietf-idr-ls-distribution]/3.3.1.3 32 /* reference :[I-D.ietf-idr-ls-distribution]/3.3.1.3
33 * 0 1 2 3 33 * 0 1 2 3
...@@ -39,9 +39,9 @@ public class NodeNameTlv implements PcepValueType { ...@@ -39,9 +39,9 @@ public class NodeNameTlv implements PcepValueType {
39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 */ 40 */
41 41
42 - protected static final Logger log = LoggerFactory.getLogger(NodeNameTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(NodeNameSubTlv.class);
43 43
44 - public static final short TYPE = 1007; //TODO:check and change TBD23 44 + public static final short TYPE = 15;
45 public final short hLength; 45 public final short hLength;
46 46
47 private final byte[] rawValue; 47 private final byte[] rawValue;
...@@ -52,7 +52,7 @@ public class NodeNameTlv implements PcepValueType { ...@@ -52,7 +52,7 @@ public class NodeNameTlv implements PcepValueType {
52 * @param rawValue of Node Name 52 * @param rawValue of Node Name
53 * @param hLength length 53 * @param hLength length
54 */ 54 */
55 - public NodeNameTlv(byte[] rawValue, short hLength) { 55 + public NodeNameSubTlv(byte[] rawValue, short hLength) {
56 log.debug("NodeNameTlv"); 56 log.debug("NodeNameTlv");
57 this.rawValue = rawValue; 57 this.rawValue = rawValue;
58 if (0 == hLength) { 58 if (0 == hLength) {
...@@ -69,8 +69,8 @@ public class NodeNameTlv implements PcepValueType { ...@@ -69,8 +69,8 @@ public class NodeNameTlv implements PcepValueType {
69 * @param hLength length 69 * @param hLength length
70 * @return new object of Node Name Tlv 70 * @return new object of Node Name Tlv
71 */ 71 */
72 - public static NodeNameTlv of(final byte[] raw, short hLength) { 72 + public static NodeNameSubTlv of(final byte[] raw, short hLength) {
73 - return new NodeNameTlv(raw, hLength); 73 + return new NodeNameSubTlv(raw, hLength);
74 } 74 }
75 75
76 /** 76 /**
...@@ -107,8 +107,8 @@ public class NodeNameTlv implements PcepValueType { ...@@ -107,8 +107,8 @@ public class NodeNameTlv implements PcepValueType {
107 if (this == obj) { 107 if (this == obj) {
108 return true; 108 return true;
109 } 109 }
110 - if (obj instanceof NodeNameTlv) { 110 + if (obj instanceof NodeNameSubTlv) {
111 - NodeNameTlv other = (NodeNameTlv) obj; 111 + NodeNameSubTlv other = (NodeNameSubTlv) obj;
112 return Objects.equals(this.rawValue, other.rawValue); 112 return Objects.equals(this.rawValue, other.rawValue);
113 } 113 }
114 return false; 114 return false;
...@@ -133,7 +133,7 @@ public class NodeNameTlv implements PcepValueType { ...@@ -133,7 +133,7 @@ public class NodeNameTlv implements PcepValueType {
133 public static PcepValueType read(ChannelBuffer c, short hLength) { 133 public static PcepValueType read(ChannelBuffer c, short hLength) {
134 byte[] iNodeName = new byte[hLength]; 134 byte[] iNodeName = new byte[hLength];
135 c.readBytes(iNodeName, 0, hLength); 135 c.readBytes(iNodeName, 0, hLength);
136 - return new NodeNameTlv(iNodeName, hLength); 136 + return new NodeNameSubTlv(iNodeName, hLength);
137 } 137 }
138 138
139 @Override 139 @Override
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects.ToStringHelper; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects.ToStringHelper;
27 /** 27 /**
28 * Provides Opaque Link Attribute. 28 * Provides Opaque Link Attribute.
29 */ 29 */
30 -public class OpaqueLinkAttributeTlv implements PcepValueType { 30 +public class OpaqueLinkAttributeSubTlv implements PcepValueType {
31 31
32 /* 32 /*
33 * TLV format. 33 * TLV format.
...@@ -41,9 +41,9 @@ public class OpaqueLinkAttributeTlv implements PcepValueType { ...@@ -41,9 +41,9 @@ public class OpaqueLinkAttributeTlv implements PcepValueType {
41 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 41 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
42 */ 42 */
43 43
44 - protected static final Logger log = LoggerFactory.getLogger(OpaqueLinkAttributeTlv.class); 44 + protected static final Logger log = LoggerFactory.getLogger(OpaqueLinkAttributeSubTlv.class);
45 45
46 - public static final short TYPE = 1097; //TODO:NEED TO HANDLE TDB42 46 + public static final short TYPE = 31;
47 private final short hLength; 47 private final short hLength;
48 48
49 private final byte[] rawValue; 49 private final byte[] rawValue;
...@@ -54,7 +54,7 @@ public class OpaqueLinkAttributeTlv implements PcepValueType { ...@@ -54,7 +54,7 @@ public class OpaqueLinkAttributeTlv implements PcepValueType {
54 * @param rawValue of Opaque Link Attribute 54 * @param rawValue of Opaque Link Attribute
55 * @param hLength length 55 * @param hLength length
56 */ 56 */
57 - public OpaqueLinkAttributeTlv(byte[] rawValue, short hLength) { 57 + public OpaqueLinkAttributeSubTlv(byte[] rawValue, short hLength) {
58 log.debug("OpaqueLinkAttributeTlv"); 58 log.debug("OpaqueLinkAttributeTlv");
59 this.rawValue = rawValue; 59 this.rawValue = rawValue;
60 if (0 == hLength) { 60 if (0 == hLength) {
...@@ -71,8 +71,8 @@ public class OpaqueLinkAttributeTlv implements PcepValueType { ...@@ -71,8 +71,8 @@ public class OpaqueLinkAttributeTlv implements PcepValueType {
71 * @param hLength length 71 * @param hLength length
72 * @return new object of OpaqueLinkAttributeTlv 72 * @return new object of OpaqueLinkAttributeTlv
73 */ 73 */
74 - public static OpaqueLinkAttributeTlv of(final byte[] raw, short hLength) { 74 + public static OpaqueLinkAttributeSubTlv of(final byte[] raw, short hLength) {
75 - return new OpaqueLinkAttributeTlv(raw, hLength); 75 + return new OpaqueLinkAttributeSubTlv(raw, hLength);
76 } 76 }
77 77
78 /** 78 /**
...@@ -108,8 +108,8 @@ public class OpaqueLinkAttributeTlv implements PcepValueType { ...@@ -108,8 +108,8 @@ public class OpaqueLinkAttributeTlv implements PcepValueType {
108 if (this == obj) { 108 if (this == obj) {
109 return true; 109 return true;
110 } 110 }
111 - if (obj instanceof OpaqueLinkAttributeTlv) { 111 + if (obj instanceof OpaqueLinkAttributeSubTlv) {
112 - OpaqueLinkAttributeTlv other = (OpaqueLinkAttributeTlv) obj; 112 + OpaqueLinkAttributeSubTlv other = (OpaqueLinkAttributeSubTlv) obj;
113 return Objects.equals(this.rawValue, other.rawValue); 113 return Objects.equals(this.rawValue, other.rawValue);
114 } 114 }
115 return false; 115 return false;
...@@ -134,7 +134,7 @@ public class OpaqueLinkAttributeTlv implements PcepValueType { ...@@ -134,7 +134,7 @@ public class OpaqueLinkAttributeTlv implements PcepValueType {
134 public static PcepValueType read(ChannelBuffer c, short hLength) { 134 public static PcepValueType read(ChannelBuffer c, short hLength) {
135 byte[] iOpaqueValue = new byte[hLength]; 135 byte[] iOpaqueValue = new byte[hLength];
136 c.readBytes(iOpaqueValue, 0, hLength); 136 c.readBytes(iOpaqueValue, 0, hLength);
137 - return new OpaqueLinkAttributeTlv(iOpaqueValue, hLength); 137 + return new OpaqueLinkAttributeSubTlv(iOpaqueValue, hLength);
138 } 138 }
139 139
140 @Override 140 @Override
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects.ToStringHelper; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects.ToStringHelper;
27 /** 27 /**
28 * Provides Opaque node attributes. 28 * Provides Opaque node attributes.
29 */ 29 */
30 -public class OpaqueNodeAttributeTlv implements PcepValueType { 30 +public class OpaqueNodePropertiesSubTlv implements PcepValueType {
31 /* 31 /*
32 * Reference [I-D.ietf-idr-Properties ls-distribution] /3.3.1.5 32 * Reference [I-D.ietf-idr-Properties ls-distribution] /3.3.1.5
33 * 0 1 2 3 33 * 0 1 2 3
...@@ -39,9 +39,9 @@ public class OpaqueNodeAttributeTlv implements PcepValueType { ...@@ -39,9 +39,9 @@ public class OpaqueNodeAttributeTlv implements PcepValueType {
39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 */ 40 */
41 41
42 - protected static final Logger log = LoggerFactory.getLogger(OpaqueNodeAttributeTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(OpaqueNodePropertiesSubTlv.class);
43 43
44 - public static final short TYPE = 1001; 44 + public static final short TYPE = 14;
45 private final short hLength; 45 private final short hLength;
46 46
47 private final byte[] rawValue; 47 private final byte[] rawValue;
...@@ -52,7 +52,7 @@ public class OpaqueNodeAttributeTlv implements PcepValueType { ...@@ -52,7 +52,7 @@ public class OpaqueNodeAttributeTlv implements PcepValueType {
52 * @param rawValue Opaque Node Attribute 52 * @param rawValue Opaque Node Attribute
53 * @param hLength length 53 * @param hLength length
54 */ 54 */
55 - public OpaqueNodeAttributeTlv(byte[] rawValue, short hLength) { 55 + public OpaqueNodePropertiesSubTlv(byte[] rawValue, short hLength) {
56 56
57 this.rawValue = rawValue; 57 this.rawValue = rawValue;
58 if (0 == hLength) { 58 if (0 == hLength) {
...@@ -69,8 +69,8 @@ public class OpaqueNodeAttributeTlv implements PcepValueType { ...@@ -69,8 +69,8 @@ public class OpaqueNodeAttributeTlv implements PcepValueType {
69 * @param hLength length 69 * @param hLength length
70 * @return new object of Opaque Node Attribute Tlv 70 * @return new object of Opaque Node Attribute Tlv
71 */ 71 */
72 - public static OpaqueNodeAttributeTlv of(final byte[] raw, short hLength) { 72 + public static OpaqueNodePropertiesSubTlv of(final byte[] raw, short hLength) {
73 - return new OpaqueNodeAttributeTlv(raw, hLength); 73 + return new OpaqueNodePropertiesSubTlv(raw, hLength);
74 } 74 }
75 75
76 /** 76 /**
...@@ -107,8 +107,8 @@ public class OpaqueNodeAttributeTlv implements PcepValueType { ...@@ -107,8 +107,8 @@ public class OpaqueNodeAttributeTlv implements PcepValueType {
107 if (this == obj) { 107 if (this == obj) {
108 return true; 108 return true;
109 } 109 }
110 - if (obj instanceof OpaqueNodeAttributeTlv) { 110 + if (obj instanceof OpaqueNodePropertiesSubTlv) {
111 - OpaqueNodeAttributeTlv other = (OpaqueNodeAttributeTlv) obj; 111 + OpaqueNodePropertiesSubTlv other = (OpaqueNodePropertiesSubTlv) obj;
112 return Objects.equals(this.rawValue, other.rawValue); 112 return Objects.equals(this.rawValue, other.rawValue);
113 } 113 }
114 return false; 114 return false;
...@@ -133,7 +133,7 @@ public class OpaqueNodeAttributeTlv implements PcepValueType { ...@@ -133,7 +133,7 @@ public class OpaqueNodeAttributeTlv implements PcepValueType {
133 public static PcepValueType read(ChannelBuffer c, short hLength) { 133 public static PcepValueType read(ChannelBuffer c, short hLength) {
134 byte[] iOpaqueValue = new byte[hLength]; 134 byte[] iOpaqueValue = new byte[hLength];
135 c.readBytes(iOpaqueValue, 0, hLength); 135 c.readBytes(iOpaqueValue, 0, hLength);
136 - return new OpaqueNodeAttributeTlv(iOpaqueValue, hLength); 136 + return new OpaqueNodePropertiesSubTlv(iOpaqueValue, hLength);
137 } 137 }
138 138
139 @Override 139 @Override
......
...@@ -40,7 +40,7 @@ public class OspfAreaIdSubTlv implements PcepValueType { ...@@ -40,7 +40,7 @@ public class OspfAreaIdSubTlv implements PcepValueType {
40 40
41 protected static final Logger log = LoggerFactory.getLogger(OspfAreaIdSubTlv.class); 41 protected static final Logger log = LoggerFactory.getLogger(OspfAreaIdSubTlv.class);
42 42
43 - public static final short TYPE = 600; //TODD:change this TBD12 43 + public static final short TYPE = 3;
44 public static final short LENGTH = 4; 44 public static final short LENGTH = 4;
45 45
46 private final int rawValue; 46 private final int rawValue;
......
...@@ -169,9 +169,9 @@ public class PcepRsvpUserErrorSpec implements PcepRsvpErrorSpec { ...@@ -169,9 +169,9 @@ public class PcepRsvpUserErrorSpec implements PcepRsvpErrorSpec {
169 int iValue = 0; 169 int iValue = 0;
170 //short hLength = cb.readShort(); 170 //short hLength = cb.readShort();
171 switch (hType) { 171 switch (hType) {
172 - case AutonomousSystemTlv.TYPE: 172 + case AutonomousSystemSubTlv.TYPE:
173 iValue = cb.readInt(); 173 iValue = cb.readInt();
174 - tlv = new AutonomousSystemTlv(iValue); 174 + tlv = new AutonomousSystemSubTlv(iValue);
175 break; 175 break;
176 default: 176 default:
177 throw new PcepParseException("Unsupported Sub TLV type :" + hType); 177 throw new PcepParseException("Unsupported Sub TLV type :" + hType);
......
...@@ -17,6 +17,7 @@ package org.onosproject.pcepio.types; ...@@ -17,6 +17,7 @@ package org.onosproject.pcepio.types;
17 17
18 import java.util.Iterator; 18 import java.util.Iterator;
19 import java.util.LinkedList; 19 import java.util.LinkedList;
20 +import java.util.List;
20 import java.util.ListIterator; 21 import java.util.ListIterator;
21 import java.util.Objects; 22 import java.util.Objects;
22 23
...@@ -31,10 +32,9 @@ import com.google.common.base.MoreObjects; ...@@ -31,10 +32,9 @@ import com.google.common.base.MoreObjects;
31 /** 32 /**
32 * Provides Remote TE Node Descriptors TLV. 33 * Provides Remote TE Node Descriptors TLV.
33 */ 34 */
34 -public class RemoteTENodeDescriptorsTlv implements PcepValueType { 35 +public class RemoteNodeDescriptorsTlv implements PcepValueType {
35 36
36 - /* Reference :PCEP Extension for Transporting TE Data 37 + /* Reference : draft-dhodylee-pce-pcep-ls-01, section 9.2.3.
37 - draft-dhodylee-pce-pcep-te-data-extn-02
38 * 38 *
39 0 1 2 3 39 0 1 2 3
40 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 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 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType { ...@@ -47,32 +47,32 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType {
47 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 47 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
48 */ 48 */
49 49
50 - protected static final Logger log = LoggerFactory.getLogger(RemoteTENodeDescriptorsTlv.class); 50 + protected static final Logger log = LoggerFactory.getLogger(RemoteNodeDescriptorsTlv.class);
51 51
52 - public static final short TYPE = 1003; //TODD:change this TBD9 52 + public static final short TYPE = (short) 65283;
53 public short hLength; 53 public short hLength;
54 54
55 public static final int TLV_HEADER_LENGTH = 4; 55 public static final int TLV_HEADER_LENGTH = 4;
56 // Node Descriptor Sub-TLVs (variable) 56 // Node Descriptor Sub-TLVs (variable)
57 - private LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLVs; 57 + private List<PcepValueType> llRemoteTENodeDescriptorSubTLVs;
58 58
59 /** 59 /**
60 * Constructor to initialize llRemoteTENodeDescriptorSubTLVs. 60 * Constructor to initialize llRemoteTENodeDescriptorSubTLVs.
61 * 61 *
62 - * @param llRemoteTENodeDescriptorSubTLVs LinkedList of PcepValueType 62 + * @param llRemoteTENodeDescriptorSubTLVs List of PcepValueType
63 */ 63 */
64 - public RemoteTENodeDescriptorsTlv(LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLVs) { 64 + public RemoteNodeDescriptorsTlv(List<PcepValueType> llRemoteTENodeDescriptorSubTLVs) {
65 this.llRemoteTENodeDescriptorSubTLVs = llRemoteTENodeDescriptorSubTLVs; 65 this.llRemoteTENodeDescriptorSubTLVs = llRemoteTENodeDescriptorSubTLVs;
66 } 66 }
67 67
68 /** 68 /**
69 * Returns object of Remote TE Node Descriptors TLV. 69 * Returns object of Remote TE Node Descriptors TLV.
70 * 70 *
71 - * @param llRemoteTENodeDescriptorSubTLVs LinkedList of PcepValueType 71 + * @param llRemoteTENodeDescriptorSubTLVs List of PcepValueType
72 - * @return object of RemoteTENodeDescriptorsTLV 72 + * @return object of RemoteNodeDescriptorsTlv
73 */ 73 */
74 - public static RemoteTENodeDescriptorsTlv of(final LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLVs) { 74 + public static RemoteNodeDescriptorsTlv of(final List<PcepValueType> llRemoteTENodeDescriptorSubTLVs) {
75 - return new RemoteTENodeDescriptorsTlv(llRemoteTENodeDescriptorSubTLVs); 75 + return new RemoteNodeDescriptorsTlv(llRemoteTENodeDescriptorSubTLVs);
76 } 76 }
77 77
78 /** 78 /**
...@@ -80,7 +80,7 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType { ...@@ -80,7 +80,7 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType {
80 * 80 *
81 * @return llRemoteTENodeDescriptorSubTLVs 81 * @return llRemoteTENodeDescriptorSubTLVs
82 */ 82 */
83 - public LinkedList<PcepValueType> getllRemoteTENodeDescriptorSubTLVs() { 83 + public List<PcepValueType> getllRemoteTENodeDescriptorSubTLVs() {
84 return llRemoteTENodeDescriptorSubTLVs; 84 return llRemoteTENodeDescriptorSubTLVs;
85 } 85 }
86 86
...@@ -117,14 +117,14 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType { ...@@ -117,14 +117,14 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType {
117 * the size, if both are same then we should check for the subtlv objects otherwise 117 * the size, if both are same then we should check for the subtlv objects otherwise
118 * we should return false. 118 * we should return false.
119 */ 119 */
120 - if (obj instanceof RemoteTENodeDescriptorsTlv) { 120 + if (obj instanceof RemoteNodeDescriptorsTlv) {
121 int countObjSubTlv = 0; 121 int countObjSubTlv = 0;
122 int countOtherSubTlv = 0; 122 int countOtherSubTlv = 0;
123 boolean isCommonSubTlv = true; 123 boolean isCommonSubTlv = true;
124 - RemoteTENodeDescriptorsTlv other = (RemoteTENodeDescriptorsTlv) obj; 124 + RemoteNodeDescriptorsTlv other = (RemoteNodeDescriptorsTlv) obj;
125 - Iterator<PcepValueType> objListIterator = ((RemoteTENodeDescriptorsTlv) obj).llRemoteTENodeDescriptorSubTLVs 125 + Iterator<PcepValueType> objListIterator = ((RemoteNodeDescriptorsTlv) obj).llRemoteTENodeDescriptorSubTLVs
126 .iterator(); 126 .iterator();
127 - countObjSubTlv = ((RemoteTENodeDescriptorsTlv) obj).llRemoteTENodeDescriptorSubTLVs.size(); 127 + countObjSubTlv = ((RemoteNodeDescriptorsTlv) obj).llRemoteTENodeDescriptorSubTLVs.size();
128 countOtherSubTlv = other.llRemoteTENodeDescriptorSubTLVs.size(); 128 countOtherSubTlv = other.llRemoteTENodeDescriptorSubTLVs.size();
129 if (countObjSubTlv != countOtherSubTlv) { 129 if (countObjSubTlv != countOtherSubTlv) {
130 return false; 130 return false;
...@@ -182,13 +182,13 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType { ...@@ -182,13 +182,13 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType {
182 * 182 *
183 * @param c input channel buffer 183 * @param c input channel buffer
184 * @param length length of buffer 184 * @param length length of buffer
185 - * @return object of RemoteTENodeDescriptorsTLV 185 + * @return object of RemoteNodeDescriptorsTlv
186 * @throws PcepParseException if mandatory fields are missing 186 * @throws PcepParseException if mandatory fields are missing
187 */ 187 */
188 public static PcepValueType read(ChannelBuffer c, short length) throws PcepParseException { 188 public static PcepValueType read(ChannelBuffer c, short length) throws PcepParseException {
189 189
190 // Node Descriptor Sub-TLVs (variable) 190 // Node Descriptor Sub-TLVs (variable)
191 - LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLVs = new LinkedList<>(); 191 + List<PcepValueType> llRemoteTENodeDescriptorSubTLVs = new LinkedList<>();
192 192
193 ChannelBuffer tempCb = c.readBytes(length); 193 ChannelBuffer tempCb = c.readBytes(length);
194 194
...@@ -200,20 +200,20 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType { ...@@ -200,20 +200,20 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType {
200 short hLength = tempCb.readShort(); 200 short hLength = tempCb.readShort();
201 switch (hType) { 201 switch (hType) {
202 202
203 - case AutonomousSystemTlv.TYPE: 203 + case AutonomousSystemSubTlv.TYPE:
204 iValue = tempCb.readInt(); 204 iValue = tempCb.readInt();
205 - tlv = new AutonomousSystemTlv(iValue); 205 + tlv = new AutonomousSystemSubTlv(iValue);
206 break; 206 break;
207 - case BgpLsIdentifierTlv.TYPE: 207 + case BgpLsIdentifierSubTlv.TYPE:
208 iValue = tempCb.readInt(); 208 iValue = tempCb.readInt();
209 - tlv = new BgpLsIdentifierTlv(iValue); 209 + tlv = new BgpLsIdentifierSubTlv(iValue);
210 break; 210 break;
211 case OspfAreaIdSubTlv.TYPE: 211 case OspfAreaIdSubTlv.TYPE:
212 iValue = tempCb.readInt(); 212 iValue = tempCb.readInt();
213 tlv = new OspfAreaIdSubTlv(iValue); 213 tlv = new OspfAreaIdSubTlv(iValue);
214 break; 214 break;
215 - case RouterIDSubTlv.TYPE: 215 + case IgpRouterIdSubTlv.TYPE:
216 - tlv = RouterIDSubTlv.read(tempCb, hLength); 216 + tlv = IgpRouterIdSubTlv.read(tempCb, hLength);
217 break; 217 break;
218 218
219 default: 219 default:
...@@ -236,7 +236,7 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType { ...@@ -236,7 +236,7 @@ public class RemoteTENodeDescriptorsTlv implements PcepValueType {
236 236
237 throw new PcepParseException("Sub Tlv parsing error. Extra bytes received."); 237 throw new PcepParseException("Sub Tlv parsing error. Extra bytes received.");
238 } 238 }
239 - return new RemoteTENodeDescriptorsTlv(llRemoteTENodeDescriptorSubTLVs); 239 + return new RemoteNodeDescriptorsTlv(llRemoteTENodeDescriptorSubTLVs);
240 } 240 }
241 241
242 @Override 242 @Override
......
...@@ -52,7 +52,7 @@ public class RoutingUniverseTlv implements PcepValueType { ...@@ -52,7 +52,7 @@ public class RoutingUniverseTlv implements PcepValueType {
52 52
53 protected static final Logger log = LoggerFactory.getLogger(RoutingUniverseTlv.class); 53 protected static final Logger log = LoggerFactory.getLogger(RoutingUniverseTlv.class);
54 54
55 - public static final short TYPE = 14; // TODO:need to change TBD7 55 + public static final short TYPE = (short) 65281;
56 public static final short LENGTH = 8; 56 public static final short LENGTH = 8;
57 57
58 private final long rawValue; 58 private final long rawValue;
......
...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects.ToStringHelper; ...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects.ToStringHelper;
28 /** 28 /**
29 * Provides SharedRiskLinkGroupTlv. 29 * Provides SharedRiskLinkGroupTlv.
30 */ 30 */
31 -public class SharedRiskLinkGroupTlv implements PcepValueType { 31 +public class SharedRiskLinkGroupSubTlv implements PcepValueType {
32 32
33 /* 33 /*
34 * Reference :[I-D.ietf-idr- Group ls-distribution] /3.3.2.5 34 * Reference :[I-D.ietf-idr- Group ls-distribution] /3.3.2.5
...@@ -46,9 +46,9 @@ public class SharedRiskLinkGroupTlv implements PcepValueType { ...@@ -46,9 +46,9 @@ public class SharedRiskLinkGroupTlv implements PcepValueType {
46 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 46 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
47 */ 47 */
48 48
49 - protected static final Logger log = LoggerFactory.getLogger(SharedRiskLinkGroupTlv.class); 49 + protected static final Logger log = LoggerFactory.getLogger(SharedRiskLinkGroupSubTlv.class);
50 50
51 - public static final short TYPE = 1096; //TODO:NEED TO HANDLE TDB41 51 + public static final short TYPE = 30;
52 52
53 private final short hLength; 53 private final short hLength;
54 54
...@@ -60,7 +60,7 @@ public class SharedRiskLinkGroupTlv implements PcepValueType { ...@@ -60,7 +60,7 @@ public class SharedRiskLinkGroupTlv implements PcepValueType {
60 * @param srlgValue Shared Risk Link Group Value 60 * @param srlgValue Shared Risk Link Group Value
61 * @param hLength length 61 * @param hLength length
62 */ 62 */
63 - public SharedRiskLinkGroupTlv(int[] srlgValue, short hLength) { 63 + public SharedRiskLinkGroupSubTlv(int[] srlgValue, short hLength) {
64 this.srlgValue = srlgValue; 64 this.srlgValue = srlgValue;
65 if (0 == hLength) { 65 if (0 == hLength) {
66 this.hLength = (short) ((srlgValue.length) * 4); 66 this.hLength = (short) ((srlgValue.length) * 4);
...@@ -76,8 +76,8 @@ public class SharedRiskLinkGroupTlv implements PcepValueType { ...@@ -76,8 +76,8 @@ public class SharedRiskLinkGroupTlv implements PcepValueType {
76 * @param hLength length 76 * @param hLength length
77 * @return object of SharedRiskLinkGroupTlv 77 * @return object of SharedRiskLinkGroupTlv
78 */ 78 */
79 - public static SharedRiskLinkGroupTlv of(final int[] raw, short hLength) { 79 + public static SharedRiskLinkGroupSubTlv of(final int[] raw, short hLength) {
80 - return new SharedRiskLinkGroupTlv(raw, hLength); 80 + return new SharedRiskLinkGroupSubTlv(raw, hLength);
81 } 81 }
82 82
83 /** 83 /**
...@@ -114,8 +114,8 @@ public class SharedRiskLinkGroupTlv implements PcepValueType { ...@@ -114,8 +114,8 @@ public class SharedRiskLinkGroupTlv implements PcepValueType {
114 if (this == obj) { 114 if (this == obj) {
115 return true; 115 return true;
116 } 116 }
117 - if (obj instanceof SharedRiskLinkGroupTlv) { 117 + if (obj instanceof SharedRiskLinkGroupSubTlv) {
118 - SharedRiskLinkGroupTlv other = (SharedRiskLinkGroupTlv) obj; 118 + SharedRiskLinkGroupSubTlv other = (SharedRiskLinkGroupSubTlv) obj;
119 return Arrays.equals(this.srlgValue, other.srlgValue); 119 return Arrays.equals(this.srlgValue, other.srlgValue);
120 } 120 }
121 return false; 121 return false;
...@@ -145,7 +145,7 @@ public class SharedRiskLinkGroupTlv implements PcepValueType { ...@@ -145,7 +145,7 @@ public class SharedRiskLinkGroupTlv implements PcepValueType {
145 for (int i = 0; i < iLength; i++) { 145 for (int i = 0; i < iLength; i++) {
146 iSharedRiskLinkGroup[i] = c.readInt(); 146 iSharedRiskLinkGroup[i] = c.readInt();
147 } 147 }
148 - return new SharedRiskLinkGroupTlv(iSharedRiskLinkGroup, hLength); 148 + return new SharedRiskLinkGroupSubTlv(iSharedRiskLinkGroup, hLength);
149 } 149 }
150 150
151 151
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides TEDefaultMetricTlv. 28 * Provides TEDefaultMetricTlv.
29 */ 29 */
30 -public class TEDefaultMetricTlv implements PcepValueType { 30 +public class TEDefaultMetricSubTlv implements PcepValueType {
31 31
32 /* 32 /*
33 * Reference :| [I-D.ietf-idr- ls-distribution] /3.3.2.3 33 * Reference :| [I-D.ietf-idr- ls-distribution] /3.3.2.3
...@@ -40,9 +40,9 @@ public class TEDefaultMetricTlv implements PcepValueType { ...@@ -40,9 +40,9 @@ public class TEDefaultMetricTlv implements PcepValueType {
40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 41
42 */ 42 */
43 - protected static final Logger log = LoggerFactory.getLogger(TEDefaultMetricTlv.class); 43 + protected static final Logger log = LoggerFactory.getLogger(TEDefaultMetricSubTlv.class);
44 44
45 - public static final short TYPE = 13400; //TDB37 45 + public static final short TYPE = 26;
46 public static final short LENGTH = 4; 46 public static final short LENGTH = 4;
47 47
48 private final int rawValue; 48 private final int rawValue;
...@@ -52,7 +52,7 @@ public class TEDefaultMetricTlv implements PcepValueType { ...@@ -52,7 +52,7 @@ public class TEDefaultMetricTlv implements PcepValueType {
52 * 52 *
53 * @param rawValue TE Default Link Metric 53 * @param rawValue TE Default Link Metric
54 */ 54 */
55 - public TEDefaultMetricTlv(int rawValue) { 55 + public TEDefaultMetricSubTlv(int rawValue) {
56 this.rawValue = rawValue; 56 this.rawValue = rawValue;
57 } 57 }
58 58
...@@ -62,8 +62,8 @@ public class TEDefaultMetricTlv implements PcepValueType { ...@@ -62,8 +62,8 @@ public class TEDefaultMetricTlv implements PcepValueType {
62 * @param raw raw value 62 * @param raw raw value
63 * @return object of TEDefaultMetricTlv. 63 * @return object of TEDefaultMetricTlv.
64 */ 64 */
65 - public static TEDefaultMetricTlv of(final int raw) { 65 + public static TEDefaultMetricSubTlv of(final int raw) {
66 - return new TEDefaultMetricTlv(raw); 66 + return new TEDefaultMetricSubTlv(raw);
67 } 67 }
68 68
69 /** 69 /**
...@@ -100,8 +100,8 @@ public class TEDefaultMetricTlv implements PcepValueType { ...@@ -100,8 +100,8 @@ public class TEDefaultMetricTlv implements PcepValueType {
100 if (this == obj) { 100 if (this == obj) {
101 return true; 101 return true;
102 } 102 }
103 - if (obj instanceof TEDefaultMetricTlv) { 103 + if (obj instanceof TEDefaultMetricSubTlv) {
104 - TEDefaultMetricTlv other = (TEDefaultMetricTlv) obj; 104 + TEDefaultMetricSubTlv other = (TEDefaultMetricSubTlv) obj;
105 return Objects.equals(this.rawValue, other.rawValue); 105 return Objects.equals(this.rawValue, other.rawValue);
106 } 106 }
107 return false; 107 return false;
...@@ -122,8 +122,8 @@ public class TEDefaultMetricTlv implements PcepValueType { ...@@ -122,8 +122,8 @@ public class TEDefaultMetricTlv implements PcepValueType {
122 * @param c input channel buffer 122 * @param c input channel buffer
123 * @return object of TEDefaultMetricTlv 123 * @return object of TEDefaultMetricTlv
124 */ 124 */
125 - public static TEDefaultMetricTlv read(ChannelBuffer c) { 125 + public static TEDefaultMetricSubTlv read(ChannelBuffer c) {
126 - return TEDefaultMetricTlv.of(c.readInt()); 126 + return TEDefaultMetricSubTlv.of(c.readInt());
127 } 127 }
128 128
129 @Override 129 @Override
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides Unreserved Bandwidth Tlv. 28 * Provides Unreserved Bandwidth Tlv.
29 */ 29 */
30 -public class UnreservedBandwidthTlv implements PcepValueType { 30 +public class UnreservedBandwidthSubTlv implements PcepValueType {
31 31
32 /* Reference :[RFC5305]/3.6 32 /* Reference :[RFC5305]/3.6
33 0 1 2 3 33 0 1 2 3
...@@ -39,9 +39,9 @@ public class UnreservedBandwidthTlv implements PcepValueType { ...@@ -39,9 +39,9 @@ public class UnreservedBandwidthTlv implements PcepValueType {
39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 */ 40 */
41 41
42 - protected static final Logger log = LoggerFactory.getLogger(UnreservedBandwidthTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(UnreservedBandwidthSubTlv.class);
43 43
44 - public static final short TYPE = 11; //TDB36 44 + public static final short TYPE = 25;
45 public static final short LENGTH = 4; 45 public static final short LENGTH = 4;
46 46
47 private final int rawValue; 47 private final int rawValue;
...@@ -51,7 +51,7 @@ public class UnreservedBandwidthTlv implements PcepValueType { ...@@ -51,7 +51,7 @@ public class UnreservedBandwidthTlv implements PcepValueType {
51 * 51 *
52 * @param rawValue Unreserved Bandwidth 52 * @param rawValue Unreserved Bandwidth
53 */ 53 */
54 - public UnreservedBandwidthTlv(int rawValue) { 54 + public UnreservedBandwidthSubTlv(int rawValue) {
55 this.rawValue = rawValue; 55 this.rawValue = rawValue;
56 } 56 }
57 57
...@@ -61,8 +61,8 @@ public class UnreservedBandwidthTlv implements PcepValueType { ...@@ -61,8 +61,8 @@ public class UnreservedBandwidthTlv implements PcepValueType {
61 * @param raw as Unreserved Bandwidth 61 * @param raw as Unreserved Bandwidth
62 * @return object of UnreservedBandwidthTlv 62 * @return object of UnreservedBandwidthTlv
63 */ 63 */
64 - public static UnreservedBandwidthTlv of(final int raw) { 64 + public static UnreservedBandwidthSubTlv of(final int raw) {
65 - return new UnreservedBandwidthTlv(raw); 65 + return new UnreservedBandwidthSubTlv(raw);
66 } 66 }
67 67
68 /** 68 /**
...@@ -99,8 +99,8 @@ public class UnreservedBandwidthTlv implements PcepValueType { ...@@ -99,8 +99,8 @@ public class UnreservedBandwidthTlv implements PcepValueType {
99 if (this == obj) { 99 if (this == obj) {
100 return true; 100 return true;
101 } 101 }
102 - if (obj instanceof UnreservedBandwidthTlv) { 102 + if (obj instanceof UnreservedBandwidthSubTlv) {
103 - UnreservedBandwidthTlv other = (UnreservedBandwidthTlv) obj; 103 + UnreservedBandwidthSubTlv other = (UnreservedBandwidthSubTlv) obj;
104 return Objects.equals(this.rawValue, other.rawValue); 104 return Objects.equals(this.rawValue, other.rawValue);
105 } 105 }
106 return false; 106 return false;
...@@ -121,8 +121,8 @@ public class UnreservedBandwidthTlv implements PcepValueType { ...@@ -121,8 +121,8 @@ public class UnreservedBandwidthTlv implements PcepValueType {
121 * @param c input channel buffer 121 * @param c input channel buffer
122 * @return object of UnreservedBandwidthTlv 122 * @return object of UnreservedBandwidthTlv
123 */ 123 */
124 - public static UnreservedBandwidthTlv read(ChannelBuffer c) { 124 + public static UnreservedBandwidthSubTlv read(ChannelBuffer c) {
125 - return UnreservedBandwidthTlv.of(c.readInt()); 125 + return UnreservedBandwidthSubTlv.of(c.readInt());
126 } 126 }
127 127
128 @Override 128 @Override
......
...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol; ...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol;
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers; 19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Test; 20 import org.junit.Test;
21 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
21 import org.onosproject.pcepio.exceptions.PcepParseException; 22 import org.onosproject.pcepio.exceptions.PcepParseException;
22 23
23 import static org.hamcrest.MatcherAssert.assertThat; 24 import static org.hamcrest.MatcherAssert.assertThat;
...@@ -30,7 +31,7 @@ public class PcepCloseMsgTest { ...@@ -30,7 +31,7 @@ public class PcepCloseMsgTest {
30 * Common header, reason to close. 31 * Common header, reason to close.
31 */ 32 */
32 @Test 33 @Test
33 - public void closeMessageTest1() throws PcepParseException { 34 + public void closeMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
34 35
35 byte[] closeMsg = new byte[] {0x20, 0x07, 0x00, 0x0C, 0x0f, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02 }; 36 byte[] closeMsg = new byte[] {0x20, 0x07, 0x00, 0x0C, 0x0f, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02 };
36 37
......
...@@ -19,6 +19,7 @@ package org.onosproject.pcepio.protocol; ...@@ -19,6 +19,7 @@ package org.onosproject.pcepio.protocol;
19 import org.jboss.netty.buffer.ChannelBuffer; 19 import org.jboss.netty.buffer.ChannelBuffer;
20 import org.jboss.netty.buffer.ChannelBuffers; 20 import org.jboss.netty.buffer.ChannelBuffers;
21 import org.junit.Test; 21 import org.junit.Test;
22 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
22 import org.onosproject.pcepio.exceptions.PcepParseException; 23 import org.onosproject.pcepio.exceptions.PcepParseException;
23 24
24 import static org.hamcrest.MatcherAssert.assertThat; 25 import static org.hamcrest.MatcherAssert.assertThat;
...@@ -33,11 +34,11 @@ public class PcepErrorMsgTest { ...@@ -33,11 +34,11 @@ public class PcepErrorMsgTest {
33 /** 34 /**
34 * This test case checks for 35 * This test case checks for
35 * PCEP-ERROR Object, OPEN Object (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV, 36 * PCEP-ERROR Object, OPEN Object (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV,
36 - * PCECC-CAPABILITY-TLV, TED Capability TLV) 37 + * PCECC-CAPABILITY-TLV, LS Capability TLV)
37 * in PcepErrorMsg message. 38 * in PcepErrorMsg message.
38 */ 39 */
39 @Test 40 @Test
40 - public void errorMessageTest1() throws PcepParseException { 41 + public void errorMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
41 42
42 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x34, // common header 43 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x34, // common header
43 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 44 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
...@@ -46,7 +47,7 @@ public class PcepErrorMsgTest { ...@@ -46,7 +47,7 @@ public class PcepErrorMsgTest {
46 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY 47 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
47 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV 48 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
48 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV 49 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV
49 - 0x00, 0x00, 0x00, 0x03, 0x00, (byte) 0x84, 0x00, 0x04, // TED Capability TLV 50 + 0x00, 0x00, 0x00, 0x03, (byte) 0xFF, (byte) 0x00, 0x00, 0x04, // LS Capability TLV
50 0x00, 0x00, 0x00, 0x00}; 51 0x00, 0x00, 0x00, 0x00};
51 52
52 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 53 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
...@@ -72,11 +73,11 @@ public class PcepErrorMsgTest { ...@@ -72,11 +73,11 @@ public class PcepErrorMsgTest {
72 /** 73 /**
73 * This test case checks for 74 * This test case checks for
74 * PCEP-ERROR Object, PCEP-ERROR Object, OPEN Object (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV, 75 * PCEP-ERROR Object, PCEP-ERROR Object, OPEN Object (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV,
75 - * PCECC-CAPABILITY-TLV, TED Capability TLV) 76 + * PCECC-CAPABILITY-TLV, LS Capability TLV)
76 * in PcepErrorMsg message. 77 * in PcepErrorMsg message.
77 */ 78 */
78 @Test 79 @Test
79 - public void errorMessageTest2() throws PcepParseException { 80 + public void errorMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
80 81
81 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x3C, // common header 82 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x3C, // common header
82 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 83 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
...@@ -86,7 +87,7 @@ public class PcepErrorMsgTest { ...@@ -86,7 +87,7 @@ public class PcepErrorMsgTest {
86 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY 87 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
87 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV 88 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
88 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV 89 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV
89 - 0x00, 0x00, 0x00, 0x03, 0x00, (byte) 0x84, 0x00, 0x04, // TED Capability TLV 90 + 0x00, 0x00, 0x00, 0x03, (byte) 0xFF, (byte) 0x00, 0x00, 0x04, // LS Capability TLV
90 0x00, 0x00, 0x00, 0x00}; 91 0x00, 0x00, 0x00, 0x00};
91 92
92 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 93 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
...@@ -115,7 +116,7 @@ public class PcepErrorMsgTest { ...@@ -115,7 +116,7 @@ public class PcepErrorMsgTest {
115 * in PcepErrorMsg message. 116 * in PcepErrorMsg message.
116 */ 117 */
117 @Test 118 @Test
118 - public void errorMessageTest3() throws PcepParseException { 119 + public void errorMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
119 120
120 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x34, // common header 121 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x34, // common header
121 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 122 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
...@@ -152,7 +153,7 @@ public class PcepErrorMsgTest { ...@@ -152,7 +153,7 @@ public class PcepErrorMsgTest {
152 * in PcepErrorMsg message. 153 * in PcepErrorMsg message.
153 */ 154 */
154 @Test 155 @Test
155 - public void errorMessageTest4() throws PcepParseException { 156 + public void errorMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
156 157
157 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x2c, // common header 158 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x2c, // common header
158 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 159 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
...@@ -188,7 +189,7 @@ public class PcepErrorMsgTest { ...@@ -188,7 +189,7 @@ public class PcepErrorMsgTest {
188 * in PcepErrorMsg message. 189 * in PcepErrorMsg message.
189 */ 190 */
190 @Test 191 @Test
191 - public void errorMessageTest5() throws PcepParseException { 192 + public void errorMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
192 193
193 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x24, // common header 194 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x24, // common header
194 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 195 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
...@@ -223,7 +224,7 @@ public class PcepErrorMsgTest { ...@@ -223,7 +224,7 @@ public class PcepErrorMsgTest {
223 * in PcepErrorMsg message. 224 * in PcepErrorMsg message.
224 */ 225 */
225 @Test 226 @Test
226 - public void errorMessageTest6() throws PcepParseException { 227 + public void errorMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
227 228
228 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x1C, // common header 229 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x1C, // common header
229 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 230 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
...@@ -257,7 +258,7 @@ public class PcepErrorMsgTest { ...@@ -257,7 +258,7 @@ public class PcepErrorMsgTest {
257 * in PcepErrorMsg message. 258 * in PcepErrorMsg message.
258 */ 259 */
259 @Test 260 @Test
260 - public void errorMessageTest7() throws PcepParseException { 261 + public void errorMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
261 262
262 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x14, // common header 263 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x14, // common header
263 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 264 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
...@@ -290,7 +291,7 @@ public class PcepErrorMsgTest { ...@@ -290,7 +291,7 @@ public class PcepErrorMsgTest {
290 * in PcepErrorMsg message. 291 * in PcepErrorMsg message.
291 */ 292 */
292 @Test 293 @Test
293 - public void errorMessageTest8() throws PcepParseException { 294 + public void errorMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
294 295
295 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x20, // common header 296 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x20, // common header
296 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 297 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
...@@ -323,7 +324,7 @@ public class PcepErrorMsgTest { ...@@ -323,7 +324,7 @@ public class PcepErrorMsgTest {
323 * in PcepErrorMsg message. 324 * in PcepErrorMsg message.
324 */ 325 */
325 @Test 326 @Test
326 - public void errorMessageTest9() throws PcepParseException { 327 + public void errorMessageTest9() throws PcepParseException, PcepOutOfBoundMessageException {
327 328
328 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x14, // common header 329 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x14, // common header
329 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header 330 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
...@@ -355,7 +356,7 @@ public class PcepErrorMsgTest { ...@@ -355,7 +356,7 @@ public class PcepErrorMsgTest {
355 * in PcepErrorMsg message. 356 * in PcepErrorMsg message.
356 */ 357 */
357 @Test 358 @Test
358 - public void errorMessageTest10() throws PcepParseException { 359 + public void errorMessageTest10() throws PcepParseException, PcepOutOfBoundMessageException {
359 360
360 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x14, // common header 361 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x14, // common header
361 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header 362 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
...@@ -383,15 +384,16 @@ public class PcepErrorMsgTest { ...@@ -383,15 +384,16 @@ public class PcepErrorMsgTest {
383 384
384 /** 385 /**
385 * This test case checks for 386 * This test case checks for
386 - * TE Object, PCEP-ERROR Object 387 + * LS Object, PCEP-ERROR Object
387 * in PcepErrorMsg message. 388 * in PcepErrorMsg message.
388 */ 389 */
389 @Test 390 @Test
390 - public void errorMessageTest11() throws PcepParseException { 391 + public void errorMessageTest11() throws PcepParseException, PcepOutOfBoundMessageException {
391 392
392 - byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x18, // common header 393 + byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x1C, // common header
393 - 0x65, 0x13, 0x00, 0x0C, // TE Object Header 394 + (byte) 0xE0, 0x13, 0x00, 0x10, // LS Object Header
394 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID 395 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // LS-ID
396 + 0x00, 0x00, 0x00, 0x10,
395 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header 397 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
396 0x00, 0x00, 0x01, 0x01}; 398 0x00, 0x00, 0x01, 0x01};
397 399
...@@ -420,7 +422,7 @@ public class PcepErrorMsgTest { ...@@ -420,7 +422,7 @@ public class PcepErrorMsgTest {
420 * in PcepErrorMsg message. 422 * in PcepErrorMsg message.
421 */ 423 */
422 @Test 424 @Test
423 - public void errorMessageTest12() throws PcepParseException { 425 + public void errorMessageTest12() throws PcepParseException, PcepOutOfBoundMessageException {
424 426
425 //RP Object, PCEP-ERROR Object 427 //RP Object, PCEP-ERROR Object
426 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x18, // common header 428 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x18, // common header
...@@ -453,7 +455,7 @@ public class PcepErrorMsgTest { ...@@ -453,7 +455,7 @@ public class PcepErrorMsgTest {
453 * in PcepErrorMsg message. 455 * in PcepErrorMsg message.
454 */ 456 */
455 @Test 457 @Test
456 - public void errorMessageTest13() throws PcepParseException { 458 + public void errorMessageTest13() throws PcepParseException, PcepOutOfBoundMessageException {
457 459
458 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x24, // common header 460 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x24, // common header
459 0x02, 0x10, 0x00, 0x0C, // RP Object Header 461 0x02, 0x10, 0x00, 0x0C, // RP Object Header
...@@ -482,17 +484,21 @@ public class PcepErrorMsgTest { ...@@ -482,17 +484,21 @@ public class PcepErrorMsgTest {
482 484
483 /** 485 /**
484 * This test case checks for 486 * This test case checks for
485 - * TE Object, TE Object, PCEP-ERROR Object 487 + * LS Object, LS Object, PCEP-ERROR Object
486 * in PcepErrorMsg message. 488 * in PcepErrorMsg message.
487 */ 489 */
488 @Test 490 @Test
489 - public void errorMessageTest14() throws PcepParseException { 491 + public void errorMessageTest14() throws PcepParseException, PcepOutOfBoundMessageException {
490 492
491 - byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x24, // common header 493 + byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x2C, // common header
492 - 0x65, 0x10, 0x00, 0x0C, // TE Object Header 494 + (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
493 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID 495 + 0x01, 0x00, 0x00, 0x03, // LS-ID
494 - 0x65, 0x10, 0x00, 0x0C, // TE Object Header 496 + 0x00, 0x00, 0x00, 0x00,
495 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x11, // TE-ID 497 + 0x00, 0x00, 0x00, 0x10,
498 + (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
499 + 0x01, 0x00, 0x00, 0x03, // LS-ID
500 + 0x00, 0x00, 0x00, 0x00,
501 + 0x00, 0x00, 0x00, 0x11,
496 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header 502 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
497 0x00, 0x00, 0x01, 0x01}; 503 0x00, 0x00, 0x01, 0x01};
498 504
...@@ -517,16 +523,19 @@ public class PcepErrorMsgTest { ...@@ -517,16 +523,19 @@ public class PcepErrorMsgTest {
517 523
518 /** 524 /**
519 * This test case checks for 525 * This test case checks for
520 - * PCEP-ERROR Object, TE Object, PCEP-ERROR Object 526 + * PCEP-ERROR Object, LS Object, PCEP-ERROR Object
521 * in PcepErrorMsg message. 527 * in PcepErrorMsg message.
522 */ 528 */
523 @Test 529 @Test
524 - public void errorMessageTest15() throws PcepParseException { 530 + public void errorMessageTest15() throws PcepParseException, PcepOutOfBoundMessageException {
525 531
526 - byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x20, // common header 532 + byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x24, // common header
527 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 533 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
528 - 0x00, 0x00, 0x01, 0x01, 0x65, 0x10, 0x00, 0x0C, // TE Object Header 534 + 0x00, 0x00, 0x01, 0x01,
529 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID 535 + (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
536 + 0x01, 0x00, 0x00, 0x03, // LS-ID
537 + 0x00, 0x00, 0x00, 0x00,
538 + 0x00, 0x00, 0x00, 0x10,
530 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header 539 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
531 0x00, 0x00, 0x01, 0x03}; 540 0x00, 0x00, 0x01, 0x03};
532 541
...@@ -555,7 +564,7 @@ public class PcepErrorMsgTest { ...@@ -555,7 +564,7 @@ public class PcepErrorMsgTest {
555 * in PcepErrorMsg message. 564 * in PcepErrorMsg message.
556 */ 565 */
557 @Test 566 @Test
558 - public void errorMessageTest16() throws PcepParseException { 567 + public void errorMessageTest16() throws PcepParseException, PcepOutOfBoundMessageException {
559 568
560 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x2C, // common header 569 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x2C, // common header
561 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header 570 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
...@@ -585,18 +594,23 @@ public class PcepErrorMsgTest { ...@@ -585,18 +594,23 @@ public class PcepErrorMsgTest {
585 594
586 /** 595 /**
587 * This test case checks for 596 * This test case checks for
588 - * PCEP-ERROR Object, TE Object, TE Object, PCEP-ERROR Object 597 + * PCEP-ERROR Object, LS Object, LS Object, PCEP-ERROR Object
589 * in PcepErrorMsg message. 598 * in PcepErrorMsg message.
590 */ 599 */
591 @Test 600 @Test
592 - public void errorMessageTest17() throws PcepParseException { 601 + public void errorMessageTest17() throws PcepParseException, PcepOutOfBoundMessageException {
593 602
594 - byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x2C, // common header 603 + byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x34, // common header
595 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header 604 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
596 - 0x00, 0x00, 0x01, 0x01, 0x65, 0x10, 0x00, 0x0C, // TE Object Header 605 + 0x00, 0x00, 0x01, 0x01,
597 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID 606 + (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
598 - 0x65, 0x10, 0x00, 0x0C, // TE Object Header 607 + 0x01, 0x00, 0x00, 0x03, // LS-ID
599 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x11, // TE-ID 608 + 0x00, 0x00, 0x00, 0x00,
609 + 0x00, 0x00, 0x00, 0x10,
610 + (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
611 + 0x01, 0x00, 0x00, 0x03, // LS-ID
612 + 0x00, 0x00, 0x00, 0x00,
613 + 0x00, 0x00, 0x00, 0x11,
600 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header 614 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
601 0x00, 0x00, 0x01, 0x03}; 615 0x00, 0x00, 0x01, 0x03};
602 616
...@@ -625,7 +639,7 @@ public class PcepErrorMsgTest { ...@@ -625,7 +639,7 @@ public class PcepErrorMsgTest {
625 * in PcepErrorMsg message. 639 * in PcepErrorMsg message.
626 */ 640 */
627 @Test 641 @Test
628 - public void errorMessageTest18() throws PcepParseException { 642 + public void errorMessageTest18() throws PcepParseException, PcepOutOfBoundMessageException {
629 643
630 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x3C, // common header 644 byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x3C, // common header
631 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header 645 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
...@@ -657,21 +671,28 @@ public class PcepErrorMsgTest { ...@@ -657,21 +671,28 @@ public class PcepErrorMsgTest {
657 671
658 /** 672 /**
659 * This test case checks for 673 * This test case checks for
660 - * PCEP-ERROR Object, PCEP-ERROR Object, TE Object, TE Object, PCEP-ERROR Object, PCEP-ERROR Object 674 + * PCEP-ERROR Object, PCEP-ERROR Object, LS Object, LS Object, PCEP-ERROR Object, PCEP-ERROR Object
661 * in PcepErrorMsg message. 675 * in PcepErrorMsg message.
662 */ 676 */
663 @Test 677 @Test
664 - public void errorMessageTest19() throws PcepParseException { 678 + public void errorMessageTest19() throws PcepParseException, PcepOutOfBoundMessageException {
665 679
666 - byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x3C, // common header 680 + byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x44, // common header
667 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 681 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
668 - 0x00, 0x00, 0x01, 0x01, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 682 + 0x00, 0x00, 0x01, 0x01,
669 - 0x00, 0x00, 0x01, 0x03, 0x65, 0x10, 0x00, 0x0C, // TE Object Header
670 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
671 - 0x65, 0x10, 0x00, 0x0C, // TE Object Header
672 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x11, // TE-ID
673 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 683 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
674 - 0x00, 0x00, 0x01, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 684 + 0x00, 0x00, 0x01, 0x03,
685 + (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
686 + 0x01, 0x00, 0x00, 0x03, // LS-ID
687 + 0x00, 0x00, 0x00, 0x00,
688 + 0x00, 0x00, 0x00, 0x10,
689 + (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
690 + 0x01, 0x00, 0x00, 0x03, // LS-ID
691 + 0x00, 0x00, 0x00, 0x00,
692 + 0x00, 0x00, 0x00, 0x11,
693 + 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
694 + 0x00, 0x00, 0x01, 0x04, // PCERR Object Header
695 + 0x0D, 0x10, 0x00, 0x08,
675 0x00, 0x00, 0x01, 0x06}; 696 0x00, 0x00, 0x01, 0x06};
676 697
677 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 698 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
...@@ -696,20 +717,20 @@ public class PcepErrorMsgTest { ...@@ -696,20 +717,20 @@ public class PcepErrorMsgTest {
696 /** 717 /**
697 * This test case checks for 718 * This test case checks for
698 * PCEP-ERROR Object, RP Object, RP Object, PCEP-ERROR Object, PCEP-ERROR Object, 719 * PCEP-ERROR Object, RP Object, RP Object, PCEP-ERROR Object, PCEP-ERROR Object,
699 - * TE Object, PCEP-ERROR Object 720 + * LS Object, PCEP-ERROR Object
700 * in PcepErrorMsg message. 721 * in PcepErrorMsg message.
701 */ 722 */
702 @Test 723 @Test
703 - public void errorMessageTest20() throws PcepParseException { 724 + public void errorMessageTest20() throws PcepParseException, PcepOutOfBoundMessageException {
704 725
705 - byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x48, // common header 726 + byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x4C, // common header
706 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header 727 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
707 0x00, 0x00, 0x01, 0x01, 0x02, 0x10, 0x00, 0x0C, // RP Object Header 728 0x00, 0x00, 0x01, 0x01, 0x02, 0x10, 0x00, 0x0C, // RP Object Header
708 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x10, 0x00, 0x0C, // RP Object Header 729 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x10, 0x00, 0x0C, // RP Object Header
709 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 730 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
710 0x00, 0x00, 0x01, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 731 0x00, 0x00, 0x01, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
711 - 0x00, 0x00, 0x01, 0x06, 0x65, 0x10, 0x00, 0x0C, // TE Object Header 732 + 0x00, 0x00, 0x01, 0x06, (byte) 0xE0, 0x10, 0x00, 0x10, // LS Object Header
712 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID 733 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
713 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header 734 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
714 0x00, 0x00, 0x01, 0x06}; 735 0x00, 0x00, 0x01, 0x06};
715 736
......
...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol; ...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol;
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers; 19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Test; 20 import org.junit.Test;
21 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
21 import org.onosproject.pcepio.exceptions.PcepParseException; 22 import org.onosproject.pcepio.exceptions.PcepParseException;
22 23
23 import static org.hamcrest.MatcherAssert.assertThat; 24 import static org.hamcrest.MatcherAssert.assertThat;
...@@ -32,11 +33,11 @@ public class PcepInitiateMsgExtTest { ...@@ -32,11 +33,11 @@ public class PcepInitiateMsgExtTest {
32 * END-POINTS, ERO, LSPA, BANDWIDTH, METRIC-LIST objects in PcInitiate message. 33 * END-POINTS, ERO, LSPA, BANDWIDTH, METRIC-LIST objects in PcInitiate message.
33 */ 34 */
34 @Test 35 @Test
35 - public void initiateMessageTest1() throws PcepParseException { 36 + public void initiateMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
36 37
37 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv, 38 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
38 - * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC-LIST. 39 + // StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC-LIST.
39 - */ 40 + //
40 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xA4, 41 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xA4,
41 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 42 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
42 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 43 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -88,11 +89,11 @@ public class PcepInitiateMsgExtTest { ...@@ -88,11 +89,11 @@ public class PcepInitiateMsgExtTest {
88 * objects in PcInitiate message. 89 * objects in PcInitiate message.
89 */ 90 */
90 @Test 91 @Test
91 - public void initiateMessageTest2() throws PcepParseException { 92 + public void initiateMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
92 93
93 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv, 94 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
94 - * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT. 95 + // StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
95 - */ 96 + //
96 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xA8, 97 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xA8,
97 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 98 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
98 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 99 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -143,11 +144,11 @@ public class PcepInitiateMsgExtTest { ...@@ -143,11 +144,11 @@ public class PcepInitiateMsgExtTest {
143 * ERO, LSPA, BANDWIDTH objects in PcInitiate message. 144 * ERO, LSPA, BANDWIDTH objects in PcInitiate message.
144 */ 145 */
145 @Test 146 @Test
146 - public void initiateMessageTest3() throws PcepParseException { 147 + public void initiateMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
147 148
148 - /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv, 149 + // SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
149 - * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH. 150 + // StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH.
150 - */ 151 + //
151 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x8c, 152 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x8c,
152 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 153 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
153 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 154 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -197,11 +198,11 @@ public class PcepInitiateMsgExtTest { ...@@ -197,11 +198,11 @@ public class PcepInitiateMsgExtTest {
197 * END-POINTS, ERO, LSPA objects in PcInitiate message. 198 * END-POINTS, ERO, LSPA objects in PcInitiate message.
198 */ 199 */
199 @Test 200 @Test
200 - public void initiateMessageTest4() throws PcepParseException { 201 + public void initiateMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
201 202
202 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv, 203 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
203 - * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA. 204 + // StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA.
204 - */ 205 + //
205 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84, 206 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
206 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 207 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
207 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 208 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -250,11 +251,11 @@ public class PcepInitiateMsgExtTest { ...@@ -250,11 +251,11 @@ public class PcepInitiateMsgExtTest {
250 * objects in PcInitiate message. 251 * objects in PcInitiate message.
251 */ 252 */
252 @Test 253 @Test
253 - public void initiateMessageTest5() throws PcepParseException { 254 + public void initiateMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
254 255
255 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv, 256 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
256 - * StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA. 257 + // StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA.
257 - */ 258 + //
258 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84, 259 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
259 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 260 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
260 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 261 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -301,11 +302,11 @@ public class PcepInitiateMsgExtTest { ...@@ -301,11 +302,11 @@ public class PcepInitiateMsgExtTest {
301 * BANDWIDTH OBJECT objects in PcInitiate message. 302 * BANDWIDTH OBJECT objects in PcInitiate message.
302 */ 303 */
303 @Test 304 @Test
304 - public void initiateMessageTest6() throws PcepParseException { 305 + public void initiateMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
305 306
306 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv, 307 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
307 - * StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT. 308 + // StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
308 - */ 309 + //
309 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x8c, 310 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x8c,
310 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 311 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
311 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 312 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -353,11 +354,11 @@ public class PcepInitiateMsgExtTest { ...@@ -353,11 +354,11 @@ public class PcepInitiateMsgExtTest {
353 * LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message. 354 * LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
354 */ 355 */
355 @Test 356 @Test
356 - public void initiateMessageTest7() throws PcepParseException { 357 + public void initiateMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
357 358
358 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv, 359 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
359 - * StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT. 360 + // StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
360 - */ 361 + //
361 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x98, 362 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x98,
362 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 363 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
363 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 364 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -406,11 +407,11 @@ public class PcepInitiateMsgExtTest { ...@@ -406,11 +407,11 @@ public class PcepInitiateMsgExtTest {
406 * objects in PcInitiate message. 407 * objects in PcInitiate message.
407 */ 408 */
408 @Test 409 @Test
409 - public void initiateMessageTest8() throws PcepParseException { 410 + public void initiateMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
410 411
411 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv), 412 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
412 - * END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT. 413 + // END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
413 - */ 414 + //
414 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x90, 415 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x90,
415 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 416 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
416 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 417 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -458,11 +459,11 @@ public class PcepInitiateMsgExtTest { ...@@ -458,11 +459,11 @@ public class PcepInitiateMsgExtTest {
458 * objects in PcInitiate message. 459 * objects in PcInitiate message.
459 */ 460 */
460 @Test 461 @Test
461 - public void initiateMessageTest9() throws PcepParseException { 462 + public void initiateMessageTest9() throws PcepParseException, PcepOutOfBoundMessageException {
462 463
463 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv), 464 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
464 - * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT. 465 + // END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
465 - */ 466 + //
466 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84, 467 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
467 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 468 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
468 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 469 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -508,11 +509,11 @@ public class PcepInitiateMsgExtTest { ...@@ -508,11 +509,11 @@ public class PcepInitiateMsgExtTest {
508 * SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message. 509 * SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
509 */ 510 */
510 @Test 511 @Test
511 - public void initiateMessageTest10() throws PcepParseException { 512 + public void initiateMessageTest10() throws PcepParseException, PcepOutOfBoundMessageException {
512 513
513 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv), 514 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
514 - * END-POINTS, ERO, LSPA OBJECT. 515 + // END-POINTS, ERO, LSPA OBJECT.
515 - */ 516 + //
516 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x70, 517 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x70,
517 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 518 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
518 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 519 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -556,11 +557,11 @@ public class PcepInitiateMsgExtTest { ...@@ -556,11 +557,11 @@ public class PcepInitiateMsgExtTest {
556 * objects in PcInitiate message. 557 * objects in PcInitiate message.
557 */ 558 */
558 @Test 559 @Test
559 - public void initiateMessageTest11() throws PcepParseException { 560 + public void initiateMessageTest11() throws PcepParseException, PcepOutOfBoundMessageException {
560 561
561 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv), 562 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
562 - * END-POINTS, ERO, LSPA OBJECT. 563 + // END-POINTS, ERO, LSPA OBJECT.
563 - */ 564 + //
564 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x7C, 565 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x7C,
565 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 566 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
566 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 567 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -604,11 +605,11 @@ public class PcepInitiateMsgExtTest { ...@@ -604,11 +605,11 @@ public class PcepInitiateMsgExtTest {
604 * objects in PcInitiate message. 605 * objects in PcInitiate message.
605 */ 606 */
606 @Test 607 @Test
607 - public void initiateMessageTest12() throws PcepParseException { 608 + public void initiateMessageTest12() throws PcepParseException, PcepOutOfBoundMessageException {
608 609
609 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv), 610 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
610 - * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT. 611 + // END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
611 - */ 612 + //
612 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x78, 613 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x78,
613 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 614 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
614 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 615 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -653,11 +654,11 @@ public class PcepInitiateMsgExtTest { ...@@ -653,11 +654,11 @@ public class PcepInitiateMsgExtTest {
653 * objects in PcInitiate message. 654 * objects in PcInitiate message.
654 */ 655 */
655 @Test 656 @Test
656 - public void initiateMessageTest13() throws PcepParseException { 657 + public void initiateMessageTest13() throws PcepParseException, PcepOutOfBoundMessageException {
657 658
658 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv), 659 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
659 - * END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT. 660 + // END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT.
660 - */ 661 + //
661 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84, 662 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
662 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 663 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
663 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 664 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -702,11 +703,11 @@ public class PcepInitiateMsgExtTest { ...@@ -702,11 +703,11 @@ public class PcepInitiateMsgExtTest {
702 * END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT objects in PcInitiate message. 703 * END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT objects in PcInitiate message.
703 */ 704 */
704 @Test 705 @Test
705 - public void initiateMessageTest14() throws PcepParseException { 706 + public void initiateMessageTest14() throws PcepParseException, PcepOutOfBoundMessageException {
706 707
707 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), 708 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
708 - * END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT. 709 + // END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT.
709 - */ 710 + //
710 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x7c, 711 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x7c,
711 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 712 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
712 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 713 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -750,11 +751,11 @@ public class PcepInitiateMsgExtTest { ...@@ -750,11 +751,11 @@ public class PcepInitiateMsgExtTest {
750 * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT objects in PcInitiate message. 751 * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
751 */ 752 */
752 @Test 753 @Test
753 - public void initiateMessageTest15() throws PcepParseException { 754 + public void initiateMessageTest15() throws PcepParseException, PcepOutOfBoundMessageException {
754 755
755 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), 756 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
756 - * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT. 757 + // END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
757 - */ 758 + //
758 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x70, 759 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x70,
759 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 760 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
760 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 761 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -797,11 +798,11 @@ public class PcepInitiateMsgExtTest { ...@@ -797,11 +798,11 @@ public class PcepInitiateMsgExtTest {
797 * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message. 798 * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
798 */ 799 */
799 @Test 800 @Test
800 - public void initiateMessageTest16() throws PcepParseException { 801 + public void initiateMessageTest16() throws PcepParseException, PcepOutOfBoundMessageException {
801 802
802 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), 803 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
803 - * END-POINTS, ERO, LSPA OBJECT. 804 + // END-POINTS, ERO, LSPA OBJECT.
804 - */ 805 + //
805 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x68, 806 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x68,
806 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 807 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
807 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 808 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -843,10 +844,10 @@ public class PcepInitiateMsgExtTest { ...@@ -843,10 +844,10 @@ public class PcepInitiateMsgExtTest {
843 * objects in PcInitiate message. 844 * objects in PcInitiate message.
844 */ 845 */
845 @Test 846 @Test
846 - public void initiateMessageTest17() throws PcepParseException { 847 + public void initiateMessageTest17() throws PcepParseException, PcepOutOfBoundMessageException {
847 848
848 - /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT. 849 + // SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
849 - */ 850 + //
850 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60, 851 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
851 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 852 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
852 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object 853 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -887,10 +888,10 @@ public class PcepInitiateMsgExtTest { ...@@ -887,10 +888,10 @@ public class PcepInitiateMsgExtTest {
887 * BANDWIDTH OBJECT objects in PcInitiate message. 888 * BANDWIDTH OBJECT objects in PcInitiate message.
888 */ 889 */
889 @Test 890 @Test
890 - public void initiateMessageTest18() throws PcepParseException { 891 + public void initiateMessageTest18() throws PcepParseException, PcepOutOfBoundMessageException {
891 892
892 - /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT. 893 + // SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
893 - */ 894 + //
894 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x68, 895 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x68,
895 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 896 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
896 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, 897 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03,
...@@ -933,10 +934,10 @@ public class PcepInitiateMsgExtTest { ...@@ -933,10 +934,10 @@ public class PcepInitiateMsgExtTest {
933 * BANDWIDTH, METRIC OBJECT objects in PcInitiate message. 934 * BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
934 */ 935 */
935 @Test 936 @Test
936 - public void initiateMessageTest19() throws PcepParseException { 937 + public void initiateMessageTest19() throws PcepParseException, PcepOutOfBoundMessageException {
937 938
938 - /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT. 939 + // SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
939 - */ 940 + //
940 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x74, 941 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x74,
941 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 942 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
942 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object 943 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -979,10 +980,10 @@ public class PcepInitiateMsgExtTest { ...@@ -979,10 +980,10 @@ public class PcepInitiateMsgExtTest {
979 * BANDWIDTH, METRIC OBJECT objects in PcInitiate message. 980 * BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
980 */ 981 */
981 @Test 982 @Test
982 - public void initiateMessageTest20() throws PcepParseException { 983 + public void initiateMessageTest20() throws PcepParseException, PcepOutOfBoundMessageException {
983 984
984 - /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT. 985 + // SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
985 - */ 986 + //
986 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64, 987 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64,
987 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 988 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
988 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object 989 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -1024,10 +1025,10 @@ public class PcepInitiateMsgExtTest { ...@@ -1024,10 +1025,10 @@ public class PcepInitiateMsgExtTest {
1024 * BANDWIDTH OBJECT objects in PcInitiate message. 1025 * BANDWIDTH OBJECT objects in PcInitiate message.
1025 */ 1026 */
1026 @Test 1027 @Test
1027 - public void initiateMessageTest21() throws PcepParseException { 1028 + public void initiateMessageTest21() throws PcepParseException, PcepOutOfBoundMessageException {
1028 1029
1029 - /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT. 1030 + // SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
1030 - */ 1031 + //
1031 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58, 1032 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
1032 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1033 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1033 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object 1034 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -1068,10 +1069,10 @@ public class PcepInitiateMsgExtTest { ...@@ -1068,10 +1069,10 @@ public class PcepInitiateMsgExtTest {
1068 * LSPA OBJECT objects in PcInitiate message. 1069 * LSPA OBJECT objects in PcInitiate message.
1069 */ 1070 */
1070 @Test 1071 @Test
1071 - public void initiateMessageTest22() throws PcepParseException { 1072 + public void initiateMessageTest22() throws PcepParseException, PcepOutOfBoundMessageException {
1072 1073
1073 - /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT. 1074 + // SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
1074 - */ 1075 + //
1075 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50, 1076 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50,
1076 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1077 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1077 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object 1078 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -1111,10 +1112,10 @@ public class PcepInitiateMsgExtTest { ...@@ -1111,10 +1112,10 @@ public class PcepInitiateMsgExtTest {
1111 * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message. 1112 * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
1112 */ 1113 */
1113 @Test 1114 @Test
1114 - public void initiateMessageTest23() throws PcepParseException { 1115 + public void initiateMessageTest23() throws PcepParseException, PcepOutOfBoundMessageException {
1115 1116
1116 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT. 1117 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
1117 - */ 1118 + //
1118 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58, 1119 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
1119 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1120 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1120 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1121 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1155,10 +1156,10 @@ public class PcepInitiateMsgExtTest { ...@@ -1155,10 +1156,10 @@ public class PcepInitiateMsgExtTest {
1155 * END-POINTS, ERO, LSPA BANDWIDTH OBJECT objects in PcInitiate message. 1156 * END-POINTS, ERO, LSPA BANDWIDTH OBJECT objects in PcInitiate message.
1156 */ 1157 */
1157 @Test 1158 @Test
1158 - public void initiateMessageTest25() throws PcepParseException { 1159 + public void initiateMessageTest25() throws PcepParseException, PcepOutOfBoundMessageException {
1159 1160
1160 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA BANDWIDTH OBJECT. 1161 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA BANDWIDTH OBJECT.
1161 - */ 1162 + //
1162 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60, 1163 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
1163 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1164 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1164 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1165 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1200,11 +1201,11 @@ public class PcepInitiateMsgExtTest { ...@@ -1200,11 +1201,11 @@ public class PcepInitiateMsgExtTest {
1200 * ERO, LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message. 1201 * ERO, LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
1201 */ 1202 */
1202 @Test 1203 @Test
1203 - public void initiateMessageTest26() throws PcepParseException { 1204 + public void initiateMessageTest26() throws PcepParseException, PcepOutOfBoundMessageException {
1204 1205
1205 - /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS, 1206 + // SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS,
1206 - * ERO, LSPA, BANDWIDTH, METRIC OBJECT. 1207 + // ERO, LSPA, BANDWIDTH, METRIC OBJECT.
1207 - */ 1208 + //
1208 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x6C, 1209 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x6C,
1209 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1210 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1210 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1211 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1247,10 +1248,10 @@ public class PcepInitiateMsgExtTest { ...@@ -1247,10 +1248,10 @@ public class PcepInitiateMsgExtTest {
1247 * BANDWIDTH, METRIC OBJECT objects in PcInitiate message. 1248 * BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
1248 */ 1249 */
1249 @Test 1250 @Test
1250 - public void initiateMessageTest27() throws PcepParseException { 1251 + public void initiateMessageTest27() throws PcepParseException, PcepOutOfBoundMessageException {
1251 1252
1252 - /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT. 1253 + // SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
1253 - */ 1254 + //
1254 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60, 1255 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
1255 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1256 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1256 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1257 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1291,10 +1292,10 @@ public class PcepInitiateMsgExtTest { ...@@ -1291,10 +1292,10 @@ public class PcepInitiateMsgExtTest {
1291 * LSPA, BANDWIDTH OBJECT objects in PcInitiate message. 1292 * LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
1292 */ 1293 */
1293 @Test 1294 @Test
1294 - public void initiateMessageTest28() throws PcepParseException { 1295 + public void initiateMessageTest28() throws PcepParseException, PcepOutOfBoundMessageException {
1295 1296
1296 - /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT. 1297 + // SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
1297 - */ 1298 + //
1298 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x54, 1299 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x54,
1299 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1300 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1300 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1301 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1334,10 +1335,10 @@ public class PcepInitiateMsgExtTest { ...@@ -1334,10 +1335,10 @@ public class PcepInitiateMsgExtTest {
1334 * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message. 1335 * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
1335 */ 1336 */
1336 @Test 1337 @Test
1337 - public void initiateMessageTest29() throws PcepParseException { 1338 + public void initiateMessageTest29() throws PcepParseException, PcepOutOfBoundMessageException {
1338 1339
1339 - /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT. 1340 + // SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
1340 - */ 1341 + //
1341 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x4C, 1342 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x4C,
1342 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1343 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1343 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1344 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1376,10 +1377,10 @@ public class PcepInitiateMsgExtTest { ...@@ -1376,10 +1377,10 @@ public class PcepInitiateMsgExtTest {
1376 * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message. 1377 * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
1377 */ 1378 */
1378 @Test 1379 @Test
1379 - public void initiateMessageTest30() throws PcepParseException { 1380 + public void initiateMessageTest30() throws PcepParseException, PcepOutOfBoundMessageException {
1380 1381
1381 - /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT. 1382 + // SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
1382 - */ 1383 + //
1383 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x5C, 1384 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x5C,
1384 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1385 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1385 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1386 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1419,10 +1420,10 @@ public class PcepInitiateMsgExtTest { ...@@ -1419,10 +1420,10 @@ public class PcepInitiateMsgExtTest {
1419 * objects in PcInitiate message. 1420 * objects in PcInitiate message.
1420 */ 1421 */
1421 @Test 1422 @Test
1422 - public void initiateMessageTest31() throws PcepParseException { 1423 + public void initiateMessageTest31() throws PcepParseException, PcepOutOfBoundMessageException {
1423 1424
1424 - /* SRP, LSP (SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT. 1425 + // SRP, LSP (SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
1425 - */ 1426 + //
1426 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x54, 1427 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x54,
1427 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1428 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1428 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object 1429 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -1461,11 +1462,11 @@ public class PcepInitiateMsgExtTest { ...@@ -1461,11 +1462,11 @@ public class PcepInitiateMsgExtTest {
1461 * ERO, LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message. 1462 * ERO, LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
1462 */ 1463 */
1463 @Test 1464 @Test
1464 - public void initiateMessageTest32() throws PcepParseException { 1465 + public void initiateMessageTest32() throws PcepParseException, PcepOutOfBoundMessageException {
1465 1466
1466 - /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS, 1467 + // SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1467 - * ERO, LSPA, BANDWIDTH, METRIC OBJECT. 1468 + // ERO, LSPA, BANDWIDTH, METRIC OBJECT.
1468 - */ 1469 + //
1469 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64, 1470 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64,
1470 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1471 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1471 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1472 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1507,11 +1508,11 @@ public class PcepInitiateMsgExtTest { ...@@ -1507,11 +1508,11 @@ public class PcepInitiateMsgExtTest {
1507 * ERO, LSPA, BANDWIDTH OBJECT objects in PcInitiate message. 1508 * ERO, LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
1508 */ 1509 */
1509 @Test 1510 @Test
1510 - public void initiateMessageTest33() throws PcepParseException { 1511 + public void initiateMessageTest33() throws PcepParseException, PcepOutOfBoundMessageException {
1511 1512
1512 - /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS, 1513 + // SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1513 - * ERO, LSPA, BANDWIDTH OBJECT. 1514 + // ERO, LSPA, BANDWIDTH OBJECT.
1514 - */ 1515 + //
1515 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58, 1516 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
1516 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1517 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1517 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1518 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1552,11 +1553,11 @@ public class PcepInitiateMsgExtTest { ...@@ -1552,11 +1553,11 @@ public class PcepInitiateMsgExtTest {
1552 * ERO, LSPA OBJECT objects in PcInitiate message. 1553 * ERO, LSPA OBJECT objects in PcInitiate message.
1553 */ 1554 */
1554 @Test 1555 @Test
1555 - public void initiateMessageTest34() throws PcepParseException { 1556 + public void initiateMessageTest34() throws PcepParseException, PcepOutOfBoundMessageException {
1556 1557
1557 - /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS, 1558 + // SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1558 - * ERO, LSPA OBJECT. 1559 + // ERO, LSPA OBJECT.
1559 - */ 1560 + //
1560 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50, 1561 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50,
1561 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1562 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1562 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1563 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1596,11 +1597,11 @@ public class PcepInitiateMsgExtTest { ...@@ -1596,11 +1597,11 @@ public class PcepInitiateMsgExtTest {
1596 * ERO, LSPA OBJECT objects in PcInitiate message. 1597 * ERO, LSPA OBJECT objects in PcInitiate message.
1597 */ 1598 */
1598 @Test 1599 @Test
1599 - public void initiateMessageTest35() throws PcepParseException { 1600 + public void initiateMessageTest35() throws PcepParseException, PcepOutOfBoundMessageException {
1600 1601
1601 - /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS, 1602 + // SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1602 - * ERO, LSPA OBJECT. 1603 + // ERO, LSPA OBJECT.
1603 - */ 1604 + //
1604 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60, 1605 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
1605 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1606 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1606 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1607 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1641,11 +1642,11 @@ public class PcepInitiateMsgExtTest { ...@@ -1641,11 +1642,11 @@ public class PcepInitiateMsgExtTest {
1641 * ERO, LSPA OBJECT objects in PcInitiate message. 1642 * ERO, LSPA OBJECT objects in PcInitiate message.
1642 */ 1643 */
1643 @Test 1644 @Test
1644 - public void initiateMessageTest36() throws PcepParseException { 1645 + public void initiateMessageTest36() throws PcepParseException, PcepOutOfBoundMessageException {
1645 1646
1646 - /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS, 1647 + // SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
1647 - * ERO, LSPA OBJECT. 1648 + // ERO, LSPA OBJECT.
1648 - */ 1649 + //
1649 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58, 1650 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
1650 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1651 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1651 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object 1652 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
......
...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol; ...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol;
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers; 19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Test; 20 import org.junit.Test;
21 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
21 import org.onosproject.pcepio.exceptions.PcepParseException; 22 import org.onosproject.pcepio.exceptions.PcepParseException;
22 23
23 import static org.hamcrest.MatcherAssert.assertThat; 24 import static org.hamcrest.MatcherAssert.assertThat;
...@@ -30,7 +31,7 @@ public class PcepInitiateMsgTest { ...@@ -30,7 +31,7 @@ public class PcepInitiateMsgTest {
30 * This test case checks for srp, lsp, end-point, ERO objects in PcInitiate message. 31 * This test case checks for srp, lsp, end-point, ERO objects in PcInitiate message.
31 */ 32 */
32 @Test 33 @Test
33 - public void initiateMessageTest1() throws PcepParseException { 34 + public void initiateMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
34 35
35 /* srp, lsp, end-point, ERO. 36 /* srp, lsp, end-point, ERO.
36 */ 37 */
...@@ -75,7 +76,7 @@ public class PcepInitiateMsgTest { ...@@ -75,7 +76,7 @@ public class PcepInitiateMsgTest {
75 * This test case checks for srp and lsp objects in PcInitiate message. 76 * This test case checks for srp and lsp objects in PcInitiate message.
76 */ 77 */
77 @Test 78 @Test
78 - public void initiateMessageTest2() throws PcepParseException { 79 + public void initiateMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
79 /* srp, lsp. 80 /* srp, lsp.
80 */ 81 */
81 byte[] initiateDeletionMsg = new byte[]{0x20, 0x0C, 0x00, 0x34, 82 byte[] initiateDeletionMsg = new byte[]{0x20, 0x0C, 0x00, 0x34,
...@@ -115,7 +116,7 @@ public class PcepInitiateMsgTest { ...@@ -115,7 +116,7 @@ public class PcepInitiateMsgTest {
115 * in PcInitiate message. 116 * in PcInitiate message.
116 */ 117 */
117 @Test 118 @Test
118 - public void initiateMessageTest3() throws PcepParseException { 119 + public void initiateMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
119 120
120 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, 121 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
121 * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO. 122 * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO.
...@@ -162,7 +163,7 @@ public class PcepInitiateMsgTest { ...@@ -162,7 +163,7 @@ public class PcepInitiateMsgTest {
162 * StatefulLspErrorCodeTlv), END-POINT, ERO objects in PcInitiate message. 163 * StatefulLspErrorCodeTlv), END-POINT, ERO objects in PcInitiate message.
163 */ 164 */
164 @Test 165 @Test
165 - public void initiateMessageTest4() throws PcepParseException { 166 + public void initiateMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
166 167
167 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, 168 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
168 * StatefulLspErrorCodeTlv), END-POINT, ERO. 169 * StatefulLspErrorCodeTlv), END-POINT, ERO.
...@@ -208,7 +209,7 @@ public class PcepInitiateMsgTest { ...@@ -208,7 +209,7 @@ public class PcepInitiateMsgTest {
208 * END-POINT, ERO objects in PcInitiate message. 209 * END-POINT, ERO objects in PcInitiate message.
209 */ 210 */
210 @Test 211 @Test
211 - public void initiateMessageTest5() throws PcepParseException { 212 + public void initiateMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
212 213
213 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv), 214 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
214 * END-POINT, ERO. 215 * END-POINT, ERO.
...@@ -255,7 +256,7 @@ public class PcepInitiateMsgTest { ...@@ -255,7 +256,7 @@ public class PcepInitiateMsgTest {
255 * END-POINT, ERO objects in PcInitiate message. 256 * END-POINT, ERO objects in PcInitiate message.
256 */ 257 */
257 @Test 258 @Test
258 - public void initiateMessageTest6() throws PcepParseException { 259 + public void initiateMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
259 260
260 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv), 261 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
261 * END-POINT, ERO. 262 * END-POINT, ERO.
...@@ -303,7 +304,7 @@ public class PcepInitiateMsgTest { ...@@ -303,7 +304,7 @@ public class PcepInitiateMsgTest {
303 * END-POINT, ERO objects in PcInitiate message. 304 * END-POINT, ERO objects in PcInitiate message.
304 */ 305 */
305 @Test 306 @Test
306 - public void initiateMessageTest7() throws PcepParseException { 307 + public void initiateMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
307 308
308 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), 309 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
309 * END-POINT, ERO. 310 * END-POINT, ERO.
...@@ -350,7 +351,7 @@ public class PcepInitiateMsgTest { ...@@ -350,7 +351,7 @@ public class PcepInitiateMsgTest {
350 * END-POINT, ERO objects in PcInitiate message. 351 * END-POINT, ERO objects in PcInitiate message.
351 */ 352 */
352 @Test 353 @Test
353 - public void initiateMessageTest8() throws PcepParseException { 354 + public void initiateMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
354 355
355 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), 356 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv),
356 * END-POINT, ERO. 357 * END-POINT, ERO.
...@@ -396,7 +397,7 @@ public class PcepInitiateMsgTest { ...@@ -396,7 +397,7 @@ public class PcepInitiateMsgTest {
396 * END-POINT, ERO objects in PcInitiate message. 397 * END-POINT, ERO objects in PcInitiate message.
397 */ 398 */
398 @Test 399 @Test
399 - public void initiateMessageTest9() throws PcepParseException { 400 + public void initiateMessageTest9() throws PcepParseException, PcepOutOfBoundMessageException {
400 401
401 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), 402 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv),
402 * END-POINT, ERO. 403 * END-POINT, ERO.
...@@ -440,7 +441,7 @@ public class PcepInitiateMsgTest { ...@@ -440,7 +441,7 @@ public class PcepInitiateMsgTest {
440 * objects in PcInitiate message. 441 * objects in PcInitiate message.
441 */ 442 */
442 @Test 443 @Test
443 - public void initiateMessageTest10() throws PcepParseException { 444 + public void initiateMessageTest10() throws PcepParseException, PcepOutOfBoundMessageException {
444 445
445 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, StatefulRsvpErrorSpecTlv). 446 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, StatefulRsvpErrorSpecTlv).
446 */ 447 */
...@@ -484,7 +485,7 @@ public class PcepInitiateMsgTest { ...@@ -484,7 +485,7 @@ public class PcepInitiateMsgTest {
484 * StatefulLspErrorCodeTlv) objects in PcInitiate message. 485 * StatefulLspErrorCodeTlv) objects in PcInitiate message.
485 */ 486 */
486 @Test 487 @Test
487 - public void initiateMessageTest11() throws PcepParseException { 488 + public void initiateMessageTest11() throws PcepParseException, PcepOutOfBoundMessageException {
488 489
489 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, 490 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
490 StatefulLspErrorCodeTlv).*/ 491 StatefulLspErrorCodeTlv).*/
...@@ -528,7 +529,7 @@ public class PcepInitiateMsgTest { ...@@ -528,7 +529,7 @@ public class PcepInitiateMsgTest {
528 * objects in PcInitiate message. 529 * objects in PcInitiate message.
529 */ 530 */
530 @Test 531 @Test
531 - public void initiateMessageTest12() throws PcepParseException { 532 + public void initiateMessageTest12() throws PcepParseException, PcepOutOfBoundMessageException {
532 533
533 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv). 534 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv).
534 */ 535 */
...@@ -571,7 +572,7 @@ public class PcepInitiateMsgTest { ...@@ -571,7 +572,7 @@ public class PcepInitiateMsgTest {
571 * objects in PcInitiate message. 572 * objects in PcInitiate message.
572 */ 573 */
573 @Test 574 @Test
574 - public void initiateMessageTest13() throws PcepParseException { 575 + public void initiateMessageTest13() throws PcepParseException, PcepOutOfBoundMessageException {
575 576
576 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv). 577 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv).
577 */ 578 */
...@@ -613,7 +614,7 @@ public class PcepInitiateMsgTest { ...@@ -613,7 +614,7 @@ public class PcepInitiateMsgTest {
613 * objects in PcInitiate message. 614 * objects in PcInitiate message.
614 */ 615 */
615 @Test 616 @Test
616 - public void initiateMessageTest14() throws PcepParseException { 617 + public void initiateMessageTest14() throws PcepParseException, PcepOutOfBoundMessageException {
617 618
618 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv). 619 /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv).
619 */ 620 */
...@@ -655,7 +656,7 @@ public class PcepInitiateMsgTest { ...@@ -655,7 +656,7 @@ public class PcepInitiateMsgTest {
655 * objects in PcInitiate message. 656 * objects in PcInitiate message.
656 */ 657 */
657 @Test 658 @Test
658 - public void initiateMessageTest15() throws PcepParseException { 659 + public void initiateMessageTest15() throws PcepParseException, PcepOutOfBoundMessageException {
659 660
660 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv). 661 /* SRP, LSP (StatefulIPv4LspIdentidiersTlv).
661 */ 662 */
...@@ -696,7 +697,7 @@ public class PcepInitiateMsgTest { ...@@ -696,7 +697,7 @@ public class PcepInitiateMsgTest {
696 * objects in PcInitiate message. 697 * objects in PcInitiate message.
697 */ 698 */
698 @Test 699 @Test
699 - public void initiateMessageTest16() throws PcepParseException { 700 + public void initiateMessageTest16() throws PcepParseException, PcepOutOfBoundMessageException {
700 701
701 //srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa 702 //srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa
702 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50, 703 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50,
...@@ -740,7 +741,7 @@ public class PcepInitiateMsgTest { ...@@ -740,7 +741,7 @@ public class PcepInitiateMsgTest {
740 * objects in PcInitiate message. 741 * objects in PcInitiate message.
741 */ 742 */
742 @Test 743 @Test
743 - public void initiateMessageTest17() throws PcepParseException { 744 + public void initiateMessageTest17() throws PcepParseException, PcepOutOfBoundMessageException {
744 745
745 //srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth 746 //srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth
746 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58, 747 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
...@@ -784,7 +785,7 @@ public class PcepInitiateMsgTest { ...@@ -784,7 +785,7 @@ public class PcepInitiateMsgTest {
784 * objects in PcInitiate message. 785 * objects in PcInitiate message.
785 */ 786 */
786 @Test 787 @Test
787 - public void initiateMessageTest18() throws PcepParseException { 788 + public void initiateMessageTest18() throws PcepParseException, PcepOutOfBoundMessageException {
788 //srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth,metric-list 789 //srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth,metric-list
789 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64, 790 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64,
790 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 791 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -829,7 +830,7 @@ public class PcepInitiateMsgTest { ...@@ -829,7 +830,7 @@ public class PcepInitiateMsgTest {
829 * objects in PcInitiate message. 830 * objects in PcInitiate message.
830 */ 831 */
831 @Test 832 @Test
832 - public void initiateMessageTest19() throws PcepParseException { 833 + public void initiateMessageTest19() throws PcepParseException, PcepOutOfBoundMessageException {
833 //srp,lsp(all tlvs),end-point,ero,lspa,bandwidth,metric-list 834 //srp,lsp(all tlvs),end-point,ero,lspa,bandwidth,metric-list
834 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x74, 835 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x74,
835 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 836 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -876,7 +877,7 @@ public class PcepInitiateMsgTest { ...@@ -876,7 +877,7 @@ public class PcepInitiateMsgTest {
876 * lsp(SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv) objects in PcInitiate message. 877 * lsp(SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv) objects in PcInitiate message.
877 */ 878 */
878 @Test 879 @Test
879 - public void initiateMessageTest20() throws PcepParseException { 880 + public void initiateMessageTest20() throws PcepParseException, PcepOutOfBoundMessageException {
880 /* srp,lsp (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, srp, 881 /* srp,lsp (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, srp,
881 * lsp(SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv). 882 * lsp(SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv).
882 */ 883 */
...@@ -924,7 +925,7 @@ public class PcepInitiateMsgTest { ...@@ -924,7 +925,7 @@ public class PcepInitiateMsgTest {
924 * objects in PcInitiate message. 925 * objects in PcInitiate message.
925 */ 926 */
926 @Test 927 @Test
927 - public void initiateMessageTest21() throws PcepParseException { 928 + public void initiateMessageTest21() throws PcepParseException, PcepOutOfBoundMessageException {
928 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero, 929 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
929 * srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero 930 * srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero
930 */ 931 */
...@@ -978,7 +979,7 @@ public class PcepInitiateMsgTest { ...@@ -978,7 +979,7 @@ public class PcepInitiateMsgTest {
978 * objects in PcInitiate message. 979 * objects in PcInitiate message.
979 */ 980 */
980 @Test 981 @Test
981 - public void initiateMessageTest22() throws PcepParseException { 982 + public void initiateMessageTest22() throws PcepParseException, PcepOutOfBoundMessageException {
982 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero, 983 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
983 * srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa 984 * srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa
984 */ 985 */
...@@ -1033,7 +1034,7 @@ public class PcepInitiateMsgTest { ...@@ -1033,7 +1034,7 @@ public class PcepInitiateMsgTest {
1033 * objects in PcInitiate message. 1034 * objects in PcInitiate message.
1034 */ 1035 */
1035 @Test 1036 @Test
1036 - public void initiateMessageTest23() throws PcepParseException { 1037 + public void initiateMessageTest23() throws PcepParseException, PcepOutOfBoundMessageException {
1037 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero, 1038 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
1038 * srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth 1039 * srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth
1039 */ 1040 */
...@@ -1090,7 +1091,7 @@ public class PcepInitiateMsgTest { ...@@ -1090,7 +1091,7 @@ public class PcepInitiateMsgTest {
1090 * objects in PcInitiate message. 1091 * objects in PcInitiate message.
1091 */ 1092 */
1092 @Test 1093 @Test
1093 - public void initiateMessageTest24() throws PcepParseException { 1094 + public void initiateMessageTest24() throws PcepParseException, PcepOutOfBoundMessageException {
1094 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero, 1095 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
1095 * srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth*/ 1096 * srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth*/
1096 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xBC, 1097 byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xBC,
...@@ -1148,7 +1149,7 @@ public class PcepInitiateMsgTest { ...@@ -1148,7 +1149,7 @@ public class PcepInitiateMsgTest {
1148 * objects in PcInitiate message. 1149 * objects in PcInitiate message.
1149 */ 1150 */
1150 @Test 1151 @Test
1151 - public void initiateMessageTest25() throws PcepParseException { 1152 + public void initiateMessageTest25() throws PcepParseException, PcepOutOfBoundMessageException {
1152 1153
1153 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,bandwidth, 1154 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,bandwidth,
1154 * srp,lsp(StatefulIPv4LspIdentidiersTlv), 1155 * srp,lsp(StatefulIPv4LspIdentidiersTlv),
...@@ -1209,7 +1210,7 @@ public class PcepInitiateMsgTest { ...@@ -1209,7 +1210,7 @@ public class PcepInitiateMsgTest {
1209 * objects in PcInitiate message. 1210 * objects in PcInitiate message.
1210 */ 1211 */
1211 @Test 1212 @Test
1212 - public void initiateMessageTest26() throws PcepParseException { 1213 + public void initiateMessageTest26() throws PcepParseException, PcepOutOfBoundMessageException {
1213 1214
1214 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,bandwidth,metric-list, 1215 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,bandwidth,metric-list,
1215 * srp,lsp(StatefulIPv4LspIdentidiersTlv), 1216 * srp,lsp(StatefulIPv4LspIdentidiersTlv),
...@@ -1271,7 +1272,7 @@ public class PcepInitiateMsgTest { ...@@ -1271,7 +1272,7 @@ public class PcepInitiateMsgTest {
1271 * objects in PcInitiate message. 1272 * objects in PcInitiate message.
1272 */ 1273 */
1273 @Test 1274 @Test
1274 - public void initiateMessageTest27() throws PcepParseException { 1275 + public void initiateMessageTest27() throws PcepParseException, PcepOutOfBoundMessageException {
1275 1276
1276 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth,metric-list, 1277 /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth,metric-list,
1277 * srp,lsp(StatefulIPv4LspIdentidiersTlv), 1278 * srp,lsp(StatefulIPv4LspIdentidiersTlv),
......
...@@ -19,6 +19,7 @@ import org.jboss.netty.buffer.ChannelBuffer; ...@@ -19,6 +19,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers; 19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Assert; 20 import org.junit.Assert;
21 import org.junit.Test; 21 import org.junit.Test;
22 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
22 import org.onosproject.pcepio.exceptions.PcepParseException; 23 import org.onosproject.pcepio.exceptions.PcepParseException;
23 24
24 import static org.hamcrest.MatcherAssert.assertThat; 25 import static org.hamcrest.MatcherAssert.assertThat;
...@@ -31,7 +32,7 @@ public class PcepKeepaliveMsgTest { ...@@ -31,7 +32,7 @@ public class PcepKeepaliveMsgTest {
31 * Common header for keep alive message. 32 * Common header for keep alive message.
32 */ 33 */
33 @Test 34 @Test
34 - public void keepaliveMessageTest1() throws PcepParseException { 35 + public void keepaliveMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
35 36
36 byte[] keepaliveMsg = new byte[] {0x20, 0x02, 0x00, 0x04 }; 37 byte[] keepaliveMsg = new byte[] {0x20, 0x02, 0x00, 0x04 };
37 38
......
1 +/*
2 + * Copyright 2014-2015 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +package org.onosproject.pcepio.protocol;
17 +
18 +import org.jboss.netty.buffer.ChannelBuffer;
19 +import org.jboss.netty.buffer.ChannelBuffers;
20 +import org.junit.Test;
21 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
22 +import org.onosproject.pcepio.exceptions.PcepParseException;
23 +
24 +import static org.hamcrest.MatcherAssert.assertThat;
25 +import static org.hamcrest.Matchers.instanceOf;
26 +import static org.hamcrest.core.Is.is;
27 +
28 +public class PcepLSReportMsgTest {
29 +
30 + /**
31 + * This test case checks for
32 + * LS Object (Routing Universe TLV, Local Node Descriptors TLV(AutonomousSystemSubTlv)).
33 + * in PcLSRpt message.
34 + */
35 + @Test
36 + public void lsReportMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
37 +
38 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x2C, // common header
39 + (byte) 0xE0, 0x10, 0x00, 0x28, // LS Object Header
40 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
41 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
42 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
43 + (byte) 0xFF, 0x02, 0x00, 0x08, // Local Node Descriptors TLV
44 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystem Tlv
45 + 0x00, 0x00, 0x00, 0x11};
46 +
47 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
48 + buffer.writeBytes(lsReportMsg);
49 +
50 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
51 + PcepMessage message = null;
52 +
53 + message = reader.readFrom(buffer);
54 +
55 + byte[] testReportMsg = {0};
56 +
57 + assertThat(message, instanceOf(PcepLSReportMsg.class));
58 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
59 + message.writeTo(buf);
60 +
61 + int readLen = buf.writerIndex();
62 + testReportMsg = new byte[readLen];
63 + buf.readBytes(testReportMsg, 0, readLen);
64 +
65 + assertThat(testReportMsg, is(lsReportMsg));
66 + }
67 +
68 + /**
69 + * This test case checks for
70 + * LS Object (Routing Universe TLV, Local Node Descriptors TLV(AutonomousSystemSubTlv)) with different LS-ID.
71 + * in PcLSRpt message.
72 + */
73 + @Test
74 + public void lsReportMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
75 +
76 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x2C, // common header
77 + (byte) 0xE0, 0x10, 0x00, 0x28, // LS Object Header
78 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
79 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
80 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
81 + (byte) 0xFF, 0x02, 0x00, 0x08, // Local Node Descriptors TLV
82 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
83 + 0x00, 0x00, 0x00, 0x11};
84 +
85 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
86 + buffer.writeBytes(lsReportMsg);
87 +
88 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
89 + PcepMessage message = null;
90 +
91 + message = reader.readFrom(buffer);
92 +
93 + byte[] testReportMsg = {0};
94 + assertThat(message, instanceOf(PcepLSReportMsg.class));
95 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
96 + message.writeTo(buf);
97 +
98 + int readLen = buf.writerIndex();
99 + testReportMsg = new byte[readLen];
100 + buf.readBytes(testReportMsg, 0, readLen);
101 +
102 + assertThat(testReportMsg, is(lsReportMsg));
103 + }
104 +
105 + /**
106 + * This test case checks for LS Object (Routing Universe TLV)
107 + * in PcLSRpt message.
108 + */
109 + @Test
110 + public void lsReportMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
111 +
112 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x20, // common header
113 + (byte) 0xE0, 0x10, 0x00, 0x1C, // LS Object Header
114 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
115 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
116 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
117 +
118 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
119 + buffer.writeBytes(lsReportMsg);
120 +
121 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
122 + PcepMessage message = null;
123 +
124 + message = reader.readFrom(buffer);
125 +
126 + byte[] testReportMsg = {0};
127 + assertThat(message, instanceOf(PcepLSReportMsg.class));
128 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
129 + message.writeTo(buf);
130 +
131 + int readLen = buf.writerIndex();
132 + testReportMsg = new byte[readLen];
133 + buf.readBytes(testReportMsg, 0, readLen);
134 +
135 + assertThat(testReportMsg, is(lsReportMsg));
136 + }
137 +
138 + /**
139 + * This test case checks for
140 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv.
141 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv)).
142 + * in PcLSRpt message.
143 + */
144 + @Test
145 + public void lsReportMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
146 +
147 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x48, // common header
148 + (byte) 0xE0, 0x10, 0x00, 0x44, // LS Object Header
149 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
150 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
151 + 0x00, 0x00, 0x00, 0x00,
152 + 0x00, 0x00, 0x00, 0x01,
153 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
154 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
155 + 0x00, 0x00, 0x00, 0x11,
156 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
157 + 0x00, 0x00, 0x00, 0x11,
158 + 0x00, 0x03, 0x00, 0x04, //OspfAreaIdSubTlv
159 + 0x00, 0x00, 0x00, 0x11,
160 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
161 + 0x00, 0x00, 0x00, 0x11,
162 + 0x00, 0x00, 0x00, 0x11};
163 +
164 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
165 + buffer.writeBytes(lsReportMsg);
166 +
167 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
168 + PcepMessage message = null;
169 +
170 + message = reader.readFrom(buffer);
171 +
172 + byte[] testReportMsg = {0};
173 + assertThat(message, instanceOf(PcepLSReportMsg.class));
174 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
175 + message.writeTo(buf);
176 +
177 + int readLen = buf.writerIndex();
178 + testReportMsg = new byte[readLen];
179 + buf.readBytes(testReportMsg, 0, readLen);
180 +
181 + assertThat(testReportMsg, is(lsReportMsg));
182 + }
183 +
184 + /**
185 + * This test case checks for
186 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(BGPLSidentifierSubTlv
187 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv))
188 + * in PcLSRpt message.
189 + */
190 + @Test
191 + public void lsReportMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
192 +
193 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x40, // common header
194 + (byte) 0xE0, 0x10, 0x00, 0x3C, // LS Object Header
195 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
196 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
197 + 0x00, 0x00, 0x00, 0x00,
198 + 0x00, 0x00, 0x00, 0x01,
199 + (byte) 0xFF, 0x02, 0x00, 0x1C, // Local Node Descriptors TLV
200 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
201 + 0x00, 0x00, 0x00, 0x11,
202 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
203 + 0x00, 0x00, 0x00, 0x11,
204 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
205 + 0x00, 0x00, 0x00, 0x11,
206 + 0x00, 0x00, 0x00, 0x11};
207 +
208 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
209 + buffer.writeBytes(lsReportMsg);
210 +
211 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
212 + PcepMessage message = null;
213 +
214 + message = reader.readFrom(buffer);
215 +
216 + byte[] testReportMsg = {0};
217 + assertThat(message, instanceOf(PcepLSReportMsg.class));
218 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
219 + message.writeTo(buf);
220 +
221 + int readLen = buf.writerIndex();
222 + testReportMsg = new byte[readLen];
223 + buf.readBytes(testReportMsg, 0, readLen);
224 +
225 + assertThat(testReportMsg, is(lsReportMsg));
226 + }
227 +
228 + /**
229 + * This test case checks for LS Object (Routing Universe TLV,Local Node Descriptors TLV(OSPFareaIDsubTlv,
230 + * IgpRouterIdSubTlv))
231 + * in PcLSRpt message.
232 + */
233 + @Test
234 + public void lsReportMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
235 +
236 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x38, // common header
237 + (byte) 0xE0, 0x10, 0x00, 0x34, // LS Object Header
238 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
239 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
240 + 0x00, 0x00, 0x00, 0x00,
241 + 0x00, 0x00, 0x00, 0x01,
242 + (byte) 0xFF, 0x02, 0x00, 0x14, // Local Node Descriptors TLV
243 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
244 + 0x00, 0x00, 0x00, 0x11,
245 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
246 + 0x00, 0x00, 0x00, 0x11,
247 + 0x00, 0x00, 0x00, 0x11};
248 +
249 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
250 + buffer.writeBytes(lsReportMsg);
251 +
252 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
253 + PcepMessage message = null;
254 +
255 + message = reader.readFrom(buffer);
256 +
257 + byte[] testReportMsg = {0};
258 + assertThat(message, instanceOf(PcepLSReportMsg.class));
259 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
260 + message.writeTo(buf);
261 +
262 + int readLen = buf.writerIndex();
263 + testReportMsg = new byte[readLen];
264 + buf.readBytes(testReportMsg, 0, readLen);
265 +
266 + assertThat(testReportMsg, is(lsReportMsg));
267 + }
268 +
269 + /**
270 + * This test case checks for LS Object (Routing Universe TLV,Local Node Descriptors TLV(IgpRouterIdSubTlv)).
271 + * in PcLSRpt message.
272 + */
273 + @Test
274 + public void lsReportMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
275 +
276 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x30, // common header
277 + (byte) 0xE0, 0x10, 0x00, 0x2C, // LS Object Header
278 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
279 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
280 + 0x00, 0x00, 0x00, 0x00,
281 + 0x00, 0x00, 0x00, 0x01,
282 + (byte) 0xFF, 0x02, 0x00, 0x0C, // Local Node Descriptors TLV
283 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
284 + 0x00, 0x00, 0x00, 0x11,
285 + 0x00, 0x00, 0x00, 0x11};
286 +
287 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
288 + buffer.writeBytes(lsReportMsg);
289 +
290 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
291 + PcepMessage message = null;
292 +
293 + message = reader.readFrom(buffer);
294 +
295 + byte[] testReportMsg = {0};
296 + assertThat(message, instanceOf(PcepLSReportMsg.class));
297 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
298 + message.writeTo(buf);
299 +
300 + int readLen = buf.writerIndex();
301 + testReportMsg = new byte[readLen];
302 + buf.readBytes(testReportMsg, 0, readLen);
303 +
304 + assertThat(testReportMsg, is(lsReportMsg));
305 + }
306 +
307 + /**
308 + * This test case checks for LS Object (Routing Universe TLV,Local Node Descriptors TLV)
309 + * in PcLSRpt message.
310 + */
311 + @Test
312 + public void lsReportMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
313 +
314 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x24, // common header
315 + (byte) 0xE0, 0x10, 0x00, 0x20, // LS Object Header
316 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
317 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
318 + 0x00, 0x00, 0x00, 0x00,
319 + 0x00, 0x00, 0x00, 0x01,
320 + (byte) 0xFF, 0x02, 0x00, 0x00 // Local Node Descriptors TLV
321 + };
322 +
323 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
324 + buffer.writeBytes(lsReportMsg);
325 +
326 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
327 + PcepMessage message = null;
328 +
329 + message = reader.readFrom(buffer);
330 +
331 + byte[] testReportMsg = {0};
332 + assertThat(message, instanceOf(PcepLSReportMsg.class));
333 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
334 + message.writeTo(buf);
335 +
336 + int readLen = buf.writerIndex();
337 + testReportMsg = new byte[readLen];
338 + buf.readBytes(testReportMsg, 0, readLen);
339 +
340 + assertThat(testReportMsg, is(lsReportMsg));
341 + }
342 +
343 + /**
344 + * This test case checks for
345 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv.
346 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv.
347 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv)).
348 + * in PcLSRpt message.
349 + */
350 + @Test
351 + public void lsReportMessageTest9() throws PcepParseException, PcepOutOfBoundMessageException {
352 +
353 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x70, // common header
354 + (byte) 0xE0, 0x10, 0x00, 0x6C, // LS Object Header
355 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
356 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
357 + 0x00, 0x00, 0x00, 0x00,
358 + 0x00, 0x00, 0x00, 0x01,
359 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
360 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
361 + 0x00, 0x00, 0x00, 0x11,
362 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
363 + 0x00, 0x00, 0x00, 0x11,
364 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
365 + 0x00, 0x00, 0x00, 0x11,
366 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
367 + 0x00, 0x00, 0x00, 0x11,
368 + 0x00, 0x00, 0x00, 0x11,
369 + (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
370 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
371 + 0x00, 0x00, 0x00, 0x11,
372 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
373 + 0x00, 0x00, 0x00, 0x11,
374 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
375 + 0x00, 0x00, 0x00, 0x11,
376 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
377 + 0x00, 0x00, 0x00, 0x11,
378 + 0x00, 0x00, 0x00, 0x11
379 + };
380 +
381 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
382 + buffer.writeBytes(lsReportMsg);
383 +
384 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
385 + PcepMessage message = null;
386 +
387 + message = reader.readFrom(buffer);
388 +
389 + byte[] testReportMsg = {0};
390 + assertThat(message, instanceOf(PcepLSReportMsg.class));
391 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
392 + message.writeTo(buf);
393 +
394 + int readLen = buf.writerIndex();
395 + testReportMsg = new byte[readLen];
396 + buf.readBytes(testReportMsg, 0, readLen);
397 +
398 + assertThat(testReportMsg, is(lsReportMsg));
399 + }
400 +
401 + /**
402 + * This test case checks for
403 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
404 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(BGPLSidentifierSubTlv
405 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv))
406 + * in PcLSRpt message.
407 + */
408 + @Test
409 + public void lsReportMessageTest10() throws PcepParseException, PcepOutOfBoundMessageException {
410 +
411 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x68, // common header
412 + (byte) 0xE0, 0x10, 0x00, 0x64, // LS Object Header
413 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
414 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
415 + 0x00, 0x00, 0x00, 0x00,
416 + 0x00, 0x00, 0x00, 0x01,
417 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
418 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
419 + 0x00, 0x00, 0x00, 0x11,
420 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
421 + 0x00, 0x00, 0x00, 0x11,
422 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
423 + 0x00, 0x00, 0x00, 0x11,
424 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
425 + 0x00, 0x00, 0x00, 0x11,
426 + 0x00, 0x00, 0x00, 0x11,
427 + (byte) 0xFF, 0x03, 0x00, 0x1C, //RemoteNodeDescriptorsTLV
428 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
429 + 0x00, 0x00, 0x00, 0x11,
430 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
431 + 0x00, 0x00, 0x00, 0x11,
432 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
433 + 0x00, 0x00, 0x00, 0x11,
434 + 0x00, 0x00, 0x00, 0x11
435 + };
436 +
437 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
438 + buffer.writeBytes(lsReportMsg);
439 +
440 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
441 + PcepMessage message = null;
442 +
443 + message = reader.readFrom(buffer);
444 +
445 + byte[] testReportMsg = {0};
446 + assertThat(message, instanceOf(PcepLSReportMsg.class));
447 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
448 + message.writeTo(buf);
449 +
450 + int readLen = buf.writerIndex();
451 + testReportMsg = new byte[readLen];
452 + buf.readBytes(testReportMsg, 0, readLen);
453 +
454 + assertThat(testReportMsg, is(lsReportMsg));
455 + }
456 +
457 + /**
458 + * This test case checks for
459 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
460 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(OSPFareaIDsubTlv, IgpRouterIdSubTlv))
461 + * in PcLSRpt message.
462 + */
463 + @Test
464 + public void lsReportMessageTest11() throws PcepParseException, PcepOutOfBoundMessageException {
465 +
466 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x60, // common header
467 + (byte) 0xE0, 0x10, 0x00, 0x5C, // LS Object Header
468 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
469 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
470 + 0x00, 0x00, 0x00, 0x00,
471 + 0x00, 0x00, 0x00, 0x01,
472 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
473 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
474 + 0x00, 0x00, 0x00, 0x11,
475 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
476 + 0x00, 0x00, 0x00, 0x11,
477 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
478 + 0x00, 0x00, 0x00, 0x11,
479 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
480 + 0x00, 0x00, 0x00, 0x11,
481 + 0x00, 0x00, 0x00, 0x11,
482 + (byte) 0xFF, 0x03, 0x00, 0x14, //RemoteNodeDescriptorsTLV
483 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
484 + 0x00, 0x00, 0x00, 0x11,
485 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
486 + 0x00, 0x00, 0x00, 0x11,
487 + 0x00, 0x00, 0x00, 0x11
488 + };
489 +
490 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
491 + buffer.writeBytes(lsReportMsg);
492 +
493 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
494 + PcepMessage message = null;
495 +
496 + message = reader.readFrom(buffer);
497 +
498 + byte[] testReportMsg = {0};
499 + assertThat(message, instanceOf(PcepLSReportMsg.class));
500 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
501 + message.writeTo(buf);
502 +
503 + int readLen = buf.writerIndex();
504 + testReportMsg = new byte[readLen];
505 + buf.readBytes(testReportMsg, 0, readLen);
506 +
507 + assertThat(testReportMsg, is(lsReportMsg));
508 + }
509 +
510 + /**
511 + * This test case checks for
512 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
513 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(IgpRouterIdSubTlv))
514 + * in PcLSRpt message.
515 + */
516 + @Test
517 + public void lsReportMessageTest12() throws PcepParseException, PcepOutOfBoundMessageException {
518 +
519 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x58, // common header
520 + (byte) 0xE0, 0x10, 0x00, 0x54, // LS Object Header
521 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
522 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
523 + 0x00, 0x00, 0x00, 0x00,
524 + 0x00, 0x00, 0x00, 0x01,
525 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
526 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
527 + 0x00, 0x00, 0x00, 0x11,
528 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
529 + 0x00, 0x00, 0x00, 0x11,
530 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
531 + 0x00, 0x00, 0x00, 0x11,
532 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
533 + 0x00, 0x00, 0x00, 0x11,
534 + 0x00, 0x00, 0x00, 0x11,
535 + (byte) 0xFF, 0x03, 0x00, 0x0c, //RemoteNodeDescriptorsTLV
536 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
537 + 0x00, 0x00, 0x00, 0x11,
538 + 0x00, 0x00, 0x00, 0x11
539 + };
540 +
541 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
542 + buffer.writeBytes(lsReportMsg);
543 +
544 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
545 + PcepMessage message = null;
546 +
547 + message = reader.readFrom(buffer);
548 +
549 + byte[] testReportMsg = {0};
550 + assertThat(message, instanceOf(PcepLSReportMsg.class));
551 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
552 + message.writeTo(buf);
553 +
554 + int readLen = buf.writerIndex();
555 + testReportMsg = new byte[readLen];
556 + buf.readBytes(testReportMsg, 0, readLen);
557 +
558 + assertThat(testReportMsg, is(lsReportMsg));
559 + }
560 +
561 + /**
562 + * This test case checks for
563 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
564 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV)
565 + * in PcLSRpt message.
566 + */
567 + @Test
568 + public void lsReportMessageTest13() throws PcepParseException, PcepOutOfBoundMessageException {
569 +
570 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x4C, // common header
571 + (byte) 0xE0, 0x10, 0x00, 0x48, // LS Object Header
572 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
573 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
574 + 0x00, 0x00, 0x00, 0x00,
575 + 0x00, 0x00, 0x00, 0x01,
576 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
577 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
578 + 0x00, 0x00, 0x00, 0x11,
579 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
580 + 0x00, 0x00, 0x00, 0x11,
581 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
582 + 0x00, 0x00, 0x00, 0x11,
583 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
584 + 0x00, 0x00, 0x00, 0x11,
585 + 0x00, 0x00, 0x00, 0x11,
586 + (byte) 0xFF, 0x03, 0x00, 0x00 //RemoteNodeDescriptorsTLV
587 + };
588 +
589 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
590 + buffer.writeBytes(lsReportMsg);
591 +
592 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
593 + PcepMessage message = null;
594 +
595 + message = reader.readFrom(buffer);
596 +
597 + byte[] testReportMsg = {0};
598 + assertThat(message, instanceOf(PcepLSReportMsg.class));
599 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
600 + message.writeTo(buf);
601 +
602 + int readLen = buf.writerIndex();
603 + testReportMsg = new byte[readLen];
604 + buf.readBytes(testReportMsg, 0, readLen);
605 +
606 + assertThat(testReportMsg, is(lsReportMsg));
607 + }
608 +
609 + /**
610 + * This test case checks for
611 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
612 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
613 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv
614 + * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv))
615 + * in PcLSRpt message.
616 + */
617 + @Test
618 + public void lsReportMessageTest14() throws PcepParseException, PcepOutOfBoundMessageException {
619 +
620 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0x90, // common header
621 + (byte) 0xE0, 0x10, 0x00, (byte) 0x8C, // LS Object Header
622 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
623 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
624 + 0x00, 0x00, 0x00, 0x00,
625 + 0x00, 0x00, 0x00, 0x01,
626 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
627 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
628 + 0x00, 0x00, 0x00, 0x11,
629 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
630 + 0x00, 0x00, 0x00, 0x11,
631 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
632 + 0x00, 0x00, 0x00, 0x11,
633 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
634 + 0x00, 0x00, 0x00, 0x11,
635 + 0x00, 0x00, 0x00, 0x11,
636 + (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
637 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
638 + 0x00, 0x00, 0x00, 0x11,
639 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
640 + 0x00, 0x00, 0x00, 0x11,
641 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
642 + 0x00, 0x00, 0x00, 0x11,
643 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
644 + 0x00, 0x00, 0x00, 0x11,
645 + 0x00, 0x00, 0x00, 0x11,
646 + (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
647 + 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
648 + 0x01, 0x11, 0x00, 0x09,
649 + 0x01, 0x21, 0x00, 0x09,
650 + 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
651 + 0x01, 0x01, 0x01, 0x01,
652 + 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
653 + 0x01, 0x011, 0x01, 0x10
654 + };
655 +
656 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
657 + buffer.writeBytes(lsReportMsg);
658 +
659 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
660 + PcepMessage message = null;
661 +
662 + message = reader.readFrom(buffer);
663 +
664 + byte[] testReportMsg = {0};
665 + assertThat(message, instanceOf(PcepLSReportMsg.class));
666 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
667 + message.writeTo(buf);
668 +
669 + int readLen = buf.writerIndex();
670 + testReportMsg = new byte[readLen];
671 + buf.readBytes(testReportMsg, 0, readLen);
672 +
673 + assertThat(testReportMsg, is(lsReportMsg));
674 + }
675 +
676 + /**
677 + * This test case checks for
678 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
679 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
680 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(
681 + * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv))
682 + * in PcLSRpt message.
683 + */
684 + @Test
685 + public void lsReportMessageTest15() throws PcepParseException, PcepOutOfBoundMessageException {
686 +
687 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0x84, // common header
688 + (byte) 0xE0, 0x10, 0x00, (byte) 0x80, // LS Object Header
689 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
690 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
691 + 0x00, 0x00, 0x00, 0x00,
692 + 0x00, 0x00, 0x00, 0x01,
693 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
694 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
695 + 0x00, 0x00, 0x00, 0x11,
696 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
697 + 0x00, 0x00, 0x00, 0x11,
698 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
699 + 0x00, 0x00, 0x00, 0x11,
700 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
701 + 0x00, 0x00, 0x00, 0x11,
702 + 0x00, 0x00, 0x00, 0x11,
703 + (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
704 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
705 + 0x00, 0x00, 0x00, 0x11,
706 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
707 + 0x00, 0x00, 0x00, 0x11,
708 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
709 + 0x00, 0x00, 0x00, 0x11,
710 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
711 + 0x00, 0x00, 0x00, 0x11,
712 + 0x00, 0x00, 0x00, 0x11,
713 + (byte) 0xFF, 0x04, 0x00, 0x10, //LinkDescriptorsTLV
714 + 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
715 + 0x01, 0x01, 0x01, 0x01,
716 + 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
717 + 0x01, 0x011, 0x01, 0x10
718 + };
719 +
720 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
721 + buffer.writeBytes(lsReportMsg);
722 +
723 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
724 + PcepMessage message = null;
725 +
726 + message = reader.readFrom(buffer);
727 +
728 + byte[] testReportMsg = {0};
729 + assertThat(message, instanceOf(PcepLSReportMsg.class));
730 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
731 + message.writeTo(buf);
732 +
733 + int readLen = buf.writerIndex();
734 + testReportMsg = new byte[readLen];
735 + buf.readBytes(testReportMsg, 0, readLen);
736 +
737 + assertThat(testReportMsg, is(lsReportMsg));
738 + }
739 +
740 + /**
741 + * This test case checks for
742 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
743 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
744 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(IPv4NeighborAddressSubTlv))
745 + * in PcLSRpt message.
746 + */
747 + @Test
748 + public void lsReportMessageTest16() throws PcepParseException, PcepOutOfBoundMessageException {
749 +
750 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0x7C, // common header
751 + (byte) 0xE0, 0x10, 0x00, (byte) 0x78, // LS Object Header
752 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
753 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
754 + 0x00, 0x00, 0x00, 0x00,
755 + 0x00, 0x00, 0x00, 0x01,
756 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
757 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
758 + 0x00, 0x00, 0x00, 0x11,
759 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
760 + 0x00, 0x00, 0x00, 0x11,
761 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
762 + 0x00, 0x00, 0x00, 0x11,
763 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
764 + 0x00, 0x00, 0x00, 0x11,
765 + 0x00, 0x00, 0x00, 0x11,
766 + (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
767 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
768 + 0x00, 0x00, 0x00, 0x11,
769 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
770 + 0x00, 0x00, 0x00, 0x11,
771 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
772 + 0x00, 0x00, 0x00, 0x11,
773 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
774 + 0x00, 0x00, 0x00, 0x11,
775 + 0x00, 0x00, 0x00, 0x11,
776 + (byte) 0xFF, 0x04, 0x00, 0x08, //LinkDescriptorsTLV
777 + 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
778 + 0x01, 0x011, 0x01, 0x10
779 + };
780 +
781 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
782 + buffer.writeBytes(lsReportMsg);
783 +
784 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
785 + PcepMessage message = null;
786 +
787 + message = reader.readFrom(buffer);
788 +
789 + byte[] testReportMsg = {0};
790 + assertThat(message, instanceOf(PcepLSReportMsg.class));
791 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
792 + message.writeTo(buf);
793 +
794 + int readLen = buf.writerIndex();
795 + testReportMsg = new byte[readLen];
796 + buf.readBytes(testReportMsg, 0, readLen);
797 +
798 + assertThat(testReportMsg, is(lsReportMsg));
799 + }
800 +
801 + /**
802 + * This test case checks for
803 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
804 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
805 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV)
806 + * in PcLSRpt message.
807 + */
808 + @Test
809 + public void lsReportMessageTest17() throws PcepParseException, PcepOutOfBoundMessageException {
810 +
811 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0x74, // common header
812 + (byte) 0xE0, 0x10, 0x00, (byte) 0x70, // LS Object Header
813 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
814 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
815 + 0x00, 0x00, 0x00, 0x00,
816 + 0x00, 0x00, 0x00, 0x01,
817 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
818 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
819 + 0x00, 0x00, 0x00, 0x11,
820 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
821 + 0x00, 0x00, 0x00, 0x11,
822 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
823 + 0x00, 0x00, 0x00, 0x11,
824 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
825 + 0x00, 0x00, 0x00, 0x11,
826 + 0x00, 0x00, 0x00, 0x11,
827 + (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
828 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
829 + 0x00, 0x00, 0x00, 0x11,
830 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
831 + 0x00, 0x00, 0x00, 0x11,
832 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
833 + 0x00, 0x00, 0x00, 0x11,
834 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
835 + 0x00, 0x00, 0x00, 0x11,
836 + 0x00, 0x00, 0x00, 0x11,
837 + (byte) 0xFF, 0x04, 0x00, 0x00, //LinkDescriptorsTLV
838 + };
839 +
840 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
841 + buffer.writeBytes(lsReportMsg);
842 +
843 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
844 + PcepMessage message = null;
845 +
846 + message = reader.readFrom(buffer);
847 +
848 + byte[] testReportMsg = {0};
849 + assertThat(message, instanceOf(PcepLSReportMsg.class));
850 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
851 + message.writeTo(buf);
852 +
853 + int readLen = buf.writerIndex();
854 + testReportMsg = new byte[readLen];
855 + buf.readBytes(testReportMsg, 0, readLen);
856 +
857 + assertThat(testReportMsg, is(lsReportMsg));
858 + }
859 +
860 + /**
861 + * This test case checks for
862 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
863 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
864 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv
865 + * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv))
866 + * in PcLSRpt message.
867 + */
868 + @Test
869 + public void lsReportMessageTest18() throws PcepParseException, PcepOutOfBoundMessageException {
870 +
871 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0xC4, // common header
872 + (byte) 0xE0, 0x10, 0x00, (byte) 0xC0, // LS Object Header
873 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
874 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
875 + 0x00, 0x00, 0x00, 0x00,
876 + 0x00, 0x00, 0x00, 0x01,
877 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
878 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
879 + 0x00, 0x00, 0x00, 0x11,
880 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
881 + 0x00, 0x00, 0x00, 0x11,
882 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
883 + 0x00, 0x00, 0x00, 0x11,
884 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
885 + 0x00, 0x00, 0x00, 0x11,
886 + 0x00, 0x00, 0x00, 0x11,
887 + (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
888 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
889 + 0x00, 0x00, 0x00, 0x11,
890 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
891 + 0x00, 0x00, 0x00, 0x11,
892 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
893 + 0x00, 0x00, 0x00, 0x11,
894 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
895 + 0x00, 0x00, 0x00, 0x11,
896 + 0x00, 0x00, 0x00, 0x11,
897 + (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
898 + 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
899 + 0x01, 0x11, 0x00, 0x09,
900 + 0x01, 0x21, 0x00, 0x09,
901 + 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
902 + 0x01, 0x01, 0x01, 0x01,
903 + 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
904 + 0x01, 0x011, 0x01, 0x10,
905 + (byte) 0xFF, 0x05, 0x00, 0x30, //NodeAttributesTlv
906 + 0x00, 0x0D, 0x00, 0x01, //NodeFlagBitsSubTlv
907 + (byte) 0x90, 0x00, 0x00, 0x00,
908 + 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
909 + 0x01, 0x011, 0x01, 0x10,
910 + 0x00, 0x0F, 0x00, 0x08, //NodeNameSubTlv
911 + 0x08, 0x00, 0x01, 0x09,
912 + 0x08, 0x00, 0x01, 0x09,
913 + 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
914 + 0x20, 0x01, 0x22, 0x01,
915 + 0x20, 0x01, 0x22, 0x01,
916 + 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
917 + 0x00, 0x01, 0x01, 0x02
918 + };
919 +
920 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
921 + buffer.writeBytes(lsReportMsg);
922 +
923 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
924 + PcepMessage message = null;
925 +
926 + message = reader.readFrom(buffer);
927 +
928 + byte[] testReportMsg = {0};
929 + assertThat(message, instanceOf(PcepLSReportMsg.class));
930 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
931 + message.writeTo(buf);
932 +
933 + int readLen = buf.writerIndex();
934 + testReportMsg = new byte[readLen];
935 + buf.readBytes(testReportMsg, 0, readLen);
936 +
937 + assertThat(testReportMsg, is(lsReportMsg));
938 + }
939 +
940 + /**
941 + * This test case checks for
942 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
943 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
944 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv
945 + * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(NodeFlagBitsSubTlv
946 + * OpaqueNodePropertiesSubTlv, NodeNameSubTlv, ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv))
947 + * in PcLSRpt message.
948 + */
949 + @Test
950 + public void lsReportMessageTest19() throws PcepParseException, PcepOutOfBoundMessageException {
951 +
952 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0xC4, // common header
953 + (byte) 0xE0, 0x10, 0x00, (byte) 0xC0, // LS Object Header
954 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
955 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
956 + 0x00, 0x00, 0x00, 0x00,
957 + 0x00, 0x00, 0x00, 0x01,
958 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
959 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
960 + 0x00, 0x00, 0x00, 0x11,
961 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
962 + 0x00, 0x00, 0x00, 0x11,
963 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
964 + 0x00, 0x00, 0x00, 0x11,
965 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
966 + 0x00, 0x00, 0x00, 0x11,
967 + 0x00, 0x00, 0x00, 0x11,
968 + (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
969 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
970 + 0x00, 0x00, 0x00, 0x11,
971 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
972 + 0x00, 0x00, 0x00, 0x11,
973 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
974 + 0x00, 0x00, 0x00, 0x11,
975 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
976 + 0x00, 0x00, 0x00, 0x11,
977 + 0x00, 0x00, 0x00, 0x11,
978 + (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
979 + 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
980 + 0x01, 0x11, 0x00, 0x09,
981 + 0x01, 0x21, 0x00, 0x09,
982 + 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
983 + 0x01, 0x01, 0x01, 0x01,
984 + 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
985 + 0x01, 0x011, 0x01, 0x10,
986 + (byte) 0xFF, 0x05, 0x00, 0x30, //NodeAttributesTlv
987 + 0x00, 0x0D, 0x00, 0x01, //NodeFlagBitsSubTlv
988 + (byte) 0x90, 0x00, 0x00, 0x00,
989 + 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
990 + 0x01, 0x011, 0x01, 0x10,
991 + 0x00, 0x0F, 0x00, 0x08, //NodeNameSubTlv
992 + 0x08, 0x00, 0x01, 0x09,
993 + 0x08, 0x00, 0x01, 0x09,
994 + 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
995 + 0x20, 0x01, 0x22, 0x01,
996 + 0x20, 0x01, 0x22, 0x01,
997 + 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
998 + 0x00, 0x01, 0x01, 0x02
999 + };
1000 +
1001 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1002 + buffer.writeBytes(lsReportMsg);
1003 +
1004 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1005 + PcepMessage message = null;
1006 +
1007 + message = reader.readFrom(buffer);
1008 +
1009 + byte[] testReportMsg = {0};
1010 + assertThat(message, instanceOf(PcepLSReportMsg.class));
1011 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1012 + message.writeTo(buf);
1013 +
1014 + int readLen = buf.writerIndex();
1015 + testReportMsg = new byte[readLen];
1016 + buf.readBytes(testReportMsg, 0, readLen);
1017 +
1018 + assertThat(testReportMsg, is(lsReportMsg));
1019 + }
1020 +
1021 + /**
1022 + * This test case checks for
1023 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
1024 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
1025 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv
1026 + * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(OpaqueNodePropertiesSubTlv
1027 + * NodeNameSubTlv, ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv))
1028 + * in PcLSRpt message.
1029 + */
1030 + @Test
1031 + public void lsReportMessageTest20() throws PcepParseException, PcepOutOfBoundMessageException {
1032 +
1033 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0xBC, // common header
1034 + (byte) 0xE0, 0x10, 0x00, (byte) 0xB8, // LS Object Header
1035 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
1036 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
1037 + 0x00, 0x00, 0x00, 0x00,
1038 + 0x00, 0x00, 0x00, 0x01,
1039 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
1040 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
1041 + 0x00, 0x00, 0x00, 0x11,
1042 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
1043 + 0x00, 0x00, 0x00, 0x11,
1044 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
1045 + 0x00, 0x00, 0x00, 0x11,
1046 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
1047 + 0x00, 0x00, 0x00, 0x11,
1048 + 0x00, 0x00, 0x00, 0x11,
1049 + (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
1050 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
1051 + 0x00, 0x00, 0x00, 0x11,
1052 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
1053 + 0x00, 0x00, 0x00, 0x11,
1054 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
1055 + 0x00, 0x00, 0x00, 0x11,
1056 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
1057 + 0x00, 0x00, 0x00, 0x11,
1058 + 0x00, 0x00, 0x00, 0x11,
1059 + (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
1060 + 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
1061 + 0x01, 0x11, 0x00, 0x09,
1062 + 0x01, 0x21, 0x00, 0x09,
1063 + 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
1064 + 0x01, 0x01, 0x01, 0x01,
1065 + 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
1066 + 0x01, 0x011, 0x01, 0x10,
1067 + (byte) 0xFF, 0x05, 0x00, 0x28, //NodeAttributesTlv
1068 + 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
1069 + 0x01, 0x011, 0x01, 0x10,
1070 + 0x00, 0x0F, 0x00, 0x08, //NodeNameSubTlv
1071 + 0x08, 0x00, 0x01, 0x09,
1072 + 0x08, 0x00, 0x01, 0x09,
1073 + 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
1074 + 0x20, 0x01, 0x22, 0x01,
1075 + 0x20, 0x01, 0x22, 0x01,
1076 + 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
1077 + 0x00, 0x01, 0x01, 0x02
1078 + };
1079 +
1080 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1081 + buffer.writeBytes(lsReportMsg);
1082 +
1083 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1084 + PcepMessage message = null;
1085 +
1086 + message = reader.readFrom(buffer);
1087 +
1088 + byte[] testReportMsg = {0};
1089 + assertThat(message, instanceOf(PcepLSReportMsg.class));
1090 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1091 + message.writeTo(buf);
1092 +
1093 + int readLen = buf.writerIndex();
1094 + testReportMsg = new byte[readLen];
1095 + buf.readBytes(testReportMsg, 0, readLen);
1096 +
1097 + assertThat(testReportMsg, is(lsReportMsg));
1098 + }
1099 +
1100 + /**
1101 + * This test case checks for
1102 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
1103 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
1104 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv.
1105 + * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(OpaqueNodePropertiesSubTlv
1106 + * ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv))
1107 + * in PcLSRpt message.
1108 + */
1109 + @Test
1110 + public void lsReportMessageTest21() throws PcepParseException, PcepOutOfBoundMessageException {
1111 +
1112 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0xB0, // common header
1113 + (byte) 0xE0, 0x10, 0x00, (byte) 0xAC, // LS Object Header
1114 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
1115 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
1116 + 0x00, 0x00, 0x00, 0x00,
1117 + 0x00, 0x00, 0x00, 0x01,
1118 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
1119 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
1120 + 0x00, 0x00, 0x00, 0x11,
1121 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
1122 + 0x00, 0x00, 0x00, 0x11,
1123 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
1124 + 0x00, 0x00, 0x00, 0x11,
1125 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
1126 + 0x00, 0x00, 0x00, 0x11,
1127 + 0x00, 0x00, 0x00, 0x11,
1128 + (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
1129 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
1130 + 0x00, 0x00, 0x00, 0x11,
1131 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
1132 + 0x00, 0x00, 0x00, 0x11,
1133 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
1134 + 0x00, 0x00, 0x00, 0x11,
1135 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
1136 + 0x00, 0x00, 0x00, 0x11,
1137 + 0x00, 0x00, 0x00, 0x11,
1138 + (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
1139 + 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
1140 + 0x01, 0x11, 0x00, 0x09,
1141 + 0x01, 0x21, 0x00, 0x09,
1142 + 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
1143 + 0x01, 0x01, 0x01, 0x01,
1144 + 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
1145 + 0x01, 0x011, 0x01, 0x10,
1146 + (byte) 0xFF, 0x05, 0x00, 0x1C, //NodeAttributesTlv
1147 + 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
1148 + 0x01, 0x011, 0x01, 0x10,
1149 + 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
1150 + 0x20, 0x01, 0x22, 0x01,
1151 + 0x20, 0x01, 0x22, 0x01,
1152 + 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
1153 + 0x00, 0x01, 0x01, 0x02
1154 + };
1155 +
1156 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1157 + buffer.writeBytes(lsReportMsg);
1158 +
1159 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1160 + PcepMessage message = null;
1161 +
1162 + message = reader.readFrom(buffer);
1163 +
1164 + byte[] testReportMsg = {0};
1165 + assertThat(message, instanceOf(PcepLSReportMsg.class));
1166 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1167 + message.writeTo(buf);
1168 +
1169 + int readLen = buf.writerIndex();
1170 + testReportMsg = new byte[readLen];
1171 + buf.readBytes(testReportMsg, 0, readLen);
1172 +
1173 + assertThat(testReportMsg, is(lsReportMsg));
1174 + }
1175 +
1176 + /**
1177 + * This test case checks for
1178 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
1179 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
1180 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv,
1181 + * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(NodeFlagBitsSubTlv,
1182 + * OpaqueNodePropertiesSubTlv, NodeNameSubTlv, ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv),
1183 + * LinkAttributesTlv(IPv4RouterIdOfRemoteNodeSubTlv, IPv6LSRouterIdofRemoteNodeTlv, AdministrativeGroupSubTlv,
1184 + * TEDefaultMetricSubTlv, MaximumLinkBandwidthSubTlv, MaximumReservableLinkBandwidthSubTlv,
1185 + * UnreservedBandwidthSubTlv, LinkProtectionTypeSubTlv, MPLSProtocolMaskSubTlv, IgpMetricSubTlv,
1186 + * SharedRiskLinkGroupSubTlv, OpaqueLinkAttributeSubTlv, LinkNameAttributeSubTlv)).
1187 + * in PcLSRpt message.
1188 + */
1189 + @Test
1190 + public void lsReportMessageTest22() throws PcepParseException, PcepOutOfBoundMessageException {
1191 +
1192 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x01, 0x18, // common header
1193 + (byte) 0xE0, 0x10, 0x01, 0x14, // LS Object Header
1194 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
1195 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
1196 + 0x00, 0x00, 0x00, 0x00,
1197 + 0x00, 0x00, 0x00, 0x01,
1198 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
1199 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
1200 + 0x00, 0x00, 0x00, 0x11,
1201 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
1202 + 0x00, 0x00, 0x00, 0x11,
1203 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
1204 + 0x00, 0x00, 0x00, 0x11,
1205 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
1206 + 0x00, 0x00, 0x00, 0x11,
1207 + 0x00, 0x00, 0x00, 0x11,
1208 + (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
1209 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
1210 + 0x00, 0x00, 0x00, 0x11,
1211 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
1212 + 0x00, 0x00, 0x00, 0x11,
1213 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
1214 + 0x00, 0x00, 0x00, 0x11,
1215 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
1216 + 0x00, 0x00, 0x00, 0x11,
1217 + 0x00, 0x00, 0x00, 0x11,
1218 + (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
1219 + 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
1220 + 0x01, 0x11, 0x00, 0x09,
1221 + 0x01, 0x21, 0x00, 0x09,
1222 + 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
1223 + 0x01, 0x01, 0x01, 0x01,
1224 + 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
1225 + 0x01, 0x011, 0x01, 0x10,
1226 + (byte) 0xFF, 0x05, 0x00, 0x1C, //NodeAttributesTlv
1227 + 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
1228 + 0x01, 0x011, 0x01, 0x10,
1229 + 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
1230 + 0x20, 0x01, 0x22, 0x01,
1231 + 0x20, 0x01, 0x22, 0x01,
1232 + 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
1233 + 0x00, 0x01, 0x01, 0x02,
1234 + (byte) 0xFF, 0x06, 0x00, 0x64, //LinkAttributesTlv
1235 + 0x00, 0x13, 0x00, 0x04, //IPv4RouterIdOfRemoteNodeSubTlv
1236 + 0x00, 0x07, 0x08, 0x00,
1237 + 0x00, 0x16, 0x00, 0x04, //AdministrativeGroupSubTlv
1238 + 0x00, 0x09, 0x08, 0x00,
1239 + 0x00, 0x17, 0x00, 0x04, //MaximumLinkBandwidthSubTlv
1240 + 0x00, 0x09, 0x00, 0x00,
1241 + 0x00, 0x18, 0x00, 0x04, //MaximumReservableLinkBandwidthSubTlv
1242 + 0x00, 0x10, 0x00, 0x00,
1243 + 0x00, 0x19, 0x00, 0x04, //UnreservedBandwidthSubTlv
1244 + 0x00, 0x00, (byte) 0x90, 0x00,
1245 + 0x00, 0x1A, 0x00, 0x04, //TEDefaultMetricSubTlv
1246 + 0x00, (byte) 0x99, 0x09, 0x00,
1247 + 0x00, 0x1B, 0x00, 0x02, //LinkProtectionTypeSubTlv
1248 + 0x09, 0x00, 0x00, 0x00,
1249 + 0x00, 0x1C, 0x00, 0x01, //MPLSProtocolMaskSubTlv
1250 + (byte) 0x80, 0x00, 0x00, 0x00,
1251 + 0x00, 0x1D, 0x00, 0x04, //IgpMetricSubTlv
1252 + 0x09, (byte) 0x89, 0x07, 0x00,
1253 + 0x00, 0x1E, 0x00, 0x04, //SharedRiskLinkGroupSubTlv
1254 + 0x04, 0x47, 0x00, 0x03,
1255 + 0x00, 0x1F, 0x00, 0x08, //OpaqueLinkAttributeSubTlv
1256 + 0x04, 0x49, 0x00, 0x04,
1257 + 0x04, 0x47, 0x00, 0x03,
1258 + 0x00, 0x20, 0x00, 0x04, //LinkNameAttributeSubTlv
1259 + 0x04, 0x47, 0x00, 0x03
1260 + };
1261 +
1262 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1263 + buffer.writeBytes(lsReportMsg);
1264 +
1265 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1266 + PcepMessage message = null;
1267 +
1268 + message = reader.readFrom(buffer);
1269 +
1270 + byte[] testReportMsg = {0};
1271 + assertThat(message, instanceOf(PcepLSReportMsg.class));
1272 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1273 + message.writeTo(buf);
1274 +
1275 + int readLen = buf.writerIndex();
1276 + testReportMsg = new byte[readLen];
1277 + buf.readBytes(testReportMsg, 0, readLen);
1278 +
1279 + assertThat(testReportMsg, is(lsReportMsg));
1280 + }
1281 +
1282 + /**
1283 + * This test case checks for
1284 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
1285 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
1286 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv,
1287 + * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(NodeFlagBitsSubTlv,
1288 + * OpaqueNodePropertiesSubTlv, NodeNameSubTlv, ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv),
1289 + * LinkAttributesTlv(IPv4RouterIdOfRemoteNodeSubTlv, IPv6LSRouterIdofRemoteNodeTlv, AdministrativeGroupSubTlv,
1290 + * MaximumLinkBandwidthSubTlv, MaximumReservableLinkBandwidthSubTlv, UnreservedBandwidthSubTlv,
1291 + * TEDefaultMetricSubTlv, LinkProtectionTypeSubTlv, MPLSProtocolMaskSubTlv, IgpMetricSubTlv,
1292 + * SharedRiskLinkGroupSubTlv, OpaqueLinkAttributeSubTlv))
1293 + * in PcLSRpt message.
1294 + */
1295 + @Test
1296 + public void lsReportMessageTest23() throws PcepParseException, PcepOutOfBoundMessageException {
1297 +
1298 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x01, 0x10, // common header
1299 + (byte) 0xE0, 0x10, 0x01, 0x0C, // LS Object Header
1300 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
1301 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
1302 + 0x00, 0x00, 0x00, 0x00,
1303 + 0x00, 0x00, 0x00, 0x01,
1304 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
1305 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
1306 + 0x00, 0x00, 0x00, 0x11,
1307 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
1308 + 0x00, 0x00, 0x00, 0x11,
1309 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
1310 + 0x00, 0x00, 0x00, 0x11,
1311 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
1312 + 0x00, 0x00, 0x00, 0x11,
1313 + 0x00, 0x00, 0x00, 0x11,
1314 + (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
1315 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
1316 + 0x00, 0x00, 0x00, 0x11,
1317 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
1318 + 0x00, 0x00, 0x00, 0x11,
1319 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
1320 + 0x00, 0x00, 0x00, 0x11,
1321 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
1322 + 0x00, 0x00, 0x00, 0x11,
1323 + 0x00, 0x00, 0x00, 0x11,
1324 + (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
1325 + 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
1326 + 0x01, 0x11, 0x00, 0x09,
1327 + 0x01, 0x21, 0x00, 0x09,
1328 + 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
1329 + 0x01, 0x01, 0x01, 0x01,
1330 + 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
1331 + 0x01, 0x011, 0x01, 0x10,
1332 + (byte) 0xFF, 0x05, 0x00, 0x1C, //NodeAttributesTlv
1333 + 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
1334 + 0x01, 0x011, 0x01, 0x10,
1335 + 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
1336 + 0x20, 0x01, 0x22, 0x01,
1337 + 0x20, 0x01, 0x22, 0x01,
1338 + 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
1339 + 0x00, 0x01, 0x01, 0x02,
1340 + (byte) 0xFF, 0x06, 0x00, 0x5C, //LinkAttributesTlv
1341 + 0x00, 0x13, 0x00, 0x04, //IPv4RouterIdOfRemoteNodeSubTlv
1342 + 0x00, 0x07, 0x08, 0x00,
1343 + 0x00, 0x16, 0x00, 0x04, //AdministrativeGroupSubTlv
1344 + 0x00, 0x09, 0x08, 0x00,
1345 + 0x00, 0x17, 0x00, 0x04, //MaximumLinkBandwidthSubTlv
1346 + 0x00, 0x09, 0x00, 0x00,
1347 + 0x00, 0x18, 0x00, 0x04, //MaximumReservableLinkBandwidthSubTlv
1348 + 0x00, 0x10, 0x00, 0x00,
1349 + 0x00, 0x19, 0x00, 0x04, //UnreservedBandwidthSubTlv
1350 + 0x00, 0x00, (byte) 0x90, 0x00,
1351 + 0x00, 0x1A, 0x00, 0x04, //TEDefaultMetricSubTlv
1352 + 0x00, (byte) 0x99, 0x09, 0x00,
1353 + 0x00, 0x1B, 0x00, 0x02, //LinkProtectionTypeSubTlv
1354 + 0x09, 0x00, 0x00, 0x00,
1355 + 0x00, 0x1C, 0x00, 0x01, //MPLSProtocolMaskSubTlv
1356 + (byte) 0x80, 0x00, 0x00, 0x00,
1357 + 0x00, 0x1D, 0x00, 0x04, //IgpMetricSubTlv
1358 + 0x09, (byte) 0x89, 0x07, 0x00,
1359 + 0x00, 0x1E, 0x00, 0x04, //SharedRiskLinkGroupSubTlv
1360 + 0x04, 0x47, 0x00, 0x03,
1361 + 0x00, 0x1F, 0x00, 0x08, //OpaqueLinkAttributeSubTlv
1362 + 0x04, 0x49, 0x00, 0x04,
1363 + 0x04, 0x47, 0x00, 0x03
1364 + };
1365 +
1366 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1367 + buffer.writeBytes(lsReportMsg);
1368 +
1369 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1370 + PcepMessage message = null;
1371 +
1372 + message = reader.readFrom(buffer);
1373 +
1374 + byte[] testReportMsg = {0};
1375 + assertThat(message, instanceOf(PcepLSReportMsg.class));
1376 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1377 + message.writeTo(buf);
1378 +
1379 + int readLen = buf.writerIndex();
1380 + testReportMsg = new byte[readLen];
1381 + buf.readBytes(testReportMsg, 0, readLen);
1382 +
1383 + assertThat(testReportMsg, is(lsReportMsg));
1384 + }
1385 +
1386 + /**
1387 + * This test case checks for
1388 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
1389 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
1390 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv,
1391 + * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(NodeFlagBitsSubTlv,
1392 + * OpaqueNodePropertiesSubTlv, NodeNameSubTlv, ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv),
1393 + * LinkAttributesTlv(IPv4RouterIdOfRemoteNodeSubTlv, IPv6LSRouterIdofRemoteNodeTlv, AdministrativeGroupSubTlv,
1394 + * MaximumLinkBandwidthSubTlv, MaximumReservableLinkBandwidthSubTlv, UnreservedBandwidthSubTlv,
1395 + * TEDefaultMetricSubTlv, LinkProtectionTypeSubTlv, MPLSProtocolMaskSubTlv, IgpMetricSubTlv,
1396 + * SharedRiskLinkGroupSubTlv)) in PcLSRpt message.
1397 + */
1398 + @Test
1399 + public void lsReportMessageTest24() throws PcepParseException, PcepOutOfBoundMessageException {
1400 +
1401 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x01, 0x08, // common header
1402 + (byte) 0xE0, 0x10, 0x01, 0x04, // LS Object Header
1403 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
1404 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
1405 + 0x00, 0x00, 0x00, 0x00,
1406 + 0x00, 0x00, 0x00, 0x01,
1407 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
1408 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
1409 + 0x00, 0x00, 0x00, 0x11,
1410 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
1411 + 0x00, 0x00, 0x00, 0x11,
1412 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
1413 + 0x00, 0x00, 0x00, 0x11,
1414 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
1415 + 0x00, 0x00, 0x00, 0x11,
1416 + 0x00, 0x00, 0x00, 0x11,
1417 + (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
1418 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
1419 + 0x00, 0x00, 0x00, 0x11,
1420 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
1421 + 0x00, 0x00, 0x00, 0x11,
1422 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
1423 + 0x00, 0x00, 0x00, 0x11,
1424 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
1425 + 0x00, 0x00, 0x00, 0x11,
1426 + 0x00, 0x00, 0x00, 0x11,
1427 + (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
1428 + 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
1429 + 0x01, 0x11, 0x00, 0x09,
1430 + 0x01, 0x21, 0x00, 0x09,
1431 + 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
1432 + 0x01, 0x01, 0x01, 0x01,
1433 + 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
1434 + 0x01, 0x011, 0x01, 0x10,
1435 + (byte) 0xFF, 0x05, 0x00, 0x1C, //NodeAttributesTlv
1436 + 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
1437 + 0x01, 0x011, 0x01, 0x10,
1438 + 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
1439 + 0x20, 0x01, 0x22, 0x01,
1440 + 0x20, 0x01, 0x22, 0x01,
1441 + 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
1442 + 0x00, 0x01, 0x01, 0x02,
1443 + (byte) 0xFF, 0x06, 0x00, 0x54, //LinkAttributesTlv
1444 + 0x00, 0x13, 0x00, 0x04, //IPv4RouterIdOfRemoteNodeSubTlv
1445 + 0x00, 0x07, 0x08, 0x00,
1446 + 0x00, 0x16, 0x00, 0x04, //AdministrativeGroupSubTlv
1447 + 0x00, 0x09, 0x08, 0x00,
1448 + 0x00, 0x17, 0x00, 0x04, //MaximumLinkBandwidthSubTlv
1449 + 0x00, 0x09, 0x00, 0x00,
1450 + 0x00, 0x18, 0x00, 0x04, //MaximumReservableLinkBandwidthSubTlv
1451 + 0x00, 0x10, 0x00, 0x00,
1452 + 0x00, 0x19, 0x00, 0x04, //UnreservedBandwidthSubTlv
1453 + 0x00, 0x00, (byte) 0x90, 0x00,
1454 + 0x00, 0x1A, 0x00, 0x04, //TEDefaultMetricSubTlv
1455 + 0x00, (byte) 0x99, 0x09, 0x00,
1456 + 0x00, 0x1B, 0x00, 0x02, //LinkProtectionTypeSubTlv
1457 + 0x09, 0x00, 0x00, 0x00,
1458 + 0x00, 0x1C, 0x00, 0x01, //MPLSProtocolMaskSubTlv
1459 + (byte) 0x80, 0x00, 0x00, 0x00,
1460 + 0x00, 0x1D, 0x00, 0x04, //IgpMetricSubTlv
1461 + 0x09, (byte) 0x89, 0x07, 0x00,
1462 + 0x00, 0x1E, 0x00, 0x08, //SharedRiskLinkGroupSubTlv
1463 + 0x04, 0x47, 0x00, 0x03,
1464 + 0x04, 0x47, 0x00, 0x03
1465 + };
1466 +
1467 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1468 + buffer.writeBytes(lsReportMsg);
1469 +
1470 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1471 + PcepMessage message = null;
1472 +
1473 + message = reader.readFrom(buffer);
1474 +
1475 + byte[] testReportMsg = {0};
1476 + assertThat(message, instanceOf(PcepLSReportMsg.class));
1477 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1478 + message.writeTo(buf);
1479 +
1480 + int readLen = buf.writerIndex();
1481 + testReportMsg = new byte[readLen];
1482 + buf.readBytes(testReportMsg, 0, readLen);
1483 +
1484 + assertThat(testReportMsg, is(lsReportMsg));
1485 + }
1486 +
1487 + /**
1488 + * This test case checks for
1489 + * LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
1490 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv,
1491 + * OSPFareaIDsubTlv, IgpRouterIdSubTlv), LinkDescriptorsTLV(LinkLocalRemoteIdentifiersSubTlv,
1492 + * IPv4InterfaceAddressSubTlv, IPv4NeighborAddressSubTlv), NodeAttributesTlv(NodeFlagBitsSubTlv,
1493 + * OpaqueNodePropertiesSubTlv, NodeNameSubTlv, ISISAreaIdentifierSubTlv, IPv4RouterIdOfLocalNodeSubTlv),
1494 + * LinkAttributesTlv(IPv4RouterIdOfRemoteNodeSubTlv, IPv6LSRouterIdofRemoteNodeTlv, AdministrativeGroupSubTlv,
1495 + * MaximumLinkBandwidthSubTlv, MaximumReservableLinkBandwidthSubTlv, UnreservedBandwidthSubTlv,
1496 + * TEDefaultMetricSubTlv, LinkProtectionTypeSubTlv, MPLSProtocolMaskSubTlv, IgpMetricSubTlv))
1497 + * in PcLSRpt message.
1498 + */
1499 + @Test
1500 + public void lsReportMessageTest25() throws PcepParseException, PcepOutOfBoundMessageException {
1501 +
1502 + byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, (byte) 0xFC, // common header
1503 + (byte) 0xE0, 0x10, 0x00, (byte) 0xF8, // LS Object Header
1504 + 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
1505 + (byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
1506 + 0x00, 0x00, 0x00, 0x00,
1507 + 0x00, 0x00, 0x00, 0x01,
1508 + (byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
1509 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
1510 + 0x00, 0x00, 0x00, 0x11,
1511 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
1512 + 0x00, 0x00, 0x00, 0x11,
1513 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
1514 + 0x00, 0x00, 0x00, 0x11,
1515 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
1516 + 0x00, 0x00, 0x00, 0x11,
1517 + 0x00, 0x00, 0x00, 0x11,
1518 + (byte) 0xFF, 0x03, 0x00, 0x24, //RemoteNodeDescriptorsTLV
1519 + 0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
1520 + 0x00, 0x00, 0x00, 0x11,
1521 + 0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
1522 + 0x00, 0x00, 0x00, 0x11,
1523 + 0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
1524 + 0x00, 0x00, 0x00, 0x11,
1525 + 0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
1526 + 0x00, 0x00, 0x00, 0x11,
1527 + 0x00, 0x00, 0x00, 0x11,
1528 + (byte) 0xFF, 0x04, 0x00, 0x1C, //LinkDescriptorsTLV
1529 + 0x00, 0x06, 0x00, 0x08, //LinkLocalRemoteIdentifiersSubTlv
1530 + 0x01, 0x11, 0x00, 0x09,
1531 + 0x01, 0x21, 0x00, 0x09,
1532 + 0x00, 0x07, 0x00, 0x04, //IPv4InterfaceAddressSubTlv
1533 + 0x01, 0x01, 0x01, 0x01,
1534 + 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressSubTlv
1535 + 0x01, 0x011, 0x01, 0x10,
1536 + (byte) 0xFF, 0x05, 0x00, 0x1C, //NodeAttributesTlv
1537 + 0x00, 0x0E, 0x00, 0x04, //OpaqueNodePropertiesSubTlv
1538 + 0x01, 0x011, 0x01, 0x10,
1539 + 0x00, 0x10, 0x00, 0x08, //ISISAreaIdentifierSubTlv
1540 + 0x20, 0x01, 0x22, 0x01,
1541 + 0x20, 0x01, 0x22, 0x01,
1542 + 0x00, 0x11, 0x00, 0x04, //IPv4RouterIdOfLocalNodeSubTlv
1543 + 0x00, 0x01, 0x01, 0x02,
1544 + (byte) 0xFF, 0x06, 0x00, 0x48, //LinkAttributesTlv
1545 + 0x00, 0x13, 0x00, 0x04, //IPv4RouterIdOfRemoteNodeSubTlv
1546 + 0x00, 0x07, 0x08, 0x00,
1547 + 0x00, 0x16, 0x00, 0x04, //AdministrativeGroupSubTlv
1548 + 0x00, 0x09, 0x08, 0x00,
1549 + 0x00, 0x17, 0x00, 0x04, //MaximumLinkBandwidthSubTlv
1550 + 0x00, 0x09, 0x00, 0x00,
1551 + 0x00, 0x18, 0x00, 0x04, //MaximumReservableLinkBandwidthSubTlv
1552 + 0x00, 0x10, 0x00, 0x00,
1553 + 0x00, 0x19, 0x00, 0x04, //UnreservedBandwidthSubTlv
1554 + 0x00, 0x00, (byte) 0x90, 0x00,
1555 + 0x00, 0x1A, 0x00, 0x04, //TEDefaultMetricSubTlv
1556 + 0x00, (byte) 0x99, 0x09, 0x00,
1557 + 0x00, 0x1B, 0x00, 0x02, //LinkProtectionTypeSubTlv
1558 + 0x09, 0x00, 0x00, 0x00,
1559 + 0x00, 0x1C, 0x00, 0x01, //MPLSProtocolMaskSubTlv
1560 + (byte) 0x80, 0x00, 0x00, 0x00,
1561 + 0x00, 0x1D, 0x00, 0x04, //IgpMetricSubTlv
1562 + 0x09, (byte) 0x89, 0x07, 0x00
1563 + };
1564 +
1565 + ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1566 + buffer.writeBytes(lsReportMsg);
1567 +
1568 + PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1569 + PcepMessage message = null;
1570 +
1571 + message = reader.readFrom(buffer);
1572 +
1573 + byte[] testReportMsg = {0};
1574 +
1575 + assertThat(message, instanceOf(PcepLSReportMsg.class));
1576 + ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1577 + message.writeTo(buf);
1578 +
1579 + int readLen = buf.writerIndex();
1580 + testReportMsg = new byte[readLen];
1581 + buf.readBytes(testReportMsg, 0, readLen);
1582 +
1583 + assertThat(testReportMsg, is(lsReportMsg));
1584 + }
1585 +}
...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol; ...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol;
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers; 19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Test; 20 import org.junit.Test;
21 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
21 import org.onosproject.pcepio.exceptions.PcepParseException; 22 import org.onosproject.pcepio.exceptions.PcepParseException;
22 23
23 import static org.hamcrest.MatcherAssert.assertThat; 24 import static org.hamcrest.MatcherAssert.assertThat;
...@@ -32,15 +33,15 @@ public class PcepLabelUpdateMsgTest { ...@@ -32,15 +33,15 @@ public class PcepLabelUpdateMsgTest {
32 * in PcepLabelUpdate message. 33 * in PcepLabelUpdate message.
33 */ 34 */
34 @Test 35 @Test
35 - public void labelUpdateMessageTest1() throws PcepParseException { 36 + public void labelUpdateMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
36 37
37 - byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x24, // common header 38 + byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x24, // common header
38 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 39 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
39 0x00, 0x00, 0x00, 0x00, 40 0x00, 0x00, 0x00, 0x00,
40 0x00, 0x00, 0x00, 0x10, 41 0x00, 0x00, 0x00, 0x10,
41 0x20, 0x10, 0x00, 0x08, // LSP Object Header 42 0x20, 0x10, 0x00, 0x08, // LSP Object Header
42 0x00, 0x01, 0x00, 0x00, 43 0x00, 0x01, 0x00, 0x00,
43 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 44 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
44 0x00, 0x00, 0x00, 0x00, 45 0x00, 0x00, 0x00, 0x00,
45 0x00, 0x00, 0x00, 0x66}; 46 0x00, 0x00, 0x00, 0x66};
46 47
...@@ -72,18 +73,18 @@ public class PcepLabelUpdateMsgTest { ...@@ -72,18 +73,18 @@ public class PcepLabelUpdateMsgTest {
72 * in PcepLabelUpdate message. 73 * in PcepLabelUpdate message.
73 */ 74 */
74 @Test 75 @Test
75 - public void labelUpdateMessageTest2() throws PcepParseException { 76 + public void labelUpdateMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
76 77
77 - byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x30, // common header 78 + byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x30, // common header
78 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 79 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
79 0x00, 0x00, 0x00, 0x00, 80 0x00, 0x00, 0x00, 0x00,
80 0x00, 0x00, 0x00, 0x10, 81 0x00, 0x00, 0x00, 0x10,
81 0x20, 0x10, 0x00, 0x08, // LSP Object Header 82 0x20, 0x10, 0x00, 0x08, // LSP Object Header
82 0x00, 0x01, 0x00, 0x00, 83 0x00, 0x01, 0x00, 0x00,
83 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 84 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
84 0x00, 0x00, 0x00, 0x00, 85 0x00, 0x00, 0x00, 0x00,
85 0x00, 0x00, 0x00, 0x66, 86 0x00, 0x00, 0x00, 0x66,
86 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 87 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
87 0x00, 0x00, 0x00, 0x00, 88 0x00, 0x00, 0x00, 0x00,
88 0x00, 0x00, 0x00, 0x77}; 89 0x00, 0x00, 0x00, 0x77};
89 90
...@@ -113,16 +114,16 @@ public class PcepLabelUpdateMsgTest { ...@@ -113,16 +114,16 @@ public class PcepLabelUpdateMsgTest {
113 * in PcepLabelUpdate message. 114 * in PcepLabelUpdate message.
114 */ 115 */
115 @Test 116 @Test
116 - public void labelUpdateMessageTest3() throws PcepParseException { 117 + public void labelUpdateMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
117 118
118 - byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x24, // common header 119 + byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x24, // common header
119 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 120 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
120 0x00, 0x00, 0x00, 0x00, 121 0x00, 0x00, 0x00, 0x00,
121 0x00, 0x00, 0x00, 0x10, 122 0x00, 0x00, 0x00, 0x10,
122 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 123 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
123 0x00, 0x00, 0x00, 0x00, 124 0x00, 0x00, 0x00, 0x00,
124 0x00, 0x00, 0x00, 0x66, 125 0x00, 0x00, 0x00, 0x66,
125 - 0x24, 0x10, 0x00, 0x08, // FEC Object Header 126 + (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header
126 0x0A, 0x0A, 0x0B, 0x0B}; 127 0x0A, 0x0A, 0x0B, 0x0B};
127 128
128 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 129 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
...@@ -151,18 +152,18 @@ public class PcepLabelUpdateMsgTest { ...@@ -151,18 +152,18 @@ public class PcepLabelUpdateMsgTest {
151 * in PcepLabelUpdate message. 152 * in PcepLabelUpdate message.
152 */ 153 */
153 @Test 154 @Test
154 - public void labelUpdateMessageTest4() throws PcepParseException { 155 + public void labelUpdateMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
155 156
156 - byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x50, // common header 157 + byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x50, // common header
157 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 158 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
158 0x00, 0x00, 0x00, 0x00, 159 0x00, 0x00, 0x00, 0x00,
159 0x00, 0x00, 0x00, 0x10, 160 0x00, 0x00, 0x00, 0x10,
160 0x20, 0x10, 0x00, 0x08, // LSP Object Header 161 0x20, 0x10, 0x00, 0x08, // LSP Object Header
161 0x00, 0x01, 0x00, 0x00, 162 0x00, 0x01, 0x00, 0x00,
162 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 163 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
163 0x00, 0x00, 0x00, 0x00, 164 0x00, 0x00, 0x00, 0x00,
164 0x00, 0x00, 0x00, 0x66, 165 0x00, 0x00, 0x00, 0x66,
165 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 166 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
166 0x00, 0x00, 0x00, 0x00, 167 0x00, 0x00, 0x00, 0x00,
167 0x00, 0x00, 0x00, 0x77, 168 0x00, 0x00, 0x00, 0x77,
168 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 169 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
...@@ -170,7 +171,7 @@ public class PcepLabelUpdateMsgTest { ...@@ -170,7 +171,7 @@ public class PcepLabelUpdateMsgTest {
170 0x00, 0x00, 0x00, 0x11, 171 0x00, 0x00, 0x00, 0x11,
171 0x20, 0x10, 0x00, 0x08, // LSP Object Header 172 0x20, 0x10, 0x00, 0x08, // LSP Object Header
172 0x00, 0x02, 0x00, 0x00, 173 0x00, 0x02, 0x00, 0x00,
173 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 174 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
174 0x00, 0x00, 0x00, 0x00, 175 0x00, 0x00, 0x00, 0x00,
175 0x00, 0x00, 0x00, 0x44}; 176 0x00, 0x00, 0x00, 0x44};
176 177
...@@ -200,24 +201,24 @@ public class PcepLabelUpdateMsgTest { ...@@ -200,24 +201,24 @@ public class PcepLabelUpdateMsgTest {
200 * in PcepLabelUpdate message. 201 * in PcepLabelUpdate message.
201 */ 202 */
202 @Test 203 @Test
203 - public void labelUpdateMessageTest5() throws PcepParseException { 204 + public void labelUpdateMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
204 205
205 - byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x44, // common header 206 + byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x44, // common header
206 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 207 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
207 0x00, 0x00, 0x00, 0x00, 208 0x00, 0x00, 0x00, 0x00,
208 0x00, 0x00, 0x00, 0x10, 209 0x00, 0x00, 0x00, 0x10,
209 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 210 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
210 0x00, 0x00, 0x00, 0x01, 211 0x00, 0x00, 0x00, 0x01,
211 0x00, 0x00, 0x00, 0x66, 212 0x00, 0x00, 0x00, 0x66,
212 - 0x24, 0x10, 0x00, 0x08, // FEC Object Header 213 + (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header
213 0x0A, 0x0A, 0x0B, 0x0B, 214 0x0A, 0x0A, 0x0B, 0x0B,
214 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 215 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
215 0x00, 0x00, 0x00, 0x00, 216 0x00, 0x00, 0x00, 0x00,
216 0x00, 0x00, 0x00, 0x11, 217 0x00, 0x00, 0x00, 0x11,
217 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 218 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
218 0x00, 0x00, 0x00, 0x00, 219 0x00, 0x00, 0x00, 0x00,
219 0x00, 0x00, 0x00, 0x66, 220 0x00, 0x00, 0x00, 0x66,
220 - 0x24, 0x10, 0x00, 0x08, // FEC Object Header 221 + (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header
221 0x0A, 0x0A, 0x0C, 0x0C}; 222 0x0A, 0x0A, 0x0C, 0x0C};
222 223
223 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 224 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
...@@ -246,27 +247,27 @@ public class PcepLabelUpdateMsgTest { ...@@ -246,27 +247,27 @@ public class PcepLabelUpdateMsgTest {
246 * in PcepLabelUpdate message. 247 * in PcepLabelUpdate message.
247 */ 248 */
248 @Test 249 @Test
249 - public void labelUpdateMessageTest6() throws PcepParseException { 250 + public void labelUpdateMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
250 251
251 - byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x50, // common header 252 + byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x50, // common header
252 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 253 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
253 0x00, 0x00, 0x00, 0x00, 254 0x00, 0x00, 0x00, 0x00,
254 0x00, 0x00, 0x00, 0x10, 255 0x00, 0x00, 0x00, 0x10,
255 0x20, 0x10, 0x00, 0x08, // LSP Object Header 256 0x20, 0x10, 0x00, 0x08, // LSP Object Header
256 0x00, 0x01, 0x00, 0x00, 257 0x00, 0x01, 0x00, 0x00,
257 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 258 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
258 0x00, 0x00, 0x00, 0x00, 259 0x00, 0x00, 0x00, 0x00,
259 0x00, 0x00, 0x00, 0x66, 260 0x00, 0x00, 0x00, 0x66,
260 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 261 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
261 0x00, 0x00, 0x00, 0x00, 262 0x00, 0x00, 0x00, 0x00,
262 0x00, 0x00, 0x00, 0x77, 263 0x00, 0x00, 0x00, 0x77,
263 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 264 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
264 0x00, 0x00, 0x00, 0x00, 265 0x00, 0x00, 0x00, 0x00,
265 0x00, 0x00, 0x00, 0x12, 266 0x00, 0x00, 0x00, 0x12,
266 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 267 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
267 0x00, 0x00, 0x00, 0x00, 268 0x00, 0x00, 0x00, 0x00,
268 0x00, 0x00, 0x00, 0x66, 269 0x00, 0x00, 0x00, 0x66,
269 - 0x24, 0x10, 0x00, 0x08, // FEC Object Header 270 + (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header
270 0x0A, 0x0A, 0x0D, 0x0D}; 271 0x0A, 0x0A, 0x0D, 0x0D};
271 272
272 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 273 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
...@@ -295,26 +296,26 @@ public class PcepLabelUpdateMsgTest { ...@@ -295,26 +296,26 @@ public class PcepLabelUpdateMsgTest {
295 * in PcepLabelUpdate message. 296 * in PcepLabelUpdate message.
296 */ 297 */
297 @Test 298 @Test
298 - public void labelUpdateMessageTest7() throws PcepParseException { 299 + public void labelUpdateMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
299 300
300 - byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x50, // common header 301 + byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x50, // common header
301 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 302 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
302 0x00, 0x00, 0x00, 0x00, 303 0x00, 0x00, 0x00, 0x00,
303 0x00, 0x00, 0x00, 0x12, 304 0x00, 0x00, 0x00, 0x12,
304 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 305 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
305 0x00, 0x00, 0x00, 0x00, 306 0x00, 0x00, 0x00, 0x00,
306 0x00, 0x00, 0x00, 0x66, 307 0x00, 0x00, 0x00, 0x66,
307 - 0x24, 0x10, 0x00, 0x08, // FEC Object Header 308 + (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header
308 0x0A, 0x0A, 0x0D, 0x0D, 309 0x0A, 0x0A, 0x0D, 0x0D,
309 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 310 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
310 0x00, 0x00, 0x00, 0x00, 311 0x00, 0x00, 0x00, 0x00,
311 0x00, 0x00, 0x00, 0x10, 312 0x00, 0x00, 0x00, 0x10,
312 0x20, 0x10, 0x00, 0x08, // LSP Object Header 313 0x20, 0x10, 0x00, 0x08, // LSP Object Header
313 0x00, 0x01, 0x00, 0x00, 314 0x00, 0x01, 0x00, 0x00,
314 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 315 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
315 0x00, 0x00, 0x00, 0x00, 316 0x00, 0x00, 0x00, 0x00,
316 0x00, 0x00, 0x00, 0x66, 317 0x00, 0x00, 0x00, 0x66,
317 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 318 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
318 0x00, 0x00, 0x00, 0x00, 319 0x00, 0x00, 0x00, 0x00,
319 0x00, 0x00, 0x00, 0x77}; 320 0x00, 0x00, 0x00, 0x77};
320 321
...@@ -345,26 +346,26 @@ public class PcepLabelUpdateMsgTest { ...@@ -345,26 +346,26 @@ public class PcepLabelUpdateMsgTest {
345 * in PcepLabelUpdate message. 346 * in PcepLabelUpdate message.
346 */ 347 */
347 @Test 348 @Test
348 - public void labelUpdateMessageTest8() throws PcepParseException { 349 + public void labelUpdateMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
349 350
350 - byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x7C, // common header 351 + byte[] labelUpdate = new byte[]{0x20, (byte) 0xE2, 0x00, 0x7C, // common header
351 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 352 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
352 0x00, 0x00, 0x00, 0x00, 353 0x00, 0x00, 0x00, 0x00,
353 0x00, 0x00, 0x00, 0x12, 354 0x00, 0x00, 0x00, 0x12,
354 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 355 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
355 0x00, 0x00, 0x00, 0x00, 356 0x00, 0x00, 0x00, 0x00,
356 0x00, 0x00, 0x00, 0x66, 357 0x00, 0x00, 0x00, 0x66,
357 - 0x24, 0x10, 0x00, 0x08, // FEC Object Header 358 + (byte) 0xE2, 0x10, 0x00, 0x08, // FEC Object Header
358 0x0A, 0x0A, 0x0D, 0x0D, 359 0x0A, 0x0A, 0x0D, 0x0D,
359 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 360 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
360 0x00, 0x00, 0x00, 0x00, 361 0x00, 0x00, 0x00, 0x00,
361 0x00, 0x00, 0x00, 0x10, 362 0x00, 0x00, 0x00, 0x10,
362 0x20, 0x10, 0x00, 0x08, // LSP Object Header 363 0x20, 0x10, 0x00, 0x08, // LSP Object Header
363 0x00, 0x01, 0x00, 0x00, 364 0x00, 0x01, 0x00, 0x00,
364 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 365 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
365 0x00, 0x00, 0x00, 0x00, 366 0x00, 0x00, 0x00, 0x00,
366 0x00, 0x00, 0x00, 0x66, 367 0x00, 0x00, 0x00, 0x66,
367 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 368 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
368 0x00, 0x00, 0x00, 0x00, 369 0x00, 0x00, 0x00, 0x00,
369 0x00, 0x00, 0x00, 0x77, 370 0x00, 0x00, 0x00, 0x77,
370 0x21, 0x10, 0x00, 0x0C, // SRP Object Header 371 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
...@@ -372,10 +373,10 @@ public class PcepLabelUpdateMsgTest { ...@@ -372,10 +373,10 @@ public class PcepLabelUpdateMsgTest {
372 0x00, 0x00, 0x00, 0x10, 373 0x00, 0x00, 0x00, 0x10,
373 0x20, 0x10, 0x00, 0x08, // LSP Object Header 374 0x20, 0x10, 0x00, 0x08, // LSP Object Header
374 0x00, 0x01, 0x00, 0x00, 375 0x00, 0x01, 0x00, 0x00,
375 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 376 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
376 0x00, 0x00, 0x00, 0x00, 377 0x00, 0x00, 0x00, 0x00,
377 0x00, 0x00, 0x00, 0x66, 378 0x00, 0x00, 0x00, 0x66,
378 - 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header 379 + (byte) 0xE1, 0x10, 0x00, 0x0C, // LABEL Object Header
379 0x00, 0x00, 0x00, 0x00, 380 0x00, 0x00, 0x00, 0x00,
380 0x00, 0x00, 0x00, 0x77}; 381 0x00, 0x00, 0x00, 0x77};
381 382
......
...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol; ...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol;
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers; 19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Test; 20 import org.junit.Test;
21 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
21 import org.onosproject.pcepio.exceptions.PcepParseException; 22 import org.onosproject.pcepio.exceptions.PcepParseException;
22 23
23 import static org.hamcrest.MatcherAssert.assertThat; 24 import static org.hamcrest.MatcherAssert.assertThat;
...@@ -33,7 +34,7 @@ public class PcepOpenMsgTest { ...@@ -33,7 +34,7 @@ public class PcepOpenMsgTest {
33 * PCECC-CAPABILITY-TLV in Pcep Open message. 34 * PCECC-CAPABILITY-TLV in Pcep Open message.
34 */ 35 */
35 @Test 36 @Test
36 - public void openMessageTest1() throws PcepParseException { 37 + public void openMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
37 38
38 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x10, 0x00, 0x20, 0x20, 0x1e, 0x78, (byte) 0xbd, 39 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x10, 0x00, 0x20, 0x20, 0x1e, 0x78, (byte) 0xbd,
39 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY 40 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY
...@@ -67,7 +68,7 @@ public class PcepOpenMsgTest { ...@@ -67,7 +68,7 @@ public class PcepOpenMsgTest {
67 * This test case checks open object with STATEFUL-PCE-CAPABILITY-TLV in Pcep Open message. 68 * This test case checks open object with STATEFUL-PCE-CAPABILITY-TLV in Pcep Open message.
68 */ 69 */
69 @Test 70 @Test
70 - public void openMessageTest2() throws PcepParseException { 71 + public void openMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
71 72
72 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x14, // common header 73 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x14, // common header
73 0x01, 0x10, 0x00, 0x10, // common object header 74 0x01, 0x10, 0x00, 0x10, // common object header
...@@ -99,7 +100,7 @@ public class PcepOpenMsgTest { ...@@ -99,7 +100,7 @@ public class PcepOpenMsgTest {
99 * This test case checks open object with GmplsCapability tlv in Pcep Open message. 100 * This test case checks open object with GmplsCapability tlv in Pcep Open message.
100 */ 101 */
101 @Test 102 @Test
102 - public void openMessageTest3() throws PcepParseException { 103 + public void openMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
103 104
104 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x14, // common header 105 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x14, // common header
105 0x01, 0x10, 0x00, 0x10, // common object header 106 0x01, 0x10, 0x00, 0x10, // common object header
...@@ -133,7 +134,7 @@ public class PcepOpenMsgTest { ...@@ -133,7 +134,7 @@ public class PcepOpenMsgTest {
133 * This test case checks open object with StatefulLspDbVer Tlv in Pcep Open message. 134 * This test case checks open object with StatefulLspDbVer Tlv in Pcep Open message.
134 */ 135 */
135 @Test 136 @Test
136 - public void openMessageTest4() throws PcepParseException { 137 + public void openMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
137 138
138 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x18, 139 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x18,
139 0x01, 0x10, 0x00, 0x14, 0x20, 0x1e, 0x78, 0x20, 140 0x01, 0x10, 0x00, 0x14, 0x20, 0x1e, 0x78, 0x20,
...@@ -165,7 +166,7 @@ public class PcepOpenMsgTest { ...@@ -165,7 +166,7 @@ public class PcepOpenMsgTest {
165 * This test case checks open object with no tlv's in Pcep Open message. 166 * This test case checks open object with no tlv's in Pcep Open message.
166 */ 167 */
167 @Test 168 @Test
168 - public void openMessageTest5() throws PcepParseException { 169 + public void openMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
169 170
170 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x0C, 171 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x0C,
171 0x01, 0x10, 0x00, 0x08, 0x20, 0x1e, 0x78, (byte) 0xbd }; // no Tlvs in open messsage 172 0x01, 0x10, 0x00, 0x08, 0x20, 0x1e, 0x78, (byte) 0xbd }; // no Tlvs in open messsage
...@@ -197,7 +198,7 @@ public class PcepOpenMsgTest { ...@@ -197,7 +198,7 @@ public class PcepOpenMsgTest {
197 * with I bit set in Pcep Open message. 198 * with I bit set in Pcep Open message.
198 */ 199 */
199 @Test 200 @Test
200 - public void openMessageTest6() throws PcepParseException { 201 + public void openMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
201 202
202 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x11, 0x00, 0x20, //p bit not set & i bit set 203 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x11, 0x00, 0x20, //p bit not set & i bit set
203 0x20, 0x1e, 0x78, (byte) 0xbd, 204 0x20, 0x1e, 0x78, (byte) 0xbd,
...@@ -233,7 +234,7 @@ public class PcepOpenMsgTest { ...@@ -233,7 +234,7 @@ public class PcepOpenMsgTest {
233 * with P bit set in Pcep Open message. 234 * with P bit set in Pcep Open message.
234 */ 235 */
235 @Test 236 @Test
236 - public void openMessageTest7() throws PcepParseException { 237 + public void openMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
237 238
238 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x12, 0x00, 0x20, //p bit set & i bit not set 239 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x12, 0x00, 0x20, //p bit set & i bit not set
239 0x20, 0x1e, 0x78, (byte) 0xbd, 240 0x20, 0x1e, 0x78, (byte) 0xbd,
...@@ -269,7 +270,7 @@ public class PcepOpenMsgTest { ...@@ -269,7 +270,7 @@ public class PcepOpenMsgTest {
269 * with P & I bits set in Pcep Open message. 270 * with P & I bits set in Pcep Open message.
270 */ 271 */
271 @Test 272 @Test
272 - public void openMessageTest8() throws PcepParseException { 273 + public void openMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
273 274
274 /* OPEN OBJECT (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV, PCECC-CAPABILITY-TLV) 275 /* OPEN OBJECT (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV, PCECC-CAPABILITY-TLV)
275 with p bit set & i bit set. 276 with p bit set & i bit set.
...@@ -308,7 +309,7 @@ public class PcepOpenMsgTest { ...@@ -308,7 +309,7 @@ public class PcepOpenMsgTest {
308 * with P & I bits set and invalid session id in Pcep Open message. 309 * with P & I bits set and invalid session id in Pcep Open message.
309 */ 310 */
310 @Test 311 @Test
311 - public void openMessageTest9() throws PcepParseException { 312 + public void openMessageTest9() throws PcepParseException, PcepOutOfBoundMessageException {
312 313
313 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x13, 0x00, 0x20, //p bit set & i bit set 314 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x13, 0x00, 0x20, //p bit set & i bit set
314 0x20, 0x1e, 0x78, 0x00, //invalid sessionID 315 0x20, 0x1e, 0x78, 0x00, //invalid sessionID
...@@ -345,7 +346,7 @@ public class PcepOpenMsgTest { ...@@ -345,7 +346,7 @@ public class PcepOpenMsgTest {
345 * in Pcep Open message. 346 * in Pcep Open message.
346 */ 347 */
347 @Test 348 @Test
348 - public void openMessageTest10() throws PcepParseException { 349 + public void openMessageTest10() throws PcepParseException, PcepOutOfBoundMessageException {
349 350
350 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x1C, // common header 351 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x1C, // common header
351 0x01, 0x10, 0x00, 0x18, // common object header 352 0x01, 0x10, 0x00, 0x18, // common object header
...@@ -382,7 +383,7 @@ public class PcepOpenMsgTest { ...@@ -382,7 +383,7 @@ public class PcepOpenMsgTest {
382 * PCECC-CAPABILITY-TLV, TED Capability TLV in Pcep Open message. 383 * PCECC-CAPABILITY-TLV, TED Capability TLV in Pcep Open message.
383 */ 384 */
384 @Test 385 @Test
385 - public void openMessageTest11() throws PcepParseException { 386 + public void openMessageTest11() throws PcepParseException, PcepOutOfBoundMessageException {
386 387
387 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x2C, // common header 388 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x2C, // common header
388 0x01, 0x10, 0x00, 0x28, // common object header 389 0x01, 0x10, 0x00, 0x28, // common object header
...@@ -390,7 +391,7 @@ public class PcepOpenMsgTest { ...@@ -390,7 +391,7 @@ public class PcepOpenMsgTest {
390 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY 391 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
391 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV 392 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
392 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV 393 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV
393 - 0x00, 0x00, 0x00, 0x03, 0x00, (byte) 0x84, 0x00, 0x04, // TED Capability TLV 394 + 0x00, 0x00, 0x00, 0x03, (byte) 0xFF, (byte) 0x00, 0x00, 0x04, // LS Capability TLV
394 0x00, 0x00, 0x00, 0x00 }; 395 0x00, 0x00, 0x00, 0x00 };
395 396
396 byte[] testOpenMsg = {0}; 397 byte[] testOpenMsg = {0};
...@@ -412,7 +413,6 @@ public class PcepOpenMsgTest { ...@@ -412,7 +413,6 @@ public class PcepOpenMsgTest {
412 buf.readBytes(testOpenMsg, 0, readLen); 413 buf.readBytes(testOpenMsg, 0, readLen);
413 414
414 assertThat(testOpenMsg, is(openMsg)); 415 assertThat(testOpenMsg, is(openMsg));
415 -
416 } 416 }
417 417
418 /** 418 /**
...@@ -420,7 +420,7 @@ public class PcepOpenMsgTest { ...@@ -420,7 +420,7 @@ public class PcepOpenMsgTest {
420 * PCECC-CAPABILITY-TLV in Pcep Open message. 420 * PCECC-CAPABILITY-TLV in Pcep Open message.
421 */ 421 */
422 @Test 422 @Test
423 - public void openMessageTest12() throws PcepParseException { 423 + public void openMessageTest12() throws PcepParseException, PcepOutOfBoundMessageException {
424 424
425 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, // common header 425 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, // common header
426 0x01, 0x10, 0x00, 0x20, // common object header 426 0x01, 0x10, 0x00, 0x20, // common object header
...@@ -457,7 +457,7 @@ public class PcepOpenMsgTest { ...@@ -457,7 +457,7 @@ public class PcepOpenMsgTest {
457 * in Pcep Open message. 457 * in Pcep Open message.
458 */ 458 */
459 @Test 459 @Test
460 - public void openMessageTest13() throws PcepParseException { 460 + public void openMessageTest13() throws PcepParseException, PcepOutOfBoundMessageException {
461 461
462 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x1c, // common header 462 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x1c, // common header
463 0x01, 0x10, 0x00, 0x18, // common object header 463 0x01, 0x10, 0x00, 0x18, // common object header
...@@ -493,7 +493,7 @@ public class PcepOpenMsgTest { ...@@ -493,7 +493,7 @@ public class PcepOpenMsgTest {
493 * This test case checks open object with STATEFUL-PCE-CAPABILITY in Pcep Open message. 493 * This test case checks open object with STATEFUL-PCE-CAPABILITY in Pcep Open message.
494 */ 494 */
495 @Test 495 @Test
496 - public void openMessageTest14() throws PcepParseException { 496 + public void openMessageTest14() throws PcepParseException, PcepOutOfBoundMessageException {
497 497
498 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x14, // common header 498 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x14, // common header
499 0x01, 0x10, 0x00, 0x10, // common object header 499 0x01, 0x10, 0x00, 0x10, // common object header
...@@ -527,7 +527,7 @@ public class PcepOpenMsgTest { ...@@ -527,7 +527,7 @@ public class PcepOpenMsgTest {
527 * This test case checks open object with no tlv Pcep Open message. 527 * This test case checks open object with no tlv Pcep Open message.
528 */ 528 */
529 @Test 529 @Test
530 - public void openMessageTest15() throws PcepParseException { 530 + public void openMessageTest15() throws PcepParseException, PcepOutOfBoundMessageException {
531 531
532 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x0c, // common header 532 byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x0c, // common header
533 0x01, 0x10, 0x00, 0x08, // common object header 533 0x01, 0x10, 0x00, 0x08, // common object header
......
...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol; ...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol;
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers; 19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Test; 20 import org.junit.Test;
21 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
21 import org.onosproject.pcepio.exceptions.PcepParseException; 22 import org.onosproject.pcepio.exceptions.PcepParseException;
22 23
23 import static org.hamcrest.MatcherAssert.assertThat; 24 import static org.hamcrest.MatcherAssert.assertThat;
...@@ -32,7 +33,7 @@ public class PcepReportMsgExtTest { ...@@ -32,7 +33,7 @@ public class PcepReportMsgExtTest {
32 * in PcRpt message. 33 * in PcRpt message.
33 */ 34 */
34 @Test 35 @Test
35 - public void reportMessageTest39() throws PcepParseException { 36 + public void reportMessageTest39() throws PcepParseException, PcepOutOfBoundMessageException {
36 37
37 byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x98, 38 byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x98,
38 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object 39 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
...@@ -79,7 +80,7 @@ public class PcepReportMsgExtTest { ...@@ -79,7 +80,7 @@ public class PcepReportMsgExtTest {
79 * in PcRpt message. 80 * in PcRpt message.
80 */ 81 */
81 @Test 82 @Test
82 - public void reportMessageTest40() throws PcepParseException { 83 + public void reportMessageTest40() throws PcepParseException, PcepOutOfBoundMessageException {
83 84
84 byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x64, 85 byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x64,
85 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object 86 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
...@@ -120,7 +121,7 @@ public class PcepReportMsgExtTest { ...@@ -120,7 +121,7 @@ public class PcepReportMsgExtTest {
120 * in PcRpt message. 121 * in PcRpt message.
121 */ 122 */
122 @Test 123 @Test
123 - public void reportMessageTest41() throws PcepParseException { 124 + public void reportMessageTest41() throws PcepParseException, PcepOutOfBoundMessageException {
124 125
125 byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x8c, 126 byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x8c,
126 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object 127 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
...@@ -166,7 +167,7 @@ public class PcepReportMsgExtTest { ...@@ -166,7 +167,7 @@ public class PcepReportMsgExtTest {
166 * in PcRpt message. 167 * in PcRpt message.
167 */ 168 */
168 @Test 169 @Test
169 - public void reportMessageTest42() throws PcepParseException { 170 + public void reportMessageTest42() throws PcepParseException, PcepOutOfBoundMessageException {
170 171
171 byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0xE8, 172 byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0xE8,
172 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object 173 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
......
...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol; ...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol;
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers; 19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Test; 20 import org.junit.Test;
21 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
21 import org.onosproject.pcepio.exceptions.PcepParseException; 22 import org.onosproject.pcepio.exceptions.PcepParseException;
22 23
23 import static org.hamcrest.MatcherAssert.assertThat; 24 import static org.hamcrest.MatcherAssert.assertThat;
...@@ -31,7 +32,7 @@ public class PcepReportMsgTest { ...@@ -31,7 +32,7 @@ public class PcepReportMsgTest {
31 * in PcRpt message. 32 * in PcRpt message.
32 */ 33 */
33 @Test 34 @Test
34 - public void reportMessageTest1() throws PcepParseException { 35 + public void reportMessageTest1() throws PcepParseException, PcepOutOfBoundMessageException {
35 36
36 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, 0x24, 37 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, 0x24,
37 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 38 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -66,7 +67,7 @@ public class PcepReportMsgTest { ...@@ -66,7 +67,7 @@ public class PcepReportMsgTest {
66 * in PcRpt message. 67 * in PcRpt message.
67 */ 68 */
68 @Test 69 @Test
69 - public void reportMessageTest2() throws PcepParseException { 70 + public void reportMessageTest2() throws PcepParseException, PcepOutOfBoundMessageException {
70 71
71 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x7c, 72 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x7c,
72 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 73 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -111,7 +112,7 @@ public class PcepReportMsgTest { ...@@ -111,7 +112,7 @@ public class PcepReportMsgTest {
111 * in PcRpt message. 112 * in PcRpt message.
112 */ 113 */
113 @Test 114 @Test
114 - public void reportMessageTest3() throws PcepParseException { 115 + public void reportMessageTest3() throws PcepParseException, PcepOutOfBoundMessageException {
115 116
116 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x70, 117 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x70,
117 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object //LSP Object 118 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object //LSP Object
...@@ -155,7 +156,7 @@ public class PcepReportMsgTest { ...@@ -155,7 +156,7 @@ public class PcepReportMsgTest {
155 * in PcRpt message. 156 * in PcRpt message.
156 */ 157 */
157 @Test 158 @Test
158 - public void reportMessageTest4() throws PcepParseException { 159 + public void reportMessageTest4() throws PcepParseException, PcepOutOfBoundMessageException {
159 160
160 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x64, 161 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x64,
161 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 162 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -197,7 +198,7 @@ public class PcepReportMsgTest { ...@@ -197,7 +198,7 @@ public class PcepReportMsgTest {
197 * in PcRpt message. 198 * in PcRpt message.
198 */ 199 */
199 @Test 200 @Test
200 - public void reportMessageTest5() throws PcepParseException { 201 + public void reportMessageTest5() throws PcepParseException, PcepOutOfBoundMessageException {
201 202
202 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x50, 203 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x50,
203 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 204 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -237,7 +238,7 @@ public class PcepReportMsgTest { ...@@ -237,7 +238,7 @@ public class PcepReportMsgTest {
237 * in PcRpt message. 238 * in PcRpt message.
238 */ 239 */
239 @Test 240 @Test
240 - public void reportMessageTest6() throws PcepParseException { 241 + public void reportMessageTest6() throws PcepParseException, PcepOutOfBoundMessageException {
241 242
242 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x6c, 243 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x6c,
243 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 244 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -279,7 +280,7 @@ public class PcepReportMsgTest { ...@@ -279,7 +280,7 @@ public class PcepReportMsgTest {
279 * in PcRpt message. 280 * in PcRpt message.
280 */ 281 */
281 @Test 282 @Test
282 - public void reportMessageTest7() throws PcepParseException { 283 + public void reportMessageTest7() throws PcepParseException, PcepOutOfBoundMessageException {
283 284
284 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x58, 285 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x58,
285 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 286 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -318,7 +319,7 @@ public class PcepReportMsgTest { ...@@ -318,7 +319,7 @@ public class PcepReportMsgTest {
318 * in PcRpt message. 319 * in PcRpt message.
319 */ 320 */
320 @Test 321 @Test
321 - public void reportMessageTest8() throws PcepParseException { 322 + public void reportMessageTest8() throws PcepParseException, PcepOutOfBoundMessageException {
322 323
323 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x70, 324 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x70,
324 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 325 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -361,7 +362,7 @@ public class PcepReportMsgTest { ...@@ -361,7 +362,7 @@ public class PcepReportMsgTest {
361 * in PcRpt message. 362 * in PcRpt message.
362 */ 363 */
363 @Test 364 @Test
364 - public void reportMessageTest9() throws PcepParseException { 365 + public void reportMessageTest9() throws PcepParseException, PcepOutOfBoundMessageException {
365 366
366 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x44, 367 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x44,
367 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object //LSP Object 368 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object //LSP Object
...@@ -399,7 +400,7 @@ public class PcepReportMsgTest { ...@@ -399,7 +400,7 @@ public class PcepReportMsgTest {
399 * in PcRpt message. 400 * in PcRpt message.
400 */ 401 */
401 @Test 402 @Test
402 - public void reportMessageTest10() throws PcepParseException { 403 + public void reportMessageTest10() throws PcepParseException, PcepOutOfBoundMessageException {
403 404
404 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x74, 405 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x74,
405 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 406 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -442,7 +443,7 @@ public class PcepReportMsgTest { ...@@ -442,7 +443,7 @@ public class PcepReportMsgTest {
442 * in PcRpt message. 443 * in PcRpt message.
443 */ 444 */
444 @Test 445 @Test
445 - public void reportMessageTest11() throws PcepParseException { 446 + public void reportMessageTest11() throws PcepParseException, PcepOutOfBoundMessageException {
446 447
447 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x68, 448 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x68,
448 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 449 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -483,7 +484,7 @@ public class PcepReportMsgTest { ...@@ -483,7 +484,7 @@ public class PcepReportMsgTest {
483 * in PcRpt message. 484 * in PcRpt message.
484 */ 485 */
485 @Test 486 @Test
486 - public void reportMessageTest12() throws PcepParseException { 487 + public void reportMessageTest12() throws PcepParseException, PcepOutOfBoundMessageException {
487 488
488 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x60, 489 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x60,
489 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 490 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -523,7 +524,7 @@ public class PcepReportMsgTest { ...@@ -523,7 +524,7 @@ public class PcepReportMsgTest {
523 * in PcRpt message. 524 * in PcRpt message.
524 */ 525 */
525 @Test 526 @Test
526 - public void reportMessageTest13() throws PcepParseException { 527 + public void reportMessageTest13() throws PcepParseException, PcepOutOfBoundMessageException {
527 528
528 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x68, 529 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x68,
529 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 530 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -564,7 +565,7 @@ public class PcepReportMsgTest { ...@@ -564,7 +565,7 @@ public class PcepReportMsgTest {
564 * in PcRpt message. 565 * in PcRpt message.
565 */ 566 */
566 @Test 567 @Test
567 - public void reportMessageTest14() throws PcepParseException { 568 + public void reportMessageTest14() throws PcepParseException, PcepOutOfBoundMessageException {
568 569
569 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x60, 570 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x60,
570 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 571 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -604,7 +605,7 @@ public class PcepReportMsgTest { ...@@ -604,7 +605,7 @@ public class PcepReportMsgTest {
604 * in PcRpt message. 605 * in PcRpt message.
605 */ 606 */
606 @Test 607 @Test
607 - public void reportMessageTest15() throws PcepParseException { 608 + public void reportMessageTest15() throws PcepParseException, PcepOutOfBoundMessageException {
608 609
609 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x7C, 610 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x7C,
610 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 611 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -647,7 +648,7 @@ public class PcepReportMsgTest { ...@@ -647,7 +648,7 @@ public class PcepReportMsgTest {
647 * in PcRpt message. 648 * in PcRpt message.
648 */ 649 */
649 @Test 650 @Test
650 - public void reportMessageTest16() throws PcepParseException { 651 + public void reportMessageTest16() throws PcepParseException, PcepOutOfBoundMessageException {
651 652
652 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x70, 653 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x70,
653 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 654 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -689,7 +690,7 @@ public class PcepReportMsgTest { ...@@ -689,7 +690,7 @@ public class PcepReportMsgTest {
689 * in PcRpt message. 690 * in PcRpt message.
690 */ 691 */
691 @Test 692 @Test
692 - public void reportMessageTest17() throws PcepParseException { 693 + public void reportMessageTest17() throws PcepParseException, PcepOutOfBoundMessageException {
693 694
694 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x74, 695 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x74,
695 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 696 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -731,7 +732,7 @@ public class PcepReportMsgTest { ...@@ -731,7 +732,7 @@ public class PcepReportMsgTest {
731 * in PcRpt message. 732 * in PcRpt message.
732 */ 733 */
733 @Test 734 @Test
734 - public void reportMessageTest18() throws PcepParseException { 735 + public void reportMessageTest18() throws PcepParseException, PcepOutOfBoundMessageException {
735 736
736 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x68, 737 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x68,
737 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 738 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -772,7 +773,7 @@ public class PcepReportMsgTest { ...@@ -772,7 +773,7 @@ public class PcepReportMsgTest {
772 * in PcRpt message. 773 * in PcRpt message.
773 */ 774 */
774 @Test 775 @Test
775 - public void reportMessageTest19() throws PcepParseException { 776 + public void reportMessageTest19() throws PcepParseException, PcepOutOfBoundMessageException {
776 777
777 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x6C, 778 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x6C,
778 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 779 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -813,7 +814,7 @@ public class PcepReportMsgTest { ...@@ -813,7 +814,7 @@ public class PcepReportMsgTest {
813 * in PcRpt message. 814 * in PcRpt message.
814 */ 815 */
815 @Test 816 @Test
816 - public void reportMessageTest20() throws PcepParseException { 817 + public void reportMessageTest20() throws PcepParseException, PcepOutOfBoundMessageException {
817 818
818 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x88, 819 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x88,
819 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 820 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -858,7 +859,7 @@ public class PcepReportMsgTest { ...@@ -858,7 +859,7 @@ public class PcepReportMsgTest {
858 * in PcRpt message. 859 * in PcRpt message.
859 */ 860 */
860 @Test 861 @Test
861 - public void reportMessageTest21() throws PcepParseException { 862 + public void reportMessageTest21() throws PcepParseException, PcepOutOfBoundMessageException {
862 863
863 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xac, 864 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xac,
864 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 865 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -908,7 +909,7 @@ public class PcepReportMsgTest { ...@@ -908,7 +909,7 @@ public class PcepReportMsgTest {
908 * in PcRpt message. 909 * in PcRpt message.
909 */ 910 */
910 @Test 911 @Test
911 - public void reportMessageTest22() throws PcepParseException { 912 + public void reportMessageTest22() throws PcepParseException, PcepOutOfBoundMessageException {
912 913
913 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xA0, 914 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xA0,
914 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object 915 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
...@@ -957,7 +958,7 @@ public class PcepReportMsgTest { ...@@ -957,7 +958,7 @@ public class PcepReportMsgTest {
957 * in PcRpt message. 958 * in PcRpt message.
958 */ 959 */
959 @Test 960 @Test
960 - public void reportMessageTest23() throws PcepParseException { 961 + public void reportMessageTest23() throws PcepParseException, PcepOutOfBoundMessageException {
961 962
962 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x8c, 963 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x8c,
963 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object 964 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
...@@ -1004,7 +1005,7 @@ public class PcepReportMsgTest { ...@@ -1004,7 +1005,7 @@ public class PcepReportMsgTest {
1004 * in PcRpt message. 1005 * in PcRpt message.
1005 */ 1006 */
1006 @Test 1007 @Test
1007 - public void reportMessageTest24() throws PcepParseException { 1008 + public void reportMessageTest24() throws PcepParseException, PcepOutOfBoundMessageException {
1008 1009
1009 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x84, 1010 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x84,
1010 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object 1011 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
...@@ -1050,7 +1051,7 @@ public class PcepReportMsgTest { ...@@ -1050,7 +1051,7 @@ public class PcepReportMsgTest {
1050 * in PcRpt message. 1051 * in PcRpt message.
1051 */ 1052 */
1052 @Test 1053 @Test
1053 - public void reportMessageTest25() throws PcepParseException { 1054 + public void reportMessageTest25() throws PcepParseException, PcepOutOfBoundMessageException {
1054 1055
1055 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x8c, 1056 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x8c,
1056 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object 1057 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
...@@ -1097,7 +1098,7 @@ public class PcepReportMsgTest { ...@@ -1097,7 +1098,7 @@ public class PcepReportMsgTest {
1097 * in PcRpt message. 1098 * in PcRpt message.
1098 */ 1099 */
1099 @Test 1100 @Test
1100 - public void reportMessageTest26() throws PcepParseException { 1101 + public void reportMessageTest26() throws PcepParseException, PcepOutOfBoundMessageException {
1101 1102
1102 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x58, 1103 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x58,
1103 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object 1104 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
...@@ -1138,7 +1139,7 @@ public class PcepReportMsgTest { ...@@ -1138,7 +1139,7 @@ public class PcepReportMsgTest {
1138 * in PcRpt message. 1139 * in PcRpt message.
1139 */ 1140 */
1140 @Test 1141 @Test
1141 - public void reportMessageTest27() throws PcepParseException { 1142 + public void reportMessageTest27() throws PcepParseException, PcepOutOfBoundMessageException {
1142 1143
1143 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x44, 1144 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x44,
1144 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object 1145 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
...@@ -1177,7 +1178,7 @@ public class PcepReportMsgTest { ...@@ -1177,7 +1178,7 @@ public class PcepReportMsgTest {
1177 * in PcRpt message. 1178 * in PcRpt message.
1178 */ 1179 */
1179 @Test 1180 @Test
1180 - public void reportMessageTest28() throws PcepParseException { 1181 + public void reportMessageTest28() throws PcepParseException, PcepOutOfBoundMessageException {
1181 1182
1182 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x6c, 1183 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x6c,
1183 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object 1184 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
...@@ -1219,7 +1220,7 @@ public class PcepReportMsgTest { ...@@ -1219,7 +1220,7 @@ public class PcepReportMsgTest {
1219 * in PcRpt message. 1220 * in PcRpt message.
1220 */ 1221 */
1221 @Test 1222 @Test
1222 - public void reportMessageTest29() throws PcepParseException { 1223 + public void reportMessageTest29() throws PcepParseException, PcepOutOfBoundMessageException {
1223 1224
1224 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x74, 1225 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x74,
1225 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 1226 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -1262,7 +1263,7 @@ public class PcepReportMsgTest { ...@@ -1262,7 +1263,7 @@ public class PcepReportMsgTest {
1262 * in PcRpt message. 1263 * in PcRpt message.
1263 */ 1264 */
1264 @Test 1265 @Test
1265 - public void reportMessageTest30() throws PcepParseException { 1266 + public void reportMessageTest30() throws PcepParseException, PcepOutOfBoundMessageException {
1266 1267
1267 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xE4, 1268 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xE4,
1268 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 1269 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -1319,7 +1320,7 @@ public class PcepReportMsgTest { ...@@ -1319,7 +1320,7 @@ public class PcepReportMsgTest {
1319 * in PcRpt message. 1320 * in PcRpt message.
1320 */ 1321 */
1321 @Test 1322 @Test
1322 - public void reportMessageTest31() throws PcepParseException { 1323 + public void reportMessageTest31() throws PcepParseException, PcepOutOfBoundMessageException {
1323 1324
1324 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x01, 0x00, 1325 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x01, 0x00,
1325 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 1326 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -1379,7 +1380,7 @@ public class PcepReportMsgTest { ...@@ -1379,7 +1380,7 @@ public class PcepReportMsgTest {
1379 * in PcRpt message. 1380 * in PcRpt message.
1380 */ 1381 */
1381 @Test 1382 @Test
1382 - public void reportMessageTest32() throws PcepParseException { 1383 + public void reportMessageTest32() throws PcepParseException, PcepOutOfBoundMessageException {
1383 1384
1384 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x01, (byte) 0x14, 1385 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x01, (byte) 0x14,
1385 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 1386 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -1441,7 +1442,7 @@ public class PcepReportMsgTest { ...@@ -1441,7 +1442,7 @@ public class PcepReportMsgTest {
1441 * in PcRpt message. 1442 * in PcRpt message.
1442 */ 1443 */
1443 @Test 1444 @Test
1444 - public void reportMessageTest33() throws PcepParseException { 1445 + public void reportMessageTest33() throws PcepParseException, PcepOutOfBoundMessageException {
1445 1446
1446 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x01, (byte) 0x1c, 1447 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x01, (byte) 0x1c,
1447 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 1448 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -1504,7 +1505,7 @@ public class PcepReportMsgTest { ...@@ -1504,7 +1505,7 @@ public class PcepReportMsgTest {
1504 * in PcRpt message. 1505 * in PcRpt message.
1505 */ 1506 */
1506 @Test 1507 @Test
1507 - public void reportMessageTest34() throws PcepParseException { 1508 + public void reportMessageTest34() throws PcepParseException, PcepOutOfBoundMessageException {
1508 1509
1509 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xB4, 1510 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xB4,
1510 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 1511 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
...@@ -1554,7 +1555,7 @@ public class PcepReportMsgTest { ...@@ -1554,7 +1555,7 @@ public class PcepReportMsgTest {
1554 * in PcRpt message. 1555 * in PcRpt message.
1555 */ 1556 */
1556 @Test 1557 @Test
1557 - public void reportMessageTest35() throws PcepParseException { 1558 + public void reportMessageTest35() throws PcepParseException, PcepOutOfBoundMessageException {
1558 1559
1559 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x8C, 1560 byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x8C,
1560 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object 1561 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
......
1 -/*
2 - * Copyright 2014-2015 Open Networking Laboratory
3 - *
4 - * Licensed under the Apache License, Version 2.0 (the "License");
5 - * you may not use this file except in compliance with the License.
6 - * You may obtain a copy of the License at
7 - *
8 - * http://www.apache.org/licenses/LICENSE-2.0
9 - *
10 - * Unless required by applicable law or agreed to in writing, software
11 - * distributed under the License is distributed on an "AS IS" BASIS,
12 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 - * See the License for the specific language governing permissions and
14 - * limitations under the License.
15 - */
16 -package org.onosproject.pcepio.protocol;
17 -
18 -import org.jboss.netty.buffer.ChannelBuffer;
19 -import org.jboss.netty.buffer.ChannelBuffers;
20 -import org.junit.Test;
21 -import org.onosproject.pcepio.exceptions.PcepParseException;
22 -
23 -import static org.hamcrest.MatcherAssert.assertThat;
24 -import static org.hamcrest.Matchers.instanceOf;
25 -import static org.hamcrest.core.Is.is;
26 -
27 -public class PcepTEReportMsgTest {
28 -
29 - /**
30 - * This test case checks for
31 - * TE Object (Routing Universe TLV, Local TE Node Descriptors TLV(AutonomousSystemTlv)).
32 - * in PcTERpt message.
33 - */
34 - @Test
35 - public void teReportMessageTest1() throws PcepParseException {
36 -
37 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x28, // common header
38 - 0x0E, 0x10, 0x00, 0x24, // TE Object Header
39 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
40 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
41 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
42 - 0x06, 0x65, 0x00, 0x08, // Local TE Node Descriptors TLV
43 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystem Tlv
44 - 0x00, 0x00, 0x00, 0x11};
45 -
46 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
47 - buffer.writeBytes(teReportMsg);
48 -
49 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
50 - PcepMessage message = null;
51 -
52 - message = reader.readFrom(buffer);
53 -
54 - byte[] testReportMsg = {0};
55 -
56 - assertThat(message, instanceOf(PcepTEReportMsg.class));
57 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
58 - message.writeTo(buf);
59 -
60 - int readLen = buf.writerIndex();
61 - testReportMsg = new byte[readLen];
62 - buf.readBytes(testReportMsg, 0, readLen);
63 -
64 - assertThat(testReportMsg, is(teReportMsg));
65 - }
66 -
67 - /**
68 - * This test case checks for
69 - * T E Object (Routing Universe TLV, Local TE Node Descriptors TLV(AutonomousSystemTlv)) with different TE-ID.
70 - * in PcTERpt message.
71 - */
72 - @Test
73 - public void teReportMessageTest2() throws PcepParseException {
74 -
75 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x28, // common header
76 - 0x0E, 0x10, 0x00, 0x24, // TE Object Header
77 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
78 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
79 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
80 - 0x06, 0x65, 0x00, 0x08, // Local TE Node Descriptors TLV
81 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
82 - 0x00, 0x00, 0x00, 0x11};
83 -
84 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
85 - buffer.writeBytes(teReportMsg);
86 -
87 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
88 - PcepMessage message = null;
89 -
90 - message = reader.readFrom(buffer);
91 -
92 - byte[] testReportMsg = {0};
93 - assertThat(message, instanceOf(PcepTEReportMsg.class));
94 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
95 - message.writeTo(buf);
96 -
97 - int readLen = buf.writerIndex();
98 - testReportMsg = new byte[readLen];
99 - buf.readBytes(testReportMsg, 0, readLen);
100 -
101 - assertThat(testReportMsg, is(teReportMsg));
102 - }
103 -
104 - /**
105 - * This test case checks for TE Object (Routing Universe TLV)
106 - * in PcTERpt message.
107 - */
108 - @Test
109 - public void teReportMessageTest3() throws PcepParseException {
110 -
111 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x1c, // common header
112 - 0x0E, 0x10, 0x00, 0x18, // TE Object Header
113 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
114 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
115 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
116 -
117 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
118 - buffer.writeBytes(teReportMsg);
119 -
120 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
121 - PcepMessage message = null;
122 -
123 - message = reader.readFrom(buffer);
124 -
125 - byte[] testReportMsg = {0};
126 - assertThat(message, instanceOf(PcepTEReportMsg.class));
127 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
128 - message.writeTo(buf);
129 -
130 - int readLen = buf.writerIndex();
131 - testReportMsg = new byte[readLen];
132 - buf.readBytes(testReportMsg, 0, readLen);
133 -
134 - assertThat(testReportMsg, is(teReportMsg));
135 - }
136 -
137 - /**
138 - * This test case checks for
139 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv.
140 - * OSPFareaIDsubTlv, RouterIDSubTlv)).
141 - * in PcTERpt message.
142 - */
143 - @Test
144 - public void teReportMessageTest4() throws PcepParseException {
145 -
146 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x44, // common header
147 - 0x0E, 0x10, 0x00, 0x40, // TE Object Header
148 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
149 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
150 - 0x00, 0x00, 0x00, 0x00,
151 - 0x00, 0x00, 0x00, 0x01,
152 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
153 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
154 - 0x00, 0x00, 0x00, 0x11,
155 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
156 - 0x00, 0x00, 0x00, 0x11,
157 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
158 - 0x00, 0x00, 0x00, 0x11,
159 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
160 - 0x00, 0x00, 0x00, 0x11,
161 - 0x00, 0x00, 0x00, 0x11};
162 -
163 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
164 - buffer.writeBytes(teReportMsg);
165 -
166 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
167 - PcepMessage message = null;
168 -
169 - message = reader.readFrom(buffer);
170 -
171 - byte[] testReportMsg = {0};
172 - assertThat(message, instanceOf(PcepTEReportMsg.class));
173 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
174 - message.writeTo(buf);
175 -
176 - int readLen = buf.writerIndex();
177 - testReportMsg = new byte[readLen];
178 - buf.readBytes(testReportMsg, 0, readLen);
179 -
180 - assertThat(testReportMsg, is(teReportMsg));
181 - }
182 -
183 - /**
184 - * This test case checks for
185 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(BGPLSidentifierTlv
186 - * OSPFareaIDsubTlv, RouterIDSubTlv))
187 - * in PcTERpt message.
188 - */
189 - @Test
190 - public void teReportMessageTest5() throws PcepParseException {
191 -
192 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x3C, // common header
193 - 0x0E, 0x10, 0x00, 0x38, // TE Object Header
194 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
195 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
196 - 0x00, 0x00, 0x00, 0x00,
197 - 0x00, 0x00, 0x00, 0x01,
198 - 0x06, 0x65, 0x00, 0x1C, // Local TE Node Descriptors TLV
199 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
200 - 0x00, 0x00, 0x00, 0x11,
201 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
202 - 0x00, 0x00, 0x00, 0x11,
203 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
204 - 0x00, 0x00, 0x00, 0x11,
205 - 0x00, 0x00, 0x00, 0x11};
206 -
207 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
208 - buffer.writeBytes(teReportMsg);
209 -
210 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
211 - PcepMessage message = null;
212 -
213 - message = reader.readFrom(buffer);
214 -
215 - byte[] testReportMsg = {0};
216 - assertThat(message, instanceOf(PcepTEReportMsg.class));
217 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
218 - message.writeTo(buf);
219 -
220 - int readLen = buf.writerIndex();
221 - testReportMsg = new byte[readLen];
222 - buf.readBytes(testReportMsg, 0, readLen);
223 -
224 - assertThat(testReportMsg, is(teReportMsg));
225 - }
226 -
227 - /**
228 - * This test case checks for TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(OSPFareaIDsubTlv,
229 - * RouterIDSubTlv))
230 - * in PcTERpt message.
231 - */
232 - @Test
233 - public void teReportMessageTest6() throws PcepParseException {
234 -
235 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x34, // common header
236 - 0x0E, 0x10, 0x00, 0x30, // TE Object Header
237 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
238 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
239 - 0x00, 0x00, 0x00, 0x00,
240 - 0x00, 0x00, 0x00, 0x01,
241 - 0x06, 0x65, 0x00, 0x14, // Local TE Node Descriptors TLV
242 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
243 - 0x00, 0x00, 0x00, 0x11,
244 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
245 - 0x00, 0x00, 0x00, 0x11,
246 - 0x00, 0x00, 0x00, 0x11};
247 -
248 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
249 - buffer.writeBytes(teReportMsg);
250 -
251 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
252 - PcepMessage message = null;
253 -
254 - message = reader.readFrom(buffer);
255 -
256 - byte[] testReportMsg = {0};
257 - assertThat(message, instanceOf(PcepTEReportMsg.class));
258 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
259 - message.writeTo(buf);
260 -
261 - int readLen = buf.writerIndex();
262 - testReportMsg = new byte[readLen];
263 - buf.readBytes(testReportMsg, 0, readLen);
264 -
265 - assertThat(testReportMsg, is(teReportMsg));
266 - }
267 -
268 - /**
269 - * This test case checks for TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(RouterIDSubTlv)).
270 - * in PcTERpt message.
271 - */
272 - @Test
273 - public void teReportMessageTest7() throws PcepParseException {
274 -
275 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x2C, // common header
276 - 0x0E, 0x10, 0x00, 0x28, // TE Object Header
277 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
278 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
279 - 0x00, 0x00, 0x00, 0x00,
280 - 0x00, 0x00, 0x00, 0x01,
281 - 0x06, 0x65, 0x00, 0x0C, // Local TE Node Descriptors TLV
282 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
283 - 0x00, 0x00, 0x00, 0x11,
284 - 0x00, 0x00, 0x00, 0x11};
285 -
286 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
287 - buffer.writeBytes(teReportMsg);
288 -
289 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
290 - PcepMessage message = null;
291 -
292 - message = reader.readFrom(buffer);
293 -
294 - byte[] testReportMsg = {0};
295 - assertThat(message, instanceOf(PcepTEReportMsg.class));
296 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
297 - message.writeTo(buf);
298 -
299 - int readLen = buf.writerIndex();
300 - testReportMsg = new byte[readLen];
301 - buf.readBytes(testReportMsg, 0, readLen);
302 -
303 - assertThat(testReportMsg, is(teReportMsg));
304 - }
305 -
306 - /**
307 - * This test case checks for TE Object (Routing Universe TLV,Local TE Node Descriptors TLV)
308 - * in PcTERpt message.
309 - */
310 - @Test
311 - public void teReportMessageTest8() throws PcepParseException {
312 -
313 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x20, // common header
314 - 0x0E, 0x10, 0x00, 0x1C, // TE Object Header
315 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
316 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
317 - 0x00, 0x00, 0x00, 0x00,
318 - 0x00, 0x00, 0x00, 0x01,
319 - 0x06, 0x65, 0x00, 0x00 // Local TE Node Descriptors TLV
320 - };
321 -
322 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
323 - buffer.writeBytes(teReportMsg);
324 -
325 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
326 - PcepMessage message = null;
327 -
328 - message = reader.readFrom(buffer);
329 -
330 - byte[] testReportMsg = {0};
331 - assertThat(message, instanceOf(PcepTEReportMsg.class));
332 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
333 - message.writeTo(buf);
334 -
335 - int readLen = buf.writerIndex();
336 - testReportMsg = new byte[readLen];
337 - buf.readBytes(testReportMsg, 0, readLen);
338 -
339 - assertThat(testReportMsg, is(teReportMsg));
340 - }
341 -
342 - /**
343 - * This test case checks for
344 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv.
345 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv.
346 - * OSPFareaIDsubTlv, RouterIDSubTlv)).
347 - * in PcTERpt message.
348 - */
349 - @Test
350 - public void teReportMessageTest9() throws PcepParseException {
351 -
352 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x6C, // common header
353 - 0x0E, 0x10, 0x00, 0x68, // TE Object Header
354 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
355 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
356 - 0x00, 0x00, 0x00, 0x00,
357 - 0x00, 0x00, 0x00, 0x01,
358 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
359 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
360 - 0x00, 0x00, 0x00, 0x11,
361 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
362 - 0x00, 0x00, 0x00, 0x11,
363 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
364 - 0x00, 0x00, 0x00, 0x11,
365 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
366 - 0x00, 0x00, 0x00, 0x11,
367 - 0x00, 0x00, 0x00, 0x11,
368 - 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
369 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
370 - 0x00, 0x00, 0x00, 0x11,
371 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
372 - 0x00, 0x00, 0x00, 0x11,
373 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
374 - 0x00, 0x00, 0x00, 0x11,
375 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
376 - 0x00, 0x00, 0x00, 0x11,
377 - 0x00, 0x00, 0x00, 0x11
378 - };
379 -
380 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
381 - buffer.writeBytes(teReportMsg);
382 -
383 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
384 - PcepMessage message = null;
385 -
386 - message = reader.readFrom(buffer);
387 -
388 - byte[] testReportMsg = {0};
389 - assertThat(message, instanceOf(PcepTEReportMsg.class));
390 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
391 - message.writeTo(buf);
392 -
393 - int readLen = buf.writerIndex();
394 - testReportMsg = new byte[readLen];
395 - buf.readBytes(testReportMsg, 0, readLen);
396 -
397 - assertThat(testReportMsg, is(teReportMsg));
398 - }
399 -
400 - /**
401 - * This test case checks for
402 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
403 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(BGPLSidentifierTlv
404 - * OSPFareaIDsubTlv, RouterIDSubTlv))
405 - * in PcTERpt message.
406 - */
407 - @Test
408 - public void teReportMessageTest10() throws PcepParseException {
409 -
410 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x64, // common header
411 - 0x0E, 0x10, 0x00, 0x60, // TE Object Header
412 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
413 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
414 - 0x00, 0x00, 0x00, 0x00,
415 - 0x00, 0x00, 0x00, 0x01,
416 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
417 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
418 - 0x00, 0x00, 0x00, 0x11,
419 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
420 - 0x00, 0x00, 0x00, 0x11,
421 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
422 - 0x00, 0x00, 0x00, 0x11,
423 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
424 - 0x00, 0x00, 0x00, 0x11,
425 - 0x00, 0x00, 0x00, 0x11,
426 - 0x03, (byte) 0xEB, 0x00, 0x1C, //RemoteTENodeDescriptorsTLV
427 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
428 - 0x00, 0x00, 0x00, 0x11,
429 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
430 - 0x00, 0x00, 0x00, 0x11,
431 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
432 - 0x00, 0x00, 0x00, 0x11,
433 - 0x00, 0x00, 0x00, 0x11
434 - };
435 -
436 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
437 - buffer.writeBytes(teReportMsg);
438 -
439 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
440 - PcepMessage message = null;
441 -
442 - message = reader.readFrom(buffer);
443 -
444 - byte[] testReportMsg = {0};
445 - assertThat(message, instanceOf(PcepTEReportMsg.class));
446 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
447 - message.writeTo(buf);
448 -
449 - int readLen = buf.writerIndex();
450 - testReportMsg = new byte[readLen];
451 - buf.readBytes(testReportMsg, 0, readLen);
452 -
453 - assertThat(testReportMsg, is(teReportMsg));
454 - }
455 -
456 - /**
457 - * This test case checks for
458 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
459 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(OSPFareaIDsubTlv, RouterIDSubTlv))
460 - * in PcTERpt message.
461 - */
462 - @Test
463 - public void teReportMessageTest11() throws PcepParseException {
464 -
465 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x5C, // common header
466 - 0x0E, 0x10, 0x00, 0x58, // TE Object Header
467 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
468 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
469 - 0x00, 0x00, 0x00, 0x00,
470 - 0x00, 0x00, 0x00, 0x01,
471 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
472 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
473 - 0x00, 0x00, 0x00, 0x11,
474 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
475 - 0x00, 0x00, 0x00, 0x11,
476 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
477 - 0x00, 0x00, 0x00, 0x11,
478 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
479 - 0x00, 0x00, 0x00, 0x11,
480 - 0x00, 0x00, 0x00, 0x11,
481 - 0x03, (byte) 0xEB, 0x00, 0x14, //RemoteTENodeDescriptorsTLV
482 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
483 - 0x00, 0x00, 0x00, 0x11,
484 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
485 - 0x00, 0x00, 0x00, 0x11,
486 - 0x00, 0x00, 0x00, 0x11
487 - };
488 -
489 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
490 - buffer.writeBytes(teReportMsg);
491 -
492 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
493 - PcepMessage message = null;
494 -
495 - message = reader.readFrom(buffer);
496 -
497 - byte[] testReportMsg = {0};
498 - assertThat(message, instanceOf(PcepTEReportMsg.class));
499 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
500 - message.writeTo(buf);
501 -
502 - int readLen = buf.writerIndex();
503 - testReportMsg = new byte[readLen];
504 - buf.readBytes(testReportMsg, 0, readLen);
505 -
506 - assertThat(testReportMsg, is(teReportMsg));
507 - }
508 -
509 - /**
510 - * This test case checks for
511 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
512 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(RouterIDSubTlv))
513 - * in PcTERpt message.
514 - */
515 - @Test
516 - public void teReportMessageTest12() throws PcepParseException {
517 -
518 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x54, // common header
519 - 0x0E, 0x10, 0x00, 0x50, // TE Object Header
520 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
521 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
522 - 0x00, 0x00, 0x00, 0x00,
523 - 0x00, 0x00, 0x00, 0x01,
524 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
525 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
526 - 0x00, 0x00, 0x00, 0x11,
527 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
528 - 0x00, 0x00, 0x00, 0x11,
529 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
530 - 0x00, 0x00, 0x00, 0x11,
531 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
532 - 0x00, 0x00, 0x00, 0x11,
533 - 0x00, 0x00, 0x00, 0x11,
534 - 0x03, (byte) 0xEB, 0x00, 0x0c, //RemoteTENodeDescriptorsTLV
535 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
536 - 0x00, 0x00, 0x00, 0x11,
537 - 0x00, 0x00, 0x00, 0x11
538 - };
539 -
540 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
541 - buffer.writeBytes(teReportMsg);
542 -
543 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
544 - PcepMessage message = null;
545 -
546 - message = reader.readFrom(buffer);
547 -
548 - byte[] testReportMsg = {0};
549 - assertThat(message, instanceOf(PcepTEReportMsg.class));
550 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
551 - message.writeTo(buf);
552 -
553 - int readLen = buf.writerIndex();
554 - testReportMsg = new byte[readLen];
555 - buf.readBytes(testReportMsg, 0, readLen);
556 -
557 - assertThat(testReportMsg, is(teReportMsg));
558 - }
559 -
560 - /**
561 - * This test case checks for
562 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
563 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV)
564 - * in PcTERpt message.
565 - */
566 - @Test
567 - public void teReportMessageTest13() throws PcepParseException {
568 -
569 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x48, // common header
570 - 0x0E, 0x10, 0x00, 0x44, // TE Object Header
571 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
572 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
573 - 0x00, 0x00, 0x00, 0x00,
574 - 0x00, 0x00, 0x00, 0x01,
575 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
576 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
577 - 0x00, 0x00, 0x00, 0x11,
578 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
579 - 0x00, 0x00, 0x00, 0x11,
580 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
581 - 0x00, 0x00, 0x00, 0x11,
582 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
583 - 0x00, 0x00, 0x00, 0x11,
584 - 0x00, 0x00, 0x00, 0x11,
585 - 0x03, (byte) 0xEB, 0x00, 0x00, //RemoteTENodeDescriptorsTLV
586 - };
587 -
588 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
589 - buffer.writeBytes(teReportMsg);
590 -
591 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
592 - PcepMessage message = null;
593 -
594 - message = reader.readFrom(buffer);
595 -
596 - byte[] testReportMsg = {0};
597 - assertThat(message, instanceOf(PcepTEReportMsg.class));
598 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
599 - message.writeTo(buf);
600 -
601 - int readLen = buf.writerIndex();
602 - testReportMsg = new byte[readLen];
603 - buf.readBytes(testReportMsg, 0, readLen);
604 -
605 - assertThat(testReportMsg, is(teReportMsg));
606 - }
607 -
608 - /**
609 - * This test case checks for
610 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
611 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
612 - * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
613 - * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv))
614 - * in PcTERpt message.
615 - */
616 - @Test
617 - public void teReportMessageTest14() throws PcepParseException {
618 -
619 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0x8C, // common header
620 - 0x0E, 0x10, 0x00, (byte) 0x88, // TE Object Header
621 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
622 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
623 - 0x00, 0x00, 0x00, 0x00,
624 - 0x00, 0x00, 0x00, 0x01,
625 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
626 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
627 - 0x00, 0x00, 0x00, 0x11,
628 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
629 - 0x00, 0x00, 0x00, 0x11,
630 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
631 - 0x00, 0x00, 0x00, 0x11,
632 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
633 - 0x00, 0x00, 0x00, 0x11,
634 - 0x00, 0x00, 0x00, 0x11,
635 - 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
636 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
637 - 0x00, 0x00, 0x00, 0x11,
638 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
639 - 0x00, 0x00, 0x00, 0x11,
640 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
641 - 0x00, 0x00, 0x00, 0x11,
642 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
643 - 0x00, 0x00, 0x00, 0x11,
644 - 0x00, 0x00, 0x00, 0x11,
645 - 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
646 - 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
647 - 0x01, 0x11, 0x00, 0x09,
648 - 0x01, 0x21, 0x00, 0x09,
649 - 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
650 - 0x01, 0x01, 0x01, 0x01,
651 - 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
652 - 0x01, 0x011, 0x01, 0x10
653 - };
654 -
655 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
656 - buffer.writeBytes(teReportMsg);
657 -
658 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
659 - PcepMessage message = null;
660 -
661 - message = reader.readFrom(buffer);
662 -
663 - byte[] testReportMsg = {0};
664 - assertThat(message, instanceOf(PcepTEReportMsg.class));
665 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
666 - message.writeTo(buf);
667 -
668 - int readLen = buf.writerIndex();
669 - testReportMsg = new byte[readLen];
670 - buf.readBytes(testReportMsg, 0, readLen);
671 -
672 - assertThat(testReportMsg, is(teReportMsg));
673 - }
674 -
675 - /**
676 - * This test case checks for
677 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
678 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
679 - * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(
680 - * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv))
681 - * in PcTERpt message.
682 - */
683 - @Test
684 - public void teReportMessageTest15() throws PcepParseException {
685 -
686 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0x80, // common header
687 - 0x0E, 0x10, 0x00, (byte) 0x7C, // TE Object Header
688 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
689 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
690 - 0x00, 0x00, 0x00, 0x00,
691 - 0x00, 0x00, 0x00, 0x01,
692 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
693 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
694 - 0x00, 0x00, 0x00, 0x11,
695 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
696 - 0x00, 0x00, 0x00, 0x11,
697 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
698 - 0x00, 0x00, 0x00, 0x11,
699 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
700 - 0x00, 0x00, 0x00, 0x11,
701 - 0x00, 0x00, 0x00, 0x11,
702 - 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
703 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
704 - 0x00, 0x00, 0x00, 0x11,
705 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
706 - 0x00, 0x00, 0x00, 0x11,
707 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
708 - 0x00, 0x00, 0x00, 0x11,
709 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
710 - 0x00, 0x00, 0x00, 0x11,
711 - 0x00, 0x00, 0x00, 0x11,
712 - 0x04, 0x2E, 0x00, 0x10, //TELinkDescriptorsTLV
713 - 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
714 - 0x01, 0x01, 0x01, 0x01,
715 - 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
716 - 0x01, 0x011, 0x01, 0x10
717 - };
718 -
719 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
720 - buffer.writeBytes(teReportMsg);
721 -
722 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
723 - PcepMessage message = null;
724 -
725 - message = reader.readFrom(buffer);
726 -
727 - byte[] testReportMsg = {0};
728 - assertThat(message, instanceOf(PcepTEReportMsg.class));
729 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
730 - message.writeTo(buf);
731 -
732 - int readLen = buf.writerIndex();
733 - testReportMsg = new byte[readLen];
734 - buf.readBytes(testReportMsg, 0, readLen);
735 -
736 - assertThat(testReportMsg, is(teReportMsg));
737 - }
738 -
739 - /**
740 - * This test case checks for
741 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
742 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
743 - * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(IPv4NeighborAddressTlv))
744 - * in PcTERpt message.
745 - */
746 - @Test
747 - public void teReportMessageTest16() throws PcepParseException {
748 -
749 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0x78, // common header
750 - 0x0E, 0x10, 0x00, (byte) 0x74, // TE Object Header
751 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
752 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
753 - 0x00, 0x00, 0x00, 0x00,
754 - 0x00, 0x00, 0x00, 0x01,
755 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
756 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
757 - 0x00, 0x00, 0x00, 0x11,
758 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
759 - 0x00, 0x00, 0x00, 0x11,
760 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
761 - 0x00, 0x00, 0x00, 0x11,
762 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
763 - 0x00, 0x00, 0x00, 0x11,
764 - 0x00, 0x00, 0x00, 0x11,
765 - 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
766 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
767 - 0x00, 0x00, 0x00, 0x11,
768 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
769 - 0x00, 0x00, 0x00, 0x11,
770 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
771 - 0x00, 0x00, 0x00, 0x11,
772 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
773 - 0x00, 0x00, 0x00, 0x11,
774 - 0x00, 0x00, 0x00, 0x11,
775 - 0x04, 0x2E, 0x00, 0x08, //TELinkDescriptorsTLV
776 - 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
777 - 0x01, 0x011, 0x01, 0x10
778 - };
779 -
780 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
781 - buffer.writeBytes(teReportMsg);
782 -
783 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
784 - PcepMessage message = null;
785 -
786 - message = reader.readFrom(buffer);
787 -
788 - byte[] testReportMsg = {0};
789 - assertThat(message, instanceOf(PcepTEReportMsg.class));
790 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
791 - message.writeTo(buf);
792 -
793 - int readLen = buf.writerIndex();
794 - testReportMsg = new byte[readLen];
795 - buf.readBytes(testReportMsg, 0, readLen);
796 -
797 - assertThat(testReportMsg, is(teReportMsg));
798 - }
799 -
800 - /**
801 - * This test case checks for
802 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
803 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
804 - * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV)
805 - * in PcTERpt message.
806 - */
807 - @Test
808 - public void teReportMessageTest17() throws PcepParseException {
809 -
810 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0x70, // common header
811 - 0x0E, 0x10, 0x00, (byte) 0x6C, // TE Object Header
812 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
813 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
814 - 0x00, 0x00, 0x00, 0x00,
815 - 0x00, 0x00, 0x00, 0x01,
816 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
817 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
818 - 0x00, 0x00, 0x00, 0x11,
819 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
820 - 0x00, 0x00, 0x00, 0x11,
821 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
822 - 0x00, 0x00, 0x00, 0x11,
823 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
824 - 0x00, 0x00, 0x00, 0x11,
825 - 0x00, 0x00, 0x00, 0x11,
826 - 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
827 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
828 - 0x00, 0x00, 0x00, 0x11,
829 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
830 - 0x00, 0x00, 0x00, 0x11,
831 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
832 - 0x00, 0x00, 0x00, 0x11,
833 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
834 - 0x00, 0x00, 0x00, 0x11,
835 - 0x00, 0x00, 0x00, 0x11,
836 - 0x04, 0x2E, 0x00, 0x00, //TELinkDescriptorsTLV
837 - };
838 -
839 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
840 - buffer.writeBytes(teReportMsg);
841 -
842 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
843 - PcepMessage message = null;
844 -
845 - message = reader.readFrom(buffer);
846 -
847 - byte[] testReportMsg = {0};
848 - assertThat(message, instanceOf(PcepTEReportMsg.class));
849 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
850 - message.writeTo(buf);
851 -
852 - int readLen = buf.writerIndex();
853 - testReportMsg = new byte[readLen];
854 - buf.readBytes(testReportMsg, 0, readLen);
855 -
856 - assertThat(testReportMsg, is(teReportMsg));
857 - }
858 -
859 - /**
860 - * This test case checks for
861 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
862 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
863 - * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
864 - * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv))
865 - * in PcTERpt message.
866 - */
867 - @Test
868 - public void teReportMessageTest18() throws PcepParseException {
869 -
870 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0xC0, // common header
871 - 0x0E, 0x10, 0x00, (byte) 0xbC, // TE Object Header
872 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
873 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
874 - 0x00, 0x00, 0x00, 0x00,
875 - 0x00, 0x00, 0x00, 0x01,
876 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
877 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
878 - 0x00, 0x00, 0x00, 0x11,
879 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
880 - 0x00, 0x00, 0x00, 0x11,
881 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
882 - 0x00, 0x00, 0x00, 0x11,
883 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
884 - 0x00, 0x00, 0x00, 0x11,
885 - 0x00, 0x00, 0x00, 0x11,
886 - 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
887 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
888 - 0x00, 0x00, 0x00, 0x11,
889 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
890 - 0x00, 0x00, 0x00, 0x11,
891 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
892 - 0x00, 0x00, 0x00, 0x11,
893 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
894 - 0x00, 0x00, 0x00, 0x11,
895 - 0x00, 0x00, 0x00, 0x11,
896 - 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
897 - 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
898 - 0x01, 0x11, 0x00, 0x09,
899 - 0x01, 0x21, 0x00, 0x09,
900 - 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
901 - 0x01, 0x01, 0x01, 0x01,
902 - 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
903 - 0x01, 0x011, 0x01, 0x10,
904 - 0x04, (byte) 0xF3, 0x00, 0x30, //TENodeAttributesTlv
905 - 0x00, 0x0E, 0x00, 0x01, //NodeFlagBitsTlv
906 - (byte) 0x90, 0x00, 0x00, 0x00,
907 - 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
908 - 0x01, 0x011, 0x01, 0x10,
909 - 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
910 - 0x08, 0x00, 0x01, 0x09,
911 - 0x08, 0x00, 0x01, 0x09,
912 - 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
913 - 0x20, 0x01, 0x22, 0x01,
914 - 0x20, 0x01, 0x22, 0x01,
915 - 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
916 - 0x00, 0x01, 0x01, 0x02
917 - };
918 -
919 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
920 - buffer.writeBytes(teReportMsg);
921 -
922 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
923 - PcepMessage message = null;
924 -
925 - message = reader.readFrom(buffer);
926 -
927 - byte[] testReportMsg = {0};
928 - assertThat(message, instanceOf(PcepTEReportMsg.class));
929 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
930 - message.writeTo(buf);
931 -
932 - int readLen = buf.writerIndex();
933 - testReportMsg = new byte[readLen];
934 - buf.readBytes(testReportMsg, 0, readLen);
935 -
936 - assertThat(testReportMsg, is(teReportMsg));
937 - }
938 -
939 - /**
940 - * This test case checks for
941 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
942 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
943 - * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
944 - * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv
945 - * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
946 - * in PcTERpt message.
947 - */
948 - @Test
949 - public void teReportMessageTest19() throws PcepParseException {
950 -
951 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0xC0, // common header
952 - 0x0E, 0x10, 0x00, (byte) 0xBC, // TE Object Header
953 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
954 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
955 - 0x00, 0x00, 0x00, 0x00,
956 - 0x00, 0x00, 0x00, 0x01,
957 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
958 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
959 - 0x00, 0x00, 0x00, 0x11,
960 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
961 - 0x00, 0x00, 0x00, 0x11,
962 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
963 - 0x00, 0x00, 0x00, 0x11,
964 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
965 - 0x00, 0x00, 0x00, 0x11,
966 - 0x00, 0x00, 0x00, 0x11,
967 - 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
968 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
969 - 0x00, 0x00, 0x00, 0x11,
970 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
971 - 0x00, 0x00, 0x00, 0x11,
972 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
973 - 0x00, 0x00, 0x00, 0x11,
974 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
975 - 0x00, 0x00, 0x00, 0x11,
976 - 0x00, 0x00, 0x00, 0x11,
977 - 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
978 - 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
979 - 0x01, 0x11, 0x00, 0x09,
980 - 0x01, 0x21, 0x00, 0x09,
981 - 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
982 - 0x01, 0x01, 0x01, 0x01,
983 - 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
984 - 0x01, 0x011, 0x01, 0x10,
985 - 0x04, (byte) 0xF3, 0x00, 0x30, //TENodeAttributesTlv
986 - 0x00, 0x0E, 0x00, 0x01, //NodeFlagBitsTlv
987 - (byte) 0x90, 0x00, 0x00, 0x00,
988 - 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
989 - 0x01, 0x011, 0x01, 0x10,
990 - 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
991 - 0x08, 0x00, 0x01, 0x09,
992 - 0x08, 0x00, 0x01, 0x09,
993 - 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
994 - 0x20, 0x01, 0x22, 0x01,
995 - 0x20, 0x01, 0x22, 0x01,
996 - 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
997 - 0x00, 0x01, 0x01, 0x02
998 - };
999 -
1000 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1001 - buffer.writeBytes(teReportMsg);
1002 -
1003 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1004 - PcepMessage message = null;
1005 -
1006 - message = reader.readFrom(buffer);
1007 -
1008 - byte[] testReportMsg = {0};
1009 - assertThat(message, instanceOf(PcepTEReportMsg.class));
1010 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1011 - message.writeTo(buf);
1012 -
1013 - int readLen = buf.writerIndex();
1014 - testReportMsg = new byte[readLen];
1015 - buf.readBytes(testReportMsg, 0, readLen);
1016 -
1017 - assertThat(testReportMsg, is(teReportMsg));
1018 - }
1019 -
1020 - /**
1021 - * This test case checks for
1022 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
1023 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
1024 - * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
1025 - * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(OpaqueNodeAttributeTlv
1026 - * NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
1027 - * in PcTERpt message.
1028 - */
1029 - @Test
1030 - public void teReportMessageTest20() throws PcepParseException {
1031 -
1032 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0xB8, // common header
1033 - 0x0E, 0x10, 0x00, (byte) 0xB4, // TE Object Header
1034 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
1035 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
1036 - 0x00, 0x00, 0x00, 0x00,
1037 - 0x00, 0x00, 0x00, 0x01,
1038 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
1039 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
1040 - 0x00, 0x00, 0x00, 0x11,
1041 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
1042 - 0x00, 0x00, 0x00, 0x11,
1043 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
1044 - 0x00, 0x00, 0x00, 0x11,
1045 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
1046 - 0x00, 0x00, 0x00, 0x11,
1047 - 0x00, 0x00, 0x00, 0x11,
1048 - 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
1049 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
1050 - 0x00, 0x00, 0x00, 0x11,
1051 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
1052 - 0x00, 0x00, 0x00, 0x11,
1053 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
1054 - 0x00, 0x00, 0x00, 0x11,
1055 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
1056 - 0x00, 0x00, 0x00, 0x11,
1057 - 0x00, 0x00, 0x00, 0x11,
1058 - 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
1059 - 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
1060 - 0x01, 0x11, 0x00, 0x09,
1061 - 0x01, 0x21, 0x00, 0x09,
1062 - 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
1063 - 0x01, 0x01, 0x01, 0x01,
1064 - 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
1065 - 0x01, 0x011, 0x01, 0x10,
1066 - 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
1067 - 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
1068 - 0x01, 0x011, 0x01, 0x10,
1069 - 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
1070 - 0x08, 0x00, 0x01, 0x09,
1071 - 0x08, 0x00, 0x01, 0x09,
1072 - 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
1073 - 0x20, 0x01, 0x22, 0x01,
1074 - 0x20, 0x01, 0x22, 0x01,
1075 - 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
1076 - 0x00, 0x01, 0x01, 0x02
1077 - };
1078 -
1079 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1080 - buffer.writeBytes(teReportMsg);
1081 -
1082 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1083 - PcepMessage message = null;
1084 -
1085 - message = reader.readFrom(buffer);
1086 -
1087 - byte[] testReportMsg = {0};
1088 - assertThat(message, instanceOf(PcepTEReportMsg.class));
1089 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1090 - message.writeTo(buf);
1091 -
1092 - int readLen = buf.writerIndex();
1093 - testReportMsg = new byte[readLen];
1094 - buf.readBytes(testReportMsg, 0, readLen);
1095 -
1096 - assertThat(testReportMsg, is(teReportMsg));
1097 - }
1098 -
1099 - /**
1100 - * This test case checks for
1101 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
1102 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
1103 - * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv.
1104 - * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(OpaqueNodeAttributeTlv
1105 - * ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
1106 - * in PcTERpt message.
1107 - */
1108 - @Test
1109 - public void teReportMessageTest21() throws PcepParseException {
1110 -
1111 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0xAC, // common header
1112 - 0x0E, 0x10, 0x00, (byte) 0xA8, // TE Object Header
1113 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
1114 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
1115 - 0x00, 0x00, 0x00, 0x00,
1116 - 0x00, 0x00, 0x00, 0x01,
1117 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
1118 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
1119 - 0x00, 0x00, 0x00, 0x11,
1120 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
1121 - 0x00, 0x00, 0x00, 0x11,
1122 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
1123 - 0x00, 0x00, 0x00, 0x11,
1124 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
1125 - 0x00, 0x00, 0x00, 0x11,
1126 - 0x00, 0x00, 0x00, 0x11,
1127 - 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
1128 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
1129 - 0x00, 0x00, 0x00, 0x11,
1130 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
1131 - 0x00, 0x00, 0x00, 0x11,
1132 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
1133 - 0x00, 0x00, 0x00, 0x11,
1134 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
1135 - 0x00, 0x00, 0x00, 0x11,
1136 - 0x00, 0x00, 0x00, 0x11,
1137 - 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
1138 - 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
1139 - 0x01, 0x11, 0x00, 0x09,
1140 - 0x01, 0x21, 0x00, 0x09,
1141 - 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
1142 - 0x01, 0x01, 0x01, 0x01,
1143 - 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
1144 - 0x01, 0x011, 0x01, 0x10,
1145 - 0x04, (byte) 0xF3, 0x00, 0x1C, //TENodeAttributesTlv
1146 - 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
1147 - 0x01, 0x011, 0x01, 0x10,
1148 - 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
1149 - 0x20, 0x01, 0x22, 0x01,
1150 - 0x20, 0x01, 0x22, 0x01,
1151 - 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
1152 - 0x00, 0x01, 0x01, 0x02
1153 - };
1154 -
1155 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1156 - buffer.writeBytes(teReportMsg);
1157 -
1158 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1159 - PcepMessage message = null;
1160 -
1161 - message = reader.readFrom(buffer);
1162 -
1163 - byte[] testReportMsg = {0};
1164 - assertThat(message, instanceOf(PcepTEReportMsg.class));
1165 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1166 - message.writeTo(buf);
1167 -
1168 - int readLen = buf.writerIndex();
1169 - testReportMsg = new byte[readLen];
1170 - buf.readBytes(testReportMsg, 0, readLen);
1171 -
1172 - assertThat(testReportMsg, is(teReportMsg));
1173 - }
1174 -
1175 - /**
1176 - * This test case checks for
1177 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv.
1178 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv.
1179 - * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv.
1180 - * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv.
1181 - * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv).
1182 - * TELinkAttributesTlv(IPv4TERouterIdOfRemoteNodeTlv, IPv6TERouterIdofRemoteNodeTlv, AdministrativeGroupTlv.
1183 - * MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv.
1184 - * LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv:, SharedRiskLinkGroupTlv.
1185 - * OpaqueLinkAttributeTlv, LinkNameTlv)).
1186 - * in PcTERpt message.
1187 - */
1188 - @Test
1189 - public void teReportMessageTest22() throws PcepParseException {
1190 -
1191 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x120, // common header
1192 - 0x0E, 0x10, 0x01, (byte) 0x1C, // TE Object Header
1193 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
1194 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
1195 - 0x00, 0x00, 0x00, 0x00,
1196 - 0x00, 0x00, 0x00, 0x01,
1197 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
1198 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
1199 - 0x00, 0x00, 0x00, 0x11,
1200 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
1201 - 0x00, 0x00, 0x00, 0x11,
1202 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
1203 - 0x00, 0x00, 0x00, 0x11,
1204 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
1205 - 0x00, 0x00, 0x00, 0x11,
1206 - 0x00, 0x00, 0x00, 0x11,
1207 - 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
1208 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
1209 - 0x00, 0x00, 0x00, 0x11,
1210 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
1211 - 0x00, 0x00, 0x00, 0x11,
1212 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
1213 - 0x00, 0x00, 0x00, 0x11,
1214 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
1215 - 0x00, 0x00, 0x00, 0x11,
1216 - 0x00, 0x00, 0x00, 0x11,
1217 - 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
1218 - 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
1219 - 0x01, 0x11, 0x00, 0x09,
1220 - 0x01, 0x21, 0x00, 0x09,
1221 - 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
1222 - 0x01, 0x01, 0x01, 0x01,
1223 - 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
1224 - 0x01, 0x011, 0x01, 0x10,
1225 - 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
1226 - 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
1227 - 0x01, 0x011, 0x01, 0x10,
1228 - 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
1229 - 0x08, 0x00, 0x01, 0x09,
1230 - 0x08, 0x00, 0x01, 0x09,
1231 - 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
1232 - 0x20, 0x01, 0x22, 0x01,
1233 - 0x20, 0x01, 0x22, 0x01,
1234 - 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
1235 - 0x00, 0x01, 0x01, 0x02,
1236 - 0x07, 0x69, 0x00, 0x64, //TELinkAttributesTlv
1237 - 0x05, 0x3C, 0x00, 0x04, //IPv4TERouterIdOfRemoteNodeTlv
1238 - 0x00, 0x07, 0x08, 0x00,
1239 - 0x00, 0x03, 0x00, 0x04, //AdministrativeGroupTlv
1240 - 0x00, 0x09, 0x08, 0x00,
1241 - 0x00, 0x09, 0x00, 0x04, //MaximumLinkBandwidthTlv
1242 - 0x00, 0x09, 0x00, 0x00,
1243 - 0x00, 0x0a, 0x00, 0x04, //MaximumReservableLinkBandwidthTlv
1244 - 0x00, 0x10, 0x00, 0x00,
1245 - 0x00, 0x0b, 0x00, 0x04, //UnreservedBandwidthTlv
1246 - 0x00, 0x00, (byte) 0x90, 0x00,
1247 - 0x34, 0x58, 0x00, 0x04, //TEDefaultMetricTlv
1248 - 0x00, (byte) 0x99, 0x09, 0x00,
1249 - 0x00, 0x14, 0x00, 0x02, //LinkProtectionTypeTlv
1250 - 0x09, 0x00, 0x00, 0x00,
1251 - 0x04, 0x46, 0x00, 0x01, //MPLSProtocolMaskTlv
1252 - (byte) 0x80, 0x00, 0x00, 0x00,
1253 - 0x04, 0x47, 0x00, 0x03, //IGPMetricTlv
1254 - 0x09, (byte) 0x89, 0x07, 0x00,
1255 - 0x04, 0x48, 0x00, 0x08, //SharedRiskLinkGroupTlv
1256 - 0x04, 0x47, 0x00, 0x03,
1257 - 0x04, 0x47, 0x00, 0x03, //OpaqueLinkAttributeTlv
1258 - 0x04, 0x49, 0x00, 0x04,
1259 - 0x04, 0x47, 0x00, 0x03,
1260 - 0x04, 0x4A, 0x00, 0x04, //LinkNameTlv
1261 - 0x04, 0x47, 0x00, 0x03
1262 - };
1263 -
1264 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1265 - buffer.writeBytes(teReportMsg);
1266 -
1267 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1268 - PcepMessage message = null;
1269 -
1270 - message = reader.readFrom(buffer);
1271 -
1272 - byte[] testReportMsg = {0};
1273 - assertThat(message, instanceOf(PcepTEReportMsg.class));
1274 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1275 - message.writeTo(buf);
1276 -
1277 - int readLen = buf.writerIndex();
1278 - testReportMsg = new byte[readLen];
1279 - buf.readBytes(testReportMsg, 0, readLen);
1280 -
1281 - assertThat(testReportMsg, is(teReportMsg));
1282 - }
1283 -
1284 - /**
1285 - * This test case checks for
1286 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
1287 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
1288 - * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
1289 - * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv
1290 - * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv)
1291 - * TELinkAttributesTlv(IPv4TERouterIdOfRemoteNodeTlv, IPv6TERouterIdofRemoteNodeTlv, AdministrativeGroupTlv
1292 - * MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv
1293 - * LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv:, SharedRiskLinkGroupTlv
1294 - * OpaqueLinkAttributeTlv))
1295 - * in PcTERpt message.
1296 - */
1297 - @Test
1298 - public void teReportMessageTest23() throws PcepParseException {
1299 -
1300 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x118, // common header
1301 - 0x0E, 0x10, 0x01, (byte) 0x14, // TE Object Header
1302 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
1303 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
1304 - 0x00, 0x00, 0x00, 0x00,
1305 - 0x00, 0x00, 0x00, 0x01,
1306 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
1307 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
1308 - 0x00, 0x00, 0x00, 0x11,
1309 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
1310 - 0x00, 0x00, 0x00, 0x11,
1311 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
1312 - 0x00, 0x00, 0x00, 0x11,
1313 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
1314 - 0x00, 0x00, 0x00, 0x11,
1315 - 0x00, 0x00, 0x00, 0x11,
1316 - 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
1317 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
1318 - 0x00, 0x00, 0x00, 0x11,
1319 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
1320 - 0x00, 0x00, 0x00, 0x11,
1321 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
1322 - 0x00, 0x00, 0x00, 0x11,
1323 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
1324 - 0x00, 0x00, 0x00, 0x11,
1325 - 0x00, 0x00, 0x00, 0x11,
1326 - 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
1327 - 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
1328 - 0x01, 0x11, 0x00, 0x09,
1329 - 0x01, 0x21, 0x00, 0x09,
1330 - 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
1331 - 0x01, 0x01, 0x01, 0x01,
1332 - 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
1333 - 0x01, 0x011, 0x01, 0x10,
1334 - 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
1335 - 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
1336 - 0x01, 0x011, 0x01, 0x10,
1337 - 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
1338 - 0x08, 0x00, 0x01, 0x09,
1339 - 0x08, 0x00, 0x01, 0x09,
1340 - 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
1341 - 0x20, 0x01, 0x22, 0x01,
1342 - 0x20, 0x01, 0x22, 0x01,
1343 - 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
1344 - 0x00, 0x01, 0x01, 0x02,
1345 - 0x07, 0x69, 0x00, 0x5C, //TELinkAttributesTlv
1346 - 0x05, 0x3C, 0x00, 0x04, //IPv4TERouterIdOfRemoteNodeTlv
1347 - 0x00, 0x07, 0x08, 0x00,
1348 - 0x00, 0x03, 0x00, 0x04, //AdministrativeGroupTlv
1349 - 0x00, 0x09, 0x08, 0x00,
1350 - 0x00, 0x09, 0x00, 0x04, //MaximumLinkBandwidthTlv
1351 - 0x00, 0x09, 0x00, 0x00,
1352 - 0x00, 0x0a, 0x00, 0x04, //MaximumReservableLinkBandwidthTlv
1353 - 0x00, 0x10, 0x00, 0x00,
1354 - 0x00, 0x0b, 0x00, 0x04, //UnreservedBandwidthTlv
1355 - 0x00, 0x00, (byte) 0x90, 0x00,
1356 - 0x34, 0x58, 0x00, 0x04, //TEDefaultMetricTlv
1357 - 0x00, (byte) 0x99, 0x09, 0x00,
1358 - 0x00, 0x14, 0x00, 0x02, //LinkProtectionTypeTlv
1359 - 0x09, 0x00, 0x00, 0x00,
1360 - 0x04, 0x46, 0x00, 0x01, //MPLSProtocolMaskTlv
1361 - (byte) 0x80, 0x00, 0x00, 0x00,
1362 - 0x04, 0x47, 0x00, 0x03, //IGPMetricTlv
1363 - 0x09, (byte) 0x89, 0x07, 0x00,
1364 - 0x04, 0x48, 0x00, 0x08, //SharedRiskLinkGroupTlv
1365 - 0x04, 0x47, 0x00, 0x03,
1366 - 0x04, 0x47, 0x00, 0x03, //OpaqueLinkAttributeTlv
1367 - 0x04, 0x49, 0x00, 0x04,
1368 - 0x04, 0x47, 0x00, 0x03
1369 - };
1370 -
1371 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1372 - buffer.writeBytes(teReportMsg);
1373 -
1374 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1375 - PcepMessage message = null;
1376 -
1377 - message = reader.readFrom(buffer);
1378 -
1379 - byte[] testReportMsg = {0};
1380 - assertThat(message, instanceOf(PcepTEReportMsg.class));
1381 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1382 - message.writeTo(buf);
1383 -
1384 - int readLen = buf.writerIndex();
1385 - testReportMsg = new byte[readLen];
1386 - buf.readBytes(testReportMsg, 0, readLen);
1387 -
1388 - assertThat(testReportMsg, is(teReportMsg));
1389 - }
1390 -
1391 - /**
1392 - * This test case checks for
1393 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
1394 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
1395 - * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
1396 - * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv
1397 - * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv)
1398 - * TELinkAttributesTlv(IPv4TERouterIdOfRemoteNodeTlv, IPv6TERouterIdofRemoteNodeTlv, AdministrativeGroupTlv
1399 - * MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv
1400 - * LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv:, SharedRiskLinkGroupTlv))
1401 - * in PcTERpt message.
1402 - */
1403 - @Test
1404 - public void teReportMessageTest24() throws PcepParseException {
1405 -
1406 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x110, // common header
1407 - 0x0E, 0x10, 0x01, (byte) 0x0C, // TE Object Header
1408 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
1409 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
1410 - 0x00, 0x00, 0x00, 0x00,
1411 - 0x00, 0x00, 0x00, 0x01,
1412 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
1413 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
1414 - 0x00, 0x00, 0x00, 0x11,
1415 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
1416 - 0x00, 0x00, 0x00, 0x11,
1417 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
1418 - 0x00, 0x00, 0x00, 0x11,
1419 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
1420 - 0x00, 0x00, 0x00, 0x11,
1421 - 0x00, 0x00, 0x00, 0x11,
1422 - 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
1423 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
1424 - 0x00, 0x00, 0x00, 0x11,
1425 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
1426 - 0x00, 0x00, 0x00, 0x11,
1427 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
1428 - 0x00, 0x00, 0x00, 0x11,
1429 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
1430 - 0x00, 0x00, 0x00, 0x11,
1431 - 0x00, 0x00, 0x00, 0x11,
1432 - 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
1433 - 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
1434 - 0x01, 0x11, 0x00, 0x09,
1435 - 0x01, 0x21, 0x00, 0x09,
1436 - 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
1437 - 0x01, 0x01, 0x01, 0x01,
1438 - 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
1439 - 0x01, 0x011, 0x01, 0x10,
1440 - 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
1441 - 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
1442 - 0x01, 0x011, 0x01, 0x10,
1443 - 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
1444 - 0x08, 0x00, 0x01, 0x09,
1445 - 0x08, 0x00, 0x01, 0x09,
1446 - 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
1447 - 0x20, 0x01, 0x22, 0x01,
1448 - 0x20, 0x01, 0x22, 0x01,
1449 - 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
1450 - 0x00, 0x01, 0x01, 0x02,
1451 - 0x07, 0x69, 0x00, 0x54, //TELinkAttributesTlv
1452 - 0x05, 0x3C, 0x00, 0x04, //IPv4TERouterIdOfRemoteNodeTlv
1453 - 0x00, 0x07, 0x08, 0x00,
1454 - 0x00, 0x03, 0x00, 0x04, //AdministrativeGroupTlv
1455 - 0x00, 0x09, 0x08, 0x00,
1456 - 0x00, 0x09, 0x00, 0x04, //MaximumLinkBandwidthTlv
1457 - 0x00, 0x09, 0x00, 0x00,
1458 - 0x00, 0x0a, 0x00, 0x04, //MaximumReservableLinkBandwidthTlv
1459 - 0x00, 0x10, 0x00, 0x00,
1460 - 0x00, 0x0b, 0x00, 0x04, //UnreservedBandwidthTlv
1461 - 0x00, 0x00, (byte) 0x90, 0x00,
1462 - 0x34, 0x58, 0x00, 0x04, //TEDefaultMetricTlv
1463 - 0x00, (byte) 0x99, 0x09, 0x00,
1464 - 0x00, 0x14, 0x00, 0x02, //LinkProtectionTypeTlv
1465 - 0x09, 0x00, 0x00, 0x00,
1466 - 0x04, 0x46, 0x00, 0x01, //MPLSProtocolMaskTlv
1467 - (byte) 0x80, 0x00, 0x00, 0x00,
1468 - 0x04, 0x47, 0x00, 0x03, //IGPMetricTlv
1469 - 0x09, (byte) 0x89, 0x07, 0x00,
1470 - 0x04, 0x48, 0x00, 0x08, //SharedRiskLinkGroupTlv
1471 - 0x04, 0x47, 0x00, 0x03,
1472 - 0x04, 0x47, 0x00, 0x03
1473 - };
1474 -
1475 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1476 - buffer.writeBytes(teReportMsg);
1477 -
1478 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1479 - PcepMessage message = null;
1480 -
1481 - message = reader.readFrom(buffer);
1482 -
1483 - byte[] testReportMsg = {0};
1484 - assertThat(message, instanceOf(PcepTEReportMsg.class));
1485 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1486 - message.writeTo(buf);
1487 -
1488 - int readLen = buf.writerIndex();
1489 - testReportMsg = new byte[readLen];
1490 - buf.readBytes(testReportMsg, 0, readLen);
1491 -
1492 - assertThat(testReportMsg, is(teReportMsg));
1493 - }
1494 -
1495 - /**
1496 - * This test case checks for
1497 - * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
1498 - * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
1499 - * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
1500 - * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv
1501 - * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv)
1502 - * TELinkAttributesTlv(IPv4TERouterIdOfRemoteNodeTlv, IPv6TERouterIdofRemoteNodeTlv, AdministrativeGroupTlv
1503 - * MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv
1504 - * LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv))
1505 - * in PcTERpt message.
1506 - */
1507 - @Test
1508 - public void teReportMessageTest25() throws PcepParseException {
1509 -
1510 - byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x104, // common header
1511 - 0x0E, 0x10, 0x01, 0x00, // TE Object Header
1512 - 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
1513 - 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
1514 - 0x00, 0x00, 0x00, 0x00,
1515 - 0x00, 0x00, 0x00, 0x01,
1516 - 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
1517 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
1518 - 0x00, 0x00, 0x00, 0x11,
1519 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
1520 - 0x00, 0x00, 0x00, 0x11,
1521 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
1522 - 0x00, 0x00, 0x00, 0x11,
1523 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
1524 - 0x00, 0x00, 0x00, 0x11,
1525 - 0x00, 0x00, 0x00, 0x11,
1526 - 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
1527 - 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
1528 - 0x00, 0x00, 0x00, 0x11,
1529 - 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
1530 - 0x00, 0x00, 0x00, 0x11,
1531 - 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
1532 - 0x00, 0x00, 0x00, 0x11,
1533 - 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
1534 - 0x00, 0x00, 0x00, 0x11,
1535 - 0x00, 0x00, 0x00, 0x11,
1536 - 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
1537 - 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
1538 - 0x01, 0x11, 0x00, 0x09,
1539 - 0x01, 0x21, 0x00, 0x09,
1540 - 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
1541 - 0x01, 0x01, 0x01, 0x01,
1542 - 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
1543 - 0x01, 0x011, 0x01, 0x10,
1544 - 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
1545 - 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
1546 - 0x01, 0x011, 0x01, 0x10,
1547 - 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
1548 - 0x08, 0x00, 0x01, 0x09,
1549 - 0x08, 0x00, 0x01, 0x09,
1550 - 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
1551 - 0x20, 0x01, 0x22, 0x01,
1552 - 0x20, 0x01, 0x22, 0x01,
1553 - 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
1554 - 0x00, 0x01, 0x01, 0x02,
1555 - 0x07, 0x69, 0x00, 0x48, //TELinkAttributesTlv
1556 - 0x05, 0x3C, 0x00, 0x04, //IPv4TERouterIdOfRemoteNodeTlv
1557 - 0x00, 0x07, 0x08, 0x00,
1558 - 0x00, 0x03, 0x00, 0x04, //AdministrativeGroupTlv
1559 - 0x00, 0x09, 0x08, 0x00,
1560 - 0x00, 0x09, 0x00, 0x04, //MaximumLinkBandwidthTlv
1561 - 0x00, 0x09, 0x00, 0x00,
1562 - 0x00, 0x0a, 0x00, 0x04, //MaximumReservableLinkBandwidthTlv
1563 - 0x00, 0x10, 0x00, 0x00,
1564 - 0x00, 0x0b, 0x00, 0x04, //UnreservedBandwidthTlv
1565 - 0x00, 0x00, (byte) 0x90, 0x00,
1566 - 0x34, 0x58, 0x00, 0x04, //TEDefaultMetricTlv
1567 - 0x00, (byte) 0x99, 0x09, 0x00,
1568 - 0x00, 0x14, 0x00, 0x02, //LinkProtectionTypeTlv
1569 - 0x09, 0x00, 0x00, 0x00,
1570 - 0x04, 0x46, 0x00, 0x01, //MPLSProtocolMaskTlv
1571 - (byte) 0x80, 0x00, 0x00, 0x00,
1572 - 0x04, 0x47, 0x00, 0x03, //IGPMetricTlv
1573 - 0x09, (byte) 0x89, 0x07, 0x00
1574 - };
1575 -
1576 - ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
1577 - buffer.writeBytes(teReportMsg);
1578 -
1579 - PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
1580 - PcepMessage message = null;
1581 -
1582 - message = reader.readFrom(buffer);
1583 -
1584 - byte[] testReportMsg = {0};
1585 -
1586 - assertThat(message, instanceOf(PcepTEReportMsg.class));
1587 - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
1588 - message.writeTo(buf);
1589 -
1590 - int readLen = buf.writerIndex();
1591 - testReportMsg = new byte[readLen];
1592 - buf.readBytes(testReportMsg, 0, readLen);
1593 -
1594 - assertThat(testReportMsg, is(teReportMsg));
1595 - }
1596 -}
...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol; ...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol;
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers; 19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Test; 20 import org.junit.Test;
21 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
21 import org.onosproject.pcepio.exceptions.PcepParseException; 22 import org.onosproject.pcepio.exceptions.PcepParseException;
22 23
23 import static org.hamcrest.MatcherAssert.assertThat; 24 import static org.hamcrest.MatcherAssert.assertThat;
...@@ -34,7 +35,7 @@ public class PcepUpdateMsgExtTest { ...@@ -34,7 +35,7 @@ public class PcepUpdateMsgExtTest {
34 * Metric object in PcepUpdate message. 35 * Metric object in PcepUpdate message.
35 */ 36 */
36 @Test 37 @Test
37 - public void pcepUpdateMsgTest1() throws PcepParseException { 38 + public void pcepUpdateMsgTest1() throws PcepParseException, PcepOutOfBoundMessageException {
38 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x8c, 39 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x8c,
39 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 40 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
40 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 41 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -80,7 +81,7 @@ public class PcepUpdateMsgExtTest { ...@@ -80,7 +81,7 @@ public class PcepUpdateMsgExtTest {
80 * LSPA, Bandwidth object in PcepUpdate message. 81 * LSPA, Bandwidth object in PcepUpdate message.
81 */ 82 */
82 @Test 83 @Test
83 - public void pcepUpdateMsgTest2() throws PcepParseException { 84 + public void pcepUpdateMsgTest2() throws PcepParseException, PcepOutOfBoundMessageException {
84 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68, 85 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
85 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 86 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
86 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object 87 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -121,7 +122,7 @@ public class PcepUpdateMsgExtTest { ...@@ -121,7 +122,7 @@ public class PcepUpdateMsgExtTest {
121 * Metric object in PcepUpdate message. 122 * Metric object in PcepUpdate message.
122 */ 123 */
123 @Test 124 @Test
124 - public void pcepUpdateMsgTest3() throws PcepParseException { 125 + public void pcepUpdateMsgTest3() throws PcepParseException, PcepOutOfBoundMessageException {
125 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54, 126 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
126 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 127 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
127 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object 128 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -159,7 +160,7 @@ public class PcepUpdateMsgExtTest { ...@@ -159,7 +160,7 @@ public class PcepUpdateMsgExtTest {
159 * Metric object in PcepUpdate message. 160 * Metric object in PcepUpdate message.
160 */ 161 */
161 @Test 162 @Test
162 - public void pcepUpdateMsgTest4() throws PcepParseException { 163 + public void pcepUpdateMsgTest4() throws PcepParseException, PcepOutOfBoundMessageException {
163 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c, 164 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
164 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 165 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
165 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object 166 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -198,7 +199,7 @@ public class PcepUpdateMsgExtTest { ...@@ -198,7 +199,7 @@ public class PcepUpdateMsgExtTest {
198 * Metric object in PcepUpdate message. 199 * Metric object in PcepUpdate message.
199 */ 200 */
200 @Test 201 @Test
201 - public void pcepUpdateMsgTest5() throws PcepParseException { 202 + public void pcepUpdateMsgTest5() throws PcepParseException, PcepOutOfBoundMessageException {
202 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x60, 203 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x60,
203 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 204 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
204 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object 205 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -238,7 +239,7 @@ public class PcepUpdateMsgExtTest { ...@@ -238,7 +239,7 @@ public class PcepUpdateMsgExtTest {
238 * Metric object in PcepUpdate message. 239 * Metric object in PcepUpdate message.
239 */ 240 */
240 @Test 241 @Test
241 - public void pcepUpdateMsgTest6() throws PcepParseException { 242 + public void pcepUpdateMsgTest6() throws PcepParseException, PcepOutOfBoundMessageException {
242 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c, 243 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
243 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 244 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
244 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object 245 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -277,7 +278,7 @@ public class PcepUpdateMsgExtTest { ...@@ -277,7 +278,7 @@ public class PcepUpdateMsgExtTest {
277 * bandwidth object Metric object in PcepUpdate message. 278 * bandwidth object Metric object in PcepUpdate message.
278 */ 279 */
279 @Test 280 @Test
280 - public void pcepUpdateMsgTest7() throws PcepParseException { 281 + public void pcepUpdateMsgTest7() throws PcepParseException, PcepOutOfBoundMessageException {
281 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x64, 282 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x64,
282 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 283 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
283 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 284 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -317,7 +318,7 @@ public class PcepUpdateMsgExtTest { ...@@ -317,7 +318,7 @@ public class PcepUpdateMsgExtTest {
317 * bandwidth object in PcepUpdate message. 318 * bandwidth object in PcepUpdate message.
318 */ 319 */
319 @Test 320 @Test
320 - public void pcepUpdateMsgTest8() throws PcepParseException { 321 + public void pcepUpdateMsgTest8() throws PcepParseException, PcepOutOfBoundMessageException {
321 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c, 322 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
322 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 323 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
323 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object 324 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -357,7 +358,7 @@ public class PcepUpdateMsgExtTest { ...@@ -357,7 +358,7 @@ public class PcepUpdateMsgExtTest {
357 * bandwidth object in PcepUpdate message. 358 * bandwidth object in PcepUpdate message.
358 */ 359 */
359 @Test 360 @Test
360 - public void pcepUpdateMsgTest9() throws PcepParseException { 361 + public void pcepUpdateMsgTest9() throws PcepParseException, PcepOutOfBoundMessageException {
361 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58, 362 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
362 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 363 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
363 0x20, 0x10, 0x00, 0x18, 0x00, 0x00, 0x10, 0x03, 364 0x20, 0x10, 0x00, 0x18, 0x00, 0x00, 0x10, 0x03,
...@@ -396,7 +397,7 @@ public class PcepUpdateMsgExtTest { ...@@ -396,7 +397,7 @@ public class PcepUpdateMsgExtTest {
396 * bandwidth object in PcepUpdate message. 397 * bandwidth object in PcepUpdate message.
397 */ 398 */
398 @Test 399 @Test
399 - public void pcepUpdateMsgTest10() throws PcepParseException { 400 + public void pcepUpdateMsgTest10() throws PcepParseException, PcepOutOfBoundMessageException {
400 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50, 401 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50,
401 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 402 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
402 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object 403 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -434,7 +435,7 @@ public class PcepUpdateMsgExtTest { ...@@ -434,7 +435,7 @@ public class PcepUpdateMsgExtTest {
434 * bandwidth object in PcepUpdate message. 435 * bandwidth object in PcepUpdate message.
435 */ 436 */
436 @Test 437 @Test
437 - public void pcepUpdateMsgTest11() throws PcepParseException { 438 + public void pcepUpdateMsgTest11() throws PcepParseException, PcepOutOfBoundMessageException {
438 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54, 439 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
439 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 440 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
440 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object 441 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -473,7 +474,7 @@ public class PcepUpdateMsgExtTest { ...@@ -473,7 +474,7 @@ public class PcepUpdateMsgExtTest {
473 * bandwidth object in PcepUpdate message. 474 * bandwidth object in PcepUpdate message.
474 */ 475 */
475 @Test 476 @Test
476 - public void pcepUpdateMsgTest12() throws PcepParseException { 477 + public void pcepUpdateMsgTest12() throws PcepParseException, PcepOutOfBoundMessageException {
477 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50, 478 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50,
478 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 479 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
479 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object 480 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -511,7 +512,7 @@ public class PcepUpdateMsgExtTest { ...@@ -511,7 +512,7 @@ public class PcepUpdateMsgExtTest {
511 * bandwidth object in PcepUpdate message. 512 * bandwidth object in PcepUpdate message.
512 */ 513 */
513 @Test 514 @Test
514 - public void pcepUpdateMsgTest13() throws PcepParseException { 515 + public void pcepUpdateMsgTest13() throws PcepParseException, PcepOutOfBoundMessageException {
515 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58, 516 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
516 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 517 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
517 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 518 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -550,7 +551,7 @@ public class PcepUpdateMsgExtTest { ...@@ -550,7 +551,7 @@ public class PcepUpdateMsgExtTest {
550 * metric object in PcepUpdate message. 551 * metric object in PcepUpdate message.
551 */ 552 */
552 @Test 553 @Test
553 - public void pcepUpdateMsgTest14() throws PcepParseException { 554 + public void pcepUpdateMsgTest14() throws PcepParseException, PcepOutOfBoundMessageException {
554 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x60, 555 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x60,
555 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 556 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
556 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object 557 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -590,7 +591,7 @@ public class PcepUpdateMsgExtTest { ...@@ -590,7 +591,7 @@ public class PcepUpdateMsgExtTest {
590 * metric object in PcepUpdate message. 591 * metric object in PcepUpdate message.
591 */ 592 */
592 @Test 593 @Test
593 - public void pcepUpdateMsgTest15() throws PcepParseException { 594 + public void pcepUpdateMsgTest15() throws PcepParseException, PcepOutOfBoundMessageException {
594 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c, 595 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c,
595 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 596 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
596 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object 597 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -627,7 +628,7 @@ public class PcepUpdateMsgExtTest { ...@@ -627,7 +628,7 @@ public class PcepUpdateMsgExtTest {
627 * metric object in PcepUpdate message. 628 * metric object in PcepUpdate message.
628 */ 629 */
629 @Test 630 @Test
630 - public void pcepUpdateMsgTest16() throws PcepParseException { 631 + public void pcepUpdateMsgTest16() throws PcepParseException, PcepOutOfBoundMessageException {
631 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54, 632 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
632 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 633 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
633 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object 634 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -665,7 +666,7 @@ public class PcepUpdateMsgExtTest { ...@@ -665,7 +666,7 @@ public class PcepUpdateMsgExtTest {
665 * metric object in PcepUpdate message. 666 * metric object in PcepUpdate message.
666 */ 667 */
667 @Test 668 @Test
668 - public void pcepUpdateMsgTest17() throws PcepParseException { 669 + public void pcepUpdateMsgTest17() throws PcepParseException, PcepOutOfBoundMessageException {
669 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58, 670 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
670 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 671 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
671 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object 672 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -704,7 +705,7 @@ public class PcepUpdateMsgExtTest { ...@@ -704,7 +705,7 @@ public class PcepUpdateMsgExtTest {
704 * metric object in PcepUpdate message. 705 * metric object in PcepUpdate message.
705 */ 706 */
706 @Test 707 @Test
707 - public void pcepUpdateMsgTest18() throws PcepParseException { 708 + public void pcepUpdateMsgTest18() throws PcepParseException, PcepOutOfBoundMessageException {
708 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54, 709 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
709 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 710 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
710 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object 711 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -742,7 +743,7 @@ public class PcepUpdateMsgExtTest { ...@@ -742,7 +743,7 @@ public class PcepUpdateMsgExtTest {
742 * metric object in PcepUpdate message. 743 * metric object in PcepUpdate message.
743 */ 744 */
744 @Test 745 @Test
745 - public void pcepUpdateMsgTest19() throws PcepParseException { 746 + public void pcepUpdateMsgTest19() throws PcepParseException, PcepOutOfBoundMessageException {
746 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c, 747 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
747 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 748 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
748 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 749 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -781,7 +782,7 @@ public class PcepUpdateMsgExtTest { ...@@ -781,7 +782,7 @@ public class PcepUpdateMsgExtTest {
781 * Bandwidth , metric object in PcepUpdate message. 782 * Bandwidth , metric object in PcepUpdate message.
782 */ 783 */
783 @Test 784 @Test
784 - public void pcepUpdateMsgTest20() throws PcepParseException { 785 + public void pcepUpdateMsgTest20() throws PcepParseException, PcepOutOfBoundMessageException {
785 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54, 786 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
786 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 787 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
787 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object 788 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -820,7 +821,7 @@ public class PcepUpdateMsgExtTest { ...@@ -820,7 +821,7 @@ public class PcepUpdateMsgExtTest {
820 * Bandwidth , metric object in PcepUpdate message. 821 * Bandwidth , metric object in PcepUpdate message.
821 */ 822 */
822 @Test 823 @Test
823 - public void pcepUpdateMsgTest21() throws PcepParseException { 824 + public void pcepUpdateMsgTest21() throws PcepParseException, PcepOutOfBoundMessageException {
824 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40, 825 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40,
825 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 826 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
826 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object 827 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -856,7 +857,7 @@ public class PcepUpdateMsgExtTest { ...@@ -856,7 +857,7 @@ public class PcepUpdateMsgExtTest {
856 * Bandwidth , metric object in PcepUpdate message. 857 * Bandwidth , metric object in PcepUpdate message.
857 */ 858 */
858 @Test 859 @Test
859 - public void pcepUpdateMsgTest22() throws PcepParseException { 860 + public void pcepUpdateMsgTest22() throws PcepParseException, PcepOutOfBoundMessageException {
860 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48, 861 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
861 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 862 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
862 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object 863 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -893,7 +894,7 @@ public class PcepUpdateMsgExtTest { ...@@ -893,7 +894,7 @@ public class PcepUpdateMsgExtTest {
893 * Bandwidth , metric object in PcepUpdate message. 894 * Bandwidth , metric object in PcepUpdate message.
894 */ 895 */
895 @Test 896 @Test
896 - public void pcepUpdateMsgTest23() throws PcepParseException { 897 + public void pcepUpdateMsgTest23() throws PcepParseException, PcepOutOfBoundMessageException {
897 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c, 898 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c,
898 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 899 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
899 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object 900 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -931,7 +932,7 @@ public class PcepUpdateMsgExtTest { ...@@ -931,7 +932,7 @@ public class PcepUpdateMsgExtTest {
931 * Bandwidth , metric object in PcepUpdate message. 932 * Bandwidth , metric object in PcepUpdate message.
932 */ 933 */
933 @Test 934 @Test
934 - public void pcepUpdateMsgTest24() throws PcepParseException { 935 + public void pcepUpdateMsgTest24() throws PcepParseException, PcepOutOfBoundMessageException {
935 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48, 936 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
936 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 937 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
937 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object 938 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -968,7 +969,7 @@ public class PcepUpdateMsgExtTest { ...@@ -968,7 +969,7 @@ public class PcepUpdateMsgExtTest {
968 * Bandwidth , metric object in PcepUpdate message. 969 * Bandwidth , metric object in PcepUpdate message.
969 */ 970 */
970 @Test 971 @Test
971 - public void pcepUpdateMsgTest25() throws PcepParseException { 972 + public void pcepUpdateMsgTest25() throws PcepParseException, PcepOutOfBoundMessageException {
972 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50, 973 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50,
973 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 974 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
974 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 975 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1006,7 +1007,7 @@ public class PcepUpdateMsgExtTest { ...@@ -1006,7 +1007,7 @@ public class PcepUpdateMsgExtTest {
1006 * LSPA object in PcepUpdate message. 1007 * LSPA object in PcepUpdate message.
1007 */ 1008 */
1008 @Test 1009 @Test
1009 - public void pcepUpdateMsgTest26() throws PcepParseException { 1010 + public void pcepUpdateMsgTest26() throws PcepParseException, PcepOutOfBoundMessageException {
1010 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54, 1011 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
1011 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1012 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1012 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object 1013 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -1045,7 +1046,7 @@ public class PcepUpdateMsgExtTest { ...@@ -1045,7 +1046,7 @@ public class PcepUpdateMsgExtTest {
1045 * bandwidth object in PcepUpdate message. 1046 * bandwidth object in PcepUpdate message.
1046 */ 1047 */
1047 @Test 1048 @Test
1048 - public void pcepUpdateMsgTest27() throws PcepParseException { 1049 + public void pcepUpdateMsgTest27() throws PcepParseException, PcepOutOfBoundMessageException {
1049 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x34, 1050 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x34,
1050 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1051 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1051 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object 1052 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -1080,7 +1081,7 @@ public class PcepUpdateMsgExtTest { ...@@ -1080,7 +1081,7 @@ public class PcepUpdateMsgExtTest {
1080 * metric object in PcepUpdate message. 1081 * metric object in PcepUpdate message.
1081 */ 1082 */
1082 @Test 1083 @Test
1083 - public void pcepUpdateMsgTest28() throws PcepParseException { 1084 + public void pcepUpdateMsgTest28() throws PcepParseException, PcepOutOfBoundMessageException {
1084 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40, 1085 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40,
1085 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1086 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1086 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object 1087 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
...@@ -1116,7 +1117,7 @@ public class PcepUpdateMsgExtTest { ...@@ -1116,7 +1117,7 @@ public class PcepUpdateMsgExtTest {
1116 * lspa object in PcepUpdate message. 1117 * lspa object in PcepUpdate message.
1117 */ 1118 */
1118 @Test 1119 @Test
1119 - public void pcepUpdateMsgTest29() throws PcepParseException { 1120 + public void pcepUpdateMsgTest29() throws PcepParseException, PcepOutOfBoundMessageException {
1120 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54, 1121 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
1121 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1122 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1122 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1123 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1155,7 +1156,7 @@ public class PcepUpdateMsgExtTest { ...@@ -1155,7 +1156,7 @@ public class PcepUpdateMsgExtTest {
1155 * bandwidth object in PcepUpdate message. 1156 * bandwidth object in PcepUpdate message.
1156 */ 1157 */
1157 @Test 1158 @Test
1158 - public void pcepUpdateMsgTest30() throws PcepParseException { 1159 + public void pcepUpdateMsgTest30() throws PcepParseException, PcepOutOfBoundMessageException {
1159 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48, 1160 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
1160 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1161 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1161 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1162 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1193,7 +1194,7 @@ public class PcepUpdateMsgExtTest { ...@@ -1193,7 +1194,7 @@ public class PcepUpdateMsgExtTest {
1193 * metric object in PcepUpdate message. 1194 * metric object in PcepUpdate message.
1194 */ 1195 */
1195 @Test 1196 @Test
1196 - public void pcepUpdateMsgTest31() throws PcepParseException { 1197 + public void pcepUpdateMsgTest31() throws PcepParseException, PcepOutOfBoundMessageException {
1197 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c, 1198 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c,
1198 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1199 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1199 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1200 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
...@@ -1231,7 +1232,7 @@ public class PcepUpdateMsgExtTest { ...@@ -1231,7 +1232,7 @@ public class PcepUpdateMsgExtTest {
1231 * Metric object in PcepUpdate message. 1232 * Metric object in PcepUpdate message.
1232 */ 1233 */
1233 @Test 1234 @Test
1234 - public void pcepUpdateMsgTest32() throws PcepParseException { 1235 + public void pcepUpdateMsgTest32() throws PcepParseException, PcepOutOfBoundMessageException {
1235 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x64, 1236 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x64,
1236 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1237 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
1237 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv 1238 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
......
...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol; ...@@ -18,6 +18,7 @@ package org.onosproject.pcepio.protocol;
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers; 19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Test; 20 import org.junit.Test;
21 +import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
21 import org.onosproject.pcepio.exceptions.PcepParseException; 22 import org.onosproject.pcepio.exceptions.PcepParseException;
22 23
23 import static org.hamcrest.MatcherAssert.assertThat; 24 import static org.hamcrest.MatcherAssert.assertThat;
...@@ -29,7 +30,7 @@ public class PcepUpdateMsgTest { ...@@ -29,7 +30,7 @@ public class PcepUpdateMsgTest {
29 * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), ERO in PcUpd message. 30 * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), ERO in PcUpd message.
30 */ 31 */
31 @Test 32 @Test
32 - public void pcepUpdateMsgTest1() throws PcepParseException { 33 + public void pcepUpdateMsgTest1() throws PcepParseException, PcepOutOfBoundMessageException {
33 34
34 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x30, 35 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x30,
35 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 36 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -64,7 +65,7 @@ public class PcepUpdateMsgTest { ...@@ -64,7 +65,7 @@ public class PcepUpdateMsgTest {
64 * SymbolicPathNameTlv, StatefulLspErrorCodeTlv), ERO, LSPA, Metric-list in PcUpd message. 65 * SymbolicPathNameTlv, StatefulLspErrorCodeTlv), ERO, LSPA, Metric-list in PcUpd message.
65 */ 66 */
66 @Test 67 @Test
67 - public void pcepUpdateMsgTest2() throws PcepParseException { 68 + public void pcepUpdateMsgTest2() throws PcepParseException, PcepOutOfBoundMessageException {
68 69
69 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x94, 70 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x94,
70 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 71 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -108,7 +109,7 @@ public class PcepUpdateMsgTest { ...@@ -108,7 +109,7 @@ public class PcepUpdateMsgTest {
108 * ERO objects in PcUpd message. 109 * ERO objects in PcUpd message.
109 */ 110 */
110 @Test 111 @Test
111 - public void pcepUpdateMsgTest3() throws PcepParseException { 112 + public void pcepUpdateMsgTest3() throws PcepParseException, PcepOutOfBoundMessageException {
112 113
113 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x38, 114 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x38,
114 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 115 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -145,7 +146,7 @@ public class PcepUpdateMsgTest { ...@@ -145,7 +146,7 @@ public class PcepUpdateMsgTest {
145 * SymbolicPathNameTlv), ERO objects in PcUpd message. 146 * SymbolicPathNameTlv), ERO objects in PcUpd message.
146 */ 147 */
147 @Test 148 @Test
148 - public void pcepUpdateMsgTest4() throws PcepParseException { 149 + public void pcepUpdateMsgTest4() throws PcepParseException, PcepOutOfBoundMessageException {
149 150
150 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40, 151 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40,
151 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 152 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -183,7 +184,7 @@ public class PcepUpdateMsgTest { ...@@ -183,7 +184,7 @@ public class PcepUpdateMsgTest {
183 * SymbolicPathNameTlv), ERO objects in PcUpd message. 184 * SymbolicPathNameTlv), ERO objects in PcUpd message.
184 */ 185 */
185 @Test 186 @Test
186 - public void pcepUpdateMsgTest5() throws PcepParseException { 187 + public void pcepUpdateMsgTest5() throws PcepParseException, PcepOutOfBoundMessageException {
187 188
188 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40, 189 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40,
189 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 190 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -221,7 +222,7 @@ public class PcepUpdateMsgTest { ...@@ -221,7 +222,7 @@ public class PcepUpdateMsgTest {
221 * StatefulLspErrorCodeTlv), ERO objects in PcUpd message. 222 * StatefulLspErrorCodeTlv), ERO objects in PcUpd message.
222 */ 223 */
223 @Test 224 @Test
224 - public void pcepUpdateMsgTest6() throws PcepParseException { 225 + public void pcepUpdateMsgTest6() throws PcepParseException, PcepOutOfBoundMessageException {
225 226
226 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48, 227 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
227 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 228 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -261,7 +262,7 @@ public class PcepUpdateMsgTest { ...@@ -261,7 +262,7 @@ public class PcepUpdateMsgTest {
261 * StatefulLspErrorCodeTlv), ERO objects in PcUpd message. 262 * StatefulLspErrorCodeTlv), ERO objects in PcUpd message.
262 */ 263 */
263 @Test 264 @Test
264 - public void pcepUpdateMsgTest7() throws PcepParseException { 265 + public void pcepUpdateMsgTest7() throws PcepParseException, PcepOutOfBoundMessageException {
265 266
266 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48, 267 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
267 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 268 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -299,7 +300,7 @@ public class PcepUpdateMsgTest { ...@@ -299,7 +300,7 @@ public class PcepUpdateMsgTest {
299 * StatefulLspErrorCodeTlv), ERO (IPv4SubObject) objects in PcUpd message. 300 * StatefulLspErrorCodeTlv), ERO (IPv4SubObject) objects in PcUpd message.
300 */ 301 */
301 @Test 302 @Test
302 - public void pcepUpdateMsgTest8() throws PcepParseException { 303 + public void pcepUpdateMsgTest8() throws PcepParseException, PcepOutOfBoundMessageException {
303 304
304 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50, 305 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50,
305 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 306 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -339,7 +340,7 @@ public class PcepUpdateMsgTest { ...@@ -339,7 +340,7 @@ public class PcepUpdateMsgTest {
339 * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject) objects in PcUpd message. 340 * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject) objects in PcUpd message.
340 */ 341 */
341 @Test 342 @Test
342 - public void pcepUpdateMsgTest9() throws PcepParseException { 343 + public void pcepUpdateMsgTest9() throws PcepParseException, PcepOutOfBoundMessageException {
343 344
344 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58, 345 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
345 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 346 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -380,7 +381,7 @@ public class PcepUpdateMsgTest { ...@@ -380,7 +381,7 @@ public class PcepUpdateMsgTest {
380 * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject), LSPA objects in PcUpd message. 381 * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject), LSPA objects in PcUpd message.
381 */ 382 */
382 @Test 383 @Test
383 - public void pcepUpdateMsgTest10() throws PcepParseException { 384 + public void pcepUpdateMsgTest10() throws PcepParseException, PcepOutOfBoundMessageException {
384 385
385 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x6c, 386 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x6c,
386 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 387 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -423,7 +424,7 @@ public class PcepUpdateMsgTest { ...@@ -423,7 +424,7 @@ public class PcepUpdateMsgTest {
423 * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, Metric objects in PcUpd message. 424 * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, Metric objects in PcUpd message.
424 */ 425 */
425 @Test 426 @Test
426 - public void pcepUpdateMsgTest11() throws PcepParseException { 427 + public void pcepUpdateMsgTest11() throws PcepParseException, PcepOutOfBoundMessageException {
427 428
428 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78, 429 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78,
429 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 430 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -467,7 +468,7 @@ public class PcepUpdateMsgTest { ...@@ -467,7 +468,7 @@ public class PcepUpdateMsgTest {
467 * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message. 468 * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message.
468 */ 469 */
469 @Test 470 @Test
470 - public void pcepUpdateMsgTest12() throws PcepParseException { 471 + public void pcepUpdateMsgTest12() throws PcepParseException, PcepOutOfBoundMessageException {
471 472
472 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70, 473 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70,
473 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 474 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -510,7 +511,7 @@ public class PcepUpdateMsgTest { ...@@ -510,7 +511,7 @@ public class PcepUpdateMsgTest {
510 * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message. 511 * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message.
511 */ 512 */
512 @Test 513 @Test
513 - public void pcepUpdateMsgTest13() throws PcepParseException { 514 + public void pcepUpdateMsgTest13() throws PcepParseException, PcepOutOfBoundMessageException {
514 515
515 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70, 516 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70,
516 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 517 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -553,7 +554,7 @@ public class PcepUpdateMsgTest { ...@@ -553,7 +554,7 @@ public class PcepUpdateMsgTest {
553 * ERO (IPv4SubObject, IPv4SubObject),LSPA, metric Object objects in PcUpd message. 554 * ERO (IPv4SubObject, IPv4SubObject),LSPA, metric Object objects in PcUpd message.
554 */ 555 */
555 @Test 556 @Test
556 - public void pcepUpdateMsgTest14() throws PcepParseException { 557 + public void pcepUpdateMsgTest14() throws PcepParseException, PcepOutOfBoundMessageException {
557 558
558 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68, 559 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
559 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 560 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -595,7 +596,7 @@ public class PcepUpdateMsgTest { ...@@ -595,7 +596,7 @@ public class PcepUpdateMsgTest {
595 * ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message. 596 * ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message.
596 */ 597 */
597 @Test 598 @Test
598 - public void pcepUpdateMsgTest15() throws PcepParseException { 599 + public void pcepUpdateMsgTest15() throws PcepParseException, PcepOutOfBoundMessageException {
599 600
600 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68, 601 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
601 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 602 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -637,7 +638,7 @@ public class PcepUpdateMsgTest { ...@@ -637,7 +638,7 @@ public class PcepUpdateMsgTest {
637 * ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message. 638 * ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message.
638 */ 639 */
639 @Test 640 @Test
640 - public void pcepUpdateMsgTest16() throws PcepParseException { 641 + public void pcepUpdateMsgTest16() throws PcepParseException, PcepOutOfBoundMessageException {
641 642
642 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x60, 643 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x60,
643 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 644 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -678,7 +679,7 @@ public class PcepUpdateMsgTest { ...@@ -678,7 +679,7 @@ public class PcepUpdateMsgTest {
678 * ERO (IPv4SubObject, IPv4SubObject),LSPA objects in PcUpd message. 679 * ERO (IPv4SubObject, IPv4SubObject),LSPA objects in PcUpd message.
679 */ 680 */
680 @Test 681 @Test
681 - public void pcepUpdateMsgTest17() throws PcepParseException { 682 + public void pcepUpdateMsgTest17() throws PcepParseException, PcepOutOfBoundMessageException {
682 683
683 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54, 684 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
684 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 685 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -718,7 +719,7 @@ public class PcepUpdateMsgTest { ...@@ -718,7 +719,7 @@ public class PcepUpdateMsgTest {
718 * ERO (IPv4SubObject, IPv4SubObject),Metric objects in PcUpd message. 719 * ERO (IPv4SubObject, IPv4SubObject),Metric objects in PcUpd message.
719 */ 720 */
720 @Test 721 @Test
721 - public void pcepUpdateMsgTest18() throws PcepParseException { 722 + public void pcepUpdateMsgTest18() throws PcepParseException, PcepOutOfBoundMessageException {
722 723
723 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c, 724 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c,
724 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 725 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -757,7 +758,7 @@ public class PcepUpdateMsgTest { ...@@ -757,7 +758,7 @@ public class PcepUpdateMsgTest {
757 * ERO (IPv4SubObject, IPv4SubObject),Metric-list objects in PcUpd message. 758 * ERO (IPv4SubObject, IPv4SubObject),Metric-list objects in PcUpd message.
758 */ 759 */
759 @Test 760 @Test
760 - public void pcepUpdateMsgTest19() throws PcepParseException { 761 + public void pcepUpdateMsgTest19() throws PcepParseException, PcepOutOfBoundMessageException {
761 762
762 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58, 763 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
763 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 764 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -797,7 +798,7 @@ public class PcepUpdateMsgTest { ...@@ -797,7 +798,7 @@ public class PcepUpdateMsgTest {
797 * StatefulLspErrorCodeTlv),ERO (IPv4SubObject, IPv4SubObject),LSPA, Bandwidth, Metric objects in PcUpd message. 798 * StatefulLspErrorCodeTlv),ERO (IPv4SubObject, IPv4SubObject),LSPA, Bandwidth, Metric objects in PcUpd message.
798 */ 799 */
799 @Test 800 @Test
800 - public void pcepUpdateMsgTest20() throws PcepParseException { 801 + public void pcepUpdateMsgTest20() throws PcepParseException, PcepOutOfBoundMessageException {
801 802
802 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x80, 803 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x80,
803 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 804 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -842,7 +843,7 @@ public class PcepUpdateMsgTest { ...@@ -842,7 +843,7 @@ public class PcepUpdateMsgTest {
842 * ERO (IPv4SubObject, IPv4SubObject), Bandwidth objects in PcUpd message. 843 * ERO (IPv4SubObject, IPv4SubObject), Bandwidth objects in PcUpd message.
843 */ 844 */
844 @Test 845 @Test
845 - public void pcepUpdateMsgTest21() throws PcepParseException { 846 + public void pcepUpdateMsgTest21() throws PcepParseException, PcepOutOfBoundMessageException {
846 847
847 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48, 848 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
848 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 849 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -881,7 +882,7 @@ public class PcepUpdateMsgTest { ...@@ -881,7 +882,7 @@ public class PcepUpdateMsgTest {
881 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth objects in PcUpd message. 882 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth objects in PcUpd message.
882 */ 883 */
883 @Test 884 @Test
884 - public void pcepUpdateMsgTest22() throws PcepParseException { 885 + public void pcepUpdateMsgTest22() throws PcepParseException, PcepOutOfBoundMessageException {
885 886
886 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5C, 887 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5C,
887 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 888 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -922,7 +923,7 @@ public class PcepUpdateMsgTest { ...@@ -922,7 +923,7 @@ public class PcepUpdateMsgTest {
922 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. 923 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
923 */ 924 */
924 @Test 925 @Test
925 - public void pcepUpdateMsgTest23() throws PcepParseException { 926 + public void pcepUpdateMsgTest23() throws PcepParseException, PcepOutOfBoundMessageException {
926 927
927 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68, 928 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
928 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 929 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -964,7 +965,7 @@ public class PcepUpdateMsgTest { ...@@ -964,7 +965,7 @@ public class PcepUpdateMsgTest {
964 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. 965 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
965 */ 966 */
966 @Test 967 @Test
967 - public void pcepUpdateMsgTest24() throws PcepParseException { 968 + public void pcepUpdateMsgTest24() throws PcepParseException, PcepOutOfBoundMessageException {
968 969
969 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70, 970 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70,
970 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 971 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -1007,7 +1008,7 @@ public class PcepUpdateMsgTest { ...@@ -1007,7 +1008,7 @@ public class PcepUpdateMsgTest {
1007 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. 1008 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
1008 */ 1009 */
1009 @Test 1010 @Test
1010 - public void pcepUpdateMsgTest25() throws PcepParseException { 1011 + public void pcepUpdateMsgTest25() throws PcepParseException, PcepOutOfBoundMessageException {
1011 1012
1012 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70, 1013 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70,
1013 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1014 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -1051,7 +1052,7 @@ public class PcepUpdateMsgTest { ...@@ -1051,7 +1052,7 @@ public class PcepUpdateMsgTest {
1051 * Metric objects in PcUpd message. 1052 * Metric objects in PcUpd message.
1052 */ 1053 */
1053 @Test 1054 @Test
1054 - public void pcepUpdateMsgTest26() throws PcepParseException { 1055 + public void pcepUpdateMsgTest26() throws PcepParseException, PcepOutOfBoundMessageException {
1055 1056
1056 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78, 1057 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78,
1057 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1058 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -1095,7 +1096,7 @@ public class PcepUpdateMsgTest { ...@@ -1095,7 +1096,7 @@ public class PcepUpdateMsgTest {
1095 * Metric objects in PcUpd message. 1096 * Metric objects in PcUpd message.
1096 */ 1097 */
1097 @Test 1098 @Test
1098 - public void pcepUpdateMsgTest27() throws PcepParseException { 1099 + public void pcepUpdateMsgTest27() throws PcepParseException, PcepOutOfBoundMessageException {
1099 1100
1100 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78, 1101 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78,
1101 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1102 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -1140,7 +1141,7 @@ public class PcepUpdateMsgTest { ...@@ -1140,7 +1141,7 @@ public class PcepUpdateMsgTest {
1140 * LSPA, Bandwidth, Metric objects in PcUpd message. 1141 * LSPA, Bandwidth, Metric objects in PcUpd message.
1141 */ 1142 */
1142 @Test 1143 @Test
1143 - public void pcepUpdateMsgTest28() throws PcepParseException { 1144 + public void pcepUpdateMsgTest28() throws PcepParseException, PcepOutOfBoundMessageException {
1144 1145
1145 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x80, 1146 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x80,
1146 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1147 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -1185,7 +1186,7 @@ public class PcepUpdateMsgTest { ...@@ -1185,7 +1186,7 @@ public class PcepUpdateMsgTest {
1185 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. 1186 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
1186 */ 1187 */
1187 @Test 1188 @Test
1188 - public void pcepUpdateMsgTest29() throws PcepParseException { 1189 + public void pcepUpdateMsgTest29() throws PcepParseException, PcepOutOfBoundMessageException {
1189 1190
1190 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68, 1191 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
1191 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1192 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -1227,7 +1228,7 @@ public class PcepUpdateMsgTest { ...@@ -1227,7 +1228,7 @@ public class PcepUpdateMsgTest {
1227 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. 1228 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
1228 */ 1229 */
1229 @Test 1230 @Test
1230 - public void pcepUpdateMsgTest30() throws PcepParseException { 1231 + public void pcepUpdateMsgTest30() throws PcepParseException, PcepOutOfBoundMessageException {
1231 1232
1232 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54, 1233 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
1233 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1234 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -1266,7 +1267,7 @@ public class PcepUpdateMsgTest { ...@@ -1266,7 +1267,7 @@ public class PcepUpdateMsgTest {
1266 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. 1267 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
1267 */ 1268 */
1268 @Test 1269 @Test
1269 - public void pcepUpdateMsgTest31() throws PcepParseException { 1270 + public void pcepUpdateMsgTest31() throws PcepParseException, PcepOutOfBoundMessageException {
1270 1271
1271 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c, 1272 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
1272 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1273 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -1306,7 +1307,7 @@ public class PcepUpdateMsgTest { ...@@ -1306,7 +1307,7 @@ public class PcepUpdateMsgTest {
1306 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. 1307 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
1307 */ 1308 */
1308 @Test 1309 @Test
1309 - public void pcepUpdateMsgTest32() throws PcepParseException { 1310 + public void pcepUpdateMsgTest32() throws PcepParseException, PcepOutOfBoundMessageException {
1310 1311
1311 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54, 1312 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
1312 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1313 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -1345,7 +1346,7 @@ public class PcepUpdateMsgTest { ...@@ -1345,7 +1346,7 @@ public class PcepUpdateMsgTest {
1345 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. 1346 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
1346 */ 1347 */
1347 @Test 1348 @Test
1348 - public void pcepUpdateMsgTest33() throws PcepParseException { 1349 + public void pcepUpdateMsgTest33() throws PcepParseException, PcepOutOfBoundMessageException {
1349 1350
1350 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c, 1351 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
1351 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1352 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
...@@ -1385,7 +1386,7 @@ public class PcepUpdateMsgTest { ...@@ -1385,7 +1386,7 @@ public class PcepUpdateMsgTest {
1385 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message. 1386 * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
1386 */ 1387 */
1387 @Test 1388 @Test
1388 - public void pcepUpdateMsgTest34() throws PcepParseException { 1389 + public void pcepUpdateMsgTest34() throws PcepParseException, PcepOutOfBoundMessageException {
1389 1390
1390 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x64, 1391 byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x64,
1391 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object 1392 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
......
...@@ -19,13 +19,12 @@ import com.google.common.testing.EqualsTester; ...@@ -19,13 +19,12 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the IPv4NeighborAddressTlv. 22 + * Test of the AdministrativeGroupSubTlv.
23 */ 23 */
24 -public class IPv4NeighborAddressTlvTest { 24 +public class AdministrativeGroupSubTlvTest {
25 - 25 + private final AdministrativeGroupSubTlv tlv1 = AdministrativeGroupSubTlv.of(1);
26 - private final IPv4NeighborAddressTlv tlv1 = IPv4NeighborAddressTlv.of(2); 26 + private final AdministrativeGroupSubTlv sameAsTlv1 = AdministrativeGroupSubTlv.of(1);
27 - private final IPv4NeighborAddressTlv sameAsTlv1 = IPv4NeighborAddressTlv.of(2); 27 + private final AdministrativeGroupSubTlv tlv2 = AdministrativeGroupSubTlv.of(2);
28 - private final IPv4NeighborAddressTlv tlv2 = IPv4NeighborAddressTlv.of(3);
29 28
30 @Test 29 @Test
31 public void basics() { 30 public void basics() {
......
1 +/*
2 + * Copyright 2015 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +package org.onosproject.pcepio.types;
17 +
18 +import com.google.common.testing.EqualsTester;
19 +import org.junit.Test;
20 +
21 +/**
22 + * Test of the AutonomousSystemNumberSubObject.
23 + */
24 +public class AutonomousSystemNumberSubObjectTest {
25 +
26 + private final AutonomousSystemNumberSubObject subObj1 = AutonomousSystemNumberSubObject.of((short) 2);
27 + private final AutonomousSystemNumberSubObject sameAsSubObj1 = AutonomousSystemNumberSubObject.of((short) 2);
28 + private final AutonomousSystemNumberSubObject subObj2 = AutonomousSystemNumberSubObject.of((short) 3);
29 +
30 + @Test
31 + public void basics() {
32 + new EqualsTester()
33 + .addEqualityGroup(subObj1, sameAsSubObj1)
34 + .addEqualityGroup(subObj2)
35 + .testEquals();
36 + }
37 +}
...@@ -19,12 +19,12 @@ import com.google.common.testing.EqualsTester; ...@@ -19,12 +19,12 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the AdministrativeGroupTlv. 22 + * Test of the AutonomousSystemSubTlv.
23 */ 23 */
24 -public class AdministrativeGroupTlvTest { 24 +public class AutonomousSystemSubTlvTest {
25 - private final AdministrativeGroupTlv tlv1 = AdministrativeGroupTlv.of(1); 25 + private final AutonomousSystemSubTlv tlv1 = AutonomousSystemSubTlv.of(1);
26 - private final AdministrativeGroupTlv sameAsTlv1 = AdministrativeGroupTlv.of(1); 26 + private final AutonomousSystemSubTlv sameAsTlv1 = AutonomousSystemSubTlv.of(1);
27 - private final AdministrativeGroupTlv tlv2 = AdministrativeGroupTlv.of(2); 27 + private final AutonomousSystemSubTlv tlv2 = AutonomousSystemSubTlv.of(2);
28 28
29 @Test 29 @Test
30 public void basics() { 30 public void basics() {
......
...@@ -19,12 +19,12 @@ import com.google.common.testing.EqualsTester; ...@@ -19,12 +19,12 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the AutonomousSystemTlv. 22 + * Test of the BgpLsIdentifierSubTlv.
23 */ 23 */
24 -public class AutonomousSystemTlvTest { 24 +public class BgpLsIdentifierSubTlvTest {
25 - private final AutonomousSystemTlv tlv1 = AutonomousSystemTlv.of(1); 25 + private final BgpLsIdentifierSubTlv tlv1 = BgpLsIdentifierSubTlv.of(1);
26 - private final AutonomousSystemTlv sameAsTlv1 = AutonomousSystemTlv.of(1); 26 + private final BgpLsIdentifierSubTlv sameAsTlv1 = BgpLsIdentifierSubTlv.of(1);
27 - private final AutonomousSystemTlv tlv2 = AutonomousSystemTlv.of(2); 27 + private final BgpLsIdentifierSubTlv tlv2 = BgpLsIdentifierSubTlv.of(2);
28 28
29 @Test 29 @Test
30 public void basics() { 30 public void basics() {
......
...@@ -19,13 +19,13 @@ import com.google.common.testing.EqualsTester; ...@@ -19,13 +19,13 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the IPv4InterfaceAddressTlv. 22 + * Test of the IPv4InterfaceAddressSubTlv.
23 */ 23 */
24 -public class IPv4InterfaceAddressTlvTest { 24 +public class IPv4InterfaceAddressSubTlvTest {
25 25
26 - private final IPv4InterfaceAddressTlv tlv1 = IPv4InterfaceAddressTlv.of(2); 26 + private final IPv4InterfaceAddressSubTlv tlv1 = IPv4InterfaceAddressSubTlv.of(2);
27 - private final IPv4InterfaceAddressTlv sameAsTlv1 = IPv4InterfaceAddressTlv.of(2); 27 + private final IPv4InterfaceAddressSubTlv sameAsTlv1 = IPv4InterfaceAddressSubTlv.of(2);
28 - private final IPv4InterfaceAddressTlv tlv2 = IPv4InterfaceAddressTlv.of(3); 28 + private final IPv4InterfaceAddressSubTlv tlv2 = IPv4InterfaceAddressSubTlv.of(3);
29 29
30 @Test 30 @Test
31 public void basics() { 31 public void basics() {
......
...@@ -19,12 +19,13 @@ import com.google.common.testing.EqualsTester; ...@@ -19,12 +19,13 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the BGPLSidentifierTlv. 22 + * Test of the IPv4NeighborAddressSubTlv.
23 */ 23 */
24 -public class BgpLsIdentifierTlvTest { 24 +public class IPv4NeighborAddressSubTlvTest {
25 - private final BgpLsIdentifierTlv tlv1 = BgpLsIdentifierTlv.of(1); 25 +
26 - private final BgpLsIdentifierTlv sameAsTlv1 = BgpLsIdentifierTlv.of(1); 26 + private final IPv4NeighborAddressSubTlv tlv1 = IPv4NeighborAddressSubTlv.of(2);
27 - private final BgpLsIdentifierTlv tlv2 = BgpLsIdentifierTlv.of(2); 27 + private final IPv4NeighborAddressSubTlv sameAsTlv1 = IPv4NeighborAddressSubTlv.of(2);
28 + private final IPv4NeighborAddressSubTlv tlv2 = IPv4NeighborAddressSubTlv.of(3);
28 29
29 @Test 30 @Test
30 public void basics() { 31 public void basics() {
......
...@@ -19,13 +19,13 @@ import com.google.common.testing.EqualsTester; ...@@ -19,13 +19,13 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the IPv4TERouterIdOfRemoteNodeTlv. 22 + * Test of the IPv4RouterIdOfLocalNodeSubTlv.
23 */ 23 */
24 -public class IPv4TERouterIdOfRemoteNodeTlvTest { 24 +public class IPv4RouterIdOfLocalNodeSubTlvTest {
25 25
26 - private final IPv4TERouterIdOfRemoteNodeTlv tlv1 = IPv4TERouterIdOfRemoteNodeTlv.of(2); 26 + private final IPv4RouterIdOfLocalNodeSubTlv tlv1 = IPv4RouterIdOfLocalNodeSubTlv.of(2);
27 - private final IPv4TERouterIdOfRemoteNodeTlv sameAsTlv1 = IPv4TERouterIdOfRemoteNodeTlv.of(2); 27 + private final IPv4RouterIdOfLocalNodeSubTlv sameAsTlv1 = IPv4RouterIdOfLocalNodeSubTlv.of(2);
28 - private final IPv4TERouterIdOfRemoteNodeTlv tlv2 = IPv4TERouterIdOfRemoteNodeTlv.of(3); 28 + private final IPv4RouterIdOfLocalNodeSubTlv tlv2 = IPv4RouterIdOfLocalNodeSubTlv.of(3);
29 29
30 @Test 30 @Test
31 public void basics() { 31 public void basics() {
......
...@@ -19,13 +19,13 @@ import com.google.common.testing.EqualsTester; ...@@ -19,13 +19,13 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the IPv4TERouterIdOfLocalNodeTlv. 22 + * Test of the IPv4RouterIdOfRemoteNodeSubTlv.
23 */ 23 */
24 -public class IPv4TERouterIdOfLocalNodeTlvTest { 24 +public class IPv4RouterIdOfRemoteNodeSubTlvTest {
25 25
26 - private final IPv4TERouterIdOfLocalNodeTlv tlv1 = IPv4TERouterIdOfLocalNodeTlv.of(2); 26 + private final IPv4RouterIdOfRemoteNodeSubTlv tlv1 = IPv4RouterIdOfRemoteNodeSubTlv.of(2);
27 - private final IPv4TERouterIdOfLocalNodeTlv sameAsTlv1 = IPv4TERouterIdOfLocalNodeTlv.of(2); 27 + private final IPv4RouterIdOfRemoteNodeSubTlv sameAsTlv1 = IPv4RouterIdOfRemoteNodeSubTlv.of(2);
28 - private final IPv4TERouterIdOfLocalNodeTlv tlv2 = IPv4TERouterIdOfLocalNodeTlv.of(3); 28 + private final IPv4RouterIdOfRemoteNodeSubTlv tlv2 = IPv4RouterIdOfRemoteNodeSubTlv.of(3);
29 29
30 @Test 30 @Test
31 public void basics() { 31 public void basics() {
......
...@@ -19,18 +19,18 @@ import com.google.common.testing.EqualsTester; ...@@ -19,18 +19,18 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the IPv6InterfaceAddressTlv. 22 + * Test of the IPv6InterfaceAddressSubTlv.
23 */ 23 */
24 -public class IPv6InterfaceAddressTlvTest { 24 +public class IPv6InterfaceAddressSubTlvTest {
25 25
26 private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 26 private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
27 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00}; 27 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
28 private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 28 private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
29 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x01}; 29 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x01};
30 30
31 - private final IPv6InterfaceAddressTlv tlv1 = IPv6InterfaceAddressTlv.of(b1); 31 + private final IPv6InterfaceAddressSubTlv tlv1 = IPv6InterfaceAddressSubTlv.of(b1);
32 - private final IPv6InterfaceAddressTlv sameAsTlv1 = IPv6InterfaceAddressTlv.of(b1); 32 + private final IPv6InterfaceAddressSubTlv sameAsTlv1 = IPv6InterfaceAddressSubTlv.of(b1);
33 - private final IPv6InterfaceAddressTlv tlv2 = IPv6InterfaceAddressTlv.of(b2); 33 + private final IPv6InterfaceAddressSubTlv tlv2 = IPv6InterfaceAddressSubTlv.of(b2);
34 34
35 @Test 35 @Test
36 public void basics() { 36 public void basics() {
......
...@@ -19,18 +19,18 @@ import com.google.common.testing.EqualsTester; ...@@ -19,18 +19,18 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the IPv6NeighborAddressTlv. 22 + * Test of the IPv6NeighborAddressSubTlv.
23 */ 23 */
24 -public class IPv6NeighborAddressTlvTest { 24 +public class IPv6NeighborAddressSubTlvTest {
25 25
26 private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 26 private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
27 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00}; 27 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
28 private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 28 private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
29 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x01}; 29 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x01};
30 30
31 - private final IPv6NeighborAddressTlv tlv1 = IPv6NeighborAddressTlv.of(b1); 31 + private final IPv6NeighborAddressSubTlv tlv1 = IPv6NeighborAddressSubTlv.of(b1);
32 - private final IPv6NeighborAddressTlv sameAsTlv1 = IPv6NeighborAddressTlv.of(b1); 32 + private final IPv6NeighborAddressSubTlv sameAsTlv1 = IPv6NeighborAddressSubTlv.of(b1);
33 - private final IPv6NeighborAddressTlv tlv2 = IPv6NeighborAddressTlv.of(b2); 33 + private final IPv6NeighborAddressSubTlv tlv2 = IPv6NeighborAddressSubTlv.of(b2);
34 34
35 @Test 35 @Test
36 public void basics() { 36 public void basics() {
......
...@@ -19,18 +19,18 @@ import com.google.common.testing.EqualsTester; ...@@ -19,18 +19,18 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the IPv6TERouterIdofRemoteNodeTlv. 22 + * Test of the IPv6RouterIdofLocalNodeSubTlv.
23 */ 23 */
24 -public class IPv6TERouterIdofRemoteNodeTlvTest { 24 +public class IPv6RouterIdofLocalNodeSubTlvTest {
25 25
26 private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 26 private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
27 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00}; 27 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
28 private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 28 private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
29 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 }; 29 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
30 30
31 - private final IPv6TERouterIdofRemoteNodeTlv tlv1 = IPv6TERouterIdofRemoteNodeTlv.of(b1); 31 + private final IPv6RouterIdofLocalNodeSubTlv tlv1 = IPv6RouterIdofLocalNodeSubTlv.of(b1);
32 - private final IPv6TERouterIdofRemoteNodeTlv sameAsTlv1 = IPv6TERouterIdofRemoteNodeTlv.of(b1); 32 + private final IPv6RouterIdofLocalNodeSubTlv sameAsTlv1 = IPv6RouterIdofLocalNodeSubTlv.of(b1);
33 - private final IPv6TERouterIdofRemoteNodeTlv tlv2 = IPv6TERouterIdofRemoteNodeTlv.of(b2); 33 + private final IPv6RouterIdofLocalNodeSubTlv tlv2 = IPv6RouterIdofLocalNodeSubTlv.of(b2);
34 34
35 @Test 35 @Test
36 public void basics() { 36 public void basics() {
......
...@@ -19,18 +19,18 @@ import com.google.common.testing.EqualsTester; ...@@ -19,18 +19,18 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the IPv6TERouterIdofLocalNodeTlv. 22 + * Test of the IPv6RouterIdofRemoteNodeSubTlv.
23 */ 23 */
24 -public class IPv6TERouterIdofLocalNodeTlvTest { 24 +public class IPv6RouterIdofRemoteNodeSubTlvTest {
25 25
26 private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 26 private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
27 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00}; 27 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
28 private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 28 private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
29 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 }; 29 (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
30 30
31 - private final IPv6TERouterIdofLocalNodeTlv tlv1 = IPv6TERouterIdofLocalNodeTlv.of(b1); 31 + private final IPv6RouterIdofRemoteNodeSubTlv tlv1 = IPv6RouterIdofRemoteNodeSubTlv.of(b1);
32 - private final IPv6TERouterIdofLocalNodeTlv sameAsTlv1 = IPv6TERouterIdofLocalNodeTlv.of(b1); 32 + private final IPv6RouterIdofRemoteNodeSubTlv sameAsTlv1 = IPv6RouterIdofRemoteNodeSubTlv.of(b1);
33 - private final IPv6TERouterIdofLocalNodeTlv tlv2 = IPv6TERouterIdofLocalNodeTlv.of(b2); 33 + private final IPv6RouterIdofRemoteNodeSubTlv tlv2 = IPv6RouterIdofRemoteNodeSubTlv.of(b2);
34 34
35 @Test 35 @Test
36 public void basics() { 36 public void basics() {
......
...@@ -19,14 +19,14 @@ import com.google.common.testing.EqualsTester; ...@@ -19,14 +19,14 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the IGPMetricTlv. 22 + * Test of the IgpMetricSubTlv.
23 */ 23 */
24 -public class IgpMetricTlvTest { 24 +public class IgpMetricSubTlvTest {
25 private final byte[] b1 = new byte[] {0x01, 0x02}; 25 private final byte[] b1 = new byte[] {0x01, 0x02};
26 private final byte[] b2 = new byte[] {0x01, 0x03}; 26 private final byte[] b2 = new byte[] {0x01, 0x03};
27 - private final IgpMetricTlv tlv1 = IgpMetricTlv.of(b1, (short) 2); 27 + private final IgpMetricSubTlv tlv1 = IgpMetricSubTlv.of(b1, (short) 2);
28 - private final IgpMetricTlv sameAsTlv1 = IgpMetricTlv.of(b1, (short) 2); 28 + private final IgpMetricSubTlv sameAsTlv1 = IgpMetricSubTlv.of(b1, (short) 2);
29 - private final IgpMetricTlv tlv2 = IgpMetricTlv.of(b2, (short) 2); 29 + private final IgpMetricSubTlv tlv2 = IgpMetricSubTlv.of(b2, (short) 2);
30 30
31 @Test 31 @Test
32 public void basics() { 32 public void basics() {
......
...@@ -19,20 +19,20 @@ import com.google.common.testing.EqualsTester; ...@@ -19,20 +19,20 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test case for Router ID Sub tlv. 22 + * Test case for IgpRouterIdSubTlv.
23 */ 23 */
24 -public class RouterIDSubTlvTest { 24 +public class IgpRouterIdSubTlvTest {
25 25
26 private final byte[] value1 = {1, 2 }; 26 private final byte[] value1 = {1, 2 };
27 private final Short length1 = 2; 27 private final Short length1 = 2;
28 - private final RouterIDSubTlv tlv1 = RouterIDSubTlv.of(value1, length1); 28 + private final IgpRouterIdSubTlv tlv1 = IgpRouterIdSubTlv.of(value1, length1);
29 29
30 private final Short length2 = 2; 30 private final Short length2 = 2;
31 - private final RouterIDSubTlv tlv2 = RouterIDSubTlv.of(value1, length2); 31 + private final IgpRouterIdSubTlv tlv2 = IgpRouterIdSubTlv.of(value1, length2);
32 32
33 private final byte[] value3 = {1, 2, 3 }; 33 private final byte[] value3 = {1, 2, 3 };
34 private final Short length3 = 3; 34 private final Short length3 = 3;
35 - private final RouterIDSubTlv tlv3 = RouterIDSubTlv.of(value3, length3); 35 + private final IgpRouterIdSubTlv tlv3 = IgpRouterIdSubTlv.of(value3, length3);
36 36
37 @Test 37 @Test
38 public void basics() { 38 public void basics() {
......
...@@ -19,16 +19,16 @@ import com.google.common.testing.EqualsTester; ...@@ -19,16 +19,16 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the ISISAreaIdentifierTlv. 22 + * Test of the IsisAreaIdentifierSubTlv.
23 */ 23 */
24 -public class IsisAreaIdentifierTlvTest { 24 +public class IsisAreaIdentifierSubTlvTest {
25 25
26 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 }; 26 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 };
27 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 }; 27 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 };
28 28
29 - private final IsisAreaIdentifierTlv tlv1 = IsisAreaIdentifierTlv.of(b1, (short) 20); 29 + private final IsisAreaIdentifierSubTlv tlv1 = IsisAreaIdentifierSubTlv.of(b1, (short) 20);
30 - private final IsisAreaIdentifierTlv sameAsTlv1 = IsisAreaIdentifierTlv.of(b1, (short) 20); 30 + private final IsisAreaIdentifierSubTlv sameAsTlv1 = IsisAreaIdentifierSubTlv.of(b1, (short) 20);
31 - private final IsisAreaIdentifierTlv tlv2 = IsisAreaIdentifierTlv.of(b2, (short) 20); 31 + private final IsisAreaIdentifierSubTlv tlv2 = IsisAreaIdentifierSubTlv.of(b2, (short) 20);
32 32
33 @Test 33 @Test
34 public void basics() { 34 public void basics() {
......
...@@ -19,32 +19,33 @@ import com.google.common.testing.EqualsTester; ...@@ -19,32 +19,33 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 import java.util.LinkedList; 21 import java.util.LinkedList;
22 +import java.util.List;
22 23
23 /** 24 /**
24 * Test case for TE Link Attribute Tlv. 25 * Test case for TE Link Attribute Tlv.
25 */ 26 */
26 -public class TELinkAttributesTlvTest { 27 +public class LinkAttributesTlvTest {
27 28
28 - private final AdministrativeGroupTlv administrativeGroupTlv1 = new AdministrativeGroupTlv(10); 29 + private final AdministrativeGroupSubTlv administrativeGroupTlv1 = new AdministrativeGroupSubTlv(10);
29 - private final MaximumReservableLinkBandwidthTlv maximumReservableLinkBandwidthTlv1 = 30 + private final MaximumReservableLinkBandwidthSubTlv maximumReservableLinkBandwidthTlv1 =
30 - new MaximumReservableLinkBandwidthTlv(20); 31 + new MaximumReservableLinkBandwidthSubTlv(20);
31 32
32 - private final AdministrativeGroupTlv administrativeGroupTlv2 = new AdministrativeGroupTlv(20); 33 + private final AdministrativeGroupSubTlv administrativeGroupTlv2 = new AdministrativeGroupSubTlv(20);
33 - private final MaximumReservableLinkBandwidthTlv maximumReservableLinkBandwidthTlv2 = 34 + private final MaximumReservableLinkBandwidthSubTlv maximumReservableLinkBandwidthTlv2 =
34 - new MaximumReservableLinkBandwidthTlv(30); 35 + new MaximumReservableLinkBandwidthSubTlv(30);
35 36
36 - private final LinkedList<PcepValueType> llLinkAttributesSubTLV1 = new LinkedList<>(); 37 + private final List<PcepValueType> llLinkAttributesSubTLV1 = new LinkedList<>();
37 private final boolean a = llLinkAttributesSubTLV1.add(administrativeGroupTlv1); 38 private final boolean a = llLinkAttributesSubTLV1.add(administrativeGroupTlv1);
38 private final boolean b = llLinkAttributesSubTLV1.add(maximumReservableLinkBandwidthTlv1); 39 private final boolean b = llLinkAttributesSubTLV1.add(maximumReservableLinkBandwidthTlv1);
39 40
40 - private final LinkedList<PcepValueType> llLinkAttributesSubTLV2 = new LinkedList<>(); 41 + private final List<PcepValueType> llLinkAttributesSubTLV2 = new LinkedList<>();
41 42
42 private final boolean c = llLinkAttributesSubTLV2.add(administrativeGroupTlv2); 43 private final boolean c = llLinkAttributesSubTLV2.add(administrativeGroupTlv2);
43 private final boolean d = llLinkAttributesSubTLV2.add(maximumReservableLinkBandwidthTlv2); 44 private final boolean d = llLinkAttributesSubTLV2.add(maximumReservableLinkBandwidthTlv2);
44 45
45 - private final TELinkAttributesTlv tlv1 = TELinkAttributesTlv.of(llLinkAttributesSubTLV1); 46 + private final LinkAttributesTlv tlv1 = LinkAttributesTlv.of(llLinkAttributesSubTLV1);
46 - private final TELinkAttributesTlv sameAsTlv1 = TELinkAttributesTlv.of(llLinkAttributesSubTLV1); 47 + private final LinkAttributesTlv sameAsTlv1 = LinkAttributesTlv.of(llLinkAttributesSubTLV1);
47 - private final TELinkAttributesTlv tlv2 = TELinkAttributesTlv.of(llLinkAttributesSubTLV2); 48 + private final LinkAttributesTlv tlv2 = LinkAttributesTlv.of(llLinkAttributesSubTLV2);
48 49
49 @Test 50 @Test
50 public void basics() { 51 public void basics() {
......
...@@ -19,30 +19,31 @@ import com.google.common.testing.EqualsTester; ...@@ -19,30 +19,31 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 import java.util.LinkedList; 21 import java.util.LinkedList;
22 +import java.util.List;
22 23
23 /** 24 /**
24 * Test case for TE link descriptors Tlv. 25 * Test case for TE link descriptors Tlv.
25 */ 26 */
26 -public class TELinkDescriptorsTlvTest { 27 +public class LinkDescriptorsTlvTest {
27 - private final LinkLocalRemoteIdentifiersTlv linkLocalRemoteIdentifiersTlv1 = new 28 + private final LinkLocalRemoteIdentifiersSubTlv linkLocalRemoteIdentifiersTlv1 = new
28 - LinkLocalRemoteIdentifiersTlv(10, 10); 29 + LinkLocalRemoteIdentifiersSubTlv(10, 10);
29 - private final IPv4InterfaceAddressTlv iPv4InterfaceAddressTlv1 = new IPv4InterfaceAddressTlv(0x01010101); 30 + private final IPv4InterfaceAddressSubTlv iPv4InterfaceAddressTlv1 = new IPv4InterfaceAddressSubTlv(0x01010101);
30 31
31 - private final LinkLocalRemoteIdentifiersTlv linkLocalRemoteIdentifiersTlv2 = new 32 + private final LinkLocalRemoteIdentifiersSubTlv linkLocalRemoteIdentifiersTlv2 = new
32 - LinkLocalRemoteIdentifiersTlv(20, 20); 33 + LinkLocalRemoteIdentifiersSubTlv(20, 20);
33 - private final IPv4InterfaceAddressTlv iPv4InterfaceAddressTlv2 = new IPv4InterfaceAddressTlv(0x02020202); 34 + private final IPv4InterfaceAddressSubTlv iPv4InterfaceAddressTlv2 = new IPv4InterfaceAddressSubTlv(0x02020202);
34 35
35 - private final LinkedList<PcepValueType> llLinkDescriptorsSubTLVs1 = new LinkedList<>(); 36 + private final List<PcepValueType> llLinkDescriptorsSubTLVs1 = new LinkedList<>();
36 private final boolean a = llLinkDescriptorsSubTLVs1.add(linkLocalRemoteIdentifiersTlv1); 37 private final boolean a = llLinkDescriptorsSubTLVs1.add(linkLocalRemoteIdentifiersTlv1);
37 private final boolean b = llLinkDescriptorsSubTLVs1.add(iPv4InterfaceAddressTlv1); 38 private final boolean b = llLinkDescriptorsSubTLVs1.add(iPv4InterfaceAddressTlv1);
38 39
39 - private final LinkedList<PcepValueType> llLinkDescriptorsSubTLVs2 = new LinkedList<>(); 40 + private final List<PcepValueType> llLinkDescriptorsSubTLVs2 = new LinkedList<>();
40 private final boolean c = llLinkDescriptorsSubTLVs2.add(linkLocalRemoteIdentifiersTlv2); 41 private final boolean c = llLinkDescriptorsSubTLVs2.add(linkLocalRemoteIdentifiersTlv2);
41 private final boolean d = llLinkDescriptorsSubTLVs2.add(iPv4InterfaceAddressTlv2); 42 private final boolean d = llLinkDescriptorsSubTLVs2.add(iPv4InterfaceAddressTlv2);
42 43
43 - private final TELinkDescriptorsTlv tlv1 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1); 44 + private final LinkDescriptorsTlv tlv1 = LinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1);
44 - private final TELinkDescriptorsTlv sameAstlv1 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1); 45 + private final LinkDescriptorsTlv sameAstlv1 = LinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1);
45 - private final TELinkDescriptorsTlv tlv2 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs2); 46 + private final LinkDescriptorsTlv tlv2 = LinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs2);
46 47
47 @Test 48 @Test
48 public void basics() { 49 public void basics() {
......
...@@ -19,13 +19,13 @@ import com.google.common.testing.EqualsTester; ...@@ -19,13 +19,13 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the LinkLocalRemoteIdentifiersTlv. 22 + * Test of the LinkLocalRemoteIdentifiersSubTlv.
23 */ 23 */
24 -public class LinkLocalRemoteIdentifiersTlvTest { 24 +public class LinkLocalRemoteIdentifiersSubTlvTest {
25 25
26 - private final LinkLocalRemoteIdentifiersTlv tlv1 = LinkLocalRemoteIdentifiersTlv.of(10, 20); 26 + private final LinkLocalRemoteIdentifiersSubTlv tlv1 = LinkLocalRemoteIdentifiersSubTlv.of(10, 20);
27 - private final LinkLocalRemoteIdentifiersTlv sameAsTlv1 = LinkLocalRemoteIdentifiersTlv.of(10, 20); 27 + private final LinkLocalRemoteIdentifiersSubTlv sameAsTlv1 = LinkLocalRemoteIdentifiersSubTlv.of(10, 20);
28 - private final LinkLocalRemoteIdentifiersTlv tlv2 = LinkLocalRemoteIdentifiersTlv.of(20, 30); 28 + private final LinkLocalRemoteIdentifiersSubTlv tlv2 = LinkLocalRemoteIdentifiersSubTlv.of(20, 30);
29 29
30 @Test 30 @Test
31 public void basics() { 31 public void basics() {
......
...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester; ...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Equality test for LinkNameTlv. 22 + * Equality test for LinkNameAttributeSubTlv.
23 */ 23 */
24 -public class LinkNameTlvTest { 24 +public class LinkNameAttributeSubTlvTest {
25 private final byte[] rawValue1 = new byte[] {0x01, 0x00}; 25 private final byte[] rawValue1 = new byte[] {0x01, 0x00};
26 private final byte[] rawValue2 = new byte[] {0x02, 0x00}; 26 private final byte[] rawValue2 = new byte[] {0x02, 0x00};
27 27
28 - private final LinkNameTlv tlv1 = new LinkNameTlv(rawValue1, (short) rawValue1.length); 28 + private final LinkNameAttributeSubTlv tlv1 = new LinkNameAttributeSubTlv(rawValue1, (short) rawValue1.length);
29 - private final LinkNameTlv sameAsTlv1 = LinkNameTlv.of(tlv1.getValue(), tlv1.getLength()); 29 + private final LinkNameAttributeSubTlv sameAsTlv1 = LinkNameAttributeSubTlv.of(tlv1.getValue(), tlv1.getLength());
30 - private final LinkNameTlv tlv2 = new LinkNameTlv(rawValue2, (short) 0); 30 + private final LinkNameAttributeSubTlv tlv2 = new LinkNameAttributeSubTlv(rawValue2, (short) 0);
31 31
32 @Test 32 @Test
33 public void basics() { 33 public void basics() {
......
...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester; ...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the LinkProtectionTypeTlv. 22 + * Test of the LinkProtectionTypeSubTlv.
23 */ 23 */
24 -public class LinkProtectionTypeTlvTest { 24 +public class LinkProtectionTypeSubTlvTest {
25 private final byte rawValue1 = 0x0A; 25 private final byte rawValue1 = 0x0A;
26 private final byte rawValue2 = 0x0B; 26 private final byte rawValue2 = 0x0B;
27 27
28 - private final LinkProtectionTypeTlv tlv1 = new LinkProtectionTypeTlv(rawValue1); 28 + private final LinkProtectionTypeSubTlv tlv1 = new LinkProtectionTypeSubTlv(rawValue1);
29 - private final LinkProtectionTypeTlv sameAsTlv1 = new LinkProtectionTypeTlv(rawValue1); 29 + private final LinkProtectionTypeSubTlv sameAsTlv1 = new LinkProtectionTypeSubTlv(rawValue1);
30 - private final LinkProtectionTypeTlv tlv2 = new LinkProtectionTypeTlv(rawValue2, (byte) 0); 30 + private final LinkProtectionTypeSubTlv tlv2 = new LinkProtectionTypeSubTlv(rawValue2, (byte) 0);
31 31
32 @Test 32 @Test
33 public void basics() { 33 public void basics() {
......
...@@ -19,29 +19,30 @@ import com.google.common.testing.EqualsTester; ...@@ -19,29 +19,30 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 import java.util.LinkedList; 21 import java.util.LinkedList;
22 +import java.util.List;
22 23
23 /** 24 /**
24 - * Test of the LocalTENodeDescriptorsTlv. 25 + * Test of the LocalNodeDescriptorsTlv.
25 */ 26 */
26 -public class LocalTENodeDescriptorsTlvTest { 27 +public class LocalNodeDescriptorsTlvTest {
27 28
28 - private final AutonomousSystemTlv baAutoSysTlvRawValue1 = new AutonomousSystemTlv(1); 29 + private final AutonomousSystemSubTlv baAutoSysTlvRawValue1 = new AutonomousSystemSubTlv(1);
29 - private final BgpLsIdentifierTlv baBgplsIdRawValue1 = new BgpLsIdentifierTlv(1); 30 + private final BgpLsIdentifierSubTlv baBgplsIdRawValue1 = new BgpLsIdentifierSubTlv(1);
30 31
31 - private final AutonomousSystemTlv baAutoSysTlvRawValue2 = new AutonomousSystemTlv(2); 32 + private final AutonomousSystemSubTlv baAutoSysTlvRawValue2 = new AutonomousSystemSubTlv(2);
32 - private final BgpLsIdentifierTlv baBgplsIdRawValue2 = new BgpLsIdentifierTlv(2); 33 + private final BgpLsIdentifierSubTlv baBgplsIdRawValue2 = new BgpLsIdentifierSubTlv(2);
33 34
34 - private final LinkedList<PcepValueType> llNodeDescriptorSubTLVs1 = new LinkedList<PcepValueType>(); 35 + private final List<PcepValueType> llNodeDescriptorSubTLVs1 = new LinkedList<PcepValueType>();
35 private final boolean a = llNodeDescriptorSubTLVs1.add(baAutoSysTlvRawValue1); 36 private final boolean a = llNodeDescriptorSubTLVs1.add(baAutoSysTlvRawValue1);
36 private final boolean b = llNodeDescriptorSubTLVs1.add(baBgplsIdRawValue1); 37 private final boolean b = llNodeDescriptorSubTLVs1.add(baBgplsIdRawValue1);
37 38
38 - private final LinkedList<PcepValueType> llNodeDescriptorSubTLVs2 = new LinkedList<PcepValueType>(); 39 + private final List<PcepValueType> llNodeDescriptorSubTLVs2 = new LinkedList<PcepValueType>();
39 private final boolean c = llNodeDescriptorSubTLVs2.add(baAutoSysTlvRawValue2); 40 private final boolean c = llNodeDescriptorSubTLVs2.add(baAutoSysTlvRawValue2);
40 private final boolean d = llNodeDescriptorSubTLVs2.add(baBgplsIdRawValue2); 41 private final boolean d = llNodeDescriptorSubTLVs2.add(baBgplsIdRawValue2);
41 42
42 - private final LocalTENodeDescriptorsTlv tlv1 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1); 43 + private final LocalNodeDescriptorsTlv tlv1 = LocalNodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
43 - private final LocalTENodeDescriptorsTlv sameAstlv1 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1); 44 + private final LocalNodeDescriptorsTlv sameAstlv1 = LocalNodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
44 - private final LocalTENodeDescriptorsTlv tlv2 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs2); 45 + private final LocalNodeDescriptorsTlv tlv2 = LocalNodeDescriptorsTlv.of(llNodeDescriptorSubTLVs2);
45 46
46 @Test 47 @Test
47 public void basics() { 48 public void basics() {
......
...@@ -21,11 +21,11 @@ import org.junit.Test; ...@@ -21,11 +21,11 @@ import org.junit.Test;
21 /** 21 /**
22 * Test case for TED Capability tlv. 22 * Test case for TED Capability tlv.
23 */ 23 */
24 -public class TedCapabilityTlvTest { 24 +public class LsCapabilityTlvTest {
25 25
26 - private final TedCapabilityTlv tlv1 = TedCapabilityTlv.of(1); 26 + private final LsCapabilityTlv tlv1 = LsCapabilityTlv.of(1);
27 - private final TedCapabilityTlv tlv2 = TedCapabilityTlv.of(1); 27 + private final LsCapabilityTlv tlv2 = LsCapabilityTlv.of(1);
28 - private final TedCapabilityTlv tlv3 = TedCapabilityTlv.of(2); 28 + private final LsCapabilityTlv tlv3 = LsCapabilityTlv.of(2);
29 29
30 @Test 30 @Test
31 public void basics() { 31 public void basics() {
......
...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester; ...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the MaximumLinkBandwidthTlv. 22 + * Test of the MaximumLinkBandwidthSubTlv.
23 */ 23 */
24 -public class MaximumLinkBandwidthTlvTest { 24 +public class MaximumLinkBandwidthSubTlvTest {
25 private final int rawValue1 = 0x0A; 25 private final int rawValue1 = 0x0A;
26 private final int rawValue2 = 0x0B; 26 private final int rawValue2 = 0x0B;
27 27
28 - private final MaximumLinkBandwidthTlv tlv1 = new MaximumLinkBandwidthTlv(rawValue1); 28 + private final MaximumLinkBandwidthSubTlv tlv1 = new MaximumLinkBandwidthSubTlv(rawValue1);
29 - private final MaximumLinkBandwidthTlv sameAsTlv1 = new MaximumLinkBandwidthTlv(rawValue1); 29 + private final MaximumLinkBandwidthSubTlv sameAsTlv1 = new MaximumLinkBandwidthSubTlv(rawValue1);
30 - private final MaximumLinkBandwidthTlv tlv2 = MaximumLinkBandwidthTlv.of(rawValue2); 30 + private final MaximumLinkBandwidthSubTlv tlv2 = MaximumLinkBandwidthSubTlv.of(rawValue2);
31 31
32 @Test 32 @Test
33 public void basics() { 33 public void basics() {
......
...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester; ...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the MaximumReservableLinkBandwidthTlv. 22 + * Test of the MaximumReservableLinkBandwidthSubTlv.
23 */ 23 */
24 -public class MaximumReservableLinkBandwidthTlvTest { 24 +public class MaximumReservableLinkBandwidthSubTlvTest {
25 private final int rawValue1 = 0x0A; 25 private final int rawValue1 = 0x0A;
26 private final int rawValue2 = 0x0B; 26 private final int rawValue2 = 0x0B;
27 27
28 - private final MaximumReservableLinkBandwidthTlv tlv1 = new MaximumReservableLinkBandwidthTlv(rawValue1); 28 + private final MaximumReservableLinkBandwidthSubTlv tlv1 = new MaximumReservableLinkBandwidthSubTlv(rawValue1);
29 - private final MaximumReservableLinkBandwidthTlv sameAsTlv1 = new MaximumReservableLinkBandwidthTlv(rawValue1); 29 + private final MaximumReservableLinkBandwidthSubTlv sameAsTlv1 = new MaximumReservableLinkBandwidthSubTlv(rawValue1);
30 - private final MaximumReservableLinkBandwidthTlv tlv2 = MaximumReservableLinkBandwidthTlv.of(rawValue2); 30 + private final MaximumReservableLinkBandwidthSubTlv tlv2 = MaximumReservableLinkBandwidthSubTlv.of(rawValue2);
31 31
32 @Test 32 @Test
33 public void basics() { 33 public void basics() {
......
...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester; ...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the MPLSProtocolMaskTlv. 22 + * Test of the MplsProtocolMaskSubTlv.
23 */ 23 */
24 -public class MplsProtocolMaskTlvTest { 24 +public class MplsProtocolMaskSubTlvTest {
25 private final byte rawValue1 = 0x0A; 25 private final byte rawValue1 = 0x0A;
26 private final byte rawValue2 = 0x0B; 26 private final byte rawValue2 = 0x0B;
27 27
28 - private final MplsProtocolMaskTlv tlv1 = new MplsProtocolMaskTlv(rawValue1); 28 + private final MplsProtocolMaskSubTlv tlv1 = new MplsProtocolMaskSubTlv(rawValue1);
29 - private final MplsProtocolMaskTlv sameAsTlv1 = new MplsProtocolMaskTlv(rawValue1); 29 + private final MplsProtocolMaskSubTlv sameAsTlv1 = new MplsProtocolMaskSubTlv(rawValue1);
30 - private final MplsProtocolMaskTlv tlv2 = MplsProtocolMaskTlv.of(rawValue2); 30 + private final MplsProtocolMaskSubTlv tlv2 = MplsProtocolMaskSubTlv.of(rawValue2);
31 31
32 @Test 32 @Test
33 public void basics() { 33 public void basics() {
......
...@@ -19,32 +19,33 @@ import com.google.common.testing.EqualsTester; ...@@ -19,32 +19,33 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 import java.util.LinkedList; 21 import java.util.LinkedList;
22 +import java.util.List;
22 23
23 /** 24 /**
24 * Test case for TE Node Attribute tlv. 25 * Test case for TE Node Attribute tlv.
25 */ 26 */
26 -public class TENodeAttributesTlvTest { 27 +public class NodeAttributesTlvTest {
27 28
28 - private final NodeFlagBitsTlv nodeFlagBitsTlv1 = new NodeFlagBitsTlv((byte) 10); 29 + private final NodeFlagBitsSubTlv nodeFlagBitsTlv1 = new NodeFlagBitsSubTlv((byte) 10);
29 - private final IPv4TERouterIdOfLocalNodeTlv iPv4TERouterIdOfLocalNodeTlv1 = new 30 + private final IPv4RouterIdOfLocalNodeSubTlv iPv4TERouterIdOfLocalNodeTlv1 = new
30 - IPv4TERouterIdOfLocalNodeTlv(0x01010101); 31 + IPv4RouterIdOfLocalNodeSubTlv(0x01010101);
31 32
32 - private final NodeFlagBitsTlv nodeFlagBitsTlv2 = new NodeFlagBitsTlv((byte) 20); 33 + private final NodeFlagBitsSubTlv nodeFlagBitsTlv2 = new NodeFlagBitsSubTlv((byte) 20);
33 - private final IPv4TERouterIdOfLocalNodeTlv iPv4TERouterIdOfLocalNodeTlv2 = new 34 + private final IPv4RouterIdOfLocalNodeSubTlv iPv4TERouterIdOfLocalNodeTlv2 = new
34 - IPv4TERouterIdOfLocalNodeTlv(0x02020202); 35 + IPv4RouterIdOfLocalNodeSubTlv(0x02020202);
35 36
36 - private final LinkedList<PcepValueType> llNodeAttributesSubTLV1 = new LinkedList<>(); 37 + private final List<PcepValueType> llNodeAttributesSubTLV1 = new LinkedList<>();
37 private final boolean a = llNodeAttributesSubTLV1.add(nodeFlagBitsTlv1); 38 private final boolean a = llNodeAttributesSubTLV1.add(nodeFlagBitsTlv1);
38 private final boolean b = llNodeAttributesSubTLV1.add(iPv4TERouterIdOfLocalNodeTlv1); 39 private final boolean b = llNodeAttributesSubTLV1.add(iPv4TERouterIdOfLocalNodeTlv1);
39 40
40 - private final LinkedList<PcepValueType> llNodeAttributesSubTLV2 = new LinkedList<>(); 41 + private final List<PcepValueType> llNodeAttributesSubTLV2 = new LinkedList<>();
41 42
42 private final boolean c = llNodeAttributesSubTLV2.add(nodeFlagBitsTlv2); 43 private final boolean c = llNodeAttributesSubTLV2.add(nodeFlagBitsTlv2);
43 private final boolean d = llNodeAttributesSubTLV2.add(iPv4TERouterIdOfLocalNodeTlv2); 44 private final boolean d = llNodeAttributesSubTLV2.add(iPv4TERouterIdOfLocalNodeTlv2);
44 45
45 - private final TENodeAttributesTlv tlv1 = TENodeAttributesTlv.of(llNodeAttributesSubTLV1); 46 + private final NodeAttributesTlv tlv1 = NodeAttributesTlv.of(llNodeAttributesSubTLV1);
46 - private final TENodeAttributesTlv sameAsTlv1 = TENodeAttributesTlv.of(llNodeAttributesSubTLV1); 47 + private final NodeAttributesTlv sameAsTlv1 = NodeAttributesTlv.of(llNodeAttributesSubTLV1);
47 - private final TENodeAttributesTlv tlv2 = TENodeAttributesTlv.of(llNodeAttributesSubTLV2); 48 + private final NodeAttributesTlv tlv2 = NodeAttributesTlv.of(llNodeAttributesSubTLV2);
48 49
49 @Test 50 @Test
50 public void basics() { 51 public void basics() {
......
...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester; ...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the NodeFlagBitsTlv. 22 + * Test of the NodeFlagBitsSubTlv.
23 */ 23 */
24 -public class NodeFlagBitsTlvTest { 24 +public class NodeFlagBitsSubTlvTest {
25 private final byte rawValue1 = 0x0A; 25 private final byte rawValue1 = 0x0A;
26 private final byte rawValue2 = 0x0B; 26 private final byte rawValue2 = 0x0B;
27 27
28 - private final NodeFlagBitsTlv tlv1 = new NodeFlagBitsTlv(rawValue1); 28 + private final NodeFlagBitsSubTlv tlv1 = new NodeFlagBitsSubTlv(rawValue1);
29 - private final NodeFlagBitsTlv sameAsTlv1 = new NodeFlagBitsTlv(rawValue1); 29 + private final NodeFlagBitsSubTlv sameAsTlv1 = new NodeFlagBitsSubTlv(rawValue1);
30 - private final NodeFlagBitsTlv tlv2 = NodeFlagBitsTlv.of(rawValue2); 30 + private final NodeFlagBitsSubTlv tlv2 = NodeFlagBitsSubTlv.of(rawValue2);
31 31
32 @Test 32 @Test
33 public void basics() { 33 public void basics() {
......
...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester; ...@@ -19,15 +19,15 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the NodeNameTlv. 22 + * Test of the NodeNameSubTlv.
23 */ 23 */
24 -public class NodeNameTlvTest { 24 +public class NodeNameSubTlvTest {
25 private final byte[] rawValue1 = new byte[] {0x01, 0x02}; 25 private final byte[] rawValue1 = new byte[] {0x01, 0x02};
26 private final byte[] rawValue2 = new byte[] {0x14, 0x15}; 26 private final byte[] rawValue2 = new byte[] {0x14, 0x15};
27 27
28 - private final NodeNameTlv tlv1 = new NodeNameTlv(rawValue1, (short) rawValue1.length); 28 + private final NodeNameSubTlv tlv1 = new NodeNameSubTlv(rawValue1, (short) rawValue1.length);
29 - private final NodeNameTlv sameAsTlv1 = NodeNameTlv.of(tlv1.getValue(), tlv1.getLength()); 29 + private final NodeNameSubTlv sameAsTlv1 = NodeNameSubTlv.of(tlv1.getValue(), tlv1.getLength());
30 - private final NodeNameTlv tlv2 = new NodeNameTlv(rawValue2, (short) 0); 30 + private final NodeNameSubTlv tlv2 = new NodeNameSubTlv(rawValue2, (short) 0);
31 31
32 @Test 32 @Test
33 public void basics() { 33 public void basics() {
......
...@@ -19,15 +19,17 @@ import com.google.common.testing.EqualsTester; ...@@ -19,15 +19,17 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the OpaqueLinkAttributeTlv. 22 + * Test of the OpaqueLinkAttributeSubTlv.
23 */ 23 */
24 -public class OpaqueLinkAttributeTlvTest { 24 +public class OpaqueLinkAttributeSubTlvTest {
25 private final byte[] rawValue1 = new byte[] {0x01, 0x02}; 25 private final byte[] rawValue1 = new byte[] {0x01, 0x02};
26 private final byte[] rawValue2 = new byte[] {0x14, 0x15}; 26 private final byte[] rawValue2 = new byte[] {0x14, 0x15};
27 27
28 - private final OpaqueLinkAttributeTlv tlv1 = new OpaqueLinkAttributeTlv(rawValue1, (short) rawValue1.length); 28 + private final OpaqueLinkAttributeSubTlv tlv1 =
29 - private final OpaqueLinkAttributeTlv sameAsTlv1 = OpaqueLinkAttributeTlv.of(tlv1.getValue(), tlv1.getLength()); 29 + new OpaqueLinkAttributeSubTlv(rawValue1, (short) rawValue1.length);
30 - private final OpaqueLinkAttributeTlv tlv2 = new OpaqueLinkAttributeTlv(rawValue2, (short) 0); 30 + private final OpaqueLinkAttributeSubTlv sameAsTlv1 =
31 + OpaqueLinkAttributeSubTlv.of(tlv1.getValue(), tlv1.getLength());
32 + private final OpaqueLinkAttributeSubTlv tlv2 = new OpaqueLinkAttributeSubTlv(rawValue2, (short) 0);
31 33
32 @Test 34 @Test
33 public void basics() { 35 public void basics() {
......
...@@ -19,7 +19,7 @@ import com.google.common.testing.EqualsTester; ...@@ -19,7 +19,7 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test of the OSPFareaIDsubTlv. 22 + * Test of the OspfAreaIdSubTlv.
23 */ 23 */
24 public class OspfAreaIdSubTlvTest { 24 public class OspfAreaIdSubTlvTest {
25 private final int rawValue1 = 0x0A; 25 private final int rawValue1 = 0x0A;
......
...@@ -19,30 +19,31 @@ import com.google.common.testing.EqualsTester; ...@@ -19,30 +19,31 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 import java.util.LinkedList; 21 import java.util.LinkedList;
22 +import java.util.List;
22 23
23 /** 24 /**
24 * Test case for Remote TE Node Descriptors tlv. 25 * Test case for Remote TE Node Descriptors tlv.
25 */ 26 */
26 -public class RemoteTENodeDescriptorsTlvTest { 27 +public class RemoteNodeDescriptorsTlvTest {
27 28
28 - private final AutonomousSystemTlv autonomousSystemTlv1 = new AutonomousSystemTlv(10); 29 + private final AutonomousSystemSubTlv autonomousSystemTlv1 = new AutonomousSystemSubTlv(10);
29 - private final BgpLsIdentifierTlv bGPLSidentifierTlv1 = new BgpLsIdentifierTlv(20); 30 + private final BgpLsIdentifierSubTlv bGPLSidentifierTlv1 = new BgpLsIdentifierSubTlv(20);
30 31
31 - private final AutonomousSystemTlv autonomousSystemTlv2 = new AutonomousSystemTlv(20); 32 + private final AutonomousSystemSubTlv autonomousSystemTlv2 = new AutonomousSystemSubTlv(20);
32 - private final BgpLsIdentifierTlv bGPLSidentifierTlv2 = new BgpLsIdentifierTlv(30); 33 + private final BgpLsIdentifierSubTlv bGPLSidentifierTlv2 = new BgpLsIdentifierSubTlv(30);
33 34
34 - private final LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLV1 = new LinkedList<>(); 35 + private final List<PcepValueType> llRemoteTENodeDescriptorSubTLV1 = new LinkedList<>();
35 private final boolean a = llRemoteTENodeDescriptorSubTLV1.add(autonomousSystemTlv1); 36 private final boolean a = llRemoteTENodeDescriptorSubTLV1.add(autonomousSystemTlv1);
36 private final boolean b = llRemoteTENodeDescriptorSubTLV1.add(bGPLSidentifierTlv1); 37 private final boolean b = llRemoteTENodeDescriptorSubTLV1.add(bGPLSidentifierTlv1);
37 38
38 - private final LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLV2 = new LinkedList<>(); 39 + private final List<PcepValueType> llRemoteTENodeDescriptorSubTLV2 = new LinkedList<>();
39 private final boolean c = llRemoteTENodeDescriptorSubTLV2.add(autonomousSystemTlv2); 40 private final boolean c = llRemoteTENodeDescriptorSubTLV2.add(autonomousSystemTlv2);
40 private final boolean d = llRemoteTENodeDescriptorSubTLV2.add(bGPLSidentifierTlv2); 41 private final boolean d = llRemoteTENodeDescriptorSubTLV2.add(bGPLSidentifierTlv2);
41 42
42 - private final RemoteTENodeDescriptorsTlv tlv1 = RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1); 43 + private final RemoteNodeDescriptorsTlv tlv1 = RemoteNodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
43 - private final RemoteTENodeDescriptorsTlv sameAsTlv1 = 44 + private final RemoteNodeDescriptorsTlv sameAsTlv1 =
44 - RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1); 45 + RemoteNodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
45 - private final RemoteTENodeDescriptorsTlv tlv2 = RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV2); 46 + private final RemoteNodeDescriptorsTlv tlv2 = RemoteNodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV2);
46 47
47 @Test 48 @Test
48 public void basics() { 49 public void basics() {
......
...@@ -19,19 +19,19 @@ import com.google.common.testing.EqualsTester; ...@@ -19,19 +19,19 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test case for Shared Risk Link Group tlv. 22 + * Test case for SharedRiskLinkGroupSubTlv.
23 */ 23 */
24 -public class SharedRiskLinkGroupTlvTest { 24 +public class SharedRiskLinkGroupSubTlvTest {
25 25
26 private final int[] raw = {1 }; 26 private final int[] raw = {1 };
27 private final Short hLength = 2; 27 private final Short hLength = 2;
28 - private final SharedRiskLinkGroupTlv tlv1 = SharedRiskLinkGroupTlv.of(raw, hLength); 28 + private final SharedRiskLinkGroupSubTlv tlv1 = SharedRiskLinkGroupSubTlv.of(raw, hLength);
29 29
30 - private final SharedRiskLinkGroupTlv sameAsTlv1 = SharedRiskLinkGroupTlv.of(raw, hLength); 30 + private final SharedRiskLinkGroupSubTlv sameAsTlv1 = SharedRiskLinkGroupSubTlv.of(raw, hLength);
31 31
32 private final int[] raw2 = {2 }; 32 private final int[] raw2 = {2 };
33 private final Short hLength2 = 3; 33 private final Short hLength2 = 3;
34 - private final SharedRiskLinkGroupTlv tlv2 = SharedRiskLinkGroupTlv.of(raw2, hLength2); 34 + private final SharedRiskLinkGroupSubTlv tlv2 = SharedRiskLinkGroupSubTlv.of(raw2, hLength2);
35 35
36 @Test 36 @Test
37 public void basics() { 37 public void basics() {
......
...@@ -19,13 +19,13 @@ import com.google.common.testing.EqualsTester; ...@@ -19,13 +19,13 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Test case for TE Default Metric tlv. 22 + * Test case for TEDefaultMetricSubTlv.
23 */ 23 */
24 -public class TEDefaultMetricTlvTest { 24 +public class TEDefaultMetricSubTlvTest {
25 25
26 - private final TEDefaultMetricTlv tlv1 = TEDefaultMetricTlv.of(1); 26 + private final TEDefaultMetricSubTlv tlv1 = TEDefaultMetricSubTlv.of(1);
27 - private final TEDefaultMetricTlv tlv2 = TEDefaultMetricTlv.of(1); 27 + private final TEDefaultMetricSubTlv tlv2 = TEDefaultMetricSubTlv.of(1);
28 - private final TEDefaultMetricTlv tlv3 = TEDefaultMetricTlv.of(2); 28 + private final TEDefaultMetricSubTlv tlv3 = TEDefaultMetricSubTlv.of(2);
29 29
30 @Test 30 @Test
31 public void basics() { 31 public void basics() {
......
...@@ -19,14 +19,14 @@ import com.google.common.testing.EqualsTester; ...@@ -19,14 +19,14 @@ import com.google.common.testing.EqualsTester;
19 import org.junit.Test; 19 import org.junit.Test;
20 20
21 /** 21 /**
22 - * Unit Test case for Unreserved Bandwidth Tlv. 22 + * Unit Test case for UnreservedBandwidthSubTlv.
23 */ 23 */
24 -public class UnreservedBandwidthTlvTest { 24 +public class UnreservedBandwidthSubTlvTest {
25 25
26 // Objects of unreserved bandwidth tlv 26 // Objects of unreserved bandwidth tlv
27 - private final UnreservedBandwidthTlv tlv1 = UnreservedBandwidthTlv.of(100); 27 + private final UnreservedBandwidthSubTlv tlv1 = UnreservedBandwidthSubTlv.of(100);
28 - private final UnreservedBandwidthTlv tlv2 = UnreservedBandwidthTlv.of(100); 28 + private final UnreservedBandwidthSubTlv tlv2 = UnreservedBandwidthSubTlv.of(100);
29 - private final UnreservedBandwidthTlv tlv3 = UnreservedBandwidthTlv.of(200); 29 + private final UnreservedBandwidthSubTlv tlv3 = UnreservedBandwidthSubTlv.of(200);
30 30
31 @Test 31 @Test
32 public void basics() { 32 public void basics() {
......