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)
5241 {
5242 // Deserialize rrcConnectionReconfigurationComplete-r8
5243 // ...
5244 }
5245
5246 return GetSerializedSize();
5247}
5248
5249void
5251{
5252 os << "rrcTransactionIdentifier: " << (int)m_rrcTransactionIdentifier << std::endl;
5253}
5254
5255void
5262
5270
5271uint8_t
5276
5277//////////////////// RrcConnectionReconfigurationHeader class ////////////////////////
5278
5282
5286
5287void
5289{
5291
5293
5294 // Serialize RRCConnectionSetupComplete sequence:
5295 // no default or optional fields. Extension marker not present.
5296 SerializeSequence(std::bitset<0>(), false);
5297
5298 // Serialize rrc-TransactionIdentifier
5300
5301 // Serialize criticalExtensions choice
5302 // 2 options, selected 0 (c1)
5303 SerializeChoice(2, 0, false);
5304
5305 // Serialize c1 choice
5306 // 8 options, selected 0 (rrcConnectionReconfiguration-r8)
5307 SerializeChoice(8, 0, false);
5308
5309 // Serialize RRCConnectionReconfiguration-r8-IEs sequence:
5310 // 6 optional fields. Extension marker not present.
5311 std::bitset<6> options;
5312 options.set(5, m_haveMeasConfig);
5313 options.set(4, m_haveMobilityControlInfo);
5314 options.set(3, false); // No dedicatedInfoNASList
5315 options.set(2, m_haveRadioResourceConfigDedicated);
5316 options.set(1, false); // No securityConfigHO
5317 options.set(0, m_haveNonCriticalExtension); // Implemented nonCriticalExtension because
5318 // compatibility with R10 - CA
5319 SerializeSequence(options, false);
5320
5321 if (m_haveMeasConfig)
5322 {
5324 }
5325
5327 {
5328 // Serialize MobilityControlInfo
5329
5330 // 4 optional fields, extension marker present.
5331 std::bitset<4> mobCtrlIntoOptional;
5332 mobCtrlIntoOptional.set(3, m_mobilityControlInfo.haveCarrierFreq);
5333 mobCtrlIntoOptional.set(2, m_mobilityControlInfo.haveCarrierBandwidth);
5334 mobCtrlIntoOptional.set(1, false); // No additionalSpectrumEmission
5335 mobCtrlIntoOptional.set(0, m_mobilityControlInfo.haveRachConfigDedicated);
5336 SerializeSequence(mobCtrlIntoOptional, true);
5337
5338 // Serialize targetPhysCellId
5340
5342 {
5343 SerializeSequence(std::bitset<1>(1), false);
5346 }
5347
5349 {
5350 SerializeSequence(std::bitset<1>(1), false);
5351
5352 // Serialize dl-Bandwidth
5354
5355 // Serialize ul-Bandwidth
5357 }
5358
5359 // Serialize t304
5360 SerializeEnum(8, 0);
5361
5362 // Serialize newUE-Identity
5364
5365 // Serialize radioResourceConfigCommon
5367
5369 {
5370 SerializeSequence(std::bitset<0>(), false);
5373 }
5374 }
5375
5377 {
5378 // Serialize RadioResourceConfigDedicated
5380 }
5381
5383 {
5384 // Serialize NonCriticalExtension RRCConnectionReconfiguration-v890-IEs sequence:
5385 // 2 optional fields. Extension marker not present.
5386 std::bitset<2> noncriticalExtension_v890;
5387 noncriticalExtension_v890.set(1, false); // No lateNonCriticalExtension
5388 noncriticalExtension_v890.set(
5389 0,
5390 m_haveNonCriticalExtension); // Implemented nonCriticalExtension because compatibility
5391 // with R10 - CA
5392 // Enable RRCCoonectionReconfiguration-v920-IEs
5393 SerializeSequence(noncriticalExtension_v890, false);
5394
5395 // Serialize NonCriticalExtension RRCConnectionReconfiguration-v920-IEs sequence:
5396 // 3 optional fields. Extension marker not present.
5397 std::bitset<3> noncriticalExtension_v920;
5398 noncriticalExtension_v920.set(1, false); // No otherConfig-r9
5399 noncriticalExtension_v920.set(1, false); // No fullConfig-r9
5400 // Enable RRCCoonectionReconfiguration-v1020-IEs
5401 noncriticalExtension_v920.set(
5402 0,
5403 m_haveNonCriticalExtension); // Implemented nonCriticalExtension because compatibility
5404 // with R10 - CA
5405 SerializeSequence(noncriticalExtension_v920, false);
5406
5408 m_nonCriticalExtension); // Serializing RRCConnectionReconfiguration-r8-IEs
5409 }
5410
5411 // Finish serialization
5413}
5414
5417{
5418 std::bitset<0> bitset0;
5419
5420 bIterator = DeserializeDlDcchMessage(bIterator);
5421
5422 // RRCConnectionReconfiguration sequence
5423 bIterator = DeserializeSequence(&bitset0, false, bIterator);
5424
5425 // rrc-TransactionIdentifier
5426 int n;
5427 bIterator = DeserializeInteger(&n, 0, 3, bIterator);
5429
5430 // criticalExtensions
5431 int sel;
5432 bIterator = DeserializeChoice(2, false, &sel, bIterator);
5433 if (sel == 1)
5434 {
5435 // criticalExtensionsFuture
5436 bIterator = DeserializeSequence(&bitset0, false, bIterator);
5437 }
5438 else if (sel == 0)
5439 {
5440 // c1
5441 int c1Chosen;
5442 bIterator = DeserializeChoice(8, false, &c1Chosen, bIterator);
5443 if (c1Chosen > 0)
5444 {
5445 bIterator = DeserializeNull(bIterator);
5446 }
5447 else if (c1Chosen == 0)
5448 {
5449 // rrcConnectionReconfiguration-r8
5450 std::bitset<6> rrcConnRecOpts;
5451 bIterator = DeserializeSequence(&rrcConnRecOpts, false, bIterator);
5452
5453 m_haveMeasConfig = rrcConnRecOpts[5];
5454 if (m_haveMeasConfig)
5455 {
5456 bIterator = DeserializeMeasConfig(&m_measConfig, bIterator);
5457 }
5458
5459 m_haveMobilityControlInfo = rrcConnRecOpts[4];
5461 {
5462 // mobilityControlInfo
5463 std::bitset<4> mobCtrlOpts;
5464 bIterator = DeserializeSequence(&mobCtrlOpts, true, bIterator);
5465
5466 // PhysCellId
5467 bIterator = DeserializeInteger(&n, 0, 503, bIterator);
5469
5470 // carrierFreq
5471 m_mobilityControlInfo.haveCarrierFreq = mobCtrlOpts[3];
5473 {
5474 std::bitset<1> ulCarrierFreqPresent;
5475 bIterator = DeserializeSequence(&ulCarrierFreqPresent, false, bIterator);
5476
5477 bIterator = DeserializeInteger(&n, 0, MAX_EARFCN, bIterator);
5479
5480 if (ulCarrierFreqPresent[0])
5481 {
5482 bIterator = DeserializeInteger(&n, 0, MAX_EARFCN, bIterator);
5484 }
5485 }
5486
5487 // carrierBandwidth
5490 {
5491 std::bitset<1> ulBandwidthPresent;
5492 bIterator = DeserializeSequence(&ulBandwidthPresent, false, bIterator);
5493
5494 bIterator = DeserializeEnum(16, &n, bIterator);
5496
5497 if (ulBandwidthPresent[0])
5498 {
5499 bIterator = DeserializeEnum(16, &n, bIterator);
5501 }
5502 }
5503
5504 // additionalSpectrumEmission
5505 if (mobCtrlOpts[1])
5506 {
5507 // ...
5508 }
5509
5510 // t304
5511 bIterator = DeserializeEnum(8, &n, bIterator);
5512
5513 // newUE-Identity
5514 std::bitset<16> cRnti;
5515 bIterator = DeserializeBitstring(&cRnti, bIterator);
5516 m_mobilityControlInfo.newUeIdentity = cRnti.to_ulong();
5517
5518 // radioResourceConfigCommon
5521 bIterator);
5522
5525 {
5526 bIterator = DeserializeSequence(&bitset0, false, bIterator);
5527 bIterator = DeserializeInteger(&n, 0, 63, bIterator);
5529 bIterator = DeserializeInteger(&n, 0, 15, bIterator);
5531 }
5532 }
5533
5534 // dedicatedInfoNASList
5535 if (rrcConnRecOpts[3])
5536 {
5537 // ...
5538 }
5539
5540 // radioResourceConfigDedicated
5541 m_haveRadioResourceConfigDedicated = rrcConnRecOpts[2];
5543 {
5545 bIterator);
5546 }
5547
5548 // securityConfigHO
5549 if (rrcConnRecOpts[1])
5550 {
5551 // ...
5552 }
5553
5554 // nonCriticalExtension
5555 m_haveNonCriticalExtension = rrcConnRecOpts[0];
5557 {
5558 bIterator =
5560 // ...
5561 }
5562 }
5563 }
5564
5565 return GetSerializedSize();
5566}
5567
5568void
5570{
5571 os << "rrcTransactionIdentifier: " << (int)m_rrcTransactionIdentifier << std::endl;
5572 os << "haveMeasConfig: " << m_haveMeasConfig << std::endl;
5573 if (m_haveMeasConfig)
5574 {
5576 {
5577 os << " measObjectToRemoveList: ";
5578 std::list<uint8_t> auxList = m_measConfig.measObjectToRemoveList;
5579 auto it = auxList.begin();
5580 for (; it != auxList.end(); it++)
5581 {
5582 os << (int)*it << ", ";
5583 }
5584 os << std::endl;
5585 }
5587 {
5588 os << " reportConfigToRemoveList: ";
5589 std::list<uint8_t> auxList = m_measConfig.reportConfigToRemoveList;
5590 auto it = auxList.begin();
5591 for (; it != auxList.end(); it++)
5592 {
5593 os << (int)*it << ", ";
5594 }
5595 os << std::endl;
5596 }
5597 if (!m_measConfig.measIdToRemoveList.empty())
5598 {
5599 os << " measIdToRemoveList: ";
5600 std::list<uint8_t> auxList = m_measConfig.measIdToRemoveList;
5601 auto it = auxList.begin();
5602 for (; it != auxList.end(); it++)
5603 {
5604 os << (int)*it << ", ";
5605 }
5606 os << std::endl;
5607 }
5608
5610 {
5611 os << " measObjectToAddMod: " << std::endl;
5612 std::list<LteRrcSap::MeasObjectToAddMod> auxList = m_measConfig.measObjectToAddModList;
5613 auto it = auxList.begin();
5614 for (; it != auxList.end(); it++)
5615 {
5616 os << " measObjectId: " << (int)it->measObjectId << std::endl;
5617 os << " carrierFreq: " << (int)it->measObjectEutra.carrierFreq << std::endl;
5618 os << " allowedMeasBandwidth: " << (int)it->measObjectEutra.allowedMeasBandwidth
5619 << std::endl;
5620 os << " presenceAntennaPort1: " << it->measObjectEutra.presenceAntennaPort1
5621 << std::endl;
5622 os << " neighCellConfig: " << (int)it->measObjectEutra.neighCellConfig
5623 << std::endl;
5624 os << " offsetFreq: " << (int)it->measObjectEutra.offsetFreq << std::endl;
5625
5626 if (!it->measObjectEutra.cellsToRemoveList.empty())
5627 {
5628 os << " cellsToRemoveList: ";
5629 std::list<uint8_t> auxList = it->measObjectEutra.cellsToRemoveList;
5630 auto it = auxList.begin();
5631 for (; it != auxList.end(); it++)
5632 {
5633 os << (int)*it << ", ";
5634 }
5635 os << std::endl;
5636 }
5637
5638 if (!it->measObjectEutra.blackCellsToRemoveList.empty())
5639 {
5640 os << " blackCellsToRemoveList: ";
5641 std::list<uint8_t> auxList = it->measObjectEutra.blackCellsToRemoveList;
5642 auto it = auxList.begin();
5643 for (; it != auxList.end(); it++)
5644 {
5645 os << (int)*it << ", ";
5646 }
5647 os << std::endl;
5648 }
5649
5650 if (!it->measObjectEutra.cellsToAddModList.empty())
5651 {
5652 os << " cellsToAddModList: " << std::endl;
5653 std::list<LteRrcSap::CellsToAddMod> auxList =
5654 it->measObjectEutra.cellsToAddModList;
5655 auto it = auxList.begin();
5656 for (; it != auxList.end(); it++)
5657 {
5658 os << " cellIndex: " << (int)it->cellIndex << std::endl;
5659 os << " physCellId: " << (int)it->physCellId << std::endl;
5660 os << " cellIndividualOffset: " << (int)it->cellIndividualOffset
5661 << std::endl;
5662 os << " ------ " << std::endl;
5663 }
5664 }
5665
5666 if (!it->measObjectEutra.blackCellsToAddModList.empty())
5667 {
5668 os << " blackCellsToAddModList: " << std::endl;
5669 std::list<LteRrcSap::BlackCellsToAddMod> auxList =
5670 it->measObjectEutra.blackCellsToAddModList;
5671 auto it = auxList.begin();
5672 for (; it != auxList.end(); it++)
5673 {
5674 os << " cellIndex: " << (int)it->cellIndex << std::endl;
5675 os << " physCellIdRange.start: " << (int)it->physCellIdRange.start
5676 << std::endl;
5677 os << " physCellIdRange.haveRange: " << it->physCellIdRange.haveRange
5678 << std::endl;
5679 os << " physCellIdRange.range: " << (int)it->physCellIdRange.range
5680 << std::endl;
5681 os << " ------ " << std::endl;
5682 }
5683 }
5684
5685 os << " haveCellForWhichToReportCGI: "
5686 << it->measObjectEutra.haveCellForWhichToReportCGI << std::endl;
5687 os << " cellForWhichToReportCGI: "
5688 << (int)it->measObjectEutra.cellForWhichToReportCGI << std::endl;
5689 os << " ------------- " << std::endl;
5690 }
5691 }
5692
5694 {
5695 os << " reportConfigToAddModList: " << std::endl;
5696 std::list<LteRrcSap::ReportConfigToAddMod> auxList =
5698 auto it = auxList.begin();
5699 for (; it != auxList.end(); it++)
5700 {
5701 os << " reportConfigId: " << (int)it->reportConfigId << std::endl;
5702 os << " reportConfigEutra.triggerType "
5703 << (int)it->reportConfigEutra.triggerType << std::endl;
5704 if (it->reportConfigEutra.triggerType == LteRrcSap::ReportConfigEutra::EVENT)
5705 {
5706 os << " reportConfigEutra.eventId " << (int)it->reportConfigEutra.eventId
5707 << std::endl;
5708 if (it->reportConfigEutra.eventId == LteRrcSap::ReportConfigEutra::EVENT_A3)
5709 {
5710 os << " reportConfigEutra.reportOnLeave "
5711 << (int)it->reportConfigEutra.reportOnLeave << std::endl;
5712 os << " reportConfigEutra.a3Offset "
5713 << (int)it->reportConfigEutra.a3Offset << std::endl;
5714 }
5715 else
5716 {
5717 os << " reportConfigEutra.threshold1.choice "
5718 << (int)it->reportConfigEutra.threshold1.choice << std::endl;
5719 os << " reportConfigEutra.threshold1.range "
5720 << (int)it->reportConfigEutra.threshold1.range << std::endl;
5721 if (it->reportConfigEutra.eventId == LteRrcSap::ReportConfigEutra::EVENT_A5)
5722 {
5723 os << " reportConfigEutra.threshold2.choice "
5724 << (int)it->reportConfigEutra.threshold2.choice << std::endl;
5725 os << " reportConfigEutra.threshold2.range "
5726 << (int)it->reportConfigEutra.threshold2.range << std::endl;
5727 }
5728 }
5729 os << " reportConfigEutra.hysteresis "
5730 << (int)it->reportConfigEutra.hysteresis << std::endl;
5731 os << " reportConfigEutra.timeToTrigger "
5732 << (int)it->reportConfigEutra.timeToTrigger << std::endl;
5733 }
5734 else
5735 {
5736 os << " reportConfigEutra.purpose " << (int)it->reportConfigEutra.purpose
5737 << std::endl;
5738 }
5739 os << " reportConfigEutra.triggerQuantity "
5740 << (int)it->reportConfigEutra.triggerQuantity << std::endl;
5741 os << " reportConfigEutra.reportQuantity "
5742 << (int)it->reportConfigEutra.reportQuantity << std::endl;
5743 os << " reportConfigEutra.maxReportCells "
5744 << (int)it->reportConfigEutra.maxReportCells << std::endl;
5745 os << " reportConfigEutra.reportInterval "
5746 << (int)it->reportConfigEutra.reportInterval << std::endl;
5747 os << " reportConfigEutra.reportAmount "
5748 << (int)it->reportConfigEutra.reportAmount << std::endl;
5749 }
5750 }
5751
5752 if (!m_measConfig.measIdToAddModList.empty())
5753 {
5754 os << " measIdToAddModList: " << std::endl;
5755 std::list<LteRrcSap::MeasIdToAddMod> auxList = m_measConfig.measIdToAddModList;
5756 auto it = auxList.begin();
5757 for (; it != auxList.end(); it++)
5758 {
5759 os << " measId: " << (int)it->measId << std::endl;
5760 os << " measObjectId: " << (int)it->measObjectId << std::endl;
5761 os << " reportConfigId: " << (int)it->reportConfigId << std::endl;
5762 os << " ------ " << std::endl;
5763 }
5764 }
5765
5766 os << " haveQuantityConfig: " << m_measConfig.haveQuantityConfig << std::endl;
5768 {
5769 os << " filterCoefficientRSRP: "
5771 os << " filterCoefficientRSRQ:"
5773 }
5774
5775 os << " haveMeasGapConfig: " << m_measConfig.haveMeasGapConfig << std::endl;
5777 {
5778 os << " measGapConfig.type: " << m_measConfig.measGapConfig.type << std::endl;
5779 os << " measGapConfig.gap (gap0/1,value): ("
5781 << (int)m_measConfig.measGapConfig.gapOffsetValue << ")" << std::endl;
5782 }
5783
5784 os << " haveSmeasure: " << m_measConfig.haveSmeasure << std::endl;
5786 {
5787 os << " sMeasure: " << (int)m_measConfig.sMeasure << std::endl;
5788 }
5789
5790 os << " haveSpeedStatePars: " << m_measConfig.haveSpeedStatePars << std::endl;
5792 {
5793 os << " speedStatePars.type: " << m_measConfig.speedStatePars.type << std::endl;
5794 os << " speedStatePars.mobilityStateParameters.tEvaluation: "
5796 os << " speedStatePars.mobilityStateParameters.tHystNormal: "
5798 os << " speedStatePars.mobilityStateParameters.nCellChangeMedium: "
5800 << std::endl;
5801 os << " speedStatePars.mobilityStateParameters.nCellChangeHigh: "
5803 << std::endl;
5804 os << " speedStatePars.timeToTriggerSf.sfMedium: "
5806 os << " speedStatePars.timeToTriggerSf.sfHigh: "
5808 }
5809 }
5810
5811 os << "haveMobilityControlInfo: " << m_haveMobilityControlInfo << std::endl;
5813 {
5814 os << "targetPhysCellId: " << (int)m_mobilityControlInfo.targetPhysCellId << std::endl;
5815 os << "haveCarrierFreq: " << m_mobilityControlInfo.haveCarrierFreq << std::endl;
5817 {
5818 os << " carrierFreq.dlCarrierFreq: "
5819 << (int)m_mobilityControlInfo.carrierFreq.dlCarrierFreq << std::endl;
5820 os << " carrierFreq.dlCarrierFreq: "
5821 << (int)m_mobilityControlInfo.carrierFreq.ulCarrierFreq << std::endl;
5822 }
5823 os << "haveCarrierBandwidth: " << m_mobilityControlInfo.haveCarrierBandwidth << std::endl;
5825 {
5826 os << " carrierBandwidth.dlBandwidth: "
5828 os << " carrierBandwidth.ulBandwidth: "
5830 }
5831 os << "newUeIdentity: " << (int)m_mobilityControlInfo.newUeIdentity << std::endl;
5832 os << "haveRachConfigDedicated: " << m_mobilityControlInfo.haveRachConfigDedicated
5833 << std::endl;
5835 {
5836 os << "raPreambleIndex: "
5838 os << "raPrachMaskIndex: "
5840 }
5841 }
5842 os << "haveRadioResourceConfigDedicated: " << m_haveRadioResourceConfigDedicated << std::endl;
5844 {
5846 }
5847}
5848
5849void
5864
5867{
5869
5871 msg.haveMeasConfig = m_haveMeasConfig;
5872 msg.measConfig = m_measConfig;
5873 msg.haveMobilityControlInfo = m_haveMobilityControlInfo;
5874 msg.mobilityControlInfo = m_mobilityControlInfo;
5875 msg.haveRadioResourceConfigDedicated = m_haveRadioResourceConfigDedicated;
5876 msg.radioResourceConfigDedicated = m_radioResourceConfigDedicated;
5877 msg.haveNonCriticalExtension = m_haveNonCriticalExtension;
5878 msg.nonCriticalExtension = m_nonCriticalExtension;
5879
5880 return msg;
5881}
5882
5883uint8_t
5888
5889bool
5894
5900
5901bool
5906
5912
5913bool
5918
5924
5925bool
5930
5936
5937bool
5942
5943std::list<LteRrcSap::SrbToAddMod>
5948
5949std::list<LteRrcSap::DrbToAddMod>
5954
5955std::list<uint8_t>
5960
5966
5967//////////////////// HandoverPreparationInfoHeader class ////////////////////////
5968
5972
5973void
5975{
5977
5978 // Serialize HandoverPreparationInformation sequence:
5979 // no default or optional fields. Extension marker not present.
5980 SerializeSequence(std::bitset<0>(), false);
5981
5982 // Serialize criticalExtensions choice
5983 // 2 options, selected 0 (c1)
5984 SerializeChoice(2, 0, false);
5985
5986 // Serialize c1 choice
5987 // 8 options, selected 0 (handoverPreparationInformation-r8)
5988 SerializeChoice(8, 0, false);
5989
5990 // Serialize HandoverPreparationInformation-r8-IEs sequence
5991 // 4 optional fields, no extension marker.
5992 std::bitset<4> handoverPrepInfoOpts;
5993 handoverPrepInfoOpts.set(3, true); // as-Config present
5994 handoverPrepInfoOpts.set(2, false); // rrm-Config not present
5995 handoverPrepInfoOpts.set(1, false); // as-Context not present
5996 handoverPrepInfoOpts.set(0, false); // nonCriticalExtension not present
5997 SerializeSequence(handoverPrepInfoOpts, false);
5998
5999 // Serialize ue-RadioAccessCapabilityInfo
6001
6002 // Serialize as-Config
6003 SerializeSequence(std::bitset<0>(), true);
6004
6005 // Serialize sourceMeasConfig
6007
6008 // Serialize sourceRadioResourceConfig
6010
6011 // Serialize sourceSecurityAlgorithmConfig
6012 SerializeSequence(std::bitset<0>(), false);
6013 // cipheringAlgorithm
6014 SerializeEnum(8, 0);
6015 // integrityProtAlgorithm
6016 SerializeEnum(8, 0);
6017
6018 // Serialize sourceUE-Identity
6020
6021 // Serialize sourceMasterInformationBlock
6022 SerializeSequence(std::bitset<0>(), false);
6024 6,
6026 SerializeSequence(std::bitset<0>(), false); // phich-Config sequence
6027 SerializeEnum(2, 0); // phich-Duration
6028 SerializeEnum(4, 0); // phich-Resource
6029 SerializeBitstring(std::bitset<8>(
6031 SerializeBitstring(std::bitset<10>(321)); // spare
6032
6033 // Serialize sourceSystemInformationBlockType1 sequence
6035
6036 // Serialize sourceSystemInformationBlockType2
6038
6039 // Serialize AntennaInfoCommon
6040 SerializeSequence(std::bitset<0>(0), false);
6041 SerializeEnum(4, 0); // antennaPortsCount
6042
6043 // Serialize sourceDlCarrierFreq
6045
6046 // Finish serialization
6048}
6049
6052{
6053 std::bitset<0> bitset0;
6054 int n;
6055
6056 // Deserialize HandoverPreparationInformation sequence
6057 // 0 optional fields, no extension marker
6058 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6059
6060 // Deserialize criticalExtensions choice
6061 int criticalExtensionsChosen;
6062 bIterator = DeserializeChoice(2, false, &criticalExtensionsChosen, bIterator);
6063
6064 if (criticalExtensionsChosen == 1)
6065 {
6066 // Deserialize criticalExtensionsFuture
6067 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6068 }
6069 else if (criticalExtensionsChosen == 0)
6070 {
6071 // Deserialize c1 choice
6072 int c1Chosen;
6073 bIterator = DeserializeChoice(8, false, &c1Chosen, bIterator);
6074 if (c1Chosen > 0)
6075 {
6076 bIterator = DeserializeNull(bIterator);
6077 }
6078 else if (c1Chosen == 0)
6079 {
6080 // Deserialize handoverPreparationInformation-r8
6081 std::bitset<4> handoverPrepInfoOpts;
6082 bIterator = DeserializeSequence(&handoverPrepInfoOpts, false, bIterator);
6083
6084 // Deserialize ue-RadioAccessCapabilityInfo
6085 bIterator = DeserializeSequenceOf(&n, MAX_RAT_CAPABILITIES, 0, bIterator);
6086 for (int i = 0; i < n; i++)
6087 {
6088 // Deserialize UE-CapabilityRAT-Container
6089 // ...
6090 }
6091
6092 if (handoverPrepInfoOpts[3])
6093 {
6094 // Deserialize as-Config sequence
6095 bIterator = DeserializeSequence(&bitset0, true, bIterator);
6096
6097 // Deserialize sourceMeasConfig
6098 bIterator = DeserializeMeasConfig(&m_asConfig.sourceMeasConfig, bIterator);
6099
6100 // Deserialize sourceRadioResourceConfig
6101 bIterator =
6103 bIterator);
6104
6105 // Deserialize sourceSecurityAlgorithmConfig
6106 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6107 bIterator = DeserializeEnum(8, &n, bIterator); // cipheringAlgorithm
6108 bIterator = DeserializeEnum(8, &n, bIterator); // integrityProtAlgorithm
6109
6110 // Deserialize sourceUE-Identity
6111 std::bitset<16> cRnti;
6112 bIterator = DeserializeBitstring(&cRnti, bIterator);
6113 m_asConfig.sourceUeIdentity = cRnti.to_ulong();
6114
6115 // Deserialize sourceMasterInformationBlock
6116 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6117 bIterator = DeserializeEnum(6, &n, bIterator); // dl-Bandwidth
6119
6120 // phich-Config
6121 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6122 bIterator = DeserializeEnum(2, &n, bIterator); // phich-Duration
6123 bIterator = DeserializeEnum(4, &n, bIterator); // phich-Resource
6124
6125 // systemFrameNumber
6126 std::bitset<8> systemFrameNumber;
6127 bIterator = DeserializeBitstring(&systemFrameNumber, bIterator);
6129 systemFrameNumber.to_ulong();
6130 // spare
6131 std::bitset<10> spare;
6132 bIterator = DeserializeBitstring(&spare, bIterator);
6133
6134 // Deserialize sourceSystemInformationBlockType1
6137 bIterator);
6138
6139 // Deserialize sourceSystemInformationBlockType2
6142 bIterator);
6143
6144 // Deserialize antennaInfoCommon
6145 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6146 bIterator = DeserializeEnum(4, &n, bIterator); // antennaPortsCount
6147
6148 // Deserialize sourceDl-CarrierFreq
6149 bIterator = DeserializeInteger(&n, 0, MAX_EARFCN, bIterator);
6151 }
6152 if (handoverPrepInfoOpts[2])
6153 {
6154 // Deserialize rrm-Config
6155 // ...
6156 }
6157 if (handoverPrepInfoOpts[1])
6158 {
6159 // Deserialize as-Context
6160 // ...
6161 }
6162 if (handoverPrepInfoOpts[0])
6163 {
6164 // Deserialize nonCriticalExtension
6165 // ...
6166 }
6167 }
6168 }
6169
6170 return GetSerializedSize();
6171}
6172
6173void
6175{
6177 os << "sourceUeIdentity: " << m_asConfig.sourceUeIdentity << std::endl;
6178 os << "dlBandwidth: " << (int)m_asConfig.sourceMasterInformationBlock.dlBandwidth << std::endl;
6179 os << "systemFrameNumber: " << (int)m_asConfig.sourceMasterInformationBlock.systemFrameNumber
6180 << std::endl;
6181 os << "plmnIdentityInfo.plmnIdentity: "
6184 << std::endl;
6185 os << "cellAccessRelatedInfo.cellIdentity "
6187 << std::endl;
6188 os << "cellAccessRelatedInfo.csgIndication: "
6190 << std::endl;
6191 os << "cellAccessRelatedInfo.csgIdentity: "
6193 << std::endl;
6194 os << "sourceDlCarrierFreq: " << m_asConfig.sourceDlCarrierFreq << std::endl;
6195}
6196
6197void
6203
6206{
6208 msg.asConfig = m_asConfig;
6209
6210 return msg;
6211}
6212
6218
6219//////////////////// RrcConnectionReestablishmentRequestHeader class ////////////////////////
6220
6224
6228
6229void
6231{
6233
6235
6236 // Serialize RrcConnectionReestablishmentRequest sequence:
6237 // no default or optional fields. Extension marker not present.
6238 SerializeSequence(std::bitset<0>(), false);
6239
6240 // Serialize criticalExtensions choice
6241 // chosen: rrcConnectionReestablishmentRequest-r8
6242 SerializeChoice(2, 0, false);
6243
6244 // Serialize RRCConnectionReestablishmentRequest-r8-IEs sequence
6245 // no default or optional fields. Extension marker not present.
6246 SerializeSequence(std::bitset<0>(), false);
6247
6248 // Serialize ue-Identity
6249 SerializeSequence(std::bitset<0>(), false);
6250 // Serialize c-RNTI
6251 SerializeBitstring(std::bitset<16>(m_ueIdentity.cRnti));
6252 // Serialize physCellId
6254 // Serialize shortMAC-I
6255 SerializeBitstring(std::bitset<16>(0));
6256
6257 // Serialize ReestablishmentCause
6258 switch (m_reestablishmentCause)
6259 {
6261 SerializeEnum(4, 0);
6262 break;
6264 SerializeEnum(4, 1);
6265 break;
6267 SerializeEnum(4, 2);
6268 break;
6269 default:
6270 SerializeEnum(4, 3);
6271 }
6272
6273 // Serialize spare
6274 SerializeBitstring(std::bitset<2>(0));
6275
6276 // Finish serialization
6278}
6279
6282{
6283 std::bitset<0> bitset0;
6284 int n;
6285
6286 bIterator = DeserializeUlCcchMessage(bIterator);
6287
6288 // Deserialize RrcConnectionReestablishmentRequest sequence
6289 // 0 optional fields, no extension marker
6290 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6291
6292 // Deserialize criticalExtensions choice
6293 bIterator = DeserializeChoice(2, false, &n, bIterator);
6294 if (n == 1)
6295 {
6296 // Deserialize criticalExtensionsFuture
6297 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6298 }
6299 else if (n == 0)
6300 {
6301 // Deserialize RRCConnectionReestablishmentRequest-r8-IEs
6302 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6303
6304 // Deserialize ReestabUE-Identity sequence
6305 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6306
6307 // Deserialize c-RNTI
6308 std::bitset<16> cRnti;
6309 bIterator = DeserializeBitstring(&cRnti, bIterator);
6310 m_ueIdentity.cRnti = cRnti.to_ulong();
6311
6312 // Deserialize physCellId
6313 int physCellId;
6314 bIterator = DeserializeInteger(&physCellId, 0, 503, bIterator);
6315 m_ueIdentity.physCellId = physCellId;
6316
6317 // Deserialize shortMAC-I
6318 std::bitset<16> shortMacI;
6319 bIterator = DeserializeBitstring(&shortMacI, bIterator);
6320
6321 // Deserialize ReestablishmentCause
6322 int reestCs;
6323 bIterator = DeserializeEnum(4, &reestCs, bIterator);
6324 switch (reestCs)
6325 {
6326 case 0:
6328 break;
6329 case 1:
6331 break;
6332 case 2:
6334 break;
6335 case 3:
6336 break;
6337 }
6338
6339 // Deserialize spare
6340 std::bitset<2> spare;
6341 bIterator = DeserializeBitstring(&spare, bIterator);
6342 }
6343
6344 return GetSerializedSize();
6345}
6346
6347void
6349{
6350 os << "ueIdentity.cRnti: " << (int)m_ueIdentity.cRnti << std::endl;
6351 os << "ueIdentity.physCellId: " << (int)m_ueIdentity.physCellId << std::endl;
6352 os << "m_reestablishmentCause: " << m_reestablishmentCause << std::endl;
6353}
6354
6355void
6363
6373
6379
6385
6386//////////////////// RrcConnectionReestablishmentHeader class ////////////////////////
6387
6391
6395
6396void
6398{
6400
6402
6403 // Serialize RrcConnectionReestablishment sequence:
6404 // no default or optional fields. Extension marker not present.
6405 SerializeSequence(std::bitset<0>(), false);
6406
6407 // Serialize rrc-TransactionIdentifier
6409
6410 // Serialize criticalExtensions choice
6411 SerializeChoice(2, 0, false);
6412
6413 // Serialize c1 choice
6414 SerializeChoice(8, 0, false);
6415
6416 // Serialize RRCConnectionReestablishment-r8-IEs sequence
6417 // 1 optional field, no extension marker
6418 SerializeSequence(std::bitset<1>(0), false);
6419
6420 // Serialize radioResourceConfigDedicated
6422
6423 // Serialize nextHopChainingCount
6424 SerializeInteger(0, 0, 7);
6425
6426 // Finish serialization
6428}
6429
6432{
6433 std::bitset<0> bitset0;
6434 int n;
6435
6436 bIterator = DeserializeDlCcchMessage(bIterator);
6437
6438 // Deserialize RrcConnectionReestablishment sequence
6439 // 0 optional fields, no extension marker
6440 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6441
6442 // Deserialize rrc-TransactionIdentifier
6443 bIterator = DeserializeInteger(&n, 0, 3, bIterator);
6445
6446 // Deserialize criticalExtensions choice
6447 int criticalExtensionsChoice;
6448 bIterator = DeserializeChoice(2, false, &criticalExtensionsChoice, bIterator);
6449 if (criticalExtensionsChoice == 1)
6450 {
6451 // Deserialize criticalExtensionsFuture
6452 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6453 }
6454 else if (criticalExtensionsChoice == 0)
6455 {
6456 // Deserialize c1
6457 int c1;
6458 bIterator = DeserializeChoice(8, false, &c1, bIterator);
6459 if (c1 > 0)
6460 {
6461 bIterator = DeserializeNull(bIterator);
6462 }
6463 else if (c1 == 0)
6464 {
6465 // Deserialize rrcConnectionReestablishment-r8
6466 // 1 optional field
6467 std::bitset<1> nonCriticalExtensionPresent;
6468 bIterator = DeserializeSequence(&nonCriticalExtensionPresent, false, bIterator);
6469
6470 // Deserialize RadioResourceConfigDedicated
6471 bIterator =
6473
6474 // Deserialize nextHopChainingCount
6475 bIterator = DeserializeInteger(&n, 0, 7, bIterator);
6476 }
6477 }
6478
6479 return GetSerializedSize();
6480}
6481
6482void
6484{
6485 os << "rrcTransactionIdentifier: " << (int)m_rrcTransactionIdentifier << std::endl;
6486 os << "RadioResourceConfigDedicated: " << std::endl;
6488}
6489
6490void
6497
6506
6507uint8_t
6512
6518
6519//////////////////// RrcConnectionReestablishmentCompleteHeader class ////////////////////////
6520
6524
6525void
6527{
6529
6530 // Serialize DCCH message
6532
6533 // Serialize RrcConnectionReestablishmentComplete sequence:
6534 // no default or optional fields. Extension marker not present.
6535 SerializeSequence(std::bitset<0>(), false);
6536
6537 // Serialize rrc-TransactionIdentifier
6539
6540 // Serialize criticalExtensions choice
6541 SerializeChoice(2, 0, false);
6542
6543 // Serialize rrcConnectionReestablishmentComplete-r8 sequence
6544 // 1 optional field (not present), no extension marker.
6545 SerializeSequence(std::bitset<1>(0), false);
6546
6547 // Finish serialization
6549}
6550
6553{
6554 std::bitset<0> bitset0;
6555 int n;
6556
6557 bIterator = DeserializeUlDcchMessage(bIterator);
6558
6559 // Deserialize RrcConnectionReestablishmentComplete sequence
6560 // 0 optional fields, no extension marker
6561 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6562
6563 // Deserialize rrc-TransactionIdentifier
6564 bIterator = DeserializeInteger(&n, 0, 3, bIterator);
6566
6567 // Deserialize criticalExtensions choice
6568 int criticalExtensionsChoice;
6569 bIterator = DeserializeChoice(2, false, &criticalExtensionsChoice, bIterator);
6570 if (criticalExtensionsChoice == 1)
6571 {
6572 // Deserialize criticalExtensionsFuture
6573 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6574 }
6575 else if (criticalExtensionsChoice == 0)
6576 {
6577 // Deserialize rrcConnectionReestablishmentComplete-r8
6578 std::bitset<1> opts;
6579 bIterator = DeserializeSequence(&opts, false, bIterator);
6580 if (opts[0])
6581 {
6582 // Deserialize RRCConnectionReestablishmentComplete-v920-IEs
6583 // ...
6584 }
6585 }
6586
6587 return GetSerializedSize();
6588}
6589
6590void
6592{
6593 os << "rrcTransactionIdentifier: " << (int)m_rrcTransactionIdentifier << std::endl;
6594}
6595
6596void
6603
6611
6612uint8_t
6617
6618//////////////////// RrcConnectionReestablishmentRejectHeader class ////////////////////////
6619
6623
6627
6628void
6630{
6632
6633 // Serialize CCCH message
6635
6636 // Serialize RrcConnectionReestablishmentReject sequence:
6637 // no default or optional fields. Extension marker not present.
6638 SerializeSequence(std::bitset<0>(), false);
6639
6640 // Serialize criticalExtensions choice
6641 SerializeChoice(2, 0, false);
6642
6643 // Serialize RRCConnectionReestablishmentReject-r8-IEs sequence
6644 // 1 optional field (not present), no extension marker.
6645 SerializeSequence(std::bitset<1>(0), false);
6646
6647 // Finish serialization
6649}
6650
6653{
6654 std::bitset<0> bitset0;
6655
6656 bIterator = DeserializeDlCcchMessage(bIterator);
6657
6658 // Deserialize RrcConnectionReestablishmentReject sequence
6659 // 0 optional fields, no extension marker
6660 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6661
6662 // Deserialize criticalExtensions choice
6663 int criticalExtensionsChoice;
6664 bIterator = DeserializeChoice(2, false, &criticalExtensionsChoice, bIterator);
6665 if (criticalExtensionsChoice == 1)
6666 {
6667 // Deserialize criticalExtensionsFuture
6668 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6669 }
6670 else if (criticalExtensionsChoice == 0)
6671 {
6672 // Deserialize rrcConnectionReestablishmentReject-r8
6673 std::bitset<1> opts;
6674 bIterator = DeserializeSequence(&opts, false, bIterator);
6675 if (opts[0])
6676 {
6677 // Deserialize RRCConnectionReestablishmentReject-v8a0-IEs
6678 // ...
6679 }
6680 }
6681
6682 return GetSerializedSize();
6683}
6684
6685void
6687{
6688}
6689
6690void
6697
6703
6704//////////////////// RrcConnectionReleaseHeader class ////////////////////////
6705
6709
6713
6714void
6716{
6718
6719 // Serialize DCCH message
6721
6722 // Serialize RrcConnectionRelease sequence:
6723 // no default or optional fields. Extension marker not present.
6724 SerializeSequence(std::bitset<0>(), false);
6725
6726 // Serialize rrc-TransactionIdentifier
6728
6729 // Serialize criticalExtensions choice
6730 SerializeChoice(2, 0, false);
6731
6732 // Serialize c1 choice
6733 SerializeChoice(4, 0, false);
6734
6735 // Serialize RRCConnectionRelease-r8-IEs sequence
6736 // 3 optional field (not present), no extension marker.
6737 SerializeSequence(std::bitset<3>(0), false);
6738
6739 // Serialize ReleaseCause
6740 SerializeEnum(4, 1);
6741
6742 // Finish serialization
6744}
6745
6748{
6749 std::bitset<0> bitset0;
6750 int n;
6751
6752 bIterator = DeserializeDlDcchMessage(bIterator);
6753
6754 // Deserialize RrcConnectionRelease sequence
6755 // 0 optional fields, no extension marker
6756 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6757
6758 // Deserialize rrc-TransactionIdentifier
6759 bIterator = DeserializeInteger(&n, 0, 3, bIterator);
6761
6762 // Deserialize criticalExtensions choice
6763 int criticalExtensionsChoice;
6764 bIterator = DeserializeChoice(2, false, &criticalExtensionsChoice, bIterator);
6765 if (criticalExtensionsChoice == 1)
6766 {
6767 // Deserialize criticalExtensionsFuture
6768 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6769 }
6770 else if (criticalExtensionsChoice == 0)
6771 {
6772 // Deserialize c1
6773 int c1Choice;
6774 bIterator = DeserializeChoice(4, false, &c1Choice, bIterator);
6775
6776 if (c1Choice == 0)
6777 {
6778 // Deserialize RRCConnectionRelease-r8-IEs
6779 std::bitset<3> opts;
6780 bIterator = DeserializeSequence(&opts, false, bIterator);
6781
6782 // Deserialize releaseCause
6783 bIterator = DeserializeEnum(4, &n, bIterator);
6784
6785 if (opts[2])
6786 {
6787 // Deserialize redirectedCarrierInfo
6788 // ...
6789 }
6790 if (opts[1])
6791 {
6792 // Deserialize idleModeMobilityControlInfo
6793 // ...
6794 }
6795 if (opts[0])
6796 {
6797 // Deserialize nonCriticalExtension
6798 // ...
6799 }
6800 }
6801
6802 else
6803 {
6804 bIterator = DeserializeNull(bIterator);
6805 }
6806 }
6807
6808 return GetSerializedSize();
6809}
6810
6811void
6813{
6814}
6815
6816void
6822
6828
6829//////////////////// RrcConnectionRejectHeader class ////////////////////////
6830
6834
6838
6839void
6841{
6843
6844 // Serialize CCCH message
6846
6847 // Serialize RrcConnectionReject sequence:
6848 // no default or optional fields. Extension marker not present.
6849 SerializeSequence(std::bitset<0>(), false);
6850
6851 // Serialize criticalExtensions choice
6852 SerializeChoice(2, 0, false);
6853
6854 // Serialize c1 choice
6855 SerializeChoice(4, 0, false);
6856
6857 // Serialize rrcConnectionReject-r8 sequence
6858 // 1 optional field (not present), no extension marker.
6859 SerializeSequence(std::bitset<1>(0), false);
6860
6861 // Serialize waitTime
6863
6864 // Finish serialization
6866}
6867
6870{
6871 std::bitset<0> bitset0;
6872 int n;
6873
6874 bIterator = DeserializeDlCcchMessage(bIterator);
6875
6876 // Deserialize RrcConnectionReject sequence
6877 // 0 optional fields, no extension marker
6878 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6879
6880 // Deserialize criticalExtensions choice
6881 int criticalExtensionsChoice;
6882 bIterator = DeserializeChoice(2, false, &criticalExtensionsChoice, bIterator);
6883 if (criticalExtensionsChoice == 1)
6884 {
6885 // Deserialize criticalExtensionsFuture
6886 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6887 }
6888 else if (criticalExtensionsChoice == 0)
6889 {
6890 // Deserialize c1 choice
6891 int c1Choice;
6892 bIterator = DeserializeChoice(4, false, &c1Choice, bIterator);
6893
6894 if (c1Choice > 0)
6895 {
6896 bIterator = DeserializeNull(bIterator);
6897 }
6898 else if (c1Choice == 0)
6899 {
6900 // Deserialize rrcConnectionReject-r8
6901 std::bitset<1> opts;
6902 bIterator = DeserializeSequence(&opts, false, bIterator);
6903
6904 bIterator = DeserializeInteger(&n, 1, 16, bIterator);
6906
6907 if (opts[0])
6908 {
6909 // Deserialize RRCConnectionReject-v8a0-IEs
6910 // ...
6911 }
6912 }
6913 }
6914
6915 return GetSerializedSize();
6916}
6917
6918void
6920{
6921 os << "wait time: " << (int)m_rrcConnectionReject.waitTime << std::endl;
6922}
6923
6924void
6930
6936
6937//////////////////// MeasurementReportHeader class ////////////////////////
6938
6942
6946
6947void
6949{
6951
6952 // Serialize DCCH message
6954
6955 // Serialize MeasurementReport sequence:
6956 // no default or optional fields. Extension marker not present.
6957 SerializeSequence(std::bitset<0>(), false);
6958
6959 // Serialize criticalExtensions choice:
6960 // c1 chosen
6961 SerializeChoice(2, 0, false);
6962
6963 // Serialize c1 choice
6964 // measurementReport-r8 chosen
6965 SerializeChoice(8, 0, false);
6966
6967 // Serialize MeasurementReport-r8-IEs sequence:
6968 // 1 optional fields, not present. Extension marker not present.
6969 SerializeSequence(std::bitset<1>(0), false);
6970
6971 // Serialize measResults
6973
6974 // Finish serialization
6976}
6977
6980{
6981 std::bitset<0> bitset0;
6982
6983 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6984
6985 bIterator = DeserializeUlDcchMessage(bIterator);
6986
6987 int criticalExtensionsChoice;
6988 bIterator = DeserializeChoice(2, false, &criticalExtensionsChoice, bIterator);
6989
6990 if (criticalExtensionsChoice == 1)
6991 {
6992 // Deserialize criticalExtensionsFuture
6993 bIterator = DeserializeSequence(&bitset0, false, bIterator);
6994 }
6995 else if (criticalExtensionsChoice == 0)
6996 {
6997 // Deserialize c1
6998 int c1Choice;
6999 bIterator = DeserializeChoice(8, false, &c1Choice, bIterator);
7000
7001 if (c1Choice > 0)
7002 {
7003 bIterator = DeserializeNull(bIterator);
7004 }
7005 else
7006 {
7007 // Deserialize measurementReport-r8
7008 std::bitset<1> isNonCriticalExtensionPresent;
7009 bIterator = DeserializeSequence(&isNonCriticalExtensionPresent, false, bIterator);
7010
7011 // Deserialize measResults
7013
7014 if (isNonCriticalExtensionPresent[0])
7015 {
7016 // Deserialize nonCriticalExtension MeasurementReport-v8a0-IEs
7017 // ...
7018 }
7019 }
7020 }
7021
7022 return GetSerializedSize();
7023}
7024
7025void
7026MeasurementReportHeader::Print(std::ostream& os) const
7027{
7028 os << "measId = " << (int)m_measurementReport.measResults.measId << std::endl;
7029 os << "rsrpResult = " << (int)m_measurementReport.measResults.measResultPCell.rsrpResult
7030 << std::endl;
7031 os << "rsrqResult = " << (int)m_measurementReport.measResults.measResultPCell.rsrqResult
7032 << std::endl;
7033 os << "haveMeasResultNeighCells = "
7035
7037 {
7038 std::list<LteRrcSap::MeasResultEutra> measResultListEutra =
7040 auto it = measResultListEutra.begin();
7041 for (; it != measResultListEutra.end(); it++)
7042 {
7043 os << " physCellId =" << (int)it->physCellId << std::endl;
7044 os << " haveCgiInfo =" << it->haveCgiInfo << std::endl;
7045 if (it->haveCgiInfo)
7046 {
7047 os << " plmnIdentity = " << (int)it->cgiInfo.plmnIdentity << std::endl;
7048 os << " cellIdentity = " << (int)it->cgiInfo.cellIdentity << std::endl;
7049 os << " trackingAreaCode = " << (int)it->cgiInfo.trackingAreaCode << std::endl;
7050 os << " havePlmnIdentityList = " << !it->cgiInfo.plmnIdentityList.empty()
7051 << std::endl;
7052 if (!it->cgiInfo.plmnIdentityList.empty())
7053 {
7054 for (auto it2 = it->cgiInfo.plmnIdentityList.begin();
7055 it2 != it->cgiInfo.plmnIdentityList.end();
7056 it2++)
7057 {
7058 os << " plmnId : " << *it2 << std::endl;
7059 }
7060 }
7061 }
7062
7063 os << " haveRsrpResult =" << it->haveRsrpResult << std::endl;
7064 if (it->haveRsrpResult)
7065 {
7066 os << " rsrpResult =" << (int)it->rsrpResult << std::endl;
7067 }
7068
7069 os << " haveRsrqResult =" << it->haveRsrqResult << std::endl;
7070 if (it->haveRsrqResult)
7071 {
7072 os << " rsrqResult =" << (int)it->rsrqResult << std::endl;
7073 }
7074 }
7075 }
7076}
7077
7078void
7084
7087{
7089 msg = m_measurementReport;
7090 return msg;
7091}
7092
7093/////////////////// RrcUlDcchMessage //////////////////////////////////
7098
7102
7105{
7106 DeserializeUlDcchMessage(bIterator);
7107 return 1;
7108}
7109
7110void
7111RrcUlDcchMessage::Print(std::ostream& os) const
7112{
7113 std::cout << "UL DCCH MSG TYPE: " << m_messageType << std::endl;
7114}
7115
7116void
7121
7124{
7125 std::bitset<0> bitset0;
7126 int n;
7127
7128 bIterator = DeserializeSequence(&bitset0, false, bIterator);
7129 bIterator = DeserializeChoice(2, false, &n, bIterator);
7130 if (n == 1)
7131 {
7132 // Deserialize messageClassExtension
7133 bIterator = DeserializeSequence(&bitset0, false, bIterator);
7134 m_messageType = -1;
7135 }
7136 else if (n == 0)
7137 {
7138 // Deserialize c1
7139 bIterator = DeserializeChoice(16, false, &m_messageType, bIterator);
7140 }
7141
7142 return bIterator;
7143}
7144
7145void
7147{
7148 SerializeSequence(std::bitset<0>(), false);
7149 // Choose c1
7150 SerializeChoice(2, 0, false);
7151 // Choose message type
7152 SerializeChoice(16, messageType, false);
7153}
7154
7155/////////////////// RrcDlDcchMessage //////////////////////////////////
7160
7164
7167{
7168 DeserializeDlDcchMessage(bIterator);
7169 return 1;
7170}
7171
7172void
7173RrcDlDcchMessage::Print(std::ostream& os) const
7174{
7175 std::cout << "DL DCCH MSG TYPE: " << m_messageType << std::endl;
7176}
7177
7178void
7183
7186{
7187 std::bitset<0> bitset0;
7188 int n;
7189
7190 bIterator = DeserializeSequence(&bitset0, false, bIterator);
7191 bIterator = DeserializeChoice(2, false, &n, bIterator);
7192 if (n == 1)
7193 {
7194 // Deserialize messageClassExtension
7195 bIterator = DeserializeSequence(&bitset0, false, bIterator);
7196 m_messageType = -1;
7197 }
7198 else if (n == 0)
7199 {
7200 // Deserialize c1
7201 bIterator = DeserializeChoice(16, false, &m_messageType, bIterator);
7202 }
7203
7204 return bIterator;
7205}
7206
7207void
7209{
7210 SerializeSequence(std::bitset<0>(), false);
7211 // Choose c1
7212 SerializeChoice(2, 0, false);
7213 // Choose message type
7214 SerializeChoice(16, messageType, false);
7215}
7216
7217/////////////////// RrcUlCcchMessage //////////////////////////////////
7222
7226
7229{
7230 DeserializeUlCcchMessage(bIterator);
7231 return 1;
7232}
7233
7234void
7235RrcUlCcchMessage::Print(std::ostream& os) const
7236{
7237 std::cout << "UL CCCH MSG TYPE: " << m_messageType << std::endl;
7238}
7239
7240void
7245
7248{
7249 std::bitset<0> bitset0;
7250 int n;
7251
7252 bIterator = DeserializeSequence(&bitset0, false, bIterator);
7253 bIterator = DeserializeChoice(2, false, &n, bIterator);
7254 if (n == 1)
7255 {
7256 // Deserialize messageClassExtension
7257 bIterator = DeserializeSequence(&bitset0, false, bIterator);
7258 m_messageType = -1;
7259 }
7260 else if (n == 0)
7261 {
7262 // Deserialize c1
7263 bIterator = DeserializeChoice(2, false, &m_messageType, bIterator);
7264 }
7265
7266 return bIterator;
7267}
7268
7269void
7271{
7272 SerializeSequence(std::bitset<0>(), false);
7273 // Choose c1
7274 SerializeChoice(2, 0, false);
7275 // Choose message type
7276 SerializeChoice(2, messageType, false);
7277}
7278
7279/////////////////// RrcDlCcchMessage //////////////////////////////////
7284
7288
7291{
7292 DeserializeDlCcchMessage(bIterator);
7293 return 1;
7294}
7295
7296void
7297RrcDlCcchMessage::Print(std::ostream& os) const
7298{
7299 std::cout << "DL CCCH MSG TYPE: " << m_messageType << std::endl;
7300}
7301
7302void
7307
7310{
7311 std::bitset<0> bitset0;
7312 int n;
7313
7314 bIterator = DeserializeSequence(&bitset0, false, bIterator);
7315 bIterator = DeserializeChoice(2, false, &n, bIterator);
7316 if (n == 1)
7317 {
7318 // Deserialize messageClassExtension
7319 bIterator = DeserializeSequence(&bitset0, false, bIterator);
7320 m_messageType = -1;
7321 }
7322 else if (n == 0)
7323 {
7324 // Deserialize c1
7325 bIterator = DeserializeChoice(4, false, &m_messageType, bIterator);
7326 }
7327
7328 return bIterator;
7329}
7330
7331void
7333{
7334 SerializeSequence(std::bitset<0>(), false);
7335 // Choose c1
7336 SerializeChoice(2, 0, false);
7337 // Choose message type
7338 SerializeChoice(4, messageType, false);
7339}
7340
7341} // namespace ns3
Buffer::Iterator DeserializeChoice(int numOptions, bool isExtensionMarkerPresent, int *selectedOption, Buffer::Iterator bIterator)
Deserialize a Choice (set of options)
Buffer::Iterator DeserializeSequenceOf(int *numElems, int nMax, int nMin, Buffer::Iterator bIterator)
Deserialize a Sequence.
Buffer::Iterator DeserializeNull(Buffer::Iterator bIterator)
Deserialize nothing (null op)
Buffer::Iterator DeserializeInteger(int *n, int nmin, int nmax, Buffer::Iterator bIterator)
Deserialize an integer.
void SerializeBitstring(std::bitset< N > bitstring) const
Serialize a bitstring.
Buffer::Iterator DeserializeEnum(int numElems, int *selectedElem, Buffer::Iterator bIterator)
Deserialize an Enum.
Buffer::Iterator DeserializeSequence(std::bitset< N > *optionalOrDefaultMask, bool isExtensionMarkerPresent, Buffer::Iterator bIterator)
Deserialize a sequence.
void SerializeSequence(std::bitset< N > optionalOrDefaultMask, bool isExtensionMarkerPresent) const
Serialize a sequence.
void SerializeChoice(int numOptions, int selectedOption, bool isExtensionMarkerPresent) const
Serialize a Choice (set of options)
Buffer m_serializationResult
serialization result
void FinalizeSerialization() const
Finalizes an in progress serialization.
void SerializeInteger(int n, int nmin, int nmax) const
Serialize an Integer.
Buffer::Iterator DeserializeBoolean(bool *value, Buffer::Iterator bIterator)
Deserialize a boolean.
uint32_t GetSerializedSize() const override
void SerializeBoolean(bool value) const
Serialize a bool.
Buffer::Iterator DeserializeBitstring(std::bitset< N > *bitstring, Buffer::Iterator bIterator)
Deserialize a bitstring.
void SerializeNull() const
Serialize nothing (null op)
bool m_isDataSerialized
true if data is serialized
void SerializeSequenceOf(int numElems, int nMax, int nMin) const
Serialize a Sequence.
void SerializeEnum(int numElems, int selectedElem) const
Serialize an Enum.
iterator in a Buffer instance
Definition buffer.h:89
automatically resized byte buffer
Definition buffer.h:83
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
void Print(std::ostream &os) const override
void SetMessage(LteRrcSap::HandoverPreparationInfo msg)
Receives a HandoverPreparationInfo IE and stores the contents into the class attributes.
LteRrcSap::HandoverPreparationInfo GetMessage() const
Returns a HandoverPreparationInfo IE from the values in the class attributes.
LteRrcSap::AsConfig m_asConfig
AS config.
uint32_t Deserialize(Buffer::Iterator bIterator) override
LteRrcSap::AsConfig GetAsConfig() const
Getter for m_asConfig.
Protocol header serialization and deserialization.
Definition header.h:33
ReestablishmentCause
ReestablishmentCause enumeration.
void Print(std::ostream &os) const override
uint32_t Deserialize(Buffer::Iterator bIterator) override
LteRrcSap::MeasurementReport m_measurementReport
measurement report
LteRrcSap::MeasurementReport GetMessage() const
Returns a MeasurementReport IE from the values in the class attributes.
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
void SetMessage(LteRrcSap::MeasurementReport msg)
Receives a MeasurementReport IE and stores the contents into the class attributes.
This class extends Asn1Header functions, adding serialization/deserialization of some Information ele...
void SerializeNonCriticalExtensionConfiguration(LteRrcSap::NonCriticalExtensionConfiguration nonCriticalExtensionConfiguration) const
Serialize non critical extension config function.
void SerializeSrbToAddModList(std::list< LteRrcSap::SrbToAddMod > srbToAddModList) const
Serialize SRB to add mod list function.
void SerializeSystemInformationBlockType2(LteRrcSap::SystemInformationBlockType2 systemInformationBlockType2) const
Serialize system information block type 2 function.
void SerializeRadioResourceConfigCommonSCell(LteRrcSap::RadioResourceConfigCommonSCell rrccsc) const
Serialize radio resource config common SCell function.
void SerializeMeasResults(LteRrcSap::MeasResults measResults) const
Serialize measure results function.
void SerializePhysicalConfigDedicated(LteRrcSap::PhysicalConfigDedicated physicalConfigDedicated) const
Serialize physical config dedicated function.
Buffer::Iterator DeserializeCellIdentification(LteRrcSap::CellIdentification *ci, Buffer::Iterator bIterator)
Deserialize cell identification function.
Buffer::Iterator DeserializeLogicalChannelConfig(LteRrcSap::LogicalChannelConfig *logicalChannelConfig, Buffer::Iterator bIterator)
Deserialize logical channel config function.
void SerializeRachConfigCommon(LteRrcSap::RachConfigCommon rachConfigCommon) const
Serialize RACH config common function.
Buffer::Iterator DeserializeMeasConfig(LteRrcSap::MeasConfig *measConfig, Buffer::Iterator bIterator)
Deserialize measure config function.
int GetMessageType() const
Get message type.
Buffer::Iterator DeserializePhysicalConfigDedicated(LteRrcSap::PhysicalConfigDedicated *physicalConfigDedicated, Buffer::Iterator bIterator)
Deserialize physical config dedicated function.
Buffer::Iterator DeserializeNonCriticalExtensionConfig(LteRrcSap::NonCriticalExtensionConfiguration *nonCriticalExtension, Buffer::Iterator bIterator)
Deserialize non critical extension config function.
void SerializeRadioResourceConfigCommonSib(LteRrcSap::RadioResourceConfigCommonSib radioResourceConfigCommonSib) const
Serialize radio resource config common SIB function.
void SerializeSystemInformationBlockType1(LteRrcSap::SystemInformationBlockType1 systemInformationBlockType1) const
Serialize system information block type 1 function.
Buffer::Iterator DeserializeRachConfigCommon(LteRrcSap::RachConfigCommon *rachConfigCommon, Buffer::Iterator bIterator)
Deserialize RACH config common function.
Buffer::Iterator DeserializePlmnIdentity(uint32_t *plmnId, Buffer::Iterator bIterator)
Deserialize PLMN identity function.
uint16_t EnumToBandwidth(int n) const
Convert from ENUMERATED value to bandwidth (in RBs)
void SerializeDrbToAddModList(std::list< LteRrcSap::DrbToAddMod > drbToAddModList) const
Serialize DRB to add mod list function.
Buffer::Iterator DeserializeMeasResults(LteRrcSap::MeasResults *measResults, Buffer::Iterator bIterator)
Deserialize measure results function.
Buffer::Iterator DeserializeRadioResourceConfigCommonSCell(LteRrcSap::RadioResourceConfigCommonSCell *rrccsc, Buffer::Iterator bIterator)
Deserialize radio resource config common SCell function.
void SerializeRadioResourceDedicatedSCell(LteRrcSap::RadioResourceConfigDedicatedSCell rrcdsc) const
Serialize radio resource dedicated SCell function.
void SerializePhysicalConfigDedicatedSCell(LteRrcSap::PhysicalConfigDedicatedSCell pcdsc) const
Serialize physical config dedicated function.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Buffer::Iterator DeserializePhysicalConfigDedicatedSCell(LteRrcSap::PhysicalConfigDedicatedSCell *pcdsc, Buffer::Iterator bIterator)
Deserialize physical config dedicated SCell function.
Buffer::Iterator DeserializeThresholdEutra(LteRrcSap::ThresholdEutra *thresholdEutra, Buffer::Iterator bIterator)
Deserialize threshold eutra function.
void SerializeRadioResourceConfigDedicated(LteRrcSap::RadioResourceConfigDedicated radioResourceConfigDedicated) const
Serialize radio resource config function.
void SerializeThresholdEutra(LteRrcSap::ThresholdEutra thresholdEutra) const
Serialize threshold eutra function.
void SerializeQoffsetRange(int8_t qOffsetRange) const
Serialize Q offset range function.
Buffer::Iterator DeserializeRadioResourceConfigDedicated(LteRrcSap::RadioResourceConfigDedicated *radioResourceConfigDedicated, Buffer::Iterator bIterator)
Deserialize radio resource config dedicated function.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
int m_messageType
Stores RRC message type, according to 3GPP TS 36.331.
Buffer::Iterator DeserializeSystemInformationBlockType1(LteRrcSap::SystemInformationBlockType1 *systemInformationBlockType1, Buffer::Iterator bIterator)
Deserialize system information block type 1 function.
void SerializeLogicalChannelConfig(LteRrcSap::LogicalChannelConfig logicalChannelConfig) const
Serialize logicala channel config function.
static TypeId GetTypeId()
Get the type ID.
Buffer::Iterator DeserializeSystemInformationBlockType2(LteRrcSap::SystemInformationBlockType2 *systemInformationBlockType2, Buffer::Iterator bIterator)
Deserialize system information block type 2 function.
Buffer::Iterator DeserializeQoffsetRange(int8_t *qOffsetRange, Buffer::Iterator bIterator)
Deserialize Qoffset range function.
int BandwidthToEnum(uint16_t bandwidth) const
Convert from bandwidth (in RBs) to ENUMERATED value.
Buffer::Iterator DeserializeDrbToAddModList(std::list< LteRrcSap::DrbToAddMod > *drbToAddModLis, Buffer::Iterator bIterator)
Deserialize DRB to add mod list function.
void SerializePlmnIdentity(uint32_t plmnId) const
Serialize PLMN identity function.
Buffer::Iterator DeserializeRadioResourceConfigCommon(LteRrcSap::RadioResourceConfigCommon *radioResourceConfigCommon, Buffer::Iterator bIterator)
Deserialize radio resource config common function.
Buffer::Iterator DeserializeRadioResourceConfigDedicatedSCell(LteRrcSap::RadioResourceConfigDedicatedSCell *rrcdsc, Buffer::Iterator bIterator)
Deserialize radio resource config dedicated SCell function.
void SerializeRadioResourceConfigCommon(LteRrcSap::RadioResourceConfigCommon radioResourceConfigCommon) const
Serialize system information block type 2 function.
void SerializeMeasConfig(LteRrcSap::MeasConfig measConfig) const
Serialize measure config function.
Buffer::Iterator DeserializeSrbToAddModList(std::list< LteRrcSap::SrbToAddMod > *srbToAddModList, Buffer::Iterator bIterator)
Deserialize SRB to add mod list function.
Buffer::Iterator DeserializeRadioResourceConfigCommonSib(LteRrcSap::RadioResourceConfigCommonSib *radioResourceConfigCommonSib, Buffer::Iterator bIterator)
Deserialize radio resource config common SIB function.
uint8_t m_rrcTransactionIdentifier
RRC transaction identifier.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
LteRrcSap::RrcConnectionReconfigurationCompleted GetMessage() const
Returns a RrcConnectionReconfigurationCompleted IE from the values in the class attributes.
uint32_t Deserialize(Buffer::Iterator bIterator) override
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
void SetMessage(LteRrcSap::RrcConnectionReconfigurationCompleted msg)
Receives a RrcConnectionReconfigurationCompleted IE and stores the contents into the class attributes...
uint8_t GetRrcTransactionIdentifier() const
Getter for m_rrcTransactionIdentifier.
bool m_haveNonCriticalExtension
Have non-critical extension.
std::list< LteRrcSap::SrbToAddMod > GetSrbToAddModList() const
Gets m_radioResourceConfigDedicated.srbToAddModList.
bool m_haveMeasConfig
have measure config?
std::list< LteRrcSap::DrbToAddMod > GetDrbToAddModList() const
Gets m_radioResourceConfigDedicated.drbToAddModList.
LteRrcSap::RrcConnectionReconfiguration GetMessage() const
Returns a RrcConnectionReconfiguration IE from the values in the class attributes.
LteRrcSap::NonCriticalExtensionConfiguration GetNonCriticalExtensionConfig()
Getter for m_nonCriticalExtension.
uint32_t Deserialize(Buffer::Iterator bIterator) override
LteRrcSap::RadioResourceConfigDedicated GetRadioResourceConfigDedicated()
Getter for m_radioResourceConfigDedicated.
bool HavePhysicalConfigDedicated() const
Gets m_radioResourceConfigDedicated.havePhysicalConfigDedicated.
LteRrcSap::MobilityControlInfo m_mobilityControlInfo
the modility control info
LteRrcSap::MeasConfig m_measConfig
the measure config
std::list< uint8_t > GetDrbToReleaseList() const
Gets m_radioResourceConfigDedicated.drbToReleaseList.
LteRrcSap::RadioResourceConfigDedicated m_radioResourceConfigDedicated
the radio resource config dedicated
bool GetHaveNonCriticalExtensionConfig() const
Getter for m_haveNonCriticalExtension.
LteRrcSap::PhysicalConfigDedicated GetPhysicalConfigDedicated() const
Gets m_radioResourceConfigDedicated.physicalConfigDedicated.
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
bool m_haveMobilityControlInfo
have mobility control info?
bool GetHaveRadioResourceConfigDedicated() const
Getter for m_haveRadioResourceConfigDedicated.
bool GetHaveMobilityControlInfo() const
Getter for m_haveMobilityControlInfo.
void SetMessage(LteRrcSap::RrcConnectionReconfiguration msg)
Receives a RrcConnectionReconfiguration IE and stores the contents into the class attributes.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
LteRrcSap::NonCriticalExtensionConfiguration m_nonCriticalExtension
the non-critical extension
uint8_t GetRrcTransactionIdentifier() const
Getter for m_rrcTransactionIdentifier.
bool m_haveRadioResourceConfigDedicated
have radio resource config dedicated?
bool GetHaveMeasConfig() const
Getter for m_haveMeasConfig.
uint8_t m_rrcTransactionIdentifier
RRC transaction identifier.
LteRrcSap::MeasConfig GetMeasConfig()
Getter for m_measConfig.
LteRrcSap::MobilityControlInfo GetMobilityControlInfo()
Getter for m_mobilityControlInfo.
void SetMessage(LteRrcSap::RrcConnectionReestablishmentComplete msg)
Receives a RrcConnectionReestablishmentComplete IE and stores the contents into the class attributes.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
uint8_t m_rrcTransactionIdentifier
RRC transaction identifier.
uint32_t Deserialize(Buffer::Iterator bIterator) override
LteRrcSap::RrcConnectionReestablishmentComplete GetMessage() const
Returns a RrcConnectionReestablishmentComplete IE from the values in the class attributes.
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
uint8_t GetRrcTransactionIdentifier() const
Getter for m_rrcTransactionIdentifier attribute.
uint8_t m_rrcTransactionIdentifier
RRC transaction identifier.
LteRrcSap::RadioResourceConfigDedicated m_radioResourceConfigDedicated
radio resource config dedicated
LteRrcSap::RrcConnectionReestablishment GetMessage() const
Returns a RrcConnectionReestablishment IE from the values in the class attributes.
uint8_t GetRrcTransactionIdentifier() const
Getter for m_rrcTransactionIdentifier attribute.
LteRrcSap::RadioResourceConfigDedicated GetRadioResourceConfigDedicated() const
Getter for m_radioResourceConfigDedicated attribute.
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
void SetMessage(LteRrcSap::RrcConnectionReestablishment msg)
Receives a RrcConnectionReestablishment IE and stores the contents into the class attributes.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
uint32_t Deserialize(Buffer::Iterator bIterator) override
void SetMessage(LteRrcSap::RrcConnectionReestablishmentReject msg)
Receives a RrcConnectionReestablishmentReject IE and stores the contents into the class attributes.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
uint32_t Deserialize(Buffer::Iterator bIterator) override
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
LteRrcSap::RrcConnectionReestablishmentReject m_rrcConnectionReestablishmentReject
RRC connection reestablishmnet reject.
LteRrcSap::RrcConnectionReestablishmentReject GetMessage() const
Returns a RrcConnectionReestablishmentReject IE from the values in the class attributes.
LteRrcSap::RrcConnectionReestablishmentRequest GetMessage() const
Returns a RrcConnectionReestablishmentRequest IE from the values in the class attributes.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
LteRrcSap::ReestablishmentCause m_reestablishmentCause
reestablishment cause
LteRrcSap::ReestablishmentCause GetReestablishmentCause() const
Getter for m_reestablishmentCause.
LteRrcSap::ReestabUeIdentity m_ueIdentity
UE identity.
void SetMessage(LteRrcSap::RrcConnectionReestablishmentRequest msg)
Receives a RrcConnectionReestablishmentRequest IE and stores the contents into the class attributes.
uint32_t Deserialize(Buffer::Iterator bIterator) override
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
LteRrcSap::ReestabUeIdentity GetUeIdentity() const
Getter for m_ueIdentity.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
LteRrcSap::RrcConnectionReject GetMessage() const
Returns a RrcConnectionReject IE from the values in the class attributes.
LteRrcSap::RrcConnectionReject m_rrcConnectionReject
RRC connection reject.
uint32_t Deserialize(Buffer::Iterator bIterator) override
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
void SetMessage(LteRrcSap::RrcConnectionReject msg)
Receives a RrcConnectionReject IE and stores the contents into the class attributes.
LteRrcSap::RrcConnectionRelease GetMessage() const
Returns a RrcConnectionRelease IE from the values in the class attributes.
void SetMessage(LteRrcSap::RrcConnectionRelease msg)
Receives a RrcConnectionRelease IE and stores the contents into the class attributes.
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
uint32_t Deserialize(Buffer::Iterator bIterator) override
LteRrcSap::RrcConnectionRelease m_rrcConnectionRelease
RRC connection release.
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
std::bitset< 8 > GetMmec() const
Get MMEC attribute.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
enum ns3::RrcConnectionRequestHeader::@59 m_establishmentCause
EstablishmentCause enumeration.
void SetMessage(LteRrcSap::RrcConnectionRequest msg)
Receives a RrcConnectionRequest IE and stores the contents into the class attributes.
uint32_t Deserialize(Buffer::Iterator bIterator) override
std::bitset< 1 > m_spare
spare bit
LteRrcSap::RrcConnectionRequest GetMessage() const
Returns a RrcConnectionRequest IE from the values in the class attributes.
static TypeId GetTypeId()
Get the type ID.
std::bitset< 32 > GetMtmsi() const
Get M-TMSI attribute.
std::bitset< 32 > m_mTmsi
TMSI.
LteRrcSap::RrcConnectionSetupCompleted GetMessage() const
Returns a RrcConnectionSetupCompleted IE from the values in the class attributes.
uint8_t m_rrcTransactionIdentifier
RRC transaction identifier.
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
void SetMessage(LteRrcSap::RrcConnectionSetupCompleted msg)
Receives a RrcConnectionSetupCompleted IE and stores the contents into the class attributes.
uint8_t GetRrcTransactionIdentifier() const
Getter for m_rrcTransactionIdentifier.
uint32_t Deserialize(Buffer::Iterator bIterator) override
LteRrcSap::RadioResourceConfigDedicated m_radioResourceConfigDedicated
radio resource config dedicated
void SetMessage(LteRrcSap::RrcConnectionSetup msg)
Receives a RrcConnectionSetup IE and stores the contents into the class attributes.
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
std::list< LteRrcSap::DrbToAddMod > GetDrbToAddModList() const
Gets m_radioResourceConfigDedicated.drbToAddModList.
LteRrcSap::RrcConnectionSetup GetMessage() const
Returns a RrcConnectionSetup IE from the values in the class attributes.
uint32_t Deserialize(Buffer::Iterator bIterator) override
std::list< uint8_t > GetDrbToReleaseList() const
Gets m_radioResourceConfigDedicated.drbToReleaseList.
uint8_t m_rrcTransactionIdentifier
RRC transaction identifier.
std::list< LteRrcSap::SrbToAddMod > GetSrbToAddModList() const
Gets m_radioResourceConfigDedicated.srbToAddModList.
bool HavePhysicalConfigDedicated() const
Gets m_radioResourceConfigDedicated.havePhysicalConfigDedicated.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
LteRrcSap::PhysicalConfigDedicated GetPhysicalConfigDedicated() const
Gets m_radioResourceConfigDedicated.physicalConfigDedicated.
uint8_t GetRrcTransactionIdentifier() const
Getter for m_rrcTransactionIdentifier.
LteRrcSap::RadioResourceConfigDedicated GetRadioResourceConfigDedicated() const
Getter for m_radioResourceConfigDedicated.
Buffer::Iterator DeserializeDlCcchMessage(Buffer::Iterator bIterator)
Deserialize DL CCCH message function.
uint32_t Deserialize(Buffer::Iterator bIterator) override
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
void SerializeDlCcchMessage(int msgType) const
Serialize DL CCCH message function.
void SerializeDlDcchMessage(int msgType) const
Serialize DL DCCH message function.
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
uint32_t Deserialize(Buffer::Iterator bIterator) override
Buffer::Iterator DeserializeDlDcchMessage(Buffer::Iterator bIterator)
Deserialize DL DCCH message function.
This class only serves to discriminate which message type has been received in uplink (ue to eNb) for...
void SerializeUlCcchMessage(int msgType) const
Serialize UL CCCH message function.
Buffer::Iterator DeserializeUlCcchMessage(Buffer::Iterator bIterator)
Deserialize DL CCCH message function.
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
uint32_t Deserialize(Buffer::Iterator bIterator) override
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
Buffer::Iterator DeserializeUlDcchMessage(Buffer::Iterator bIterator)
Deserialize UL DCCH message function.
uint32_t Deserialize(Buffer::Iterator bIterator) override
void Print(std::ostream &os) const override
This function prints the object, for debugging purposes.
void PreSerialize() const override
This function serializes class attributes to m_serializationResult local Buffer.
void SerializeUlDcchMessage(int msgType) const
Serialize UL DCCH message function.
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define MAX_CELL_REPORT
#define MAX_CELL_MEAS
#define MAX_DRB
#define MAX_SIB
#define MAX_EARFCN
#define MAX_SI_MESSAGE
#define MAX_MEAS_ID
#define MAX_OBJECT_ID
#define MAX_RAT_CAPABILITIES
#define MAX_REPORT_CONFIG_ID
#define MAX_SCELL_REPORT
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint16_t antennaPortsCount
antenna ports count
uint8_t transmissionMode
transmission mode
AsConfig structure.
RadioResourceConfigDedicated sourceRadioResourceConfig
source radio resource config
MasterInformationBlock sourceMasterInformationBlock
source master information block
uint16_t sourceUeIdentity
source UE identity
MeasConfig sourceMeasConfig
source measure config
uint32_t sourceDlCarrierFreq
source DL carrier frequency
SystemInformationBlockType1 sourceSystemInformationBlockType1
source system information block type 1
SystemInformationBlockType2 sourceSystemInformationBlockType2
source system information block type 2
BlackCellsToAddMod structure.
PhysCellIdRange physCellIdRange
Phy cell ID range.
uint32_t dlCarrierFreq
DL carrier frequency.
uint32_t ulCarrierFreq
UL carrier frequency.
CellIdentification structure.
uint32_t dlCarrierFreq
ARFCN - valueEUTRA.
uint32_t physCellId
physical cell ID
CellsToAddMod structure.
int8_t cellIndividualOffset
cell individual offset
uint8_t cellIndex
cell index
uint16_t physCellId
Phy cell ID.
uint32_t cellIdentity
cell identity
uint32_t plmnIdentity
PLMN identity.
std::list< uint32_t > plmnIdentityList
PLMN identity list.
uint16_t trackingAreaCode
tracking area code
DrbToAddMod structure.
uint8_t epsBearerIdentity
EPS bearer identity.
RlcConfig rlcConfig
RLC config.
uint8_t logicalChannelIdentity
logical channel identify
uint8_t drbIdentity
DRB identity.
LogicalChannelConfig logicalChannelConfig
logical channel config
uint32_t ulCarrierFreq
UL carrier frequency.
Definition lte-rrc-sap.h:77
uint16_t ulBandwidth
UL bandwidth.
Definition lte-rrc-sap.h:78
HandoverPreparationInfo structure.
LogicalChannelConfig structure.
Definition lte-rrc-sap.h:98
uint16_t bucketSizeDurationMs
bucket size duration ms
uint16_t prioritizedBitRateKbps
prioritized bit rate Kbps
uint8_t logicalChannelGroup
logical channel group
uint16_t systemFrameNumber
system frame number
MeasConfig structure.
std::list< uint8_t > measIdToRemoveList
measure ID to remove list
uint8_t sMeasure
S measure.
std::list< MeasObjectToAddMod > measObjectToAddModList
measure object to add mod list
std::list< uint8_t > reportConfigToRemoveList
report config to remove list
std::list< uint8_t > measObjectToRemoveList
measure object to remove list
SpeedStatePars speedStatePars
speed state parameters
bool haveMeasGapConfig
have measure gap config?
QuantityConfig quantityConfig
quantity config
bool haveSmeasure
have S measure?
bool haveSpeedStatePars
have speed state parameters?
std::list< ReportConfigToAddMod > reportConfigToAddModList
report config to add mod list
MeasGapConfig measGapConfig
measure gap config
std::list< MeasIdToAddMod > measIdToAddModList
measure ID to add mod list
bool haveQuantityConfig
have quantity config?
uint8_t gapOffsetValue
gap offset value
MeasIdToAddMod structure.
uint8_t measObjectId
measure object ID
uint8_t reportConfigId
report config ID
std::list< uint8_t > cellsToRemoveList
cells to remove list
bool haveCellForWhichToReportCGI
have cell for which to report CGI?
std::list< CellsToAddMod > cellsToAddModList
cells to add mod list
uint16_t allowedMeasBandwidth
allowed measure bandwidth
int8_t offsetFreq
offset frequency
uint8_t neighCellConfig
neighbor cell config
uint16_t cellForWhichToReportCGI
cell for which to report CGI
bool presenceAntennaPort1
antenna port 1 present?
std::list< uint8_t > blackCellsToRemoveList
black cells to remove list
std::list< BlackCellsToAddMod > blackCellsToAddModList
black cells to add mod list
uint32_t carrierFreq
carrier frequency
MeasObjectToAddMod structure.
uint8_t measObjectId
measure object ID
MeasObjectEutra measObjectEutra
measure object eutra
uint16_t physCellId
physical cell ID
MeasResultEutra structure.
uint8_t rsrqResult
RSRQ result.
uint8_t rsrpResult
RSRP result.
bool haveRsrpResult
have RSRP result
bool haveRsrqResult
have RSRQ result?
uint16_t physCellId
Phy cell ID.
bool haveCgiInfo
have CGI info?
uint8_t rsrqResult
the RSRQ result
uint8_t rsrpResult
the RSRP result
uint8_t rsrpResult
the RSRP result
uint8_t rsrqResult
the RSRQ result
MeasResultServFreq structure.
bool haveMeasResultSCell
have measResultSCell?
MeasResultBestNeighCell measResultBestNeighCell
best neighbor cell measurement results
bool haveMeasResultBestNeighCell
have measResultBestNeighCell?
uint16_t servFreqId
serving cell index
MeasResultSCell measResultSCell
SCell measurement results.
MeasResults structure.
uint8_t measId
measure ID
bool haveMeasResultNeighCells
have measure result neighbor cells
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
bool haveMeasResultServFreqList
has measResultServFreqList-r10
std::list< MeasResultServFreq > measResultServFreqList
MeasResultServFreqList-r10.
MeasResultPCell measResultPCell
measurement result primary cell
MeasurementReport structure.
MeasResults measResults
measure results
MobilityControlInfo structure.
RadioResourceConfigCommon radioResourceConfigCommon
radio resource config common
RachConfigDedicated rachConfigDedicated
RACH config dedicated.
bool haveRachConfigDedicated
Have RACH config dedicated?
uint16_t newUeIdentity
new UE identity
bool haveCarrierBandwidth
have carrier bandwidth?
bool haveCarrierFreq
have carrier frequency?
CarrierBandwidthEutra carrierBandwidth
carrier bandwidth
CarrierFreqEutra carrierFreq
carrier frequency
uint16_t targetPhysCellId
target Phy cell ID
uint8_t nCellChangeHigh
cell change high
uint8_t nCellChangeMedium
cell change medium
NonCriticalExtensionConfiguration structure.
std::list< uint8_t > sCellToReleaseList
SCell to release list.
std::list< SCellToAddMod > sCellToAddModList
SCell to add mod list.
AntennaInfoCommon antennaInfoCommon
2: Physical configuration, general antennaInfoCommon-r10
PdschConfigCommon pdschConfigCommon
4: Physical configuration, physical channels pdsch-ConfigCommon-r10
uint16_t dlBandwidth
1: Cell characteristics
int8_t referenceSignalPower
INTEGER (-60..50),.
int8_t pb
INTEGER (0..3),.
uint16_t start
starting cell ID
PhysicalConfigDedicated structure.
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
bool haveAntennaInfoDedicated
have antenna info dedicated?
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
bool haveSoundingRsUlConfigDedicated
have sounding RS UL config dedicated?
bool havePdschConfigDedicated
have PDSCH config dedicated?
AntennaInfoDedicated antennaInfo
antenna info
PhysicalConfigDedicatedSCell structure.
AntennaInfoDedicated antennaInfoUl
antenna info UL
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
bool haveSoundingRsUlConfigDedicated
have sounding RS UL config dedicated?
bool haveUlConfiguration
have UL configuration?
bool haveAntennaInfoUlDedicated
have antenna info UL dedicated?
bool havePdschConfigDedicated
have PDSCH config dedicated?
bool haveNonUlConfiguration
have non UL configuration?
AntennaInfoDedicated antennaInfo
antenna info dedicated
bool haveAntennaInfoDedicated
have antenna info dedicated?
uint32_t plmnIdentity
PLMN identity.
Definition lte-rrc-sap.h:55
uint8_t numberOfRaPreambles
number of RA preambles
uint8_t filterCoefficientRSRQ
filter coefficient RSRQ
uint8_t filterCoefficientRSRP
filter coefficient RSRP
uint8_t raResponseWindowSize
RA response window size.
uint8_t preambleTransMax
preamble transmit maximum
RachConfigCommon structure.
TxFailParam txFailParam
txFailParams
PreambleInfo preambleInfo
preamble info
RaSupervisionInfo raSupervisionInfo
RA supervision info.
uint8_t raPreambleIndex
RA preamble index.
uint8_t raPrachMaskIndex
RA PRACH mask index.
RadioResourceConfigCommon structure.
RachConfigCommon rachConfigCommon
RACH config common.
RadioResourceConfigCommonSCell.
NonUlConfiguration nonUlConfiguration
non UL configuration
bool haveUlConfiguration
have UL configuration
bool haveNonUlConfiguration
have non UL configuration?
UlConfiguration ulConfiguration
UL configuration.
RadioResourceConfigCommonSib structure.
RachConfigCommon rachConfigCommon
RACH config common.
RadioResourceConfigDedicated structure.
PhysicalConfigDedicated physicalConfigDedicated
physical config dedicated
std::list< uint8_t > drbToReleaseList
DRB to release list.
bool havePhysicalConfigDedicated
have physical config dedicated?
std::list< DrbToAddMod > drbToAddModList
DRB to add mod list.
std::list< SrbToAddMod > srbToAddModList
SRB to add mod list.
RadioResourceConfigDedicatedSCell structure.
PhysicalConfigDedicatedSCell physicalConfigDedicatedSCell
physical config dedicated SCell
ReestabUeIdentity structure.
uint16_t physCellId
Phy cell ID.
bool reportOnLeave
Indicates whether or not the UE shall initiate the measurement reporting procedure when the leaving c...
uint8_t maxReportCells
Maximum number of cells, excluding the serving cell, to be included in the measurement report.
enum ns3::LteRrcSap::ReportConfigEutra::@62 eventId
Event enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@61 triggerType
Trigger enumeration.
uint8_t hysteresis
Parameter used within the entry and leave condition of an event triggered reporting condition.
@ RSRP
Reference Signal Received Power.
@ RSRQ
Reference Signal Received Quality.
@ EVENT_A2
Event A2: Serving becomes worse than absolute threshold.
@ EVENT_A3
Event A3: Neighbour becomes amount of offset better than PCell.
@ EVENT_A4
Event A4: Neighbour becomes better than absolute threshold.
@ EVENT_A1
Event A1: Serving becomes better than absolute threshold.
@ EVENT_A5
Event A5: PCell becomes worse than absolute threshold1 AND Neighbour becomes better than another abso...
uint8_t reportAmount
Number of measurement reports applicable, always assumed to be infinite.
enum ns3::LteRrcSap::ReportConfigEutra::@65 reportInterval
Report interval enumeration.
ThresholdEutra threshold2
Threshold for event A5.
enum ns3::LteRrcSap::ReportConfigEutra::@63 triggerQuantity
Trigger type enumeration.
@ BOTH
Both the RSRP and RSRQ quantities are to be included in the measurement report.
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
enum ns3::LteRrcSap::ReportConfigEutra::@64 reportQuantity
Report type enumeration.
int8_t a3Offset
Offset value for Event A3.
uint16_t timeToTrigger
Time during which specific criteria for the event needs to be met in order to trigger a measurement r...
ReportConfigToAddMod structure.
uint8_t reportConfigId
report config ID
ReportConfigEutra reportConfigEutra
report config eutra
Direction choice
direction choice
Definition lte-rrc-sap.h:93
RrcConnectionReconfigurationCompleted structure.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
RrcConnectionReconfiguration structure.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
bool haveMobilityControlInfo
have mobility control info
NonCriticalExtensionConfiguration nonCriticalExtension
3GPP TS 36.331 v.11.10 R11 Sec.
bool haveRadioResourceConfigDedicated
have radio resource config dedicated
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
bool haveNonCriticalExtension
have critical extension?
MobilityControlInfo mobilityControlInfo
mobility control info
RrcConnectionReestablishmentComplete structure.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
RrcConnectionReestablishment structure.
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
RrcConnectionReestablishmentReject structure.
RrcConnectionReestablishmentRequest structure.
ReestablishmentCause reestablishmentCause
reestablishment cause
RrcConnectionReject structure.
RrcConnectionRelease structure.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
RrcConnectionRequest structure.
RrcConnectionSetupCompleted structure.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
RrcConnectionSetup structure.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
SCellToAddMod structure.
RadioResourceConfigDedicatedSCell radioResourceConfigDedicatedSCell
radio resource config dedicated SCell
uint32_t sCellIndex
SCell index.
bool haveRadioResourceConfigDedicatedSCell
have radio resource config dedicated SCell?
CellIdentification cellIdentification
cell identification
RadioResourceConfigCommonSCell radioResourceConfigCommonSCell
radio resource config common SCell
uint16_t srsConfigIndex
SRS config index.
SpeedStateScaleFactors timeToTriggerSf
time to trigger scale factors
MobilityStateParameters mobilityStateParameters
mobility state parameters
uint8_t sfHigh
scale factor high
uint8_t sfMedium
scale factor medium
SrbToAddMod structure.
LogicalChannelConfig logicalChannelConfig
logical channel config
uint8_t srbIdentity
SB identity.
SystemInformationBlockType1 structure.
CellAccessRelatedInfo cellAccessRelatedInfo
cell access related info
SystemInformationBlockType2 structure.
RadioResourceConfigCommonSib radioResourceConfigCommon
radio resource config common
Threshold for event evaluation.
@ THRESHOLD_RSRP
RSRP is used for the threshold.
@ THRESHOLD_RSRQ
RSRQ is used for the threshold.
enum ns3::LteRrcSap::ThresholdEutra::@60 choice
Threshold enumeration.
uint8_t range
Value range used in RSRP/RSRQ threshold.
uint8_t connEstFailCount
Number of times that the UE detects T300 expiry on the same cell.
UlPowerControlCommonSCell ulPowerControlCommonSCell
3GPP TS 36.331 v.11.10 R11 pag.223
FreqInfo ulFreqInfo
UL frequency info.
PrachConfigSCell prachConfigSCell
PRACH config SCell.