Committed by
Gerrit Code Review
Remove recordCount and locatorCount from LISP control message class
Because recordCount or locatorCount is only used when decoding the LISP control message received from xTR, therefore, there is no need to provide any interface to specify this value from obj builder. Change-Id: I380b275e6f06feb4846b84f62ebf2430ad5a9ec6
Showing
15 changed files
with
36 additions
and
163 deletions
... | @@ -39,7 +39,6 @@ public final class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -39,7 +39,6 @@ public final class DefaultLispMapNotify implements LispMapNotify { |
39 | private final short keyId; | 39 | private final short keyId; |
40 | private final short authDataLength; | 40 | private final short authDataLength; |
41 | private final byte[] authenticationData; | 41 | private final byte[] authenticationData; |
42 | - private final byte recordCount; | ||
43 | private final List<LispMapRecord> mapRecords; | 42 | private final List<LispMapRecord> mapRecords; |
44 | 43 | ||
45 | /** | 44 | /** |
... | @@ -48,17 +47,14 @@ public final class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -48,17 +47,14 @@ public final class DefaultLispMapNotify implements LispMapNotify { |
48 | * @param nonce nonce | 47 | * @param nonce nonce |
49 | * @param keyId key identifier | 48 | * @param keyId key identifier |
50 | * @param authenticationData authentication data | 49 | * @param authenticationData authentication data |
51 | - * @param recordCount record count number | ||
52 | * @param mapRecords a collection of map records | 50 | * @param mapRecords a collection of map records |
53 | */ | 51 | */ |
54 | private DefaultLispMapNotify(long nonce, short keyId, short authDataLength, | 52 | private DefaultLispMapNotify(long nonce, short keyId, short authDataLength, |
55 | - byte[] authenticationData, byte recordCount, | 53 | + byte[] authenticationData, List<LispMapRecord> mapRecords) { |
56 | - List<LispMapRecord> mapRecords) { | ||
57 | this.nonce = nonce; | 54 | this.nonce = nonce; |
58 | this.keyId = keyId; | 55 | this.keyId = keyId; |
59 | this.authDataLength = authDataLength; | 56 | this.authDataLength = authDataLength; |
60 | this.authenticationData = authenticationData; | 57 | this.authenticationData = authenticationData; |
61 | - this.recordCount = recordCount; | ||
62 | this.mapRecords = mapRecords; | 58 | this.mapRecords = mapRecords; |
63 | } | 59 | } |
64 | 60 | ||
... | @@ -83,8 +79,8 @@ public final class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -83,8 +79,8 @@ public final class DefaultLispMapNotify implements LispMapNotify { |
83 | } | 79 | } |
84 | 80 | ||
85 | @Override | 81 | @Override |
86 | - public byte getRecordCount() { | 82 | + public int getRecordCount() { |
87 | - return recordCount; | 83 | + return mapRecords.size(); |
88 | } | 84 | } |
89 | 85 | ||
90 | @Override | 86 | @Override |
... | @@ -116,7 +112,6 @@ public final class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -116,7 +112,6 @@ public final class DefaultLispMapNotify implements LispMapNotify { |
116 | return toStringHelper(this) | 112 | return toStringHelper(this) |
117 | .add("type", getType()) | 113 | .add("type", getType()) |
118 | .add("nonce", nonce) | 114 | .add("nonce", nonce) |
119 | - .add("recordCount", recordCount) | ||
120 | .add("keyId", keyId) | 115 | .add("keyId", keyId) |
121 | .add("authentication data length", authDataLength) | 116 | .add("authentication data length", authDataLength) |
122 | .add("authentication data", authenticationData) | 117 | .add("authentication data", authenticationData) |
... | @@ -133,7 +128,6 @@ public final class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -133,7 +128,6 @@ public final class DefaultLispMapNotify implements LispMapNotify { |
133 | } | 128 | } |
134 | DefaultLispMapNotify that = (DefaultLispMapNotify) o; | 129 | DefaultLispMapNotify that = (DefaultLispMapNotify) o; |
135 | return Objects.equal(nonce, that.nonce) && | 130 | return Objects.equal(nonce, that.nonce) && |
136 | - Objects.equal(recordCount, that.recordCount) && | ||
137 | Objects.equal(keyId, that.keyId) && | 131 | Objects.equal(keyId, that.keyId) && |
138 | Objects.equal(authDataLength, that.authDataLength) && | 132 | Objects.equal(authDataLength, that.authDataLength) && |
139 | Arrays.equals(authenticationData, that.authenticationData); | 133 | Arrays.equals(authenticationData, that.authenticationData); |
... | @@ -141,7 +135,7 @@ public final class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -141,7 +135,7 @@ public final class DefaultLispMapNotify implements LispMapNotify { |
141 | 135 | ||
142 | @Override | 136 | @Override |
143 | public int hashCode() { | 137 | public int hashCode() { |
144 | - return Objects.hashCode(nonce, recordCount, keyId, authDataLength) + | 138 | + return Objects.hashCode(nonce, keyId, authDataLength) + |
145 | Arrays.hashCode(authenticationData); | 139 | Arrays.hashCode(authenticationData); |
146 | } | 140 | } |
147 | 141 | ||
... | @@ -151,7 +145,6 @@ public final class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -151,7 +145,6 @@ public final class DefaultLispMapNotify implements LispMapNotify { |
151 | private short keyId; | 145 | private short keyId; |
152 | private short authDataLength; | 146 | private short authDataLength; |
153 | private byte[] authenticationData; | 147 | private byte[] authenticationData; |
154 | - private byte recordCount; | ||
155 | private List<LispMapRecord> mapRecords = Lists.newArrayList(); | 148 | private List<LispMapRecord> mapRecords = Lists.newArrayList(); |
156 | 149 | ||
157 | @Override | 150 | @Override |
... | @@ -166,12 +159,6 @@ public final class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -166,12 +159,6 @@ public final class DefaultLispMapNotify implements LispMapNotify { |
166 | } | 159 | } |
167 | 160 | ||
168 | @Override | 161 | @Override |
169 | - public NotifyBuilder withRecordCount(byte recordCount) { | ||
170 | - this.recordCount = recordCount; | ||
171 | - return this; | ||
172 | - } | ||
173 | - | ||
174 | - @Override | ||
175 | public NotifyBuilder withKeyId(short keyId) { | 162 | public NotifyBuilder withKeyId(short keyId) { |
176 | this.keyId = keyId; | 163 | this.keyId = keyId; |
177 | return this; | 164 | return this; |
... | @@ -209,7 +196,7 @@ public final class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -209,7 +196,7 @@ public final class DefaultLispMapNotify implements LispMapNotify { |
209 | } | 196 | } |
210 | 197 | ||
211 | return new DefaultLispMapNotify(nonce, keyId, authDataLength, | 198 | return new DefaultLispMapNotify(nonce, keyId, authDataLength, |
212 | - authenticationData, recordCount, mapRecords); | 199 | + authenticationData, mapRecords); |
213 | } | 200 | } |
214 | } | 201 | } |
215 | 202 | ||
... | @@ -252,7 +239,6 @@ public final class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -252,7 +239,6 @@ public final class DefaultLispMapNotify implements LispMapNotify { |
252 | } | 239 | } |
253 | 240 | ||
254 | return new DefaultNotifyBuilder() | 241 | return new DefaultNotifyBuilder() |
255 | - .withRecordCount(recordCount) | ||
256 | .withNonce(nonce) | 242 | .withNonce(nonce) |
257 | .withKeyId(keyId) | 243 | .withKeyId(keyId) |
258 | .withAuthDataLength(authLength) | 244 | .withAuthDataLength(authLength) |
... | @@ -283,7 +269,7 @@ public final class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -283,7 +269,7 @@ public final class DefaultLispMapNotify implements LispMapNotify { |
283 | byteBuf.writeShort((short) UNUSED_ZERO); | 269 | byteBuf.writeShort((short) UNUSED_ZERO); |
284 | 270 | ||
285 | // record count | 271 | // record count |
286 | - byteBuf.writeByte(message.getRecordCount()); | 272 | + byteBuf.writeByte(message.getMapRecords().size()); |
287 | 273 | ||
288 | // nonce | 274 | // nonce |
289 | byteBuf.writeLong(message.getNonce()); | 275 | byteBuf.writeLong(message.getNonce()); | ... | ... |
... | @@ -38,7 +38,6 @@ import static org.onosproject.lisp.msg.protocols.DefaultLispLocatorRecord.Locato | ... | @@ -38,7 +38,6 @@ import static org.onosproject.lisp.msg.protocols.DefaultLispLocatorRecord.Locato |
38 | public final class DefaultLispMapRecord implements LispMapRecord { | 38 | public final class DefaultLispMapRecord implements LispMapRecord { |
39 | 39 | ||
40 | private final int recordTtl; | 40 | private final int recordTtl; |
41 | - private final int locatorCount; | ||
42 | private final byte maskLength; | 41 | private final byte maskLength; |
43 | private final LispMapReplyAction action; | 42 | private final LispMapReplyAction action; |
44 | private final boolean authoritative; | 43 | private final boolean authoritative; |
... | @@ -50,19 +49,17 @@ public final class DefaultLispMapRecord implements LispMapRecord { | ... | @@ -50,19 +49,17 @@ public final class DefaultLispMapRecord implements LispMapRecord { |
50 | * A private constructor that protects object instantiation from external. | 49 | * A private constructor that protects object instantiation from external. |
51 | * | 50 | * |
52 | * @param recordTtl record time-to-live value | 51 | * @param recordTtl record time-to-live value |
53 | - * @param locatorCount locator's count number | ||
54 | * @param maskLength mask length | 52 | * @param maskLength mask length |
55 | * @param action lisp map reply action | 53 | * @param action lisp map reply action |
56 | * @param authoritative authoritative flag | 54 | * @param authoritative authoritative flag |
57 | * @param mapVersionNumber map version number | 55 | * @param mapVersionNumber map version number |
58 | * @param eidPrefixAfi EID prefix AFI address | 56 | * @param eidPrefixAfi EID prefix AFI address |
59 | */ | 57 | */ |
60 | - private DefaultLispMapRecord(int recordTtl, int locatorCount, byte maskLength, | 58 | + private DefaultLispMapRecord(int recordTtl, byte maskLength, |
61 | LispMapReplyAction action, boolean authoritative, | 59 | LispMapReplyAction action, boolean authoritative, |
62 | short mapVersionNumber, LispAfiAddress eidPrefixAfi, | 60 | short mapVersionNumber, LispAfiAddress eidPrefixAfi, |
63 | List<LispLocatorRecord> locatorRecords) { | 61 | List<LispLocatorRecord> locatorRecords) { |
64 | this.recordTtl = recordTtl; | 62 | this.recordTtl = recordTtl; |
65 | - this.locatorCount = locatorCount; | ||
66 | this.maskLength = maskLength; | 63 | this.maskLength = maskLength; |
67 | this.action = action; | 64 | this.action = action; |
68 | this.authoritative = authoritative; | 65 | this.authoritative = authoritative; |
... | @@ -78,7 +75,7 @@ public final class DefaultLispMapRecord implements LispMapRecord { | ... | @@ -78,7 +75,7 @@ public final class DefaultLispMapRecord implements LispMapRecord { |
78 | 75 | ||
79 | @Override | 76 | @Override |
80 | public int getLocatorCount() { | 77 | public int getLocatorCount() { |
81 | - return locatorCount; | 78 | + return locatorRecords.size(); |
82 | } | 79 | } |
83 | 80 | ||
84 | @Override | 81 | @Override |
... | @@ -120,7 +117,6 @@ public final class DefaultLispMapRecord implements LispMapRecord { | ... | @@ -120,7 +117,6 @@ public final class DefaultLispMapRecord implements LispMapRecord { |
120 | public String toString() { | 117 | public String toString() { |
121 | return toStringHelper(this) | 118 | return toStringHelper(this) |
122 | .add("record TTL", recordTtl) | 119 | .add("record TTL", recordTtl) |
123 | - .add("locatorCount", locatorCount) | ||
124 | .add("maskLength", maskLength) | 120 | .add("maskLength", maskLength) |
125 | .add("action", action) | 121 | .add("action", action) |
126 | .add("authoritative", authoritative) | 122 | .add("authoritative", authoritative) |
... | @@ -140,7 +136,6 @@ public final class DefaultLispMapRecord implements LispMapRecord { | ... | @@ -140,7 +136,6 @@ public final class DefaultLispMapRecord implements LispMapRecord { |
140 | } | 136 | } |
141 | DefaultLispMapRecord that = (DefaultLispMapRecord) o; | 137 | DefaultLispMapRecord that = (DefaultLispMapRecord) o; |
142 | return Objects.equal(recordTtl, that.recordTtl) && | 138 | return Objects.equal(recordTtl, that.recordTtl) && |
143 | - Objects.equal(locatorCount, that.locatorCount) && | ||
144 | Objects.equal(maskLength, that.maskLength) && | 139 | Objects.equal(maskLength, that.maskLength) && |
145 | Objects.equal(action, that.action) && | 140 | Objects.equal(action, that.action) && |
146 | Objects.equal(authoritative, that.authoritative) && | 141 | Objects.equal(authoritative, that.authoritative) && |
... | @@ -151,14 +146,13 @@ public final class DefaultLispMapRecord implements LispMapRecord { | ... | @@ -151,14 +146,13 @@ public final class DefaultLispMapRecord implements LispMapRecord { |
151 | 146 | ||
152 | @Override | 147 | @Override |
153 | public int hashCode() { | 148 | public int hashCode() { |
154 | - return Objects.hashCode(recordTtl, locatorCount, maskLength, action, | 149 | + return Objects.hashCode(recordTtl, maskLength, action, |
155 | authoritative, mapVersionNumber, eidPrefixAfi, locatorRecords); | 150 | authoritative, mapVersionNumber, eidPrefixAfi, locatorRecords); |
156 | } | 151 | } |
157 | 152 | ||
158 | public static final class DefaultMapRecordBuilder implements MapRecordBuilder { | 153 | public static final class DefaultMapRecordBuilder implements MapRecordBuilder { |
159 | 154 | ||
160 | private int recordTtl; | 155 | private int recordTtl; |
161 | - private int locatorCount; | ||
162 | private byte maskLength; | 156 | private byte maskLength; |
163 | private LispMapReplyAction action; | 157 | private LispMapReplyAction action; |
164 | private boolean authoritative; | 158 | private boolean authoritative; |
... | @@ -173,12 +167,6 @@ public final class DefaultLispMapRecord implements LispMapRecord { | ... | @@ -173,12 +167,6 @@ public final class DefaultLispMapRecord implements LispMapRecord { |
173 | } | 167 | } |
174 | 168 | ||
175 | @Override | 169 | @Override |
176 | - public MapRecordBuilder withLocatorCount(int locatorCount) { | ||
177 | - this.locatorCount = locatorCount; | ||
178 | - return this; | ||
179 | - } | ||
180 | - | ||
181 | - @Override | ||
182 | public MapRecordBuilder withMaskLength(byte maskLength) { | 170 | public MapRecordBuilder withMaskLength(byte maskLength) { |
183 | this.maskLength = maskLength; | 171 | this.maskLength = maskLength; |
184 | return this; | 172 | return this; |
... | @@ -221,8 +209,8 @@ public final class DefaultLispMapRecord implements LispMapRecord { | ... | @@ -221,8 +209,8 @@ public final class DefaultLispMapRecord implements LispMapRecord { |
221 | 209 | ||
222 | checkNotNull(eidPrefixAfi, "Must specify an EID prefix"); | 210 | checkNotNull(eidPrefixAfi, "Must specify an EID prefix"); |
223 | 211 | ||
224 | - return new DefaultLispMapRecord(recordTtl, locatorCount, maskLength, | 212 | + return new DefaultLispMapRecord(recordTtl, maskLength, action, |
225 | - action, authoritative, mapVersionNumber, eidPrefixAfi, locatorRecords); | 213 | + authoritative, mapVersionNumber, eidPrefixAfi, locatorRecords); |
226 | } | 214 | } |
227 | } | 215 | } |
228 | 216 | ||
... | @@ -275,7 +263,6 @@ public final class DefaultLispMapRecord implements LispMapRecord { | ... | @@ -275,7 +263,6 @@ public final class DefaultLispMapRecord implements LispMapRecord { |
275 | 263 | ||
276 | return new DefaultMapRecordBuilder() | 264 | return new DefaultMapRecordBuilder() |
277 | .withRecordTtl(recordTtl) | 265 | .withRecordTtl(recordTtl) |
278 | - .withLocatorCount(locatorCount) | ||
279 | .withMaskLength(maskLength) | 266 | .withMaskLength(maskLength) |
280 | .withAction(action) | 267 | .withAction(action) |
281 | .withAuthoritative(authoritative) | 268 | .withAuthoritative(authoritative) |
... | @@ -304,7 +291,7 @@ public final class DefaultLispMapRecord implements LispMapRecord { | ... | @@ -304,7 +291,7 @@ public final class DefaultLispMapRecord implements LispMapRecord { |
304 | byteBuf.writeInt(message.getRecordTtl()); | 291 | byteBuf.writeInt(message.getRecordTtl()); |
305 | 292 | ||
306 | // locator count | 293 | // locator count |
307 | - byteBuf.writeByte((byte) message.getLocatorCount()); | 294 | + byteBuf.writeByte((byte) message.getLocators().size()); |
308 | 295 | ||
309 | // EID mask length | 296 | // EID mask length |
310 | byteBuf.writeByte(message.getMaskLength()); | 297 | byteBuf.writeByte(message.getMaskLength()); | ... | ... |
... | @@ -42,7 +42,6 @@ public final class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -42,7 +42,6 @@ public final class DefaultLispMapRegister implements LispMapRegister { |
42 | private final short keyId; | 42 | private final short keyId; |
43 | private final short authDataLength; | 43 | private final short authDataLength; |
44 | private final byte[] authenticationData; | 44 | private final byte[] authenticationData; |
45 | - private final byte recordCount; | ||
46 | private final List<LispMapRecord> mapRecords; | 45 | private final List<LispMapRecord> mapRecords; |
47 | private final boolean proxyMapReply; | 46 | private final boolean proxyMapReply; |
48 | private final boolean wantMapNotify; | 47 | private final boolean wantMapNotify; |
... | @@ -53,20 +52,17 @@ public final class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -53,20 +52,17 @@ public final class DefaultLispMapRegister implements LispMapRegister { |
53 | * @param nonce nonce | 52 | * @param nonce nonce |
54 | * @param keyId key identifier | 53 | * @param keyId key identifier |
55 | * @param authenticationData authentication data | 54 | * @param authenticationData authentication data |
56 | - * @param recordCount record count number | ||
57 | * @param mapRecords a collection of map records | 55 | * @param mapRecords a collection of map records |
58 | * @param proxyMapReply proxy map reply flag | 56 | * @param proxyMapReply proxy map reply flag |
59 | * @param wantMapNotify want map notify flag | 57 | * @param wantMapNotify want map notify flag |
60 | */ | 58 | */ |
61 | private DefaultLispMapRegister(long nonce, short keyId, short authDataLength, | 59 | private DefaultLispMapRegister(long nonce, short keyId, short authDataLength, |
62 | - byte[] authenticationData, byte recordCount, | 60 | + byte[] authenticationData, List<LispMapRecord> mapRecords, |
63 | - List<LispMapRecord> mapRecords, | ||
64 | boolean proxyMapReply, boolean wantMapNotify) { | 61 | boolean proxyMapReply, boolean wantMapNotify) { |
65 | this.nonce = nonce; | 62 | this.nonce = nonce; |
66 | this.keyId = keyId; | 63 | this.keyId = keyId; |
67 | this.authDataLength = authDataLength; | 64 | this.authDataLength = authDataLength; |
68 | this.authenticationData = authenticationData; | 65 | this.authenticationData = authenticationData; |
69 | - this.recordCount = recordCount; | ||
70 | this.mapRecords = mapRecords; | 66 | this.mapRecords = mapRecords; |
71 | this.proxyMapReply = proxyMapReply; | 67 | this.proxyMapReply = proxyMapReply; |
72 | this.wantMapNotify = wantMapNotify; | 68 | this.wantMapNotify = wantMapNotify; |
... | @@ -98,8 +94,8 @@ public final class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -98,8 +94,8 @@ public final class DefaultLispMapRegister implements LispMapRegister { |
98 | } | 94 | } |
99 | 95 | ||
100 | @Override | 96 | @Override |
101 | - public byte getRecordCount() { | 97 | + public int getRecordCount() { |
102 | - return recordCount; | 98 | + return mapRecords.size(); |
103 | } | 99 | } |
104 | 100 | ||
105 | @Override | 101 | @Override |
... | @@ -136,7 +132,6 @@ public final class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -136,7 +132,6 @@ public final class DefaultLispMapRegister implements LispMapRegister { |
136 | return toStringHelper(this) | 132 | return toStringHelper(this) |
137 | .add("type", getType()) | 133 | .add("type", getType()) |
138 | .add("nonce", nonce) | 134 | .add("nonce", nonce) |
139 | - .add("recordCount", recordCount) | ||
140 | .add("keyId", keyId) | 135 | .add("keyId", keyId) |
141 | .add("authentication data length", authDataLength) | 136 | .add("authentication data length", authDataLength) |
142 | .add("authentication data", authenticationData) | 137 | .add("authentication data", authenticationData) |
... | @@ -156,7 +151,6 @@ public final class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -156,7 +151,6 @@ public final class DefaultLispMapRegister implements LispMapRegister { |
156 | 151 | ||
157 | DefaultLispMapRegister that = (DefaultLispMapRegister) o; | 152 | DefaultLispMapRegister that = (DefaultLispMapRegister) o; |
158 | return Objects.equal(nonce, that.nonce) && | 153 | return Objects.equal(nonce, that.nonce) && |
159 | - Objects.equal(recordCount, that.recordCount) && | ||
160 | Objects.equal(keyId, that.keyId) && | 154 | Objects.equal(keyId, that.keyId) && |
161 | Objects.equal(authDataLength, that.authDataLength) && | 155 | Objects.equal(authDataLength, that.authDataLength) && |
162 | Arrays.equals(authenticationData, that.authenticationData) && | 156 | Arrays.equals(authenticationData, that.authenticationData) && |
... | @@ -166,7 +160,7 @@ public final class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -166,7 +160,7 @@ public final class DefaultLispMapRegister implements LispMapRegister { |
166 | 160 | ||
167 | @Override | 161 | @Override |
168 | public int hashCode() { | 162 | public int hashCode() { |
169 | - return Objects.hashCode(nonce, recordCount, keyId, authDataLength, | 163 | + return Objects.hashCode(nonce, keyId, authDataLength, |
170 | proxyMapReply, wantMapNotify) + Arrays.hashCode(authenticationData); | 164 | proxyMapReply, wantMapNotify) + Arrays.hashCode(authenticationData); |
171 | } | 165 | } |
172 | 166 | ||
... | @@ -176,7 +170,6 @@ public final class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -176,7 +170,6 @@ public final class DefaultLispMapRegister implements LispMapRegister { |
176 | private short keyId; | 170 | private short keyId; |
177 | private short authDataLength; | 171 | private short authDataLength; |
178 | private byte[] authenticationData = new byte[0]; | 172 | private byte[] authenticationData = new byte[0]; |
179 | - private byte recordCount; | ||
180 | private List<LispMapRecord> mapRecords = Lists.newArrayList(); | 173 | private List<LispMapRecord> mapRecords = Lists.newArrayList(); |
181 | private boolean proxyMapReply; | 174 | private boolean proxyMapReply; |
182 | private boolean wantMapNotify; | 175 | private boolean wantMapNotify; |
... | @@ -199,12 +192,6 @@ public final class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -199,12 +192,6 @@ public final class DefaultLispMapRegister implements LispMapRegister { |
199 | } | 192 | } |
200 | 193 | ||
201 | @Override | 194 | @Override |
202 | - public RegisterBuilder withRecordCount(byte recordCount) { | ||
203 | - this.recordCount = recordCount; | ||
204 | - return this; | ||
205 | - } | ||
206 | - | ||
207 | - @Override | ||
208 | public RegisterBuilder withNonce(long nonce) { | 195 | public RegisterBuilder withNonce(long nonce) { |
209 | this.nonce = nonce; | 196 | this.nonce = nonce; |
210 | return this; | 197 | return this; |
... | @@ -241,7 +228,7 @@ public final class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -241,7 +228,7 @@ public final class DefaultLispMapRegister implements LispMapRegister { |
241 | @Override | 228 | @Override |
242 | public LispMapRegister build() { | 229 | public LispMapRegister build() { |
243 | return new DefaultLispMapRegister(nonce, keyId, authDataLength, | 230 | return new DefaultLispMapRegister(nonce, keyId, authDataLength, |
244 | - authenticationData, recordCount, mapRecords, proxyMapReply, wantMapNotify); | 231 | + authenticationData, mapRecords, proxyMapReply, wantMapNotify); |
245 | } | 232 | } |
246 | } | 233 | } |
247 | 234 | ||
... | @@ -296,7 +283,6 @@ public final class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -296,7 +283,6 @@ public final class DefaultLispMapRegister implements LispMapRegister { |
296 | return new DefaultRegisterBuilder() | 283 | return new DefaultRegisterBuilder() |
297 | .withIsProxyMapReply(proxyMapReplyFlag) | 284 | .withIsProxyMapReply(proxyMapReplyFlag) |
298 | .withIsWantMapNotify(wantMapNotifyFlag) | 285 | .withIsWantMapNotify(wantMapNotifyFlag) |
299 | - .withRecordCount(recordCount) | ||
300 | .withNonce(nonce) | 286 | .withNonce(nonce) |
301 | .withKeyId(keyId) | 287 | .withKeyId(keyId) |
302 | .withAuthenticationData(authData) | 288 | .withAuthenticationData(authData) |
... | @@ -346,7 +332,7 @@ public final class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -346,7 +332,7 @@ public final class DefaultLispMapRegister implements LispMapRegister { |
346 | byteBuf.writeByte(wantMapNotify); | 332 | byteBuf.writeByte(wantMapNotify); |
347 | 333 | ||
348 | // record count | 334 | // record count |
349 | - byteBuf.writeByte(message.getRecordCount()); | 335 | + byteBuf.writeByte(message.getMapRecords().size()); |
350 | 336 | ||
351 | // nonce | 337 | // nonce |
352 | byteBuf.writeLong(message.getNonce()); | 338 | byteBuf.writeLong(message.getNonce()); | ... | ... |
... | @@ -35,7 +35,6 @@ import static org.onosproject.lisp.msg.protocols.DefaultLispMapRecord.MapRecordW | ... | @@ -35,7 +35,6 @@ import static org.onosproject.lisp.msg.protocols.DefaultLispMapRecord.MapRecordW |
35 | public final class DefaultLispMapReply implements LispMapReply { | 35 | public final class DefaultLispMapReply implements LispMapReply { |
36 | 36 | ||
37 | private final long nonce; | 37 | private final long nonce; |
38 | - private final byte recordCount; | ||
39 | private final boolean probe; | 38 | private final boolean probe; |
40 | private final boolean etr; | 39 | private final boolean etr; |
41 | private final boolean security; | 40 | private final boolean security; |
... | @@ -45,15 +44,13 @@ public final class DefaultLispMapReply implements LispMapReply { | ... | @@ -45,15 +44,13 @@ public final class DefaultLispMapReply implements LispMapReply { |
45 | * A private constructor that protects object instantiation from external. | 44 | * A private constructor that protects object instantiation from external. |
46 | * | 45 | * |
47 | * @param nonce nonce | 46 | * @param nonce nonce |
48 | - * @param recordCount record count number | ||
49 | * @param probe probe flag | 47 | * @param probe probe flag |
50 | * @param etr etr flag | 48 | * @param etr etr flag |
51 | * @param security security flag | 49 | * @param security security flag |
52 | */ | 50 | */ |
53 | - private DefaultLispMapReply(long nonce, byte recordCount, boolean probe, | 51 | + private DefaultLispMapReply(long nonce, boolean probe, boolean etr, |
54 | - boolean etr, boolean security, List<LispMapRecord> mapRecords) { | 52 | + boolean security, List<LispMapRecord> mapRecords) { |
55 | this.nonce = nonce; | 53 | this.nonce = nonce; |
56 | - this.recordCount = recordCount; | ||
57 | this.probe = probe; | 54 | this.probe = probe; |
58 | this.etr = etr; | 55 | this.etr = etr; |
59 | this.security = security; | 56 | this.security = security; |
... | @@ -91,8 +88,8 @@ public final class DefaultLispMapReply implements LispMapReply { | ... | @@ -91,8 +88,8 @@ public final class DefaultLispMapReply implements LispMapReply { |
91 | } | 88 | } |
92 | 89 | ||
93 | @Override | 90 | @Override |
94 | - public byte getRecordCount() { | 91 | + public int getRecordCount() { |
95 | - return recordCount; | 92 | + return mapRecords.size(); |
96 | } | 93 | } |
97 | 94 | ||
98 | @Override | 95 | @Override |
... | @@ -110,7 +107,6 @@ public final class DefaultLispMapReply implements LispMapReply { | ... | @@ -110,7 +107,6 @@ public final class DefaultLispMapReply implements LispMapReply { |
110 | return toStringHelper(this) | 107 | return toStringHelper(this) |
111 | .add("type", getType()) | 108 | .add("type", getType()) |
112 | .add("nonce", nonce) | 109 | .add("nonce", nonce) |
113 | - .add("recordCount", recordCount) | ||
114 | .add("probe", probe) | 110 | .add("probe", probe) |
115 | .add("etr", etr) | 111 | .add("etr", etr) |
116 | .add("security", security) | 112 | .add("security", security) |
... | @@ -127,7 +123,6 @@ public final class DefaultLispMapReply implements LispMapReply { | ... | @@ -127,7 +123,6 @@ public final class DefaultLispMapReply implements LispMapReply { |
127 | } | 123 | } |
128 | DefaultLispMapReply that = (DefaultLispMapReply) o; | 124 | DefaultLispMapReply that = (DefaultLispMapReply) o; |
129 | return Objects.equal(nonce, that.nonce) && | 125 | return Objects.equal(nonce, that.nonce) && |
130 | - Objects.equal(recordCount, that.recordCount) && | ||
131 | Objects.equal(probe, that.probe) && | 126 | Objects.equal(probe, that.probe) && |
132 | Objects.equal(etr, that.etr) && | 127 | Objects.equal(etr, that.etr) && |
133 | Objects.equal(security, that.security) && | 128 | Objects.equal(security, that.security) && |
... | @@ -136,13 +131,12 @@ public final class DefaultLispMapReply implements LispMapReply { | ... | @@ -136,13 +131,12 @@ public final class DefaultLispMapReply implements LispMapReply { |
136 | 131 | ||
137 | @Override | 132 | @Override |
138 | public int hashCode() { | 133 | public int hashCode() { |
139 | - return Objects.hashCode(nonce, recordCount, probe, etr, security, mapRecords); | 134 | + return Objects.hashCode(nonce, probe, etr, security, mapRecords); |
140 | } | 135 | } |
141 | 136 | ||
142 | public static final class DefaultReplyBuilder implements ReplyBuilder { | 137 | public static final class DefaultReplyBuilder implements ReplyBuilder { |
143 | 138 | ||
144 | private long nonce; | 139 | private long nonce; |
145 | - private byte recordCount; | ||
146 | private boolean probe; | 140 | private boolean probe; |
147 | private boolean etr; | 141 | private boolean etr; |
148 | private boolean security; | 142 | private boolean security; |
... | @@ -172,12 +166,6 @@ public final class DefaultLispMapReply implements LispMapReply { | ... | @@ -172,12 +166,6 @@ public final class DefaultLispMapReply implements LispMapReply { |
172 | } | 166 | } |
173 | 167 | ||
174 | @Override | 168 | @Override |
175 | - public ReplyBuilder withRecordCount(byte recordCount) { | ||
176 | - this.recordCount = recordCount; | ||
177 | - return this; | ||
178 | - } | ||
179 | - | ||
180 | - @Override | ||
181 | public ReplyBuilder withNonce(long nonce) { | 169 | public ReplyBuilder withNonce(long nonce) { |
182 | this.nonce = nonce; | 170 | this.nonce = nonce; |
183 | return this; | 171 | return this; |
... | @@ -193,7 +181,7 @@ public final class DefaultLispMapReply implements LispMapReply { | ... | @@ -193,7 +181,7 @@ public final class DefaultLispMapReply implements LispMapReply { |
193 | 181 | ||
194 | @Override | 182 | @Override |
195 | public LispMapReply build() { | 183 | public LispMapReply build() { |
196 | - return new DefaultLispMapReply(nonce, recordCount, probe, etr, security, mapRecords); | 184 | + return new DefaultLispMapReply(nonce, probe, etr, security, mapRecords); |
197 | } | 185 | } |
198 | } | 186 | } |
199 | 187 | ||
... | @@ -243,7 +231,6 @@ public final class DefaultLispMapReply implements LispMapReply { | ... | @@ -243,7 +231,6 @@ public final class DefaultLispMapReply implements LispMapReply { |
243 | .withIsProbe(probe) | 231 | .withIsProbe(probe) |
244 | .withIsEtr(etr) | 232 | .withIsEtr(etr) |
245 | .withIsSecurity(security) | 233 | .withIsSecurity(security) |
246 | - .withRecordCount(recordCount) | ||
247 | .withNonce(nonce) | 234 | .withNonce(nonce) |
248 | .build(); | 235 | .build(); |
249 | } | 236 | } |
... | @@ -296,7 +283,7 @@ public final class DefaultLispMapReply implements LispMapReply { | ... | @@ -296,7 +283,7 @@ public final class DefaultLispMapReply implements LispMapReply { |
296 | byteBuf.writeShort((short) UNUSED_ZERO); | 283 | byteBuf.writeShort((short) UNUSED_ZERO); |
297 | 284 | ||
298 | // record count | 285 | // record count |
299 | - byteBuf.writeByte(message.getRecordCount()); | 286 | + byteBuf.writeByte(message.getMapRecords().size()); |
300 | 287 | ||
301 | // nonce | 288 | // nonce |
302 | byteBuf.writeLong(message.getNonce()); | 289 | byteBuf.writeLong(message.getNonce()); | ... | ... |
... | @@ -39,7 +39,6 @@ import static org.onosproject.lisp.msg.protocols.LispEidRecord.EidRecordWriter; | ... | @@ -39,7 +39,6 @@ import static org.onosproject.lisp.msg.protocols.LispEidRecord.EidRecordWriter; |
39 | public final class DefaultLispMapRequest implements LispMapRequest { | 39 | public final class DefaultLispMapRequest implements LispMapRequest { |
40 | 40 | ||
41 | private final long nonce; | 41 | private final long nonce; |
42 | - private final byte recordCount; | ||
43 | private final LispAfiAddress sourceEid; | 42 | private final LispAfiAddress sourceEid; |
44 | private final List<LispAfiAddress> itrRlocs; | 43 | private final List<LispAfiAddress> itrRlocs; |
45 | private final List<LispEidRecord> eidRecords; | 44 | private final List<LispEidRecord> eidRecords; |
... | @@ -54,7 +53,6 @@ public final class DefaultLispMapRequest implements LispMapRequest { | ... | @@ -54,7 +53,6 @@ public final class DefaultLispMapRequest implements LispMapRequest { |
54 | * A private constructor that protects object instantiation from external. | 53 | * A private constructor that protects object instantiation from external. |
55 | * | 54 | * |
56 | * @param nonce nonce | 55 | * @param nonce nonce |
57 | - * @param recordCount record count number | ||
58 | * @param sourceEid source EID address | 56 | * @param sourceEid source EID address |
59 | * @param itrRlocs a collection of ITR RLOCs | 57 | * @param itrRlocs a collection of ITR RLOCs |
60 | * @param eidRecords a collection of EID records | 58 | * @param eidRecords a collection of EID records |
... | @@ -65,12 +63,11 @@ public final class DefaultLispMapRequest implements LispMapRequest { | ... | @@ -65,12 +63,11 @@ public final class DefaultLispMapRequest implements LispMapRequest { |
65 | * @param pitr pitr flag | 63 | * @param pitr pitr flag |
66 | * @param smrInvoked smrInvoked flag | 64 | * @param smrInvoked smrInvoked flag |
67 | */ | 65 | */ |
68 | - private DefaultLispMapRequest(long nonce, byte recordCount, LispAfiAddress sourceEid, | 66 | + private DefaultLispMapRequest(long nonce, LispAfiAddress sourceEid, |
69 | List<LispAfiAddress> itrRlocs, List<LispEidRecord> eidRecords, | 67 | List<LispAfiAddress> itrRlocs, List<LispEidRecord> eidRecords, |
70 | boolean authoritative, boolean mapDataPresent, boolean probe, | 68 | boolean authoritative, boolean mapDataPresent, boolean probe, |
71 | boolean smr, boolean pitr, boolean smrInvoked) { | 69 | boolean smr, boolean pitr, boolean smrInvoked) { |
72 | this.nonce = nonce; | 70 | this.nonce = nonce; |
73 | - this.recordCount = recordCount; | ||
74 | this.sourceEid = sourceEid; | 71 | this.sourceEid = sourceEid; |
75 | this.itrRlocs = itrRlocs; | 72 | this.itrRlocs = itrRlocs; |
76 | this.eidRecords = eidRecords; | 73 | this.eidRecords = eidRecords; |
... | @@ -128,8 +125,8 @@ public final class DefaultLispMapRequest implements LispMapRequest { | ... | @@ -128,8 +125,8 @@ public final class DefaultLispMapRequest implements LispMapRequest { |
128 | } | 125 | } |
129 | 126 | ||
130 | @Override | 127 | @Override |
131 | - public byte getRecordCount() { | 128 | + public int getRecordCount() { |
132 | - return recordCount; | 129 | + return eidRecords.size(); |
133 | } | 130 | } |
134 | 131 | ||
135 | @Override | 132 | @Override |
... | @@ -157,7 +154,6 @@ public final class DefaultLispMapRequest implements LispMapRequest { | ... | @@ -157,7 +154,6 @@ public final class DefaultLispMapRequest implements LispMapRequest { |
157 | return toStringHelper(this) | 154 | return toStringHelper(this) |
158 | .add("type", getType()) | 155 | .add("type", getType()) |
159 | .add("nonce", nonce) | 156 | .add("nonce", nonce) |
160 | - .add("recordCount", recordCount) | ||
161 | .add("source EID", sourceEid) | 157 | .add("source EID", sourceEid) |
162 | .add("ITR rlocs", itrRlocs) | 158 | .add("ITR rlocs", itrRlocs) |
163 | .add("EID records", eidRecords) | 159 | .add("EID records", eidRecords) |
... | @@ -179,7 +175,6 @@ public final class DefaultLispMapRequest implements LispMapRequest { | ... | @@ -179,7 +175,6 @@ public final class DefaultLispMapRequest implements LispMapRequest { |
179 | } | 175 | } |
180 | DefaultLispMapRequest that = (DefaultLispMapRequest) o; | 176 | DefaultLispMapRequest that = (DefaultLispMapRequest) o; |
181 | return Objects.equal(nonce, that.nonce) && | 177 | return Objects.equal(nonce, that.nonce) && |
182 | - Objects.equal(recordCount, that.recordCount) && | ||
183 | Objects.equal(sourceEid, that.sourceEid) && | 178 | Objects.equal(sourceEid, that.sourceEid) && |
184 | Objects.equal(authoritative, that.authoritative) && | 179 | Objects.equal(authoritative, that.authoritative) && |
185 | Objects.equal(mapDataPresent, that.mapDataPresent) && | 180 | Objects.equal(mapDataPresent, that.mapDataPresent) && |
... | @@ -191,14 +186,13 @@ public final class DefaultLispMapRequest implements LispMapRequest { | ... | @@ -191,14 +186,13 @@ public final class DefaultLispMapRequest implements LispMapRequest { |
191 | 186 | ||
192 | @Override | 187 | @Override |
193 | public int hashCode() { | 188 | public int hashCode() { |
194 | - return Objects.hashCode(nonce, recordCount, sourceEid, authoritative, | 189 | + return Objects.hashCode(nonce, sourceEid, authoritative, |
195 | mapDataPresent, probe, smr, pitr, smrInvoked); | 190 | mapDataPresent, probe, smr, pitr, smrInvoked); |
196 | } | 191 | } |
197 | 192 | ||
198 | public static final class DefaultRequestBuilder implements RequestBuilder { | 193 | public static final class DefaultRequestBuilder implements RequestBuilder { |
199 | 194 | ||
200 | private long nonce; | 195 | private long nonce; |
201 | - private byte recordCount; | ||
202 | private LispAfiAddress sourceEid; | 196 | private LispAfiAddress sourceEid; |
203 | private List<LispAfiAddress> itrRlocs = Lists.newArrayList(); | 197 | private List<LispAfiAddress> itrRlocs = Lists.newArrayList(); |
204 | private List<LispEidRecord> eidRecords = Lists.newArrayList(); | 198 | private List<LispEidRecord> eidRecords = Lists.newArrayList(); |
... | @@ -251,12 +245,6 @@ public final class DefaultLispMapRequest implements LispMapRequest { | ... | @@ -251,12 +245,6 @@ public final class DefaultLispMapRequest implements LispMapRequest { |
251 | } | 245 | } |
252 | 246 | ||
253 | @Override | 247 | @Override |
254 | - public RequestBuilder withRecordCount(byte recordCount) { | ||
255 | - this.recordCount = recordCount; | ||
256 | - return this; | ||
257 | - } | ||
258 | - | ||
259 | - @Override | ||
260 | public RequestBuilder withNonce(long nonce) { | 248 | public RequestBuilder withNonce(long nonce) { |
261 | this.nonce = nonce; | 249 | this.nonce = nonce; |
262 | return this; | 250 | return this; |
... | @@ -290,8 +278,8 @@ public final class DefaultLispMapRequest implements LispMapRequest { | ... | @@ -290,8 +278,8 @@ public final class DefaultLispMapRequest implements LispMapRequest { |
290 | checkNotNull(sourceEid, "Must have a source EID"); | 278 | checkNotNull(sourceEid, "Must have a source EID"); |
291 | checkArgument((itrRlocs != null) && (itrRlocs.size() > 0), "Must have an ITR RLOC entry"); | 279 | checkArgument((itrRlocs != null) && (itrRlocs.size() > 0), "Must have an ITR RLOC entry"); |
292 | 280 | ||
293 | - return new DefaultLispMapRequest(nonce, recordCount, sourceEid, itrRlocs, | 281 | + return new DefaultLispMapRequest(nonce, sourceEid, itrRlocs, eidRecords, |
294 | - eidRecords, authoritative, mapDataPresent, probe, smr, pitr, smrInvoked); | 282 | + authoritative, mapDataPresent, probe, smr, pitr, smrInvoked); |
295 | } | 283 | } |
296 | } | 284 | } |
297 | 285 | ||
... | @@ -369,7 +357,6 @@ public final class DefaultLispMapRequest implements LispMapRequest { | ... | @@ -369,7 +357,6 @@ public final class DefaultLispMapRequest implements LispMapRequest { |
369 | .withIsPitr(pitr) | 357 | .withIsPitr(pitr) |
370 | .withIsSmrInvoked(smrInvoked) | 358 | .withIsSmrInvoked(smrInvoked) |
371 | .withNonce(nonce) | 359 | .withNonce(nonce) |
372 | - .withRecordCount((byte) recordCount) | ||
373 | .withSourceEid(sourceEid) | 360 | .withSourceEid(sourceEid) |
374 | .withEidRecords(eidRecords) | 361 | .withEidRecords(eidRecords) |
375 | .withItrRlocs(itrRlocs) | 362 | .withItrRlocs(itrRlocs) |
... | @@ -445,7 +432,7 @@ public final class DefaultLispMapRequest implements LispMapRequest { | ... | @@ -445,7 +432,7 @@ public final class DefaultLispMapRequest implements LispMapRequest { |
445 | byteBuf.writeByte((byte) message.getItrRlocs().size()); | 432 | byteBuf.writeByte((byte) message.getItrRlocs().size()); |
446 | 433 | ||
447 | // record count | 434 | // record count |
448 | - byteBuf.writeByte(message.getRecordCount()); | 435 | + byteBuf.writeByte(message.getEids().size()); |
449 | 436 | ||
450 | // nonce | 437 | // nonce |
451 | byteBuf.writeLong(message.getNonce()); | 438 | byteBuf.writeLong(message.getNonce()); | ... | ... |
... | @@ -68,7 +68,7 @@ public interface LispMapNotify extends LispMessage { | ... | @@ -68,7 +68,7 @@ public interface LispMapNotify extends LispMessage { |
68 | * | 68 | * |
69 | * @return record count value | 69 | * @return record count value |
70 | */ | 70 | */ |
71 | - byte getRecordCount(); | 71 | + int getRecordCount(); |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * Obtains key identifier. | 74 | * Obtains key identifier. |
... | @@ -112,14 +112,6 @@ public interface LispMapNotify extends LispMessage { | ... | @@ -112,14 +112,6 @@ public interface LispMapNotify extends LispMessage { |
112 | NotifyBuilder withNonce(long nonce); | 112 | NotifyBuilder withNonce(long nonce); |
113 | 113 | ||
114 | /** | 114 | /** |
115 | - * Sets record count. | ||
116 | - * | ||
117 | - * @param recordCount record count | ||
118 | - * @return NotifyBuilder object | ||
119 | - */ | ||
120 | - NotifyBuilder withRecordCount(byte recordCount); | ||
121 | - | ||
122 | - /** | ||
123 | * Sets key identitifer. | 115 | * Sets key identitifer. |
124 | * | 116 | * |
125 | * @param keyId key identifier | 117 | * @param keyId key identifier | ... | ... |
... | @@ -102,14 +102,6 @@ public interface LispMapRecord { | ... | @@ -102,14 +102,6 @@ public interface LispMapRecord { |
102 | MapRecordBuilder withRecordTtl(int recordTtl); | 102 | MapRecordBuilder withRecordTtl(int recordTtl); |
103 | 103 | ||
104 | /** | 104 | /** |
105 | - * Sets locator count. | ||
106 | - * | ||
107 | - * @param locatorCount locator count | ||
108 | - * @return MapRecordBuilder object | ||
109 | - */ | ||
110 | - MapRecordBuilder withLocatorCount(int locatorCount); | ||
111 | - | ||
112 | - /** | ||
113 | * Sets mask length. | 105 | * Sets mask length. |
114 | * | 106 | * |
115 | * @param maskLength mask length | 107 | * @param maskLength mask length | ... | ... |
... | @@ -75,7 +75,7 @@ public interface LispMapRegister extends LispMessage { | ... | @@ -75,7 +75,7 @@ public interface LispMapRegister extends LispMessage { |
75 | * | 75 | * |
76 | * @return record count value | 76 | * @return record count value |
77 | */ | 77 | */ |
78 | - byte getRecordCount(); | 78 | + int getRecordCount(); |
79 | 79 | ||
80 | /** | 80 | /** |
81 | * Obtains nonce value. | 81 | * Obtains nonce value. |
... | @@ -134,14 +134,6 @@ public interface LispMapRegister extends LispMessage { | ... | @@ -134,14 +134,6 @@ public interface LispMapRegister extends LispMessage { |
134 | RegisterBuilder withIsWantMapNotify(boolean isWantMapNotify); | 134 | RegisterBuilder withIsWantMapNotify(boolean isWantMapNotify); |
135 | 135 | ||
136 | /** | 136 | /** |
137 | - * Sets record count. | ||
138 | - * | ||
139 | - * @param recordCount record count | ||
140 | - * @return RegisterBuilder object | ||
141 | - */ | ||
142 | - RegisterBuilder withRecordCount(byte recordCount); | ||
143 | - | ||
144 | - /** | ||
145 | * Sets nonce value. | 137 | * Sets nonce value. |
146 | * | 138 | * |
147 | * @param nonce nonce value | 139 | * @param nonce nonce value | ... | ... |
... | @@ -78,7 +78,7 @@ public interface LispMapReply extends LispMessage { | ... | @@ -78,7 +78,7 @@ public interface LispMapReply extends LispMessage { |
78 | * | 78 | * |
79 | * @return record count value | 79 | * @return record count value |
80 | */ | 80 | */ |
81 | - byte getRecordCount(); | 81 | + int getRecordCount(); |
82 | 82 | ||
83 | /** | 83 | /** |
84 | * Obtains nonce value. | 84 | * Obtains nonce value. |
... | @@ -124,14 +124,6 @@ public interface LispMapReply extends LispMessage { | ... | @@ -124,14 +124,6 @@ public interface LispMapReply extends LispMessage { |
124 | ReplyBuilder withIsSecurity(boolean security); | 124 | ReplyBuilder withIsSecurity(boolean security); |
125 | 125 | ||
126 | /** | 126 | /** |
127 | - * Sets record count. | ||
128 | - * | ||
129 | - * @param recordCount record count | ||
130 | - * @return ReplyBuilder object | ||
131 | - */ | ||
132 | - ReplyBuilder withRecordCount(byte recordCount); | ||
133 | - | ||
134 | - /** | ||
135 | * Sets nonce value. | 127 | * Sets nonce value. |
136 | * | 128 | * |
137 | * @param nonce nonce value | 129 | * @param nonce nonce value | ... | ... |
... | @@ -102,7 +102,7 @@ public interface LispMapRequest extends LispMessage { | ... | @@ -102,7 +102,7 @@ public interface LispMapRequest extends LispMessage { |
102 | * | 102 | * |
103 | * @return record count value | 103 | * @return record count value |
104 | */ | 104 | */ |
105 | - byte getRecordCount(); | 105 | + int getRecordCount(); |
106 | 106 | ||
107 | /** | 107 | /** |
108 | * Obtains nonce value. | 108 | * Obtains nonce value. |
... | @@ -186,14 +186,6 @@ public interface LispMapRequest extends LispMessage { | ... | @@ -186,14 +186,6 @@ public interface LispMapRequest extends LispMessage { |
186 | RequestBuilder withIsSmrInvoked(boolean smrInvoked); | 186 | RequestBuilder withIsSmrInvoked(boolean smrInvoked); |
187 | 187 | ||
188 | /** | 188 | /** |
189 | - * Sets record count. | ||
190 | - * | ||
191 | - * @param recordCount record count | ||
192 | - * @return RequestBuilder object | ||
193 | - */ | ||
194 | - RequestBuilder withRecordCount(byte recordCount); | ||
195 | - | ||
196 | - /** | ||
197 | * Sets nonce value. | 189 | * Sets nonce value. |
198 | * | 190 | * |
199 | * @param nonce nonce value | 191 | * @param nonce nonce value | ... | ... |
... | @@ -46,7 +46,6 @@ public final class DefaultLispMapNotifyTest { | ... | @@ -46,7 +46,6 @@ public final class DefaultLispMapNotifyTest { |
46 | notify1 = builder1 | 46 | notify1 = builder1 |
47 | .withKeyId((short) 1) | 47 | .withKeyId((short) 1) |
48 | .withNonce(1L) | 48 | .withNonce(1L) |
49 | - .withRecordCount((byte) 0) | ||
50 | .build(); | 49 | .build(); |
51 | 50 | ||
52 | LispMapNotify.NotifyBuilder builder2 = | 51 | LispMapNotify.NotifyBuilder builder2 = |
... | @@ -55,7 +54,6 @@ public final class DefaultLispMapNotifyTest { | ... | @@ -55,7 +54,6 @@ public final class DefaultLispMapNotifyTest { |
55 | sameAsNotify1 = builder2 | 54 | sameAsNotify1 = builder2 |
56 | .withKeyId((short) 1) | 55 | .withKeyId((short) 1) |
57 | .withNonce(1L) | 56 | .withNonce(1L) |
58 | - .withRecordCount((byte) 0) | ||
59 | .build(); | 57 | .build(); |
60 | 58 | ||
61 | LispMapNotify.NotifyBuilder builder3 = | 59 | LispMapNotify.NotifyBuilder builder3 = |
... | @@ -64,7 +62,6 @@ public final class DefaultLispMapNotifyTest { | ... | @@ -64,7 +62,6 @@ public final class DefaultLispMapNotifyTest { |
64 | notify2 = builder3 | 62 | notify2 = builder3 |
65 | .withKeyId((short) 2) | 63 | .withKeyId((short) 2) |
66 | .withNonce(2L) | 64 | .withNonce(2L) |
67 | - .withRecordCount((byte) 0x02) | ||
68 | .build(); | 65 | .build(); |
69 | } | 66 | } |
70 | 67 | ||
... | @@ -81,7 +78,6 @@ public final class DefaultLispMapNotifyTest { | ... | @@ -81,7 +78,6 @@ public final class DefaultLispMapNotifyTest { |
81 | 78 | ||
82 | assertThat(notify.getKeyId(), is((short) 1)); | 79 | assertThat(notify.getKeyId(), is((short) 1)); |
83 | assertThat(notify.getNonce(), is(1L)); | 80 | assertThat(notify.getNonce(), is(1L)); |
84 | - assertThat(notify.getRecordCount(), is((byte) 0)); | ||
85 | } | 81 | } |
86 | 82 | ||
87 | @Test | 83 | @Test | ... | ... |
... | @@ -50,7 +50,6 @@ public final class DefaultLispMapRecordTest { | ... | @@ -50,7 +50,6 @@ public final class DefaultLispMapRecordTest { |
50 | record1 = builder1 | 50 | record1 = builder1 |
51 | .withRecordTtl(100) | 51 | .withRecordTtl(100) |
52 | .withAuthoritative(true) | 52 | .withAuthoritative(true) |
53 | - .withLocatorCount(0) | ||
54 | .withMapVersionNumber((short) 1) | 53 | .withMapVersionNumber((short) 1) |
55 | .withMaskLength((byte) 0x01) | 54 | .withMaskLength((byte) 0x01) |
56 | .withAction(LispMapReplyAction.NativelyForward) | 55 | .withAction(LispMapReplyAction.NativelyForward) |
... | @@ -63,7 +62,6 @@ public final class DefaultLispMapRecordTest { | ... | @@ -63,7 +62,6 @@ public final class DefaultLispMapRecordTest { |
63 | sameAsRecord1 = builder2 | 62 | sameAsRecord1 = builder2 |
64 | .withRecordTtl(100) | 63 | .withRecordTtl(100) |
65 | .withAuthoritative(true) | 64 | .withAuthoritative(true) |
66 | - .withLocatorCount(0) | ||
67 | .withMapVersionNumber((short) 1) | 65 | .withMapVersionNumber((short) 1) |
68 | .withMaskLength((byte) 0x01) | 66 | .withMaskLength((byte) 0x01) |
69 | .withAction(LispMapReplyAction.NativelyForward) | 67 | .withAction(LispMapReplyAction.NativelyForward) |
... | @@ -78,7 +76,6 @@ public final class DefaultLispMapRecordTest { | ... | @@ -78,7 +76,6 @@ public final class DefaultLispMapRecordTest { |
78 | record2 = builder3 | 76 | record2 = builder3 |
79 | .withRecordTtl(200) | 77 | .withRecordTtl(200) |
80 | .withAuthoritative(false) | 78 | .withAuthoritative(false) |
81 | - .withLocatorCount(200) | ||
82 | .withMapVersionNumber((short) 2) | 79 | .withMapVersionNumber((short) 2) |
83 | .withMaskLength((byte) 0x02) | 80 | .withMaskLength((byte) 0x02) |
84 | .withAction(LispMapReplyAction.Drop) | 81 | .withAction(LispMapReplyAction.Drop) |
... | @@ -101,7 +98,6 @@ public final class DefaultLispMapRecordTest { | ... | @@ -101,7 +98,6 @@ public final class DefaultLispMapRecordTest { |
101 | 98 | ||
102 | assertThat(record.getRecordTtl(), is(100)); | 99 | assertThat(record.getRecordTtl(), is(100)); |
103 | assertThat(record.isAuthoritative(), is(true)); | 100 | assertThat(record.isAuthoritative(), is(true)); |
104 | - assertThat(record.getLocatorCount(), is(0)); | ||
105 | assertThat(record.getMapVersionNumber(), is((short) 1)); | 101 | assertThat(record.getMapVersionNumber(), is((short) 1)); |
106 | assertThat(record.getMaskLength(), is((byte) 0x01)); | 102 | assertThat(record.getMaskLength(), is((byte) 0x01)); |
107 | assertThat(record.getAction(), is(LispMapReplyAction.NativelyForward)); | 103 | assertThat(record.getAction(), is(LispMapReplyAction.NativelyForward)); | ... | ... |
... | @@ -49,7 +49,6 @@ public final class DefaultLispMapRegisterTest { | ... | @@ -49,7 +49,6 @@ public final class DefaultLispMapRegisterTest { |
49 | .withIsWantMapNotify(false) | 49 | .withIsWantMapNotify(false) |
50 | .withKeyId((short) 1) | 50 | .withKeyId((short) 1) |
51 | .withNonce(1L) | 51 | .withNonce(1L) |
52 | - .withRecordCount((byte) 0) | ||
53 | .build(); | 52 | .build(); |
54 | 53 | ||
55 | LispMapRegister.RegisterBuilder builder2 = | 54 | LispMapRegister.RegisterBuilder builder2 = |
... | @@ -60,7 +59,6 @@ public final class DefaultLispMapRegisterTest { | ... | @@ -60,7 +59,6 @@ public final class DefaultLispMapRegisterTest { |
60 | .withIsWantMapNotify(false) | 59 | .withIsWantMapNotify(false) |
61 | .withKeyId((short) 1) | 60 | .withKeyId((short) 1) |
62 | .withNonce(1L) | 61 | .withNonce(1L) |
63 | - .withRecordCount((byte) 0) | ||
64 | .build(); | 62 | .build(); |
65 | 63 | ||
66 | LispMapRegister.RegisterBuilder builder3 = | 64 | LispMapRegister.RegisterBuilder builder3 = |
... | @@ -71,7 +69,6 @@ public final class DefaultLispMapRegisterTest { | ... | @@ -71,7 +69,6 @@ public final class DefaultLispMapRegisterTest { |
71 | .withIsWantMapNotify(false) | 69 | .withIsWantMapNotify(false) |
72 | .withKeyId((short) 2) | 70 | .withKeyId((short) 2) |
73 | .withNonce(2L) | 71 | .withNonce(2L) |
74 | - .withRecordCount((byte) 0x02) | ||
75 | .build(); | 72 | .build(); |
76 | } | 73 | } |
77 | 74 | ||
... | @@ -90,7 +87,6 @@ public final class DefaultLispMapRegisterTest { | ... | @@ -90,7 +87,6 @@ public final class DefaultLispMapRegisterTest { |
90 | assertThat(register.isWantMapNotify(), is(false)); | 87 | assertThat(register.isWantMapNotify(), is(false)); |
91 | assertThat(register.getKeyId(), is((short) 1)); | 88 | assertThat(register.getKeyId(), is((short) 1)); |
92 | assertThat(register.getNonce(), is(1L)); | 89 | assertThat(register.getNonce(), is(1L)); |
93 | - assertThat(register.getRecordCount(), is((byte) 0)); | ||
94 | } | 90 | } |
95 | 91 | ||
96 | @Test | 92 | @Test | ... | ... |
... | @@ -49,7 +49,6 @@ public final class DefaultLispMapReplyTest { | ... | @@ -49,7 +49,6 @@ public final class DefaultLispMapReplyTest { |
49 | .withIsProbe(false) | 49 | .withIsProbe(false) |
50 | .withIsSecurity(true) | 50 | .withIsSecurity(true) |
51 | .withNonce(1L) | 51 | .withNonce(1L) |
52 | - .withRecordCount((byte) 0) | ||
53 | .build(); | 52 | .build(); |
54 | 53 | ||
55 | LispMapReply.ReplyBuilder builder2 = | 54 | LispMapReply.ReplyBuilder builder2 = |
... | @@ -60,7 +59,6 @@ public final class DefaultLispMapReplyTest { | ... | @@ -60,7 +59,6 @@ public final class DefaultLispMapReplyTest { |
60 | .withIsProbe(false) | 59 | .withIsProbe(false) |
61 | .withIsSecurity(true) | 60 | .withIsSecurity(true) |
62 | .withNonce(1L) | 61 | .withNonce(1L) |
63 | - .withRecordCount((byte) 0) | ||
64 | .build(); | 62 | .build(); |
65 | 63 | ||
66 | LispMapReply.ReplyBuilder builder3 = | 64 | LispMapReply.ReplyBuilder builder3 = |
... | @@ -70,7 +68,6 @@ public final class DefaultLispMapReplyTest { | ... | @@ -70,7 +68,6 @@ public final class DefaultLispMapReplyTest { |
70 | .withIsProbe(true) | 68 | .withIsProbe(true) |
71 | .withIsSecurity(false) | 69 | .withIsSecurity(false) |
72 | .withNonce(2L) | 70 | .withNonce(2L) |
73 | - .withRecordCount((byte) 0x02) | ||
74 | .build(); | 71 | .build(); |
75 | } | 72 | } |
76 | 73 | ||
... | @@ -89,7 +86,6 @@ public final class DefaultLispMapReplyTest { | ... | @@ -89,7 +86,6 @@ public final class DefaultLispMapReplyTest { |
89 | assertThat(reply.isProbe(), is(false)); | 86 | assertThat(reply.isProbe(), is(false)); |
90 | assertThat(reply.isSecurity(), is(true)); | 87 | assertThat(reply.isSecurity(), is(true)); |
91 | assertThat(reply.getNonce(), is(1L)); | 88 | assertThat(reply.getNonce(), is(1L)); |
92 | - assertThat(reply.getRecordCount(), is((byte) 0)); | ||
93 | } | 89 | } |
94 | 90 | ||
95 | @Test | 91 | @Test | ... | ... |
... | @@ -65,7 +65,6 @@ public final class DefaultLispMapRequestTest { | ... | @@ -65,7 +65,6 @@ public final class DefaultLispMapRequestTest { |
65 | .withSourceEid(ipv4Eid1) | 65 | .withSourceEid(ipv4Eid1) |
66 | .withItrRlocs(rlocs1) | 66 | .withItrRlocs(rlocs1) |
67 | .withNonce(1L) | 67 | .withNonce(1L) |
68 | - .withRecordCount((byte) 0) | ||
69 | .build(); | 68 | .build(); |
70 | 69 | ||
71 | RequestBuilder builder2 = new DefaultRequestBuilder(); | 70 | RequestBuilder builder2 = new DefaultRequestBuilder(); |
... | @@ -80,7 +79,6 @@ public final class DefaultLispMapRequestTest { | ... | @@ -80,7 +79,6 @@ public final class DefaultLispMapRequestTest { |
80 | .withSourceEid(ipv4Eid1) | 79 | .withSourceEid(ipv4Eid1) |
81 | .withItrRlocs(rlocs1) | 80 | .withItrRlocs(rlocs1) |
82 | .withNonce(1L) | 81 | .withNonce(1L) |
83 | - .withRecordCount((byte) 0) | ||
84 | .build(); | 82 | .build(); |
85 | 83 | ||
86 | RequestBuilder builder3 = new DefaultRequestBuilder(); | 84 | RequestBuilder builder3 = new DefaultRequestBuilder(); |
... | @@ -102,7 +100,6 @@ public final class DefaultLispMapRequestTest { | ... | @@ -102,7 +100,6 @@ public final class DefaultLispMapRequestTest { |
102 | .withSourceEid(ipv4Eid2) | 100 | .withSourceEid(ipv4Eid2) |
103 | .withItrRlocs(rlocs2) | 101 | .withItrRlocs(rlocs2) |
104 | .withNonce(2L) | 102 | .withNonce(2L) |
105 | - .withRecordCount((byte) 0x02) | ||
106 | .build(); | 103 | .build(); |
107 | } | 104 | } |
108 | 105 | ||
... | @@ -124,7 +121,6 @@ public final class DefaultLispMapRequestTest { | ... | @@ -124,7 +121,6 @@ public final class DefaultLispMapRequestTest { |
124 | assertThat(request.isSmr(), is(true)); | 121 | assertThat(request.isSmr(), is(true)); |
125 | assertThat(request.isSmrInvoked(), is(false)); | 122 | assertThat(request.isSmrInvoked(), is(false)); |
126 | assertThat(request.getNonce(), is(1L)); | 123 | assertThat(request.getNonce(), is(1L)); |
127 | - assertThat(request.getRecordCount(), is((byte) 0)); | ||
128 | } | 124 | } |
129 | 125 | ||
130 | @Test | 126 | @Test | ... | ... |
-
Please register or login to post a comment