A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-rrc-header.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Lluis Parcerisa <lparcerisa@cttc.cat>
7 * Modified by:
8 * Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015)
9 * Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
10 */
11
12#include "lte-rrc-header.h"
13
14#include "ns3/log.h"
15
16#include <sstream>
17#include <stdio.h>
18
19#define MAX_DRB 11 // According to section 6.4 3GPP TS 36.331
20#define MAX_EARFCN 262143
21#define MAX_RAT_CAPABILITIES 8
22#define MAX_SI_MESSAGE 32
23#define MAX_SIB 32
24
25#define MAX_REPORT_CONFIG_ID 32
26#define MAX_OBJECT_ID 32
27#define MAX_MEAS_ID 32
28#define MAX_CELL_MEAS 32
29#define MAX_CELL_REPORT 8
30
31#define MAX_SCELL_REPORT 5
32#define MAX_SCELL_CONF 5
33
34namespace ns3
35{
36
37NS_LOG_COMPONENT_DEFINE("RrcHeader");
38
39//////////////////// RrcAsn1Header class ///////////////////////////////
43
46{
47 static TypeId tid = TypeId("ns3::RrcAsn1Header").SetParent<Header>().SetGroupName("Lte");
48 return tid;
49}
50
53{
54 return GetTypeId();
55}
56
57int
62
63int
64RrcAsn1Header::BandwidthToEnum(uint16_t bandwidth) const
65{
66 int n;
67 switch (bandwidth)
68 {
69 case 6:
70 n = 0;
71 break;
72 case 15:
73 n = 1;
74 break;
75 case 25:
76 n = 2;
77 break;
78 case 50:
79 n = 3;
80 break;
81 case 75:
82 n = 4;
83 break;
84 case 100:
85 n = 5;
86 break;
87 default:
88 NS_FATAL_ERROR("Wrong bandwidth: " << bandwidth);
89 }
90 return n;
91}
92
93uint16_t
95{
96 uint16_t bw;
97 switch (n)
98 {
99 case 0:
100 bw = 6;
101 break;
102 case 1:
103 bw = 15;
104 break;
105 case 2:
106 bw = 25;
107 break;
108 case 3:
109 bw = 50;
110 break;
111 case 4:
112 bw = 75;
113 break;
114 case 5:
115 bw = 100;
116 break;
117 default:
118 NS_FATAL_ERROR("Wrong enum value for bandwidth: " << n);
119 }
120 return bw;
121}
122
123void
124RrcAsn1Header::SerializeDrbToAddModList(std::list<LteRrcSap::DrbToAddMod> drbToAddModList) const
125{
126 // Serialize DRB-ToAddModList sequence-of
127 SerializeSequenceOf(drbToAddModList.size(), MAX_DRB, 1);
128
129 // Serialize the elements in the sequence-of list
130 auto it = drbToAddModList.begin();
131 for (; it != drbToAddModList.end(); it++)
132 {
133 // Serialize DRB-ToAddMod sequence
134 // 5 optional fields. Extension marker is present.
135 std::bitset<5> drbToAddModListOptionalFieldsPresent = std::bitset<5>();
136 drbToAddModListOptionalFieldsPresent.set(4, true); // eps-BearerIdentity present
137 drbToAddModListOptionalFieldsPresent.set(3, false); // pdcp-Config not present
138 drbToAddModListOptionalFieldsPresent.set(2, true); // rlc-Config present
139 drbToAddModListOptionalFieldsPresent.set(1, true); // logicalChannelIdentity present
140 drbToAddModListOptionalFieldsPresent.set(0, true); // logicalChannelConfig present
141 SerializeSequence(drbToAddModListOptionalFieldsPresent, true);
142
143 // Serialize eps-BearerIdentity::=INTEGER (0..15)
144 SerializeInteger(it->epsBearerIdentity, 0, 15);
145
146 // Serialize drb-Identity ::= INTEGER (1..32)
147 SerializeInteger(it->drbIdentity, 1, 32);
148
149 switch (it->rlcConfig.choice)
150 {
152 // Serialize rlc-Config choice
153 SerializeChoice(4, 1, true);
154
155 // Serialize UL-UM-RLC
156 SerializeSequence(std::bitset<0>(), false);
157 SerializeEnum(2, 0); // sn-FieldLength
158
159 // Serialize DL-UM-RLC
160 SerializeSequence(std::bitset<0>(), false);
161 SerializeEnum(2, 0); // sn-FieldLength
162 SerializeEnum(32, 0); // t-Reordering
163 break;
164
166 // Serialize rlc-Config choice
167 SerializeChoice(4, 2, true);
168
169 // Serialize UL-UM-RLC
170 SerializeSequence(std::bitset<0>(), false);
171 SerializeEnum(2, 0); // sn-FieldLength
172 break;
173
175 // Serialize rlc-Config choice
176 SerializeChoice(4, 3, true);
177
178 // Serialize DL-UM-RLC
179 SerializeSequence(std::bitset<0>(), false);
180 SerializeEnum(2, 0); // sn-FieldLength
181 SerializeEnum(32, 0); // t-Reordering
182 break;
183
185 default:
186 // Serialize rlc-Config choice
187 SerializeChoice(4, 0, true);
188
189 // Serialize UL-AM-RLC
190 SerializeSequence(std::bitset<0>(), false);
191 SerializeEnum(64, 0); // t-PollRetransmit
192 SerializeEnum(8, 0); // pollPDU
193 SerializeEnum(16, 0); // pollByte
194 SerializeEnum(8, 0); // maxRetxThreshold
195
196 // Serialize DL-AM-RLC
197 SerializeSequence(std::bitset<0>(), false);
198 SerializeEnum(32, 0); // t-Reordering
199 SerializeEnum(64, 0); // t-StatusProhibit
200 break;
201 }
202
203 // Serialize logicalChannelIdentity ::=INTEGER (3..10)
204 SerializeInteger(it->logicalChannelIdentity, 3, 10);
205
206 // Serialize logicalChannelConfig
207 SerializeLogicalChannelConfig(it->logicalChannelConfig);
208 }
209}
210
211void
212RrcAsn1Header::SerializeSrbToAddModList(std::list<LteRrcSap::SrbToAddMod> srbToAddModList) const
213{
214 // Serialize SRB-ToAddModList ::= SEQUENCE (SIZE (1..2)) OF SRB-ToAddMod
215 SerializeSequenceOf(srbToAddModList.size(), 2, 1);
216
217 // Serialize the elements in the sequence-of list
218 auto it = srbToAddModList.begin();
219 for (; it != srbToAddModList.end(); it++)
220 {
221 // Serialize SRB-ToAddMod sequence
222 // 2 optional fields. Extension marker is present.
223 std::bitset<2> srbToAddModListOptionalFieldsPresent = std::bitset<2>();
224 srbToAddModListOptionalFieldsPresent.set(1, false); // rlc-Config not present
225 srbToAddModListOptionalFieldsPresent.set(0, true); // logicalChannelConfig present
226 SerializeSequence(srbToAddModListOptionalFieldsPresent, true);
227
228 // Serialize srb-Identity ::= INTEGER (1..2)
229 SerializeInteger(it->srbIdentity, 1, 2);
230
231 // Serialize logicalChannelConfig choice
232 // 2 options, selected option 0 (var "explicitValue", of type LogicalChannelConfig)
233 SerializeChoice(2, 0, false);
234
235 // Serialize LogicalChannelConfig
236 SerializeLogicalChannelConfig(it->logicalChannelConfig);
237 }
238}
239
240void
242 LteRrcSap::LogicalChannelConfig logicalChannelConfig) const
243{
244 // Serialize LogicalChannelConfig sequence
245 // 1 optional field (ul-SpecificParameters), which is present. Extension marker present.
246 SerializeSequence(std::bitset<1>(1), true);
247
248 // Serialize ul-SpecificParameters sequence
249 // 1 optional field (logicalChannelGroup), which is present. No extension marker.
250 SerializeSequence(std::bitset<1>(1), false);
251
252 // Serialize priority ::= INTEGER (1..16)
253 SerializeInteger(logicalChannelConfig.priority, 1, 16);
254
255 // Serialize prioritisedBitRate
256 int prioritizedBitRate;
257 switch (logicalChannelConfig.prioritizedBitRateKbps)
258 {
259 case 0:
260 prioritizedBitRate = 0;
261 break;
262 case 8:
263 prioritizedBitRate = 1;
264 break;
265 case 16:
266 prioritizedBitRate = 2;
267 break;
268 case 32:
269 prioritizedBitRate = 3;
270 break;
271 case 64:
272 prioritizedBitRate = 4;
273 break;
274 case 128:
275 prioritizedBitRate = 5;
276 break;
277 case 256:
278 prioritizedBitRate = 6;
279 break;
280 default:
281 prioritizedBitRate = 7; // Infinity
282 }
283 SerializeEnum(16, prioritizedBitRate);
284
285 // Serialize bucketSizeDuration
286 int bucketSizeDuration;
287 switch (logicalChannelConfig.bucketSizeDurationMs)
288 {
289 case 50:
290 bucketSizeDuration = 0;
291 break;
292 case 100:
293 bucketSizeDuration = 1;
294 break;
295 case 150:
296 bucketSizeDuration = 2;
297 break;
298 case 300:
299 bucketSizeDuration = 3;
300 break;
301 case 500:
302 bucketSizeDuration = 4;
303 break;
304 case 1000:
305 bucketSizeDuration = 5;
306 break;
307 default:
308 bucketSizeDuration = 5;
309 }
310 SerializeEnum(8, bucketSizeDuration);
311
312 // Serialize logicalChannelGroup ::= INTEGER (0..3)
313 SerializeInteger(logicalChannelConfig.logicalChannelGroup, 0, 3);
314}
315
316void
318 LteRrcSap::PhysicalConfigDedicated physicalConfigDedicated) const
319{
320 // Serialize PhysicalConfigDedicated Sequence
321 std::bitset<10> optionalFieldsPhysicalConfigDedicated;
322 optionalFieldsPhysicalConfigDedicated.set(
323 9,
324 physicalConfigDedicated.havePdschConfigDedicated); // pdsch-ConfigDedicated
325 optionalFieldsPhysicalConfigDedicated.set(8, false); // pucch-ConfigDedicated not present
326 optionalFieldsPhysicalConfigDedicated.set(7, false); // pusch-ConfigDedicated not present
327 optionalFieldsPhysicalConfigDedicated.set(6, false); // uplinkPowerControlDedicated not present
328 optionalFieldsPhysicalConfigDedicated.set(5, false); // tpc-PDCCH-ConfigPUCCH not present
329 optionalFieldsPhysicalConfigDedicated.set(4, false); // tpc-PDCCH-ConfigPUSCH not present
330 optionalFieldsPhysicalConfigDedicated.set(3, false); // cqi-ReportConfig not present
331 optionalFieldsPhysicalConfigDedicated.set(
332 2,
333 physicalConfigDedicated.haveSoundingRsUlConfigDedicated); // soundingRS-UL-ConfigDedicated
334 optionalFieldsPhysicalConfigDedicated.set(
335 1,
336 physicalConfigDedicated.haveAntennaInfoDedicated); // antennaInfo
337 optionalFieldsPhysicalConfigDedicated.set(0, false); // schedulingRequestConfig not present
338 SerializeSequence(optionalFieldsPhysicalConfigDedicated, true);
339
340 if (physicalConfigDedicated.havePdschConfigDedicated)
341 {
342 // Serialize Pdsch-ConfigDedicated Sequence:
343 // 0 optional / default fields, no extension marker.
344 SerializeSequence(std::bitset<0>(), false);
345
346 // Serialize p-a
347 // Assuming the value in the struct is the enum index
348 SerializeEnum(8, physicalConfigDedicated.pdschConfigDedicated.pa);
349
350 // Serialize release
352 }
353
354 if (physicalConfigDedicated.haveSoundingRsUlConfigDedicated)
355 {
356 // Serialize SoundingRS-UL-ConfigDedicated choice:
357 switch (physicalConfigDedicated.soundingRsUlConfigDedicated.type)
358 {
360 SerializeChoice(2, 0, false);
362 break;
363
365 default:
366 // 2 options, selected: 1 (setup)
367 SerializeChoice(2, 1, false);
368
369 // Serialize setup sequence
370 // 0 optional / default fields, no extension marker.
371 SerializeSequence(std::bitset<0>(), false);
372
373 // Serialize srs-Bandwidth
374 SerializeEnum(4, physicalConfigDedicated.soundingRsUlConfigDedicated.srsBandwidth);
375
376 // Serialize srs-HoppingBandwidth
377 SerializeEnum(4, 0);
378
379 // Serialize freqDomainPosition
380 SerializeInteger(0, 0, 23);
381
382 // Serialize duration
383 SerializeBoolean(false);
384
385 // Serialize srs-ConfigIndex
387 0,
388 1023);
389
390 // Serialize transmissionComb
391 SerializeInteger(0, 0, 1);
392
393 // Serialize cyclicShift
394 SerializeEnum(8, 0);
395
396 break;
397 }
398 }
399
400 if (physicalConfigDedicated.haveAntennaInfoDedicated)
401 {
402 // Serialize antennaInfo choice
403 // 2 options. Selected: 0 ("explicitValue" of type "AntennaInfoDedicated")
404 SerializeChoice(2, 0, false);
405
406 // Serialize AntennaInfoDedicated sequence
407 // 1 optional parameter, not present. No extension marker.
408 SerializeSequence(std::bitset<1>(0), false);
409
410 // Serialize transmissionMode
411 // Assuming the value in the struct is the enum index
412 SerializeEnum(8, physicalConfigDedicated.antennaInfo.transmissionMode);
413
414 // Serialize ue-TransmitAntennaSelection choice
415 SerializeChoice(2, 0, false);
416
417 // Serialize release
419 }
420}
421
422void
424 LteRrcSap::RadioResourceConfigDedicated radioResourceConfigDedicated) const
425{
426 bool isSrbToAddModListPresent = !radioResourceConfigDedicated.srbToAddModList.empty();
427 bool isDrbToAddModListPresent = !radioResourceConfigDedicated.drbToAddModList.empty();
428 bool isDrbToReleaseListPresent = !radioResourceConfigDedicated.drbToReleaseList.empty();
429
430 // 6 optional fields. Extension marker is present.
431 std::bitset<6> optionalFieldsPresent = std::bitset<6>();
432 optionalFieldsPresent.set(5, isSrbToAddModListPresent); // srb-ToAddModList present
433 optionalFieldsPresent.set(4, isDrbToAddModListPresent); // drb-ToAddModList present
434 optionalFieldsPresent.set(3, isDrbToReleaseListPresent); // drb-ToReleaseList present
435 optionalFieldsPresent.set(2, false); // mac-MainConfig not present
436 optionalFieldsPresent.set(1, false); // sps-Config not present
437 optionalFieldsPresent.set(0, radioResourceConfigDedicated.havePhysicalConfigDedicated);
438 SerializeSequence(optionalFieldsPresent, true);
439
440 // Serialize srbToAddModList
441 if (isSrbToAddModListPresent)
442 {
443 SerializeSrbToAddModList(radioResourceConfigDedicated.srbToAddModList);
444 }
445
446 // Serialize drbToAddModList
447 if (isDrbToAddModListPresent)
448 {
449 SerializeDrbToAddModList(radioResourceConfigDedicated.drbToAddModList);
450 }
451
452 // Serialize drbToReleaseList
453 if (isDrbToReleaseListPresent)
454 {
455 SerializeSequenceOf(radioResourceConfigDedicated.drbToReleaseList.size(), MAX_DRB, 1);
456 auto it = radioResourceConfigDedicated.drbToReleaseList.begin();
457 for (; it != radioResourceConfigDedicated.drbToReleaseList.end(); it++)
458 {
459 // DRB-Identity ::= INTEGER (1..32)
460 SerializeInteger(*it, 1, 32);
461 }
462 }
463
464 if (radioResourceConfigDedicated.havePhysicalConfigDedicated)
465 {
466 SerializePhysicalConfigDedicated(radioResourceConfigDedicated.physicalConfigDedicated);
467 }
468}
469
470void
472 LteRrcSap::SystemInformationBlockType1 systemInformationBlockType1) const
473{
474 // 3 optional fields, no extension marker.
475 std::bitset<3> sysInfoBlk1Opts;
476 sysInfoBlk1Opts.set(2, false); // p-Max absent
477 sysInfoBlk1Opts.set(1, false); // tdd-Config absent
478 sysInfoBlk1Opts.set(0, false); // nonCriticalExtension absent
479 SerializeSequence(sysInfoBlk1Opts, false);
480
481 // Serialize cellAccessRelatedInfo
482 // 1 optional field (csgIdentity) which is present, no extension marker.
483 SerializeSequence(std::bitset<1>(1), false);
484
485 // Serialize plmn-IdentityList
486 SerializeSequenceOf(1, 6, 1);
487
488 // PLMN-IdentityInfo
489 SerializeSequence(std::bitset<0>(), false);
490
492 systemInformationBlockType1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity);
493
494 // Serialize trackingAreaCode
495 SerializeBitstring(std::bitset<16>(0));
496 // Serialize cellIdentity
498 std::bitset<28>(systemInformationBlockType1.cellAccessRelatedInfo.cellIdentity));
499 // Serialize cellBarred
500 SerializeEnum(2, 0);
501 // Serialize intraFreqReselection
502 SerializeEnum(2, 0);
503 // Serialize csg-Indication
504 SerializeBoolean(systemInformationBlockType1.cellAccessRelatedInfo.csgIndication);
505 // Serialize csg-Identity
507 std::bitset<27>(systemInformationBlockType1.cellAccessRelatedInfo.csgIdentity));
508
509 // Serialize cellSelectionInfo
510 SerializeSequence(std::bitset<1>(0), false);
511 // Serialize q-RxLevMin
512 SerializeInteger(-50, -70, -22);
513
514 // Serialize freqBandIndicator
515 SerializeInteger(1, 1, 64);
516
517 // Serialize schedulingInfoList
519 // SchedulingInfo
520 SerializeSequence(std::bitset<0>(), false);
521 // si-Periodicity
522 SerializeEnum(7, 0);
523 // sib-MappingInfo
524 SerializeSequenceOf(0, MAX_SIB - 1, 0);
525
526 // Serialize si-WindowLength
527 SerializeEnum(7, 0);
528
529 // Serialize systemInfoValueTag
530 SerializeInteger(0, 0, 31);
531}
532
533void
535 LteRrcSap::RadioResourceConfigCommon radioResourceConfigCommon) const
536{
537 // 9 optional fields. Extension marker yes.
538 std::bitset<9> rrCfgCmmOpts;
539 rrCfgCmmOpts.set(8, true); // rach-ConfigCommon is present
540 rrCfgCmmOpts.set(7, false); // pdsch-ConfigCommon not present
541 rrCfgCmmOpts.set(6, false); // phich-Config not present
542 rrCfgCmmOpts.set(5, false); // pucch-ConfigCommon not present
543 rrCfgCmmOpts.set(4, false); // soundingRS-UL-ConfigCommon not present
544 rrCfgCmmOpts.set(3, false); // uplinkPowerControlCommon not present
545 rrCfgCmmOpts.set(2, false); // antennaInfoCommon not present
546 rrCfgCmmOpts.set(1, false); // p-Max not present
547 rrCfgCmmOpts.set(0, false); // tdd-Config not present
548
549 SerializeSequence(rrCfgCmmOpts, true);
550
551 if (rrCfgCmmOpts[8])
552 {
553 // Serialize RACH-ConfigCommon
554 SerializeRachConfigCommon(radioResourceConfigCommon.rachConfigCommon);
555 }
556
557 // Serialize PRACH-Config
558 // 1 optional, 0 extension marker.
559 SerializeSequence(std::bitset<1>(0), false);
560
561 // Serialize PRACH-Config rootSequenceIndex
562 SerializeInteger(0, 0, 1023);
563
564 // Serialize PUSCH-ConfigCommon
565 SerializeSequence(std::bitset<0>(), false);
566
567 // Serialize pusch-ConfigBasic
568 SerializeSequence(std::bitset<0>(), false);
569 SerializeInteger(1, 1, 4);
570 SerializeEnum(2, 0);
571 SerializeInteger(0, 0, 98);
572 SerializeBoolean(false);
573
574 // Serialize UL-ReferenceSignalsPUSCH
575 SerializeSequence(std::bitset<0>(), false);
576 SerializeBoolean(false);
577 SerializeInteger(0, 0, 29);
578 SerializeBoolean(false);
579 SerializeInteger(4, 0, 7);
580
581 // Serialize UL-CyclicPrefixLength
582 SerializeEnum(2, 0);
583}
584
585void
587 LteRrcSap::RadioResourceConfigCommonSib radioResourceConfigCommonSib) const
588{
589 SerializeSequence(std::bitset<0>(0), true);
590
591 // rach-ConfigCommon
592 SerializeRachConfigCommon(radioResourceConfigCommonSib.rachConfigCommon);
593
594 // bcch-Config
595 SerializeSequence(std::bitset<0>(0), false);
596 SerializeEnum(4, 0); // modificationPeriodCoeff
597 // pcch-Config
598 SerializeSequence(std::bitset<0>(0), false);
599 SerializeEnum(4, 0); // defaultPagingCycle
600 SerializeEnum(8, 0); // nB
601 // prach-Config
602 SerializeSequence(std::bitset<1>(0), false);
603 SerializeInteger(0, 0, 1023); // rootSequenceIndex
604 // pdsch-ConfigCommon
605 SerializeSequence(std::bitset<0>(0), false);
606 SerializeInteger(0, -60, 50); // referenceSignalPower
607 SerializeInteger(0, 0, 3); // p-b
608 // pusch-ConfigCommon
609 SerializeSequence(std::bitset<0>(0), false);
610 SerializeSequence(std::bitset<0>(0), false); // pusch-ConfigBasic
611 SerializeInteger(1, 1, 4); // n-SB
612 SerializeEnum(2, 0); // hoppingMode
613 SerializeInteger(0, 0, 98); // pusch-HoppingOffset
614 SerializeBoolean(false); // enable64QAM
615 SerializeSequence(std::bitset<0>(0), false); // UL-ReferenceSignalsPUSCH
616 SerializeBoolean(false); // groupHoppingEnabled
617 SerializeInteger(0, 0, 29); // groupAssignmentPUSCH
618 SerializeBoolean(false); // sequenceHoppingEnabled
619 SerializeInteger(0, 0, 7); // cyclicShift
620 // pucch-ConfigCommon
621 SerializeSequence(std::bitset<0>(0), false);
622 SerializeEnum(3, 0); // deltaPUCCH-Shift
623 SerializeInteger(0, 0, 98); // nRB-CQI
624 SerializeInteger(0, 0, 7); // nCS-AN
625 SerializeInteger(0, 0, 2047); // n1PUCCH-AN
626 // soundingRS-UL-ConfigCommon
627 SerializeChoice(2, 0, false);
628 SerializeNull(); // release
629 // uplinkPowerControlCommon
630 SerializeSequence(std::bitset<0>(0), false);
631 SerializeInteger(0, -126, 24); // p0-NominalPUSCH
632 SerializeEnum(8, 0); // alpha
633 SerializeInteger(-110, -127, -96); // p0-NominalPUCCH
634 SerializeSequence(std::bitset<0>(0), false); // deltaFList-PUCCH
635 SerializeEnum(3, 0); // deltaF-PUCCH-Format1
636 SerializeEnum(3, 0); // deltaF-PUCCH-Format1b
637 SerializeEnum(4, 0); // deltaF-PUCCH-Format2
638 SerializeEnum(3, 0); // deltaF-PUCCH-Format2a
639 SerializeEnum(3, 0); // deltaF-PUCCH-Format2b
640 SerializeInteger(0, -1, 6);
641 // ul-CyclicPrefixLength
642 SerializeEnum(2, 0);
643}
644
645void
647 LteRrcSap::SystemInformationBlockType2 systemInformationBlockType2) const
648{
649 SerializeSequence(std::bitset<2>(0), true);
650
651 // RadioResourceConfigCommonSib
653
654 // ue-TimersAndConstants
655 SerializeSequence(std::bitset<0>(0), true);
656 SerializeEnum(8, 0); // t300
657 SerializeEnum(8, 0); // t301
658 SerializeEnum(7, 0); // t310
659 SerializeEnum(8, 0); // n310
660 SerializeEnum(7, 0); // t311
661 SerializeEnum(8, 0); // n311
662
663 // freqInfo
664 SerializeSequence(std::bitset<2>(3), false);
665 SerializeInteger((int)systemInformationBlockType2.freqInfo.ulCarrierFreq, 0, MAX_EARFCN);
666 SerializeEnum(6, BandwidthToEnum(systemInformationBlockType2.freqInfo.ulBandwidth));
667
668 SerializeInteger(29, 1, 32); // additionalSpectrumEmission
669 // timeAlignmentTimerCommon
670 SerializeEnum(8, 0);
671}
672
673void
675{
676 // Watchdog: if list has 0 elements, set boolean to false
677 if (measResults.measResultListEutra.empty())
678 {
679 measResults.haveMeasResultNeighCells = false;
680 }
681
682 std::bitset<4> measResultOptional;
683 measResultOptional.set(3, measResults.haveMeasResultServFreqList);
684 measResultOptional.set(2, false); // LocationInfo-r10
685 measResultOptional.set(1, false); // MeasResultForECID-r9
686 measResultOptional.set(0, measResults.haveMeasResultNeighCells);
687 SerializeSequence(measResultOptional, true);
688
689 // Serialize measId
690 SerializeInteger(measResults.measId, 1, MAX_MEAS_ID);
691
692 // Serialize measResultPCell sequence
693 SerializeSequence(std::bitset<0>(0), false);
694
695 // Serialize rsrpResult
696 SerializeInteger(measResults.measResultPCell.rsrpResult, 0, 97);
697
698 // Serialize rsrqResult
699 SerializeInteger(measResults.measResultPCell.rsrqResult, 0, 34);
700
701 if (measResults.haveMeasResultNeighCells)
702 {
703 // Serialize Choice = 0 (MeasResultListEUTRA)
704 SerializeChoice(4, 0, false);
705
706 // Serialize measResultNeighCells
708
709 // serialize MeasResultEutra elements in the list
710 for (auto it = measResults.measResultListEutra.begin();
711 it != measResults.measResultListEutra.end();
712 it++)
713 {
714 SerializeSequence(std::bitset<1>(it->haveCgiInfo), false);
715
716 // Serialize PhysCellId
717 SerializeInteger(it->physCellId, 0, 503);
718
719 // Serialize CgiInfo
720 if (it->haveCgiInfo)
721 {
722 SerializeSequence(std::bitset<1>(it->cgiInfo.plmnIdentityList.size()), false);
723
724 // Serialize cellGlobalId
725 SerializeSequence(std::bitset<0>(0), false);
726 SerializePlmnIdentity(it->cgiInfo.plmnIdentity);
727 SerializeBitstring(std::bitset<28>(it->cgiInfo.cellIdentity));
728
729 // Serialize trackingAreaCode
730 SerializeBitstring(std::bitset<16>(it->cgiInfo.trackingAreaCode));
731
732 // Serialize plmn-IdentityList
733 if (!it->cgiInfo.plmnIdentityList.empty())
734 {
735 SerializeSequenceOf(it->cgiInfo.plmnIdentityList.size(), 5, 1);
736 for (auto it2 = it->cgiInfo.plmnIdentityList.begin();
737 it2 != it->cgiInfo.plmnIdentityList.end();
738 it2++)
739 {
741 }
742 }
743 }
744
745 // Serialize measResult
746 std::bitset<2> measResultFieldsPresent;
747 measResultFieldsPresent[1] = it->haveRsrpResult;
748 measResultFieldsPresent[0] = it->haveRsrqResult;
749 SerializeSequence(measResultFieldsPresent, true);
750
751 if (it->haveRsrpResult)
752 {
753 SerializeInteger(it->rsrpResult, 0, 97);
754 }
755
756 if (it->haveRsrqResult)
757 {
758 SerializeInteger(it->rsrqResult, 0, 34);
759 }
760 }
761 }
762
763 // measResultServFreqList-r10 serialization
764 if (measResults.haveMeasResultServFreqList)
765 {
766 // Serialize measResultServFreqList-r10
768 // serialize MeasResultServFreqList-r10 elements in the list
769 for (const auto& it : measResults.measResultServFreqList)
770 {
771 // Serialize MeasResultServFreq-r10
772 std::bitset<2> measResultServFreqPresent;
773 measResultServFreqPresent[0] = it.haveMeasResultSCell;
774 measResultServFreqPresent[1] = it.haveMeasResultBestNeighCell;
775 SerializeSequence(measResultServFreqPresent, true);
776
777 // Serialize servFreqId-r10
778 SerializeInteger(it.servFreqId, 0, 7);
779
780 if (it.haveMeasResultSCell)
781 {
782 // Serialize rsrpResultSCell-r10
783 SerializeInteger(it.measResultSCell.rsrpResult, 0, 97);
784
785 // Serialize rsrqResultSCell-r10
786 SerializeInteger(it.measResultSCell.rsrqResult, 0, 34);
787 }
788
789 if (it.haveMeasResultBestNeighCell)
790 {
791 // Serialize physCellId-r10
792 SerializeInteger(it.measResultBestNeighCell.physCellId, 0, 503);
793
794 // Serialize rsrpResultNCell-r10
795 SerializeInteger(it.measResultBestNeighCell.rsrpResult, 0, 97);
796
797 // Serialize rsrqResultNCell-r10
798 SerializeInteger(it.measResultBestNeighCell.rsrqResult, 0, 34);
799 }
800
801 NS_ASSERT(!it.haveMeasResultBestNeighCell); // Not implemented
802 }
803 }
804}
805
806void
808{
809 // plmn-Identity sequence, mcc is optional, no extension marker
810 SerializeSequence(std::bitset<1>(0), false);
811
812 // Serialize mnc
813 int nDig = (plmnId > 99) ? 3 : 2;
814
815 SerializeSequenceOf(nDig, 3, 2);
816 for (int i = nDig - 1; i >= 0; i--)
817 {
818 int n = floor(plmnId / pow(10, i));
819 SerializeInteger(n, 0, 9);
820 plmnId -= n * pow(10, i);
821 }
822
823 // cellReservedForOperatorUse
824 SerializeEnum(2, 0);
825}
826
827void
829{
830 // rach-ConfigCommon
831 SerializeSequence(std::bitset<0>(0), true);
832
833 // preambleInfo
834 SerializeSequence(std::bitset<1>(0), false);
835
836 // numberOfRA-Preambles
837 switch (rachConfigCommon.preambleInfo.numberOfRaPreambles)
838 {
839 case 4:
840 SerializeEnum(16, 0);
841 break;
842 case 8:
843 SerializeEnum(16, 1);
844 break;
845 case 12:
846 SerializeEnum(16, 2);
847 break;
848 case 16:
849 SerializeEnum(16, 3);
850 break;
851 case 20:
852 SerializeEnum(16, 4);
853 break;
854 case 24:
855 SerializeEnum(16, 5);
856 break;
857 case 28:
858 SerializeEnum(16, 6);
859 break;
860 case 32:
861 SerializeEnum(16, 7);
862 break;
863 case 36:
864 SerializeEnum(16, 8);
865 break;
866 case 40:
867 SerializeEnum(16, 9);
868 break;
869 case 44:
870 SerializeEnum(16, 10);
871 break;
872 case 48:
873 SerializeEnum(16, 11);
874 break;
875 case 52:
876 SerializeEnum(16, 12);
877 break;
878 case 56:
879 SerializeEnum(16, 13);
880 break;
881 case 60:
882 SerializeEnum(16, 14);
883 break;
884 case 64:
885 SerializeEnum(16, 15);
886 break;
887 default:
888 NS_FATAL_ERROR("Wrong numberOfRA-Preambles value");
889 }
890
891 SerializeSequence(std::bitset<0>(0), false); // powerRampingParameters
892 SerializeEnum(4, 0); // powerRampingStep
893 SerializeEnum(16, 0); // preambleInitialReceivedTargetPower
894 SerializeSequence(std::bitset<0>(0), false); // ra-SupervisionInfo
895
896 // preambleTransMax
897 switch (rachConfigCommon.raSupervisionInfo.preambleTransMax)
898 {
899 case 3:
900 SerializeEnum(11, 0);
901 break;
902 case 4:
903 SerializeEnum(11, 1);
904 break;
905 case 5:
906 SerializeEnum(11, 2);
907 break;
908 case 6:
909 SerializeEnum(11, 3);
910 break;
911 case 7:
912 SerializeEnum(11, 4);
913 break;
914 case 8:
915 SerializeEnum(11, 5);
916 break;
917 case 10:
918 SerializeEnum(11, 6);
919 break;
920 case 20:
921 SerializeEnum(11, 7);
922 break;
923 case 50:
924 SerializeEnum(11, 8);
925 break;
926 case 100:
927 SerializeEnum(11, 9);
928 break;
929 case 200:
930 SerializeEnum(11, 10);
931 break;
932 default:
933 SerializeEnum(11, 0);
934 }
935
936 // ra-ResponseWindowSize
937 switch (rachConfigCommon.raSupervisionInfo.raResponseWindowSize)
938 {
939 case 2:
940 SerializeEnum(8, 0);
941 break;
942 case 3:
943 SerializeEnum(8, 1);
944 break;
945 case 4:
946 SerializeEnum(8, 2);
947 break;
948 case 5:
949 SerializeEnum(8, 3);
950 break;
951 case 6:
952 SerializeEnum(8, 4);
953 break;
954 case 7:
955 SerializeEnum(8, 5);
956 break;
957 case 8:
958 SerializeEnum(8, 6);
959 break;
960 case 10:
961 SerializeEnum(8, 7);
962 break;
963 default:
964 SerializeEnum(8, 0);
965 }
966
967 SerializeEnum(8, 0); // mac-ContentionResolutionTimer
968 SerializeInteger(1, 1, 8); // maxHARQ-Msg3Tx
969
970 // connEstFailCount
971 switch (rachConfigCommon.txFailParam.connEstFailCount)
972 {
973 case 1:
974 SerializeEnum(8, 1);
975 break;
976 case 2:
977 SerializeEnum(8, 2);
978 break;
979 case 3:
980 SerializeEnum(8, 3);
981 break;
982 case 4:
983 SerializeEnum(8, 4);
984 break;
985 default:
986 SerializeEnum(8, 1);
987 }
988}
989
990void
992{
993 switch (qOffsetRange)
994 {
995 case -24:
996 SerializeEnum(31, 0);
997 break;
998 case -22:
999 SerializeEnum(31, 1);
1000 break;
1001 case -20:
1002 SerializeEnum(31, 2);
1003 break;
1004 case -18:
1005 SerializeEnum(31, 3);
1006 break;
1007 case -16:
1008 SerializeEnum(31, 4);
1009 break;
1010 case -14:
1011 SerializeEnum(31, 5);
1012 break;
1013 case -12:
1014 SerializeEnum(31, 6);
1015 break;
1016 case -10:
1017 SerializeEnum(31, 7);
1018 break;
1019 case -8:
1020 SerializeEnum(31, 8);
1021 break;
1022 case -6:
1023 SerializeEnum(31, 9);
1024 break;
1025 case -5:
1026 SerializeEnum(31, 10);
1027 break;
1028 case -4:
1029 SerializeEnum(31, 11);
1030 break;
1031 case -3:
1032 SerializeEnum(31, 12);
1033 break;
1034 case -2:
1035 SerializeEnum(31, 13);
1036 break;
1037 case -1:
1038 SerializeEnum(31, 14);
1039 break;
1040 case 0:
1041 SerializeEnum(31, 15);
1042 break;
1043 case 1:
1044 SerializeEnum(31, 16);
1045 break;
1046 case 2:
1047 SerializeEnum(31, 17);
1048 break;
1049 case 3:
1050 SerializeEnum(31, 18);
1051 break;
1052 case 4:
1053 SerializeEnum(31, 19);
1054 break;
1055 case 5:
1056 SerializeEnum(31, 20);
1057 break;
1058 case 6:
1059 SerializeEnum(31, 21);
1060 break;
1061 case 8:
1062 SerializeEnum(31, 22);
1063 break;
1064 case 10:
1065 SerializeEnum(31, 23);
1066 break;
1067 case 12:
1068 SerializeEnum(31, 24);
1069 break;
1070 case 14:
1071 SerializeEnum(31, 25);
1072 break;
1073 case 16:
1074 SerializeEnum(31, 26);
1075 break;
1076 case 18:
1077 SerializeEnum(31, 27);
1078 break;
1079 case 20:
1080 SerializeEnum(31, 28);
1081 break;
1082 case 22:
1083 SerializeEnum(31, 29);
1084 break;
1085 case 24:
1086 SerializeEnum(31, 30);
1087 break;
1088 default:
1089 SerializeEnum(31, 15);
1090 }
1091}
1092
1093void
1095{
1096 switch (thresholdEutra.choice)
1097 {
1099 SerializeChoice(2, 0, false);
1100 SerializeInteger(thresholdEutra.range, 0, 97);
1101 break;
1103 default:
1104 SerializeChoice(2, 1, false);
1105 SerializeInteger(thresholdEutra.range, 0, 34);
1106 }
1107}
1108
1109void
1111{
1112 // Serialize MeasConfig sequence
1113 // 11 optional fields, extension marker present
1114 std::bitset<11> measConfigOptional;
1115 measConfigOptional.set(10, !measConfig.measObjectToRemoveList.empty());
1116 measConfigOptional.set(9, !measConfig.measObjectToAddModList.empty());
1117 measConfigOptional.set(8, !measConfig.reportConfigToRemoveList.empty());
1118 measConfigOptional.set(7, !measConfig.reportConfigToAddModList.empty());
1119 measConfigOptional.set(6, !measConfig.measIdToRemoveList.empty());
1120 measConfigOptional.set(5, !measConfig.measIdToAddModList.empty());
1121 measConfigOptional.set(4, measConfig.haveQuantityConfig);
1122 measConfigOptional.set(3, measConfig.haveMeasGapConfig);
1123 measConfigOptional.set(2, measConfig.haveSmeasure);
1124 measConfigOptional.set(1, false); // preRegistrationInfoHRPD
1125 measConfigOptional.set(0, measConfig.haveSpeedStatePars);
1126 SerializeSequence(measConfigOptional, true);
1127
1128 if (!measConfig.measObjectToRemoveList.empty())
1129 {
1131 for (auto it = measConfig.measObjectToRemoveList.begin();
1132 it != measConfig.measObjectToRemoveList.end();
1133 it++)
1134 {
1136 }
1137 }
1138
1139 if (!measConfig.measObjectToAddModList.empty())
1140 {
1142 for (auto it = measConfig.measObjectToAddModList.begin();
1143 it != measConfig.measObjectToAddModList.end();
1144 it++)
1145 {
1146 SerializeSequence(std::bitset<0>(), false);
1147 SerializeInteger(it->measObjectId, 1, MAX_OBJECT_ID);
1148 SerializeChoice(4, 0, true); // Select MeasObjectEUTRA
1149
1150 // Serialize measObjectEutra
1151 std::bitset<5> measObjOpts;
1152 measObjOpts.set(4, !it->measObjectEutra.cellsToRemoveList.empty());
1153 measObjOpts.set(3, !it->measObjectEutra.cellsToAddModList.empty());
1154 measObjOpts.set(2, !it->measObjectEutra.blackCellsToRemoveList.empty());
1155 measObjOpts.set(1, !it->measObjectEutra.blackCellsToAddModList.empty());
1156 measObjOpts.set(0, it->measObjectEutra.haveCellForWhichToReportCGI);
1157 SerializeSequence(measObjOpts, true);
1158
1159 // Serialize carrierFreq
1160 SerializeInteger(it->measObjectEutra.carrierFreq, 0, MAX_EARFCN);
1161
1162 // Serialize allowedMeasBandwidth
1163 SerializeEnum(6, BandwidthToEnum(it->measObjectEutra.allowedMeasBandwidth));
1164
1165 SerializeBoolean(it->measObjectEutra.presenceAntennaPort1);
1166 SerializeBitstring(std::bitset<2>(it->measObjectEutra.neighCellConfig));
1167 SerializeQoffsetRange(it->measObjectEutra.offsetFreq);
1168
1169 if (!it->measObjectEutra.cellsToRemoveList.empty())
1170 {
1171 SerializeSequenceOf(it->measObjectEutra.cellsToRemoveList.size(), MAX_CELL_MEAS, 1);
1172 for (auto it2 = it->measObjectEutra.cellsToRemoveList.begin();
1173 it2 != it->measObjectEutra.cellsToRemoveList.end();
1174 it2++)
1175 {
1177 }
1178 }
1179
1180 if (!it->measObjectEutra.cellsToAddModList.empty())
1181 {
1182 SerializeSequenceOf(it->measObjectEutra.cellsToAddModList.size(), MAX_CELL_MEAS, 1);
1183 for (auto it2 = it->measObjectEutra.cellsToAddModList.begin();
1184 it2 != it->measObjectEutra.cellsToAddModList.end();
1185 it2++)
1186 {
1187 SerializeSequence(std::bitset<0>(), false);
1188
1189 // Serialize cellIndex
1190 SerializeInteger(it2->cellIndex, 1, MAX_CELL_MEAS);
1191
1192 // Serialize PhysCellId
1193 SerializeInteger(it2->physCellId, 0, 503);
1194
1195 // Serialize cellIndividualOffset
1196 SerializeQoffsetRange(it2->cellIndividualOffset);
1197 }
1198 }
1199
1200 if (!it->measObjectEutra.blackCellsToRemoveList.empty())
1201 {
1202 SerializeSequenceOf(it->measObjectEutra.blackCellsToRemoveList.size(),
1204 1);
1205 for (auto it2 = it->measObjectEutra.blackCellsToRemoveList.begin();
1206 it2 != it->measObjectEutra.blackCellsToRemoveList.end();
1207 it2++)
1208 {
1210 }
1211 }
1212
1213 if (!it->measObjectEutra.blackCellsToAddModList.empty())
1214 {
1215 SerializeSequenceOf(it->measObjectEutra.blackCellsToAddModList.size(),
1217 1);
1218 for (auto it2 = it->measObjectEutra.blackCellsToAddModList.begin();
1219 it2 != it->measObjectEutra.blackCellsToAddModList.end();
1220 it2++)
1221 {
1222 SerializeSequence(std::bitset<0>(), false);
1223 SerializeInteger(it2->cellIndex, 1, MAX_CELL_MEAS);
1224
1225 // Serialize PhysCellIdRange
1226 // range optional
1227 std::bitset<1> rangePresent(it2->physCellIdRange.haveRange);
1228 SerializeSequence(rangePresent, false);
1229 SerializeInteger(it2->physCellIdRange.start, 0, 503);
1230 if (it2->physCellIdRange.haveRange)
1231 {
1232 switch (it2->physCellIdRange.range)
1233 {
1234 case 4:
1235 SerializeEnum(16, 0);
1236 break;
1237 case 8:
1238 SerializeEnum(16, 1);
1239 break;
1240 case 12:
1241 SerializeEnum(16, 2);
1242 break;
1243 case 16:
1244 SerializeEnum(16, 3);
1245 break;
1246 case 24:
1247 SerializeEnum(16, 4);
1248 break;
1249 case 32:
1250 SerializeEnum(16, 5);
1251 break;
1252 case 48:
1253 SerializeEnum(16, 6);
1254 break;
1255 case 64:
1256 SerializeEnum(16, 7);
1257 break;
1258 case 84:
1259 SerializeEnum(16, 8);
1260 break;
1261 case 96:
1262 SerializeEnum(16, 9);
1263 break;
1264 case 128:
1265 SerializeEnum(16, 10);
1266 break;
1267 case 168:
1268 SerializeEnum(16, 11);
1269 break;
1270 case 252:
1271 SerializeEnum(16, 12);
1272 break;
1273 case 504:
1274 SerializeEnum(16, 13);
1275 break;
1276 default:
1277 SerializeEnum(16, 0);
1278 }
1279 }
1280 }
1281 }
1282
1283 if (it->measObjectEutra.haveCellForWhichToReportCGI)
1284 {
1285 SerializeInteger(it->measObjectEutra.cellForWhichToReportCGI, 0, 503);
1286 }
1287 }
1288 }
1289
1290 if (!measConfig.reportConfigToRemoveList.empty())
1291 {
1293 for (auto it = measConfig.reportConfigToRemoveList.begin();
1294 it != measConfig.reportConfigToRemoveList.end();
1295 it++)
1296 {
1298 }
1299 }
1300
1301 if (!measConfig.reportConfigToAddModList.empty())
1302 {
1304 for (auto it = measConfig.reportConfigToAddModList.begin();
1305 it != measConfig.reportConfigToAddModList.end();
1306 it++)
1307 {
1308 SerializeSequence(std::bitset<0>(), false);
1309 SerializeInteger(it->reportConfigId, 1, MAX_REPORT_CONFIG_ID);
1310 SerializeChoice(2, 0, false); // reportConfigEUTRA
1311
1312 // Serialize ReportConfigEUTRA
1313 SerializeSequence(std::bitset<0>(), true);
1314 switch (it->reportConfigEutra.triggerType)
1315 {
1317 SerializeChoice(2, 1, false);
1318 SerializeSequence(std::bitset<0>(), false);
1319 switch (it->reportConfigEutra.purpose)
1320 {
1322 SerializeEnum(2, 1);
1323 break;
1325 default:
1326 SerializeEnum(2, 0);
1327 }
1328 break;
1330 default:
1331 SerializeChoice(2, 0, false);
1332 SerializeSequence(std::bitset<0>(), false);
1333 switch (it->reportConfigEutra.eventId)
1334 {
1336 SerializeChoice(5, 0, true);
1337 SerializeSequence(std::bitset<0>(), false);
1338 SerializeThresholdEutra(it->reportConfigEutra.threshold1);
1339 break;
1341 SerializeChoice(5, 1, true);
1342 SerializeSequence(std::bitset<0>(), false);
1343 SerializeThresholdEutra(it->reportConfigEutra.threshold1);
1344 break;
1346 SerializeChoice(5, 2, true);
1347 SerializeSequence(std::bitset<0>(), false);
1348 SerializeInteger(it->reportConfigEutra.a3Offset, -30, 30);
1349 SerializeBoolean(it->reportConfigEutra.reportOnLeave);
1350 break;
1352 SerializeChoice(5, 3, true);
1353 SerializeSequence(std::bitset<0>(), false);
1354 SerializeThresholdEutra(it->reportConfigEutra.threshold1);
1355 break;
1357 default:
1358 SerializeChoice(5, 4, true);
1359 SerializeSequence(std::bitset<0>(), false);
1360 SerializeThresholdEutra(it->reportConfigEutra.threshold1);
1361 SerializeThresholdEutra(it->reportConfigEutra.threshold2);
1362 }
1363
1364 SerializeInteger(it->reportConfigEutra.hysteresis, 0, 30);
1365
1366 switch (it->reportConfigEutra.timeToTrigger)
1367 {
1368 case 0:
1369 SerializeEnum(16, 0);
1370 break;
1371 case 40:
1372 SerializeEnum(16, 1);
1373 break;
1374 case 64:
1375 SerializeEnum(16, 2);
1376 break;
1377 case 80:
1378 SerializeEnum(16, 3);
1379 break;
1380 case 100:
1381 SerializeEnum(16, 4);
1382 break;
1383 case 128:
1384 SerializeEnum(16, 5);
1385 break;
1386 case 160:
1387 SerializeEnum(16, 6);
1388 break;
1389 case 256:
1390 SerializeEnum(16, 7);
1391 break;
1392 case 320:
1393 SerializeEnum(16, 8);
1394 break;
1395 case 480:
1396 SerializeEnum(16, 9);
1397 break;
1398 case 512:
1399 SerializeEnum(16, 10);
1400 break;
1401 case 640:
1402 SerializeEnum(16, 11);
1403 break;
1404 case 1024:
1405 SerializeEnum(16, 12);
1406 break;
1407 case 1280:
1408 SerializeEnum(16, 13);
1409 break;
1410 case 2560:
1411 SerializeEnum(16, 14);
1412 break;
1413 case 5120:
1414 default:
1415 SerializeEnum(16, 15);
1416 }
1417 } // end trigger type
1418
1419 // Serialize triggerQuantity
1420 if (it->reportConfigEutra.triggerQuantity == LteRrcSap::ReportConfigEutra::RSRP)
1421 {
1422 SerializeEnum(2, 0);
1423 }
1424 else
1425 {
1426 SerializeEnum(2, 1);
1427 }
1428
1429 // Serialize reportQuantity
1430 if (it->reportConfigEutra.reportQuantity ==
1432 {
1433 SerializeEnum(2, 0);
1434 }
1435 else
1436 {
1437 SerializeEnum(2, 1);
1438 }
1439
1440 // Serialize maxReportCells
1441 SerializeInteger(it->reportConfigEutra.maxReportCells, 1, MAX_CELL_REPORT);
1442
1443 // Serialize reportInterval
1444 switch (it->reportConfigEutra.reportInterval)
1445 {
1447 SerializeEnum(16, 0);
1448 break;
1450 SerializeEnum(16, 1);
1451 break;
1453 SerializeEnum(16, 2);
1454 break;
1456 SerializeEnum(16, 3);
1457 break;
1459 SerializeEnum(16, 4);
1460 break;
1462 SerializeEnum(16, 5);
1463 break;
1465 SerializeEnum(16, 6);
1466 break;
1468 SerializeEnum(16, 7);
1469 break;
1471 SerializeEnum(16, 8);
1472 break;
1474 SerializeEnum(16, 9);
1475 break;
1477 SerializeEnum(16, 10);
1478 break;
1480 SerializeEnum(16, 11);
1481 break;
1483 SerializeEnum(16, 12);
1484 break;
1486 SerializeEnum(16, 13);
1487 break;
1489 SerializeEnum(16, 14);
1490 break;
1492 default:
1493 SerializeEnum(16, 15);
1494 }
1495
1496 // Serialize reportAmount
1497 switch (it->reportConfigEutra.reportAmount)
1498 {
1499 case 1:
1500 SerializeEnum(8, 0);
1501 break;
1502 case 2:
1503 SerializeEnum(8, 1);
1504 break;
1505 case 4:
1506 SerializeEnum(8, 2);
1507 break;
1508 case 8:
1509 SerializeEnum(8, 3);
1510 break;
1511 case 16:
1512 SerializeEnum(8, 4);
1513 break;
1514 case 32:
1515 SerializeEnum(8, 5);
1516 break;
1517 case 64:
1518 SerializeEnum(8, 6);
1519 break;
1520 default:
1521 SerializeEnum(8, 7);
1522 }
1523 }
1524 }
1525
1526 if (!measConfig.measIdToRemoveList.empty())
1527 {
1528 SerializeSequenceOf(measConfig.measIdToRemoveList.size(), MAX_MEAS_ID, 1);
1529 for (auto it = measConfig.measIdToRemoveList.begin();
1530 it != measConfig.measIdToRemoveList.end();
1531 it++)
1532 {
1534 }
1535 }
1536
1537 if (!measConfig.measIdToAddModList.empty())
1538 {
1539 SerializeSequenceOf(measConfig.measIdToAddModList.size(), MAX_MEAS_ID, 1);
1540 for (auto it = measConfig.measIdToAddModList.begin();
1541 it != measConfig.measIdToAddModList.end();
1542 it++)
1543 {
1544 SerializeInteger(it->measId, 1, MAX_MEAS_ID);
1545 SerializeInteger(it->measObjectId, 1, MAX_OBJECT_ID);
1546 SerializeInteger(it->reportConfigId, 1, MAX_REPORT_CONFIG_ID);
1547 }
1548 }
1549
1550 if (measConfig.haveQuantityConfig)
1551 {
1552 // QuantityConfig sequence
1553 // 4 optional fields, only first (EUTRA) present. Extension marker yes.
1554 std::bitset<4> quantityConfigOpts(0);
1555 quantityConfigOpts.set(3, true);
1556 SerializeSequence(quantityConfigOpts, true);
1557 SerializeSequence(std::bitset<0>(), false);
1558
1559 switch (measConfig.quantityConfig.filterCoefficientRSRP)
1560 {
1561 case 0:
1562 SerializeEnum(16, 0);
1563 break;
1564 case 1:
1565 SerializeEnum(16, 1);
1566 break;
1567 case 2:
1568 SerializeEnum(16, 2);
1569 break;
1570 case 3:
1571 SerializeEnum(16, 3);
1572 break;
1573 case 4:
1574 SerializeEnum(16, 4);
1575 break;
1576 case 5:
1577 SerializeEnum(16, 5);
1578 break;
1579 case 6:
1580 SerializeEnum(16, 6);
1581 break;
1582 case 7:
1583 SerializeEnum(16, 7);
1584 break;
1585 case 8:
1586 SerializeEnum(16, 8);
1587 break;
1588 case 9:
1589 SerializeEnum(16, 9);
1590 break;
1591 case 11:
1592 SerializeEnum(16, 10);
1593 break;
1594 case 13:
1595 SerializeEnum(16, 11);
1596 break;
1597 case 15:
1598 SerializeEnum(16, 12);
1599 break;
1600 case 17:
1601 SerializeEnum(16, 13);
1602 break;
1603 case 19:
1604 SerializeEnum(16, 14);
1605 break;
1606 default:
1607 SerializeEnum(16, 4);
1608 }
1609
1610 switch (measConfig.quantityConfig.filterCoefficientRSRQ)
1611 {
1612 case 0:
1613 SerializeEnum(16, 0);
1614 break;
1615 case 1:
1616 SerializeEnum(16, 1);
1617 break;
1618 case 2:
1619 SerializeEnum(16, 2);
1620 break;
1621 case 3:
1622 SerializeEnum(16, 3);
1623 break;
1624 case 4:
1625 SerializeEnum(16, 4);
1626 break;
1627 case 5:
1628 SerializeEnum(16, 5);
1629 break;
1630 case 6:
1631 SerializeEnum(16, 6);
1632 break;
1633 case 7:
1634 SerializeEnum(16, 7);
1635 break;
1636 case 8:
1637 SerializeEnum(16, 8);
1638 break;
1639 case 9:
1640 SerializeEnum(16, 9);
1641 break;
1642 case 11:
1643 SerializeEnum(16, 10);
1644 break;
1645 case 13:
1646 SerializeEnum(16, 11);
1647 break;
1648 case 15:
1649 SerializeEnum(16, 12);
1650 break;
1651 case 17:
1652 SerializeEnum(16, 13);
1653 break;
1654 case 19:
1655 SerializeEnum(16, 14);
1656 break;
1657 default:
1658 SerializeEnum(16, 4);
1659 }
1660 }
1661
1662 if (measConfig.haveMeasGapConfig)
1663 {
1664 switch (measConfig.measGapConfig.type)
1665 {
1667 SerializeChoice(2, 0, false);
1668 SerializeNull();
1669 break;
1671 default:
1672 SerializeChoice(2, 1, false);
1673 SerializeSequence(std::bitset<0>(), false);
1674 switch (measConfig.measGapConfig.gapOffsetChoice)
1675 {
1677 SerializeChoice(2, 0, true);
1679 break;
1681 default:
1682 SerializeChoice(2, 1, true);
1684 }
1685 }
1686 }
1687
1688 if (measConfig.haveSmeasure)
1689 {
1690 SerializeInteger(measConfig.sMeasure, 0, 97);
1691 }
1692
1693 // ...Here preRegistrationInfoHRPD would be serialized
1694
1695 if (measConfig.haveSpeedStatePars)
1696 {
1697 switch (measConfig.speedStatePars.type)
1698 {
1700 SerializeChoice(2, 0, false);
1701 SerializeNull();
1702 break;
1704 default:
1705 SerializeChoice(2, 1, false);
1706 SerializeSequence(std::bitset<0>(), false);
1708 {
1709 case 30:
1710 SerializeEnum(8, 0);
1711 break;
1712 case 60:
1713 SerializeEnum(8, 1);
1714 break;
1715 case 120:
1716 SerializeEnum(8, 2);
1717 break;
1718 case 180:
1719 SerializeEnum(8, 3);
1720 break;
1721 case 240:
1722 SerializeEnum(8, 4);
1723 break;
1724 default:
1725 SerializeEnum(8, 5);
1726 break;
1727 }
1728
1730 {
1731 case 30:
1732 SerializeEnum(8, 0);
1733 break;
1734 case 60:
1735 SerializeEnum(8, 1);
1736 break;
1737 case 120:
1738 SerializeEnum(8, 2);
1739 break;
1740 case 180:
1741 SerializeEnum(8, 3);
1742 break;
1743 case 240:
1744 SerializeEnum(8, 4);
1745 break;
1746 default:
1747 SerializeEnum(8, 5);
1748 break;
1749 }
1750
1752 1,
1753 16);
1755 1,
1756 16);
1757
1758 SerializeSequence(std::bitset<0>(), false);
1759 switch (measConfig.speedStatePars.timeToTriggerSf.sfMedium)
1760 {
1761 case 25:
1762 SerializeEnum(4, 0);
1763 break;
1764 case 50:
1765 SerializeEnum(4, 1);
1766 break;
1767 case 75:
1768 SerializeEnum(4, 2);
1769 break;
1770 case 100:
1771 default:
1772 SerializeEnum(4, 3);
1773 }
1774
1775 switch (measConfig.speedStatePars.timeToTriggerSf.sfHigh)
1776 {
1777 case 25:
1778 SerializeEnum(4, 0);
1779 break;
1780 case 50:
1781 SerializeEnum(4, 1);
1782 break;
1783 case 75:
1784 SerializeEnum(4, 2);
1785 break;
1786 case 100:
1787 default:
1788 SerializeEnum(4, 3);
1789 }
1790 }
1791 }
1792}
1793
1794void
1796 LteRrcSap::NonCriticalExtensionConfiguration nonCriticalExtension) const
1797{
1798 // 3 optional fields. Extension marker not present.
1799 std::bitset<3> noncriticalExtension_v1020;
1800 noncriticalExtension_v1020.set(
1801 2,
1802 !nonCriticalExtension.sCellToReleaseList.empty()); // sCellToReleaseList-r10
1803 noncriticalExtension_v1020.set(
1804 1,
1805 !nonCriticalExtension.sCellToAddModList.empty()); // sCellToAddModList-r10
1806 noncriticalExtension_v1020.set(
1807 0,
1808 false); // No nonCriticalExtension RRCConnectionReconfiguration-v1130-IEs
1809 SerializeSequence(noncriticalExtension_v1020, false);
1810
1811 if (!nonCriticalExtension.sCellToReleaseList.empty())
1812 {
1813 SerializeSequenceOf(nonCriticalExtension.sCellToReleaseList.size(), MAX_OBJECT_ID, 1);
1814 for (uint8_t sCellIndex : nonCriticalExtension.sCellToReleaseList)
1815 {
1816 SerializeInteger(sCellIndex, 1, 7); // sCellIndex-r10
1817 }
1818 }
1819
1820 if (!nonCriticalExtension.sCellToAddModList.empty())
1821 {
1822 SerializeSequenceOf(nonCriticalExtension.sCellToAddModList.size(), MAX_OBJECT_ID, 1);
1823 for (auto& it : nonCriticalExtension.sCellToAddModList)
1824 {
1825 std::bitset<4> sCellToAddMod_r10;
1826 sCellToAddMod_r10.set(3, true); // sCellIndex
1827 sCellToAddMod_r10.set(2, true); // CellIdentification
1828 sCellToAddMod_r10.set(1, true); // RadioResourceConfigCommonSCell
1829 sCellToAddMod_r10.set(
1830 0,
1831 it.haveRadioResourceConfigDedicatedSCell); // No nonCriticalExtension RRC
1832 SerializeSequence(sCellToAddMod_r10, false);
1833 SerializeInteger(it.sCellIndex, 1, 7); // sCellIndex-r10
1834
1835 // Serialize CellIdentification
1836 std::bitset<2> cellIdentification_r10;
1837 cellIdentification_r10.set(1, true); // phyCellId-r10
1838 cellIdentification_r10.set(0, true); // dl-CarrierFreq-r10
1839 SerializeSequence(cellIdentification_r10, false);
1840
1841 SerializeInteger(it.cellIdentification.physCellId, 1, 65536);
1842 SerializeInteger(it.cellIdentification.dlCarrierFreq, 1, MAX_EARFCN);
1843
1844 // Serialize RadioResourceConfigCommonSCell
1845 SerializeRadioResourceConfigCommonSCell(it.radioResourceConfigCommonSCell);
1846
1847 if (it.haveRadioResourceConfigDedicatedSCell)
1848 {
1849 // Serialize RadioResourceConfigDedicatedSCell
1850 SerializeRadioResourceDedicatedSCell(it.radioResourceConfigDedicatedSCell);
1851 }
1852 }
1853 }
1854}
1855
1856void
1859{
1860 // 2 optional fields. Extension marker not present.
1861 std::bitset<2> radioResourceConfigCommonSCell_r10;
1862 radioResourceConfigCommonSCell_r10.set(1, rrccsc.haveNonUlConfiguration); // NonUlConfiguration
1863 radioResourceConfigCommonSCell_r10.set(0, rrccsc.haveUlConfiguration); // UlConfiguration
1864 SerializeSequence(radioResourceConfigCommonSCell_r10, false);
1865
1866 if (rrccsc.haveNonUlConfiguration)
1867 {
1868 // 5 optional fields. Extension marker not present.
1869 std::bitset<5> nonUlConfiguration_r10;
1870 nonUlConfiguration_r10.set(4, true); // Dl- bandwidth --> convert in enum
1871 nonUlConfiguration_r10.set(3, true); // AntennaInfoCommon-r10
1872 nonUlConfiguration_r10.set(2, false); // phich-Config-r10 Not Implemented
1873 nonUlConfiguration_r10.set(1, true); // pdschConfigCommon
1874 nonUlConfiguration_r10.set(0, false); // Tdd-Config-r10 Not Implemented
1875 SerializeSequence(nonUlConfiguration_r10, false);
1876
1878
1879 std::bitset<1> antennaInfoCommon_r10;
1880 antennaInfoCommon_r10.set(0, true);
1881 SerializeSequence(antennaInfoCommon_r10, false);
1883
1884 std::bitset<2> pdschConfigCommon_r10;
1885 pdschConfigCommon_r10.set(1, true);
1886 pdschConfigCommon_r10.set(0, true);
1887 SerializeSequence(pdschConfigCommon_r10, false);
1888
1891 }
1892 if (rrccsc.haveUlConfiguration)
1893 {
1894 // Serialize Ul Configuration
1895 // 7 optional fields. Extension marker present.
1896 std::bitset<7> UlConfiguration_r10;
1897 UlConfiguration_r10.set(6, true); // ul-Configuration-r10
1898 UlConfiguration_r10.set(5, false); // p-Max-r10 Not Implemented
1899 UlConfiguration_r10.set(4, true); // uplinkPowerControlCommonSCell-r10
1900 UlConfiguration_r10.set(3, false); // soundingRS-UL-ConfigCommon-r10
1901 UlConfiguration_r10.set(2, false); // ul-CyclicPrefixLength-r10
1902 UlConfiguration_r10.set(1, true); // prach-ConfigSCell-r10
1903 UlConfiguration_r10.set(0, false); // pusch-ConfigCommon-r10 Not Implemented
1904 SerializeSequence(UlConfiguration_r10, true);
1905
1906 // Serialize ulFreqInfo
1907 std::bitset<3> FreqInfo_r10;
1908 FreqInfo_r10.set(2, true); // ulCarrierFreq
1909 FreqInfo_r10.set(1, true); // UlBandwidth
1910 FreqInfo_r10.set(0, false); // additionalSpectrumEmissionSCell-r10 Not Implemented
1911 SerializeSequence(FreqInfo_r10, false);
1912
1915
1916 // Serialize UlPowerControlCommonSCell
1917 std::bitset<2> UlPowerControlCommonSCell_r10;
1918 UlPowerControlCommonSCell_r10.set(1, false); // p0-NominalPUSCH-r10 Not Implemented
1919 UlPowerControlCommonSCell_r10.set(0, true); // alpha
1920 SerializeSequence(UlPowerControlCommonSCell_r10, false);
1921
1923
1924 // Serialize soundingRs-UlConfigCommon
1925 // Not Implemented
1926
1927 // Serialize PrachConfigSCell
1928 std::bitset<1> prachConfigSCell_r10;
1929 prachConfigSCell_r10.set(0, true);
1930 SerializeSequence(prachConfigSCell_r10, false);
1932 }
1933}
1934
1935void
1938{
1939 // Serialize RadioResourceConfigDedicatedSCell
1940 std::bitset<1> RadioResourceConfigDedicatedSCell_r10;
1941 RadioResourceConfigDedicatedSCell_r10.set(0, true);
1942 SerializeSequence(RadioResourceConfigDedicatedSCell_r10, false);
1943
1946}
1947
1948void
1951{
1952 std::bitset<2> pcdscOpt;
1953 pcdscOpt.set(1, pcdsc.haveNonUlConfiguration);
1954 pcdscOpt.set(0, pcdsc.haveUlConfiguration);
1955 SerializeSequence(pcdscOpt, true);
1956
1957 if (pcdsc.haveNonUlConfiguration)
1958 {
1959 // Serialize NonUl configuration
1960 std::bitset<4> nulOpt;
1961 nulOpt.set(3, pcdsc.haveAntennaInfoDedicated);
1962 nulOpt.set(2, false); // crossCarrierSchedulingConfig-r10 Not Implemented
1963 nulOpt.set(1, false); // csi-RS-Config-r10 Not Implemented
1964 nulOpt.set(0, pcdsc.havePdschConfigDedicated); // pdsch-ConfigDedicated-r10
1965 SerializeSequence(nulOpt, false);
1966
1967 if (pcdsc.haveAntennaInfoDedicated)
1968 {
1969 // Serialize antennaInfo choice
1970 // 2 options. Selected: 0 ("explicitValue" of type "AntennaInfoDedicated")
1971 SerializeChoice(2, 0, false);
1972
1973 // Serialize AntennaInfoDedicated sequence
1974 // 1 optional parameter, not present. No extension marker.
1975 SerializeSequence(std::bitset<1>(0), false);
1976
1977 // Serialize transmissionMode
1978 // Assuming the value in the struct is the enum index
1980
1981 // Serialize ue-TransmitAntennaSelection choice
1982 SerializeChoice(2, 0, false);
1983
1984 // Serialize release
1985 SerializeNull();
1986 }
1987 if (pcdsc.havePdschConfigDedicated)
1988 {
1989 // Serialize Pdsch-ConfigDedicated Sequence:
1990 // 0 optional / default fields, no extension marker.
1991 SerializeSequence(std::bitset<0>(), false);
1992
1993 // Serialize p-a
1994 // Assuming the value in the struct is the enum index
1996
1997 // Serialize release
1998 SerializeNull();
1999 }
2000 }
2001 if (pcdsc.haveUlConfiguration)
2002 {
2003 // Serialize Ul Configuration
2004 std::bitset<7> ulOpt;
2005 ulOpt.set(6, pcdsc.haveAntennaInfoUlDedicated); // antennaInfoUL-r10
2006 ulOpt.set(5, false); // pusch-ConfigDedicatedSCell-r10 not present
2007 ulOpt.set(4, false); // uplinkPowerControlDedicatedSCell-r10 not present
2008 ulOpt.set(3, false); // cqi-ReportConfigSCell-r10 not present
2009 ulOpt.set(2, pcdsc.haveSoundingRsUlConfigDedicated); // soundingRS-UL-ConfigDedicated-r10
2010 ulOpt.set(1, false); // soundingRS-UL-ConfigDedicated-v1020 not present
2011 ulOpt.set(0, false); // soundingRS-UL-ConfigDedicatedAperiodic-r10 not present
2012 SerializeSequence(ulOpt, false);
2013
2015 {
2016 // Serialize antennaInfo choice
2017 // 2 options. Selected: 0 ("explicitValue" of type "AntennaInfoDedicated")
2018 SerializeChoice(2, 0, false);
2019
2020 // Serialize AntennaInfoDedicated sequence
2021 // 1 optional parameter, not present. No extension marker.
2022 SerializeSequence(std::bitset<1>(0), false);
2023
2024 // Serialize transmissionMode
2025 // Assuming the value in the struct is the enum index
2027
2028 // Serialize ue-TransmitAntennaSelection choice
2029 SerializeChoice(2, 0, false);
2030
2031 // Serialize release
2032 SerializeNull();
2033 }
2035 {
2036 // Serialize SoundingRS-UL-ConfigDedicated choice:
2037 switch (pcdsc.soundingRsUlConfigDedicated.type)
2038 {
2040 SerializeChoice(2, 0, false);
2041 SerializeNull();
2042 break;
2043
2045 default:
2046 // 2 options, selected: 1 (setup)
2047 SerializeChoice(2, 1, false);
2048
2049 // Serialize setup sequence
2050 // 0 optional / default fields, no extension marker.
2051 SerializeSequence(std::bitset<0>(), false);
2052
2053 // Serialize srs-Bandwidth
2055
2056 // Serialize srs-HoppingBandwidth
2057 SerializeEnum(4, 0);
2058
2059 // Serialize freqDomainPosition
2060 SerializeInteger(0, 0, 23);
2061
2062 // Serialize duration
2063 SerializeBoolean(false);
2064
2065 // Serialize srs-ConfigIndex
2067
2068 // Serialize transmissionComb
2069 SerializeInteger(0, 0, 1);
2070
2071 // Serialize cyclicShift
2072 SerializeEnum(8, 0);
2073
2074 break;
2075 }
2076 }
2077 }
2078}
2079
2082 Buffer::Iterator bIterator)
2083{
2084 int thresholdEutraChoice;
2085 int range;
2086 bIterator = DeserializeChoice(2, false, &thresholdEutraChoice, bIterator);
2087
2088 switch (thresholdEutraChoice)
2089 {
2090 case 0:
2092 bIterator = DeserializeInteger(&range, 0, 97, bIterator);
2093 thresholdEutra->range = range;
2094 break;
2095 case 1:
2096 default:
2098 bIterator = DeserializeInteger(&range, 0, 34, bIterator);
2099 thresholdEutra->range = range;
2100 }
2101
2102 return bIterator;
2103}
2104
2107{
2108 int n;
2109 bIterator = DeserializeEnum(31, &n, bIterator);
2110 switch (n)
2111 {
2112 case 0:
2113 *qOffsetRange = -24;
2114 break;
2115 case 1:
2116 *qOffsetRange = -22;
2117 break;
2118 case 2:
2119 *qOffsetRange = -20;
2120 break;
2121 case 3:
2122 *qOffsetRange = -18;
2123 break;
2124 case 4:
2125 *qOffsetRange = -16;
2126 break;
2127 case 5:
2128 *qOffsetRange = -14;
2129 break;
2130 case 6:
2131 *qOffsetRange = -12;
2132 break;
2133 case 7:
2134 *qOffsetRange = -10;
2135 break;
2136 case 8:
2137 *qOffsetRange = -8;
2138 break;
2139 case 9:
2140 *qOffsetRange = -6;
2141 break;
2142 case 10:
2143 *qOffsetRange = -5;
2144 break;
2145 case 11:
2146 *qOffsetRange = -4;
2147 break;
2148 case 12:
2149 *qOffsetRange = -3;
2150 break;
2151 case 13:
2152 *qOffsetRange = -2;
2153 break;
2154 case 14:
2155 *qOffsetRange = -1;
2156 break;
2157 case 15:
2158 *qOffsetRange = 0;
2159 break;
2160 case 16:
2161 *qOffsetRange = 1;
2162 break;
2163 case 17:
2164 *qOffsetRange = 2;
2165 break;
2166 case 18:
2167 *qOffsetRange = 3;
2168 break;
2169 case 19:
2170 *qOffsetRange = 4;
2171 break;
2172 case 20:
2173 *qOffsetRange = 5;
2174 break;
2175 case 21:
2176 *qOffsetRange = 6;
2177 break;
2178 case 22:
2179 *qOffsetRange = 8;
2180 break;
2181 case 23:
2182 *qOffsetRange = 10;
2183 break;
2184 case 24:
2185 *qOffsetRange = 12;
2186 break;
2187 case 25:
2188 *qOffsetRange = 14;
2189 break;
2190 case 26:
2191 *qOffsetRange = 16;
2192 break;
2193 case 27:
2194 *qOffsetRange = 18;
2195 break;
2196 case 28:
2197 *qOffsetRange = 20;
2198 break;
2199 case 29:
2200 *qOffsetRange = 22;
2201 break;
2202 case 30:
2203 default:
2204 *qOffsetRange = 24;
2205 }
2206 return bIterator;
2207}
2208
2211 LteRrcSap::RadioResourceConfigDedicated* radioResourceConfigDedicated,
2212 Buffer::Iterator bIterator)
2213{
2214 // Deserialize RadioResourceConfigDedicated sequence
2215 std::bitset<6> optionalFieldsPresent = std::bitset<6>();
2216 bIterator = DeserializeSequence(&optionalFieldsPresent, true, bIterator);
2217
2218 if (optionalFieldsPresent[5])
2219 {
2220 // Deserialize srb-ToAddModList
2221 bIterator =
2222 DeserializeSrbToAddModList(&(radioResourceConfigDedicated->srbToAddModList), bIterator);
2223 }
2224
2225 if (optionalFieldsPresent[4])
2226 {
2227 // Deserialize drb-ToAddModList
2228 bIterator =
2229 DeserializeDrbToAddModList(&(radioResourceConfigDedicated->drbToAddModList), bIterator);
2230 }
2231
2232 if (optionalFieldsPresent[3])
2233 {
2234 // Deserialize drb-ToReleaseList
2235 int n;
2236 int val;
2237 bIterator = DeserializeSequenceOf(&n, MAX_DRB, 1, bIterator);
2238 for (int i = 0; i < n; i++)
2239 {
2240 bIterator = DeserializeInteger(&val, 1, 32, bIterator);
2241 radioResourceConfigDedicated->drbToReleaseList.push_back(val);
2242 }
2243 }
2244
2245 if (optionalFieldsPresent[2])
2246 {
2247 // Deserialize mac-MainConfig
2248 // ...
2249 }
2250
2251 if (optionalFieldsPresent[1])
2252 {
2253 // Deserialize sps-Config
2254 // ...
2255 }
2256
2257 radioResourceConfigDedicated->havePhysicalConfigDedicated = optionalFieldsPresent[0];
2258 if (optionalFieldsPresent[0])
2259 {
2260 // Deserialize physicalConfigDedicated
2262 &radioResourceConfigDedicated->physicalConfigDedicated,
2263 bIterator);
2264 }
2265
2266 return bIterator;
2267}
2268
2270RrcAsn1Header::DeserializeSrbToAddModList(std::list<LteRrcSap::SrbToAddMod>* srbToAddModList,
2271 Buffer::Iterator bIterator)
2272{
2273 int numElems;
2274 bIterator = DeserializeSequenceOf(&numElems, 2, 1, bIterator);
2275
2276 srbToAddModList->clear();
2277
2278 // Deserialize SRB-ToAddMod elements
2279 for (int i = 0; i < numElems; i++)
2280 {
2281 LteRrcSap::SrbToAddMod srbToAddMod;
2282 // Deserialize SRB-ToAddMod sequence
2283 // 2 optional fields, extension marker present
2284 std::bitset<2> optionalFields;
2285 bIterator = DeserializeSequence(&optionalFields, true, bIterator);
2286
2287 // Deserialize srbIdentity
2288 int n;
2289 bIterator = DeserializeInteger(&n, 1, 2, bIterator);
2290 srbToAddMod.srbIdentity = n;
2291
2292 if (optionalFields[1])
2293 {
2294 // Deserialize rlcConfig choice
2295 // ...
2296 }
2297
2298 if (optionalFields[0])
2299 {
2300 // Deserialize logicalChannelConfig choice
2301 int sel;
2302 bIterator = DeserializeChoice(2, false, &sel, bIterator);
2303
2304 // Deserialize logicalChannelConfig defaultValue
2305 if (sel == 1)
2306 {
2307 bIterator = DeserializeNull(bIterator);
2308 }
2309
2310 // Deserialize logicalChannelConfig explicitValue
2311 else if (sel == 0)
2312 {
2313 bIterator =
2315 }
2316 }
2317 srbToAddModList->insert(srbToAddModList->end(), srbToAddMod);
2318 }
2319
2320 return bIterator;
2321}
2322
2324RrcAsn1Header::DeserializeDrbToAddModList(std::list<LteRrcSap::DrbToAddMod>* drbToAddModList,
2325 Buffer::Iterator bIterator)
2326{
2327 int n;
2328 int val;
2329 bIterator = DeserializeSequenceOf(&n, MAX_DRB, 1, bIterator);
2330
2331 drbToAddModList->clear();
2332
2333 for (int i = 0; i < n; i++)
2334 {
2335 LteRrcSap::DrbToAddMod drbToAddMod;
2336
2337 std::bitset<5> optionalFields;
2338 bIterator = DeserializeSequence(&optionalFields, true, bIterator);
2339
2340 if (optionalFields[4])
2341 {
2342 // Deserialize epsBearerIdentity
2343 bIterator = DeserializeInteger(&val, 0, 15, bIterator);
2344 drbToAddMod.epsBearerIdentity = val;
2345 }
2346
2347 bIterator = DeserializeInteger(&val, 1, 32, bIterator);
2348 drbToAddMod.drbIdentity = val;
2349
2350 if (optionalFields[3])
2351 {
2352 // Deserialize pdcp-Config
2353 // ...
2354 }
2355
2356 if (optionalFields[2])
2357 {
2358 // Deserialize RLC-Config
2359 int chosen;
2360 bIterator = DeserializeChoice(4, true, &chosen, bIterator);
2361
2362 int sel;
2363 std::bitset<0> bitset0;
2364 switch (chosen)
2365 {
2366 case 0:
2368
2369 // Deserialize UL-AM-RLC
2370 bIterator = DeserializeSequence(&bitset0, false, bIterator);
2371 bIterator = DeserializeEnum(64, &sel, bIterator); // t-PollRetransmit
2372 bIterator = DeserializeEnum(8, &sel, bIterator); // pollPDU
2373 bIterator = DeserializeEnum(16, &sel, bIterator); // pollByte
2374 bIterator = DeserializeEnum(8, &sel, bIterator); // maxRetxThreshold
2375
2376 // Deserialize DL-AM-RLC
2377 bIterator = DeserializeSequence(&bitset0, false, bIterator);
2378 bIterator = DeserializeEnum(32, &sel, bIterator); // t-Reordering
2379 bIterator = DeserializeEnum(64, &sel, bIterator); // t-StatusProhibit
2380 break;
2381
2382 case 1:
2384
2385 // Deserialize UL-UM-RLC
2386 bIterator = DeserializeSequence(&bitset0, false, bIterator);
2387 bIterator = DeserializeEnum(2, &sel, bIterator); // sn-FieldLength
2388
2389 // Deserialize DL-UM-RLC
2390 bIterator = DeserializeSequence(&bitset0, false, bIterator);
2391 bIterator = DeserializeEnum(2, &sel, bIterator); // sn-FieldLength
2392 bIterator = DeserializeEnum(32, &sel, bIterator); // t-Reordering
2393 break;
2394
2395 case 2:
2397
2398 // Deserialize UL-UM-RLC
2399 bIterator = DeserializeSequence(&bitset0, false, bIterator);
2400 bIterator = DeserializeEnum(2, &sel, bIterator); // sn-FieldLength
2401 break;
2402
2403 case 3:
2405
2406 // Deserialize DL-UM-RLC
2407 bIterator = DeserializeSequence(&bitset0, false, bIterator);
2408 bIterator = DeserializeEnum(2, &sel, bIterator); // sn-FieldLength
2409 bIterator = DeserializeEnum(32, &sel, bIterator); // t-Reordering
2410 break;
2411 }
2412 }
2413
2414 if (optionalFields[1])
2415 {
2416 bIterator = DeserializeInteger(&val, 3, 10, bIterator);
2417 drbToAddMod.logicalChannelIdentity = val;
2418 }
2419
2420 if (optionalFields[0])
2421 {
2422 bIterator =
2424 }
2425
2426 drbToAddModList->insert(drbToAddModList->end(), drbToAddMod);
2427 }
2428 return bIterator;
2429}
2430
2433 LteRrcSap::LogicalChannelConfig* logicalChannelConfig,
2434 Buffer::Iterator bIterator)
2435{
2436 int n;
2437
2438 // Deserialize LogicalChannelConfig sequence
2439 // 1 optional field, extension marker is present.
2440 std::bitset<1> bitset1;
2441 bIterator = DeserializeSequence(&bitset1, true, bIterator);
2442
2443 if (bitset1[0])
2444 {
2445 // Deserialize ul-SpecificParameters sequence
2446 bIterator = DeserializeSequence(&bitset1, false, bIterator);
2447
2448 // Deserialize priority
2449 bIterator = DeserializeInteger(&n, 1, 16, bIterator);
2450 logicalChannelConfig->priority = n;
2451
2452 // Deserialize prioritisedBitRate
2453 bIterator = DeserializeEnum(16, &n, bIterator);
2454 uint16_t prioritizedBitRateKbps;
2455
2456 switch (n)
2457 {
2458 case 0:
2459 prioritizedBitRateKbps = 0;
2460 break;
2461 case 1:
2462 prioritizedBitRateKbps = 8;
2463 break;
2464 case 2:
2465 prioritizedBitRateKbps = 16;
2466 break;
2467 case 3:
2468 prioritizedBitRateKbps = 32;
2469 break;
2470 case 4:
2471 prioritizedBitRateKbps = 64;
2472 break;
2473 case 5:
2474 prioritizedBitRateKbps = 128;
2475 break;
2476 case 6:
2477 prioritizedBitRateKbps = 256;
2478 break;
2479 case 7:
2480 prioritizedBitRateKbps = 10000;
2481 break;
2482 default:
2483 prioritizedBitRateKbps = 10000;
2484 }
2485 logicalChannelConfig->prioritizedBitRateKbps = prioritizedBitRateKbps;
2486
2487 // Deserialize bucketSizeDuration
2488 bIterator = DeserializeEnum(8, &n, bIterator);
2489 uint16_t bucketSizeDurationMs;
2490 switch (n)
2491 {
2492 case 0:
2493 bucketSizeDurationMs = 50;
2494 break;
2495 case 1:
2496 bucketSizeDurationMs = 100;
2497 break;
2498 case 2:
2499 bucketSizeDurationMs = 150;
2500 break;
2501 case 3:
2502 bucketSizeDurationMs = 300;
2503 break;
2504 case 4:
2505 bucketSizeDurationMs = 500;
2506 break;
2507 case 5:
2508 bucketSizeDurationMs = 1000;
2509 break;
2510 default:
2511 bucketSizeDurationMs = 1000;
2512 }
2513 logicalChannelConfig->bucketSizeDurationMs = bucketSizeDurationMs;
2514
2515 if (bitset1[0])
2516 {
2517 // Deserialize logicalChannelGroup
2518 bIterator = DeserializeInteger(&n, 0, 3, bIterator);
2519 logicalChannelConfig->logicalChannelGroup = n;
2520 }
2521 }
2522 return bIterator;
2523}
2524
2527 LteRrcSap::PhysicalConfigDedicated* physicalConfigDedicated,
2528 Buffer::Iterator bIterator)
2529{
2530 std::bitset<10> optionalFieldPresent;
2531 bIterator = DeserializeSequence(&optionalFieldPresent, true, bIterator);
2532
2533 physicalConfigDedicated->havePdschConfigDedicated = optionalFieldPresent[9];
2534 if (optionalFieldPresent[9])
2535 {
2536 // Deserialize pdsch-ConfigDedicated
2537 std::bitset<0> bitset0;
2538 bIterator = DeserializeSequence(&bitset0, false, bIterator);
2539
2540 int slct;
2541
2542 // Deserialize p-a
2543 bIterator = DeserializeEnum(8, &slct, bIterator);
2544 physicalConfigDedicated->pdschConfigDedicated.pa = slct;
2545
2546 bIterator = DeserializeNull(bIterator);
2547 }
2548 if (optionalFieldPresent[8])
2549 {
2550 // Deserialize pucch-ConfigDedicated
2551 // ...
2552 }
2553 if (optionalFieldPresent[7])
2554 {
2555 // Deserialize pusch-ConfigDedicated
2556 // ...
2557 }
2558 if (optionalFieldPresent[6])
2559 {
2560 // Deserialize uplinkPowerControlDedicated
2561 // ...
2562 }
2563 if (optionalFieldPresent[5])
2564 {
2565 // Deserialize tpc-PDCCH-ConfigPUCCH
2566 // ...
2567 }
2568 if (optionalFieldPresent[4])
2569 {
2570 // Deserialize tpc-PDCCH-ConfigPUSCH
2571 // ...
2572 }
2573 if (optionalFieldPresent[3])
2574 {
2575 // Deserialize cqi-ReportConfig
2576 // ...
2577 }
2578 physicalConfigDedicated->haveSoundingRsUlConfigDedicated = optionalFieldPresent[2];
2579 if (optionalFieldPresent[2])
2580 {
2581 // Deserialize soundingRS-UL-ConfigDedicated
2582 int sel;
2583 bIterator = DeserializeChoice(2, false, &sel, bIterator);
2584
2585 if (sel == 0)
2586 {
2587 physicalConfigDedicated->soundingRsUlConfigDedicated.type =
2589
2590 bIterator = DeserializeNull(bIterator);
2591 }
2592
2593 else if (sel == 1)
2594 {
2595 physicalConfigDedicated->soundingRsUlConfigDedicated.type =
2597
2598 std::bitset<0> bitset0;
2599 bIterator = DeserializeSequence(&bitset0, false, bIterator);
2600
2601 int slct;
2602
2603 // Deserialize srs-Bandwidth
2604 bIterator = DeserializeEnum(4, &slct, bIterator);
2605 physicalConfigDedicated->soundingRsUlConfigDedicated.srsBandwidth = slct;
2606
2607 // Deserialize srs-HoppingBandwidth
2608 bIterator = DeserializeEnum(4, &slct, bIterator);
2609
2610 // Deserialize freqDomainPosition
2611 bIterator = DeserializeInteger(&slct, 0, 23, bIterator);
2612
2613 // Deserialize duration
2614 bool duration;
2615 bIterator = DeserializeBoolean(&duration, bIterator);
2616
2617 // Deserialize srs-ConfigIndex
2618 bIterator = DeserializeInteger(&slct, 0, 1023, bIterator);
2619 physicalConfigDedicated->soundingRsUlConfigDedicated.srsConfigIndex = slct;
2620
2621 // Deserialize transmissionComb
2622 bIterator = DeserializeInteger(&slct, 0, 1, bIterator);
2623
2624 // Deserialize cyclicShift
2625 bIterator = DeserializeEnum(8, &slct, bIterator);
2626 }
2627 }
2628 physicalConfigDedicated->haveAntennaInfoDedicated = optionalFieldPresent[1];
2629 if (optionalFieldPresent[1])
2630 {
2631 // Deserialize antennaInfo
2632 int sel;
2633 bIterator = DeserializeChoice(2, false, &sel, bIterator);
2634 if (sel == 1)
2635 {
2636 bIterator = DeserializeNull(bIterator);
2637 }
2638 else if (sel == 0)
2639 {
2640 std::bitset<1> codebookSubsetRestrictionPresent;
2641 bIterator = DeserializeSequence(&codebookSubsetRestrictionPresent, false, bIterator);
2642
2643 int txmode;
2644 bIterator = DeserializeEnum(8, &txmode, bIterator);
2645 physicalConfigDedicated->antennaInfo.transmissionMode = txmode;
2646
2647 if (codebookSubsetRestrictionPresent[0])
2648 {
2649 // Deserialize codebookSubsetRestriction
2650 // ...
2651 }
2652
2653 int txantennaselchosen;
2654 bIterator = DeserializeChoice(2, false, &txantennaselchosen, bIterator);
2655 if (txantennaselchosen == 0)
2656 {
2657 // Deserialize ue-TransmitAntennaSelection release
2658 bIterator = DeserializeNull(bIterator);
2659 }
2660 else if (txantennaselchosen == 1)
2661 {
2662 // Deserialize ue-TransmitAntennaSelection setup
2663 // ...
2664 }
2665 }
2666 }
2667 if (optionalFieldPresent[0])
2668 {
2669 // Deserialize schedulingRequestConfig
2670 // ...
2671 }
2672 return bIterator;
2673}
2674
2675void
2676RrcAsn1Header::Print(std::ostream& os) const
2677{
2678 NS_LOG_FUNCTION(this << &os);
2679 NS_FATAL_ERROR("RrcAsn1Header Print() function must also specify "
2680 "LteRrcSap::RadioResourceConfigDedicated as a second argument");
2681}
2682
2686 Buffer::Iterator bIterator)
2687{
2688 NS_LOG_FUNCTION(this);
2689 std::bitset<2> nonCriticalExtension_v890;
2690 bIterator = DeserializeSequence(&nonCriticalExtension_v890, false, bIterator);
2691
2692 if (nonCriticalExtension_v890[0])
2693 {
2694 // Continue to analyze future Release optional fields
2695 std::bitset<3> nonCriticalExtension_v920;
2696 bIterator = DeserializeSequence(&nonCriticalExtension_v920, false, bIterator);
2697 if (nonCriticalExtension_v920[0])
2698 {
2699 // Continue to deserialize future Release optional fields
2700 std::bitset<3> nonCriticalExtension_v1020;
2701 bIterator = DeserializeSequence(&nonCriticalExtension_v1020, false, bIterator);
2702
2703 if (nonCriticalExtension_v1020[2])
2704 {
2705 // sCellToReleaseList-r10
2706 int numElems;
2707
2708 bIterator = DeserializeSequenceOf(&numElems, MAX_OBJECT_ID, 1, bIterator);
2709 nonCriticalExtension->sCellToReleaseList.clear();
2710
2711 for (int i = 0; i < numElems; i++)
2712 {
2713 // Deserialize SCellIndex-r10
2714 int sCellIndex;
2715 bIterator = DeserializeInteger(&sCellIndex, 1, 7, bIterator);
2716 nonCriticalExtension->sCellToReleaseList.push_back(sCellIndex);
2717 }
2718 }
2719
2720 if (nonCriticalExtension_v1020[1])
2721 {
2722 // sCellToAddModList-r10
2723
2724 int numElems;
2725 bIterator = DeserializeSequenceOf(&numElems, MAX_OBJECT_ID, 1, bIterator);
2726 nonCriticalExtension->sCellToAddModList.clear();
2727 // Deserialize SCellToAddMod
2728 for (int i = 0; i < numElems; i++)
2729 {
2730 std::bitset<4> sCellToAddMod_r10;
2731 bIterator = DeserializeSequence(&sCellToAddMod_r10, false, bIterator);
2732
2734 // Deserialize sCellIndex
2735 NS_ASSERT(sCellToAddMod_r10[3]); // sCellIndex
2736 int n;
2737 bIterator = DeserializeInteger(&n, 1, 7, bIterator);
2738 sctam.sCellIndex = n;
2739 // Deserialize CellIdentification
2740 NS_ASSERT(sCellToAddMod_r10[2]); // CellIdentification
2741 bIterator = DeserializeCellIdentification(&sctam.cellIdentification, bIterator);
2742
2743 // Deserialize RadioResourceConfigCommonSCell
2744 NS_ASSERT(sCellToAddMod_r10[1]);
2747 bIterator);
2748 if (sCellToAddMod_r10[0])
2749 {
2751 // Deserialize RadioResourceConfigDedicatedSCell
2754 bIterator);
2755 }
2756 else
2757 {
2759 }
2760
2761 nonCriticalExtension->sCellToAddModList.push_back(sctam);
2762 }
2763 }
2764
2765 NS_ASSERT(!nonCriticalExtension_v1020[0]); // No nonCriticalExtension
2766 // RRCConnectionReconfiguration-v1130-IEs
2767 }
2768 }
2769
2770 return bIterator;
2771}
2772
2775 Buffer::Iterator bIterator)
2776{
2777 NS_LOG_FUNCTION(this);
2778 std::bitset<2> cellIdentification_r10;
2779 bIterator = DeserializeSequence(&cellIdentification_r10, false, bIterator);
2780 NS_ASSERT(cellIdentification_r10[1]); // phyCellId-r10
2781 int n1;
2782 bIterator = DeserializeInteger(&n1, 1, 65536, bIterator);
2783 ci->physCellId = n1;
2784 int n2;
2785 NS_ASSERT(cellIdentification_r10[0]); // dl-CarrierFreq-r10
2786 bIterator = DeserializeInteger(&n2, 1, MAX_EARFCN, bIterator);
2787 ci->dlCarrierFreq = n2;
2788
2789 return bIterator;
2790}
2791
2795 Buffer::Iterator bIterator)
2796{
2797 NS_LOG_FUNCTION(this);
2798 std::bitset<2> radioResourceConfigCommonSCell_r10;
2799 bIterator = DeserializeSequence(&radioResourceConfigCommonSCell_r10, false, bIterator);
2800 rrccsc->haveNonUlConfiguration = radioResourceConfigCommonSCell_r10[1];
2801 rrccsc->haveUlConfiguration = radioResourceConfigCommonSCell_r10[0];
2802 if (rrccsc->haveNonUlConfiguration)
2803 {
2804 std::bitset<5> nonUlConfiguration_r10;
2805 bIterator = DeserializeSequence(&nonUlConfiguration_r10, false, bIterator);
2806 int n;
2807 bIterator = DeserializeInteger(&n, 6, 100, bIterator);
2808 rrccsc->nonUlConfiguration.dlBandwidth = n;
2809
2810 std::bitset<1> antennaInfoCommon_r10;
2811 bIterator = DeserializeSequence(&antennaInfoCommon_r10, false, bIterator);
2812 bIterator = DeserializeInteger(&n, 0, 65536, bIterator);
2814
2815 std::bitset<2> pdschConfigCommon_r10;
2816 bIterator = DeserializeSequence(&pdschConfigCommon_r10, false, bIterator);
2817 bIterator = DeserializeInteger(&n, -60, 50, bIterator);
2819 bIterator = DeserializeInteger(&n, 0, 3, bIterator);
2821 }
2822 if (rrccsc->haveUlConfiguration)
2823 {
2824 std::bitset<7> UlConfiguration_r10;
2825 bIterator = DeserializeSequence(&UlConfiguration_r10, true, bIterator);
2826
2827 std::bitset<3> FreqInfo_r10;
2828 bIterator = DeserializeSequence(&FreqInfo_r10, false, bIterator);
2829 int n;
2830 bIterator = DeserializeInteger(&n, 0, MAX_EARFCN, bIterator);
2832 bIterator = DeserializeInteger(&n, 6, 100, bIterator);
2834
2835 std::bitset<2> UlPowerControlCommonSCell_r10;
2836 bIterator = DeserializeSequence(&UlPowerControlCommonSCell_r10, false, bIterator);
2837 bIterator = DeserializeInteger(&n, 0, 65536, bIterator);
2839
2840 std::bitset<1> prachConfigSCell_r10;
2841 bIterator = DeserializeSequence(&prachConfigSCell_r10, false, bIterator);
2842 bIterator = DeserializeInteger(&n, 0, 256, bIterator);
2844 }
2845
2846 return bIterator;
2847}
2848
2852 Buffer::Iterator bIterator)
2853{
2854 NS_LOG_FUNCTION(this);
2855 std::bitset<1> RadioResourceConfigDedicatedSCell_r10;
2856 bIterator = DeserializeSequence(&RadioResourceConfigDedicatedSCell_r10, false, bIterator);
2857 bIterator =
2859
2860 return bIterator;
2861}
2862
2866 Buffer::Iterator bIterator)
2867{
2868 NS_LOG_FUNCTION(this);
2869 std::bitset<2> pcdscOpt;
2870 bIterator = DeserializeSequence(&pcdscOpt, true, bIterator);
2871 pcdsc->haveNonUlConfiguration = pcdscOpt[1];
2872 pcdsc->haveUlConfiguration = pcdscOpt[0];
2873 if (pcdsc->haveNonUlConfiguration)
2874 {
2875 std::bitset<4> nulOpt;
2876 bIterator = DeserializeSequence(&nulOpt, false, bIterator);
2877 pcdsc->haveAntennaInfoDedicated = nulOpt[3];
2878 NS_ASSERT(!nulOpt[2]); // crossCarrierSchedulingConfig-r10 Not Implemented
2879 NS_ASSERT(!nulOpt[1]); // csi-RS-Config-r10 Not Implemented
2880 pcdsc->havePdschConfigDedicated = nulOpt[0];
2881
2882 if (pcdsc->haveAntennaInfoDedicated)
2883 {
2884 // Deserialize antennaInfo
2885 int sel;
2886 bIterator = DeserializeChoice(2, false, &sel, bIterator);
2887 if (sel == 1)
2888 {
2889 bIterator = DeserializeNull(bIterator);
2890 }
2891 else if (sel == 0)
2892 {
2893 std::bitset<1> codebookSubsetRestrictionPresent;
2894 bIterator =
2895 DeserializeSequence(&codebookSubsetRestrictionPresent, false, bIterator);
2896
2897 int txmode;
2898 bIterator = DeserializeEnum(8, &txmode, bIterator);
2899 pcdsc->antennaInfo.transmissionMode = txmode;
2900
2901 if (codebookSubsetRestrictionPresent[0])
2902 {
2903 // Deserialize codebookSubsetRestriction
2904 NS_FATAL_ERROR("Not implemented yet");
2905 // ...
2906 }
2907
2908 int txantennaselchosen;
2909 bIterator = DeserializeChoice(2, false, &txantennaselchosen, bIterator);
2910 if (txantennaselchosen == 0)
2911 {
2912 // Deserialize ue-TransmitAntennaSelection release
2913 bIterator = DeserializeNull(bIterator);
2914 }
2915 else if (txantennaselchosen == 1)
2916 {
2917 // Deserialize ue-TransmitAntennaSelection setup
2918 NS_FATAL_ERROR("Not implemented yet");
2919 // ...
2920 }
2921 }
2922 }
2923 if (pcdsc->havePdschConfigDedicated)
2924 {
2925 // Deserialize pdsch-ConfigDedicated
2926 std::bitset<0> bitset0;
2927 bIterator = DeserializeSequence(&bitset0, false, bIterator);
2928
2929 int slct;
2930
2931 // Deserialize p-a
2932 bIterator = DeserializeEnum(8, &slct, bIterator);
2933 pcdsc->pdschConfigDedicated.pa = slct;
2934
2935 bIterator = DeserializeNull(bIterator);
2936 }
2937 }
2938 if (pcdsc->haveUlConfiguration)
2939 {
2940 std::bitset<7> ulOpt;
2941 bIterator = DeserializeSequence(&ulOpt, false, bIterator);
2942 pcdsc->haveAntennaInfoUlDedicated = ulOpt[6];
2943 NS_ASSERT(!ulOpt[5]); // pusch-ConfigDedicatedSCell-r10 not present
2944 NS_ASSERT(!ulOpt[4]); // uplinkPowerControlDedicatedSCell-r10 not present
2945 NS_ASSERT(!ulOpt[3]); // cqi-ReportConfigSCell-r10 not present
2946 pcdsc->haveSoundingRsUlConfigDedicated = ulOpt[2];
2947 NS_ASSERT(!ulOpt[1]); // soundingRS-UL-ConfigDedicated-v1020 not present
2948 NS_ASSERT(!ulOpt[0]); // soundingRS-UL-ConfigDedicatedAperiodic-r10 not present
2949
2950 if (pcdsc->haveAntennaInfoUlDedicated)
2951 {
2952 // Deserialize antennaInfo
2953 int sel;
2954 bIterator = DeserializeChoice(2, false, &sel, bIterator);
2955 if (sel == 1)
2956 {
2957 bIterator = DeserializeNull(bIterator);
2958 }
2959 else if (sel == 0)
2960 {
2961 std::bitset<1> codebookSubsetRestrictionPresent;
2962 bIterator =
2963 DeserializeSequence(&codebookSubsetRestrictionPresent, false, bIterator);
2964
2965 int txmode;
2966 bIterator = DeserializeEnum(8, &txmode, bIterator);
2967 pcdsc->antennaInfoUl.transmissionMode = txmode;
2968
2969 if (codebookSubsetRestrictionPresent[0])
2970 {
2971 // Deserialize codebookSubsetRestriction
2972 NS_FATAL_ERROR("Not implemented yet");
2973 // ...
2974 }
2975
2976 int txantennaselchosen;
2977 bIterator = DeserializeChoice(2, false, &txantennaselchosen, bIterator);
2978 if (txantennaselchosen == 0)
2979 {
2980 // Deserialize ue-TransmitAntennaSelection release
2981 bIterator = DeserializeNull(bIterator);
2982 }
2983 else if (txantennaselchosen == 1)
2984 {
2985 // Deserialize ue-TransmitAntennaSelection setup
2986 NS_FATAL_ERROR("Not implemented yet");
2987 // ...
2988 }
2989 }
2990 }
2992 {
2993 // Deserialize soundingRS-UL-ConfigDedicated
2994 int sel;
2995 bIterator = DeserializeChoice(2, false, &sel, bIterator);
2996
2997 if (sel == 0)
2998 {
3001
3002 bIterator = DeserializeNull(bIterator);
3003 }
3004
3005 else if (sel == 1)
3006 {
3009
3010 std::bitset<0> bitset0;
3011 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3012
3013 int slct;
3014
3015 // Deserialize srs-Bandwidth
3016 bIterator = DeserializeEnum(4, &slct, bIterator);
3018
3019 // Deserialize srs-HoppingBandwidth
3020 bIterator = DeserializeEnum(4, &slct, bIterator);
3021
3022 // Deserialize freqDomainPosition
3023 bIterator = DeserializeInteger(&slct, 0, 23, bIterator);
3024
3025 // Deserialize duration
3026 bool duration;
3027 bIterator = DeserializeBoolean(&duration, bIterator);
3028
3029 // Deserialize srs-ConfigIndex
3030 bIterator = DeserializeInteger(&slct, 0, 1023, bIterator);
3032
3033 // Deserialize transmissionComb
3034 bIterator = DeserializeInteger(&slct, 0, 1, bIterator);
3035
3036 // Deserialize cyclicShift
3037 bIterator = DeserializeEnum(8, &slct, bIterator);
3038 }
3039 }
3040 }
3041
3042 return bIterator;
3043}
3044
3045void
3046RrcAsn1Header::Print(std::ostream& os,
3047 LteRrcSap::RadioResourceConfigDedicated radioResourceConfigDedicated) const
3048{
3049 os << " srbToAddModList: " << std::endl;
3050 auto it = radioResourceConfigDedicated.srbToAddModList.begin();
3051 for (; it != radioResourceConfigDedicated.srbToAddModList.end(); it++)
3052 {
3053 os << " srbIdentity: " << (int)it->srbIdentity << std::endl;
3054 os << " logicalChannelConfig: " << std::endl;
3055 os << " priority: " << (int)it->logicalChannelConfig.priority << std::endl;
3056 os << " prioritizedBitRateKbps: "
3057 << (int)it->logicalChannelConfig.prioritizedBitRateKbps << std::endl;
3058 os << " bucketSizeDurationMs: "
3059 << (int)it->logicalChannelConfig.bucketSizeDurationMs << std::endl;
3060 os << " logicalChannelGroup: " << (int)it->logicalChannelConfig.logicalChannelGroup
3061 << std::endl;
3062 }
3063 os << std::endl;
3064
3065 os << " drbToAddModList: " << std::endl;
3066 auto it2 = radioResourceConfigDedicated.drbToAddModList.begin();
3067 for (; it2 != radioResourceConfigDedicated.drbToAddModList.end(); it2++)
3068 {
3069 os << " epsBearerIdentity: " << (int)it2->epsBearerIdentity << std::endl;
3070 os << " drbIdentity: " << (int)it2->drbIdentity << std::endl;
3071 os << " rlcConfig: " << it2->rlcConfig.choice << std::endl;
3072 os << " logicalChannelIdentity: " << (int)it2->logicalChannelIdentity << std::endl;
3073 os << " logicalChannelConfig: " << std::endl;
3074 os << " priority: " << (int)it2->logicalChannelConfig.priority << std::endl;
3075 os << " prioritizedBitRateKbps: "
3076 << (int)it2->logicalChannelConfig.prioritizedBitRateKbps << std::endl;
3077 os << " bucketSizeDurationMs: "
3078 << (int)it2->logicalChannelConfig.bucketSizeDurationMs << std::endl;
3079 os << " logicalChannelGroup: " << (int)it2->logicalChannelConfig.logicalChannelGroup
3080 << std::endl;
3081 }
3082 os << std::endl;
3083
3084 os << " drbToReleaseList: ";
3085 auto it3 = radioResourceConfigDedicated.drbToReleaseList.begin();
3086 for (; it3 != radioResourceConfigDedicated.drbToReleaseList.end(); it3++)
3087 {
3088 os << (int)*it3 << ", ";
3089 }
3090 os << std::endl;
3091
3092 os << " havePhysicalConfigDedicated: "
3093 << radioResourceConfigDedicated.havePhysicalConfigDedicated << std::endl;
3094
3095 if (radioResourceConfigDedicated.havePhysicalConfigDedicated)
3096 {
3097 os << " physicalConfigDedicated: " << std::endl;
3098
3099 os << " haveSoundingRsUlConfigDedicated: "
3100 << radioResourceConfigDedicated.physicalConfigDedicated.haveSoundingRsUlConfigDedicated
3101 << std::endl;
3102 if (radioResourceConfigDedicated.physicalConfigDedicated.haveSoundingRsUlConfigDedicated)
3103 {
3104 os << " soundingRsUlConfigDedicated: " << std::endl;
3105 os << " type: "
3106 << radioResourceConfigDedicated.physicalConfigDedicated.soundingRsUlConfigDedicated
3107 .type
3108 << std::endl;
3109 os << " srsBandwidth: "
3110 << (int)radioResourceConfigDedicated.physicalConfigDedicated
3112 << std::endl;
3113 os << " srsConfigIndex: "
3114 << (int)radioResourceConfigDedicated.physicalConfigDedicated
3116 << std::endl;
3117 }
3118
3119 os << " haveAntennaInfoDedicated: "
3120 << radioResourceConfigDedicated.physicalConfigDedicated.haveAntennaInfoDedicated
3121 << std::endl;
3122 if (radioResourceConfigDedicated.physicalConfigDedicated.haveAntennaInfoDedicated)
3123 {
3124 os << " antennaInfo Tx mode: "
3125 << (int)radioResourceConfigDedicated.physicalConfigDedicated.antennaInfo
3127 << std::endl;
3128 }
3129 }
3130}
3131
3134 LteRrcSap::SystemInformationBlockType1* systemInformationBlockType1,
3135 Buffer::Iterator bIterator)
3136{
3137 std::bitset<0> bitset0;
3138 int n;
3139
3140 std::bitset<3> sysInfoBlkT1Opts;
3141 bIterator = DeserializeSequence(&sysInfoBlkT1Opts, false, bIterator);
3142
3143 // Deserialize cellAccessRelatedInfo
3144 std::bitset<1> cellAccessRelatedInfoOpts;
3145 bIterator = DeserializeSequence(&cellAccessRelatedInfoOpts, false, bIterator);
3146
3147 // Deserialize plmn-IdentityList
3148 int numPlmnIdentityInfoElements;
3149 bIterator = DeserializeSequenceOf(&numPlmnIdentityInfoElements, 6, 1, bIterator);
3150 for (int i = 0; i < numPlmnIdentityInfoElements; i++)
3151 {
3152 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3153
3154 // plmn-Identity
3155 bIterator = DeserializePlmnIdentity(
3156 &systemInformationBlockType1->cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity,
3157 bIterator);
3158 }
3159
3160 // Deserialize trackingAreaCode
3161 std::bitset<16> trackingAreaCode;
3162 bIterator = DeserializeBitstring(&trackingAreaCode, bIterator);
3163
3164 // Deserialize cellIdentity
3165 std::bitset<28> cellIdentity;
3166 bIterator = DeserializeBitstring(&cellIdentity, bIterator);
3167 systemInformationBlockType1->cellAccessRelatedInfo.cellIdentity = cellIdentity.to_ulong();
3168
3169 // Deserialize cellBarred
3170 bIterator = DeserializeEnum(2, &n, bIterator);
3171
3172 // Deserialize intraFreqReselection
3173 bIterator = DeserializeEnum(2, &n, bIterator);
3174
3175 // Deserialize csg-Indication
3176 bIterator =
3177 DeserializeBoolean(&systemInformationBlockType1->cellAccessRelatedInfo.csgIndication,
3178 bIterator);
3179
3180 if (cellAccessRelatedInfoOpts[0])
3181 {
3182 // Deserialize csg-Identity
3183 std::bitset<27> csgIdentity;
3184 bIterator = DeserializeBitstring(&csgIdentity, bIterator);
3185 systemInformationBlockType1->cellAccessRelatedInfo.csgIdentity = csgIdentity.to_ulong();
3186 }
3187
3188 // Deserialize cellSelectionInfo
3189 std::bitset<1> qRxLevMinOffsetPresent;
3190 bIterator = DeserializeSequence(&qRxLevMinOffsetPresent, false, bIterator);
3191 bIterator = DeserializeInteger(&n, -70, -22, bIterator); // q-RxLevMin
3192 if (qRxLevMinOffsetPresent[0])
3193 {
3194 // Deserialize qRxLevMinOffset
3195 // ...
3196 }
3197
3198 if (sysInfoBlkT1Opts[2])
3199 {
3200 // Deserialize p-Max
3201 // ...
3202 }
3203
3204 // freqBandIndicator
3205 bIterator = DeserializeInteger(&n, 1, 64, bIterator);
3206
3207 // schedulingInfoList
3208 int numSchedulingInfo;
3209 bIterator = DeserializeSequenceOf(&numSchedulingInfo, MAX_SI_MESSAGE, 1, bIterator);
3210 for (int i = 0; i < numSchedulingInfo; i++)
3211 {
3212 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3213 bIterator = DeserializeEnum(7, &n, bIterator); // si-Periodicity
3214 int numSibType;
3215 bIterator =
3216 DeserializeSequenceOf(&numSibType, MAX_SIB - 1, 0, bIterator); // sib-MappingInfo
3217 for (int j = 0; j < numSibType; j++)
3218 {
3219 bIterator = DeserializeEnum(16, &n, bIterator); // SIB-Type
3220 }
3221 }
3222
3223 if (sysInfoBlkT1Opts[1])
3224 {
3225 // tdd-Config
3226 // ...
3227 }
3228
3229 // si-WindowLength
3230 bIterator = DeserializeEnum(7, &n, bIterator);
3231
3232 // systemInfoValueTag
3233 bIterator = DeserializeInteger(&n, 0, 31, bIterator);
3234
3235 if (sysInfoBlkT1Opts[0])
3236 {
3237 // Deserialize nonCriticalExtension
3238 // ...
3239 }
3240 return bIterator;
3241}
3242
3245 LteRrcSap::SystemInformationBlockType2* systemInformationBlockType2,
3246 Buffer::Iterator bIterator)
3247{
3248 std::bitset<0> bitset0;
3249 int n;
3250
3251 std::bitset<2> sysInfoBlkT2Opts;
3252 bIterator = DeserializeSequence(&sysInfoBlkT2Opts, true, bIterator);
3253 if (sysInfoBlkT2Opts[1])
3254 {
3255 // Deserialize ac-BarringInfo
3256 // ...
3257 }
3258
3259 // Deserialize radioResourceConfigCommon
3261 &systemInformationBlockType2->radioResourceConfigCommon,
3262 bIterator);
3263
3264 // Deserialize ue-TimersAndConstants
3265 bIterator = DeserializeSequence(&bitset0, true, bIterator);
3266 bIterator = DeserializeEnum(8, &n, bIterator); // t300
3267 bIterator = DeserializeEnum(8, &n, bIterator); // t301
3268 bIterator = DeserializeEnum(7, &n, bIterator); // t310
3269 bIterator = DeserializeEnum(8, &n, bIterator); // n310
3270 bIterator = DeserializeEnum(7, &n, bIterator); // t311
3271 bIterator = DeserializeEnum(8, &n, bIterator); // n311
3272
3273 // Deserialize freqInfo
3274 std::bitset<2> freqInfoOpts;
3275 bIterator = DeserializeSequence(&freqInfoOpts, false, bIterator);
3276 if (freqInfoOpts[1])
3277 {
3278 // Deserialize ul-CarrierFreq
3279 bIterator = DeserializeInteger(&n, 0, MAX_EARFCN, bIterator);
3280 systemInformationBlockType2->freqInfo.ulCarrierFreq = n;
3281 }
3282 if (freqInfoOpts[0])
3283 {
3284 // Deserialize ul-Bandwidth
3285 bIterator = DeserializeEnum(6, &n, bIterator);
3286 systemInformationBlockType2->freqInfo.ulBandwidth = EnumToBandwidth(n);
3287 }
3288
3289 // additionalSpectrumEmission
3290 bIterator = DeserializeInteger(&n, 1, 32, bIterator);
3291
3292 if (sysInfoBlkT2Opts[0])
3293 {
3294 // Deserialize mbsfn-SubframeConfigList
3295 // ...
3296 }
3297
3298 // Deserialize timeAlignmentTimerCommon
3299 bIterator = DeserializeEnum(8, &n, bIterator);
3300
3301 return bIterator;
3302}
3303
3306 LteRrcSap::RadioResourceConfigCommon* radioResourceConfigCommon,
3307 Buffer::Iterator bIterator)
3308{
3309 std::bitset<0> bitset0;
3310 int n;
3311
3312 std::bitset<9> rrCfgCommOptions;
3313 bIterator = DeserializeSequence(&rrCfgCommOptions, true, bIterator);
3314
3315 // rach-ConfigCommon
3316 if (rrCfgCommOptions[8])
3317 {
3318 bIterator =
3319 DeserializeRachConfigCommon(&radioResourceConfigCommon->rachConfigCommon, bIterator);
3320 }
3321
3322 // prach-Config
3323 std::bitset<1> prachConfigInfoPresent;
3324 bIterator = DeserializeSequence(&prachConfigInfoPresent, false, bIterator);
3325
3326 // prach-Config -> rootSequenceIndex
3327 bIterator = DeserializeInteger(&n, 0, 1023, bIterator);
3328
3329 // prach-Config -> prach-ConfigInfo
3330 if (prachConfigInfoPresent[0])
3331 {
3332 // ...
3333 }
3334
3335 // pdsch-ConfigCommon
3336 if (rrCfgCommOptions[7])
3337 {
3338 // ...
3339 }
3340
3341 // pusch-ConfigCommon
3342 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3343
3344 // pusch-ConfigCommon -> pusch-ConfigBasic
3345 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3346
3347 // pusch-ConfigCommon -> pusch-ConfigBasic -> n-SB
3348 bIterator = DeserializeInteger(&n, 1, 4, bIterator);
3349
3350 // pusch-ConfigCommon -> pusch-ConfigBasic -> hoppingMode
3351 bIterator = DeserializeEnum(2, &n, bIterator);
3352
3353 // pusch-ConfigCommon -> pusch-ConfigBasic -> pusch-HoppingOffset
3354 bIterator = DeserializeInteger(&n, 0, 98, bIterator);
3355
3356 // pusch-ConfigCommon -> pusch-ConfigBasic -> enable64QAM
3357 bool enable64QAM;
3358 bIterator = DeserializeBoolean(&enable64QAM, bIterator);
3359
3360 // ul-ReferenceSignalsPUSCH
3361 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3362
3363 // groupHoppingEnabled
3364 bool dummyBool;
3365 bIterator = DeserializeBoolean(&dummyBool, bIterator);
3366
3367 // groupAssignmentPUSCH
3368 bIterator = DeserializeInteger(&n, 0, 29, bIterator);
3369
3370 // sequenceHoppingEnabled
3371 bIterator = DeserializeBoolean(&dummyBool, bIterator);
3372
3373 // cyclicShift
3374 bIterator = DeserializeInteger(&n, 0, 7, bIterator);
3375
3376 // phich-Config
3377 if (rrCfgCommOptions[6])
3378 {
3379 // ...
3380 }
3381
3382 // pucch-ConfigCommon
3383 if (rrCfgCommOptions[5])
3384 {
3385 // ...
3386 }
3387
3388 // soundingRS-UL-ConfigCommon
3389 if (rrCfgCommOptions[4])
3390 {
3391 // ...
3392 }
3393
3394 // uplinkPowerControlCommon
3395 if (rrCfgCommOptions[3])
3396 {
3397 // ...
3398 }
3399
3400 // antennaInfoCommon
3401 if (rrCfgCommOptions[2])
3402 {
3403 // ...
3404 }
3405
3406 // p-Max
3407 if (rrCfgCommOptions[1])
3408 {
3409 // ...
3410 }
3411
3412 // tdd-Config
3413 if (rrCfgCommOptions[0])
3414 {
3415 // ...
3416 }
3417
3418 // ul-CyclicPrefixLength
3419 bIterator = DeserializeEnum(2, &n, bIterator);
3420
3421 return bIterator;
3422}
3423
3426 Buffer::Iterator bIterator)
3427{
3428 std::bitset<0> bitset0;
3429 int n;
3430
3431 bIterator = DeserializeSequence(&bitset0, true, bIterator);
3432
3433 // preambleInfo
3434 std::bitset<1> preamblesGroupAConfigPresent;
3435 bIterator = DeserializeSequence(&preamblesGroupAConfigPresent, false, bIterator);
3436
3437 // numberOfRA-Preambles
3438 bIterator = DeserializeEnum(16, &n, bIterator);
3439 switch (n)
3440 {
3441 case 0:
3442 rachConfigCommon->preambleInfo.numberOfRaPreambles = 4;
3443 break;
3444 case 1:
3445 rachConfigCommon->preambleInfo.numberOfRaPreambles = 8;
3446 break;
3447 case 2:
3448 rachConfigCommon->preambleInfo.numberOfRaPreambles = 12;
3449 break;
3450 case 3:
3451 rachConfigCommon->preambleInfo.numberOfRaPreambles = 16;
3452 break;
3453 case 4:
3454 rachConfigCommon->preambleInfo.numberOfRaPreambles = 20;
3455 break;
3456 case 5:
3457 rachConfigCommon->preambleInfo.numberOfRaPreambles = 24;
3458 break;
3459 case 6:
3460 rachConfigCommon->preambleInfo.numberOfRaPreambles = 28;
3461 break;
3462 case 7:
3463 rachConfigCommon->preambleInfo.numberOfRaPreambles = 32;
3464 break;
3465 case 8:
3466 rachConfigCommon->preambleInfo.numberOfRaPreambles = 36;
3467 break;
3468 case 9:
3469 rachConfigCommon->preambleInfo.numberOfRaPreambles = 40;
3470 break;
3471 case 10:
3472 rachConfigCommon->preambleInfo.numberOfRaPreambles = 44;
3473 break;
3474 case 11:
3475 rachConfigCommon->preambleInfo.numberOfRaPreambles = 48;
3476 break;
3477 case 12:
3478 rachConfigCommon->preambleInfo.numberOfRaPreambles = 52;
3479 break;
3480 case 13:
3481 rachConfigCommon->preambleInfo.numberOfRaPreambles = 56;
3482 break;
3483 case 14:
3484 rachConfigCommon->preambleInfo.numberOfRaPreambles = 60;
3485 break;
3486 case 15:
3487 rachConfigCommon->preambleInfo.numberOfRaPreambles = 64;
3488 break;
3489 default:
3490 rachConfigCommon->preambleInfo.numberOfRaPreambles = 4;
3491 }
3492
3493 if (preamblesGroupAConfigPresent[0])
3494 {
3495 // Deserialize preamblesGroupAConfig
3496 // ...
3497 }
3498
3499 // powerRampingParameters
3500 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3501 bIterator = DeserializeEnum(4, &n, bIterator); // powerRampingStep
3502 bIterator = DeserializeEnum(16, &n, bIterator); // preambleInitialReceivedTargetPower
3503
3504 // ra-SupervisionInfo
3505 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3506 bIterator = DeserializeEnum(11, &n, bIterator); // preambleTransMax
3507 switch (n)
3508 {
3509 case 0:
3510 rachConfigCommon->raSupervisionInfo.preambleTransMax = 3;
3511 break;
3512 case 1:
3513 rachConfigCommon->raSupervisionInfo.preambleTransMax = 4;
3514 break;
3515 case 2:
3516 rachConfigCommon->raSupervisionInfo.preambleTransMax = 5;
3517 break;
3518 case 3:
3519 rachConfigCommon->raSupervisionInfo.preambleTransMax = 6;
3520 break;
3521 case 4:
3522 rachConfigCommon->raSupervisionInfo.preambleTransMax = 7;
3523 break;
3524 case 5:
3525 rachConfigCommon->raSupervisionInfo.preambleTransMax = 8;
3526 break;
3527 case 6:
3528 rachConfigCommon->raSupervisionInfo.preambleTransMax = 10;
3529 break;
3530 case 7:
3531 rachConfigCommon->raSupervisionInfo.preambleTransMax = 20;
3532 break;
3533 case 8:
3534 rachConfigCommon->raSupervisionInfo.preambleTransMax = 50;
3535 break;
3536 case 9:
3537 rachConfigCommon->raSupervisionInfo.preambleTransMax = 100;
3538 break;
3539 case 10:
3540 rachConfigCommon->raSupervisionInfo.preambleTransMax = 200;
3541 break;
3542 default:
3543 rachConfigCommon->raSupervisionInfo.preambleTransMax = 0;
3544 }
3545
3546 // ra-ResponseWindowSize
3547 bIterator = DeserializeEnum(8, &n, bIterator);
3548 switch (n)
3549 {
3550 case 0:
3551 rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 2;
3552 break;
3553 case 1:
3554 rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 3;
3555 break;
3556 case 2:
3557 rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 4;
3558 break;
3559 case 3:
3560 rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 5;
3561 break;
3562 case 4:
3563 rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 6;
3564 break;
3565 case 5:
3566 rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 7;
3567 break;
3568 case 6:
3569 rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 8;
3570 break;
3571 case 7:
3572 rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 10;
3573 break;
3574 default:
3575 rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 0;
3576 }
3577
3578 bIterator = DeserializeEnum(8, &n, bIterator); // mac-ContentionResolutionTimer
3579 bIterator = DeserializeInteger(&n, 1, 8, bIterator); // maxHARQ-Msg3Tx
3580
3581 // connEstFailCount
3582 bIterator = DeserializeEnum(8, &n, bIterator);
3583 switch (n)
3584 {
3585 case 1:
3586 rachConfigCommon->txFailParam.connEstFailCount = 1;
3587 break;
3588 case 2:
3589 rachConfigCommon->txFailParam.connEstFailCount = 2;
3590 break;
3591 case 3:
3592 rachConfigCommon->txFailParam.connEstFailCount = 3;
3593 break;
3594 case 4:
3595 rachConfigCommon->txFailParam.connEstFailCount = 4;
3596 break;
3597 default:
3598 rachConfigCommon->txFailParam.connEstFailCount = 1;
3599 }
3600 return bIterator;
3601}
3602
3605 LteRrcSap::RadioResourceConfigCommonSib* radioResourceConfigCommonSib,
3606 Buffer::Iterator bIterator)
3607{
3608 std::bitset<0> bitset0;
3609 int n;
3610
3611 bIterator = DeserializeSequence(&bitset0, true, bIterator);
3612
3613 // rach-ConfigCommon
3614 bIterator =
3615 DeserializeRachConfigCommon(&radioResourceConfigCommonSib->rachConfigCommon, bIterator);
3616
3617 // bcch-Config
3618 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3619 bIterator = DeserializeEnum(4, &n, bIterator); // modificationPeriodCoeff
3620
3621 // pcch-Config
3622 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3623 bIterator = DeserializeEnum(4, &n, bIterator); // defaultPagingCycle
3624 bIterator = DeserializeEnum(8, &n, bIterator); // nB
3625
3626 // prach-Config
3627 std::bitset<1> prachConfigInfoPresent;
3628 bIterator = DeserializeSequence(&prachConfigInfoPresent, false, bIterator);
3629 // prach-Config -> rootSequenceIndex
3630 bIterator = DeserializeInteger(&n, 0, 1023, bIterator);
3631 // prach-Config -> prach-ConfigInfo
3632 if (prachConfigInfoPresent[0])
3633 {
3634 // ...
3635 }
3636
3637 // pdsch-ConfigCommon
3638 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3639 bIterator = DeserializeInteger(&n, -60, 50, bIterator); // referenceSignalPower
3640 bIterator = DeserializeInteger(&n, 0, 3, bIterator); // p-b
3641
3642 // pusch-ConfigCommon
3643 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3644
3645 // pusch-ConfigCommon -> pusch-ConfigBasic
3646 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3647
3648 // pusch-ConfigCommon -> pusch-ConfigBasic -> n-SB
3649 bIterator = DeserializeInteger(&n, 1, 4, bIterator);
3650
3651 // pusch-ConfigCommon -> pusch-ConfigBasic -> hoppingMode
3652 bIterator = DeserializeEnum(2, &n, bIterator);
3653
3654 // pusch-ConfigCommon -> pusch-ConfigBasic -> pusch-HoppingOffset
3655 bIterator = DeserializeInteger(&n, 0, 98, bIterator);
3656
3657 // pusch-ConfigCommon -> pusch-ConfigBasic -> enable64QAM
3658 bool dummyBoolean;
3659 bIterator = DeserializeBoolean(&dummyBoolean, bIterator);
3660
3661 // ul-ReferenceSignalsPUSCH
3662 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3663
3664 // groupHoppingEnabled
3665 bIterator = DeserializeBoolean(&dummyBoolean, bIterator);
3666
3667 // groupAssignmentPUSCH
3668 bIterator = DeserializeInteger(&n, 0, 29, bIterator);
3669
3670 // sequenceHoppingEnabled
3671 bIterator = DeserializeBoolean(&dummyBoolean, bIterator);
3672
3673 // cyclicShift
3674 bIterator = DeserializeInteger(&n, 0, 7, bIterator);
3675
3676 // pucch-ConfigCommon
3677 bIterator = DeserializeEnum(3, &n, bIterator); // deltaPUCCH-Shift
3678 bIterator = DeserializeInteger(&n, 0, 98, bIterator); // nRB-CQI
3679 bIterator = DeserializeInteger(&n, 0, 7, bIterator); // nCS-AN
3680 bIterator = DeserializeInteger(&n, 0, 2047, bIterator); // n1PUCCH-AN
3681
3682 // soundingRS-UL-ConfigCommon
3683 int choice;
3684 bIterator = DeserializeChoice(2, false, &choice, bIterator);
3685 if (choice == 0)
3686 {
3687 bIterator = DeserializeNull(bIterator); // release
3688 }
3689 if (choice == 1)
3690 {
3691 // setup
3692 // ...
3693 }
3694
3695 // uplinkPowerControlCommon
3696 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3697 bIterator = DeserializeInteger(&n, -126, 24, bIterator); // p0-NominalPUSCH
3698 bIterator = DeserializeEnum(8, &n, bIterator); // alpha
3699 bIterator = DeserializeInteger(&n, -127, -96, bIterator); // p0-NominalPUCCH
3700 // deltaFList-PUCCH
3701 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3702 bIterator = DeserializeEnum(3, &n, bIterator); // deltaF-PUCCH-Format1
3703 bIterator = DeserializeEnum(3, &n, bIterator); // deltaF-PUCCH-Format1b
3704 bIterator = DeserializeEnum(4, &n, bIterator); // deltaF-PUCCH-Format2
3705 bIterator = DeserializeEnum(3, &n, bIterator); // deltaF-PUCCH-Format2a
3706 bIterator = DeserializeEnum(3, &n, bIterator); // deltaF-PUCCH-Format2b
3707 bIterator = DeserializeInteger(&n, -1, 6, bIterator); // deltaPreambleMsg3
3708
3709 // ul-CyclicPrefixLength
3710 bIterator = DeserializeEnum(2, &n, bIterator);
3711
3712 return bIterator;
3713}
3714
3717 Buffer::Iterator bIterator)
3718{
3719 int n;
3720 std::bitset<0> b0;
3721 std::bitset<4> measResultOptionalPresent;
3722 // bIterator = DeserializeSequence (&measResultNeighCellsPresent,true,bIterator);
3723 bIterator = DeserializeSequence(&measResultOptionalPresent, true, bIterator);
3724
3725 // Deserialize measId
3726 bIterator = DeserializeInteger(&n, 1, MAX_MEAS_ID, bIterator);
3727 measResults->measId = n;
3728
3729 // Deserialize measResultServCell
3730 bIterator = DeserializeSequence(&b0, false, bIterator);
3731
3732 // Deserialize rsrpResult
3733 bIterator = DeserializeInteger(&n, 0, 97, bIterator);
3734 measResults->measResultPCell.rsrpResult = n;
3735
3736 // Deserialize rsrqResult
3737 bIterator = DeserializeInteger(&n, 0, 34, bIterator);
3738 measResults->measResultPCell.rsrqResult = n;
3739
3740 measResults->haveMeasResultNeighCells = measResultOptionalPresent[0];
3741 measResults->haveMeasResultServFreqList = measResultOptionalPresent[3];
3742 if (measResults->haveMeasResultNeighCells)
3743 {
3744 int measResultNeighCellsChoice;
3745
3746 // Deserialize measResultNeighCells
3747 bIterator = DeserializeChoice(4, false, &measResultNeighCellsChoice, bIterator);
3748
3749 if (measResultNeighCellsChoice == 0)
3750 {
3751 // Deserialize measResultListEUTRA
3752 int numElems;
3753 bIterator = DeserializeSequenceOf(&numElems, MAX_CELL_REPORT, 1, bIterator);
3754
3755 for (int i = 0; i < numElems; i++)
3756 {
3757 LteRrcSap::MeasResultEutra measResultEutra;
3758
3759 std::bitset<1> isCgiInfoPresent;
3760 bIterator = DeserializeSequence(&isCgiInfoPresent, false, bIterator);
3761
3762 // PhysCellId
3763 bIterator = DeserializeInteger(&n, 0, 503, bIterator);
3764 measResultEutra.physCellId = n;
3765
3766 measResultEutra.haveCgiInfo = isCgiInfoPresent[0];
3767 if (isCgiInfoPresent[0])
3768 {
3769 std::bitset<1> havePlmnIdentityList;
3770 bIterator = DeserializeSequence(&havePlmnIdentityList, false, bIterator);
3771
3772 // Deserialize cellGlobalId
3773 bIterator = DeserializeSequence(&b0, false, bIterator);
3774
3775 // Deserialize plmn-Identity
3776 bIterator =
3777 DeserializePlmnIdentity(&measResultEutra.cgiInfo.plmnIdentity, bIterator);
3778
3779 // Deserialize CellIdentity
3780 std::bitset<28> cellId;
3781 bIterator = DeserializeBitstring(&cellId, bIterator);
3782 measResultEutra.cgiInfo.cellIdentity = cellId.to_ulong();
3783
3784 // Deserialize trackingAreaCode
3785 std::bitset<16> trArCo;
3786 bIterator = DeserializeBitstring(&trArCo, bIterator);
3787 measResultEutra.cgiInfo.trackingAreaCode = trArCo.to_ulong();
3788
3789 // Deserialize plmn-IdentityList
3790 if (havePlmnIdentityList[0])
3791 {
3792 int numPlmnElems;
3793 bIterator = DeserializeSequenceOf(&numPlmnElems, 5, 1, bIterator);
3794
3795 for (int j = 0; j < numPlmnElems; j++)
3796 {
3797 uint32_t plmnId;
3798 bIterator = DeserializePlmnIdentity(&plmnId, bIterator);
3799 measResultEutra.cgiInfo.plmnIdentityList.push_back(plmnId);
3800 }
3801 }
3802 }
3803
3804 // Deserialize measResult
3805 std::bitset<2> measResultOpts;
3806 bIterator = DeserializeSequence(&measResultOpts, true, bIterator);
3807
3808 measResultEutra.haveRsrpResult = measResultOpts[1];
3809 if (measResultOpts[1])
3810 {
3811 // Deserialize rsrpResult
3812 bIterator = DeserializeInteger(&n, 0, 97, bIterator);
3813 measResultEutra.rsrpResult = n;
3814 }
3815
3816 measResultEutra.haveRsrqResult = measResultOpts[0];
3817 if (measResultOpts[0])
3818 {
3819 // Deserialize rsrqResult
3820 bIterator = DeserializeInteger(&n, 0, 34, bIterator);
3821 measResultEutra.rsrqResult = n;
3822 }
3823
3824 measResults->measResultListEutra.push_back(measResultEutra);
3825 }
3826 }
3827
3828 if (measResultNeighCellsChoice == 1)
3829 {
3830 // Deserialize measResultListUTRA
3831 // ...
3832 }
3833
3834 if (measResultNeighCellsChoice == 2)
3835 {
3836 // Deserialize measResultListGERAN
3837 // ...
3838 }
3839 if (measResultNeighCellsChoice == 3)
3840 {
3841 // Deserialize measResultsCDMA2000
3842 // ...
3843 }
3844 }
3845 if (measResults->haveMeasResultServFreqList)
3846 {
3847 int numElems;
3848 bIterator = DeserializeSequenceOf(&numElems, MAX_SCELL_REPORT, 1, bIterator);
3849 for (int i = 0; i < numElems; i++)
3850 {
3851 LteRrcSap::MeasResultServFreq measResultServFreq;
3852
3853 // Deserialize MeasResultServFreq-r10
3854 std::bitset<2> measResultScellPresent;
3855 bIterator = DeserializeSequence(&measResultScellPresent, true, bIterator);
3856 measResultServFreq.haveMeasResultSCell = measResultScellPresent[0];
3857 measResultServFreq.haveMeasResultBestNeighCell = measResultScellPresent[1];
3858
3859 // Deserialize servFreqId-r10
3860 int servFreqId;
3861 bIterator = DeserializeInteger(&servFreqId, 0, 7, bIterator);
3862 measResultServFreq.servFreqId = servFreqId;
3863
3864 if (measResultServFreq.haveMeasResultSCell)
3865 {
3866 // Deserialize rsrpResult
3867 bIterator = DeserializeInteger(&n, 0, 97, bIterator);
3868 measResultServFreq.measResultSCell.rsrpResult = n;
3869
3870 // Deserialize rsrqResult
3871 bIterator = DeserializeInteger(&n, 0, 34, bIterator);
3872 measResultServFreq.measResultSCell.rsrqResult = n;
3873 }
3874
3875 if (measResultServFreq.haveMeasResultBestNeighCell)
3876 {
3877 // Deserialize physCellId-r10
3878 bIterator = DeserializeInteger(&n, 0, 503, bIterator);
3879 measResultServFreq.measResultBestNeighCell.physCellId = n;
3880
3881 // Deserialize rsrpResultNCell-r10
3882 bIterator = DeserializeInteger(&n, 0, 97, bIterator);
3883 measResultServFreq.measResultBestNeighCell.rsrpResult = n;
3884
3885 // Deserialize rsrqResultNCell-r10
3886 bIterator = DeserializeInteger(&n, 0, 34, bIterator);
3887 measResultServFreq.measResultBestNeighCell.rsrqResult = n;
3888 }
3889 measResults->measResultServFreqList.push_back(measResultServFreq);
3890 }
3891 }
3892 return bIterator;
3893}
3894
3897{
3898 int n;
3899 std::bitset<1> isMccPresent;
3900 bIterator = DeserializeSequence(&isMccPresent, false, bIterator);
3901
3902 if (isMccPresent[0])
3903 {
3904 // Deserialize mcc
3905 // ...
3906 }
3907
3908 // Deserialize mnc
3909 int mncDigits;
3910 int mnc = 0;
3911 bIterator = DeserializeSequenceOf(&mncDigits, 3, 2, bIterator);
3912
3913 for (int j = mncDigits - 1; j >= 0; j--)
3914 {
3915 bIterator = DeserializeInteger(&n, 0, 9, bIterator);
3916 mnc += n * pow(10, j);
3917 }
3918
3919 *plmnId = mnc;
3920
3921 // cellReservedForOperatorUse
3922 bIterator = DeserializeEnum(2, &n, bIterator);
3923 return bIterator;
3924}
3925
3928{
3929 std::bitset<0> bitset0;
3930 std::bitset<2> bitset2;
3931 std::bitset<11> bitset11;
3932 int n;
3933
3934 // measConfig
3935 bIterator = DeserializeSequence(&bitset11, true, bIterator);
3936
3937 if (bitset11[10])
3938 {
3939 // measObjectToRemoveList
3940 int measObjectToRemoveListElems;
3941 bIterator =
3942 DeserializeSequenceOf(&measObjectToRemoveListElems, MAX_OBJECT_ID, 1, bIterator);
3943
3944 for (int i = 0; i < measObjectToRemoveListElems; i++)
3945 {
3946 bIterator = DeserializeInteger(&n, 1, MAX_OBJECT_ID, bIterator);
3947 measConfig->measObjectToRemoveList.push_back(n);
3948 }
3949 }
3950
3951 if (bitset11[9])
3952 {
3953 // measObjectToAddModList
3954 int measObjectToAddModListElems;
3955 bIterator =
3956 DeserializeSequenceOf(&measObjectToAddModListElems, MAX_OBJECT_ID, 1, bIterator);
3957
3958 for (int i = 0; i < measObjectToAddModListElems; i++)
3959 {
3961
3962 bIterator = DeserializeSequence(&bitset0, false, bIterator);
3963
3964 bIterator = DeserializeInteger(&n, 1, MAX_OBJECT_ID, bIterator);
3965 elem.measObjectId = n;
3966
3967 int measObjectChoice;
3968 bIterator = DeserializeChoice(4, true, &measObjectChoice, bIterator);
3969
3970 switch (measObjectChoice)
3971 {
3972 case 1:
3973 // Deserialize measObjectUTRA
3974 // ...
3975
3976 case 2:
3977 // Deserialize measObjectGERAN
3978 // ...
3979
3980 case 3:
3981 // Deserialize measObjectCDMA2000
3982 // ...
3983 break;
3984
3985 case 0:
3986 default:
3987 // Deserialize measObjectEUTRA
3988 std::bitset<5> measObjectEutraOpts;
3989 bIterator = DeserializeSequence(&measObjectEutraOpts, true, bIterator);
3990
3991 // carrierFreq
3992 bIterator = DeserializeInteger(&n, 0, MAX_EARFCN, bIterator);
3994
3995 // allowedMeasBandwidth
3996 bIterator = DeserializeEnum(6, &n, bIterator);
3998
3999 // presenceAntennaPort1
4000 bIterator =
4002
4003 // neighCellConfig
4004 bIterator = DeserializeBitstring(&bitset2, bIterator);
4005 elem.measObjectEutra.neighCellConfig = bitset2.to_ulong();
4006
4007 // offsetFreq
4008 bIterator = DeserializeQoffsetRange(&elem.measObjectEutra.offsetFreq, bIterator);
4009
4010 if (measObjectEutraOpts[4])
4011 {
4012 // cellsToRemoveList
4013 int numElems;
4014 bIterator = DeserializeSequenceOf(&numElems, MAX_CELL_MEAS, 1, bIterator);
4015
4016 for (int i = 0; i < numElems; i++)
4017 {
4018 bIterator = DeserializeInteger(&n, 1, MAX_CELL_MEAS, bIterator);
4019 elem.measObjectEutra.cellsToRemoveList.push_back(n);
4020 }
4021 }
4022
4023 if (measObjectEutraOpts[3])
4024 {
4025 // cellsToAddModList
4026 int numElems;
4027 bIterator = DeserializeSequenceOf(&numElems, MAX_CELL_MEAS, 1, bIterator);
4028
4029 for (int i = 0; i < numElems; i++)
4030 {
4031 LteRrcSap::CellsToAddMod cellsToAddMod;
4032
4033 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4034
4035 // cellIndex
4036 bIterator = DeserializeInteger(&n, 1, MAX_CELL_MEAS, bIterator);
4037 cellsToAddMod.cellIndex = n;
4038
4039 // PhysCellId
4040 bIterator = DeserializeInteger(&n, 0, 503, bIterator);
4041 cellsToAddMod.physCellId = n;
4042
4043 // cellIndividualOffset
4044 bIterator =
4045 DeserializeQoffsetRange(&cellsToAddMod.cellIndividualOffset, bIterator);
4046
4047 elem.measObjectEutra.cellsToAddModList.push_back(cellsToAddMod);
4048 }
4049 }
4050
4051 if (measObjectEutraOpts[2])
4052 {
4053 // blackCellsToRemoveList
4054 int numElems;
4055 bIterator = DeserializeSequenceOf(&numElems, MAX_CELL_MEAS, 1, bIterator);
4056
4057 for (int i = 0; i < numElems; i++)
4058 {
4059 bIterator = DeserializeInteger(&n, 1, MAX_CELL_MEAS, bIterator);
4060 elem.measObjectEutra.blackCellsToRemoveList.push_back(n);
4061 }
4062 }
4063
4064 if (measObjectEutraOpts[1])
4065 {
4066 // blackCellsToAddModList
4067 int numElems;
4068 bIterator = DeserializeSequenceOf(&numElems, MAX_CELL_MEAS, 1, bIterator);
4069
4070 for (int i = 0; i < numElems; i++)
4071 {
4072 LteRrcSap::BlackCellsToAddMod blackCellsToAddMod;
4073 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4074
4075 bIterator = DeserializeInteger(&n, 1, MAX_CELL_MEAS, bIterator);
4076 blackCellsToAddMod.cellIndex = n;
4077
4078 // PhysCellIdRange
4079 std::bitset<1> isRangePresent;
4080 bIterator = DeserializeSequence(&isRangePresent, false, bIterator);
4081
4082 // start
4083 bIterator = DeserializeInteger(&n, 0, 503, bIterator);
4084 blackCellsToAddMod.physCellIdRange.start = n;
4085
4086 blackCellsToAddMod.physCellIdRange.haveRange = isRangePresent[0];
4087 // initialize range to silence compiler warning
4088 blackCellsToAddMod.physCellIdRange.range = 0;
4089 if (blackCellsToAddMod.physCellIdRange.haveRange)
4090 {
4091 // range
4092 bIterator = DeserializeEnum(16, &n, bIterator);
4093 switch (n)
4094 {
4095 case 0:
4096 blackCellsToAddMod.physCellIdRange.range = 4;
4097 break;
4098 case 1:
4099 blackCellsToAddMod.physCellIdRange.range = 8;
4100 break;
4101 case 2:
4102 blackCellsToAddMod.physCellIdRange.range = 12;
4103 break;
4104 case 3:
4105 blackCellsToAddMod.physCellIdRange.range = 16;
4106 break;
4107 case 4:
4108 blackCellsToAddMod.physCellIdRange.range = 24;
4109 break;
4110 case 5:
4111 blackCellsToAddMod.physCellIdRange.range = 32;
4112 break;
4113 case 6:
4114 blackCellsToAddMod.physCellIdRange.range = 48;
4115 break;
4116 case 7:
4117 blackCellsToAddMod.physCellIdRange.range = 64;
4118 break;
4119 case 8:
4120 blackCellsToAddMod.physCellIdRange.range = 84;
4121 break;
4122 case 9:
4123 blackCellsToAddMod.physCellIdRange.range = 96;
4124 break;
4125 case 10:
4126 blackCellsToAddMod.physCellIdRange.range = 128;
4127 break;
4128 case 11:
4129 blackCellsToAddMod.physCellIdRange.range = 168;
4130 break;
4131 case 12:
4132 blackCellsToAddMod.physCellIdRange.range = 252;
4133 break;
4134 case 13:
4135 blackCellsToAddMod.physCellIdRange.range = 504;
4136 break;
4137 default:
4138 blackCellsToAddMod.physCellIdRange.range = 0;
4139 }
4140 }
4141
4142 elem.measObjectEutra.blackCellsToAddModList.push_back(blackCellsToAddMod);
4143 }
4144 }
4145
4146 elem.measObjectEutra.haveCellForWhichToReportCGI = measObjectEutraOpts[0];
4147 if (measObjectEutraOpts[0])
4148 {
4149 // cellForWhichToReportCGI
4150 bIterator = DeserializeInteger(&n, 0, 503, bIterator);
4152 }
4153 }
4154 measConfig->measObjectToAddModList.push_back(elem);
4155 }
4156 }
4157
4158 if (bitset11[8])
4159 {
4160 // reportConfigToRemoveList
4161 int reportConfigToRemoveListElems;
4162 bIterator = DeserializeSequenceOf(&reportConfigToRemoveListElems,
4164 1,
4165 bIterator);
4166
4167 for (int i = 0; i < reportConfigToRemoveListElems; i++)
4168 {
4169 bIterator = DeserializeInteger(&n, 1, MAX_REPORT_CONFIG_ID, bIterator);
4170 measConfig->reportConfigToRemoveList.push_back(n);
4171 }
4172 }
4173
4174 if (bitset11[7])
4175 {
4176 // reportConfigToAddModList
4177 int reportConfigToAddModListElems;
4178 bIterator = DeserializeSequenceOf(&reportConfigToAddModListElems,
4180 1,
4181 bIterator);
4182
4183 for (int i = 0; i < reportConfigToAddModListElems; i++)
4184 {
4186
4187 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4188 bIterator = DeserializeInteger(&n, 1, MAX_REPORT_CONFIG_ID, bIterator);
4189 elem.reportConfigId = n;
4190
4191 // Deserialize reportConfig
4192 int reportConfigChoice;
4193 bIterator = DeserializeChoice(2, false, &reportConfigChoice, bIterator);
4194
4195 if (reportConfigChoice == 0)
4196 {
4197 // reportConfigEUTRA
4198 bIterator = DeserializeSequence(&bitset0, true, bIterator);
4199
4200 // triggerType
4201 int triggerTypeChoice;
4202 bIterator = DeserializeChoice(2, false, &triggerTypeChoice, bIterator);
4203
4204 if (triggerTypeChoice == 0)
4205 {
4206 // event
4208 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4209
4210 // eventId
4211 int eventIdChoice;
4212 bIterator = DeserializeChoice(5, true, &eventIdChoice, bIterator);
4213
4214 switch (eventIdChoice)
4215 {
4216 case 0:
4218 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4220 bIterator);
4221 break;
4222
4223 case 1:
4225 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4227 bIterator);
4228 break;
4229
4230 case 2:
4232 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4233 bIterator = DeserializeInteger(&n, -30, 30, bIterator);
4234 elem.reportConfigEutra.a3Offset = n;
4235 bIterator =
4237 break;
4238
4239 case 3:
4241 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4243 bIterator);
4244 break;
4245
4246 case 4:
4247 default:
4249 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4251 bIterator);
4253 bIterator);
4254 }
4255
4256 bIterator = DeserializeInteger(&n, 0, 30, bIterator);
4258
4259 bIterator = DeserializeEnum(16, &n, bIterator);
4260 switch (n)
4261 {
4262 case 0:
4264 break;
4265 case 1:
4267 break;
4268 case 2:
4270 break;
4271 case 3:
4273 break;
4274 case 4:
4276 break;
4277 case 5:
4279 break;
4280 case 6:
4282 break;
4283 case 7:
4285 break;
4286 case 8:
4288 break;
4289 case 9:
4291 break;
4292 case 10:
4294 break;
4295 case 11:
4297 break;
4298 case 12:
4299 elem.reportConfigEutra.timeToTrigger = 1024;
4300 break;
4301 case 13:
4302 elem.reportConfigEutra.timeToTrigger = 1280;
4303 break;
4304 case 14:
4305 elem.reportConfigEutra.timeToTrigger = 2560;
4306 break;
4307 case 15:
4308 default:
4309 elem.reportConfigEutra.timeToTrigger = 5120;
4310 break;
4311 }
4312 }
4313
4314 if (triggerTypeChoice == 1)
4315 {
4316 // periodical
4318
4319 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4320 bIterator = DeserializeEnum(2, &n, bIterator);
4321 if (n == 0)
4322 {
4325 }
4326 else
4327 {
4329 }
4330 }
4331
4332 // triggerQuantity
4333 bIterator = DeserializeEnum(2, &n, bIterator);
4334 if (n == 0)
4335 {
4337 }
4338 else
4339 {
4341 }
4342
4343 // reportQuantity
4344 bIterator = DeserializeEnum(2, &n, bIterator);
4345 if (n == 0)
4346 {
4349 }
4350 else
4351 {
4353 }
4354
4355 // maxReportCells
4356 bIterator = DeserializeInteger(&n, 1, MAX_CELL_REPORT, bIterator);
4358
4359 // reportInterval
4360 bIterator = DeserializeEnum(16, &n, bIterator);
4361 switch (n)
4362 {
4363 case 0:
4365 break;
4366 case 1:
4368 break;
4369 case 2:
4371 break;
4372 case 3:
4374 break;
4375 case 4:
4377 break;
4378 case 5:
4380 break;
4381 case 6:
4383 break;
4384 case 7:
4386 break;
4387 case 8:
4389 break;
4390 case 9:
4392 break;
4393 case 10:
4395 break;
4396 case 11:
4398 break;
4399 case 12:
4401 break;
4402 case 13:
4404 break;
4405 case 14:
4407 break;
4408 case 15:
4409 default:
4411 }
4412
4413 // reportAmount
4414 bIterator = DeserializeEnum(8, &n, bIterator);
4415 switch (n)
4416 {
4417 case 0:
4419 break;
4420 case 1:
4422 break;
4423 case 2:
4425 break;
4426 case 3:
4428 break;
4429 case 4:
4431 break;
4432 case 5:
4434 break;
4435 case 6:
4437 break;
4438 default:
4440 }
4441 }
4442
4443 if (reportConfigChoice == 1)
4444 {
4445 // ReportConfigInterRAT
4446 // ...
4447 }
4448
4449 measConfig->reportConfigToAddModList.push_back(elem);
4450 }
4451 }
4452
4453 if (bitset11[6])
4454 {
4455 // measIdToRemoveList
4456 int measIdToRemoveListElems;
4457 bIterator = DeserializeSequenceOf(&measIdToRemoveListElems, MAX_MEAS_ID, 1, bIterator);
4458
4459 for (int i = 0; i < measIdToRemoveListElems; i++)
4460 {
4461 bIterator = DeserializeInteger(&n, 1, MAX_MEAS_ID, bIterator);
4462 measConfig->measIdToRemoveList.push_back(n);
4463 }
4464 }
4465
4466 if (bitset11[5])
4467 {
4468 // measIdToAddModList
4469 int measIdToAddModListElems;
4470 bIterator = DeserializeSequenceOf(&measIdToAddModListElems, MAX_MEAS_ID, 1, bIterator);
4471
4472 for (int i = 0; i < measIdToAddModListElems; i++)
4473 {
4475
4476 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4477
4478 bIterator = DeserializeInteger(&n, 1, MAX_MEAS_ID, bIterator);
4479 elem.measId = n;
4480
4481 bIterator = DeserializeInteger(&n, 1, MAX_OBJECT_ID, bIterator);
4482 elem.measObjectId = n;
4483
4484 bIterator = DeserializeInteger(&n, 1, MAX_REPORT_CONFIG_ID, bIterator);
4485 elem.reportConfigId = n;
4486
4487 measConfig->measIdToAddModList.push_back(elem);
4488 }
4489 }
4490
4491 measConfig->haveQuantityConfig = bitset11[4];
4492 if (measConfig->haveQuantityConfig)
4493 {
4494 // quantityConfig
4495 std::bitset<4> quantityConfigOpts;
4496 bIterator = DeserializeSequence(&quantityConfigOpts, true, bIterator);
4497
4498 if (quantityConfigOpts[3])
4499 {
4500 // quantityConfigEUTRA
4501 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4502 bIterator = DeserializeEnum(16, &n, bIterator);
4503 switch (n)
4504 {
4505 case 0:
4506 measConfig->quantityConfig.filterCoefficientRSRP = 0;
4507 break;
4508 case 1:
4509 measConfig->quantityConfig.filterCoefficientRSRP = 1;
4510 break;
4511 case 2:
4512 measConfig->quantityConfig.filterCoefficientRSRP = 2;
4513 break;
4514 case 3:
4515 measConfig->quantityConfig.filterCoefficientRSRP = 3;
4516 break;
4517 case 4:
4518 measConfig->quantityConfig.filterCoefficientRSRP = 4;
4519 break;
4520 case 5:
4521 measConfig->quantityConfig.filterCoefficientRSRP = 5;
4522 break;
4523 case 6:
4524 measConfig->quantityConfig.filterCoefficientRSRP = 6;
4525 break;
4526 case 7:
4527 measConfig->quantityConfig.filterCoefficientRSRP = 7;
4528 break;
4529 case 8:
4530 measConfig->quantityConfig.filterCoefficientRSRP = 8;
4531 break;
4532 case 9:
4533 measConfig->quantityConfig.filterCoefficientRSRP = 9;
4534 break;
4535 case 10:
4536 measConfig->quantityConfig.filterCoefficientRSRP = 11;
4537 break;
4538 case 11:
4539 measConfig->quantityConfig.filterCoefficientRSRP = 13;
4540 break;
4541 case 12:
4542 measConfig->quantityConfig.filterCoefficientRSRP = 15;
4543 break;
4544 case 13:
4545 measConfig->quantityConfig.filterCoefficientRSRP = 17;
4546 break;
4547 case 14:
4548 measConfig->quantityConfig.filterCoefficientRSRP = 19;
4549 break;
4550 case 15:
4551 measConfig->quantityConfig.filterCoefficientRSRP = 0;
4552 break;
4553 default:
4554 measConfig->quantityConfig.filterCoefficientRSRP = 4;
4555 }
4556 bIterator = DeserializeEnum(16, &n, bIterator);
4557 switch (n)
4558 {
4559 case 0:
4560 measConfig->quantityConfig.filterCoefficientRSRQ = 0;
4561 break;
4562 case 1:
4563 measConfig->quantityConfig.filterCoefficientRSRQ = 1;
4564 break;
4565 case 2:
4566 measConfig->quantityConfig.filterCoefficientRSRQ = 2;
4567 break;
4568 case 3:
4569 measConfig->quantityConfig.filterCoefficientRSRQ = 3;
4570 break;
4571 case 4:
4572 measConfig->quantityConfig.filterCoefficientRSRQ = 4;
4573 break;
4574 case 5:
4575 measConfig->quantityConfig.filterCoefficientRSRQ = 5;
4576 break;
4577 case 6:
4578 measConfig->quantityConfig.filterCoefficientRSRQ = 6;
4579 break;
4580 case 7:
4581 measConfig->quantityConfig.filterCoefficientRSRQ = 7;
4582 break;
4583 case 8:
4584 measConfig->quantityConfig.filterCoefficientRSRQ = 8;
4585 break;
4586 case 9:
4587 measConfig->quantityConfig.filterCoefficientRSRQ = 9;
4588 break;
4589 case 10:
4590 measConfig->quantityConfig.filterCoefficientRSRQ = 11;
4591 break;
4592 case 11:
4593 measConfig->quantityConfig.filterCoefficientRSRQ = 13;
4594 break;
4595 case 12:
4596 measConfig->quantityConfig.filterCoefficientRSRQ = 15;
4597 break;
4598 case 13:
4599 measConfig->quantityConfig.filterCoefficientRSRQ = 17;
4600 break;
4601 case 14:
4602 measConfig->quantityConfig.filterCoefficientRSRQ = 19;
4603 break;
4604 case 15:
4605 measConfig->quantityConfig.filterCoefficientRSRQ = 0;
4606 break;
4607 default:
4608 measConfig->quantityConfig.filterCoefficientRSRQ = 4;
4609 }
4610 }
4611 if (quantityConfigOpts[2])
4612 {
4613 // quantityConfigUTRA
4614 // ...
4615 }
4616 if (quantityConfigOpts[1])
4617 {
4618 // quantityConfigGERAN
4619 // ...
4620 }
4621 if (quantityConfigOpts[0])
4622 {
4623 // quantityConfigCDMA2000
4624 // ...
4625 }
4626 }
4627
4628 measConfig->haveMeasGapConfig = bitset11[3];
4629 if (measConfig->haveMeasGapConfig)
4630 {
4631 // measGapConfig
4632 int measGapConfigChoice;
4633 bIterator = DeserializeChoice(2, false, &measGapConfigChoice, bIterator);
4634 switch (measGapConfigChoice)
4635 {
4636 case 0:
4638 bIterator = DeserializeNull(bIterator);
4639 break;
4640 case 1:
4641 default:
4643 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4644
4645 int gapOffsetChoice;
4646 bIterator = DeserializeChoice(2, true, &gapOffsetChoice, bIterator);
4647 switch (gapOffsetChoice)
4648 {
4649 case 0:
4651 bIterator = DeserializeInteger(&n, 0, 39, bIterator);
4652 measConfig->measGapConfig.gapOffsetValue = n;
4653 break;
4654 case 1:
4655 default:
4657 bIterator = DeserializeInteger(&n, 0, 79, bIterator);
4658 measConfig->measGapConfig.gapOffsetValue = n;
4659 }
4660 }
4661 }
4662
4663 measConfig->haveSmeasure = bitset11[2];
4664 if (measConfig->haveSmeasure)
4665 {
4666 // s-Measure
4667 bIterator = DeserializeInteger(&n, 0, 97, bIterator);
4668 measConfig->sMeasure = n;
4669 }
4670
4671 if (bitset11[1])
4672 {
4673 // preRegistrationInfoHRPD
4674 // ...
4675 }
4676
4677 measConfig->haveSpeedStatePars = bitset11[0];
4678 if (measConfig->haveSpeedStatePars)
4679 {
4680 // speedStatePars
4681 int speedStateParsChoice;
4682 bIterator = DeserializeChoice(2, false, &speedStateParsChoice, bIterator);
4683 switch (speedStateParsChoice)
4684 {
4685 case 0:
4687 bIterator = DeserializeNull(bIterator);
4688 break;
4689 case 1:
4690 default:
4692 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4693
4694 // Deserialize mobilityStateParameters
4695 // Deserialize t-Evaluation
4696 bIterator = DeserializeEnum(8, &n, bIterator);
4697 switch (n)
4698 {
4699 case 0:
4701 break;
4702 case 1:
4704 break;
4705 case 2:
4707 break;
4708 case 3:
4710 break;
4711 case 4:
4713 break;
4714 default:
4716 }
4717 // Deserialize t-HystNormal
4718 bIterator = DeserializeEnum(8, &n, bIterator);
4719 switch (n)
4720 {
4721 case 0:
4723 break;
4724 case 1:
4726 break;
4727 case 2:
4729 break;
4730 case 3:
4732 break;
4733 case 4:
4735 break;
4736 default:
4738 }
4739
4740 bIterator = DeserializeInteger(&n, 1, 16, bIterator);
4742
4743 bIterator = DeserializeInteger(&n, 1, 16, bIterator);
4745
4746 // Deserialize timeToTriggerSf
4747 bIterator = DeserializeEnum(4, &n, bIterator);
4748 measConfig->speedStatePars.timeToTriggerSf.sfMedium = (n + 1) * 25;
4749 bIterator = DeserializeEnum(4, &n, bIterator);
4750 measConfig->speedStatePars.timeToTriggerSf.sfHigh = (n + 1) * 25;
4751 }
4752 }
4753 return bIterator;
4754}
4755
4756//////////////////// RrcConnectionRequest class ////////////////////////
4757
4758// Constructor
4761{
4762 m_mmec = std::bitset<8>(0UL);
4763 m_mTmsi = std::bitset<32>(0UL);
4765 m_spare = std::bitset<1>(0UL);
4766}
4767
4768// Destructor
4772
4773TypeId
4775{
4776 static TypeId tid =
4777 TypeId("ns3::RrcConnectionRequestHeader").SetParent<Header>().SetGroupName("Lte");
4778 return tid;
4779}
4780
4781void
4783{
4784 os << "MMEC:" << m_mmec << std::endl;
4785 os << "MTMSI:" << m_mTmsi << std::endl;
4786 os << "EstablishmentCause:" << m_establishmentCause << std::endl;
4787 os << "Spare: " << m_spare << std::endl;
4788}
4789
4790void
4792{
4794
4796
4797 // Serialize RRCConnectionRequest sequence:
4798 // no default or optional fields. Extension marker not present.
4799 SerializeSequence(std::bitset<0>(), false);
4800
4801 // Serialize criticalExtensions choice:
4802 // 2 options, selected: 0 (option: rrcConnectionRequest-r8)
4803 SerializeChoice(2, 0, false);
4804
4805 // Serialize RRCConnectionRequest-r8-IEs sequence:
4806 // no default or optional fields. Extension marker not present.
4807 SerializeSequence(std::bitset<0>(), false);
4808
4809 // Serialize InitialUE-Identity choice:
4810 // 2 options, selected: 0 (option: s-TMSI)
4811 SerializeChoice(2, 0, false);
4812
4813 // Serialize S-TMSI sequence:
4814 // no default or optional fields. Extension marker not present.
4815 SerializeSequence(std::bitset<0>(), false);
4816
4817 // Serialize mmec : MMEC ::= BIT STRING (SIZE (8))
4819
4820 // Serialize m-TMSI ::= BIT STRING (SIZE (32))
4822
4823 // Serialize establishmentCause : EstablishmentCause ::= ENUMERATED
4825
4826 // Serialize spare : BIT STRING (SIZE (1))
4827 SerializeBitstring(std::bitset<1>());
4828
4829 // Finish serialization
4831}
4832
4835{
4836 std::bitset<1> dummy;
4837 std::bitset<0> optionalOrDefaultMask;
4838 int selectedOption;
4839
4840 bIterator = DeserializeUlCcchMessage(bIterator);
4841
4842 // Deserialize RCConnectionRequest sequence
4843 bIterator = DeserializeSequence(&optionalOrDefaultMask, false, bIterator);
4844
4845 // Deserialize criticalExtensions choice:
4846 bIterator = DeserializeChoice(2, false, &selectedOption, bIterator);
4847
4848 // Deserialize RRCConnectionRequest-r8-IEs sequence
4849 bIterator = DeserializeSequence(&optionalOrDefaultMask, false, bIterator);
4850
4851 // Deserialize InitialUE-Identity choice
4852 bIterator = DeserializeChoice(2, false, &selectedOption, bIterator);
4853
4854 // Deserialize S-TMSI sequence
4855 bIterator = DeserializeSequence(&optionalOrDefaultMask, false, bIterator);
4856
4857 // Deserialize mmec
4858 bIterator = DeserializeBitstring(&m_mmec, bIterator);
4859
4860 // Deserialize m-TMSI
4861 bIterator = DeserializeBitstring(&m_mTmsi, bIterator);
4862
4863 // Deserialize establishmentCause
4864 bIterator = DeserializeEnum(8, &selectedOption, bIterator);
4865
4866 // Deserialize spare
4867 bIterator = DeserializeBitstring(&dummy, bIterator);
4868
4869 return GetSerializedSize();
4870}
4871
4872void
4874{
4875 m_mTmsi = std::bitset<32>((uint32_t)msg.ueIdentity);
4876 m_mmec = std::bitset<8>((uint32_t)(msg.ueIdentity >> 32));
4877 m_isDataSerialized = false;
4878}
4879
4882{
4884 msg.ueIdentity = (((uint64_t)m_mmec.to_ulong()) << 32) | (m_mTmsi.to_ulong());
4885
4886 return msg;
4887}
4888
4889std::bitset<8>
4891{
4892 return m_mmec;
4893}
4894
4895std::bitset<32>
4897{
4898 return m_mTmsi;
4899}
4900
4901//////////////////// RrcConnectionSetup class ////////////////////////
4905
4909
4910void
4911RrcConnectionSetupHeader::Print(std::ostream& os) const
4912{
4913 os << "rrcTransactionIdentifier: " << (int)m_rrcTransactionIdentifier << std::endl;
4914 os << "radioResourceConfigDedicated:" << std::endl;
4916}
4917
4918void
4920{
4922
4924
4925 SerializeInteger(15, 0, 15);
4926
4927 // Serialize RRCConnectionSetup sequence:
4928 // no default or optional fields. Extension marker not present.
4929 SerializeSequence(std::bitset<0>(), false);
4930
4931 // Serialize rrc-TransactionIdentifier ::=INTEGER (0..3)
4933
4934 // Serialize criticalExtensions choice:
4935 // 2 options, selected: 0 (option: c1)
4936 SerializeChoice(2, 0, false);
4937
4938 // Serialize c1 choice:
4939 // 8 options, selected: 0 (option: rrcConnectionSetup-r8)
4940 SerializeChoice(8, 0, false);
4941
4942 // Serialize rrcConnectionSetup-r8 sequence
4943 // 1 optional fields (not present). Extension marker not present.
4944 SerializeSequence(std::bitset<1>(0), false);
4945
4946 // Serialize RadioResourceConfigDedicated sequence
4948
4949 // Serialize nonCriticalExtension sequence
4950 // 2 optional fields, none present. No extension marker.
4951 SerializeSequence(std::bitset<2>(0), false);
4952
4953 // Finish serialization
4955}
4956
4959{
4960 int n;
4961
4962 std::bitset<0> bitset0;
4963 std::bitset<1> bitset1;
4964 std::bitset<2> bitset2;
4965
4966 bIterator = DeserializeDlCcchMessage(bIterator);
4967
4968 bIterator = DeserializeInteger(&n, 0, 15, bIterator);
4969
4970 // Deserialize RRCConnectionSetup sequence
4971 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4972
4973 // Deserialize rrc-TransactionIdentifier ::=INTEGER (0..3)
4974 bIterator = DeserializeInteger(&n, 0, 3, bIterator);
4976
4977 // Deserialize criticalExtensions choice
4978 int criticalExtensionChoice;
4979 bIterator = DeserializeChoice(2, false, &criticalExtensionChoice, bIterator);
4980 if (criticalExtensionChoice == 1)
4981 {
4982 // Deserialize criticalExtensionsFuture
4983 bIterator = DeserializeSequence(&bitset0, false, bIterator);
4984 }
4985 else if (criticalExtensionChoice == 0)
4986 {
4987 // Deserialize c1
4988 int c1;
4989 bIterator = DeserializeChoice(8, false, &c1, bIterator);
4990
4991 if (c1 > 0)
4992 {
4993 // Deserialize spareX , X:=7..1
4994 bIterator = DeserializeNull(bIterator);
4995 }
4996 else if (c1 == 0)
4997 {
4998 // Deserialize rrcConnectionSetup-r8
4999 // 1 optional fields, no extension marker.
5000 bIterator = DeserializeSequence(&bitset1, false, bIterator);
5001
5002 // Deserialize radioResourceConfigDedicated
5003 bIterator =
5005
5006 if (bitset1[0])
5007 {
5008 // Deserialize nonCriticalExtension
5009 // 2 optional fields, no extension marker.
5010 bIterator = DeserializeSequence(&bitset2, false, bIterator);
5011
5012 // Deserialization of lateR8NonCriticalExtension and nonCriticalExtension
5013 // ...
5014 }
5015 }
5016 }
5017 return GetSerializedSize();
5018}
5019
5020void
5027
5036
5037uint8_t
5042
5043bool
5048
5049std::list<LteRrcSap::SrbToAddMod>
5054
5055std::list<LteRrcSap::DrbToAddMod>
5060
5061std::list<uint8_t>
5066
5072
5078
5079//////////////////// RrcConnectionSetupCompleteHeader class ////////////////////////
5080
5084
5088
5089void
5091{
5093
5094 // Serialize DCCH message
5096
5097 // Serialize RRCConnectionSetupComplete sequence:
5098 // no default or optional fields. Extension marker not present.
5099 SerializeSequence(std::bitset<0>(), false);
5100
5101 // Serialize rrc-TransactionIdentifier
5103
5104 // Serialize criticalExtensions choice
5105 // 2 options, selected 0 (c1)
5106 SerializeChoice(2, 0, false);
5107
5108 // Choose spare3 NULL
5109 SerializeChoice(4, 1, false);
5110
5111 // Serialize spare3 NULL
5112 SerializeNull();
5113
5114 // Finish serialization
5116}
5117
5120{
5121 std::bitset<0> bitset0;
5122
5123 bIterator = DeserializeUlDcchMessage(bIterator);
5124
5125 bIterator = DeserializeSequence(&bitset0, false, bIterator);
5126
5127 int n;
5128 bIterator = DeserializeInteger(&n, 0, 3, bIterator);
5130
5131 bIterator = DeserializeChoice(2, false, &n, bIterator);
5132
5133 if (n == 1)
5134 {
5135 // Deserialize criticalExtensionsFuture
5136 bIterator = DeserializeSequence(&bitset0, false, bIterator);
5137 }
5138 else if (n == 0)
5139 {
5140 // Deserialize c1
5141 int c1Chosen;
5142 bIterator = DeserializeChoice(4, false, &c1Chosen, bIterator);
5143
5144 if (c1Chosen == 0)
5145 {
5146 // Deserialize rrcConnectionSetupComplete-r8
5147 // ...
5148 }
5149 else
5150 {
5151 bIterator = DeserializeNull(bIterator);
5152 }
5153 }
5154
5155 return GetSerializedSize();
5156}
5157
5158void
5160{
5161 os << "rrcTransactionIdentifier: " << (int)m_rrcTransactionIdentifier << std::endl;
5162}
5163
5164void
5170
5171uint8_t
5176
5184
5185//////////////////// RrcConnectionReconfigurationCompleteHeader class ////////////////////////
5186
5190
5194
5195void
5197{
5199
5200 // Serialize DCCH message
5202
5203 // Serialize RRCConnectionSetupComplete sequence:
5204 // no default or optional fields. Extension marker not present.
5205 SerializeSequence(std::bitset<0>(), false);
5206
5207 // Serialize rrc-TransactionIdentifier
5209
5210 // Serialize criticalExtensions choice
5211 // 2 options, selected 1 (criticalExtensionsFuture)
5212 SerializeChoice(2, 1, false);
5213
5214 // Choose criticalExtensionsFuture
5215 SerializeSequence(std::bitset<0>(), false);
5216
5217 // Finish serialization
5219}
5220
5223{
5224 std::bitset<0> bitset0;
5225 int n;
5226
5227 bIterator = DeserializeUlDcchMessage(bIterator);
5228 bIterator = DeserializeSequence(&bitset0, false, bIterator);
5229
5230 bIterator = DeserializeInteger(&n, 0, 3, bIterator);
5232
5233 bIterator = DeserializeChoice(2, false, &n, bIterator);
5234
5235 if (n == 1)
5236 {
5237 // Deserialize criticalExtensionsFuture
5238 bIterator = DeserializeSequence(&bitset0, false, bIterator);
5239 }
5240 else if (n == 0)
<