Mahesh Poojary S
Committed by Gerrit Code Review

PCEP modificaton to support PCEP-LS

Change-Id: Ic829dd17b0398ad76ec412b4e8293de564b5b56b
Showing 111 changed files with 1107 additions and 895 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 }
......
...@@ -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,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
......