blob: 4c9bae710e0c1641f60404dda51938a3d992f859 [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;
10import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
11import org.openmuc.jasn1.ber.BerLength;
12import org.openmuc.jasn1.ber.BerTag;
13import org.openmuc.jasn1.ber.types.BerBitString;
14import org.openmuc.jasn1.ber.types.BerInteger;
slowr67d05e42017-08-11 20:37:22 -070015import org.openmuc.jasn1.ber.types.string.BerUTF8String;
16
slowr13fa5b02017-08-08 16:32:31 -070017import java.io.IOException;
18import java.io.InputStream;
19import java.io.Serializable;
slowr67d05e42017-08-11 20:37:22 -070020import java.io.UnsupportedEncodingException;
slowr13fa5b02017-08-08 16:32:31 -070021import java.util.ArrayList;
22import java.util.Iterator;
23import java.util.List;
24
25public class RRMConfig implements Serializable {
26
slowr67d05e42017-08-11 20:37:22 -070027 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
28 private static final long serialVersionUID = 1L;
29 public byte[] code = null;
30 private ECGI ecgi = null;
31 private Crnti crnti = null;
32 private Pa pa = null;
33 private StartPrbDl startPrbDl = null;
34 private EndPrbDl endPrbDl = null;
35 private SubframeBitmaskDl subframeBitmaskDl = null;
36 private P0UePusch p0UePusch = null;
37 private StartPrbUl startPrbUl = null;
38 private EndPrbUl endPrbUl = null;
39 private SubframeBitmaskUl subframeBitmaskUl = null;
slowr13fa5b02017-08-08 16:32:31 -070040
slowr67d05e42017-08-11 20:37:22 -070041 public RRMConfig() {
42 }
slowr13fa5b02017-08-08 16:32:31 -070043
slowr67d05e42017-08-11 20:37:22 -070044 public RRMConfig(byte[] code) {
45 this.code = code;
46 }
slowr13fa5b02017-08-08 16:32:31 -070047
slowr67d05e42017-08-11 20:37:22 -070048 public ECGI getEcgi() {
49 return ecgi;
50 }
slowr13fa5b02017-08-08 16:32:31 -070051
slowr67d05e42017-08-11 20:37:22 -070052 public void setEcgi(ECGI ecgi) {
53 this.ecgi = ecgi;
54 }
slowr13fa5b02017-08-08 16:32:31 -070055
slowr67d05e42017-08-11 20:37:22 -070056 public Crnti getCrnti() {
57 return crnti;
58 }
slowr13fa5b02017-08-08 16:32:31 -070059
slowr67d05e42017-08-11 20:37:22 -070060 public void setCrnti(Crnti crnti) {
61 this.crnti = crnti;
62 }
slowr13fa5b02017-08-08 16:32:31 -070063
slowr67d05e42017-08-11 20:37:22 -070064 public Pa getPa() {
65 return pa;
66 }
slowr13fa5b02017-08-08 16:32:31 -070067
slowr67d05e42017-08-11 20:37:22 -070068 public void setPa(Pa pa) {
69 this.pa = pa;
70 }
slowr13fa5b02017-08-08 16:32:31 -070071
slowr67d05e42017-08-11 20:37:22 -070072 public StartPrbDl getStartPrbDl() {
73 return startPrbDl;
74 }
slowr13fa5b02017-08-08 16:32:31 -070075
slowr67d05e42017-08-11 20:37:22 -070076 public void setStartPrbDl(StartPrbDl startPrbDl) {
77 this.startPrbDl = startPrbDl;
78 }
slowr13fa5b02017-08-08 16:32:31 -070079
slowr67d05e42017-08-11 20:37:22 -070080 public EndPrbDl getEndPrbDl() {
81 return endPrbDl;
82 }
slowr13fa5b02017-08-08 16:32:31 -070083
slowr67d05e42017-08-11 20:37:22 -070084 public void setEndPrbDl(EndPrbDl endPrbDl) {
85 this.endPrbDl = endPrbDl;
86 }
slowr13fa5b02017-08-08 16:32:31 -070087
slowr67d05e42017-08-11 20:37:22 -070088 public SubframeBitmaskDl getSubframeBitmaskDl() {
89 return subframeBitmaskDl;
90 }
slowr13fa5b02017-08-08 16:32:31 -070091
slowr67d05e42017-08-11 20:37:22 -070092 public void setSubframeBitmaskDl(SubframeBitmaskDl subframeBitmaskDl) {
93 this.subframeBitmaskDl = subframeBitmaskDl;
94 }
slowr13fa5b02017-08-08 16:32:31 -070095
slowr67d05e42017-08-11 20:37:22 -070096 public P0UePusch getP0UePusch() {
97 return p0UePusch;
98 }
slowr13fa5b02017-08-08 16:32:31 -070099
slowr67d05e42017-08-11 20:37:22 -0700100 public void setP0UePusch(P0UePusch p0UePusch) {
101 this.p0UePusch = p0UePusch;
102 }
slowr13fa5b02017-08-08 16:32:31 -0700103
slowr67d05e42017-08-11 20:37:22 -0700104 public StartPrbUl getStartPrbUl() {
105 return startPrbUl;
106 }
slowr13fa5b02017-08-08 16:32:31 -0700107
slowr67d05e42017-08-11 20:37:22 -0700108 public void setStartPrbUl(StartPrbUl startPrbUl) {
109 this.startPrbUl = startPrbUl;
110 }
slowr13fa5b02017-08-08 16:32:31 -0700111
slowr67d05e42017-08-11 20:37:22 -0700112 public EndPrbUl getEndPrbUl() {
113 return endPrbUl;
114 }
slowr13fa5b02017-08-08 16:32:31 -0700115
slowr67d05e42017-08-11 20:37:22 -0700116 public void setEndPrbUl(EndPrbUl endPrbUl) {
117 this.endPrbUl = endPrbUl;
118 }
slowr13fa5b02017-08-08 16:32:31 -0700119
slowr67d05e42017-08-11 20:37:22 -0700120 public SubframeBitmaskUl getSubframeBitmaskUl() {
121 return subframeBitmaskUl;
122 }
slowr13fa5b02017-08-08 16:32:31 -0700123
slowr67d05e42017-08-11 20:37:22 -0700124 public void setSubframeBitmaskUl(SubframeBitmaskUl subframeBitmaskUl) {
125 this.subframeBitmaskUl = subframeBitmaskUl;
126 }
slowr13fa5b02017-08-08 16:32:31 -0700127
slowr67d05e42017-08-11 20:37:22 -0700128 public int encode(BerByteArrayOutputStream os) throws IOException {
129 return encode(os, true);
130 }
131
132 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
133
134 if (code != null) {
135 for (int i = code.length - 1; i >= 0; i--) {
136 os.write(code[i]);
137 }
138 if (withTag) {
139 return tag.encode(os) + code.length;
140 }
141 return code.length;
142 }
143
144 int codeLength = 0;
145 if (subframeBitmaskUl != null) {
146 codeLength += subframeBitmaskUl.encode(os, false);
147 // write tag: CONTEXT_CLASS, CONSTRUCTED, 9
148 os.write(0xA9);
149 codeLength += 1;
150 }
151
152 if (endPrbUl != null) {
153 codeLength += endPrbUl.encode(os, false);
154 // write tag: CONTEXT_CLASS, CONSTRUCTED, 8
155 os.write(0xA8);
156 codeLength += 1;
157 }
158
159 if (startPrbUl != null) {
160 codeLength += startPrbUl.encode(os, false);
161 // write tag: CONTEXT_CLASS, CONSTRUCTED, 7
162 os.write(0xA7);
163 codeLength += 1;
164 }
165
166 if (p0UePusch != null) {
167 codeLength += p0UePusch.encode(os, false);
168 // write tag: CONTEXT_CLASS, CONSTRUCTED, 6
169 os.write(0xA6);
170 codeLength += 1;
171 }
172
173 if (subframeBitmaskDl != null) {
174 codeLength += subframeBitmaskDl.encode(os, false);
175 // write tag: CONTEXT_CLASS, CONSTRUCTED, 5
176 os.write(0xA5);
177 codeLength += 1;
178 }
179
180 if (endPrbDl != null) {
181 codeLength += endPrbDl.encode(os, false);
182 // write tag: CONTEXT_CLASS, CONSTRUCTED, 4
183 os.write(0xA4);
184 codeLength += 1;
185 }
186
187 if (startPrbDl != null) {
188 codeLength += startPrbDl.encode(os, false);
189 // write tag: CONTEXT_CLASS, CONSTRUCTED, 3
190 os.write(0xA3);
191 codeLength += 1;
192 }
193
194 if (pa != null) {
195 codeLength += pa.encode(os, false);
196 // write tag: CONTEXT_CLASS, CONSTRUCTED, 2
197 os.write(0xA2);
198 codeLength += 1;
199 }
200
201 if (crnti != null) {
202 codeLength += crnti.encode(os, false);
203 // write tag: CONTEXT_CLASS, CONSTRUCTED, 1
204 os.write(0xA1);
205 codeLength += 1;
206 }
207
208 codeLength += ecgi.encode(os, false);
209 // write tag: CONTEXT_CLASS, CONSTRUCTED, 0
210 os.write(0xA0);
211 codeLength += 1;
212
213 codeLength += BerLength.encodeLength(os, codeLength);
214
215 if (withTag) {
216 codeLength += tag.encode(os);
217 }
218
219 return codeLength;
220
221 }
222
223 public int decode(InputStream is) throws IOException {
224 return decode(is, true);
225 }
226
227 public int decode(InputStream is, boolean withTag) throws IOException {
228 int codeLength = 0;
229 int subCodeLength = 0;
230 BerTag berTag = new BerTag();
231
232 if (withTag) {
233 codeLength += tag.decodeAndCheck(is);
234 }
235
236 BerLength length = new BerLength();
237 codeLength += length.decode(is);
238
239 int totalLength = length.val;
240 codeLength += totalLength;
241
242 subCodeLength += berTag.decode(is);
243 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
244 ecgi = new ECGI();
245 subCodeLength += ecgi.decode(is, false);
246 if (subCodeLength == totalLength) {
247 return codeLength;
248 }
249 subCodeLength += berTag.decode(is);
250 } else {
251 throw new IOException("Tag does not match the mandatory sequence element tag.");
252 }
253
254 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
255 crnti = new Crnti();
256 subCodeLength += crnti.decode(is, false);
257 if (subCodeLength == totalLength) {
258 return codeLength;
259 }
260 subCodeLength += berTag.decode(is);
261 }
262
263 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
264 pa = new Pa();
265 subCodeLength += pa.decode(is, false);
266 if (subCodeLength == totalLength) {
267 return codeLength;
268 }
269 subCodeLength += berTag.decode(is);
270 }
271
272 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) {
273 startPrbDl = new StartPrbDl();
274 subCodeLength += startPrbDl.decode(is, false);
275 if (subCodeLength == totalLength) {
276 return codeLength;
277 }
278 subCodeLength += berTag.decode(is);
279 }
280
281 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
282 endPrbDl = new EndPrbDl();
283 subCodeLength += endPrbDl.decode(is, false);
284 if (subCodeLength == totalLength) {
285 return codeLength;
286 }
287 subCodeLength += berTag.decode(is);
288 }
289
290 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
291 subframeBitmaskDl = new SubframeBitmaskDl();
292 subCodeLength += subframeBitmaskDl.decode(is, false);
293 if (subCodeLength == totalLength) {
294 return codeLength;
295 }
296 subCodeLength += berTag.decode(is);
297 }
298
299 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) {
300 p0UePusch = new P0UePusch();
301 subCodeLength += p0UePusch.decode(is, false);
302 if (subCodeLength == totalLength) {
303 return codeLength;
304 }
305 subCodeLength += berTag.decode(is);
306 }
307
308 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 7)) {
309 startPrbUl = new StartPrbUl();
310 subCodeLength += startPrbUl.decode(is, false);
311 if (subCodeLength == totalLength) {
312 return codeLength;
313 }
314 subCodeLength += berTag.decode(is);
315 }
316
317 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 8)) {
318 endPrbUl = new EndPrbUl();
319 subCodeLength += endPrbUl.decode(is, false);
320 if (subCodeLength == totalLength) {
321 return codeLength;
322 }
323 subCodeLength += berTag.decode(is);
324 }
325
326 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 9)) {
327 subframeBitmaskUl = new SubframeBitmaskUl();
328 subCodeLength += subframeBitmaskUl.decode(is, false);
329 if (subCodeLength == totalLength) {
330 return codeLength;
331 }
332 }
333 throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
334
335
336 }
337
338 public void encodeAndSave(int encodingSizeGuess) throws IOException {
339 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
340 encode(os, false);
341 code = os.getArray();
342 }
343
344 public String toString() {
345 StringBuilder sb = new StringBuilder();
346 appendAsString(sb, 0);
347 return sb.toString();
348 }
349
350 public void appendAsString(StringBuilder sb, int indentLevel) {
351
352 sb.append("{");
353 sb.append("\n");
354 for (int i = 0; i < indentLevel + 1; i++) {
355 sb.append("\t");
356 }
357 if (ecgi != null) {
358 sb.append("\"ecgi\": ");
359 ecgi.appendAsString(sb, indentLevel + 1);
360 }
361
362 if (crnti != null) {
363 sb.append(",\n");
364 for (int i = 0; i < indentLevel + 1; i++) {
365 sb.append("\t");
366 }
367 sb.append("\"crnti\": ");
368 crnti.appendAsString(sb, indentLevel + 1);
369 }
370
371 if (pa != null) {
372 sb.append(",\n");
373 for (int i = 0; i < indentLevel + 1; i++) {
374 sb.append("\t");
375 }
376 sb.append("\"pa\": ");
377 pa.appendAsString(sb, indentLevel + 1);
378 }
379
380 if (startPrbDl != null) {
381 sb.append(",\n");
382 for (int i = 0; i < indentLevel + 1; i++) {
383 sb.append("\t");
384 }
385 sb.append("\"startPrbDl\": ");
386 startPrbDl.appendAsString(sb, indentLevel + 1);
387 }
388
389 if (endPrbDl != null) {
390 sb.append(",\n");
391 for (int i = 0; i < indentLevel + 1; i++) {
392 sb.append("\t");
393 }
394 sb.append("\"endPrbDl\": ");
395 endPrbDl.appendAsString(sb, indentLevel + 1);
396 }
397
398 if (subframeBitmaskDl != null) {
399 sb.append(",\n");
400 for (int i = 0; i < indentLevel + 1; i++) {
401 sb.append("\t");
402 }
403 sb.append("\"subframeBitmaskDl\": ");
404 subframeBitmaskDl.appendAsString(sb, indentLevel + 1);
405 }
406
407 if (p0UePusch != null) {
408 sb.append(",\n");
409 for (int i = 0; i < indentLevel + 1; i++) {
410 sb.append("\t");
411 }
412 sb.append("\"p0UePusch\": ");
413 p0UePusch.appendAsString(sb, indentLevel + 1);
414 }
415
416 if (startPrbUl != null) {
417 sb.append(",\n");
418 for (int i = 0; i < indentLevel + 1; i++) {
419 sb.append("\t");
420 }
421 sb.append("\"startPrbUl\": ");
422 startPrbUl.appendAsString(sb, indentLevel + 1);
423 }
424
425 if (endPrbUl != null) {
426 sb.append(",\n");
427 for (int i = 0; i < indentLevel + 1; i++) {
428 sb.append("\t");
429 }
430 sb.append("\"endPrbUl\": ");
431 endPrbUl.appendAsString(sb, indentLevel + 1);
432 }
433
434 if (subframeBitmaskUl != null) {
435 sb.append(",\n");
436 for (int i = 0; i < indentLevel + 1; i++) {
437 sb.append("\t");
438 }
439 sb.append("\"subframeBitmaskUl\": ");
440 subframeBitmaskUl.appendAsString(sb, indentLevel + 1);
441 }
442
443 sb.append("\n");
444 for (int i = 0; i < indentLevel; i++) {
445 sb.append("\t");
446 }
447 sb.append("}");
448 }
449
450 public static class Crnti implements Serializable {
451
452 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
453 private static final long serialVersionUID = 1L;
454 public byte[] code = null;
455 private List<CRNTI> seqOf = null;
456
457 public Crnti() {
458 seqOf = new ArrayList<CRNTI>();
459 }
460
461 public Crnti(byte[] code) {
462 this.code = code;
463 }
464
465 public List<CRNTI> getCRNTI() {
466 if (seqOf == null) {
467 seqOf = new ArrayList<CRNTI>();
468 }
469 return seqOf;
470 }
471
472 public void addCRNTI(CRNTI crnti) {
473 seqOf.add(crnti);
474 }
475
476 public int encode(BerByteArrayOutputStream os) throws IOException {
477 return encode(os, true);
478 }
479
480 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
481
482 if (code != null) {
483 for (int i = code.length - 1; i >= 0; i--) {
484 os.write(code[i]);
485 }
486 if (withTag) {
487 return tag.encode(os) + code.length;
488 }
489 return code.length;
490 }
491
492 int codeLength = 0;
493 for (int i = (seqOf.size() - 1); i >= 0; i--) {
494 codeLength += seqOf.get(i).encode(os, true);
495 }
496
497 codeLength += BerLength.encodeLength(os, codeLength);
498
499 if (withTag) {
500 codeLength += tag.encode(os);
501 }
502
503 return codeLength;
504 }
505
506 public int decode(InputStream is) throws IOException {
507 return decode(is, true);
508 }
509
510 public int decode(InputStream is, boolean withTag) throws IOException {
511 int codeLength = 0;
512 int subCodeLength = 0;
513 if (withTag) {
514 codeLength += tag.decodeAndCheck(is);
515 }
516
517 BerLength length = new BerLength();
518 codeLength += length.decode(is);
519 int totalLength = length.val;
520
521 while (subCodeLength < totalLength) {
522 CRNTI element = new CRNTI();
523 subCodeLength += element.decode(is, true);
524 seqOf.add(element);
525 }
526 if (subCodeLength != totalLength) {
527 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
528
529 }
530 codeLength += subCodeLength;
531
532 return codeLength;
533 }
534
535 public void encodeAndSave(int encodingSizeGuess) throws IOException {
536 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
537 encode(os, false);
538 code = os.getArray();
539 }
540
541 public String toString() {
542 StringBuilder sb = new StringBuilder();
543 appendAsString(sb, 0);
544 return sb.toString();
545 }
546
547 public void appendAsString(StringBuilder sb, int indentLevel) {
548
549 sb.append("[\n");
550 for (int i = 0; i < indentLevel + 1; i++) {
551 sb.append("\t");
552 }
553 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -0700554// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -0700555 } else {
556 Iterator<CRNTI> it = seqOf.iterator();
557 if (it.hasNext()) {
558 sb.append(it.next());
559 while (it.hasNext()) {
560 sb.append(",\n");
561 for (int i = 0; i < indentLevel + 1; i++) {
562 sb.append("\t");
563 }
564 sb.append(it.next());
565 }
566 }
567 }
slowr13fa5b02017-08-08 16:32:31 -0700568
slowr67d05e42017-08-11 20:37:22 -0700569 sb.append("\n");
570 for (int i = 0; i < indentLevel; i++) {
571 sb.append("\t");
572 }
573 sb.append("]");
574 }
slowr13fa5b02017-08-08 16:32:31 -0700575
slowr67d05e42017-08-11 20:37:22 -0700576 }
slowr13fa5b02017-08-08 16:32:31 -0700577
slowr67d05e42017-08-11 20:37:22 -0700578 public static class Pa implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -0700579
slowr67d05e42017-08-11 20:37:22 -0700580 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
581 private static final long serialVersionUID = 1L;
582 public byte[] code = null;
583 private List<XICICPA> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -0700584
slowr67d05e42017-08-11 20:37:22 -0700585 public Pa() {
586 seqOf = new ArrayList<XICICPA>();
587 }
slowr13fa5b02017-08-08 16:32:31 -0700588
slowr67d05e42017-08-11 20:37:22 -0700589 public Pa(byte[] code) {
590 this.code = code;
591 }
slowr13fa5b02017-08-08 16:32:31 -0700592
slowr67d05e42017-08-11 20:37:22 -0700593 public List<XICICPA> getXICICPA() {
594 if (seqOf == null) {
595 seqOf = new ArrayList<XICICPA>();
596 }
597 return seqOf;
598 }
slowr13fa5b02017-08-08 16:32:31 -0700599
slowr67d05e42017-08-11 20:37:22 -0700600 public int encode(BerByteArrayOutputStream os) throws IOException {
601 return encode(os, true);
602 }
slowr13fa5b02017-08-08 16:32:31 -0700603
slowr67d05e42017-08-11 20:37:22 -0700604 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -0700605
slowr67d05e42017-08-11 20:37:22 -0700606 if (code != null) {
607 for (int i = code.length - 1; i >= 0; i--) {
608 os.write(code[i]);
609 }
610 if (withTag) {
611 return tag.encode(os) + code.length;
612 }
613 return code.length;
614 }
slowr13fa5b02017-08-08 16:32:31 -0700615
slowr67d05e42017-08-11 20:37:22 -0700616 int codeLength = 0;
617 for (int i = (seqOf.size() - 1); i >= 0; i--) {
618 codeLength += seqOf.get(i).encode(os, true);
619 }
slowr13fa5b02017-08-08 16:32:31 -0700620
slowr67d05e42017-08-11 20:37:22 -0700621 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -0700622
slowr67d05e42017-08-11 20:37:22 -0700623 if (withTag) {
624 codeLength += tag.encode(os);
625 }
slowr13fa5b02017-08-08 16:32:31 -0700626
slowr67d05e42017-08-11 20:37:22 -0700627 return codeLength;
628 }
slowr13fa5b02017-08-08 16:32:31 -0700629
slowr67d05e42017-08-11 20:37:22 -0700630 public int decode(InputStream is) throws IOException {
631 return decode(is, true);
632 }
slowr13fa5b02017-08-08 16:32:31 -0700633
slowr67d05e42017-08-11 20:37:22 -0700634 public int decode(InputStream is, boolean withTag) throws IOException {
635 int codeLength = 0;
636 int subCodeLength = 0;
637 if (withTag) {
638 codeLength += tag.decodeAndCheck(is);
639 }
slowr13fa5b02017-08-08 16:32:31 -0700640
slowr67d05e42017-08-11 20:37:22 -0700641 BerLength length = new BerLength();
642 codeLength += length.decode(is);
643 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -0700644
slowr67d05e42017-08-11 20:37:22 -0700645 while (subCodeLength < totalLength) {
646 XICICPA element = new XICICPA();
647 subCodeLength += element.decode(is, true);
648 seqOf.add(element);
649 }
650 if (subCodeLength != totalLength) {
651 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -0700652
slowr67d05e42017-08-11 20:37:22 -0700653 }
654 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -0700655
slowr67d05e42017-08-11 20:37:22 -0700656 return codeLength;
657 }
slowr13fa5b02017-08-08 16:32:31 -0700658
slowr67d05e42017-08-11 20:37:22 -0700659 public void encodeAndSave(int encodingSizeGuess) throws IOException {
660 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
661 encode(os, false);
662 code = os.getArray();
663 }
slowr13fa5b02017-08-08 16:32:31 -0700664
slowr67d05e42017-08-11 20:37:22 -0700665 public String toString() {
666 StringBuilder sb = new StringBuilder();
667 appendAsString(sb, 0);
668 return sb.toString();
669 }
slowr13fa5b02017-08-08 16:32:31 -0700670
slowr67d05e42017-08-11 20:37:22 -0700671 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -0700672
slowr67d05e42017-08-11 20:37:22 -0700673 sb.append("[\n");
674 for (int i = 0; i < indentLevel + 1; i++) {
675 sb.append("\t");
676 }
677 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -0700678// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -0700679 } else {
680 Iterator<XICICPA> it = seqOf.iterator();
681 if (it.hasNext()) {
682 sb.append(it.next());
683 while (it.hasNext()) {
684 sb.append(",\n");
685 for (int i = 0; i < indentLevel + 1; i++) {
686 sb.append("\t");
687 }
688 sb.append(it.next());
689 }
690 }
691 }
slowr13fa5b02017-08-08 16:32:31 -0700692
slowr67d05e42017-08-11 20:37:22 -0700693 sb.append("\n");
694 for (int i = 0; i < indentLevel; i++) {
695 sb.append("\t");
696 }
697 sb.append("]");
698 }
slowr13fa5b02017-08-08 16:32:31 -0700699
slowr67d05e42017-08-11 20:37:22 -0700700 }
slowr13fa5b02017-08-08 16:32:31 -0700701
slowr67d05e42017-08-11 20:37:22 -0700702 public static class StartPrbDl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -0700703
slowr67d05e42017-08-11 20:37:22 -0700704 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
705 private static final long serialVersionUID = 1L;
706 public byte[] code = null;
707 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -0700708
slowr67d05e42017-08-11 20:37:22 -0700709 public StartPrbDl() {
710 seqOf = new ArrayList<BerInteger>();
711 }
slowr13fa5b02017-08-08 16:32:31 -0700712
slowr67d05e42017-08-11 20:37:22 -0700713 public StartPrbDl(byte[] code) {
714 this.code = code;
715 }
slowr13fa5b02017-08-08 16:32:31 -0700716
slowr67d05e42017-08-11 20:37:22 -0700717 public List<BerInteger> getSeqOf() {
718 return seqOf;
719 }
slowr13fa5b02017-08-08 16:32:31 -0700720
slowr67d05e42017-08-11 20:37:22 -0700721 public void setSeqOf(List<BerInteger> seqOf) {
722 this.seqOf = seqOf;
723 }
slowr13fa5b02017-08-08 16:32:31 -0700724
slowr67d05e42017-08-11 20:37:22 -0700725 public List<BerInteger> getBerInteger() {
726 if (seqOf == null) {
727 seqOf = new ArrayList<BerInteger>();
728 }
729 return seqOf;
730 }
slowr13fa5b02017-08-08 16:32:31 -0700731
slowr67d05e42017-08-11 20:37:22 -0700732 public int encode(BerByteArrayOutputStream os) throws IOException {
733 return encode(os, true);
734 }
slowr13fa5b02017-08-08 16:32:31 -0700735
slowr67d05e42017-08-11 20:37:22 -0700736 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -0700737
slowr67d05e42017-08-11 20:37:22 -0700738 if (code != null) {
739 for (int i = code.length - 1; i >= 0; i--) {
740 os.write(code[i]);
741 }
742 if (withTag) {
743 return tag.encode(os) + code.length;
744 }
745 return code.length;
746 }
slowr13fa5b02017-08-08 16:32:31 -0700747
slowr67d05e42017-08-11 20:37:22 -0700748 int codeLength = 0;
749 for (int i = (seqOf.size() - 1); i >= 0; i--) {
750 codeLength += seqOf.get(i).encode(os, true);
751 }
slowr13fa5b02017-08-08 16:32:31 -0700752
slowr67d05e42017-08-11 20:37:22 -0700753 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -0700754
slowr67d05e42017-08-11 20:37:22 -0700755 if (withTag) {
756 codeLength += tag.encode(os);
757 }
slowr13fa5b02017-08-08 16:32:31 -0700758
slowr67d05e42017-08-11 20:37:22 -0700759 return codeLength;
760 }
slowr13fa5b02017-08-08 16:32:31 -0700761
slowr67d05e42017-08-11 20:37:22 -0700762 public int decode(InputStream is) throws IOException {
763 return decode(is, true);
764 }
slowr13fa5b02017-08-08 16:32:31 -0700765
slowr67d05e42017-08-11 20:37:22 -0700766 public int decode(InputStream is, boolean withTag) throws IOException {
767 int codeLength = 0;
768 int subCodeLength = 0;
769 if (withTag) {
770 codeLength += tag.decodeAndCheck(is);
771 }
slowr13fa5b02017-08-08 16:32:31 -0700772
slowr67d05e42017-08-11 20:37:22 -0700773 BerLength length = new BerLength();
774 codeLength += length.decode(is);
775 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -0700776
slowr67d05e42017-08-11 20:37:22 -0700777 while (subCodeLength < totalLength) {
778 BerInteger element = new BerInteger();
779 subCodeLength += element.decode(is, true);
780 seqOf.add(element);
781 }
782 if (subCodeLength != totalLength) {
783 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -0700784
slowr67d05e42017-08-11 20:37:22 -0700785 }
786 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -0700787
slowr67d05e42017-08-11 20:37:22 -0700788 return codeLength;
789 }
slowr13fa5b02017-08-08 16:32:31 -0700790
slowr67d05e42017-08-11 20:37:22 -0700791 public void encodeAndSave(int encodingSizeGuess) throws IOException {
792 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
793 encode(os, false);
794 code = os.getArray();
795 }
slowr13fa5b02017-08-08 16:32:31 -0700796
slowr67d05e42017-08-11 20:37:22 -0700797 public String toString() {
798 StringBuilder sb = new StringBuilder();
799 appendAsString(sb, 0);
800 return sb.toString();
801 }
slowr13fa5b02017-08-08 16:32:31 -0700802
slowr67d05e42017-08-11 20:37:22 -0700803 public void appendAsString(StringBuilder sb, int indentLevel) {
804
805 sb.append("[\n");
806 for (int i = 0; i < indentLevel + 1; i++) {
807 sb.append("\t");
808 }
809 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -0700810// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -0700811 } else {
812 Iterator<BerInteger> it = seqOf.iterator();
813 if (it.hasNext()) {
814 sb.append(it.next());
815 while (it.hasNext()) {
816 sb.append(",\n");
817 for (int i = 0; i < indentLevel + 1; i++) {
818 sb.append("\t");
819 }
820 sb.append(it.next());
821 }
822 }
823 }
slowr13fa5b02017-08-08 16:32:31 -0700824
slowr67d05e42017-08-11 20:37:22 -0700825 sb.append("\n");
826 for (int i = 0; i < indentLevel; i++) {
827 sb.append("\t");
828 }
829 sb.append("]");
830 }
slowr13fa5b02017-08-08 16:32:31 -0700831
slowr67d05e42017-08-11 20:37:22 -0700832 public void addBerInteger(BerInteger berInteger) {
833 seqOf.add(berInteger);
834 }
835 }
slowr13fa5b02017-08-08 16:32:31 -0700836
slowr67d05e42017-08-11 20:37:22 -0700837 public static class EndPrbDl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -0700838
slowr67d05e42017-08-11 20:37:22 -0700839 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
840 private static final long serialVersionUID = 1L;
841 public byte[] code = null;
842 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -0700843
slowr67d05e42017-08-11 20:37:22 -0700844 public EndPrbDl() {
845 seqOf = new ArrayList<BerInteger>();
846 }
slowr13fa5b02017-08-08 16:32:31 -0700847
slowr67d05e42017-08-11 20:37:22 -0700848 public EndPrbDl(byte[] code) {
849 this.code = code;
850 }
slowr13fa5b02017-08-08 16:32:31 -0700851
slowr67d05e42017-08-11 20:37:22 -0700852 public List<BerInteger> getBerInteger() {
853 if (seqOf == null) {
854 seqOf = new ArrayList<BerInteger>();
855 }
856 return seqOf;
857 }
slowr13fa5b02017-08-08 16:32:31 -0700858
slowr67d05e42017-08-11 20:37:22 -0700859 public int encode(BerByteArrayOutputStream os) throws IOException {
860 return encode(os, true);
861 }
slowr13fa5b02017-08-08 16:32:31 -0700862
slowr67d05e42017-08-11 20:37:22 -0700863 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -0700864
slowr67d05e42017-08-11 20:37:22 -0700865 if (code != null) {
866 for (int i = code.length - 1; i >= 0; i--) {
867 os.write(code[i]);
868 }
869 if (withTag) {
870 return tag.encode(os) + code.length;
871 }
872 return code.length;
873 }
slowr13fa5b02017-08-08 16:32:31 -0700874
slowr67d05e42017-08-11 20:37:22 -0700875 int codeLength = 0;
876 for (int i = (seqOf.size() - 1); i >= 0; i--) {
877 codeLength += seqOf.get(i).encode(os, true);
878 }
slowr13fa5b02017-08-08 16:32:31 -0700879
slowr67d05e42017-08-11 20:37:22 -0700880 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -0700881
slowr67d05e42017-08-11 20:37:22 -0700882 if (withTag) {
883 codeLength += tag.encode(os);
884 }
slowr13fa5b02017-08-08 16:32:31 -0700885
slowr67d05e42017-08-11 20:37:22 -0700886 return codeLength;
887 }
slowr13fa5b02017-08-08 16:32:31 -0700888
slowr67d05e42017-08-11 20:37:22 -0700889 public int decode(InputStream is) throws IOException {
890 return decode(is, true);
891 }
slowr13fa5b02017-08-08 16:32:31 -0700892
slowr67d05e42017-08-11 20:37:22 -0700893 public int decode(InputStream is, boolean withTag) throws IOException {
894 int codeLength = 0;
895 int subCodeLength = 0;
896 if (withTag) {
897 codeLength += tag.decodeAndCheck(is);
898 }
slowr13fa5b02017-08-08 16:32:31 -0700899
slowr67d05e42017-08-11 20:37:22 -0700900 BerLength length = new BerLength();
901 codeLength += length.decode(is);
902 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -0700903
slowr67d05e42017-08-11 20:37:22 -0700904 while (subCodeLength < totalLength) {
905 BerInteger element = new BerInteger();
906 subCodeLength += element.decode(is, true);
907 seqOf.add(element);
908 }
909 if (subCodeLength != totalLength) {
910 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -0700911
slowr67d05e42017-08-11 20:37:22 -0700912 }
913 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -0700914
slowr67d05e42017-08-11 20:37:22 -0700915 return codeLength;
916 }
slowr13fa5b02017-08-08 16:32:31 -0700917
slowr67d05e42017-08-11 20:37:22 -0700918 public void encodeAndSave(int encodingSizeGuess) throws IOException {
919 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
920 encode(os, false);
921 code = os.getArray();
922 }
slowr13fa5b02017-08-08 16:32:31 -0700923
slowr67d05e42017-08-11 20:37:22 -0700924 public String toString() {
925 StringBuilder sb = new StringBuilder();
926 appendAsString(sb, 0);
927 return sb.toString();
928 }
slowr13fa5b02017-08-08 16:32:31 -0700929
slowr67d05e42017-08-11 20:37:22 -0700930 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -0700931
slowr67d05e42017-08-11 20:37:22 -0700932 sb.append("[\n");
933 for (int i = 0; i < indentLevel + 1; i++) {
934 sb.append("\t");
935 }
936 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -0700937// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -0700938 } else {
939 Iterator<BerInteger> it = seqOf.iterator();
940 if (it.hasNext()) {
941 sb.append(it.next());
942 while (it.hasNext()) {
943 sb.append(",\n");
944 for (int i = 0; i < indentLevel + 1; i++) {
945 sb.append("\t");
946 }
947 sb.append(it.next());
948 }
949 }
950 }
slowr13fa5b02017-08-08 16:32:31 -0700951
slowr67d05e42017-08-11 20:37:22 -0700952 sb.append("\n");
953 for (int i = 0; i < indentLevel; i++) {
954 sb.append("\t");
955 }
956 sb.append("]");
957 }
slowr13fa5b02017-08-08 16:32:31 -0700958
slowr67d05e42017-08-11 20:37:22 -0700959 public void addBerInteger(BerInteger berInteger) {
960 seqOf.add(berInteger);
961 }
slowr13fa5b02017-08-08 16:32:31 -0700962
slowr67d05e42017-08-11 20:37:22 -0700963 public List<BerInteger> getSeqOf() {
964 return seqOf;
965 }
slowr13fa5b02017-08-08 16:32:31 -0700966
slowr67d05e42017-08-11 20:37:22 -0700967 public void setSeqOf(List<BerInteger> seqOf) {
968 this.seqOf = seqOf;
969 }
970 }
slowr13fa5b02017-08-08 16:32:31 -0700971
slowr67d05e42017-08-11 20:37:22 -0700972 public static class SubframeBitmaskDl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -0700973
slowr67d05e42017-08-11 20:37:22 -0700974 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
975 private static final long serialVersionUID = 1L;
976 public byte[] code = null;
977 private List<BerBitString> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -0700978
slowr67d05e42017-08-11 20:37:22 -0700979 public SubframeBitmaskDl() {
980 seqOf = new ArrayList<BerBitString>();
981 }
slowr13fa5b02017-08-08 16:32:31 -0700982
slowr67d05e42017-08-11 20:37:22 -0700983 public SubframeBitmaskDl(byte[] code) {
984 this.code = code;
985 }
slowr13fa5b02017-08-08 16:32:31 -0700986
slowr67d05e42017-08-11 20:37:22 -0700987 public List<BerBitString> getBerBitString() {
988 if (seqOf == null) {
989 seqOf = new ArrayList<BerBitString>();
990 }
991 return seqOf;
992 }
slowr13fa5b02017-08-08 16:32:31 -0700993
slowr67d05e42017-08-11 20:37:22 -0700994 public void addBerBitString(BerBitString berBitString) {
995 seqOf.add(berBitString);
996 }
slowr13fa5b02017-08-08 16:32:31 -0700997
slowr67d05e42017-08-11 20:37:22 -0700998 public int encode(BerByteArrayOutputStream os) throws IOException {
999 return encode(os, true);
1000 }
slowr13fa5b02017-08-08 16:32:31 -07001001
slowr67d05e42017-08-11 20:37:22 -07001002 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001003
slowr67d05e42017-08-11 20:37:22 -07001004 if (code != null) {
1005 for (int i = code.length - 1; i >= 0; i--) {
1006 os.write(code[i]);
1007 }
1008 if (withTag) {
1009 return tag.encode(os) + code.length;
1010 }
1011 return code.length;
1012 }
slowr13fa5b02017-08-08 16:32:31 -07001013
slowr67d05e42017-08-11 20:37:22 -07001014 int codeLength = 0;
1015 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1016 codeLength += seqOf.get(i).encode(os, true);
1017 }
slowr13fa5b02017-08-08 16:32:31 -07001018
slowr67d05e42017-08-11 20:37:22 -07001019 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001020
slowr67d05e42017-08-11 20:37:22 -07001021 if (withTag) {
1022 codeLength += tag.encode(os);
1023 }
slowr13fa5b02017-08-08 16:32:31 -07001024
slowr67d05e42017-08-11 20:37:22 -07001025 return codeLength;
1026 }
slowr13fa5b02017-08-08 16:32:31 -07001027
slowr67d05e42017-08-11 20:37:22 -07001028 public int decode(InputStream is) throws IOException {
1029 return decode(is, true);
1030 }
slowr13fa5b02017-08-08 16:32:31 -07001031
slowr67d05e42017-08-11 20:37:22 -07001032 public int decode(InputStream is, boolean withTag) throws IOException {
1033 int codeLength = 0;
1034 int subCodeLength = 0;
1035 if (withTag) {
1036 codeLength += tag.decodeAndCheck(is);
1037 }
slowr13fa5b02017-08-08 16:32:31 -07001038
slowr67d05e42017-08-11 20:37:22 -07001039 BerLength length = new BerLength();
1040 codeLength += length.decode(is);
1041 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001042
slowr67d05e42017-08-11 20:37:22 -07001043 while (subCodeLength < totalLength) {
1044 BerBitString element = new BerBitString();
1045 subCodeLength += element.decode(is, true);
1046 seqOf.add(element);
1047 }
1048 if (subCodeLength != totalLength) {
1049 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001050
slowr67d05e42017-08-11 20:37:22 -07001051 }
1052 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001053
slowr67d05e42017-08-11 20:37:22 -07001054 return codeLength;
1055 }
slowr13fa5b02017-08-08 16:32:31 -07001056
slowr67d05e42017-08-11 20:37:22 -07001057 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1058 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1059 encode(os, false);
1060 code = os.getArray();
1061 }
slowr13fa5b02017-08-08 16:32:31 -07001062
slowr67d05e42017-08-11 20:37:22 -07001063 public String toString() {
1064 StringBuilder sb = new StringBuilder();
1065 appendAsString(sb, 0);
1066 return sb.toString();
1067 }
1068
1069 public void appendAsString(StringBuilder sb, int indentLevel) {
1070
1071 sb.append("[\n");
1072 for (int i = 0; i < indentLevel + 1; i++) {
1073 sb.append("\t");
1074 }
1075 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -07001076// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001077 } else {
1078 Iterator<BerBitString> it = seqOf.iterator();
1079 if (it.hasNext()) {
1080 sb.append("\"" + it.next() + "\"");
1081 while (it.hasNext()) {
1082 sb.append(",\n");
1083 for (int i = 0; i < indentLevel + 1; i++) {
1084 sb.append("\t");
1085 }
1086 sb.append("\"" + it.next() + "\"");
1087 }
1088 }
1089 }
slowr13fa5b02017-08-08 16:32:31 -07001090
slowr67d05e42017-08-11 20:37:22 -07001091 sb.append("\n");
1092 for (int i = 0; i < indentLevel; i++) {
1093 sb.append("\t");
1094 }
1095 sb.append("]");
1096 }
slowr13fa5b02017-08-08 16:32:31 -07001097
slowr67d05e42017-08-11 20:37:22 -07001098 }
slowr13fa5b02017-08-08 16:32:31 -07001099
slowr67d05e42017-08-11 20:37:22 -07001100 public static class P0UePusch implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -07001101
slowr67d05e42017-08-11 20:37:22 -07001102 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
1103 private static final long serialVersionUID = 1L;
1104 public byte[] code = null;
1105 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -07001106
slowr67d05e42017-08-11 20:37:22 -07001107 public P0UePusch() {
1108 seqOf = new ArrayList<BerInteger>();
1109 }
slowr13fa5b02017-08-08 16:32:31 -07001110
slowr67d05e42017-08-11 20:37:22 -07001111 public P0UePusch(byte[] code) {
1112 this.code = code;
1113 }
slowr13fa5b02017-08-08 16:32:31 -07001114
slowr67d05e42017-08-11 20:37:22 -07001115 public List<BerInteger> getBerInteger() {
1116 if (seqOf == null) {
1117 seqOf = new ArrayList<BerInteger>();
1118 }
1119 return seqOf;
1120 }
slowr13fa5b02017-08-08 16:32:31 -07001121
slowr67d05e42017-08-11 20:37:22 -07001122 public int encode(BerByteArrayOutputStream os) throws IOException {
1123 return encode(os, true);
1124 }
slowr13fa5b02017-08-08 16:32:31 -07001125
slowr67d05e42017-08-11 20:37:22 -07001126 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001127
slowr67d05e42017-08-11 20:37:22 -07001128 if (code != null) {
1129 for (int i = code.length - 1; i >= 0; i--) {
1130 os.write(code[i]);
1131 }
1132 if (withTag) {
1133 return tag.encode(os) + code.length;
1134 }
1135 return code.length;
1136 }
slowr13fa5b02017-08-08 16:32:31 -07001137
slowr67d05e42017-08-11 20:37:22 -07001138 int codeLength = 0;
1139 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1140 codeLength += seqOf.get(i).encode(os, true);
1141 }
slowr13fa5b02017-08-08 16:32:31 -07001142
slowr67d05e42017-08-11 20:37:22 -07001143 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001144
slowr67d05e42017-08-11 20:37:22 -07001145 if (withTag) {
1146 codeLength += tag.encode(os);
1147 }
slowr13fa5b02017-08-08 16:32:31 -07001148
slowr67d05e42017-08-11 20:37:22 -07001149 return codeLength;
1150 }
slowr13fa5b02017-08-08 16:32:31 -07001151
slowr67d05e42017-08-11 20:37:22 -07001152 public int decode(InputStream is) throws IOException {
1153 return decode(is, true);
1154 }
slowr13fa5b02017-08-08 16:32:31 -07001155
slowr67d05e42017-08-11 20:37:22 -07001156 public int decode(InputStream is, boolean withTag) throws IOException {
1157 int codeLength = 0;
1158 int subCodeLength = 0;
1159 if (withTag) {
1160 codeLength += tag.decodeAndCheck(is);
1161 }
slowr13fa5b02017-08-08 16:32:31 -07001162
slowr67d05e42017-08-11 20:37:22 -07001163 BerLength length = new BerLength();
1164 codeLength += length.decode(is);
1165 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001166
slowr67d05e42017-08-11 20:37:22 -07001167 while (subCodeLength < totalLength) {
1168 BerInteger element = new BerInteger();
1169 subCodeLength += element.decode(is, true);
1170 seqOf.add(element);
1171 }
1172 if (subCodeLength != totalLength) {
1173 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001174
slowr67d05e42017-08-11 20:37:22 -07001175 }
1176 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001177
slowr67d05e42017-08-11 20:37:22 -07001178 return codeLength;
1179 }
slowr13fa5b02017-08-08 16:32:31 -07001180
slowr67d05e42017-08-11 20:37:22 -07001181 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1182 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1183 encode(os, false);
1184 code = os.getArray();
1185 }
slowr13fa5b02017-08-08 16:32:31 -07001186
slowr67d05e42017-08-11 20:37:22 -07001187 public String toString() {
1188 StringBuilder sb = new StringBuilder();
1189 appendAsString(sb, 0);
1190 return sb.toString();
1191 }
slowr13fa5b02017-08-08 16:32:31 -07001192
slowr67d05e42017-08-11 20:37:22 -07001193 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -07001194
slowr67d05e42017-08-11 20:37:22 -07001195 sb.append("[\n");
1196 for (int i = 0; i < indentLevel + 1; i++) {
1197 sb.append("\t");
1198 }
1199 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -07001200// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001201 } else {
1202 Iterator<BerInteger> it = seqOf.iterator();
1203 if (it.hasNext()) {
1204 sb.append(it.next());
1205 while (it.hasNext()) {
1206 sb.append(",\n");
1207 for (int i = 0; i < indentLevel + 1; i++) {
1208 sb.append("\t");
1209 }
1210 sb.append(it.next());
1211 }
1212 }
1213 }
slowr13fa5b02017-08-08 16:32:31 -07001214
slowr67d05e42017-08-11 20:37:22 -07001215 sb.append("\n");
1216 for (int i = 0; i < indentLevel; i++) {
1217 sb.append("\t");
1218 }
1219 sb.append("]");
1220 }
slowr13fa5b02017-08-08 16:32:31 -07001221
slowr67d05e42017-08-11 20:37:22 -07001222 }
slowr13fa5b02017-08-08 16:32:31 -07001223
slowr67d05e42017-08-11 20:37:22 -07001224 public static class StartPrbUl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -07001225
slowr67d05e42017-08-11 20:37:22 -07001226 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
1227 private static final long serialVersionUID = 1L;
1228 public byte[] code = null;
1229 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -07001230
slowr67d05e42017-08-11 20:37:22 -07001231 public StartPrbUl() {
1232 seqOf = new ArrayList<BerInteger>();
1233 }
slowr13fa5b02017-08-08 16:32:31 -07001234
slowr67d05e42017-08-11 20:37:22 -07001235 public StartPrbUl(byte[] code) {
1236 this.code = code;
1237 }
slowr13fa5b02017-08-08 16:32:31 -07001238
slowr67d05e42017-08-11 20:37:22 -07001239 public List<BerInteger> getBerInteger() {
1240 if (seqOf == null) {
1241 seqOf = new ArrayList<BerInteger>();
1242 }
1243 return seqOf;
1244 }
slowr13fa5b02017-08-08 16:32:31 -07001245
slowr67d05e42017-08-11 20:37:22 -07001246 public int encode(BerByteArrayOutputStream os) throws IOException {
1247 return encode(os, true);
1248 }
slowr13fa5b02017-08-08 16:32:31 -07001249
slowr67d05e42017-08-11 20:37:22 -07001250 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001251
slowr67d05e42017-08-11 20:37:22 -07001252 if (code != null) {
1253 for (int i = code.length - 1; i >= 0; i--) {
1254 os.write(code[i]);
1255 }
1256 if (withTag) {
1257 return tag.encode(os) + code.length;
1258 }
1259 return code.length;
1260 }
slowr13fa5b02017-08-08 16:32:31 -07001261
slowr67d05e42017-08-11 20:37:22 -07001262 int codeLength = 0;
1263 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1264 codeLength += seqOf.get(i).encode(os, true);
1265 }
slowr13fa5b02017-08-08 16:32:31 -07001266
slowr67d05e42017-08-11 20:37:22 -07001267 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001268
slowr67d05e42017-08-11 20:37:22 -07001269 if (withTag) {
1270 codeLength += tag.encode(os);
1271 }
slowr13fa5b02017-08-08 16:32:31 -07001272
slowr67d05e42017-08-11 20:37:22 -07001273 return codeLength;
1274 }
slowr13fa5b02017-08-08 16:32:31 -07001275
slowr67d05e42017-08-11 20:37:22 -07001276 public int decode(InputStream is) throws IOException {
1277 return decode(is, true);
1278 }
slowr13fa5b02017-08-08 16:32:31 -07001279
slowr67d05e42017-08-11 20:37:22 -07001280 public int decode(InputStream is, boolean withTag) throws IOException {
1281 int codeLength = 0;
1282 int subCodeLength = 0;
1283 if (withTag) {
1284 codeLength += tag.decodeAndCheck(is);
1285 }
slowr13fa5b02017-08-08 16:32:31 -07001286
slowr67d05e42017-08-11 20:37:22 -07001287 BerLength length = new BerLength();
1288 codeLength += length.decode(is);
1289 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001290
slowr67d05e42017-08-11 20:37:22 -07001291 while (subCodeLength < totalLength) {
1292 BerInteger element = new BerInteger();
1293 subCodeLength += element.decode(is, true);
1294 seqOf.add(element);
1295 }
1296 if (subCodeLength != totalLength) {
1297 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001298
slowr67d05e42017-08-11 20:37:22 -07001299 }
1300 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001301
slowr67d05e42017-08-11 20:37:22 -07001302 return codeLength;
1303 }
slowr13fa5b02017-08-08 16:32:31 -07001304
slowr67d05e42017-08-11 20:37:22 -07001305 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1306 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1307 encode(os, false);
1308 code = os.getArray();
1309 }
slowr13fa5b02017-08-08 16:32:31 -07001310
slowr67d05e42017-08-11 20:37:22 -07001311 public String toString() {
1312 StringBuilder sb = new StringBuilder();
1313 appendAsString(sb, 0);
1314 return sb.toString();
1315 }
slowr13fa5b02017-08-08 16:32:31 -07001316
slowr67d05e42017-08-11 20:37:22 -07001317 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -07001318
slowr67d05e42017-08-11 20:37:22 -07001319 sb.append("[\n");
1320 for (int i = 0; i < indentLevel + 1; i++) {
1321 sb.append("\t");
1322 }
1323 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -07001324// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001325 } else {
1326 Iterator<BerInteger> it = seqOf.iterator();
1327 if (it.hasNext()) {
1328 sb.append(it.next());
1329 while (it.hasNext()) {
1330 sb.append(",\n");
1331 for (int i = 0; i < indentLevel + 1; i++) {
1332 sb.append("\t");
1333 }
1334 sb.append(it.next());
1335 }
1336 }
1337 }
slowr13fa5b02017-08-08 16:32:31 -07001338
slowr67d05e42017-08-11 20:37:22 -07001339 sb.append("\n");
1340 for (int i = 0; i < indentLevel; i++) {
1341 sb.append("\t");
1342 }
1343 sb.append("]");
1344 }
slowr13fa5b02017-08-08 16:32:31 -07001345
slowr67d05e42017-08-11 20:37:22 -07001346 public void addBerInteger(BerInteger berInteger) {
1347 seqOf.add(berInteger);
1348 }
slowr8ddc2b12017-08-14 14:13:38 -07001349
1350 public List<BerInteger> getSeqOf() {
1351 return seqOf;
1352 }
1353
1354 public void setSeqOf(List<BerInteger> seqOf) {
1355 this.seqOf = seqOf;
1356 }
slowr67d05e42017-08-11 20:37:22 -07001357 }
slowr13fa5b02017-08-08 16:32:31 -07001358
slowr67d05e42017-08-11 20:37:22 -07001359 public static class EndPrbUl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -07001360
slowr67d05e42017-08-11 20:37:22 -07001361 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
1362 private static final long serialVersionUID = 1L;
1363 public byte[] code = null;
1364 private List<BerInteger> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -07001365
slowr67d05e42017-08-11 20:37:22 -07001366 public EndPrbUl() {
1367 seqOf = new ArrayList<BerInteger>();
1368 }
slowr13fa5b02017-08-08 16:32:31 -07001369
slowr67d05e42017-08-11 20:37:22 -07001370 public EndPrbUl(byte[] code) {
1371 this.code = code;
1372 }
slowr13fa5b02017-08-08 16:32:31 -07001373
slowr67d05e42017-08-11 20:37:22 -07001374 public List<BerInteger> getBerInteger() {
1375 if (seqOf == null) {
1376 seqOf = new ArrayList<BerInteger>();
1377 }
1378 return seqOf;
1379 }
slowr13fa5b02017-08-08 16:32:31 -07001380
slowr67d05e42017-08-11 20:37:22 -07001381 public int encode(BerByteArrayOutputStream os) throws IOException {
1382 return encode(os, true);
1383 }
slowr13fa5b02017-08-08 16:32:31 -07001384
slowr67d05e42017-08-11 20:37:22 -07001385 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001386
slowr67d05e42017-08-11 20:37:22 -07001387 if (code != null) {
1388 for (int i = code.length - 1; i >= 0; i--) {
1389 os.write(code[i]);
1390 }
1391 if (withTag) {
1392 return tag.encode(os) + code.length;
1393 }
1394 return code.length;
1395 }
slowr13fa5b02017-08-08 16:32:31 -07001396
slowr67d05e42017-08-11 20:37:22 -07001397 int codeLength = 0;
1398 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1399 codeLength += seqOf.get(i).encode(os, true);
1400 }
slowr13fa5b02017-08-08 16:32:31 -07001401
slowr67d05e42017-08-11 20:37:22 -07001402 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001403
slowr67d05e42017-08-11 20:37:22 -07001404 if (withTag) {
1405 codeLength += tag.encode(os);
1406 }
slowr13fa5b02017-08-08 16:32:31 -07001407
slowr67d05e42017-08-11 20:37:22 -07001408 return codeLength;
1409 }
slowr13fa5b02017-08-08 16:32:31 -07001410
slowr67d05e42017-08-11 20:37:22 -07001411 public int decode(InputStream is) throws IOException {
1412 return decode(is, true);
1413 }
slowr13fa5b02017-08-08 16:32:31 -07001414
slowr67d05e42017-08-11 20:37:22 -07001415 public int decode(InputStream is, boolean withTag) throws IOException {
1416 int codeLength = 0;
1417 int subCodeLength = 0;
1418 if (withTag) {
1419 codeLength += tag.decodeAndCheck(is);
1420 }
slowr13fa5b02017-08-08 16:32:31 -07001421
slowr67d05e42017-08-11 20:37:22 -07001422 BerLength length = new BerLength();
1423 codeLength += length.decode(is);
1424 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001425
slowr67d05e42017-08-11 20:37:22 -07001426 while (subCodeLength < totalLength) {
1427 BerInteger element = new BerInteger();
1428 subCodeLength += element.decode(is, true);
1429 seqOf.add(element);
1430 }
1431 if (subCodeLength != totalLength) {
1432 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001433
slowr67d05e42017-08-11 20:37:22 -07001434 }
1435 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001436
slowr67d05e42017-08-11 20:37:22 -07001437 return codeLength;
1438 }
slowr13fa5b02017-08-08 16:32:31 -07001439
slowr67d05e42017-08-11 20:37:22 -07001440 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1441 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1442 encode(os, false);
1443 code = os.getArray();
1444 }
slowr13fa5b02017-08-08 16:32:31 -07001445
slowr67d05e42017-08-11 20:37:22 -07001446 public String toString() {
1447 StringBuilder sb = new StringBuilder();
1448 appendAsString(sb, 0);
1449 return sb.toString();
1450 }
slowr13fa5b02017-08-08 16:32:31 -07001451
slowr67d05e42017-08-11 20:37:22 -07001452 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -07001453
slowr67d05e42017-08-11 20:37:22 -07001454 sb.append("[\n");
1455 for (int i = 0; i < indentLevel + 1; i++) {
1456 sb.append("\t");
1457 }
1458 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -07001459// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001460 } else {
1461 Iterator<BerInteger> it = seqOf.iterator();
1462 if (it.hasNext()) {
1463 sb.append(it.next());
1464 while (it.hasNext()) {
1465 sb.append(",\n");
1466 for (int i = 0; i < indentLevel + 1; i++) {
1467 sb.append("\t");
1468 }
1469 sb.append(it.next());
1470 }
1471 }
1472 }
slowr13fa5b02017-08-08 16:32:31 -07001473
slowr67d05e42017-08-11 20:37:22 -07001474 sb.append("\n");
1475 for (int i = 0; i < indentLevel; i++) {
1476 sb.append("\t");
1477 }
1478 sb.append("]");
1479 }
slowr13fa5b02017-08-08 16:32:31 -07001480
slowr67d05e42017-08-11 20:37:22 -07001481 public void addBerInteger(BerInteger berInteger) {
1482 seqOf.add(berInteger);
1483 }
slowr8ddc2b12017-08-14 14:13:38 -07001484
1485 public List<BerInteger> getSeqOf() {
1486 return seqOf;
1487 }
1488
1489 public void setSeqOf(List<BerInteger> seqOf) {
1490 this.seqOf = seqOf;
1491 }
slowr67d05e42017-08-11 20:37:22 -07001492 }
slowr13fa5b02017-08-08 16:32:31 -07001493
slowr67d05e42017-08-11 20:37:22 -07001494 public static class SubframeBitmaskUl implements Serializable {
slowr13fa5b02017-08-08 16:32:31 -07001495
slowr67d05e42017-08-11 20:37:22 -07001496 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
1497 private static final long serialVersionUID = 1L;
1498 public byte[] code = null;
1499 private List<BerBitString> seqOf = null;
slowr13fa5b02017-08-08 16:32:31 -07001500
slowr67d05e42017-08-11 20:37:22 -07001501 public SubframeBitmaskUl() {
1502 seqOf = new ArrayList<BerBitString>();
1503 }
slowr13fa5b02017-08-08 16:32:31 -07001504
slowr67d05e42017-08-11 20:37:22 -07001505 public SubframeBitmaskUl(byte[] code) {
1506 this.code = code;
1507 }
slowr13fa5b02017-08-08 16:32:31 -07001508
slowr67d05e42017-08-11 20:37:22 -07001509 public List<BerBitString> getBerBitString() {
1510 if (seqOf == null) {
1511 seqOf = new ArrayList<BerBitString>();
1512 }
1513 return seqOf;
1514 }
slowr13fa5b02017-08-08 16:32:31 -07001515
slowr67d05e42017-08-11 20:37:22 -07001516 public int encode(BerByteArrayOutputStream os) throws IOException {
1517 return encode(os, true);
1518 }
slowr13fa5b02017-08-08 16:32:31 -07001519
slowr67d05e42017-08-11 20:37:22 -07001520 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
slowr13fa5b02017-08-08 16:32:31 -07001521
slowr67d05e42017-08-11 20:37:22 -07001522 if (code != null) {
1523 for (int i = code.length - 1; i >= 0; i--) {
1524 os.write(code[i]);
1525 }
1526 if (withTag) {
1527 return tag.encode(os) + code.length;
1528 }
1529 return code.length;
1530 }
slowr13fa5b02017-08-08 16:32:31 -07001531
slowr67d05e42017-08-11 20:37:22 -07001532 int codeLength = 0;
1533 for (int i = (seqOf.size() - 1); i >= 0; i--) {
1534 codeLength += seqOf.get(i).encode(os, true);
1535 }
slowr13fa5b02017-08-08 16:32:31 -07001536
slowr67d05e42017-08-11 20:37:22 -07001537 codeLength += BerLength.encodeLength(os, codeLength);
slowr13fa5b02017-08-08 16:32:31 -07001538
slowr67d05e42017-08-11 20:37:22 -07001539 if (withTag) {
1540 codeLength += tag.encode(os);
1541 }
slowr13fa5b02017-08-08 16:32:31 -07001542
slowr67d05e42017-08-11 20:37:22 -07001543 return codeLength;
1544 }
slowr13fa5b02017-08-08 16:32:31 -07001545
slowr67d05e42017-08-11 20:37:22 -07001546 public int decode(InputStream is) throws IOException {
1547 return decode(is, true);
1548 }
slowr13fa5b02017-08-08 16:32:31 -07001549
slowr67d05e42017-08-11 20:37:22 -07001550 public int decode(InputStream is, boolean withTag) throws IOException {
1551 int codeLength = 0;
1552 int subCodeLength = 0;
1553 if (withTag) {
1554 codeLength += tag.decodeAndCheck(is);
1555 }
slowr13fa5b02017-08-08 16:32:31 -07001556
slowr67d05e42017-08-11 20:37:22 -07001557 BerLength length = new BerLength();
1558 codeLength += length.decode(is);
1559 int totalLength = length.val;
slowr13fa5b02017-08-08 16:32:31 -07001560
slowr67d05e42017-08-11 20:37:22 -07001561 while (subCodeLength < totalLength) {
1562 BerBitString element = new BerBitString();
1563 subCodeLength += element.decode(is, true);
1564 seqOf.add(element);
1565 }
1566 if (subCodeLength != totalLength) {
1567 throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
slowr13fa5b02017-08-08 16:32:31 -07001568
slowr67d05e42017-08-11 20:37:22 -07001569 }
1570 codeLength += subCodeLength;
slowr13fa5b02017-08-08 16:32:31 -07001571
slowr67d05e42017-08-11 20:37:22 -07001572 return codeLength;
1573 }
slowr13fa5b02017-08-08 16:32:31 -07001574
slowr67d05e42017-08-11 20:37:22 -07001575 public void encodeAndSave(int encodingSizeGuess) throws IOException {
1576 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
1577 encode(os, false);
1578 code = os.getArray();
1579 }
slowr13fa5b02017-08-08 16:32:31 -07001580
slowr67d05e42017-08-11 20:37:22 -07001581 public String toString() {
1582 StringBuilder sb = new StringBuilder();
1583 appendAsString(sb, 0);
1584 return sb.toString();
1585 }
slowr13fa5b02017-08-08 16:32:31 -07001586
slowr67d05e42017-08-11 20:37:22 -07001587 public void appendAsString(StringBuilder sb, int indentLevel) {
slowr13fa5b02017-08-08 16:32:31 -07001588
slowr67d05e42017-08-11 20:37:22 -07001589 sb.append("[\n");
1590 for (int i = 0; i < indentLevel + 1; i++) {
1591 sb.append("\t");
1592 }
1593 if (seqOf == null) {
slowr13fa5b02017-08-08 16:32:31 -07001594// sb.append("null");
slowr67d05e42017-08-11 20:37:22 -07001595 } else {
1596 Iterator<BerBitString> it = seqOf.iterator();
1597 if (it.hasNext()) {
1598 sb.append(it.next());
1599 while (it.hasNext()) {
1600 sb.append(",\n");
1601 for (int i = 0; i < indentLevel + 1; i++) {
1602 sb.append("\t");
1603 }
1604 sb.append(it.next());
1605 }
1606 }
1607 }
slowr13fa5b02017-08-08 16:32:31 -07001608
slowr67d05e42017-08-11 20:37:22 -07001609 sb.append("\n");
1610 for (int i = 0; i < indentLevel; i++) {
1611 sb.append("\t");
1612 }
1613 sb.append("]");
1614 }
slowr13fa5b02017-08-08 16:32:31 -07001615
slowr67d05e42017-08-11 20:37:22 -07001616 }
slowr13fa5b02017-08-08 16:32:31 -07001617
slowr8ddc2b12017-08-14 14:13:38 -07001618 public static XrancPdu constructPacket(RRMConfig config) {
slowr67d05e42017-08-11 20:37:22 -07001619 XrancPduBody body = new XrancPduBody();
slowr8ddc2b12017-08-14 14:13:38 -07001620 body.setRRMConfig(config);
slowr13fa5b02017-08-08 16:32:31 -07001621
slowr67d05e42017-08-11 20:37:22 -07001622 BerUTF8String ver = null;
1623 try {
slowr8ddc2b12017-08-14 14:13:38 -07001624 ver = new BerUTF8String("3");
slowr67d05e42017-08-11 20:37:22 -07001625 } catch (UnsupportedEncodingException e) {
1626 e.printStackTrace();
1627 }
slowr13fa5b02017-08-08 16:32:31 -07001628
slowr8ddc2b12017-08-14 14:13:38 -07001629 XrancApiID apiID = new XrancApiID(29);
slowr67d05e42017-08-11 20:37:22 -07001630 XrancPduHdr hdr = new XrancPduHdr();
1631 hdr.setVer(ver);
1632 hdr.setApiId(apiID);
slowr13fa5b02017-08-08 16:32:31 -07001633
slowr67d05e42017-08-11 20:37:22 -07001634 XrancPdu pdu = new XrancPdu();
1635 pdu.setHdr(hdr);
1636 pdu.setBody(body);
1637 return pdu;
1638 }
slowr13fa5b02017-08-08 16:32:31 -07001639
1640}
1641