blob: e7ff333cfbe38e7a6a82375288fd2b32325454e3 [file] [log] [blame]
slowr13fa5b02017-08-08 16:32:31 -07001/**
2 * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org)
3 */
4
5package org.onosproject.xran.codecs.pdu;
6
7import org.onosproject.xran.codecs.api.CRNTI;
8import org.onosproject.xran.codecs.api.ECGI;
9import org.onosproject.xran.codecs.api.XICICPA;
slowr67d05e42017-08-11 20:37:22 -070010import org.onosproject.xran.entities.RnibCell;
slowr13fa5b02017-08-08 16:32:31 -070011import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
12import org.openmuc.jasn1.ber.BerLength;
13import org.openmuc.jasn1.ber.BerTag;
14import org.openmuc.jasn1.ber.types.BerBitString;
15import org.openmuc.jasn1.ber.types.BerInteger;
slowr67d05e42017-08-11 20:37:22 -070016import org.openmuc.jasn1.ber.types.string.BerUTF8String;
17
slowr13fa5b02017-08-08 16:32:31 -070018import java.io.IOException;
19import java.io.InputStream;
20import java.io.Serializable;
slowr67d05e42017-08-11 20:37:22 -070021import java.io.UnsupportedEncodingException;
slowr13fa5b02017-08-08 16:32:31 -070022import java.util.ArrayList;
23import java.util.Iterator;
24import java.util.List;
25
26public class RRMConfig implements Serializable {
27
slowr67d05e42017-08-11 20:37:22 -070028 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
29 private static final long serialVersionUID = 1L;
30 public byte[] code = null;
31 private ECGI ecgi = null;
32 private Crnti crnti = null;
33 private Pa pa = null;
34 private StartPrbDl startPrbDl = null;
35 private EndPrbDl endPrbDl = null;
36 private SubframeBitmaskDl subframeBitmaskDl = null;
37 private P0UePusch p0UePusch = null;
38 private StartPrbUl startPrbUl = null;
39 private EndPrbUl endPrbUl = null;
40 private SubframeBitmaskUl subframeBitmaskUl = null;
slowr13fa5b02017-08-08 16:32:31 -070041
slowr67d05e42017-08-11 20:37:22 -070042 public RRMConfig() {
43 }
slowr13fa5b02017-08-08 16:32:31 -070044
slowr67d05e42017-08-11 20:37:22 -070045 public RRMConfig(byte[] code) {
46 this.code = code;
47 }
slowr13fa5b02017-08-08 16:32:31 -070048
slowr67d05e42017-08-11 20:37:22 -070049 public ECGI getEcgi() {
50 return ecgi;
51 }
slowr13fa5b02017-08-08 16:32:31 -070052
slowr67d05e42017-08-11 20:37:22 -070053 public void setEcgi(ECGI ecgi) {
54 this.ecgi = ecgi;
55 }
slowr13fa5b02017-08-08 16:32:31 -070056
slowr67d05e42017-08-11 20:37:22 -070057 public Crnti getCrnti() {
58 return crnti;
59 }
slowr13fa5b02017-08-08 16:32:31 -070060
slowr67d05e42017-08-11 20:37:22 -070061 public void setCrnti(Crnti crnti) {
62 this.crnti = crnti;
63 }
slowr13fa5b02017-08-08 16:32:31 -070064
slowr67d05e42017-08-11 20:37:22 -070065 public Pa getPa() {
66 return pa;
67 }
slowr13fa5b02017-08-08 16:32:31 -070068
slowr67d05e42017-08-11 20:37:22 -070069 public void setPa(Pa pa) {
70 this.pa = pa;
71 }
slowr13fa5b02017-08-08 16:32:31 -070072
slowr67d05e42017-08-11 20:37:22 -070073 public StartPrbDl getStartPrbDl() {
74 return startPrbDl;
75 }
slowr13fa5b02017-08-08 16:32:31 -070076
slowr67d05e42017-08-11 20:37:22 -070077 public void setStartPrbDl(StartPrbDl startPrbDl) {
78 this.startPrbDl = startPrbDl;
79 }
slowr13fa5b02017-08-08 16:32:31 -070080
slowr67d05e42017-08-11 20:37:22 -070081 public EndPrbDl getEndPrbDl() {
82 return endPrbDl;
83 }
slowr13fa5b02017-08-08 16:32:31 -070084
slowr67d05e42017-08-11 20:37:22 -070085 public void setEndPrbDl(EndPrbDl endPrbDl) {
86 this.endPrbDl = endPrbDl;
87 }
slowr13fa5b02017-08-08 16:32:31 -070088
slowr67d05e42017-08-11 20:37:22 -070089 public SubframeBitmaskDl getSubframeBitmaskDl() {
90 return subframeBitmaskDl;
91 }
slowr13fa5b02017-08-08 16:32:31 -070092
slowr67d05e42017-08-11 20:37:22 -070093 public void setSubframeBitmaskDl(SubframeBitmaskDl subframeBitmaskDl) {
94 this.subframeBitmaskDl = subframeBitmaskDl;
95 }
slowr13fa5b02017-08-08 16:32:31 -070096
slowr67d05e42017-08-11 20:37:22 -070097 public P0UePusch getP0UePusch() {
98 return p0UePusch;
99 }
slowr13fa5b02017-08-08 16:32:31 -0700100
slowr67d05e42017-08-11 20:37:22 -0700101 public void setP0UePusch(P0UePusch p0UePusch) {
102 this.p0UePusch = p0UePusch;
103 }
slowr13fa5b02017-08-08 16:32:31 -0700104
slowr67d05e42017-08-11 20:37:22 -0700105 public StartPrbUl getStartPrbUl() {
106 return startPrbUl;
107 }
slowr13fa5b02017-08-08 16:32:31 -0700108
slowr67d05e42017-08-11 20:37:22 -0700109 public void setStartPrbUl(StartPrbUl startPrbUl) {
110 this.startPrbUl = startPrbUl;
111 }
slowr13fa5b02017-08-08 16:32:31 -0700112
slowr67d05e42017-08-11 20:37:22 -0700113 public EndPrbUl getEndPrbUl() {
114 return endPrbUl;
115 }
slowr13fa5b02017-08-08 16:32:31 -0700116
slowr67d05e42017-08-11 20:37:22 -0700117 public void setEndPrbUl(EndPrbUl endPrbUl) {
118 this.endPrbUl = endPrbUl;
119 }
slowr13fa5b02017-08-08 16:32:31 -0700120
slowr67d05e42017-08-11 20:37:22 -0700121 public SubframeBitmaskUl getSubframeBitmaskUl() {
122 return subframeBitmaskUl;
123 }
slowr13fa5b02017-08-08 16:32:31 -0700124
slowr67d05e42017-08-11 20:37:22 -0700125 public void setSubframeBitmaskUl(SubframeBitmaskUl subframeBitmaskUl) {
126 this.subframeBitmaskUl = subframeBitmaskUl;
127 }
slowr13fa5b02017-08-08 16:32:31 -0700128
slowr67d05e42017-08-11 20:37:22 -0700129 public int encode(BerByteArrayOutputStream os) throws IOException {
130 return encode(os, true);
131 }
132
133 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
134
135 if (code != null) {
136 for (int i = code.length - 1; i >= 0; i--) {
137 os.write(code[i]);
138 }
139 if (withTag) {
140 return tag.encode(os) + code.length;
141 }
142 return code.length;
143 }
144
145 int codeLength = 0;
146 if (subframeBitmaskUl != null) {
147 codeLength += subframeBitmaskUl.encode(os, false);
148 // write tag: CONTEXT_CLASS, CONSTRUCTED, 9
149 os.write(0xA9);
150 codeLength += 1;
151 }
152
153 if (endPrbUl != null) {
154 codeLength += endPrbUl.encode(os, false);
155 // write tag: CONTEXT_CLASS, CONSTRUCTED, 8
156 os.write(0xA8);
157 codeLength += 1;
158 }
159
160 if (startPrbUl != null) {
161 codeLength += startPrbUl.encode(os, false);
162 // write tag: CONTEXT_CLASS, CONSTRUCTED, 7
163 os.write(0xA7);
164 codeLength += 1;
165 }
166
167 if (p0UePusch != null) {
168 codeLength += p0UePusch.encode(os, false);
169 // write tag: CONTEXT_CLASS, CONSTRUCTED, 6
170 os.write(0xA6);
171 codeLength += 1;
172 }
173
174 if (subframeBitmaskDl != null) {
175 codeLength += subframeBitmaskDl.encode(os, false);
176 // write tag: CONTEXT_CLASS, CONSTRUCTED, 5
177 os.write(0xA5);
178 codeLength += 1;
179 }
180
181 if (endPrbDl != null) {
182 codeLength += endPrbDl.encode(os, false);
183 // write tag: CONTEXT_CLASS, CONSTRUCTED, 4
184 os.write(0xA4);
185 codeLength += 1;
186 }
187
188 if (startPrbDl != null) {
189 codeLength += startPrbDl.encode(os, false);
190 // write tag: CONTEXT_CLASS, CONSTRUCTED, 3
191 os.write(0xA3);
192 codeLength += 1;
193 }
194
195 if (pa != null) {
196 codeLength += pa.encode(os, false);
197 // write tag: CONTEXT_CLASS, CONSTRUCTED, 2
198 os.write(0xA2);
199 codeLength += 1;
200 }
201
202 if (crnti != null) {
203 codeLength += crnti.encode(os, false);
204 // write tag: CONTEXT_CLASS, CONSTRUCTED, 1
205 os.write(0xA1);
206 codeLength += 1;
207 }
208
209 codeLength += ecgi.encode(os, false);
210 // write tag: CONTEXT_CLASS, CONSTRUCTED, 0
211 os.write(0xA0);
212 codeLength += 1;
213
214 codeLength += BerLength.encodeLength(os, codeLength);
215
216 if (withTag) {
217 codeLength += tag.encode(os);
218 }
219
220 return codeLength;
221
222 }
223
224 public int decode(InputStream is) throws IOException {
225 return decode(is, true);
226 }
227
228 public int decode(InputStream is, boolean withTag) throws IOException {
229 int codeLength = 0;
230 int subCodeLength = 0;
231 BerTag berTag = new BerTag();
232
233 if (withTag) {
234 codeLength += tag.decodeAndCheck(is);
235 }
236
237 BerLength length = new BerLength();
238 codeLength += length.decode(is);
239
240 int totalLength = length.val;
241 codeLength += totalLength;
242
243 subCodeLength += berTag.decode(is);
244 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
245 ecgi = new ECGI();
246 subCodeLength += ecgi.decode(is, false);
247 if (subCodeLength == totalLength) {
248 return codeLength;
249 }
250 subCodeLength += berTag.decode(is);
251 } else {
252 throw new IOException("Tag does not match the mandatory sequence element tag.");
253 }
254
255 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
256 crnti = new Crnti();
257 subCodeLength += crnti.decode(is, false);
258 if (subCodeLength == totalLength) {
259 return codeLength;
260 }
261 subCodeLength += berTag.decode(is);
262 }
263
264 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
265 pa = new Pa();
266 subCodeLength += pa.decode(is, false);
267 if (subCodeLength == totalLength) {
268 return codeLength;
269 }
270 subCodeLength += berTag.decode(is);
271 }
272
273 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) {
274 startPrbDl = new StartPrbDl();
275 subCodeLength += startPrbDl.decode(is, false);
276 if (subCodeLength == totalLength) {
277 return codeLength;
278 }
279 subCodeLength += berTag.decode(is);
280 }
281
282 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
283 endPrbDl = new EndPrbDl();
284 subCodeLength += endPrbDl.decode(is, false);
285 if (subCodeLength == totalLength) {
286 return codeLength;
287 }
288 subCodeLength += berTag.decode(is);
289 }
290
291 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
292 subframeBitmaskDl = new SubframeBitmaskDl();
293 subCodeLength += subframeBitmaskDl.decode(is, false);
294 if (subCodeLength == totalLength) {
295 return codeLength;
296 }
297 subCodeLength += berTag.decode(is);
298 }
299
300 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) {
301 p0UePusch = new P0UePusch();
302 subCodeLength += p0UePusch.decode(is, false);
303 if (subCodeLength == totalLength) {
304 return codeLength;
305 }
306 subCodeLength += berTag.decode(is);
307 }
308
309 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 7)) {
310 startPrbUl = new StartPrbUl();
311 subCodeLength += startPrbUl.decode(is, false);
312 if (subCodeLength == totalLength) {
313 return codeLength;
314 }
315 subCodeLength += berTag.decode(is);
316 }
317
318 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 8)) {
319 endPrbUl = new EndPrbUl();
320 subCodeLength += endPrbUl.decode(is, false);
321 if (subCodeLength == totalLength) {
322 return codeLength;
323 }
324 subCodeLength += berTag.decode(is);
325 }
326
327 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 9)) {
328 subframeBitmaskUl = new SubframeBitmaskUl();
329 subCodeLength += subframeBitmaskUl.decode(is, false);
330 if (subCodeLength == totalLength) {
331 return codeLength;
332 }
333 }
334 throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
335
336
337 }
338
339 public void encodeAndSave(int encodingSizeGuess) throws IOException {
340 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
341 encode(os, false);
342 code = os.getArray();
343 }
344
345 public String toString() {
346 StringBuilder sb = new StringBuilder();
347 appendAsString(sb, 0);
348 return sb.toString();
349 }
350
351 public void appendAsString(StringBuilder sb, int indentLevel) {
352
353 sb.append("{");
354 sb.append("\n");
355 for (int i = 0; i < indentLevel + 1; i++) {
356 sb.append("\t");
357 }
358 if (ecgi != null) {
359 sb.append("\"ecgi\": ");
360 ecgi.appendAsString(sb, indentLevel + 1);
361 }
362
363 if (crnti != null) {
364 sb.append(",\n");
365 for (int i = 0; i < indentLevel + 1; i++) {
366 sb.append("\t");
367 }
368 sb.append("\"crnti\": ");
369 crnti.appendAsString(sb, indentLevel + 1);
370 }
371
372 if (pa != null) {
373 sb.append(",\n");
374 for (int i = 0; i < indentLevel + 1; i++) {
375 sb.append("\t");
376 }
377 sb.append("\"pa\": ");
378 pa.appendAsString(sb, indentLevel + 1);
379 }
380
381 if (startPrbDl != null) {
382 sb.append(",\n");
383 for (int i = 0; i < indentLevel + 1; i++) {
384 sb.append("\t");
385 }
386 sb.append("\"startPrbDl\": ");
387 startPrbDl.appendAsString(sb, indentLevel + 1);
388 }
389
390 if (endPrbDl != null) {
391 sb.append(",\n");
392 for (int i = 0; i < indentLevel + 1; i++) {
393 sb.append("\t");
394 }
395 sb.append("\"endPrbDl\": ");
396 endPrbDl.appendAsString(sb, indentLevel + 1);
397 }
398
399 if (subframeBitmaskDl != null) {
400 sb.append(",\n");
401 for (int i = 0; i < indentLevel + 1; i++) {
402 sb.append("\t");
403 }
404 sb.append("\"subframeBitmaskDl\": ");
405 subframeBitmaskDl.appendAsString(sb, indentLevel + 1);
406 }
407
408 if (p0UePusch != null) {
409 sb.append(",\n");
410 for (int i = 0; i < indentLevel + 1; i++) {
411 sb.append("\t");
412 }
413 sb.append("\"p0UePusch\": ");
414 p0UePusch.appendAsString(sb, indentLevel + 1);
415 }
416
417 if (startPrbUl != null) {
418 sb.append(",\n");
419 for (int i = 0; i < indentLevel + 1; i++) {
420 sb.append("\t");
421 }
422 sb.append("\"startPrbUl\": ");
423 startPrbUl.appendAsString(sb, indentLevel + 1);
424 }
425
426 if (endPrbUl != null) {
427 sb.append(",\n");
428 for (int i = 0; i < indentLevel + 1; i++) {
429 sb.append("\t");
430 }
431 sb.append("\"endPrbUl\": ");
432 endPrbUl.appendAsString(sb, indentLevel + 1);
433 }
434
435 if (subframeBitmaskUl != null) {
436 sb.append(",\n");
437 for (int i = 0; i < indentLevel + 1; i++) {
438 sb.append("\t");
439 }
440 sb.append("\"subframeBitmaskUl\": ");
441 subframeBitmaskUl.appendAsString(sb, indentLevel + 1);
442 }
443
444 sb.append("\n");
445 for (int i = 0; i < indentLevel; i++) {
446 sb.append("\t");
447 }
448 sb.append("}");
449 }
450
451 public static class Crnti implements Serializable {
452
453 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
454 private static final long serialVersionUID = 1L;
455 public byte[] code = null;
456 private List<CRNTI> seqOf = null;
457
458 public Crnti() {
459 seqOf = new ArrayList<CRNTI>();
460 }
461
462 public Crnti(byte[] code) {
463 this.code = code;
464 }
465
466 public List<CRNTI> getCRNTI() {
467 if (seqOf == null) {
468 seqOf = new ArrayList<CRNTI>();
469 }
470 return seqOf;
471 }
472
473 public void addCRNTI(CRNTI crnti) {
474 seqOf.add(crnti);
475 }
476
477 public int encode(BerByteArrayOutputStream os) throws IOException {
478 return encode(os, true);
479 }
480
481 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
482
483 if (code != null) {
484 for (int i = code.length - 1; i >= 0; i--) {
485 os.write(code[i]);
486 }
487 if (withTag) {
488 return tag.encode(os) + code.length;
489 }
490 return code.length;
491 }
492
493 int codeLength = 0;
494 for (int i = (seqOf.size() - 1); i >= 0; i--) {
495 codeLength += seqOf.get(i).encode(os, true);
496 }
497
498 codeLength += BerLength.encodeLength(os, codeLength);
499
500 if (withTag) {
501 codeLength += tag.encode(os);
502 }
503
504 return codeLength;
505 }
506
507 public int decode(InputStream is) throws IOException {
508 return decode(is, true);
509 }
510
511 public int decode(InputStream is, boolean withTag) throws IOException {
512 int codeLength = 0;
513 int subCodeLength = 0;
514 if (withTag) {
515 codeLength += tag.decodeAndCheck(is);
516 }
517
518 BerLength length = new BerLength();
519 codeLength += length.decode(is);
520 int totalLength = length.val;
521
522 while (subCodeLength < totalLength) {
523 CRNTI element = new CRNTI();
524 subCodeLength += element.decode(is, true);
525 seqOf.add(element);
526 }
527 if (subCodeLength != totalLength) {
528 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
529
530 }
531 codeLength += subCodeLength;
532
533 return codeLength;
534 }
535
536 public void encodeAndSave(int encodingSizeGuess) throws IOException {
537 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
538 encode(os, false);
539 code = os.getArray();
540 }
541
542 public String toString() {
543 StringBuilder sb = new StringBuilder();
544 appendAsString(sb, 0);
545 return sb.toString();
546 }
547
548 public void appendAsString(StringBuilder sb, int indentLevel) {
549
550 sb.append("[\n");
551 for (int i = 0; i < indentLevel + 1; i++) {
552 sb.append("\t");
553 }
554 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -0700555// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -0700556 } else {
557 Iterator<CRNTI> it = seqOf.iterator();
558 if (it.hasNext()) {
559 sb.append(it.next());
560 while (it.hasNext()) {
561 sb.append(",\n");
562 for (int i = 0; i < indentLevel + 1; i++) {
563 sb.append("\t");
564 }
565 sb.append(it.next());
566 }
567 }
568 }
slowr13fa5b02017-08-08 16:32:31 -0700569
slowr67d05e42017-08-11 20:37:22 -0700570 sb.append("\n");
571 for (int i = 0; i < indentLevel; i++) {
572 sb.append("\t");
573 }
574 sb.append("]");
575 }
slowr13fa5b02017-08-08 16:32:31 -0700576
slowr67d05e42017-08-11 20:37:22 -0700577 }
slowr13fa5b02017-08-08 16:32:31 -0700578
slowr67d05e42017-08-11 20:37:22 -0700579 public static class Pa implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -0700580
slowr67d05e42017-08-11 20:37:22 -0700581 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
582 private static final long serialVersionUID = 1L;
583 public byte[] code = null;
584 private List<XICICPA> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -0700585
slowr67d05e42017-08-11 20:37:22 -0700586 public Pa() {
587 seqOf = new ArrayList<XICICPA>();
588 }
slowr13fa5b02017-08-08 16:32:31 -0700589
slowr67d05e42017-08-11 20:37:22 -0700590 public Pa(byte[] code) {
591 this.code = code;
592 }
slowr13fa5b02017-08-08 16:32:31 -0700593
slowr67d05e42017-08-11 20:37:22 -0700594 public List<XICICPA> getXICICPA() {
595 if (seqOf == null) {
596 seqOf = new ArrayList<XICICPA>();
597 }
598 return seqOf;
599 }
slowr13fa5b02017-08-08 16:32:31 -0700600
slowr67d05e42017-08-11 20:37:22 -0700601 public int encode(BerByteArrayOutputStream os) throws IOException {
602 return encode(os, true);
603 }
slowr13fa5b02017-08-08 16:32:31 -0700604
slowr67d05e42017-08-11 20:37:22 -0700605 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -0700606
slowr67d05e42017-08-11 20:37:22 -0700607 if (code != null) {
608 for (int i = code.length - 1; i >= 0; i--) {
609 os.write(code[i]);
610 }
611 if (withTag) {
612 return tag.encode(os) + code.length;
613 }
614 return code.length;
615 }
slowr13fa5b02017-08-08 16:32:31 -0700616
slowr67d05e42017-08-11 20:37:22 -0700617 int codeLength = 0;
618 for (int i = (seqOf.size() - 1); i >= 0; i--) {
619 codeLength += seqOf.get(i).encode(os, true);
620 }
slowr13fa5b02017-08-08 16:32:31 -0700621
slowr67d05e42017-08-11 20:37:22 -0700622 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -0700623
slowr67d05e42017-08-11 20:37:22 -0700624 if (withTag) {
625 codeLength += tag.encode(os);
626 }
slowr13fa5b02017-08-08 16:32:31 -0700627
slowr67d05e42017-08-11 20:37:22 -0700628 return codeLength;
629 }
slowr13fa5b02017-08-08 16:32:31 -0700630
slowr67d05e42017-08-11 20:37:22 -0700631 public int decode(InputStream is) throws IOException {
632 return decode(is, true);
633 }
slowr13fa5b02017-08-08 16:32:31 -0700634
slowr67d05e42017-08-11 20:37:22 -0700635 public int decode(InputStream is, boolean withTag) throws IOException {
636 int codeLength = 0;
637 int subCodeLength = 0;
638 if (withTag) {
639 codeLength += tag.decodeAndCheck(is);
640 }
slowr13fa5b02017-08-08 16:32:31 -0700641
slowr67d05e42017-08-11 20:37:22 -0700642 BerLength length = new BerLength();
643 codeLength += length.decode(is);
644 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -0700645
slowr67d05e42017-08-11 20:37:22 -0700646 while (subCodeLength < totalLength) {
647 XICICPA element = new XICICPA();
648 subCodeLength += element.decode(is, true);
649 seqOf.add(element);
650 }
651 if (subCodeLength != totalLength) {
652 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -0700653
slowr67d05e42017-08-11 20:37:22 -0700654 }
655 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -0700656
slowr67d05e42017-08-11 20:37:22 -0700657 return codeLength;
658 }
slowr13fa5b02017-08-08 16:32:31 -0700659
slowr67d05e42017-08-11 20:37:22 -0700660 public void encodeAndSave(int encodingSizeGuess) throws IOException {
661 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
662 encode(os, false);
663 code = os.getArray();
664 }
slowr13fa5b02017-08-08 16:32:31 -0700665
slowr67d05e42017-08-11 20:37:22 -0700666 public String toString() {
667 StringBuilder sb = new StringBuilder();
668 appendAsString(sb, 0);
669 return sb.toString();
670 }
slowr13fa5b02017-08-08 16:32:31 -0700671
slowr67d05e42017-08-11 20:37:22 -0700672 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -0700673
slowr67d05e42017-08-11 20:37:22 -0700674 sb.append("[\n");
675 for (int i = 0; i < indentLevel + 1; i++) {
676 sb.append("\t");
677 }
678 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -0700679// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -0700680 } else {
681 Iterator<XICICPA> it = seqOf.iterator();
682 if (it.hasNext()) {
683 sb.append(it.next());
684 while (it.hasNext()) {
685 sb.append(",\n");
686 for (int i = 0; i < indentLevel + 1; i++) {
687 sb.append("\t");
688 }
689 sb.append(it.next());
690 }
691 }
692 }
slowr13fa5b02017-08-08 16:32:31 -0700693
slowr67d05e42017-08-11 20:37:22 -0700694 sb.append("\n");
695 for (int i = 0; i < indentLevel; i++) {
696 sb.append("\t");
697 }
698 sb.append("]");
699 }
slowr13fa5b02017-08-08 16:32:31 -0700700
slowr67d05e42017-08-11 20:37:22 -0700701 }
slowr13fa5b02017-08-08 16:32:31 -0700702
slowr67d05e42017-08-11 20:37:22 -0700703 public static class StartPrbDl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -0700704
slowr67d05e42017-08-11 20:37:22 -0700705 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
706 private static final long serialVersionUID = 1L;
707 public byte[] code = null;
708 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -0700709
slowr67d05e42017-08-11 20:37:22 -0700710 public StartPrbDl() {
711 seqOf = new ArrayList<BerInteger>();
712 }
slowr13fa5b02017-08-08 16:32:31 -0700713
slowr67d05e42017-08-11 20:37:22 -0700714 public StartPrbDl(byte[] code) {
715 this.code = code;
716 }
slowr13fa5b02017-08-08 16:32:31 -0700717
slowr67d05e42017-08-11 20:37:22 -0700718 public List<BerInteger> getSeqOf() {
719 return seqOf;
720 }
slowr13fa5b02017-08-08 16:32:31 -0700721
slowr67d05e42017-08-11 20:37:22 -0700722 public void setSeqOf(List<BerInteger> seqOf) {
723 this.seqOf = seqOf;
724 }
slowr13fa5b02017-08-08 16:32:31 -0700725
slowr67d05e42017-08-11 20:37:22 -0700726 public List<BerInteger> getBerInteger() {
727 if (seqOf == null) {
728 seqOf = new ArrayList<BerInteger>();
729 }
730 return seqOf;
731 }
slowr13fa5b02017-08-08 16:32:31 -0700732
slowr67d05e42017-08-11 20:37:22 -0700733 public int encode(BerByteArrayOutputStream os) throws IOException {
734 return encode(os, true);
735 }
slowr13fa5b02017-08-08 16:32:31 -0700736
slowr67d05e42017-08-11 20:37:22 -0700737 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -0700738
slowr67d05e42017-08-11 20:37:22 -0700739 if (code != null) {
740 for (int i = code.length - 1; i >= 0; i--) {
741 os.write(code[i]);
742 }
743 if (withTag) {
744 return tag.encode(os) + code.length;
745 }
746 return code.length;
747 }
slowr13fa5b02017-08-08 16:32:31 -0700748
slowr67d05e42017-08-11 20:37:22 -0700749 int codeLength = 0;
750 for (int i = (seqOf.size() - 1); i >= 0; i--) {
751 codeLength += seqOf.get(i).encode(os, true);
752 }
slowr13fa5b02017-08-08 16:32:31 -0700753
slowr67d05e42017-08-11 20:37:22 -0700754 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -0700755
slowr67d05e42017-08-11 20:37:22 -0700756 if (withTag) {
757 codeLength += tag.encode(os);
758 }
slowr13fa5b02017-08-08 16:32:31 -0700759
slowr67d05e42017-08-11 20:37:22 -0700760 return codeLength;
761 }
slowr13fa5b02017-08-08 16:32:31 -0700762
slowr67d05e42017-08-11 20:37:22 -0700763 public int decode(InputStream is) throws IOException {
764 return decode(is, true);
765 }
slowr13fa5b02017-08-08 16:32:31 -0700766
slowr67d05e42017-08-11 20:37:22 -0700767 public int decode(InputStream is, boolean withTag) throws IOException {
768 int codeLength = 0;
769 int subCodeLength = 0;
770 if (withTag) {
771 codeLength += tag.decodeAndCheck(is);
772 }
slowr13fa5b02017-08-08 16:32:31 -0700773
slowr67d05e42017-08-11 20:37:22 -0700774 BerLength length = new BerLength();
775 codeLength += length.decode(is);
776 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -0700777
slowr67d05e42017-08-11 20:37:22 -0700778 while (subCodeLength < totalLength) {
779 BerInteger element = new BerInteger();
780 subCodeLength += element.decode(is, true);
781 seqOf.add(element);
782 }
783 if (subCodeLength != totalLength) {
784 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -0700785
slowr67d05e42017-08-11 20:37:22 -0700786 }
787 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -0700788
slowr67d05e42017-08-11 20:37:22 -0700789 return codeLength;
790 }
slowr13fa5b02017-08-08 16:32:31 -0700791
slowr67d05e42017-08-11 20:37:22 -0700792 public void encodeAndSave(int encodingSizeGuess) throws IOException {
793 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
794 encode(os, false);
795 code = os.getArray();
796 }
slowr13fa5b02017-08-08 16:32:31 -0700797
slowr67d05e42017-08-11 20:37:22 -0700798 public String toString() {
799 StringBuilder sb = new StringBuilder();
800 appendAsString(sb, 0);
801 return sb.toString();
802 }
slowr13fa5b02017-08-08 16:32:31 -0700803
slowr67d05e42017-08-11 20:37:22 -0700804 public void appendAsString(StringBuilder sb, int indentLevel) {
805
806 sb.append("[\n");
807 for (int i = 0; i < indentLevel + 1; i++) {
808 sb.append("\t");
809 }
810 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -0700811// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -0700812 } else {
813 Iterator<BerInteger> it = seqOf.iterator();
814 if (it.hasNext()) {
815 sb.append(it.next());
816 while (it.hasNext()) {
817 sb.append(",\n");
818 for (int i = 0; i < indentLevel + 1; i++) {
819 sb.append("\t");
820 }
821 sb.append(it.next());
822 }
823 }
824 }
slowr13fa5b02017-08-08 16:32:31 -0700825
slowr67d05e42017-08-11 20:37:22 -0700826 sb.append("\n");
827 for (int i = 0; i < indentLevel; i++) {
828 sb.append("\t");
829 }
830 sb.append("]");
831 }
slowr13fa5b02017-08-08 16:32:31 -0700832
slowr67d05e42017-08-11 20:37:22 -0700833 public void addBerInteger(BerInteger berInteger) {
834 seqOf.add(berInteger);
835 }
836 }
slowr13fa5b02017-08-08 16:32:31 -0700837
slowr67d05e42017-08-11 20:37:22 -0700838 public static class EndPrbDl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -0700839
slowr67d05e42017-08-11 20:37:22 -0700840 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
841 private static final long serialVersionUID = 1L;
842 public byte[] code = null;
843 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -0700844
slowr67d05e42017-08-11 20:37:22 -0700845 public EndPrbDl() {
846 seqOf = new ArrayList<BerInteger>();
847 }
slowr13fa5b02017-08-08 16:32:31 -0700848
slowr67d05e42017-08-11 20:37:22 -0700849 public EndPrbDl(byte[] code) {
850 this.code = code;
851 }
slowr13fa5b02017-08-08 16:32:31 -0700852
slowr67d05e42017-08-11 20:37:22 -0700853 public List<BerInteger> getBerInteger() {
854 if (seqOf == null) {
855 seqOf = new ArrayList<BerInteger>();
856 }
857 return seqOf;
858 }
slowr13fa5b02017-08-08 16:32:31 -0700859
slowr67d05e42017-08-11 20:37:22 -0700860 public int encode(BerByteArrayOutputStream os) throws IOException {
861 return encode(os, true);
862 }
slowr13fa5b02017-08-08 16:32:31 -0700863
slowr67d05e42017-08-11 20:37:22 -0700864 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -0700865
slowr67d05e42017-08-11 20:37:22 -0700866 if (code != null) {
867 for (int i = code.length - 1; i >= 0; i--) {
868 os.write(code[i]);
869 }
870 if (withTag) {
871 return tag.encode(os) + code.length;
872 }
873 return code.length;
874 }
slowr13fa5b02017-08-08 16:32:31 -0700875
slowr67d05e42017-08-11 20:37:22 -0700876 int codeLength = 0;
877 for (int i = (seqOf.size() - 1); i >= 0; i--) {
878 codeLength += seqOf.get(i).encode(os, true);
879 }
slowr13fa5b02017-08-08 16:32:31 -0700880
slowr67d05e42017-08-11 20:37:22 -0700881 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -0700882
slowr67d05e42017-08-11 20:37:22 -0700883 if (withTag) {
884 codeLength += tag.encode(os);
885 }
slowr13fa5b02017-08-08 16:32:31 -0700886
slowr67d05e42017-08-11 20:37:22 -0700887 return codeLength;
888 }
slowr13fa5b02017-08-08 16:32:31 -0700889
slowr67d05e42017-08-11 20:37:22 -0700890 public int decode(InputStream is) throws IOException {
891 return decode(is, true);
892 }
slowr13fa5b02017-08-08 16:32:31 -0700893
slowr67d05e42017-08-11 20:37:22 -0700894 public int decode(InputStream is, boolean withTag) throws IOException {
895 int codeLength = 0;
896 int subCodeLength = 0;
897 if (withTag) {
898 codeLength += tag.decodeAndCheck(is);
899 }
slowr13fa5b02017-08-08 16:32:31 -0700900
slowr67d05e42017-08-11 20:37:22 -0700901 BerLength length = new BerLength();
902 codeLength += length.decode(is);
903 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -0700904
slowr67d05e42017-08-11 20:37:22 -0700905 while (subCodeLength < totalLength) {
906 BerInteger element = new BerInteger();
907 subCodeLength += element.decode(is, true);
908 seqOf.add(element);
909 }
910 if (subCodeLength != totalLength) {
911 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -0700912
slowr67d05e42017-08-11 20:37:22 -0700913 }
914 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -0700915
slowr67d05e42017-08-11 20:37:22 -0700916 return codeLength;
917 }
slowr13fa5b02017-08-08 16:32:31 -0700918
slowr67d05e42017-08-11 20:37:22 -0700919 public void encodeAndSave(int encodingSizeGuess) throws IOException {
920 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
921 encode(os, false);
922 code = os.getArray();
923 }
slowr13fa5b02017-08-08 16:32:31 -0700924
slowr67d05e42017-08-11 20:37:22 -0700925 public String toString() {
926 StringBuilder sb = new StringBuilder();
927 appendAsString(sb, 0);
928 return sb.toString();
929 }
slowr13fa5b02017-08-08 16:32:31 -0700930
slowr67d05e42017-08-11 20:37:22 -0700931 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -0700932
slowr67d05e42017-08-11 20:37:22 -0700933 sb.append("[\n");
934 for (int i = 0; i < indentLevel + 1; i++) {
935 sb.append("\t");
936 }
937 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -0700938// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -0700939 } else {
940 Iterator<BerInteger> it = seqOf.iterator();
941 if (it.hasNext()) {
942 sb.append(it.next());
943 while (it.hasNext()) {
944 sb.append(",\n");
945 for (int i = 0; i < indentLevel + 1; i++) {
946 sb.append("\t");
947 }
948 sb.append(it.next());
949 }
950 }
951 }
slowr13fa5b02017-08-08 16:32:31 -0700952
slowr67d05e42017-08-11 20:37:22 -0700953 sb.append("\n");
954 for (int i = 0; i < indentLevel; i++) {
955 sb.append("\t");
956 }
957 sb.append("]");
958 }
slowr13fa5b02017-08-08 16:32:31 -0700959
slowr67d05e42017-08-11 20:37:22 -0700960 public void addBerInteger(BerInteger berInteger) {
961 seqOf.add(berInteger);
962 }
slowr13fa5b02017-08-08 16:32:31 -0700963
slowr67d05e42017-08-11 20:37:22 -0700964 public List<BerInteger> getSeqOf() {
965 return seqOf;
966 }
slowr13fa5b02017-08-08 16:32:31 -0700967
slowr67d05e42017-08-11 20:37:22 -0700968 public void setSeqOf(List<BerInteger> seqOf) {
969 this.seqOf = seqOf;
970 }
971 }
slowr13fa5b02017-08-08 16:32:31 -0700972
slowr67d05e42017-08-11 20:37:22 -0700973 public static class SubframeBitmaskDl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -0700974
slowr67d05e42017-08-11 20:37:22 -0700975 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
976 private static final long serialVersionUID = 1L;
977 public byte[] code = null;
978 private List<BerBitString> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -0700979
slowr67d05e42017-08-11 20:37:22 -0700980 public SubframeBitmaskDl() {
981 seqOf = new ArrayList<BerBitString>();
982 }
slowr13fa5b02017-08-08 16:32:31 -0700983
slowr67d05e42017-08-11 20:37:22 -0700984 public SubframeBitmaskDl(byte[] code) {
985 this.code = code;
986 }
slowr13fa5b02017-08-08 16:32:31 -0700987
slowr67d05e42017-08-11 20:37:22 -0700988 public List<BerBitString> getBerBitString() {
989 if (seqOf == null) {
990 seqOf = new ArrayList<BerBitString>();
991 }
992 return seqOf;
993 }
slowr13fa5b02017-08-08 16:32:31 -0700994
slowr67d05e42017-08-11 20:37:22 -0700995 public void addBerBitString(BerBitString berBitString) {
996 seqOf.add(berBitString);
997 }
slowr13fa5b02017-08-08 16:32:31 -0700998
slowr67d05e42017-08-11 20:37:22 -0700999 public int encode(BerByteArrayOutputStream os) throws IOException {
1000 return encode(os, true);
1001 }
slowr13fa5b02017-08-08 16:32:31 -07001002
slowr67d05e42017-08-11 20:37:22 -07001003 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001004
slowr67d05e42017-08-11 20:37:22 -07001005 if (code != null) {
1006 for (int i = code.length - 1; i >= 0; i--) {
1007 os.write(code[i]);
1008 }
1009 if (withTag) {
1010 return tag.encode(os) + code.length;
1011 }
1012 return code.length;
1013 }
slowr13fa5b02017-08-08 16:32:31 -07001014
slowr67d05e42017-08-11 20:37:22 -07001015 int codeLength = 0;
1016 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1017 codeLength += seqOf.get(i).encode(os, true);
1018 }
slowr13fa5b02017-08-08 16:32:31 -07001019
slowr67d05e42017-08-11 20:37:22 -07001020 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001021
slowr67d05e42017-08-11 20:37:22 -07001022 if (withTag) {
1023 codeLength += tag.encode(os);
1024 }
slowr13fa5b02017-08-08 16:32:31 -07001025
slowr67d05e42017-08-11 20:37:22 -07001026 return codeLength;
1027 }
slowr13fa5b02017-08-08 16:32:31 -07001028
slowr67d05e42017-08-11 20:37:22 -07001029 public int decode(InputStream is) throws IOException {
1030 return decode(is, true);
1031 }
slowr13fa5b02017-08-08 16:32:31 -07001032
slowr67d05e42017-08-11 20:37:22 -07001033 public int decode(InputStream is, boolean withTag) throws IOException {
1034 int codeLength = 0;
1035 int subCodeLength = 0;
1036 if (withTag) {
1037 codeLength += tag.decodeAndCheck(is);
1038 }
slowr13fa5b02017-08-08 16:32:31 -07001039
slowr67d05e42017-08-11 20:37:22 -07001040 BerLength length = new BerLength();
1041 codeLength += length.decode(is);
1042 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001043
slowr67d05e42017-08-11 20:37:22 -07001044 while (subCodeLength < totalLength) {
1045 BerBitString element = new BerBitString();
1046 subCodeLength += element.decode(is, true);
1047 seqOf.add(element);
1048 }
1049 if (subCodeLength != totalLength) {
1050 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001051
slowr67d05e42017-08-11 20:37:22 -07001052 }
1053 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001054
slowr67d05e42017-08-11 20:37:22 -07001055 return codeLength;
1056 }
slowr13fa5b02017-08-08 16:32:31 -07001057
slowr67d05e42017-08-11 20:37:22 -07001058 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1059 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1060 encode(os, false);
1061 code = os.getArray();
1062 }
slowr13fa5b02017-08-08 16:32:31 -07001063
slowr67d05e42017-08-11 20:37:22 -07001064 public String toString() {
1065 StringBuilder sb = new StringBuilder();
1066 appendAsString(sb, 0);
1067 return sb.toString();
1068 }
1069
1070 public void appendAsString(StringBuilder sb, int indentLevel) {
1071
1072 sb.append("[\n");
1073 for (int i = 0; i < indentLevel + 1; i++) {
1074 sb.append("\t");
1075 }
1076 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -07001077// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001078 } else {
1079 Iterator<BerBitString> it = seqOf.iterator();
1080 if (it.hasNext()) {
1081 sb.append("\"" + it.next() + "\"");
1082 while (it.hasNext()) {
1083 sb.append(",\n");
1084 for (int i = 0; i < indentLevel + 1; i++) {
1085 sb.append("\t");
1086 }
1087 sb.append("\"" + it.next() + "\"");
1088 }
1089 }
1090 }
slowr13fa5b02017-08-08 16:32:31 -07001091
slowr67d05e42017-08-11 20:37:22 -07001092 sb.append("\n");
1093 for (int i = 0; i < indentLevel; i++) {
1094 sb.append("\t");
1095 }
1096 sb.append("]");
1097 }
slowr13fa5b02017-08-08 16:32:31 -07001098
slowr67d05e42017-08-11 20:37:22 -07001099 }
slowr13fa5b02017-08-08 16:32:31 -07001100
slowr67d05e42017-08-11 20:37:22 -07001101 public static class P0UePusch implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -07001102
slowr67d05e42017-08-11 20:37:22 -07001103 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
1104 private static final long serialVersionUID = 1L;
1105 public byte[] code = null;
1106 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -07001107
slowr67d05e42017-08-11 20:37:22 -07001108 public P0UePusch() {
1109 seqOf = new ArrayList<BerInteger>();
1110 }
slowr13fa5b02017-08-08 16:32:31 -07001111
slowr67d05e42017-08-11 20:37:22 -07001112 public P0UePusch(byte[] code) {
1113 this.code = code;
1114 }
slowr13fa5b02017-08-08 16:32:31 -07001115
slowr67d05e42017-08-11 20:37:22 -07001116 public List<BerInteger> getBerInteger() {
1117 if (seqOf == null) {
1118 seqOf = new ArrayList<BerInteger>();
1119 }
1120 return seqOf;
1121 }
slowr13fa5b02017-08-08 16:32:31 -07001122
slowr67d05e42017-08-11 20:37:22 -07001123 public int encode(BerByteArrayOutputStream os) throws IOException {
1124 return encode(os, true);
1125 }
slowr13fa5b02017-08-08 16:32:31 -07001126
slowr67d05e42017-08-11 20:37:22 -07001127 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001128
slowr67d05e42017-08-11 20:37:22 -07001129 if (code != null) {
1130 for (int i = code.length - 1; i >= 0; i--) {
1131 os.write(code[i]);
1132 }
1133 if (withTag) {
1134 return tag.encode(os) + code.length;
1135 }
1136 return code.length;
1137 }
slowr13fa5b02017-08-08 16:32:31 -07001138
slowr67d05e42017-08-11 20:37:22 -07001139 int codeLength = 0;
1140 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1141 codeLength += seqOf.get(i).encode(os, true);
1142 }
slowr13fa5b02017-08-08 16:32:31 -07001143
slowr67d05e42017-08-11 20:37:22 -07001144 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001145
slowr67d05e42017-08-11 20:37:22 -07001146 if (withTag) {
1147 codeLength += tag.encode(os);
1148 }
slowr13fa5b02017-08-08 16:32:31 -07001149
slowr67d05e42017-08-11 20:37:22 -07001150 return codeLength;
1151 }
slowr13fa5b02017-08-08 16:32:31 -07001152
slowr67d05e42017-08-11 20:37:22 -07001153 public int decode(InputStream is) throws IOException {
1154 return decode(is, true);
1155 }
slowr13fa5b02017-08-08 16:32:31 -07001156
slowr67d05e42017-08-11 20:37:22 -07001157 public int decode(InputStream is, boolean withTag) throws IOException {
1158 int codeLength = 0;
1159 int subCodeLength = 0;
1160 if (withTag) {
1161 codeLength += tag.decodeAndCheck(is);
1162 }
slowr13fa5b02017-08-08 16:32:31 -07001163
slowr67d05e42017-08-11 20:37:22 -07001164 BerLength length = new BerLength();
1165 codeLength += length.decode(is);
1166 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001167
slowr67d05e42017-08-11 20:37:22 -07001168 while (subCodeLength < totalLength) {
1169 BerInteger element = new BerInteger();
1170 subCodeLength += element.decode(is, true);
1171 seqOf.add(element);
1172 }
1173 if (subCodeLength != totalLength) {
1174 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001175
slowr67d05e42017-08-11 20:37:22 -07001176 }
1177 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001178
slowr67d05e42017-08-11 20:37:22 -07001179 return codeLength;
1180 }
slowr13fa5b02017-08-08 16:32:31 -07001181
slowr67d05e42017-08-11 20:37:22 -07001182 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1183 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1184 encode(os, false);
1185 code = os.getArray();
1186 }
slowr13fa5b02017-08-08 16:32:31 -07001187
slowr67d05e42017-08-11 20:37:22 -07001188 public String toString() {
1189 StringBuilder sb = new StringBuilder();
1190 appendAsString(sb, 0);
1191 return sb.toString();
1192 }
slowr13fa5b02017-08-08 16:32:31 -07001193
slowr67d05e42017-08-11 20:37:22 -07001194 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -07001195
slowr67d05e42017-08-11 20:37:22 -07001196 sb.append("[\n");
1197 for (int i = 0; i < indentLevel + 1; i++) {
1198 sb.append("\t");
1199 }
1200 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -07001201// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001202 } else {
1203 Iterator<BerInteger> it = seqOf.iterator();
1204 if (it.hasNext()) {
1205 sb.append(it.next());
1206 while (it.hasNext()) {
1207 sb.append(",\n");
1208 for (int i = 0; i < indentLevel + 1; i++) {
1209 sb.append("\t");
1210 }
1211 sb.append(it.next());
1212 }
1213 }
1214 }
slowr13fa5b02017-08-08 16:32:31 -07001215
slowr67d05e42017-08-11 20:37:22 -07001216 sb.append("\n");
1217 for (int i = 0; i < indentLevel; i++) {
1218 sb.append("\t");
1219 }
1220 sb.append("]");
1221 }
slowr13fa5b02017-08-08 16:32:31 -07001222
slowr67d05e42017-08-11 20:37:22 -07001223 }
slowr13fa5b02017-08-08 16:32:31 -07001224
slowr67d05e42017-08-11 20:37:22 -07001225 public static class StartPrbUl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -07001226
slowr67d05e42017-08-11 20:37:22 -07001227 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
1228 private static final long serialVersionUID = 1L;
1229 public byte[] code = null;
1230 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -07001231
slowr67d05e42017-08-11 20:37:22 -07001232 public StartPrbUl() {
1233 seqOf = new ArrayList<BerInteger>();
1234 }
slowr13fa5b02017-08-08 16:32:31 -07001235
slowr67d05e42017-08-11 20:37:22 -07001236 public StartPrbUl(byte[] code) {
1237 this.code = code;
1238 }
slowr13fa5b02017-08-08 16:32:31 -07001239
slowr67d05e42017-08-11 20:37:22 -07001240 public List<BerInteger> getBerInteger() {
1241 if (seqOf == null) {
1242 seqOf = new ArrayList<BerInteger>();
1243 }
1244 return seqOf;
1245 }
slowr13fa5b02017-08-08 16:32:31 -07001246
slowr67d05e42017-08-11 20:37:22 -07001247 public int encode(BerByteArrayOutputStream os) throws IOException {
1248 return encode(os, true);
1249 }
slowr13fa5b02017-08-08 16:32:31 -07001250
slowr67d05e42017-08-11 20:37:22 -07001251 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001252
slowr67d05e42017-08-11 20:37:22 -07001253 if (code != null) {
1254 for (int i = code.length - 1; i >= 0; i--) {
1255 os.write(code[i]);
1256 }
1257 if (withTag) {
1258 return tag.encode(os) + code.length;
1259 }
1260 return code.length;
1261 }
slowr13fa5b02017-08-08 16:32:31 -07001262
slowr67d05e42017-08-11 20:37:22 -07001263 int codeLength = 0;
1264 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1265 codeLength += seqOf.get(i).encode(os, true);
1266 }
slowr13fa5b02017-08-08 16:32:31 -07001267
slowr67d05e42017-08-11 20:37:22 -07001268 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001269
slowr67d05e42017-08-11 20:37:22 -07001270 if (withTag) {
1271 codeLength += tag.encode(os);
1272 }
slowr13fa5b02017-08-08 16:32:31 -07001273
slowr67d05e42017-08-11 20:37:22 -07001274 return codeLength;
1275 }
slowr13fa5b02017-08-08 16:32:31 -07001276
slowr67d05e42017-08-11 20:37:22 -07001277 public int decode(InputStream is) throws IOException {
1278 return decode(is, true);
1279 }
slowr13fa5b02017-08-08 16:32:31 -07001280
slowr67d05e42017-08-11 20:37:22 -07001281 public int decode(InputStream is, boolean withTag) throws IOException {
1282 int codeLength = 0;
1283 int subCodeLength = 0;
1284 if (withTag) {
1285 codeLength += tag.decodeAndCheck(is);
1286 }
slowr13fa5b02017-08-08 16:32:31 -07001287
slowr67d05e42017-08-11 20:37:22 -07001288 BerLength length = new BerLength();
1289 codeLength += length.decode(is);
1290 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001291
slowr67d05e42017-08-11 20:37:22 -07001292 while (subCodeLength < totalLength) {
1293 BerInteger element = new BerInteger();
1294 subCodeLength += element.decode(is, true);
1295 seqOf.add(element);
1296 }
1297 if (subCodeLength != totalLength) {
1298 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001299
slowr67d05e42017-08-11 20:37:22 -07001300 }
1301 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001302
slowr67d05e42017-08-11 20:37:22 -07001303 return codeLength;
1304 }
slowr13fa5b02017-08-08 16:32:31 -07001305
slowr67d05e42017-08-11 20:37:22 -07001306 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1307 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1308 encode(os, false);
1309 code = os.getArray();
1310 }
slowr13fa5b02017-08-08 16:32:31 -07001311
slowr67d05e42017-08-11 20:37:22 -07001312 public String toString() {
1313 StringBuilder sb = new StringBuilder();
1314 appendAsString(sb, 0);
1315 return sb.toString();
1316 }
slowr13fa5b02017-08-08 16:32:31 -07001317
slowr67d05e42017-08-11 20:37:22 -07001318 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -07001319
slowr67d05e42017-08-11 20:37:22 -07001320 sb.append("[\n");
1321 for (int i = 0; i < indentLevel + 1; i++) {
1322 sb.append("\t");
1323 }
1324 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -07001325// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001326 } else {
1327 Iterator<BerInteger> it = seqOf.iterator();
1328 if (it.hasNext()) {
1329 sb.append(it.next());
1330 while (it.hasNext()) {
1331 sb.append(",\n");
1332 for (int i = 0; i < indentLevel + 1; i++) {
1333 sb.append("\t");
1334 }
1335 sb.append(it.next());
1336 }
1337 }
1338 }
slowr13fa5b02017-08-08 16:32:31 -07001339
slowr67d05e42017-08-11 20:37:22 -07001340 sb.append("\n");
1341 for (int i = 0; i < indentLevel; i++) {
1342 sb.append("\t");
1343 }
1344 sb.append("]");
1345 }
slowr13fa5b02017-08-08 16:32:31 -07001346
slowr67d05e42017-08-11 20:37:22 -07001347 public void addBerInteger(BerInteger berInteger) {
1348 seqOf.add(berInteger);
1349 }
1350 }
slowr13fa5b02017-08-08 16:32:31 -07001351
slowr67d05e42017-08-11 20:37:22 -07001352 public static class EndPrbUl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -07001353
slowr67d05e42017-08-11 20:37:22 -07001354 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
1355 private static final long serialVersionUID = 1L;
1356 public byte[] code = null;
1357 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -07001358
slowr67d05e42017-08-11 20:37:22 -07001359 public EndPrbUl() {
1360 seqOf = new ArrayList<BerInteger>();
1361 }
slowr13fa5b02017-08-08 16:32:31 -07001362
slowr67d05e42017-08-11 20:37:22 -07001363 public EndPrbUl(byte[] code) {
1364 this.code = code;
1365 }
slowr13fa5b02017-08-08 16:32:31 -07001366
slowr67d05e42017-08-11 20:37:22 -07001367 public List<BerInteger> getBerInteger() {
1368 if (seqOf == null) {
1369 seqOf = new ArrayList<BerInteger>();
1370 }
1371 return seqOf;
1372 }
slowr13fa5b02017-08-08 16:32:31 -07001373
slowr67d05e42017-08-11 20:37:22 -07001374 public int encode(BerByteArrayOutputStream os) throws IOException {
1375 return encode(os, true);
1376 }
slowr13fa5b02017-08-08 16:32:31 -07001377
slowr67d05e42017-08-11 20:37:22 -07001378 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001379
slowr67d05e42017-08-11 20:37:22 -07001380 if (code != null) {
1381 for (int i = code.length - 1; i >= 0; i--) {
1382 os.write(code[i]);
1383 }
1384 if (withTag) {
1385 return tag.encode(os) + code.length;
1386 }
1387 return code.length;
1388 }
slowr13fa5b02017-08-08 16:32:31 -07001389
slowr67d05e42017-08-11 20:37:22 -07001390 int codeLength = 0;
1391 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1392 codeLength += seqOf.get(i).encode(os, true);
1393 }
slowr13fa5b02017-08-08 16:32:31 -07001394
slowr67d05e42017-08-11 20:37:22 -07001395 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001396
slowr67d05e42017-08-11 20:37:22 -07001397 if (withTag) {
1398 codeLength += tag.encode(os);
1399 }
slowr13fa5b02017-08-08 16:32:31 -07001400
slowr67d05e42017-08-11 20:37:22 -07001401 return codeLength;
1402 }
slowr13fa5b02017-08-08 16:32:31 -07001403
slowr67d05e42017-08-11 20:37:22 -07001404 public int decode(InputStream is) throws IOException {
1405 return decode(is, true);
1406 }
slowr13fa5b02017-08-08 16:32:31 -07001407
slowr67d05e42017-08-11 20:37:22 -07001408 public int decode(InputStream is, boolean withTag) throws IOException {
1409 int codeLength = 0;
1410 int subCodeLength = 0;
1411 if (withTag) {
1412 codeLength += tag.decodeAndCheck(is);
1413 }
slowr13fa5b02017-08-08 16:32:31 -07001414
slowr67d05e42017-08-11 20:37:22 -07001415 BerLength length = new BerLength();
1416 codeLength += length.decode(is);
1417 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001418
slowr67d05e42017-08-11 20:37:22 -07001419 while (subCodeLength < totalLength) {
1420 BerInteger element = new BerInteger();
1421 subCodeLength += element.decode(is, true);
1422 seqOf.add(element);
1423 }
1424 if (subCodeLength != totalLength) {
1425 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001426
slowr67d05e42017-08-11 20:37:22 -07001427 }
1428 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001429
slowr67d05e42017-08-11 20:37:22 -07001430 return codeLength;
1431 }
slowr13fa5b02017-08-08 16:32:31 -07001432
slowr67d05e42017-08-11 20:37:22 -07001433 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1434 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1435 encode(os, false);
1436 code = os.getArray();
1437 }
slowr13fa5b02017-08-08 16:32:31 -07001438
slowr67d05e42017-08-11 20:37:22 -07001439 public String toString() {
1440 StringBuilder sb = new StringBuilder();
1441 appendAsString(sb, 0);
1442 return sb.toString();
1443 }
slowr13fa5b02017-08-08 16:32:31 -07001444
slowr67d05e42017-08-11 20:37:22 -07001445 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -07001446
slowr67d05e42017-08-11 20:37:22 -07001447 sb.append("[\n");
1448 for (int i = 0; i < indentLevel + 1; i++) {
1449 sb.append("\t");
1450 }
1451 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -07001452// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001453 } else {
1454 Iterator<BerInteger> it = seqOf.iterator();
1455 if (it.hasNext()) {
1456 sb.append(it.next());
1457 while (it.hasNext()) {
1458 sb.append(",\n");
1459 for (int i = 0; i < indentLevel + 1; i++) {
1460 sb.append("\t");
1461 }
1462 sb.append(it.next());
1463 }
1464 }
1465 }
slowr13fa5b02017-08-08 16:32:31 -07001466
slowr67d05e42017-08-11 20:37:22 -07001467 sb.append("\n");
1468 for (int i = 0; i < indentLevel; i++) {
1469 sb.append("\t");
1470 }
1471 sb.append("]");
1472 }
slowr13fa5b02017-08-08 16:32:31 -07001473
slowr67d05e42017-08-11 20:37:22 -07001474 public void addBerInteger(BerInteger berInteger) {
1475 seqOf.add(berInteger);
1476 }
1477 }
slowr13fa5b02017-08-08 16:32:31 -07001478
slowr67d05e42017-08-11 20:37:22 -07001479 public static class SubframeBitmaskUl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -07001480
slowr67d05e42017-08-11 20:37:22 -07001481 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
1482 private static final long serialVersionUID = 1L;
1483 public byte[] code = null;
1484 private List<BerBitString> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -07001485
slowr67d05e42017-08-11 20:37:22 -07001486 public SubframeBitmaskUl() {
1487 seqOf = new ArrayList<BerBitString>();
1488 }
slowr13fa5b02017-08-08 16:32:31 -07001489
slowr67d05e42017-08-11 20:37:22 -07001490 public SubframeBitmaskUl(byte[] code) {
1491 this.code = code;
1492 }
slowr13fa5b02017-08-08 16:32:31 -07001493
slowr67d05e42017-08-11 20:37:22 -07001494 public List<BerBitString> getBerBitString() {
1495 if (seqOf == null) {
1496 seqOf = new ArrayList<BerBitString>();
1497 }
1498 return seqOf;
1499 }
slowr13fa5b02017-08-08 16:32:31 -07001500
slowr67d05e42017-08-11 20:37:22 -07001501 public int encode(BerByteArrayOutputStream os) throws IOException {
1502 return encode(os, true);
1503 }
slowr13fa5b02017-08-08 16:32:31 -07001504
slowr67d05e42017-08-11 20:37:22 -07001505 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001506
slowr67d05e42017-08-11 20:37:22 -07001507 if (code != null) {
1508 for (int i = code.length - 1; i >= 0; i--) {
1509 os.write(code[i]);
1510 }
1511 if (withTag) {
1512 return tag.encode(os) + code.length;
1513 }
1514 return code.length;
1515 }
slowr13fa5b02017-08-08 16:32:31 -07001516
slowr67d05e42017-08-11 20:37:22 -07001517 int codeLength = 0;
1518 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1519 codeLength += seqOf.get(i).encode(os, true);
1520 }
slowr13fa5b02017-08-08 16:32:31 -07001521
slowr67d05e42017-08-11 20:37:22 -07001522 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001523
slowr67d05e42017-08-11 20:37:22 -07001524 if (withTag) {
1525 codeLength += tag.encode(os);
1526 }
slowr13fa5b02017-08-08 16:32:31 -07001527
slowr67d05e42017-08-11 20:37:22 -07001528 return codeLength;
1529 }
slowr13fa5b02017-08-08 16:32:31 -07001530
slowr67d05e42017-08-11 20:37:22 -07001531 public int decode(InputStream is) throws IOException {
1532 return decode(is, true);
1533 }
slowr13fa5b02017-08-08 16:32:31 -07001534
slowr67d05e42017-08-11 20:37:22 -07001535 public int decode(InputStream is, boolean withTag) throws IOException {
1536 int codeLength = 0;
1537 int subCodeLength = 0;
1538 if (withTag) {
1539 codeLength += tag.decodeAndCheck(is);
1540 }
slowr13fa5b02017-08-08 16:32:31 -07001541
slowr67d05e42017-08-11 20:37:22 -07001542 BerLength length = new BerLength();
1543 codeLength += length.decode(is);
1544 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001545
slowr67d05e42017-08-11 20:37:22 -07001546 while (subCodeLength < totalLength) {
1547 BerBitString element = new BerBitString();
1548 subCodeLength += element.decode(is, true);
1549 seqOf.add(element);
1550 }
1551 if (subCodeLength != totalLength) {
1552 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001553
slowr67d05e42017-08-11 20:37:22 -07001554 }
1555 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001556
slowr67d05e42017-08-11 20:37:22 -07001557 return codeLength;
1558 }
slowr13fa5b02017-08-08 16:32:31 -07001559
slowr67d05e42017-08-11 20:37:22 -07001560 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1561 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1562 encode(os, false);
1563 code = os.getArray();
1564 }
slowr13fa5b02017-08-08 16:32:31 -07001565
slowr67d05e42017-08-11 20:37:22 -07001566 public String toString() {
1567 StringBuilder sb = new StringBuilder();
1568 appendAsString(sb, 0);
1569 return sb.toString();
1570 }
slowr13fa5b02017-08-08 16:32:31 -07001571
slowr67d05e42017-08-11 20:37:22 -07001572 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -07001573
slowr67d05e42017-08-11 20:37:22 -07001574 sb.append("[\n");
1575 for (int i = 0; i < indentLevel + 1; i++) {
1576 sb.append("\t");
1577 }
1578 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -07001579// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001580 } else {
1581 Iterator<BerBitString> it = seqOf.iterator();
1582 if (it.hasNext()) {
1583 sb.append(it.next());
1584 while (it.hasNext()) {
1585 sb.append(",\n");
1586 for (int i = 0; i < indentLevel + 1; i++) {
1587 sb.append("\t");
1588 }
1589 sb.append(it.next());
1590 }
1591 }
1592 }
slowr13fa5b02017-08-08 16:32:31 -07001593
slowr67d05e42017-08-11 20:37:22 -07001594 sb.append("\n");
1595 for (int i = 0; i < indentLevel; i++) {
1596 sb.append("\t");
1597 }
1598 sb.append("]");
1599 }
slowr13fa5b02017-08-08 16:32:31 -07001600
slowr67d05e42017-08-11 20:37:22 -07001601 }
slowr13fa5b02017-08-08 16:32:31 -07001602
slowr67d05e42017-08-11 20:37:22 -07001603 public static XrancPdu constructPacket(RnibCell cell) {
1604 XrancPduBody body = new XrancPduBody();
1605 body.setRRMConfig(cell.getRrmConfig());
slowr13fa5b02017-08-08 16:32:31 -07001606
slowr67d05e42017-08-11 20:37:22 -07001607 BerUTF8String ver = null;
1608 try {
1609 ver = new BerUTF8String("4");
1610 } catch (UnsupportedEncodingException e) {
1611 e.printStackTrace();
1612 }
slowr13fa5b02017-08-08 16:32:31 -07001613
slowr67d05e42017-08-11 20:37:22 -07001614 XrancApiID apiID = new XrancApiID(26);
1615 XrancPduHdr hdr = new XrancPduHdr();
1616 hdr.setVer(ver);
1617 hdr.setApiId(apiID);
slowr13fa5b02017-08-08 16:32:31 -07001618
slowr67d05e42017-08-11 20:37:22 -07001619 XrancPdu pdu = new XrancPdu();
1620 pdu.setHdr(hdr);
1621 pdu.setBody(body);
1622 return pdu;
1623 }
slowr13fa5b02017-08-08 16:32:31 -07001624
1625}
1626