blob: 196071c0c87bc674eb27c68bfbddad503b76cabf [file] [log] [blame]
slowr13fa5b02017-08-08 16:32:31 -07001/**
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08002 * This class file was automatically generated by jASN1 v1.8.2 (http://www.openmuc.org)
slowr13fa5b02017-08-08 16:32:31 -07003 */
4
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08005package org.onosproject.xran.asn1lib.pdu;
slowr13fa5b02017-08-08 16:32:31 -07006
slowr60d4d102017-08-16 18:33:58 -07007import com.fasterxml.jackson.annotation.JsonIgnore;
8import com.fasterxml.jackson.annotation.JsonValue;
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08009import org.onosproject.xran.asn1lib.api.CRNTI;
10import org.onosproject.xran.asn1lib.api.ECGI;
11import org.onosproject.xran.asn1lib.api.PCIARFCN;
12import org.onosproject.xran.asn1lib.api.XICICPA;
13import org.onosproject.xran.asn1lib.ber.BerByteArrayOutputStream;
14import org.onosproject.xran.asn1lib.ber.BerLength;
15import org.onosproject.xran.asn1lib.ber.BerTag;
16import org.onosproject.xran.asn1lib.ber.types.BerBitString;
17import org.onosproject.xran.asn1lib.ber.types.BerInteger;
18import org.onosproject.xran.asn1lib.ber.types.string.BerUTF8String;
slowr67d05e42017-08-11 20:37:22 -070019
slowr13fa5b02017-08-08 16:32:31 -070020import java.io.IOException;
21import java.io.InputStream;
22import java.io.Serializable;
slowr67d05e42017-08-11 20:37:22 -070023import java.io.UnsupportedEncodingException;
slowr13fa5b02017-08-08 16:32:31 -070024import java.util.ArrayList;
25import java.util.Iterator;
26import java.util.List;
27
28public class RRMConfig implements Serializable {
29
slowr67d05e42017-08-11 20:37:22 -070030 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
31 private static final long serialVersionUID = 1L;
slowr60d4d102017-08-16 18:33:58 -070032 @JsonIgnore
slowr67d05e42017-08-11 20:37:22 -070033 public byte[] code = null;
34 private ECGI ecgi = null;
35 private Crnti crnti = null;
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -080036 private PCIARFCN pciArfcn = null;
slowr67d05e42017-08-11 20:37:22 -070037 private Pa pa = null;
38 private StartPrbDl startPrbDl = null;
39 private EndPrbDl endPrbDl = null;
40 private SubframeBitmaskDl subframeBitmaskDl = null;
41 private P0UePusch p0UePusch = null;
42 private StartPrbUl startPrbUl = null;
43 private EndPrbUl endPrbUl = null;
44 private SubframeBitmaskUl subframeBitmaskUl = null;
slowr13fa5b02017-08-08 16:32:31 -070045
slowr67d05e42017-08-11 20:37:22 -070046 public RRMConfig() {
47 }
slowr13fa5b02017-08-08 16:32:31 -070048
slowr73b4eae2017-08-17 16:09:09 -070049 public static XrancPdu constructPacket(RRMConfig config) {
50 XrancPduBody body = new XrancPduBody();
51 body.setRRMConfig(config);
52
53 BerUTF8String ver = null;
54 try {
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -080055 ver = new BerUTF8String("5");
slowr73b4eae2017-08-17 16:09:09 -070056 } catch (UnsupportedEncodingException e) {
57 e.printStackTrace();
58 }
59
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -080060 XrancApiID apiID = new XrancApiID(27);
slowr73b4eae2017-08-17 16:09:09 -070061 XrancPduHdr hdr = new XrancPduHdr();
62 hdr.setVer(ver);
63 hdr.setApiId(apiID);
64
65 XrancPdu pdu = new XrancPdu();
66 pdu.setHdr(hdr);
67 pdu.setBody(body);
68 return pdu;
69 }
70
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -080071 public RRMConfig(byte[] code) {
72 this.code = code;
73 }
74
slowr67d05e42017-08-11 20:37:22 -070075 public ECGI getEcgi() {
76 return ecgi;
77 }
slowr13fa5b02017-08-08 16:32:31 -070078
slowr67d05e42017-08-11 20:37:22 -070079 public void setEcgi(ECGI ecgi) {
80 this.ecgi = ecgi;
81 }
slowr13fa5b02017-08-08 16:32:31 -070082
slowr67d05e42017-08-11 20:37:22 -070083 public Crnti getCrnti() {
84 return crnti;
85 }
slowr13fa5b02017-08-08 16:32:31 -070086
slowr67d05e42017-08-11 20:37:22 -070087 public void setCrnti(Crnti crnti) {
88 this.crnti = crnti;
89 }
slowr13fa5b02017-08-08 16:32:31 -070090
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -080091 public PCIARFCN getPciArfcn() {
92 return pciArfcn;
93 }
94
95 public void setPciArfcn(PCIARFCN pciArfcn) {
96 this.pciArfcn = pciArfcn;
97 }
98
slowr67d05e42017-08-11 20:37:22 -070099 public Pa getPa() {
100 return pa;
101 }
slowr13fa5b02017-08-08 16:32:31 -0700102
slowr67d05e42017-08-11 20:37:22 -0700103 public void setPa(Pa pa) {
104 this.pa = pa;
105 }
slowr13fa5b02017-08-08 16:32:31 -0700106
slowr67d05e42017-08-11 20:37:22 -0700107 public StartPrbDl getStartPrbDl() {
108 return startPrbDl;
109 }
slowr13fa5b02017-08-08 16:32:31 -0700110
slowr67d05e42017-08-11 20:37:22 -0700111 public void setStartPrbDl(StartPrbDl startPrbDl) {
112 this.startPrbDl = startPrbDl;
113 }
slowr13fa5b02017-08-08 16:32:31 -0700114
slowr67d05e42017-08-11 20:37:22 -0700115 public EndPrbDl getEndPrbDl() {
116 return endPrbDl;
117 }
slowr13fa5b02017-08-08 16:32:31 -0700118
slowr67d05e42017-08-11 20:37:22 -0700119 public void setEndPrbDl(EndPrbDl endPrbDl) {
120 this.endPrbDl = endPrbDl;
121 }
slowr13fa5b02017-08-08 16:32:31 -0700122
slowr67d05e42017-08-11 20:37:22 -0700123 public SubframeBitmaskDl getSubframeBitmaskDl() {
124 return subframeBitmaskDl;
125 }
slowr13fa5b02017-08-08 16:32:31 -0700126
slowr67d05e42017-08-11 20:37:22 -0700127 public void setSubframeBitmaskDl(SubframeBitmaskDl subframeBitmaskDl) {
128 this.subframeBitmaskDl = subframeBitmaskDl;
129 }
slowr13fa5b02017-08-08 16:32:31 -0700130
slowr67d05e42017-08-11 20:37:22 -0700131 public P0UePusch getP0UePusch() {
132 return p0UePusch;
133 }
slowr13fa5b02017-08-08 16:32:31 -0700134
slowr67d05e42017-08-11 20:37:22 -0700135 public void setP0UePusch(P0UePusch p0UePusch) {
136 this.p0UePusch = p0UePusch;
137 }
slowr13fa5b02017-08-08 16:32:31 -0700138
slowr67d05e42017-08-11 20:37:22 -0700139 public StartPrbUl getStartPrbUl() {
140 return startPrbUl;
141 }
slowr13fa5b02017-08-08 16:32:31 -0700142
slowr67d05e42017-08-11 20:37:22 -0700143 public void setStartPrbUl(StartPrbUl startPrbUl) {
144 this.startPrbUl = startPrbUl;
145 }
slowr13fa5b02017-08-08 16:32:31 -0700146
slowr67d05e42017-08-11 20:37:22 -0700147 public EndPrbUl getEndPrbUl() {
148 return endPrbUl;
149 }
slowr13fa5b02017-08-08 16:32:31 -0700150
slowr67d05e42017-08-11 20:37:22 -0700151 public void setEndPrbUl(EndPrbUl endPrbUl) {
152 this.endPrbUl = endPrbUl;
153 }
slowr13fa5b02017-08-08 16:32:31 -0700154
slowr67d05e42017-08-11 20:37:22 -0700155 public SubframeBitmaskUl getSubframeBitmaskUl() {
156 return subframeBitmaskUl;
157 }
slowr13fa5b02017-08-08 16:32:31 -0700158
slowr67d05e42017-08-11 20:37:22 -0700159 public void setSubframeBitmaskUl(SubframeBitmaskUl subframeBitmaskUl) {
160 this.subframeBitmaskUl = subframeBitmaskUl;
161 }
slowr13fa5b02017-08-08 16:32:31 -0700162
slowr67d05e42017-08-11 20:37:22 -0700163 public int encode(BerByteArrayOutputStream os) throws IOException {
164 return encode(os, true);
165 }
166
167 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
168
169 if (code != null) {
170 for (int i = code.length - 1; i >= 0; i--) {
171 os.write(code[i]);
172 }
173 if (withTag) {
174 return tag.encode(os) + code.length;
175 }
176 return code.length;
177 }
178
179 int codeLength = 0;
180 if (subframeBitmaskUl != null) {
181 codeLength += subframeBitmaskUl.encode(os, false);
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800182 // write tag: CONTEXT_CLASS, CONSTRUCTED, 10
183 os.write(0xAA);
slowr67d05e42017-08-11 20:37:22 -0700184 codeLength += 1;
185 }
186
187 if (endPrbUl != null) {
188 codeLength += endPrbUl.encode(os, false);
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800189 // write tag: CONTEXT_CLASS, CONSTRUCTED, 9
190 os.write(0xA9);
slowr67d05e42017-08-11 20:37:22 -0700191 codeLength += 1;
192 }
193
194 if (startPrbUl != null) {
195 codeLength += startPrbUl.encode(os, false);
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800196 // write tag: CONTEXT_CLASS, CONSTRUCTED, 8
197 os.write(0xA8);
slowr67d05e42017-08-11 20:37:22 -0700198 codeLength += 1;
199 }
200
201 if (p0UePusch != null) {
202 codeLength += p0UePusch.encode(os, false);
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800203 // write tag: CONTEXT_CLASS, CONSTRUCTED, 7
204 os.write(0xA7);
slowr67d05e42017-08-11 20:37:22 -0700205 codeLength += 1;
206 }
207
208 if (subframeBitmaskDl != null) {
209 codeLength += subframeBitmaskDl.encode(os, false);
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800210 // write tag: CONTEXT_CLASS, CONSTRUCTED, 6
211 os.write(0xA6);
slowr67d05e42017-08-11 20:37:22 -0700212 codeLength += 1;
213 }
214
215 if (endPrbDl != null) {
216 codeLength += endPrbDl.encode(os, false);
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800217 // write tag: CONTEXT_CLASS, CONSTRUCTED, 5
218 os.write(0xA5);
slowr67d05e42017-08-11 20:37:22 -0700219 codeLength += 1;
220 }
221
222 if (startPrbDl != null) {
223 codeLength += startPrbDl.encode(os, false);
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800224 // write tag: CONTEXT_CLASS, CONSTRUCTED, 4
225 os.write(0xA4);
slowr67d05e42017-08-11 20:37:22 -0700226 codeLength += 1;
227 }
228
229 if (pa != null) {
230 codeLength += pa.encode(os, false);
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800231 // write tag: CONTEXT_CLASS, CONSTRUCTED, 3
232 os.write(0xA3);
233 codeLength += 1;
234 }
235
236 if (pciArfcn != null) {
237 codeLength += pciArfcn.encode(os, false);
slowr67d05e42017-08-11 20:37:22 -0700238 // write tag: CONTEXT_CLASS, CONSTRUCTED, 2
239 os.write(0xA2);
240 codeLength += 1;
241 }
242
243 if (crnti != null) {
244 codeLength += crnti.encode(os, false);
245 // write tag: CONTEXT_CLASS, CONSTRUCTED, 1
246 os.write(0xA1);
247 codeLength += 1;
248 }
249
250 codeLength += ecgi.encode(os, false);
251 // write tag: CONTEXT_CLASS, CONSTRUCTED, 0
252 os.write(0xA0);
253 codeLength += 1;
254
255 codeLength += BerLength.encodeLength(os, codeLength);
256
257 if (withTag) {
258 codeLength += tag.encode(os);
259 }
260
261 return codeLength;
262
263 }
264
265 public int decode(InputStream is) throws IOException {
266 return decode(is, true);
267 }
268
269 public int decode(InputStream is, boolean withTag) throws IOException {
270 int codeLength = 0;
271 int subCodeLength = 0;
272 BerTag berTag = new BerTag();
273
274 if (withTag) {
275 codeLength += tag.decodeAndCheck(is);
276 }
277
278 BerLength length = new BerLength();
279 codeLength += length.decode(is);
280
281 int totalLength = length.val;
282 codeLength += totalLength;
283
284 subCodeLength += berTag.decode(is);
285 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
286 ecgi = new ECGI();
287 subCodeLength += ecgi.decode(is, false);
288 if (subCodeLength == totalLength) {
289 return codeLength;
290 }
291 subCodeLength += berTag.decode(is);
292 } else {
293 throw new IOException("Tag does not match the mandatory sequence element tag.");
294 }
295
296 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
297 crnti = new Crnti();
298 subCodeLength += crnti.decode(is, false);
299 if (subCodeLength == totalLength) {
300 return codeLength;
301 }
302 subCodeLength += berTag.decode(is);
303 }
304
305 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800306 pciArfcn = new PCIARFCN();
307 subCodeLength += pciArfcn.decode(is, false);
308 if (subCodeLength == totalLength) {
309 return codeLength;
310 }
311 subCodeLength += berTag.decode(is);
312 }
313
314 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) {
slowr67d05e42017-08-11 20:37:22 -0700315 pa = new Pa();
316 subCodeLength += pa.decode(is, false);
317 if (subCodeLength == totalLength) {
318 return codeLength;
319 }
320 subCodeLength += berTag.decode(is);
321 }
322
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800323 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
slowr67d05e42017-08-11 20:37:22 -0700324 startPrbDl = new StartPrbDl();
325 subCodeLength += startPrbDl.decode(is, false);
326 if (subCodeLength == totalLength) {
327 return codeLength;
328 }
329 subCodeLength += berTag.decode(is);
330 }
331
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800332 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
slowr67d05e42017-08-11 20:37:22 -0700333 endPrbDl = new EndPrbDl();
334 subCodeLength += endPrbDl.decode(is, false);
335 if (subCodeLength == totalLength) {
336 return codeLength;
337 }
338 subCodeLength += berTag.decode(is);
339 }
340
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800341 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) {
slowr67d05e42017-08-11 20:37:22 -0700342 subframeBitmaskDl = new SubframeBitmaskDl();
343 subCodeLength += subframeBitmaskDl.decode(is, false);
344 if (subCodeLength == totalLength) {
345 return codeLength;
346 }
347 subCodeLength += berTag.decode(is);
348 }
349
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800350 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 7)) {
slowr67d05e42017-08-11 20:37:22 -0700351 p0UePusch = new P0UePusch();
352 subCodeLength += p0UePusch.decode(is, false);
353 if (subCodeLength == totalLength) {
354 return codeLength;
355 }
356 subCodeLength += berTag.decode(is);
357 }
358
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800359 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 8)) {
slowr67d05e42017-08-11 20:37:22 -0700360 startPrbUl = new StartPrbUl();
361 subCodeLength += startPrbUl.decode(is, false);
362 if (subCodeLength == totalLength) {
363 return codeLength;
364 }
365 subCodeLength += berTag.decode(is);
366 }
367
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800368 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 9)) {
slowr67d05e42017-08-11 20:37:22 -0700369 endPrbUl = new EndPrbUl();
370 subCodeLength += endPrbUl.decode(is, false);
371 if (subCodeLength == totalLength) {
372 return codeLength;
373 }
374 subCodeLength += berTag.decode(is);
375 }
376
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800377 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 10)) {
slowr67d05e42017-08-11 20:37:22 -0700378 subframeBitmaskUl = new SubframeBitmaskUl();
379 subCodeLength += subframeBitmaskUl.decode(is, false);
380 if (subCodeLength == totalLength) {
381 return codeLength;
382 }
383 }
384 throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
385
386
387 }
388
389 public void encodeAndSave(int encodingSizeGuess) throws IOException {
390 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
391 encode(os, false);
392 code = os.getArray();
393 }
394
395 public String toString() {
396 StringBuilder sb = new StringBuilder();
397 appendAsString(sb, 0);
398 return sb.toString();
399 }
400
401 public void appendAsString(StringBuilder sb, int indentLevel) {
402
403 sb.append("{");
404 sb.append("\n");
405 for (int i = 0; i < indentLevel + 1; i++) {
406 sb.append("\t");
407 }
408 if (ecgi != null) {
slowr60d4d102017-08-16 18:33:58 -0700409 sb.append("ecgi: ");
slowr67d05e42017-08-11 20:37:22 -0700410 ecgi.appendAsString(sb, indentLevel + 1);
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800411 } else {
412 sb.append("ecgi: <empty-required-field>");
slowr67d05e42017-08-11 20:37:22 -0700413 }
414
415 if (crnti != null) {
416 sb.append(",\n");
417 for (int i = 0; i < indentLevel + 1; i++) {
418 sb.append("\t");
419 }
slowr60d4d102017-08-16 18:33:58 -0700420 sb.append("crnti: ");
slowr67d05e42017-08-11 20:37:22 -0700421 crnti.appendAsString(sb, indentLevel + 1);
422 }
423
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800424 if (pciArfcn != null) {
425 sb.append(",\n");
426 for (int i = 0; i < indentLevel + 1; i++) {
427 sb.append("\t");
428 }
429 sb.append("pciArfcn: ");
430 pciArfcn.appendAsString(sb, indentLevel + 1);
431 }
432
slowr67d05e42017-08-11 20:37:22 -0700433 if (pa != null) {
434 sb.append(",\n");
435 for (int i = 0; i < indentLevel + 1; i++) {
436 sb.append("\t");
437 }
slowr60d4d102017-08-16 18:33:58 -0700438 sb.append("pa: ");
slowr67d05e42017-08-11 20:37:22 -0700439 pa.appendAsString(sb, indentLevel + 1);
440 }
441
442 if (startPrbDl != null) {
443 sb.append(",\n");
444 for (int i = 0; i < indentLevel + 1; i++) {
445 sb.append("\t");
446 }
slowr60d4d102017-08-16 18:33:58 -0700447 sb.append("startPrbDl: ");
slowr67d05e42017-08-11 20:37:22 -0700448 startPrbDl.appendAsString(sb, indentLevel + 1);
449 }
450
451 if (endPrbDl != null) {
452 sb.append(",\n");
453 for (int i = 0; i < indentLevel + 1; i++) {
454 sb.append("\t");
455 }
slowr60d4d102017-08-16 18:33:58 -0700456 sb.append("endPrbDl: ");
slowr67d05e42017-08-11 20:37:22 -0700457 endPrbDl.appendAsString(sb, indentLevel + 1);
458 }
459
460 if (subframeBitmaskDl != null) {
461 sb.append(",\n");
462 for (int i = 0; i < indentLevel + 1; i++) {
463 sb.append("\t");
464 }
slowr60d4d102017-08-16 18:33:58 -0700465 sb.append("subframeBitmaskDl: ");
slowr67d05e42017-08-11 20:37:22 -0700466 subframeBitmaskDl.appendAsString(sb, indentLevel + 1);
467 }
468
469 if (p0UePusch != null) {
470 sb.append(",\n");
471 for (int i = 0; i < indentLevel + 1; i++) {
472 sb.append("\t");
473 }
slowr60d4d102017-08-16 18:33:58 -0700474 sb.append("p0UePusch: ");
slowr67d05e42017-08-11 20:37:22 -0700475 p0UePusch.appendAsString(sb, indentLevel + 1);
476 }
477
478 if (startPrbUl != null) {
479 sb.append(",\n");
480 for (int i = 0; i < indentLevel + 1; i++) {
481 sb.append("\t");
482 }
slowr60d4d102017-08-16 18:33:58 -0700483 sb.append("startPrbUl: ");
slowr67d05e42017-08-11 20:37:22 -0700484 startPrbUl.appendAsString(sb, indentLevel + 1);
485 }
486
487 if (endPrbUl != null) {
488 sb.append(",\n");
489 for (int i = 0; i < indentLevel + 1; i++) {
490 sb.append("\t");
491 }
slowr60d4d102017-08-16 18:33:58 -0700492 sb.append("endPrbUl: ");
slowr67d05e42017-08-11 20:37:22 -0700493 endPrbUl.appendAsString(sb, indentLevel + 1);
494 }
495
496 if (subframeBitmaskUl != null) {
497 sb.append(",\n");
498 for (int i = 0; i < indentLevel + 1; i++) {
499 sb.append("\t");
500 }
slowr60d4d102017-08-16 18:33:58 -0700501 sb.append("subframeBitmaskUl: ");
slowr67d05e42017-08-11 20:37:22 -0700502 subframeBitmaskUl.appendAsString(sb, indentLevel + 1);
503 }
504
505 sb.append("\n");
506 for (int i = 0; i < indentLevel; i++) {
507 sb.append("\t");
508 }
509 sb.append("}");
510 }
511
512 public static class Crnti implements Serializable {
513
514 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
515 private static final long serialVersionUID = 1L;
slowr73b4eae2017-08-17 16:09:09 -0700516 @JsonIgnore
517 public byte[] code = null;
slowr67d05e42017-08-11 20:37:22 -0700518 private List<CRNTI> seqOf = null;
519
520 public Crnti() {
521 seqOf = new ArrayList<CRNTI>();
522 }
523
524 public Crnti(byte[] code) {
525 this.code = code;
526 }
527
slowr60d4d102017-08-16 18:33:58 -0700528 @JsonValue
slowr67d05e42017-08-11 20:37:22 -0700529 public List<CRNTI> getCRNTI() {
530 if (seqOf == null) {
531 seqOf = new ArrayList<CRNTI>();
532 }
533 return seqOf;
534 }
535
slowr67d05e42017-08-11 20:37:22 -0700536 public int encode(BerByteArrayOutputStream os) throws IOException {
537 return encode(os, true);
538 }
539
540 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
541
542 if (code != null) {
543 for (int i = code.length - 1; i >= 0; i--) {
544 os.write(code[i]);
545 }
546 if (withTag) {
547 return tag.encode(os) + code.length;
548 }
549 return code.length;
550 }
551
552 int codeLength = 0;
553 for (int i = (seqOf.size() - 1); i >= 0; i--) {
554 codeLength += seqOf.get(i).encode(os, true);
555 }
556
557 codeLength += BerLength.encodeLength(os, codeLength);
558
559 if (withTag) {
560 codeLength += tag.encode(os);
561 }
562
563 return codeLength;
564 }
565
566 public int decode(InputStream is) throws IOException {
567 return decode(is, true);
568 }
569
570 public int decode(InputStream is, boolean withTag) throws IOException {
571 int codeLength = 0;
572 int subCodeLength = 0;
573 if (withTag) {
574 codeLength += tag.decodeAndCheck(is);
575 }
576
577 BerLength length = new BerLength();
578 codeLength += length.decode(is);
579 int totalLength = length.val;
580
581 while (subCodeLength < totalLength) {
582 CRNTI element = new CRNTI();
583 subCodeLength += element.decode(is, true);
584 seqOf.add(element);
585 }
586 if (subCodeLength != totalLength) {
587 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
588
589 }
590 codeLength += subCodeLength;
591
592 return codeLength;
593 }
594
595 public void encodeAndSave(int encodingSizeGuess) throws IOException {
596 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
597 encode(os, false);
598 code = os.getArray();
599 }
600
601 public String toString() {
602 StringBuilder sb = new StringBuilder();
603 appendAsString(sb, 0);
604 return sb.toString();
605 }
606
607 public void appendAsString(StringBuilder sb, int indentLevel) {
608
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800609 sb.append("{\n");
slowr67d05e42017-08-11 20:37:22 -0700610 for (int i = 0; i < indentLevel + 1; i++) {
611 sb.append("\t");
612 }
613 if (seqOf == null) {
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800614 sb.append("null");
slowr67d05e42017-08-11 20:37:22 -0700615 } else {
616 Iterator<CRNTI> it = seqOf.iterator();
617 if (it.hasNext()) {
618 sb.append(it.next());
619 while (it.hasNext()) {
620 sb.append(",\n");
621 for (int i = 0; i < indentLevel + 1; i++) {
622 sb.append("\t");
623 }
624 sb.append(it.next());
625 }
626 }
627 }
slowr13fa5b02017-08-08 16:32:31 -0700628
slowr67d05e42017-08-11 20:37:22 -0700629 sb.append("\n");
630 for (int i = 0; i < indentLevel; i++) {
631 sb.append("\t");
632 }
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800633 sb.append("}");
slowr67d05e42017-08-11 20:37:22 -0700634 }
slowr13fa5b02017-08-08 16:32:31 -0700635
slowr67d05e42017-08-11 20:37:22 -0700636 }
slowr13fa5b02017-08-08 16:32:31 -0700637
slowr67d05e42017-08-11 20:37:22 -0700638 public static class Pa implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -0700639
slowr67d05e42017-08-11 20:37:22 -0700640 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
641 private static final long serialVersionUID = 1L;
slowr73b4eae2017-08-17 16:09:09 -0700642 @JsonIgnore
643 public byte[] code = null;
slowr67d05e42017-08-11 20:37:22 -0700644 private List<XICICPA> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -0700645
slowr67d05e42017-08-11 20:37:22 -0700646 public Pa() {
647 seqOf = new ArrayList<XICICPA>();
648 }
slowr13fa5b02017-08-08 16:32:31 -0700649
slowr67d05e42017-08-11 20:37:22 -0700650 public Pa(byte[] code) {
651 this.code = code;
652 }
slowr13fa5b02017-08-08 16:32:31 -0700653
slowr60d4d102017-08-16 18:33:58 -0700654 @JsonValue
slowr67d05e42017-08-11 20:37:22 -0700655 public List<XICICPA> getXICICPA() {
656 if (seqOf == null) {
657 seqOf = new ArrayList<XICICPA>();
658 }
659 return seqOf;
660 }
slowr13fa5b02017-08-08 16:32:31 -0700661
slowr67d05e42017-08-11 20:37:22 -0700662 public int encode(BerByteArrayOutputStream os) throws IOException {
663 return encode(os, true);
664 }
slowr13fa5b02017-08-08 16:32:31 -0700665
slowr67d05e42017-08-11 20:37:22 -0700666 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -0700667
slowr67d05e42017-08-11 20:37:22 -0700668 if (code != null) {
669 for (int i = code.length - 1; i >= 0; i--) {
670 os.write(code[i]);
671 }
672 if (withTag) {
673 return tag.encode(os) + code.length;
674 }
675 return code.length;
676 }
slowr13fa5b02017-08-08 16:32:31 -0700677
slowr67d05e42017-08-11 20:37:22 -0700678 int codeLength = 0;
679 for (int i = (seqOf.size() - 1); i >= 0; i--) {
680 codeLength += seqOf.get(i).encode(os, true);
681 }
slowr13fa5b02017-08-08 16:32:31 -0700682
slowr67d05e42017-08-11 20:37:22 -0700683 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -0700684
slowr67d05e42017-08-11 20:37:22 -0700685 if (withTag) {
686 codeLength += tag.encode(os);
687 }
slowr13fa5b02017-08-08 16:32:31 -0700688
slowr67d05e42017-08-11 20:37:22 -0700689 return codeLength;
690 }
slowr13fa5b02017-08-08 16:32:31 -0700691
slowr67d05e42017-08-11 20:37:22 -0700692 public int decode(InputStream is) throws IOException {
693 return decode(is, true);
694 }
slowr13fa5b02017-08-08 16:32:31 -0700695
slowr67d05e42017-08-11 20:37:22 -0700696 public int decode(InputStream is, boolean withTag) throws IOException {
697 int codeLength = 0;
698 int subCodeLength = 0;
699 if (withTag) {
700 codeLength += tag.decodeAndCheck(is);
701 }
slowr13fa5b02017-08-08 16:32:31 -0700702
slowr67d05e42017-08-11 20:37:22 -0700703 BerLength length = new BerLength();
704 codeLength += length.decode(is);
705 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -0700706
slowr67d05e42017-08-11 20:37:22 -0700707 while (subCodeLength < totalLength) {
708 XICICPA element = new XICICPA();
709 subCodeLength += element.decode(is, true);
710 seqOf.add(element);
711 }
712 if (subCodeLength != totalLength) {
713 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -0700714
slowr67d05e42017-08-11 20:37:22 -0700715 }
716 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -0700717
slowr67d05e42017-08-11 20:37:22 -0700718 return codeLength;
719 }
slowr13fa5b02017-08-08 16:32:31 -0700720
slowr67d05e42017-08-11 20:37:22 -0700721 public void encodeAndSave(int encodingSizeGuess) throws IOException {
722 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
723 encode(os, false);
724 code = os.getArray();
725 }
slowr13fa5b02017-08-08 16:32:31 -0700726
slowr67d05e42017-08-11 20:37:22 -0700727 public String toString() {
728 StringBuilder sb = new StringBuilder();
729 appendAsString(sb, 0);
730 return sb.toString();
731 }
slowr13fa5b02017-08-08 16:32:31 -0700732
slowr67d05e42017-08-11 20:37:22 -0700733 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -0700734
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800735 sb.append("{\n");
slowr67d05e42017-08-11 20:37:22 -0700736 for (int i = 0; i < indentLevel + 1; i++) {
737 sb.append("\t");
738 }
739 if (seqOf == null) {
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800740 sb.append("null");
slowr67d05e42017-08-11 20:37:22 -0700741 } else {
742 Iterator<XICICPA> it = seqOf.iterator();
743 if (it.hasNext()) {
744 sb.append(it.next());
745 while (it.hasNext()) {
746 sb.append(",\n");
747 for (int i = 0; i < indentLevel + 1; i++) {
748 sb.append("\t");
749 }
750 sb.append(it.next());
751 }
752 }
753 }
slowr13fa5b02017-08-08 16:32:31 -0700754
slowr67d05e42017-08-11 20:37:22 -0700755 sb.append("\n");
756 for (int i = 0; i < indentLevel; i++) {
757 sb.append("\t");
758 }
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800759 sb.append("}");
slowr67d05e42017-08-11 20:37:22 -0700760 }
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800761
slowr67d05e42017-08-11 20:37:22 -0700762 }
slowr13fa5b02017-08-08 16:32:31 -0700763
slowr67d05e42017-08-11 20:37:22 -0700764 public static class StartPrbDl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -0700765
slowr67d05e42017-08-11 20:37:22 -0700766 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
767 private static final long serialVersionUID = 1L;
slowr73b4eae2017-08-17 16:09:09 -0700768 @JsonIgnore
769 public byte[] code = null;
slowr67d05e42017-08-11 20:37:22 -0700770 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -0700771
slowr67d05e42017-08-11 20:37:22 -0700772 public StartPrbDl() {
773 seqOf = new ArrayList<BerInteger>();
774 }
slowr13fa5b02017-08-08 16:32:31 -0700775
slowr67d05e42017-08-11 20:37:22 -0700776 public StartPrbDl(byte[] code) {
777 this.code = code;
778 }
slowr13fa5b02017-08-08 16:32:31 -0700779
slowr73b4eae2017-08-17 16:09:09 -0700780 @JsonValue
781 public List<BerInteger> getBerInteger() {
slowr67d05e42017-08-11 20:37:22 -0700782 if (seqOf == null) {
783 seqOf = new ArrayList<BerInteger>();
784 }
785 return seqOf;
786 }
slowr13fa5b02017-08-08 16:32:31 -0700787
slowr67d05e42017-08-11 20:37:22 -0700788 public int encode(BerByteArrayOutputStream os) throws IOException {
789 return encode(os, true);
790 }
slowr13fa5b02017-08-08 16:32:31 -0700791
slowr67d05e42017-08-11 20:37:22 -0700792 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -0700793
slowr67d05e42017-08-11 20:37:22 -0700794 if (code != null) {
795 for (int i = code.length - 1; i >= 0; i--) {
796 os.write(code[i]);
797 }
798 if (withTag) {
799 return tag.encode(os) + code.length;
800 }
801 return code.length;
802 }
slowr13fa5b02017-08-08 16:32:31 -0700803
slowr67d05e42017-08-11 20:37:22 -0700804 int codeLength = 0;
805 for (int i = (seqOf.size() - 1); i >= 0; i--) {
806 codeLength += seqOf.get(i).encode(os, true);
807 }
slowr13fa5b02017-08-08 16:32:31 -0700808
slowr67d05e42017-08-11 20:37:22 -0700809 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -0700810
slowr67d05e42017-08-11 20:37:22 -0700811 if (withTag) {
812 codeLength += tag.encode(os);
813 }
slowr13fa5b02017-08-08 16:32:31 -0700814
slowr67d05e42017-08-11 20:37:22 -0700815 return codeLength;
816 }
slowr13fa5b02017-08-08 16:32:31 -0700817
slowr67d05e42017-08-11 20:37:22 -0700818 public int decode(InputStream is) throws IOException {
819 return decode(is, true);
820 }
slowr13fa5b02017-08-08 16:32:31 -0700821
slowr67d05e42017-08-11 20:37:22 -0700822 public int decode(InputStream is, boolean withTag) throws IOException {
823 int codeLength = 0;
824 int subCodeLength = 0;
825 if (withTag) {
826 codeLength += tag.decodeAndCheck(is);
827 }
slowr13fa5b02017-08-08 16:32:31 -0700828
slowr67d05e42017-08-11 20:37:22 -0700829 BerLength length = new BerLength();
830 codeLength += length.decode(is);
831 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -0700832
slowr67d05e42017-08-11 20:37:22 -0700833 while (subCodeLength < totalLength) {
834 BerInteger element = new BerInteger();
835 subCodeLength += element.decode(is, true);
836 seqOf.add(element);
837 }
838 if (subCodeLength != totalLength) {
839 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -0700840
slowr67d05e42017-08-11 20:37:22 -0700841 }
842 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -0700843
slowr67d05e42017-08-11 20:37:22 -0700844 return codeLength;
845 }
slowr13fa5b02017-08-08 16:32:31 -0700846
slowr67d05e42017-08-11 20:37:22 -0700847 public void encodeAndSave(int encodingSizeGuess) throws IOException {
848 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
849 encode(os, false);
850 code = os.getArray();
851 }
slowr13fa5b02017-08-08 16:32:31 -0700852
slowr67d05e42017-08-11 20:37:22 -0700853 public String toString() {
854 StringBuilder sb = new StringBuilder();
855 appendAsString(sb, 0);
856 return sb.toString();
857 }
slowr13fa5b02017-08-08 16:32:31 -0700858
slowr67d05e42017-08-11 20:37:22 -0700859 public void appendAsString(StringBuilder sb, int indentLevel) {
860
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800861 sb.append("{\n");
slowr67d05e42017-08-11 20:37:22 -0700862 for (int i = 0; i < indentLevel + 1; i++) {
863 sb.append("\t");
864 }
865 if (seqOf == null) {
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800866 sb.append("null");
slowr67d05e42017-08-11 20:37:22 -0700867 } else {
868 Iterator<BerInteger> it = seqOf.iterator();
869 if (it.hasNext()) {
870 sb.append(it.next());
871 while (it.hasNext()) {
872 sb.append(",\n");
873 for (int i = 0; i < indentLevel + 1; i++) {
874 sb.append("\t");
875 }
876 sb.append(it.next());
877 }
878 }
879 }
slowr13fa5b02017-08-08 16:32:31 -0700880
slowr67d05e42017-08-11 20:37:22 -0700881 sb.append("\n");
882 for (int i = 0; i < indentLevel; i++) {
883 sb.append("\t");
884 }
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800885 sb.append("}");
slowr67d05e42017-08-11 20:37:22 -0700886 }
slowr13fa5b02017-08-08 16:32:31 -0700887
slowr67d05e42017-08-11 20:37:22 -0700888 }
slowr13fa5b02017-08-08 16:32:31 -0700889
slowr67d05e42017-08-11 20:37:22 -0700890 public static class EndPrbDl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -0700891
slowr67d05e42017-08-11 20:37:22 -0700892 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
893 private static final long serialVersionUID = 1L;
slowr73b4eae2017-08-17 16:09:09 -0700894 @JsonIgnore
895 public byte[] code = null;
slowr67d05e42017-08-11 20:37:22 -0700896 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -0700897
slowr67d05e42017-08-11 20:37:22 -0700898 public EndPrbDl() {
899 seqOf = new ArrayList<BerInteger>();
900 }
slowr13fa5b02017-08-08 16:32:31 -0700901
slowr67d05e42017-08-11 20:37:22 -0700902 public EndPrbDl(byte[] code) {
903 this.code = code;
904 }
slowr13fa5b02017-08-08 16:32:31 -0700905
slowr73b4eae2017-08-17 16:09:09 -0700906 @JsonValue
907 public List<BerInteger> getBerInteger() {
slowr67d05e42017-08-11 20:37:22 -0700908 if (seqOf == null) {
909 seqOf = new ArrayList<BerInteger>();
910 }
911 return seqOf;
912 }
slowr13fa5b02017-08-08 16:32:31 -0700913
slowr67d05e42017-08-11 20:37:22 -0700914 public int encode(BerByteArrayOutputStream os) throws IOException {
915 return encode(os, true);
916 }
slowr13fa5b02017-08-08 16:32:31 -0700917
slowr67d05e42017-08-11 20:37:22 -0700918 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -0700919
slowr67d05e42017-08-11 20:37:22 -0700920 if (code != null) {
921 for (int i = code.length - 1; i >= 0; i--) {
922 os.write(code[i]);
923 }
924 if (withTag) {
925 return tag.encode(os) + code.length;
926 }
927 return code.length;
928 }
slowr13fa5b02017-08-08 16:32:31 -0700929
slowr67d05e42017-08-11 20:37:22 -0700930 int codeLength = 0;
931 for (int i = (seqOf.size() - 1); i >= 0; i--) {
932 codeLength += seqOf.get(i).encode(os, true);
933 }
slowr13fa5b02017-08-08 16:32:31 -0700934
slowr67d05e42017-08-11 20:37:22 -0700935 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -0700936
slowr67d05e42017-08-11 20:37:22 -0700937 if (withTag) {
938 codeLength += tag.encode(os);
939 }
slowr13fa5b02017-08-08 16:32:31 -0700940
slowr67d05e42017-08-11 20:37:22 -0700941 return codeLength;
942 }
slowr13fa5b02017-08-08 16:32:31 -0700943
slowr67d05e42017-08-11 20:37:22 -0700944 public int decode(InputStream is) throws IOException {
945 return decode(is, true);
946 }
slowr13fa5b02017-08-08 16:32:31 -0700947
slowr67d05e42017-08-11 20:37:22 -0700948 public int decode(InputStream is, boolean withTag) throws IOException {
949 int codeLength = 0;
950 int subCodeLength = 0;
951 if (withTag) {
952 codeLength += tag.decodeAndCheck(is);
953 }
slowr13fa5b02017-08-08 16:32:31 -0700954
slowr67d05e42017-08-11 20:37:22 -0700955 BerLength length = new BerLength();
956 codeLength += length.decode(is);
957 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -0700958
slowr67d05e42017-08-11 20:37:22 -0700959 while (subCodeLength < totalLength) {
960 BerInteger element = new BerInteger();
961 subCodeLength += element.decode(is, true);
962 seqOf.add(element);
963 }
964 if (subCodeLength != totalLength) {
965 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -0700966
slowr67d05e42017-08-11 20:37:22 -0700967 }
968 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -0700969
slowr67d05e42017-08-11 20:37:22 -0700970 return codeLength;
971 }
slowr13fa5b02017-08-08 16:32:31 -0700972
slowr67d05e42017-08-11 20:37:22 -0700973 public void encodeAndSave(int encodingSizeGuess) throws IOException {
974 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
975 encode(os, false);
976 code = os.getArray();
977 }
slowr13fa5b02017-08-08 16:32:31 -0700978
slowr67d05e42017-08-11 20:37:22 -0700979 public String toString() {
980 StringBuilder sb = new StringBuilder();
981 appendAsString(sb, 0);
982 return sb.toString();
983 }
slowr13fa5b02017-08-08 16:32:31 -0700984
slowr67d05e42017-08-11 20:37:22 -0700985 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -0700986
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800987 sb.append("{\n");
slowr67d05e42017-08-11 20:37:22 -0700988 for (int i = 0; i < indentLevel + 1; i++) {
989 sb.append("\t");
990 }
991 if (seqOf == null) {
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -0800992 sb.append("null");
slowr67d05e42017-08-11 20:37:22 -0700993 } else {
994 Iterator<BerInteger> it = seqOf.iterator();
995 if (it.hasNext()) {
996 sb.append(it.next());
997 while (it.hasNext()) {
998 sb.append(",\n");
999 for (int i = 0; i < indentLevel + 1; i++) {
1000 sb.append("\t");
1001 }
1002 sb.append(it.next());
1003 }
1004 }
1005 }
slowr13fa5b02017-08-08 16:32:31 -07001006
slowr67d05e42017-08-11 20:37:22 -07001007 sb.append("\n");
1008 for (int i = 0; i < indentLevel; i++) {
1009 sb.append("\t");
1010 }
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001011 sb.append("}");
slowr67d05e42017-08-11 20:37:22 -07001012 }
slowr13fa5b02017-08-08 16:32:31 -07001013
slowr67d05e42017-08-11 20:37:22 -07001014 }
slowr13fa5b02017-08-08 16:32:31 -07001015
slowr67d05e42017-08-11 20:37:22 -07001016 public static class SubframeBitmaskDl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -07001017
slowr67d05e42017-08-11 20:37:22 -07001018 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
1019 private static final long serialVersionUID = 1L;
slowr73b4eae2017-08-17 16:09:09 -07001020 @JsonIgnore
1021 public byte[] code = null;
slowr67d05e42017-08-11 20:37:22 -07001022 private List<BerBitString> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -07001023
slowr67d05e42017-08-11 20:37:22 -07001024 public SubframeBitmaskDl() {
1025 seqOf = new ArrayList<BerBitString>();
1026 }
slowr13fa5b02017-08-08 16:32:31 -07001027
slowr67d05e42017-08-11 20:37:22 -07001028 public SubframeBitmaskDl(byte[] code) {
1029 this.code = code;
1030 }
slowr13fa5b02017-08-08 16:32:31 -07001031
slowr60d4d102017-08-16 18:33:58 -07001032 @JsonValue
slowr67d05e42017-08-11 20:37:22 -07001033 public List<BerBitString> getBerBitString() {
1034 if (seqOf == null) {
1035 seqOf = new ArrayList<BerBitString>();
1036 }
1037 return seqOf;
1038 }
slowr13fa5b02017-08-08 16:32:31 -07001039
slowr67d05e42017-08-11 20:37:22 -07001040 public int encode(BerByteArrayOutputStream os) throws IOException {
1041 return encode(os, true);
1042 }
slowr13fa5b02017-08-08 16:32:31 -07001043
slowr67d05e42017-08-11 20:37:22 -07001044 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001045
slowr67d05e42017-08-11 20:37:22 -07001046 if (code != null) {
1047 for (int i = code.length - 1; i >= 0; i--) {
1048 os.write(code[i]);
1049 }
1050 if (withTag) {
1051 return tag.encode(os) + code.length;
1052 }
1053 return code.length;
1054 }
slowr13fa5b02017-08-08 16:32:31 -07001055
slowr67d05e42017-08-11 20:37:22 -07001056 int codeLength = 0;
1057 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1058 codeLength += seqOf.get(i).encode(os, true);
1059 }
slowr13fa5b02017-08-08 16:32:31 -07001060
slowr67d05e42017-08-11 20:37:22 -07001061 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001062
slowr67d05e42017-08-11 20:37:22 -07001063 if (withTag) {
1064 codeLength += tag.encode(os);
1065 }
slowr13fa5b02017-08-08 16:32:31 -07001066
slowr67d05e42017-08-11 20:37:22 -07001067 return codeLength;
1068 }
slowr13fa5b02017-08-08 16:32:31 -07001069
slowr67d05e42017-08-11 20:37:22 -07001070 public int decode(InputStream is) throws IOException {
1071 return decode(is, true);
1072 }
slowr13fa5b02017-08-08 16:32:31 -07001073
slowr67d05e42017-08-11 20:37:22 -07001074 public int decode(InputStream is, boolean withTag) throws IOException {
1075 int codeLength = 0;
1076 int subCodeLength = 0;
1077 if (withTag) {
1078 codeLength += tag.decodeAndCheck(is);
1079 }
slowr13fa5b02017-08-08 16:32:31 -07001080
slowr67d05e42017-08-11 20:37:22 -07001081 BerLength length = new BerLength();
1082 codeLength += length.decode(is);
1083 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001084
slowr67d05e42017-08-11 20:37:22 -07001085 while (subCodeLength < totalLength) {
1086 BerBitString element = new BerBitString();
1087 subCodeLength += element.decode(is, true);
1088 seqOf.add(element);
1089 }
1090 if (subCodeLength != totalLength) {
1091 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001092
slowr67d05e42017-08-11 20:37:22 -07001093 }
1094 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001095
slowr67d05e42017-08-11 20:37:22 -07001096 return codeLength;
1097 }
slowr13fa5b02017-08-08 16:32:31 -07001098
slowr67d05e42017-08-11 20:37:22 -07001099 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1100 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1101 encode(os, false);
1102 code = os.getArray();
1103 }
slowr13fa5b02017-08-08 16:32:31 -07001104
slowr67d05e42017-08-11 20:37:22 -07001105 public String toString() {
1106 StringBuilder sb = new StringBuilder();
1107 appendAsString(sb, 0);
1108 return sb.toString();
1109 }
1110
1111 public void appendAsString(StringBuilder sb, int indentLevel) {
1112
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001113 sb.append("{\n");
slowr67d05e42017-08-11 20:37:22 -07001114 for (int i = 0; i < indentLevel + 1; i++) {
1115 sb.append("\t");
1116 }
1117 if (seqOf == null) {
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001118 sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001119 } else {
1120 Iterator<BerBitString> it = seqOf.iterator();
1121 if (it.hasNext()) {
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001122 sb.append(it.next());
slowr67d05e42017-08-11 20:37:22 -07001123 while (it.hasNext()) {
1124 sb.append(",\n");
1125 for (int i = 0; i < indentLevel + 1; i++) {
1126 sb.append("\t");
1127 }
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001128 sb.append(it.next());
slowr67d05e42017-08-11 20:37:22 -07001129 }
1130 }
1131 }
slowr13fa5b02017-08-08 16:32:31 -07001132
slowr67d05e42017-08-11 20:37:22 -07001133 sb.append("\n");
1134 for (int i = 0; i < indentLevel; i++) {
1135 sb.append("\t");
1136 }
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001137 sb.append("}");
slowr67d05e42017-08-11 20:37:22 -07001138 }
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001139
slowr67d05e42017-08-11 20:37:22 -07001140 }
slowr13fa5b02017-08-08 16:32:31 -07001141
slowr67d05e42017-08-11 20:37:22 -07001142 public static class P0UePusch implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -07001143
slowr67d05e42017-08-11 20:37:22 -07001144 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
1145 private static final long serialVersionUID = 1L;
slowr73b4eae2017-08-17 16:09:09 -07001146 @JsonIgnore
1147 public byte[] code = null;
slowr67d05e42017-08-11 20:37:22 -07001148 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -07001149
slowr67d05e42017-08-11 20:37:22 -07001150 public P0UePusch() {
1151 seqOf = new ArrayList<BerInteger>();
1152 }
slowr13fa5b02017-08-08 16:32:31 -07001153
slowr67d05e42017-08-11 20:37:22 -07001154 public P0UePusch(byte[] code) {
1155 this.code = code;
1156 }
slowr13fa5b02017-08-08 16:32:31 -07001157
slowr73b4eae2017-08-17 16:09:09 -07001158 @JsonValue
1159 public List<BerInteger> getBerInteger() {
slowr67d05e42017-08-11 20:37:22 -07001160 if (seqOf == null) {
1161 seqOf = new ArrayList<BerInteger>();
1162 }
1163 return seqOf;
1164 }
slowr13fa5b02017-08-08 16:32:31 -07001165
slowr67d05e42017-08-11 20:37:22 -07001166 public int encode(BerByteArrayOutputStream os) throws IOException {
1167 return encode(os, true);
1168 }
slowr13fa5b02017-08-08 16:32:31 -07001169
slowr67d05e42017-08-11 20:37:22 -07001170 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001171
slowr67d05e42017-08-11 20:37:22 -07001172 if (code != null) {
1173 for (int i = code.length - 1; i >= 0; i--) {
1174 os.write(code[i]);
1175 }
1176 if (withTag) {
1177 return tag.encode(os) + code.length;
1178 }
1179 return code.length;
1180 }
slowr13fa5b02017-08-08 16:32:31 -07001181
slowr67d05e42017-08-11 20:37:22 -07001182 int codeLength = 0;
1183 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1184 codeLength += seqOf.get(i).encode(os, true);
1185 }
slowr13fa5b02017-08-08 16:32:31 -07001186
slowr67d05e42017-08-11 20:37:22 -07001187 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001188
slowr67d05e42017-08-11 20:37:22 -07001189 if (withTag) {
1190 codeLength += tag.encode(os);
1191 }
slowr13fa5b02017-08-08 16:32:31 -07001192
slowr67d05e42017-08-11 20:37:22 -07001193 return codeLength;
1194 }
slowr13fa5b02017-08-08 16:32:31 -07001195
slowr67d05e42017-08-11 20:37:22 -07001196 public int decode(InputStream is) throws IOException {
1197 return decode(is, true);
1198 }
slowr13fa5b02017-08-08 16:32:31 -07001199
slowr67d05e42017-08-11 20:37:22 -07001200 public int decode(InputStream is, boolean withTag) throws IOException {
1201 int codeLength = 0;
1202 int subCodeLength = 0;
1203 if (withTag) {
1204 codeLength += tag.decodeAndCheck(is);
1205 }
slowr13fa5b02017-08-08 16:32:31 -07001206
slowr67d05e42017-08-11 20:37:22 -07001207 BerLength length = new BerLength();
1208 codeLength += length.decode(is);
1209 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001210
slowr67d05e42017-08-11 20:37:22 -07001211 while (subCodeLength < totalLength) {
1212 BerInteger element = new BerInteger();
1213 subCodeLength += element.decode(is, true);
1214 seqOf.add(element);
1215 }
1216 if (subCodeLength != totalLength) {
1217 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001218
slowr67d05e42017-08-11 20:37:22 -07001219 }
1220 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001221
slowr67d05e42017-08-11 20:37:22 -07001222 return codeLength;
1223 }
slowr13fa5b02017-08-08 16:32:31 -07001224
slowr67d05e42017-08-11 20:37:22 -07001225 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1226 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1227 encode(os, false);
1228 code = os.getArray();
1229 }
slowr13fa5b02017-08-08 16:32:31 -07001230
slowr67d05e42017-08-11 20:37:22 -07001231 public String toString() {
1232 StringBuilder sb = new StringBuilder();
1233 appendAsString(sb, 0);
1234 return sb.toString();
1235 }
slowr13fa5b02017-08-08 16:32:31 -07001236
slowr67d05e42017-08-11 20:37:22 -07001237 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -07001238
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001239 sb.append("{\n");
slowr67d05e42017-08-11 20:37:22 -07001240 for (int i = 0; i < indentLevel + 1; i++) {
1241 sb.append("\t");
1242 }
1243 if (seqOf == null) {
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001244 sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001245 } else {
1246 Iterator<BerInteger> it = seqOf.iterator();
1247 if (it.hasNext()) {
1248 sb.append(it.next());
1249 while (it.hasNext()) {
1250 sb.append(",\n");
1251 for (int i = 0; i < indentLevel + 1; i++) {
1252 sb.append("\t");
1253 }
1254 sb.append(it.next());
1255 }
1256 }
1257 }
slowr13fa5b02017-08-08 16:32:31 -07001258
slowr67d05e42017-08-11 20:37:22 -07001259 sb.append("\n");
1260 for (int i = 0; i < indentLevel; i++) {
1261 sb.append("\t");
1262 }
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001263 sb.append("}");
slowr67d05e42017-08-11 20:37:22 -07001264 }
slowr13fa5b02017-08-08 16:32:31 -07001265
slowr67d05e42017-08-11 20:37:22 -07001266 }
slowr13fa5b02017-08-08 16:32:31 -07001267
slowr67d05e42017-08-11 20:37:22 -07001268 public static class StartPrbUl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -07001269
slowr67d05e42017-08-11 20:37:22 -07001270 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
1271 private static final long serialVersionUID = 1L;
slowr73b4eae2017-08-17 16:09:09 -07001272 @JsonIgnore
1273 public byte[] code = null;
slowr67d05e42017-08-11 20:37:22 -07001274 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -07001275
slowr67d05e42017-08-11 20:37:22 -07001276 public StartPrbUl() {
1277 seqOf = new ArrayList<BerInteger>();
1278 }
slowr13fa5b02017-08-08 16:32:31 -07001279
slowr67d05e42017-08-11 20:37:22 -07001280 public StartPrbUl(byte[] code) {
1281 this.code = code;
1282 }
slowr13fa5b02017-08-08 16:32:31 -07001283
slowr73b4eae2017-08-17 16:09:09 -07001284 @JsonValue
1285 public List<BerInteger> getBerInteger() {
slowr67d05e42017-08-11 20:37:22 -07001286 if (seqOf == null) {
1287 seqOf = new ArrayList<BerInteger>();
1288 }
1289 return seqOf;
1290 }
slowr13fa5b02017-08-08 16:32:31 -07001291
slowr67d05e42017-08-11 20:37:22 -07001292 public int encode(BerByteArrayOutputStream os) throws IOException {
1293 return encode(os, true);
1294 }
slowr13fa5b02017-08-08 16:32:31 -07001295
slowr67d05e42017-08-11 20:37:22 -07001296 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001297
slowr67d05e42017-08-11 20:37:22 -07001298 if (code != null) {
1299 for (int i = code.length - 1; i >= 0; i--) {
1300 os.write(code[i]);
1301 }
1302 if (withTag) {
1303 return tag.encode(os) + code.length;
1304 }
1305 return code.length;
1306 }
slowr13fa5b02017-08-08 16:32:31 -07001307
slowr67d05e42017-08-11 20:37:22 -07001308 int codeLength = 0;
1309 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1310 codeLength += seqOf.get(i).encode(os, true);
1311 }
slowr13fa5b02017-08-08 16:32:31 -07001312
slowr67d05e42017-08-11 20:37:22 -07001313 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001314
slowr67d05e42017-08-11 20:37:22 -07001315 if (withTag) {
1316 codeLength += tag.encode(os);
1317 }
slowr13fa5b02017-08-08 16:32:31 -07001318
slowr67d05e42017-08-11 20:37:22 -07001319 return codeLength;
1320 }
slowr13fa5b02017-08-08 16:32:31 -07001321
slowr67d05e42017-08-11 20:37:22 -07001322 public int decode(InputStream is) throws IOException {
1323 return decode(is, true);
1324 }
slowr13fa5b02017-08-08 16:32:31 -07001325
slowr67d05e42017-08-11 20:37:22 -07001326 public int decode(InputStream is, boolean withTag) throws IOException {
1327 int codeLength = 0;
1328 int subCodeLength = 0;
1329 if (withTag) {
1330 codeLength += tag.decodeAndCheck(is);
1331 }
slowr13fa5b02017-08-08 16:32:31 -07001332
slowr67d05e42017-08-11 20:37:22 -07001333 BerLength length = new BerLength();
1334 codeLength += length.decode(is);
1335 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001336
slowr67d05e42017-08-11 20:37:22 -07001337 while (subCodeLength < totalLength) {
1338 BerInteger element = new BerInteger();
1339 subCodeLength += element.decode(is, true);
1340 seqOf.add(element);
1341 }
1342 if (subCodeLength != totalLength) {
1343 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001344
slowr67d05e42017-08-11 20:37:22 -07001345 }
1346 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001347
slowr67d05e42017-08-11 20:37:22 -07001348 return codeLength;
1349 }
slowr13fa5b02017-08-08 16:32:31 -07001350
slowr67d05e42017-08-11 20:37:22 -07001351 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1352 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1353 encode(os, false);
1354 code = os.getArray();
1355 }
slowr13fa5b02017-08-08 16:32:31 -07001356
slowr67d05e42017-08-11 20:37:22 -07001357 public String toString() {
1358 StringBuilder sb = new StringBuilder();
1359 appendAsString(sb, 0);
1360 return sb.toString();
1361 }
slowr13fa5b02017-08-08 16:32:31 -07001362
slowr67d05e42017-08-11 20:37:22 -07001363 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -07001364
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001365 sb.append("{\n");
slowr67d05e42017-08-11 20:37:22 -07001366 for (int i = 0; i < indentLevel + 1; i++) {
1367 sb.append("\t");
1368 }
1369 if (seqOf == null) {
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001370 sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001371 } else {
1372 Iterator<BerInteger> it = seqOf.iterator();
1373 if (it.hasNext()) {
1374 sb.append(it.next());
1375 while (it.hasNext()) {
1376 sb.append(",\n");
1377 for (int i = 0; i < indentLevel + 1; i++) {
1378 sb.append("\t");
1379 }
1380 sb.append(it.next());
1381 }
1382 }
1383 }
slowr13fa5b02017-08-08 16:32:31 -07001384
slowr67d05e42017-08-11 20:37:22 -07001385 sb.append("\n");
1386 for (int i = 0; i < indentLevel; i++) {
1387 sb.append("\t");
1388 }
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001389 sb.append("}");
slowr67d05e42017-08-11 20:37:22 -07001390 }
slowr13fa5b02017-08-08 16:32:31 -07001391
slowr67d05e42017-08-11 20:37:22 -07001392 }
slowr13fa5b02017-08-08 16:32:31 -07001393
slowr67d05e42017-08-11 20:37:22 -07001394 public static class EndPrbUl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -07001395
slowr67d05e42017-08-11 20:37:22 -07001396 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
1397 private static final long serialVersionUID = 1L;
slowr73b4eae2017-08-17 16:09:09 -07001398 @JsonIgnore
1399 public byte[] code = null;
slowr67d05e42017-08-11 20:37:22 -07001400 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -07001401
slowr67d05e42017-08-11 20:37:22 -07001402 public EndPrbUl() {
1403 seqOf = new ArrayList<BerInteger>();
1404 }
slowr13fa5b02017-08-08 16:32:31 -07001405
slowr67d05e42017-08-11 20:37:22 -07001406 public EndPrbUl(byte[] code) {
1407 this.code = code;
1408 }
slowr13fa5b02017-08-08 16:32:31 -07001409
slowr60d4d102017-08-16 18:33:58 -07001410 @JsonValue
slowr67d05e42017-08-11 20:37:22 -07001411 public List<BerInteger> getBerInteger() {
1412 if (seqOf == null) {
1413 seqOf = new ArrayList<BerInteger>();
1414 }
1415 return seqOf;
1416 }
slowr13fa5b02017-08-08 16:32:31 -07001417
slowr67d05e42017-08-11 20:37:22 -07001418 public int encode(BerByteArrayOutputStream os) throws IOException {
1419 return encode(os, true);
1420 }
slowr13fa5b02017-08-08 16:32:31 -07001421
slowr67d05e42017-08-11 20:37:22 -07001422 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001423
slowr67d05e42017-08-11 20:37:22 -07001424 if (code != null) {
1425 for (int i = code.length - 1; i >= 0; i--) {
1426 os.write(code[i]);
1427 }
1428 if (withTag) {
1429 return tag.encode(os) + code.length;
1430 }
1431 return code.length;
1432 }
slowr13fa5b02017-08-08 16:32:31 -07001433
slowr67d05e42017-08-11 20:37:22 -07001434 int codeLength = 0;
1435 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1436 codeLength += seqOf.get(i).encode(os, true);
1437 }
slowr13fa5b02017-08-08 16:32:31 -07001438
slowr67d05e42017-08-11 20:37:22 -07001439 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001440
slowr67d05e42017-08-11 20:37:22 -07001441 if (withTag) {
1442 codeLength += tag.encode(os);
1443 }
slowr13fa5b02017-08-08 16:32:31 -07001444
slowr67d05e42017-08-11 20:37:22 -07001445 return codeLength;
1446 }
slowr13fa5b02017-08-08 16:32:31 -07001447
slowr67d05e42017-08-11 20:37:22 -07001448 public int decode(InputStream is) throws IOException {
1449 return decode(is, true);
1450 }
slowr13fa5b02017-08-08 16:32:31 -07001451
slowr67d05e42017-08-11 20:37:22 -07001452 public int decode(InputStream is, boolean withTag) throws IOException {
1453 int codeLength = 0;
1454 int subCodeLength = 0;
1455 if (withTag) {
1456 codeLength += tag.decodeAndCheck(is);
1457 }
slowr13fa5b02017-08-08 16:32:31 -07001458
slowr67d05e42017-08-11 20:37:22 -07001459 BerLength length = new BerLength();
1460 codeLength += length.decode(is);
1461 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001462
slowr67d05e42017-08-11 20:37:22 -07001463 while (subCodeLength < totalLength) {
1464 BerInteger element = new BerInteger();
1465 subCodeLength += element.decode(is, true);
1466 seqOf.add(element);
1467 }
1468 if (subCodeLength != totalLength) {
1469 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001470
slowr67d05e42017-08-11 20:37:22 -07001471 }
1472 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001473
slowr67d05e42017-08-11 20:37:22 -07001474 return codeLength;
1475 }
slowr13fa5b02017-08-08 16:32:31 -07001476
slowr67d05e42017-08-11 20:37:22 -07001477 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1478 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1479 encode(os, false);
1480 code = os.getArray();
1481 }
slowr13fa5b02017-08-08 16:32:31 -07001482
slowr67d05e42017-08-11 20:37:22 -07001483 public String toString() {
1484 StringBuilder sb = new StringBuilder();
1485 appendAsString(sb, 0);
1486 return sb.toString();
1487 }
slowr13fa5b02017-08-08 16:32:31 -07001488
slowr67d05e42017-08-11 20:37:22 -07001489 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -07001490
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001491 sb.append("{\n");
slowr67d05e42017-08-11 20:37:22 -07001492 for (int i = 0; i < indentLevel + 1; i++) {
1493 sb.append("\t");
1494 }
1495 if (seqOf == null) {
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001496 sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001497 } else {
1498 Iterator<BerInteger> it = seqOf.iterator();
1499 if (it.hasNext()) {
1500 sb.append(it.next());
1501 while (it.hasNext()) {
1502 sb.append(",\n");
1503 for (int i = 0; i < indentLevel + 1; i++) {
1504 sb.append("\t");
1505 }
1506 sb.append(it.next());
1507 }
1508 }
1509 }
slowr13fa5b02017-08-08 16:32:31 -07001510
slowr67d05e42017-08-11 20:37:22 -07001511 sb.append("\n");
1512 for (int i = 0; i < indentLevel; i++) {
1513 sb.append("\t");
1514 }
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001515 sb.append("}");
slowr67d05e42017-08-11 20:37:22 -07001516 }
slowr13fa5b02017-08-08 16:32:31 -07001517
slowr67d05e42017-08-11 20:37:22 -07001518 }
slowr13fa5b02017-08-08 16:32:31 -07001519
slowr67d05e42017-08-11 20:37:22 -07001520 public static class SubframeBitmaskUl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -07001521
slowr67d05e42017-08-11 20:37:22 -07001522 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
1523 private static final long serialVersionUID = 1L;
slowr73b4eae2017-08-17 16:09:09 -07001524 @JsonIgnore
1525 public byte[] code = null;
slowr67d05e42017-08-11 20:37:22 -07001526 private List<BerBitString> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -07001527
slowr67d05e42017-08-11 20:37:22 -07001528 public SubframeBitmaskUl() {
1529 seqOf = new ArrayList<BerBitString>();
1530 }
slowr13fa5b02017-08-08 16:32:31 -07001531
slowr67d05e42017-08-11 20:37:22 -07001532 public SubframeBitmaskUl(byte[] code) {
1533 this.code = code;
1534 }
slowr13fa5b02017-08-08 16:32:31 -07001535
slowr60d4d102017-08-16 18:33:58 -07001536 @JsonValue
slowr67d05e42017-08-11 20:37:22 -07001537 public List<BerBitString> getBerBitString() {
1538 if (seqOf == null) {
1539 seqOf = new ArrayList<BerBitString>();
1540 }
1541 return seqOf;
1542 }
slowr13fa5b02017-08-08 16:32:31 -07001543
slowr67d05e42017-08-11 20:37:22 -07001544 public int encode(BerByteArrayOutputStream os) throws IOException {
1545 return encode(os, true);
1546 }
slowr13fa5b02017-08-08 16:32:31 -07001547
slowr67d05e42017-08-11 20:37:22 -07001548 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001549
slowr67d05e42017-08-11 20:37:22 -07001550 if (code != null) {
1551 for (int i = code.length - 1; i >= 0; i--) {
1552 os.write(code[i]);
1553 }
1554 if (withTag) {
1555 return tag.encode(os) + code.length;
1556 }
1557 return code.length;
1558 }
slowr13fa5b02017-08-08 16:32:31 -07001559
slowr67d05e42017-08-11 20:37:22 -07001560 int codeLength = 0;
1561 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1562 codeLength += seqOf.get(i).encode(os, true);
1563 }
slowr13fa5b02017-08-08 16:32:31 -07001564
slowr67d05e42017-08-11 20:37:22 -07001565 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001566
slowr67d05e42017-08-11 20:37:22 -07001567 if (withTag) {
1568 codeLength += tag.encode(os);
1569 }
slowr13fa5b02017-08-08 16:32:31 -07001570
slowr67d05e42017-08-11 20:37:22 -07001571 return codeLength;
1572 }
slowr13fa5b02017-08-08 16:32:31 -07001573
slowr67d05e42017-08-11 20:37:22 -07001574 public int decode(InputStream is) throws IOException {
1575 return decode(is, true);
1576 }
slowr13fa5b02017-08-08 16:32:31 -07001577
slowr67d05e42017-08-11 20:37:22 -07001578 public int decode(InputStream is, boolean withTag) throws IOException {
1579 int codeLength = 0;
1580 int subCodeLength = 0;
1581 if (withTag) {
1582 codeLength += tag.decodeAndCheck(is);
1583 }
slowr13fa5b02017-08-08 16:32:31 -07001584
slowr67d05e42017-08-11 20:37:22 -07001585 BerLength length = new BerLength();
1586 codeLength += length.decode(is);
1587 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001588
slowr67d05e42017-08-11 20:37:22 -07001589 while (subCodeLength < totalLength) {
1590 BerBitString element = new BerBitString();
1591 subCodeLength += element.decode(is, true);
1592 seqOf.add(element);
1593 }
1594 if (subCodeLength != totalLength) {
1595 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001596
slowr67d05e42017-08-11 20:37:22 -07001597 }
1598 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001599
slowr67d05e42017-08-11 20:37:22 -07001600 return codeLength;
1601 }
slowr13fa5b02017-08-08 16:32:31 -07001602
slowr67d05e42017-08-11 20:37:22 -07001603 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1604 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1605 encode(os, false);
1606 code = os.getArray();
1607 }
slowr13fa5b02017-08-08 16:32:31 -07001608
slowr67d05e42017-08-11 20:37:22 -07001609 public String toString() {
1610 StringBuilder sb = new StringBuilder();
1611 appendAsString(sb, 0);
1612 return sb.toString();
1613 }
slowr13fa5b02017-08-08 16:32:31 -07001614
slowr67d05e42017-08-11 20:37:22 -07001615 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -07001616
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001617 sb.append("{\n");
slowr67d05e42017-08-11 20:37:22 -07001618 for (int i = 0; i < indentLevel + 1; i++) {
1619 sb.append("\t");
1620 }
1621 if (seqOf == null) {
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001622 sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001623 } else {
1624 Iterator<BerBitString> it = seqOf.iterator();
1625 if (it.hasNext()) {
1626 sb.append(it.next());
1627 while (it.hasNext()) {
1628 sb.append(",\n");
1629 for (int i = 0; i < indentLevel + 1; i++) {
1630 sb.append("\t");
1631 }
1632 sb.append(it.next());
1633 }
1634 }
1635 }
slowr13fa5b02017-08-08 16:32:31 -07001636
slowr67d05e42017-08-11 20:37:22 -07001637 sb.append("\n");
1638 for (int i = 0; i < indentLevel; i++) {
1639 sb.append("\t");
1640 }
Dimitrios Mavrommatis96b255a2017-12-06 13:09:25 -08001641 sb.append("}");
slowr67d05e42017-08-11 20:37:22 -07001642 }
slowr13fa5b02017-08-08 16:32:31 -07001643
slowr67d05e42017-08-11 20:37:22 -07001644 }
slowr13fa5b02017-08-08 16:32:31 -07001645
slowr13fa5b02017-08-08 16:32:31 -07001646}
1647