A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-rrc-header.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Lluis Parcerisa <lparcerisa@cttc.cat>
19  */
20 
21 #include "ns3/log.h"
22 #include "ns3/lte-rrc-header.h"
23 
24 #include <stdio.h>
25 #include <sstream>
26 
27 #define MAX_DRB 11 // According to section 6.4 3GPP TS 36.331
28 #define MAX_EARFCN 65535
29 #define MAX_RAT_CAPABILITIES 8
30 #define MAX_SI_MESSAGE 32
31 #define MAX_SIB 32
32 
33 #define MAX_REPORT_CONFIG_ID 32
34 #define MAX_OBJECT_ID 32
35 #define MAX_MEAS_ID 32
36 #define MAX_CELL_MEAS 32
37 #define MAX_CELL_REPORT 8
38 
39 NS_LOG_COMPONENT_DEFINE ("RrcHeader");
40 
41 namespace ns3 {
42 
45 {
46 }
47 
48 TypeId
50 {
51  static TypeId tid = TypeId ("ns3::RrcAsn1Header")
52  .SetParent<Header> ()
53  ;
54  return tid;
55 }
56 
57 TypeId
59 {
60  return GetTypeId ();
61 }
62 
63 int
65 {
66  return m_messageType;
67 }
68 
69 void
70 RrcAsn1Header::SerializeDrbToAddModList (std::list<LteRrcSap::DrbToAddMod> drbToAddModList) const
71 {
72  // Serialize DRB-ToAddModList sequence-of
73  SerializeSequenceOf (drbToAddModList.size (),MAX_DRB,1);
74 
75  // Serialize the elements in the sequence-of list
76  std::list<LteRrcSap::DrbToAddMod>::iterator it = drbToAddModList.begin ();
77  for (; it != drbToAddModList.end (); it++)
78  {
79  // Serialize DRB-ToAddMod sequence
80  // 5 otional fields. Extension marker is present.
81  std::bitset<5> drbToAddModListOptionalFieldsPresent = std::bitset<5> ();
82  drbToAddModListOptionalFieldsPresent.set (4,1); // eps-BearerIdentity present
83  drbToAddModListOptionalFieldsPresent.set (3,0); // pdcp-Config not present
84  drbToAddModListOptionalFieldsPresent.set (2,1); // rlc-Config present
85  drbToAddModListOptionalFieldsPresent.set (1,1); // logicalChannelIdentity present
86  drbToAddModListOptionalFieldsPresent.set (0,1); // logicalChannelConfig present
87  SerializeSequence (drbToAddModListOptionalFieldsPresent,true);
88 
89  // Serialize eps-BearerIdentity::=INTEGER (0..15)
90  SerializeInteger (it->epsBearerIdentity,0,15);
91 
92  // Serialize drb-Identity ::= INTEGER (1..32)
93  SerializeInteger (it->drbIdentity,1,32);
94 
95  switch (it->rlcConfig.choice)
96  {
98  // Serialize rlc-Config choice
99  SerializeChoice (4,1,true);
100 
101  // Serialize UL-UM-RLC
102  SerializeSequence (std::bitset<0> (),false);
103  SerializeEnum (2,0); // sn-FieldLength
104 
105  // Serialize DL-UM-RLC
106  SerializeSequence (std::bitset<0> (),false);
107  SerializeEnum (2,0); // sn-FieldLength
108  SerializeEnum (32,0); // t-Reordering
109  break;
110 
112  // Serialize rlc-Config choice
113  SerializeChoice (4,2,true);
114 
115  // Serialize UL-UM-RLC
116  SerializeSequence (std::bitset<0> (),false);
117  SerializeEnum (2,0); // sn-FieldLength
118  break;
119 
121  // Serialize rlc-Config choice
122  SerializeChoice (4,3,true);
123 
124  // Serialize DL-UM-RLC
125  SerializeSequence (std::bitset<0> (),false);
126  SerializeEnum (2,0); // sn-FieldLength
127  SerializeEnum (32,0); // t-Reordering
128  break;
129 
131  default:
132  // Serialize rlc-Config choice
133  SerializeChoice (4,0,true);
134 
135  // Serialize UL-AM-RLC
136  SerializeSequence (std::bitset<0> (),false);
137  SerializeEnum (64,0); // t-PollRetransmit
138  SerializeEnum (8,0); // pollPDU
139  SerializeEnum (16,0); // pollByte
140  SerializeEnum (8,0); // maxRetxThreshold
141 
142  // Serialize DL-AM-RLC
143  SerializeSequence (std::bitset<0> (),false);
144  SerializeEnum (32,0); // t-Reordering
145  SerializeEnum (64,0); // t-StatusProhibit
146  break;
147  }
148 
149  // Serialize logicalChannelIdentity ::=INTEGER (3..10)
150  SerializeInteger (it->logicalChannelIdentity,3,10);
151 
152  // Serialize logicalChannelConfig
153  SerializeLogicalChannelConfig (it->logicalChannelConfig);
154  }
155 }
156 
157 void
158 RrcAsn1Header::SerializeSrbToAddModList (std::list<LteRrcSap::SrbToAddMod> srbToAddModList) const
159 {
160  // Serialize SRB-ToAddModList ::= SEQUENCE (SIZE (1..2)) OF SRB-ToAddMod
161  SerializeSequenceOf (srbToAddModList.size (),2,1);
162 
163  // Serialize the elements in the sequence-of list
164  std::list<LteRrcSap::SrbToAddMod>::iterator it = srbToAddModList.begin ();
165  for (; it != srbToAddModList.end (); it++)
166  {
167  // Serialize SRB-ToAddMod sequence
168  // 2 otional fields. Extension marker is present.
169  std::bitset<2> srbToAddModListOptionalFieldsPresent = std::bitset<2> ();
170  srbToAddModListOptionalFieldsPresent.set (1,0); // rlc-Config not present
171  srbToAddModListOptionalFieldsPresent.set (0,1); // logicalChannelConfig present
172  SerializeSequence (srbToAddModListOptionalFieldsPresent,true);
173 
174  // Serialize srb-Identity ::= INTEGER (1..2)
175  SerializeInteger (it->srbIdentity,1,2);
176 
177  // Serialize logicalChannelConfig choice
178  // 2 options, selected option 0 (var "explicitValue", of type LogicalChannelConfig)
179  SerializeChoice (2,0,false);
180 
181  // Serialize LogicalChannelConfig
182  SerializeLogicalChannelConfig (it->logicalChannelConfig);
183  }
184 }
185 
186 void
188 {
189  // Serialize LogicalChannelConfig sequence
190  // 1 optional field (ul-SpecificParameters), which is present. Extension marker present.
191  SerializeSequence (std::bitset<1> (1),true);
192 
193  // Serialize ul-SpecificParameters sequence
194  // 1 optional field (logicalChannelGroup), which is present. No extension marker.
195  SerializeSequence (std::bitset<1> (1),false);
196 
197  // Serialize priority ::= INTEGER (1..16)
198  SerializeInteger (logicalChannelConfig.priority,1,16);
199 
200  // Serialize prioritisedBitRate
201  int prioritizedBitRate;
202  switch (logicalChannelConfig.prioritizedBitRateKbps)
203  {
204  case 0:
205  prioritizedBitRate = 0;
206  break;
207  case 8:
208  prioritizedBitRate = 1;
209  break;
210  case 16:
211  prioritizedBitRate = 2;
212  break;
213  case 32:
214  prioritizedBitRate = 3;
215  break;
216  case 64:
217  prioritizedBitRate = 4;
218  break;
219  case 128:
220  prioritizedBitRate = 5;
221  break;
222  case 256:
223  prioritizedBitRate = 6;
224  break;
225  default:
226  prioritizedBitRate = 7; // Infinity
227  }
228  SerializeEnum (16,prioritizedBitRate);
229 
230  // Serialize bucketSizeDuration
231  int bucketSizeDuration;
232  switch (logicalChannelConfig.bucketSizeDurationMs)
233  {
234  case 50:
235  bucketSizeDuration = 0;
236  break;
237  case 100:
238  bucketSizeDuration = 1;
239  break;
240  case 150:
241  bucketSizeDuration = 2;
242  break;
243  case 300:
244  bucketSizeDuration = 3;
245  break;
246  case 500:
247  bucketSizeDuration = 4;
248  break;
249  case 1000:
250  bucketSizeDuration = 5;
251  break;
252  default:
253  bucketSizeDuration = 5;
254  }
255  SerializeEnum (8,bucketSizeDuration);
256 
257  // Serialize logicalChannelGroup ::= INTEGER (0..3)
258  SerializeInteger (logicalChannelConfig.logicalChannelGroup,0,3);
259 }
260 
261 void
263 {
264  // Serialize PhysicalConfigDedicated Sequence
265  std::bitset<10> optionalFieldsPhysicalConfigDedicated;
266  optionalFieldsPhysicalConfigDedicated.set (9,0); // pdsch-ConfigDedicated not present
267  optionalFieldsPhysicalConfigDedicated.set (8,0); // pucch-ConfigDedicated not present
268  optionalFieldsPhysicalConfigDedicated.set (7,0); // pusch-ConfigDedicated not present
269  optionalFieldsPhysicalConfigDedicated.set (6,0); // uplinkPowerControlDedicated not present
270  optionalFieldsPhysicalConfigDedicated.set (5,0); // tpc-PDCCH-ConfigPUCCH not present
271  optionalFieldsPhysicalConfigDedicated.set (4,0); // tpc-PDCCH-ConfigPUSCH not present
272  optionalFieldsPhysicalConfigDedicated.set (3,0); // cqi-ReportConfig not present
273  optionalFieldsPhysicalConfigDedicated.set (2,physicalConfigDedicated.haveSoundingRsUlConfigDedicated); // soundingRS-UL-ConfigDedicated
274  optionalFieldsPhysicalConfigDedicated.set (1,physicalConfigDedicated.haveAntennaInfoDedicated); // antennaInfo
275  optionalFieldsPhysicalConfigDedicated.set (0,0); // schedulingRequestConfig not present
276  SerializeSequence (optionalFieldsPhysicalConfigDedicated,true);
277 
278  if (physicalConfigDedicated.haveSoundingRsUlConfigDedicated)
279  {
280  // Serialize SoundingRS-UL-ConfigDedicated choice:
281  switch (physicalConfigDedicated.soundingRsUlConfigDedicated.type)
282  {
284  SerializeChoice (2,0,false);
285  SerializeNull ();
286  break;
287 
289  default:
290  // 2 options, selected: 1 (setup)
291  SerializeChoice (2,1,false);
292 
293  // Serialize setup sequence
294  // 0 optional / default fields, no extension marker.
295  SerializeSequence (std::bitset<0> (),false);
296 
297  // Serialize srs-Bandwidth
298  SerializeEnum (4,physicalConfigDedicated.soundingRsUlConfigDedicated.srsBandwidth);
299 
300  // Serialize srs-HoppingBandwidth
301  SerializeEnum (4,0);
302 
303  // Serialize freqDomainPosition
304  SerializeInteger (0,0,23);
305 
306  // Serialize duration
307  SerializeBoolean (false);
308 
309  // Serialize srs-ConfigIndex
310  SerializeInteger (physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex,0,1023);
311 
312  // Serialize transmissionComb
313  SerializeInteger (0,0,1);
314 
315  // Serialize cyclicShift
316  SerializeEnum (8,0);
317 
318  break;
319  }
320  }
321 
322  if (physicalConfigDedicated.haveAntennaInfoDedicated)
323  {
324  // Serialize antennaInfo choice
325  // 2 options. Selected: 0 ("explicitValue" of type "AntennaInfoDedicated")
326  SerializeChoice (2,0,false);
327 
328  // Serialize AntennaInfoDedicated sequence
329  // 1 optional parameter, not present. No extension marker.
330  SerializeSequence (std::bitset<1> (0),false);
331 
332  // Serialize transmissionMode
333  // Assuming the value in the struct is the enum index
334  SerializeEnum (8,physicalConfigDedicated.antennaInfo.transmissionMode);
335 
336  // Serialize ue-TransmitAntennaSelection choice
337  SerializeChoice (2,0,false);
338 
339  // Serialize release
340  SerializeNull ();
341  }
342 }
343 
344 void
346 {
347  bool isSrbToAddModListPresent = !radioResourceConfigDedicated.srbToAddModList.empty ();
348  bool isDrbToAddModListPresent = !radioResourceConfigDedicated.drbToAddModList.empty ();
349  bool isDrbToReleaseListPresent = !radioResourceConfigDedicated.drbToReleaseList.empty ();
350 
351  // 6 optional fields. Extension marker is present.
352  std::bitset<6> optionalFieldsPresent = std::bitset<6> ();
353  optionalFieldsPresent.set (5,isSrbToAddModListPresent); // srb-ToAddModList present
354  optionalFieldsPresent.set (4,isDrbToAddModListPresent); // drb-ToAddModList present
355  optionalFieldsPresent.set (3,isDrbToReleaseListPresent); // drb-ToReleaseList present
356  optionalFieldsPresent.set (2,0); // mac-MainConfig not present
357  optionalFieldsPresent.set (1,0); // sps-Config not present
358  optionalFieldsPresent.set (0,(radioResourceConfigDedicated.havePhysicalConfigDedicated) ? 1 : 0);
359  SerializeSequence (optionalFieldsPresent,true);
360 
361  // Serialize srbToAddModList
362  if (isSrbToAddModListPresent)
363  {
364  SerializeSrbToAddModList (radioResourceConfigDedicated.srbToAddModList);
365  }
366 
367  // Serialize drbToAddModList
368  if (isDrbToAddModListPresent)
369  {
370  SerializeDrbToAddModList (radioResourceConfigDedicated.drbToAddModList);
371  }
372 
373  // Serialize drbToReleaseList
374  if (isDrbToReleaseListPresent)
375  {
376  SerializeSequenceOf (radioResourceConfigDedicated.drbToReleaseList.size (),MAX_DRB,1);
377  std::list<uint8_t>::iterator it = radioResourceConfigDedicated.drbToReleaseList.begin ();
378  for (; it != radioResourceConfigDedicated.drbToReleaseList.end (); it++)
379  {
380  // DRB-Identity ::= INTEGER (1..32)
381  SerializeInteger (*it,1,32);
382  }
383  }
384 
385  if (radioResourceConfigDedicated.havePhysicalConfigDedicated)
386  {
387  SerializePhysicalConfigDedicated (radioResourceConfigDedicated.physicalConfigDedicated);
388  }
389 }
390 
391 void
393 {
394  // 3 optional fields, no extension marker.
395  std::bitset<3> sysInfoBlk1Opts;
396  sysInfoBlk1Opts.set (2,0); // p-Max absent
397  sysInfoBlk1Opts.set (1,0); // tdd-Config absent
398  sysInfoBlk1Opts.set (0,0); // nonCriticalExtension absent
399  SerializeSequence (sysInfoBlk1Opts,false);
400 
401  // Serialize cellAccessRelatedInfo
402  // 1 optional field (csgIdentity) which is present, no extension marker.
403  SerializeSequence (std::bitset<1> (1),false);
404 
405  // Serialize plmn-IdentityList
406  SerializeSequenceOf (1,6,1);
407 
408  // PLMN-IdentityInfo
409  SerializeSequence (std::bitset<0> (),false);
410 
412 
413  // Serialize trackingAreaCode
414  SerializeBitstring (std::bitset<16> (0));
415  // Serialize cellIdentity
416  SerializeBitstring (std::bitset<28> (systemInformationBlockType1.cellAccessRelatedInfo.cellIdentity));
417  // Serialize cellBarred
418  SerializeEnum (2,0);
419  // Serialize intraFreqReselection
420  SerializeEnum (2,0);
421  // Serialize csg-Indication
422  SerializeBoolean (systemInformationBlockType1.cellAccessRelatedInfo.csgIndication);
423  // Serialize csg-Identity
424  SerializeBitstring (std::bitset<27> (systemInformationBlockType1.cellAccessRelatedInfo.csgIdentity));
425 
426  // Serialize cellSelectionInfo
427  SerializeSequence (std::bitset<1> (0),false);
428  // Serialize q-RxLevMin
429  SerializeInteger (-50,-70,-22);
430 
431  // Serialize freqBandIndicator
432  SerializeInteger (1,1,64);
433 
434  // Serialize schedulingInfoList
436  // SchedulingInfo
437  SerializeSequence (std::bitset<0> (),false);
438  // si-Periodicity
439  SerializeEnum (7,0);
440  // sib-MappingInfo
441  SerializeSequenceOf (0,MAX_SIB - 1,0);
442 
443  // Serialize si-WindowLength
444  SerializeEnum (7,0);
445 
446  // Serialize systemInfoValueTag
447  SerializeInteger (0,0,31);
448 }
449 
450 void
452 {
453  // 9 optional fields. Extension marker yes.
454  std::bitset<9> rrCfgCmmOpts;
455  rrCfgCmmOpts.set (8,1); // rach-ConfigCommon is present
456  rrCfgCmmOpts.set (7,0); // pdsch-ConfigCommon not present
457  rrCfgCmmOpts.set (6,0); // phich-Config not present
458  rrCfgCmmOpts.set (5,0); // pucch-ConfigCommon not present
459  rrCfgCmmOpts.set (4,0); // soundingRS-UL-ConfigCommon not present
460  rrCfgCmmOpts.set (3,0); // uplinkPowerControlCommon not present
461  rrCfgCmmOpts.set (2,0); // antennaInfoCommon not present
462  rrCfgCmmOpts.set (1,0); // p-Max not present
463  rrCfgCmmOpts.set (0,0); // tdd-Config not present
464 
465  SerializeSequence (rrCfgCmmOpts,true);
466 
467  if (rrCfgCmmOpts[8])
468  {
469  // Serialize RACH-ConfigCommon
470  SerializeRachConfigCommon (radioResourceConfigCommon.rachConfigCommon);
471  }
472 
473  // Serialize PRACH-Config
474  // 1 optional, 0 extension marker.
475  SerializeSequence (std::bitset<1> (0),false);
476 
477  // Serialize PRACH-Config rootSequenceIndex
478  SerializeInteger (0,0,1023);
479 
480  // Serialize PUSCH-ConfigCommon
481  SerializeSequence (std::bitset<0> (),false);
482 
483  // Serialize pusch-ConfigBasic
484  SerializeSequence (std::bitset<0> (),false);
485  SerializeInteger (1,1,4);
486  SerializeEnum (2,0);
487  SerializeInteger (0,0,98);
488  SerializeBoolean (false);
489 
490  // Serialize UL-ReferenceSignalsPUSCH
491  SerializeSequence (std::bitset<0> (),false);
492  SerializeBoolean (false);
493  SerializeInteger (0,0,29);
494  SerializeBoolean (false);
495  SerializeInteger (4,0,7);
496 
497  // Serialize UL-CyclicPrefixLength
498  SerializeEnum (2,0);
499 }
500 
501 void
503 {
504  SerializeSequence (std::bitset<0> (0),true);
505 
506  // rach-ConfigCommon
507  SerializeRachConfigCommon (radioResourceConfigCommonSib.rachConfigCommon);
508 
509  // bcch-Config
510  SerializeSequence (std::bitset<0> (0),false);
511  SerializeEnum (4,0); // modificationPeriodCoeff
512  // pcch-Config
513  SerializeSequence (std::bitset<0> (0),false);
514  SerializeEnum (4,0); // defaultPagingCycle
515  SerializeEnum (8,0); // nB
516  // prach-Config
517  SerializeSequence (std::bitset<1> (0),false);
518  SerializeInteger (0,0,1023); // rootSequenceIndex
519  // pdsch-ConfigCommon
520  SerializeSequence (std::bitset<0> (0),false);
521  SerializeInteger (0,-60,50); // referenceSignalPower
522  SerializeInteger (0,0,3); // p-b
523  // pusch-ConfigCommon
524  SerializeSequence (std::bitset<0> (0),false);
525  SerializeSequence (std::bitset<0> (0),false); // pusch-ConfigBasic
526  SerializeInteger (1,1,4); // n-SB
527  SerializeEnum (2,0); // hoppingMode
528  SerializeInteger (0,0,98); // pusch-HoppingOffset
529  SerializeBoolean (false); // enable64QAM
530  SerializeSequence (std::bitset<0> (0),false); // UL-ReferenceSignalsPUSCH
531  SerializeBoolean (false); // groupHoppingEnabled
532  SerializeInteger (0,0,29); // groupAssignmentPUSCH
533  SerializeBoolean (false); // sequenceHoppingEnabled
534  SerializeInteger (0,0,7); // cyclicShift
535  // pucch-ConfigCommon
536  SerializeSequence (std::bitset<0> (0),false);
537  SerializeEnum (3,0); // deltaPUCCH-Shift
538  SerializeInteger (0,0,98); // nRB-CQI
539  SerializeInteger (0,0,7); // nCS-AN
540  SerializeInteger (0,0,2047); // n1PUCCH-AN
541  // soundingRS-UL-ConfigCommon
542  SerializeChoice (2,0,false);
543  SerializeNull (); // release
544  // uplinkPowerControlCommon
545  SerializeSequence (std::bitset<0> (0),false);
546  SerializeInteger (0,-126,24); // p0-NominalPUSCH
547  SerializeEnum (8,0); // alpha
548  SerializeInteger (-50,-127,-96); // p0-NominalPUCCH
549  SerializeSequence (std::bitset<0> (0),false); // deltaFList-PUCCH
550  SerializeEnum (3,0); // deltaF-PUCCH-Format1
551  SerializeEnum (3,0); // deltaF-PUCCH-Format1b
552  SerializeEnum (4,0); // deltaF-PUCCH-Format2
553  SerializeEnum (3,0); // deltaF-PUCCH-Format2a
554  SerializeEnum (3,0); // deltaF-PUCCH-Format2b
555  SerializeInteger (0,-1,6);
556  // ul-CyclicPrefixLength
557  SerializeEnum (2,0);
558 }
559 
560 void
562 {
563  SerializeSequence (std::bitset<2> (0),true);
564 
565  // RadioResourceConfigCommonSib
567 
568  // ue-TimersAndConstants
569  SerializeSequence (std::bitset<0> (0),true);
570  SerializeEnum (8,0); // t300
571  SerializeEnum (8,0); // t301
572  SerializeEnum (7,0); // t310
573  SerializeEnum (8,0); // n310
574  SerializeEnum (7,0); // t311
575  SerializeEnum (8,0); // n311
576 
577  // freqInfo
578  SerializeSequence (std::bitset<2> (3),false);
579  SerializeInteger ((int) systemInformationBlockType2.freqInfo.ulCarrierFreq, 0, MAX_EARFCN);
580  switch (systemInformationBlockType2.freqInfo.ulBandwidth)
581  {
582  case 6:
583  SerializeEnum (6,0);
584  break;
585  case 15:
586  SerializeEnum (6,1);
587  break;
588  case 25:
589  SerializeEnum (6,2);
590  break;
591  case 50:
592  SerializeEnum (6,3);
593  break;
594  case 75:
595  SerializeEnum (6,4);
596  break;
597  case 100:
598  SerializeEnum (6,5);
599  break;
600  default:
601  SerializeEnum (6,0);
602  }
603 
604  SerializeInteger (29,1,32); // additionalSpectrumEmission
605  // timeAlignmentTimerCommon
606  SerializeEnum (8,0);
607 }
608 
609 void
611 {
612  // Watchdog: if list has 0 elements, set boolean to false
613  if (measResults.measResultListEutra.empty ())
614  {
615  measResults.haveMeasResultNeighCells = false;
616  }
617 
618  // Serialize MeasResults sequence, 1 optional value, extension marker present
619  SerializeSequence (std::bitset<1> (measResults.haveMeasResultNeighCells),true);
620 
621  // Serialize measId
622  SerializeInteger (measResults.measId,1,MAX_MEAS_ID);
623 
624  // Serialize measResultServCell sequence
625  SerializeSequence (std::bitset<0> (0),false);
626 
627  // Serialize rsrpResult
628  SerializeInteger (measResults.rsrpResult,0,97);
629 
630  // Serialize rsrqResult
631  SerializeInteger (measResults.rsrqResult,0,34);
632 
633  if (measResults.haveMeasResultNeighCells)
634  {
635  // Serialize Choice = 0 (MeasResultListEUTRA)
636  SerializeChoice (4,0,false);
637 
638  // Serialize measResultNeighCells
640 
641  // serialize MeasResultEutra elements in the list
642  std::list<LteRrcSap::MeasResultEutra>::iterator it;
643  for (it = measResults.measResultListEutra.begin (); it != measResults.measResultListEutra.end (); it++)
644  {
645  SerializeSequence (std::bitset<1> (it->haveCgiInfo),false);
646 
647  // Serialize PhysCellId
648  SerializeInteger (it->physCellId, 0, 503);
649 
650  // Serialize CgiInfo
651  if (it->haveCgiInfo)
652  {
653  SerializeSequence (std::bitset<1> (it->cgiInfo.plmnIdentityList.size ()),false);
654 
655  // Serialize cellGlobalId
656  SerializeSequence (std::bitset<0> (0),false);
657  SerializePlmnIdentity (it->cgiInfo.plmnIdentity);
658  SerializeBitstring (std::bitset<28> (it->cgiInfo.cellIdentity));
659 
660  // Serialize trackingAreaCode
661  SerializeBitstring (std::bitset<16> (it->cgiInfo.trackingAreaCode));
662 
663  // Serialize plmn-IdentityList
664  if (!it->cgiInfo.plmnIdentityList.empty ())
665  {
666  SerializeSequenceOf (it->cgiInfo.plmnIdentityList.size (),5,1);
667  std::list<uint32_t>::iterator it2;
668  for (it2 = it->cgiInfo.plmnIdentityList.begin (); it2 != it->cgiInfo.plmnIdentityList.end (); it2++)
669  {
670  SerializePlmnIdentity (*it2);
671  }
672  }
673  }
674 
675  // Serialize measResult
676  std::bitset<2> measResultFieldsPresent;
677  measResultFieldsPresent[1] = it->haveRsrpResult;
678  measResultFieldsPresent[0] = it->haveRsrqResult;
679  SerializeSequence (measResultFieldsPresent,true);
680 
681  if (it->haveRsrpResult)
682  {
683  SerializeInteger (it->rsrpResult,0,97);
684  }
685 
686  if (it->haveRsrqResult)
687  {
688  SerializeInteger (it->rsrqResult,0,34);
689  }
690  }
691  }
692 }
693 
694 void
696 {
697  // plmn-Identity sequence, mcc is optional, no extension marker
698  SerializeSequence (std::bitset<1> (0), false);
699 
700  // Serialize mnc
701  int nDig = (plmnId > 99) ? 3 : 2;
702 
703  SerializeSequenceOf (nDig,3,2);
704  for (int i = nDig - 1; i >= 0; i--)
705  {
706  int n = floor (plmnId / pow (10,i));
707  SerializeInteger (n,0,9);
708  plmnId -= n * pow (10,i);
709  }
710 
711  // cellReservedForOperatorUse
712  SerializeEnum (2,0);
713 }
714 
715 void
717 {
718  // rach-ConfigCommon
719  SerializeSequence (std::bitset<0> (0),true);
720 
721  // preambleInfo
722  SerializeSequence (std::bitset<1> (0),false);
723 
724  // numberOfRA-Preambles
725  switch (rachConfigCommon.preambleInfo.numberOfRaPreambles)
726  {
727  case 4:
728  SerializeEnum (16,0);
729  break;
730  case 8:
731  SerializeEnum (16,1);
732  break;
733  case 12:
734  SerializeEnum (16,2);
735  break;
736  case 16:
737  SerializeEnum (16,3);
738  break;
739  case 20:
740  SerializeEnum (16,4);
741  break;
742  case 24:
743  SerializeEnum (16,5);
744  break;
745  case 28:
746  SerializeEnum (16,6);
747  break;
748  case 32:
749  SerializeEnum (16,7);
750  break;
751  case 36:
752  SerializeEnum (16,8);
753  break;
754  case 40:
755  SerializeEnum (16,9);
756  break;
757  case 44:
758  SerializeEnum (16,10);
759  break;
760  case 48:
761  SerializeEnum (16,11);
762  break;
763  case 52:
764  SerializeEnum (16,12);
765  break;
766  case 56:
767  SerializeEnum (16,13);
768  break;
769  case 60:
770  SerializeEnum (16,14);
771  break;
772  case 64:
773  SerializeEnum (16,15);
774  break;
775  default:
776  SerializeEnum (16,0);
777  }
778 
779  SerializeSequence (std::bitset<0> (0),false); // powerRampingParameters
780  SerializeEnum (4,0); // powerRampingStep
781  SerializeEnum (16,0); // preambleInitialReceivedTargetPower
782  SerializeSequence (std::bitset<0> (0),false); // ra-SupervisionInfo
783 
784  // preambleTransMax
785  switch (rachConfigCommon.raSupervisionInfo.preambleTransMax)
786  {
787  case 3:
788  SerializeEnum (11,0);
789  break;
790  case 4:
791  SerializeEnum (11,1);
792  break;
793  case 5:
794  SerializeEnum (11,2);
795  break;
796  case 6:
797  SerializeEnum (11,3);
798  break;
799  case 7:
800  SerializeEnum (11,4);
801  break;
802  case 8:
803  SerializeEnum (11,5);
804  break;
805  case 10:
806  SerializeEnum (11,6);
807  break;
808  case 20:
809  SerializeEnum (11,7);
810  break;
811  case 50:
812  SerializeEnum (11,8);
813  break;
814  case 100:
815  SerializeEnum (11,9);
816  break;
817  case 200:
818  SerializeEnum (11,10);
819  break;
820  default:
821  SerializeEnum (11,0);
822  }
823 
824  // ra-ResponseWindowSize
825  switch (rachConfigCommon.raSupervisionInfo.raResponseWindowSize)
826  {
827  case 2:
828  SerializeEnum (8,0);
829  break;
830  case 3:
831  SerializeEnum (8,1);
832  break;
833  case 4:
834  SerializeEnum (8,2);
835  break;
836  case 5:
837  SerializeEnum (8,3);
838  break;
839  case 6:
840  SerializeEnum (8,4);
841  break;
842  case 7:
843  SerializeEnum (8,5);
844  break;
845  case 8:
846  SerializeEnum (8,6);
847  break;
848  case 10:
849  SerializeEnum (8,7);
850  break;
851  default:
852  SerializeEnum (8,0);
853  }
854 
855  SerializeEnum (8,0); // mac-ContentionResolutionTimer
856  SerializeInteger (1,1,8); // maxHARQ-Msg3Tx
857 }
858 
859 void
860 RrcAsn1Header::SerializeQoffsetRange (int8_t qOffsetRange) const
861 {
862  switch (qOffsetRange)
863  {
864  case -24:
865  SerializeEnum (31,0);
866  break;
867  case -22:
868  SerializeEnum (31,1);
869  break;
870  case -20:
871  SerializeEnum (31,2);
872  break;
873  case -18:
874  SerializeEnum (31,3);
875  break;
876  case -16:
877  SerializeEnum (31,4);
878  break;
879  case -14:
880  SerializeEnum (31,5);
881  break;
882  case -12:
883  SerializeEnum (31,6);
884  break;
885  case -10:
886  SerializeEnum (31,7);
887  break;
888  case -8:
889  SerializeEnum (31,8);
890  break;
891  case -6:
892  SerializeEnum (31,9);
893  break;
894  case -5:
895  SerializeEnum (31,10);
896  break;
897  case -4:
898  SerializeEnum (31,11);
899  break;
900  case -3:
901  SerializeEnum (31,12);
902  break;
903  case -2:
904  SerializeEnum (31,13);
905  break;
906  case -1:
907  SerializeEnum (31,14);
908  break;
909  case 0:
910  SerializeEnum (31,15);
911  break;
912  case 1:
913  SerializeEnum (31,16);
914  break;
915  case 2:
916  SerializeEnum (31,17);
917  break;
918  case 3:
919  SerializeEnum (31,18);
920  break;
921  case 4:
922  SerializeEnum (31,19);
923  break;
924  case 5:
925  SerializeEnum (31,20);
926  break;
927  case 6:
928  SerializeEnum (31,21);
929  break;
930  case 8:
931  SerializeEnum (31,22);
932  break;
933  case 10:
934  SerializeEnum (31,23);
935  break;
936  case 12:
937  SerializeEnum (31,24);
938  break;
939  case 14:
940  SerializeEnum (31,25);
941  break;
942  case 16:
943  SerializeEnum (31,26);
944  break;
945  case 18:
946  SerializeEnum (31,27);
947  break;
948  case 20:
949  SerializeEnum (31,28);
950  break;
951  case 22:
952  SerializeEnum (31,29);
953  break;
954  case 24:
955  SerializeEnum (31,30);
956  break;
957  default:
958  SerializeEnum (31,15);
959  }
960 }
961 
962 void
964 {
965  switch (thresholdEutra.choice)
966  {
968  SerializeChoice (2,0,false);
969  SerializeInteger (thresholdEutra.range, 0, 97);
970  break;
972  default:
973  SerializeChoice (2,1,false);
974  SerializeInteger (thresholdEutra.range, 0, 34);
975  }
976 }
977 
978 void
980 {
981  // Serialize MeasConfig sequence
982  // 11 optional fields, extension marker present
983  std::bitset<11> measConfigOptional;
984  measConfigOptional.set (10, !measConfig.measObjectToRemoveList.empty () );
985  measConfigOptional.set (9, !measConfig.measObjectToAddModList.empty () );
986  measConfigOptional.set (8, !measConfig.reportConfigToRemoveList.empty () );
987  measConfigOptional.set (7, !measConfig.reportConfigToAddModList.empty () );
988  measConfigOptional.set (6, !measConfig.measIdToRemoveList.empty () );
989  measConfigOptional.set (5, !measConfig.measIdToAddModList.empty () );
990  measConfigOptional.set (4, measConfig.haveQuantityConfig );
991  measConfigOptional.set (3, measConfig.haveMeasGapConfig );
992  measConfigOptional.set (2, measConfig.haveSmeasure );
993  measConfigOptional.set (1, false ); // preRegistrationInfoHRPD
994  measConfigOptional.set (0, measConfig.haveSpeedStatePars );
995  SerializeSequence (measConfigOptional,true);
996 
997  if (!measConfig.measObjectToRemoveList.empty ())
998  {
1000  for (std::list<uint8_t>::iterator it = measConfig.measObjectToRemoveList.begin (); it != measConfig.measObjectToRemoveList.end (); it++)
1001  {
1002  SerializeInteger (*it, 1, MAX_OBJECT_ID);
1003  }
1004  }
1005 
1006  if (!measConfig.measObjectToAddModList.empty ())
1007  {
1009  for (std::list<LteRrcSap::MeasObjectToAddMod>::iterator it = measConfig.measObjectToAddModList.begin (); it != measConfig.measObjectToAddModList.end (); it++)
1010  {
1011  SerializeSequence (std::bitset<0> (), false);
1012  SerializeInteger (it->measObjectId, 1, MAX_OBJECT_ID);
1013  SerializeChoice (4, 0, true); // Select MeasObjectEUTRA
1014 
1015  // Serialize measObjectEutra
1016  std::bitset<5> measObjOpts;
1017  measObjOpts.set (4,!it->measObjectEutra.cellsToRemoveList.empty () );
1018  measObjOpts.set (3,!it->measObjectEutra.cellsToAddModList.empty () );
1019  measObjOpts.set (2,!it->measObjectEutra.blackCellsToRemoveList.empty () );
1020  measObjOpts.set (1,!it->measObjectEutra.blackCellsToAddModList.empty () );
1021  measObjOpts.set (0,it->measObjectEutra.haveCellForWhichToReportCGI);
1022  SerializeSequence (measObjOpts, true);
1023 
1024  // Serialize carrierFreq
1025  SerializeInteger (it->measObjectEutra.carrierFreq, 0, MAX_EARFCN);
1026 
1027  // Serialize allowedMeasBandwidth
1028  switch (it->measObjectEutra.allowedMeasBandwidth)
1029  {
1030  case 6:
1031  SerializeEnum (6,0);
1032  break;
1033  case 15:
1034  SerializeEnum (6,1);
1035  break;
1036  case 25:
1037  SerializeEnum (6,2);
1038  break;
1039  case 50:
1040  SerializeEnum (6,3);
1041  break;
1042  case 75:
1043  SerializeEnum (6,4);
1044  break;
1045  case 100:
1046  SerializeEnum (6,5);
1047  break;
1048  default:
1049  SerializeEnum (6,0);
1050  }
1051 
1052  SerializeBoolean (it->measObjectEutra.presenceAntennaPort1);
1053  SerializeBitstring (std::bitset<2> (it->measObjectEutra.neighCellConfig));
1054  SerializeQoffsetRange (it->measObjectEutra.offsetFreq);
1055 
1056  if (!it->measObjectEutra.cellsToRemoveList.empty ())
1057  {
1058  SerializeSequenceOf (it->measObjectEutra.cellsToRemoveList.size (),MAX_CELL_MEAS,1);
1059  for (std::list<uint8_t>::iterator it2 = it->measObjectEutra.cellsToRemoveList.begin (); it2 != it->measObjectEutra.cellsToRemoveList.end (); it2++)
1060  {
1061  SerializeInteger (*it2, 1, MAX_CELL_MEAS);
1062  }
1063  }
1064 
1065  if (!it->measObjectEutra.cellsToAddModList.empty ())
1066  {
1067  SerializeSequenceOf (it->measObjectEutra.cellsToAddModList.size (), MAX_CELL_MEAS, 1);
1068  for (std::list<LteRrcSap::CellsToAddMod>::iterator it2 = it->measObjectEutra.cellsToAddModList.begin (); it2 != it->measObjectEutra.cellsToAddModList.end (); it2++)
1069  {
1070  SerializeSequence (std::bitset<0> (), false);
1071 
1072  // Serialize cellIndex
1073  SerializeInteger (it2->cellIndex, 1, MAX_CELL_MEAS);
1074 
1075  // Serialize PhysCellId
1076  SerializeInteger (it2->physCellId,0,503);
1077 
1078  // Serialize cellIndividualOffset
1079  SerializeQoffsetRange (it2->cellIndividualOffset);
1080  }
1081  }
1082 
1083  if (!it->measObjectEutra.blackCellsToRemoveList.empty () )
1084  {
1085  SerializeSequenceOf (it->measObjectEutra.blackCellsToRemoveList.size (),MAX_CELL_MEAS,1);
1086  for (std::list<uint8_t>::iterator it2 = it->measObjectEutra.blackCellsToRemoveList.begin (); it2 != it->measObjectEutra.blackCellsToRemoveList.end (); it2++)
1087  {
1088  SerializeInteger (*it2, 1, MAX_CELL_MEAS);
1089  }
1090  }
1091 
1092  if (!it->measObjectEutra.blackCellsToAddModList.empty () )
1093  {
1094  SerializeSequenceOf (it->measObjectEutra.blackCellsToAddModList.size (), MAX_CELL_MEAS, 1);
1095  for (std::list<LteRrcSap::BlackCellsToAddMod>::iterator it2 = it->measObjectEutra.blackCellsToAddModList.begin (); it2 != it->measObjectEutra.blackCellsToAddModList.end (); it2++)
1096  {
1097  SerializeSequence (std::bitset<0> (),false);
1098  SerializeInteger (it2->cellIndex, 1, MAX_CELL_MEAS);
1099 
1100  // Serialize PhysCellIdRange
1101  // range optional
1102  std::bitset<1> rangePresent = std::bitset<1> (it2->physCellIdRange.haveRange);
1103  SerializeSequence (rangePresent,false);
1104  SerializeInteger (it2->physCellIdRange.start,0,503);
1105  if (it2->physCellIdRange.haveRange)
1106  {
1107  switch (it2->physCellIdRange.range)
1108  {
1109  case 4:
1110  SerializeEnum (16, 0);
1111  break;
1112  case 8:
1113  SerializeEnum (16, 1);
1114  break;
1115  case 12:
1116  SerializeEnum (16, 2);
1117  break;
1118  case 16:
1119  SerializeEnum (16, 3);
1120  break;
1121  case 24:
1122  SerializeEnum (16, 4);
1123  break;
1124  case 32:
1125  SerializeEnum (16, 5);
1126  break;
1127  case 48:
1128  SerializeEnum (16, 6);
1129  break;
1130  case 64:
1131  SerializeEnum (16, 7);
1132  break;
1133  case 84:
1134  SerializeEnum (16, 8);
1135  break;
1136  case 96:
1137  SerializeEnum (16, 9);
1138  break;
1139  case 128:
1140  SerializeEnum (16, 10);
1141  break;
1142  case 168:
1143  SerializeEnum (16, 11);
1144  break;
1145  case 252:
1146  SerializeEnum (16, 12);
1147  break;
1148  case 504:
1149  SerializeEnum (16, 13);
1150  break;
1151  default:
1152  SerializeEnum (16, 0);
1153  }
1154  }
1155  }
1156 
1157  }
1158 
1159  if (it->measObjectEutra.haveCellForWhichToReportCGI)
1160  {
1161  SerializeInteger (it->measObjectEutra.cellForWhichToReportCGI,0,503);
1162  }
1163  }
1164  }
1165 
1166 
1167  if (!measConfig.reportConfigToRemoveList.empty () )
1168  {
1170  for (std::list<uint8_t>::iterator it = measConfig.reportConfigToRemoveList.begin (); it != measConfig.reportConfigToRemoveList.end (); it++)
1171  {
1173  }
1174  }
1175 
1176  if (!measConfig.reportConfigToAddModList.empty () )
1177  {
1179  for (std::list<LteRrcSap::ReportConfigToAddMod>::iterator it = measConfig.reportConfigToAddModList.begin (); it != measConfig.reportConfigToAddModList.end (); it++)
1180  {
1181  SerializeSequence (std::bitset<0> (), false);
1182  SerializeInteger (it->reportConfigId,1,MAX_REPORT_CONFIG_ID);
1183  SerializeChoice (2,0,false); // reportConfigEUTRA
1184 
1185  // Serialize ReportConfigEUTRA
1186  SerializeSequence (std::bitset<0> (), true);
1187  switch (it->reportConfigEutra.triggerType)
1188  {
1190  SerializeChoice (2, 1, false);
1191  SerializeSequence (std::bitset<0> (),false);
1192  switch (it->reportConfigEutra.purpose)
1193  {
1195  SerializeEnum (2,1);
1196  break;
1198  default:
1199  SerializeEnum (2,0);
1200  }
1201  break;
1203  default:
1204  SerializeChoice (2, 0, false);
1205  SerializeSequence (std::bitset<0> (),false);
1206  switch (it->reportConfigEutra.eventId)
1207  {
1209  SerializeChoice (5, 0, true);
1210  SerializeSequence (std::bitset<0> (),false);
1211  SerializeThresholdEutra (it->reportConfigEutra.threshold1);
1212  break;
1214  SerializeChoice (5, 1, true);
1215  SerializeSequence (std::bitset<0> (),false);
1216  SerializeThresholdEutra (it->reportConfigEutra.threshold1);
1217  break;
1219  SerializeChoice (5, 2, true);
1220  SerializeSequence (std::bitset<0> (),false);
1221  SerializeInteger (it->reportConfigEutra.a3Offset,-30,30);
1222  SerializeBoolean (it->reportConfigEutra.reportOnLeave);
1223  break;
1225  SerializeChoice (5, 3, true);
1226  SerializeSequence (std::bitset<0> (),false);
1227  SerializeThresholdEutra (it->reportConfigEutra.threshold1);
1228  break;
1230  default:
1231  SerializeChoice (5, 4, true);
1232  SerializeSequence (std::bitset<0> (),false);
1233  SerializeThresholdEutra (it->reportConfigEutra.threshold1);
1234  SerializeThresholdEutra (it->reportConfigEutra.threshold2);
1235  }
1236 
1237  SerializeInteger (it->reportConfigEutra.hysteresis, 0, 30);
1238 
1239  switch (it->reportConfigEutra.timeToTrigger)
1240  {
1241  case 0:
1242  SerializeEnum (16, 0);
1243  break;
1244  case 40:
1245  SerializeEnum (16, 1);
1246  break;
1247  case 64:
1248  SerializeEnum (16, 2);
1249  break;
1250  case 80:
1251  SerializeEnum (16, 3);
1252  break;
1253  case 100:
1254  SerializeEnum (16, 4);
1255  break;
1256  case 128:
1257  SerializeEnum (16, 5);
1258  break;
1259  case 160:
1260  SerializeEnum (16, 6);
1261  break;
1262  case 256:
1263  SerializeEnum (16, 7);
1264  break;
1265  case 320:
1266  SerializeEnum (16, 8);
1267  break;
1268  case 480:
1269  SerializeEnum (16, 9);
1270  break;
1271  case 512:
1272  SerializeEnum (16, 10);
1273  break;
1274  case 640:
1275  SerializeEnum (16, 11);
1276  break;
1277  case 1024:
1278  SerializeEnum (16, 12);
1279  break;
1280  case 1280:
1281  SerializeEnum (16, 13);
1282  break;
1283  case 2560:
1284  SerializeEnum (16, 14);
1285  break;
1286  case 5120:
1287  default:
1288  SerializeEnum (16, 15);
1289  }
1290  } // end trigger type
1291 
1292  // Serialize triggerQuantity
1293  if (it->reportConfigEutra.triggerQuantity == LteRrcSap::ReportConfigEutra::RSRP)
1294  {
1295  SerializeEnum (2, 0);
1296  }
1297  else
1298  {
1299  SerializeEnum (2, 1);
1300  }
1301 
1302  // Serialize reportQuantity
1303  if (it->reportConfigEutra.reportQuantity == LteRrcSap::ReportConfigEutra::SAME_AS_TRIGGER_QUANTITY)
1304  {
1305  SerializeEnum (2, 0);
1306  }
1307  else
1308  {
1309  SerializeEnum (2, 1);
1310  }
1311 
1312  // Serialize maxReportCells
1313  SerializeInteger (it->reportConfigEutra.maxReportCells, 1, MAX_CELL_REPORT);
1314 
1315  // Serialize reportInterval
1316  switch (it->reportConfigEutra.reportInterval)
1317  {
1319  SerializeEnum (16, 0);
1320  break;
1322  SerializeEnum (16, 1);
1323  break;
1325  SerializeEnum (16, 2);
1326  break;
1328  SerializeEnum (16, 3);
1329  break;
1331  SerializeEnum (16, 4);
1332  break;
1334  SerializeEnum (16, 5);
1335  break;
1337  SerializeEnum (16, 6);
1338  break;
1340  SerializeEnum (16, 7);
1341  break;
1343  SerializeEnum (16, 8);
1344  break;
1346  SerializeEnum (16, 9);
1347  break;
1349  SerializeEnum (16, 10);
1350  break;
1352  SerializeEnum (16, 11);
1353  break;
1355  SerializeEnum (16, 12);
1356  break;
1358  SerializeEnum (16, 13);
1359  break;
1361  SerializeEnum (16, 14);
1362  break;
1364  default:
1365  SerializeEnum (16, 15);
1366  }
1367 
1368  // Serialize reportAmount
1369  switch (it->reportConfigEutra.reportAmount)
1370  {
1371  case 1:
1372  SerializeEnum (8, 0);
1373  break;
1374  case 2:
1375  SerializeEnum (8, 1);
1376  break;
1377  case 4:
1378  SerializeEnum (8, 2);
1379  break;
1380  case 8:
1381  SerializeEnum (8, 3);
1382  break;
1383  case 16:
1384  SerializeEnum (8, 4);
1385  break;
1386  case 32:
1387  SerializeEnum (8, 5);
1388  break;
1389  case 64:
1390  SerializeEnum (8, 6);
1391  break;
1392  default:
1393  SerializeEnum (8, 7);
1394  }
1395  }
1396  }
1397 
1398  if (!measConfig.measIdToRemoveList.empty () )
1399  {
1400  SerializeSequenceOf (measConfig.measIdToRemoveList.size (), MAX_MEAS_ID, 1);
1401  for (std::list<uint8_t>::iterator it = measConfig.measIdToRemoveList.begin (); it != measConfig.measIdToRemoveList.end (); it++)
1402  {
1403  SerializeInteger (*it, 1, MAX_MEAS_ID);
1404  }
1405  }
1406 
1407  if (!measConfig.measIdToAddModList.empty () )
1408  {
1409  SerializeSequenceOf ( measConfig.measIdToAddModList.size (), MAX_MEAS_ID, 1);
1410  for (std::list<LteRrcSap::MeasIdToAddMod>::iterator it = measConfig.measIdToAddModList.begin (); it != measConfig.measIdToAddModList.end (); it++)
1411  {
1412  SerializeInteger (it->measId, 1, MAX_MEAS_ID);
1413  SerializeInteger (it->measObjectId, 1, MAX_OBJECT_ID);
1414  SerializeInteger (it->reportConfigId, 1, MAX_REPORT_CONFIG_ID);
1415  }
1416  }
1417 
1418  if (measConfig.haveQuantityConfig )
1419  {
1420  // QuantityConfig sequence
1421  // 4 optional fields, only first (EUTRA) present. Extension marker yes.
1422  std::bitset<4> quantityConfigOpts (0);
1423  quantityConfigOpts.set (3,1);
1424  SerializeSequence (quantityConfigOpts, true);
1425  SerializeSequence (std::bitset<0> (), false);
1426 
1427  switch (measConfig.quantityConfig.filterCoefficientRSRP)
1428  {
1429  case 0:
1430  SerializeEnum (16, 0);
1431  break;
1432  case 1:
1433  SerializeEnum (16, 1);
1434  break;
1435  case 2:
1436  SerializeEnum (16, 2);
1437  break;
1438  case 3:
1439  SerializeEnum (16, 3);
1440  break;
1441  case 4:
1442  SerializeEnum (16, 4);
1443  break;
1444  case 5:
1445  SerializeEnum (16, 5);
1446  break;
1447  case 6:
1448  SerializeEnum (16, 6);
1449  break;
1450  case 7:
1451  SerializeEnum (16, 7);
1452  break;
1453  case 8:
1454  SerializeEnum (16, 8);
1455  break;
1456  case 9:
1457  SerializeEnum (16, 9);
1458  break;
1459  case 11:
1460  SerializeEnum (16, 10);
1461  break;
1462  case 13:
1463  SerializeEnum (16, 11);
1464  break;
1465  case 15:
1466  SerializeEnum (16, 12);
1467  break;
1468  case 17:
1469  SerializeEnum (16, 13);
1470  break;
1471  case 19:
1472  SerializeEnum (16, 14);
1473  break;
1474  default:
1475  SerializeEnum (16, 4);
1476  }
1477 
1478  switch (measConfig.quantityConfig.filterCoefficientRSRQ)
1479  {
1480  case 0:
1481  SerializeEnum (16, 0);
1482  break;
1483  case 1:
1484  SerializeEnum (16, 1);
1485  break;
1486  case 2:
1487  SerializeEnum (16, 2);
1488  break;
1489  case 3:
1490  SerializeEnum (16, 3);
1491  break;
1492  case 4:
1493  SerializeEnum (16, 4);
1494  break;
1495  case 5:
1496  SerializeEnum (16, 5);
1497  break;
1498  case 6:
1499  SerializeEnum (16, 6);
1500  break;
1501  case 7:
1502  SerializeEnum (16, 7);
1503  break;
1504  case 8:
1505  SerializeEnum (16, 8);
1506  break;
1507  case 9:
1508  SerializeEnum (16, 9);
1509  break;
1510  case 11:
1511  SerializeEnum (16, 10);
1512  break;
1513  case 13:
1514  SerializeEnum (16, 11);
1515  break;
1516  case 15:
1517  SerializeEnum (16, 12);
1518  break;
1519  case 17:
1520  SerializeEnum (16, 13);
1521  break;
1522  case 19:
1523  SerializeEnum (16, 14);
1524  break;
1525  default:
1526  SerializeEnum (16, 4);
1527  }
1528  }
1529 
1530  if (measConfig.haveMeasGapConfig )
1531  {
1532  switch (measConfig.measGapConfig.type)
1533  {
1535  SerializeChoice (2, 0, false);
1536  SerializeNull ();
1537  break;
1539  default:
1540  SerializeChoice (2, 1, false);
1541  SerializeSequence (std::bitset<0> (),false);
1542  switch (measConfig.measGapConfig.gapOffsetChoice)
1543  {
1545  SerializeChoice (2, 0, true);
1546  SerializeInteger (measConfig.measGapConfig.gapOffsetValue, 0, 39);
1547  break;
1549  default:
1550  SerializeChoice (2, 1, true);
1551  SerializeInteger (measConfig.measGapConfig.gapOffsetValue, 0, 79);
1552  }
1553  }
1554  }
1555 
1556  if (measConfig.haveSmeasure )
1557  {
1558  SerializeInteger (measConfig.sMeasure, 0, 97);
1559  }
1560 
1561  // ...Here preRegistrationInfoHRPD would be serialized
1562 
1563  if (measConfig.haveSpeedStatePars )
1564  {
1565  switch (measConfig.speedStatePars.type)
1566  {
1568  SerializeChoice (2, 0, false);
1569  SerializeNull ();
1570  break;
1572  default:
1573  SerializeChoice (2, 1, false);
1574  SerializeSequence (std::bitset<0> (), false);
1576  {
1577  case 30:
1578  SerializeEnum (8, 0);
1579  break;
1580  case 60:
1581  SerializeEnum (8, 1);
1582  break;
1583  case 120:
1584  SerializeEnum (8, 2);
1585  break;
1586  case 180:
1587  SerializeEnum (8, 3);
1588  break;
1589  case 240:
1590  SerializeEnum (8, 4);
1591  break;
1592  default:
1593  SerializeEnum (8, 5);
1594  break;
1595  }
1596 
1598  {
1599  case 30:
1600  SerializeEnum (8, 0);
1601  break;
1602  case 60:
1603  SerializeEnum (8, 1);
1604  break;
1605  case 120:
1606  SerializeEnum (8, 2);
1607  break;
1608  case 180:
1609  SerializeEnum (8, 3);
1610  break;
1611  case 240:
1612  SerializeEnum (8, 4);
1613  break;
1614  default:
1615  SerializeEnum (8, 5);
1616  break;
1617  }
1618 
1621 
1622  SerializeSequence (std::bitset<0> (), false);
1623  switch (measConfig.speedStatePars.timeToTriggerSf.sfMedium)
1624  {
1625  case 25:
1626  SerializeEnum (4, 0);
1627  break;
1628  case 50:
1629  SerializeEnum (4, 1);
1630  break;
1631  case 75:
1632  SerializeEnum (4, 2);
1633  break;
1634  case 100:
1635  default:
1636  SerializeEnum (4, 3);
1637  }
1638 
1639  switch (measConfig.speedStatePars.timeToTriggerSf.sfHigh)
1640  {
1641  case 25:
1642  SerializeEnum (4, 0);
1643  break;
1644  case 50:
1645  SerializeEnum (4, 1);
1646  break;
1647  case 75:
1648  SerializeEnum (4, 2);
1649  break;
1650  case 100:
1651  default:
1652  SerializeEnum (4, 3);
1653  }
1654  }
1655  }
1656 }
1657 
1660 {
1661  int thresholdEutraChoice, range;
1662  bIterator = DeserializeChoice (2, false, &thresholdEutraChoice, bIterator);
1663 
1664  switch (thresholdEutraChoice)
1665  {
1666  case 0:
1668  bIterator = DeserializeInteger (&range, 0, 97, bIterator);
1669  thresholdEutra->range = range;
1670  break;
1671  case 1:
1672  default:
1674  bIterator = DeserializeInteger (&range, 0, 34, bIterator);
1675  thresholdEutra->range = range;
1676  }
1677 
1678  return bIterator;
1679 }
1680 
1683 {
1684  int n;
1685  bIterator = DeserializeEnum (31, &n, bIterator);
1686  switch (n)
1687  {
1688  case 0:
1689  *qOffsetRange = -24;
1690  break;
1691  case 1:
1692  *qOffsetRange = -22;
1693  break;
1694  case 2:
1695  *qOffsetRange = -20;
1696  break;
1697  case 3:
1698  *qOffsetRange = -18;
1699  break;
1700  case 4:
1701  *qOffsetRange = -16;
1702  break;
1703  case 5:
1704  *qOffsetRange = -14;
1705  break;
1706  case 6:
1707  *qOffsetRange = -12;
1708  break;
1709  case 7:
1710  *qOffsetRange = -10;
1711  break;
1712  case 8:
1713  *qOffsetRange = -8;
1714  break;
1715  case 9:
1716  *qOffsetRange = -6;
1717  break;
1718  case 10:
1719  *qOffsetRange = -5;
1720  break;
1721  case 11:
1722  *qOffsetRange = -4;
1723  break;
1724  case 12:
1725  *qOffsetRange = -3;
1726  break;
1727  case 13:
1728  *qOffsetRange = -2;
1729  break;
1730  case 14:
1731  *qOffsetRange = -1;
1732  break;
1733  case 15:
1734  *qOffsetRange = 0;
1735  break;
1736  case 16:
1737  *qOffsetRange = 1;
1738  break;
1739  case 17:
1740  *qOffsetRange = 2;
1741  break;
1742  case 18:
1743  *qOffsetRange = 3;
1744  break;
1745  case 19:
1746  *qOffsetRange = 4;
1747  break;
1748  case 20:
1749  *qOffsetRange = 5;
1750  break;
1751  case 21:
1752  *qOffsetRange = 6;
1753  break;
1754  case 22:
1755  *qOffsetRange = 8;
1756  break;
1757  case 23:
1758  *qOffsetRange = 10;
1759  break;
1760  case 24:
1761  *qOffsetRange = 12;
1762  break;
1763  case 25:
1764  *qOffsetRange = 14;
1765  break;
1766  case 26:
1767  *qOffsetRange = 16;
1768  break;
1769  case 27:
1770  *qOffsetRange = 18;
1771  break;
1772  case 28:
1773  *qOffsetRange = 20;
1774  break;
1775  case 29:
1776  *qOffsetRange = 22;
1777  break;
1778  case 30:
1779  default:
1780  *qOffsetRange = 24;
1781  }
1782  return bIterator;
1783 }
1784 
1787 {
1788  // Deserialize RadioResourceConfigDedicated sequence
1789  std::bitset<6> optionalFieldsPresent = std::bitset<6> ();
1790  bIterator = DeserializeSequence (&optionalFieldsPresent,true,bIterator);
1791 
1792  if (optionalFieldsPresent[5])
1793  {
1794  // Deserialize srb-ToAddModList
1795  bIterator = DeserializeSrbToAddModList (&(radioResourceConfigDedicated->srbToAddModList),bIterator);
1796  }
1797 
1798  if (optionalFieldsPresent[4])
1799  {
1800  // Deserialize drb-ToAddModList
1801  bIterator = DeserializeDrbToAddModList (&(radioResourceConfigDedicated->drbToAddModList),bIterator);
1802  }
1803 
1804  if (optionalFieldsPresent[3])
1805  {
1806  // Deserialize drb-ToReleaseList
1807  int n;
1808  int val;
1809  bIterator = DeserializeSequenceOf (&n,MAX_DRB,1,bIterator);
1810  for (int i = 0; i < n; i++)
1811  {
1812  bIterator = DeserializeInteger (&val,1,32,bIterator);
1813  radioResourceConfigDedicated->drbToReleaseList.push_back (val);
1814  }
1815  }
1816 
1817  if (optionalFieldsPresent[2])
1818  {
1819  // Deserialize mac-MainConfig
1820  // ...
1821  }
1822 
1823  if (optionalFieldsPresent[1])
1824  {
1825  // Deserialize sps-Config
1826  // ...
1827  }
1828 
1829  radioResourceConfigDedicated->havePhysicalConfigDedicated = optionalFieldsPresent[0];
1830  if (optionalFieldsPresent[0])
1831  {
1832  // Deserialize physicalConfigDedicated
1833  bIterator = DeserializePhysicalConfigDedicated (&radioResourceConfigDedicated->physicalConfigDedicated,bIterator);
1834  }
1835 
1836  return bIterator;
1837 }
1838 
1840 RrcAsn1Header::DeserializeSrbToAddModList (std::list<LteRrcSap::SrbToAddMod> *srbToAddModList, Buffer::Iterator bIterator)
1841 {
1842  int numElems;
1843  bIterator = DeserializeSequenceOf (&numElems,2,1,bIterator);
1844 
1845  srbToAddModList->clear ();
1846 
1847  // Deserialize SRB-ToAddMod elements
1848  for (int i = 0; i < numElems; i++)
1849  {
1850  LteRrcSap::SrbToAddMod srbToAddMod;
1851  // Deserialize SRB-ToAddMod sequence
1852  // 2 optional fields, extension marker present
1853  std::bitset<2> optionalFields;
1854  bIterator = DeserializeSequence (&optionalFields,true,bIterator);
1855 
1856  // Deserialize srbIdentity
1857  int n;
1858  bIterator = DeserializeInteger (&n,1,2,bIterator);
1859  srbToAddMod.srbIdentity = n;
1860 
1861  if (optionalFields[1])
1862  {
1863  // Deserialize rlcConfig choice
1864  // ...
1865  }
1866 
1867  if (optionalFields[0])
1868  {
1869  // Deserialize logicalChannelConfig choice
1870  int sel;
1871  bIterator = DeserializeChoice (2,false,&sel,bIterator);
1872 
1873  // Deserialize logicalChannelConfig defaultValue
1874  if (sel == 1)
1875  {
1876  bIterator = DeserializeNull (bIterator);
1877  }
1878 
1879  // Deserialize logicalChannelConfig explicitValue
1880  else if (sel == 0)
1881  {
1882  bIterator = DeserializeLogicalChannelConfig (&srbToAddMod.logicalChannelConfig,bIterator);
1883  }
1884  }
1885  srbToAddModList->insert (srbToAddModList->end (),srbToAddMod);
1886  }
1887 
1888  return bIterator;
1889 }
1890 
1892 RrcAsn1Header::DeserializeDrbToAddModList (std::list<LteRrcSap::DrbToAddMod> *drbToAddModList, Buffer::Iterator bIterator)
1893 {
1894  int n;
1895  int val;
1896  bIterator = DeserializeSequenceOf (&n,MAX_DRB,1,bIterator);
1897 
1898  drbToAddModList->clear ();
1899 
1900  for (int i = 0; i < n; i++)
1901  {
1902  LteRrcSap::DrbToAddMod drbToAddMod;
1903 
1904  std::bitset<5> optionalFields;
1905  bIterator = DeserializeSequence (&optionalFields,true,bIterator);
1906 
1907  if (optionalFields[4])
1908  {
1909  // Deserialize epsBearerIdentity
1910  bIterator = DeserializeInteger (&val,0,15,bIterator);
1911  drbToAddMod.epsBearerIdentity = val;
1912  }
1913 
1914  bIterator = DeserializeInteger (&val,1,32,bIterator);
1915  drbToAddMod.drbIdentity = val;
1916 
1917  if (optionalFields[3])
1918  {
1919  // Deserialize pdcp-Config
1920  // ...
1921  }
1922 
1923  if (optionalFields[2])
1924  {
1925  // Deserialize RLC-Config
1926  int chosen;
1927  bIterator = DeserializeChoice (4,true,&chosen,bIterator);
1928 
1929  int sel;
1930  std::bitset<0> bitset0;
1931  switch (chosen)
1932  {
1933  case 0:
1935 
1936  // Deserialize UL-AM-RLC
1937  bIterator = DeserializeSequence (&bitset0,false, bIterator);
1938  bIterator = DeserializeEnum (64,&sel, bIterator); // t-PollRetransmit
1939  bIterator = DeserializeEnum (8,&sel, bIterator); // pollPDU
1940  bIterator = DeserializeEnum (16,&sel, bIterator); // pollByte
1941  bIterator = DeserializeEnum (8,&sel, bIterator); // maxRetxThreshold
1942 
1943  // Deserialize DL-AM-RLC
1944  bIterator = DeserializeSequence (&bitset0,false, bIterator);
1945  bIterator = DeserializeEnum (32,&sel, bIterator); // t-Reordering
1946  bIterator = DeserializeEnum (64,&sel, bIterator); // t-StatusProhibit
1947  break;
1948 
1949  case 1:
1951 
1952  // Deserialize UL-UM-RLC
1953  bIterator = DeserializeSequence (&bitset0,false, bIterator);
1954  bIterator = DeserializeEnum (2,&sel, bIterator); // sn-FieldLength
1955 
1956  // Deserialize DL-UM-RLC
1957  bIterator = DeserializeSequence (&bitset0,false, bIterator);
1958  bIterator = DeserializeEnum (2,&sel, bIterator); // sn-FieldLength
1959  bIterator = DeserializeEnum (32,&sel, bIterator); // t-Reordering
1960  break;
1961 
1962  case 2:
1964 
1965  // Deserialize UL-UM-RLC
1966  bIterator = DeserializeSequence (&bitset0,false, bIterator);
1967  bIterator = DeserializeEnum (2,&sel, bIterator); // sn-FieldLength
1968  break;
1969 
1970  case 3:
1972 
1973  // Deserialize DL-UM-RLC
1974  bIterator = DeserializeSequence (&bitset0,false, bIterator);
1975  bIterator = DeserializeEnum (2,&sel, bIterator); // sn-FieldLength
1976  bIterator = DeserializeEnum (32,&sel, bIterator); // t-Reordering
1977  break;
1978  }
1979 
1980  }
1981 
1982  if (optionalFields[1])
1983  {
1984  bIterator = DeserializeInteger (&val,3,10,bIterator);
1985  drbToAddMod.logicalChannelIdentity = val;
1986  }
1987 
1988  if (optionalFields[0])
1989  {
1990  bIterator = DeserializeLogicalChannelConfig (&drbToAddMod.logicalChannelConfig,bIterator);
1991  }
1992 
1993  drbToAddModList->insert (drbToAddModList->end (),drbToAddMod);
1994  }
1995  return bIterator;
1996 }
1997 
2000 {
2001  int n;
2002 
2003  // Deserialize LogicalChannelConfig sequence
2004  // 1 optional field, extension marker is present.
2005  std::bitset<1> bitset1;
2006  bIterator = DeserializeSequence (&bitset1,true,bIterator);
2007 
2008  if (bitset1[0])
2009  {
2010  // Deserialize ul-SpecificParameters sequence
2011  bIterator = DeserializeSequence (&bitset1,false,bIterator);
2012 
2013  // Deserialize priority
2014  bIterator = DeserializeInteger (&n,1,16,bIterator);
2015  logicalChannelConfig->priority = n;
2016 
2017  // Deserialize prioritisedBitRate
2018  bIterator = DeserializeEnum (16,&n,bIterator);
2019  uint16_t prioritizedBitRateKbps;
2020 
2021  switch (n)
2022  {
2023  case 0:
2024  prioritizedBitRateKbps = 0;
2025  break;
2026  case 1:
2027  prioritizedBitRateKbps = 8;
2028  break;
2029  case 2:
2030  prioritizedBitRateKbps = 16;
2031  break;
2032  case 3:
2033  prioritizedBitRateKbps = 32;
2034  break;
2035  case 4:
2036  prioritizedBitRateKbps = 64;
2037  break;
2038  case 5:
2039  prioritizedBitRateKbps = 128;
2040  break;
2041  case 6:
2042  prioritizedBitRateKbps = 256;
2043  break;
2044  case 7:
2045  prioritizedBitRateKbps = 10000;
2046  break;
2047  default:
2048  prioritizedBitRateKbps = 10000;
2049  }
2050  logicalChannelConfig->prioritizedBitRateKbps = prioritizedBitRateKbps;
2051 
2052  // Deserialize bucketSizeDuration
2053  bIterator = DeserializeEnum (8,&n,bIterator);
2054  uint16_t bucketSizeDurationMs;
2055  switch (n)
2056  {
2057  case 0:
2058  bucketSizeDurationMs = 50;
2059  break;
2060  case 1:
2061  bucketSizeDurationMs = 100;
2062  break;
2063  case 2:
2064  bucketSizeDurationMs = 150;
2065  break;
2066  case 3:
2067  bucketSizeDurationMs = 300;
2068  break;
2069  case 4:
2070  bucketSizeDurationMs = 500;
2071  break;
2072  case 5:
2073  bucketSizeDurationMs = 1000;
2074  break;
2075  default:
2076  bucketSizeDurationMs = 1000;
2077  }
2078  logicalChannelConfig->bucketSizeDurationMs = bucketSizeDurationMs;
2079 
2080  if (bitset1[0])
2081  {
2082  // Deserialize logicalChannelGroup
2083  bIterator = DeserializeInteger (&n,0,3,bIterator);
2084  logicalChannelConfig->logicalChannelGroup = n;
2085  }
2086  }
2087  return bIterator;
2088 }
2089 
2092 {
2093  std::bitset<10> optionalFieldPresent;
2094  bIterator = DeserializeSequence (&optionalFieldPresent,true,bIterator);
2095 
2096  if (optionalFieldPresent[9])
2097  {
2098  // Deserialize pdsch-ConfigDedicated
2099  // ...
2100  }
2101  if (optionalFieldPresent[8])
2102  {
2103  // Deserialize pucch-ConfigDedicated
2104  // ...
2105  }
2106  if (optionalFieldPresent[7])
2107  {
2108  // Deserialize pusch-ConfigDedicated
2109  // ...
2110  }
2111  if (optionalFieldPresent[6])
2112  {
2113  // Deserialize uplinkPowerControlDedicated
2114  // ...
2115  }
2116  if (optionalFieldPresent[5])
2117  {
2118  // Deserialize tpc-PDCCH-ConfigPUCCH
2119  // ...
2120  }
2121  if (optionalFieldPresent[4])
2122  {
2123  // Deserialize tpc-PDCCH-ConfigPUSCH
2124  // ...
2125  }
2126  if (optionalFieldPresent[3])
2127  {
2128  // Deserialize cqi-ReportConfig
2129  // ...
2130  }
2131  physicalConfigDedicated->haveSoundingRsUlConfigDedicated = optionalFieldPresent[2];
2132  if (optionalFieldPresent[2])
2133  {
2134  // Deserialize soundingRS-UL-ConfigDedicated
2135  int sel;
2136  bIterator = DeserializeChoice (2,false,&sel,bIterator);
2137 
2138  if (sel == 0)
2139  {
2141 
2142  bIterator = DeserializeNull (bIterator);
2143  }
2144 
2145  else if (sel == 1)
2146  {
2148 
2149  std::bitset<0> bitset0;
2150  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2151 
2152  int slct;
2153 
2154  // Deserialize srs-Bandwidth
2155  bIterator = DeserializeEnum (4,&slct,bIterator);
2156  physicalConfigDedicated->soundingRsUlConfigDedicated.srsBandwidth = slct;
2157 
2158  // Deserialize srs-HoppingBandwidth
2159  bIterator = DeserializeEnum (4,&slct,bIterator);
2160 
2161  // Deserialize freqDomainPosition
2162  bIterator = DeserializeInteger (&slct,0,23,bIterator);
2163 
2164  // Deserialize duration
2165  bool duration;
2166  bIterator = DeserializeBoolean (&duration,bIterator);
2167 
2168  // Deserialize srs-ConfigIndex
2169  bIterator = DeserializeInteger (&slct,0,1023,bIterator);
2170  physicalConfigDedicated->soundingRsUlConfigDedicated.srsConfigIndex = slct;
2171 
2172  // Deserialize transmissionComb
2173  bIterator = DeserializeInteger (&slct,0,1,bIterator);
2174 
2175  // Deserialize cyclicShift
2176  bIterator = DeserializeEnum (8,&slct,bIterator);
2177  }
2178  }
2179  physicalConfigDedicated->haveAntennaInfoDedicated = optionalFieldPresent[1];
2180  if (optionalFieldPresent[1])
2181  {
2182  // Deserialize antennaInfo
2183  int sel;
2184  bIterator = DeserializeChoice (2,false,&sel,bIterator);
2185  if (sel == 1)
2186  {
2187  bIterator = DeserializeNull (bIterator);
2188  }
2189  else if (sel == 0)
2190  {
2191  std::bitset<1> codebookSubsetRestrictionPresent;
2192  bIterator = DeserializeSequence (&codebookSubsetRestrictionPresent,false,bIterator);
2193 
2194  int txmode;
2195  bIterator = DeserializeEnum (8,&txmode,bIterator);
2196  physicalConfigDedicated->antennaInfo.transmissionMode = txmode;
2197 
2198  if (codebookSubsetRestrictionPresent[0])
2199  {
2200  // Deserialize codebookSubsetRestriction
2201  // ...
2202  }
2203 
2204  int txantennaselchosen;
2205  bIterator = DeserializeChoice (2,false,&txantennaselchosen,bIterator);
2206  if (txantennaselchosen == 0)
2207  {
2208  // Deserialize ue-TransmitAntennaSelection release
2209  bIterator = DeserializeNull (bIterator);
2210  }
2211  else if (txantennaselchosen == 1)
2212  {
2213  // Deserialize ue-TransmitAntennaSelection setup
2214  // ...
2215  }
2216  }
2217  }
2218  if (optionalFieldPresent[0])
2219  {
2220  // Deserialize schedulingRequestConfig
2221  // ...
2222  }
2223  return bIterator;
2224 }
2225 
2226 void
2227 RrcAsn1Header::Print (std::ostream &os) const
2228 {
2229  NS_LOG_FUNCTION (this << &os);
2230  NS_FATAL_ERROR ("RrcAsn1Header Print() function must also specify LteRrcSap::RadioResourceConfigDedicated as a second argument");
2231 }
2232 
2233 void
2234 RrcAsn1Header::Print (std::ostream &os, LteRrcSap::RadioResourceConfigDedicated radioResourceConfigDedicated) const
2235 {
2236  os << " srbToAddModList: " << std::endl;
2237  std::list<LteRrcSap::SrbToAddMod>::iterator it = radioResourceConfigDedicated.srbToAddModList.begin ();
2238  for (; it != radioResourceConfigDedicated.srbToAddModList.end (); it++)
2239  {
2240  os << " srbIdentity: " << (int)it->srbIdentity << std::endl;
2241  os << " logicalChannelConfig: " << std::endl;
2242  os << " priority: " << (int)it->logicalChannelConfig.priority << std::endl;
2243  os << " prioritizedBitRateKbps: " << (int)it->logicalChannelConfig.prioritizedBitRateKbps << std::endl;
2244  os << " bucketSizeDurationMs: " << (int)it->logicalChannelConfig.bucketSizeDurationMs << std::endl;
2245  os << " logicalChannelGroup: " << (int)it->logicalChannelConfig.logicalChannelGroup << std::endl;
2246  }
2247  os << std::endl;
2248 
2249  os << " drbToAddModList: " << std::endl;
2250  std::list<LteRrcSap::DrbToAddMod>::iterator it2 = radioResourceConfigDedicated.drbToAddModList.begin ();
2251  for (; it2 != radioResourceConfigDedicated.drbToAddModList.end (); it2++)
2252  {
2253  os << " epsBearerIdentity: " << (int)it2->epsBearerIdentity << std::endl;
2254  os << " drbIdentity: " << (int)it2->drbIdentity << std::endl;
2255  os << " rlcConfig: " << it2->rlcConfig.choice << std::endl;
2256  os << " logicalChannelIdentity: " << (int)it2->logicalChannelIdentity << std::endl;
2257  os << " logicalChannelConfig: " << std::endl;
2258  os << " priority: " << (int)it2->logicalChannelConfig.priority << std::endl;
2259  os << " prioritizedBitRateKbps: " << (int)it2->logicalChannelConfig.prioritizedBitRateKbps << std::endl;
2260  os << " bucketSizeDurationMs: " << (int)it2->logicalChannelConfig.bucketSizeDurationMs << std::endl;
2261  os << " logicalChannelGroup: " << (int)it2->logicalChannelConfig.logicalChannelGroup << std::endl;
2262  }
2263  os << std::endl;
2264 
2265  os << " drbToReleaseList: ";
2266  std::list<uint8_t>::iterator it3 = radioResourceConfigDedicated.drbToReleaseList.begin ();
2267  for (; it3 != radioResourceConfigDedicated.drbToReleaseList.end (); it3++)
2268  {
2269  os << (int)*it3 << ", ";
2270  }
2271  os << std::endl;
2272 
2273  os << " havePhysicalConfigDedicated: " << radioResourceConfigDedicated.havePhysicalConfigDedicated << std::endl;
2274 
2275  if (radioResourceConfigDedicated.havePhysicalConfigDedicated)
2276  {
2277  os << " physicalConfigDedicated: " << std::endl;
2278 
2279  os << " haveSoundingRsUlConfigDedicated: " << radioResourceConfigDedicated.physicalConfigDedicated.haveSoundingRsUlConfigDedicated << std::endl;
2280  if (radioResourceConfigDedicated.physicalConfigDedicated.haveSoundingRsUlConfigDedicated)
2281  {
2282  os << " soundingRsUlConfigDedicated: " << std::endl;
2283  os << " type: " << radioResourceConfigDedicated.physicalConfigDedicated.soundingRsUlConfigDedicated.type << std::endl;
2284  os << " srsBandwidth: " << (int)radioResourceConfigDedicated.physicalConfigDedicated.soundingRsUlConfigDedicated.srsBandwidth << std::endl;
2285  os << " srsConfigIndex: " << (int)radioResourceConfigDedicated.physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex << std::endl;
2286  }
2287 
2288  os << " haveAntennaInfoDedicated: " << radioResourceConfigDedicated.physicalConfigDedicated.haveAntennaInfoDedicated << std::endl;
2289  if (radioResourceConfigDedicated.physicalConfigDedicated.haveAntennaInfoDedicated)
2290  {
2291  os << " antennaInfo Tx mode: " << (int)radioResourceConfigDedicated.physicalConfigDedicated.antennaInfo.transmissionMode << std::endl;
2292  }
2293  }
2294 }
2295 
2298 {
2299  std::bitset<0> bitset0;
2300  int n;
2301 
2302  std::bitset<3> sysInfoBlkT1Opts;
2303  bIterator = DeserializeSequence (&sysInfoBlkT1Opts,false,bIterator);
2304 
2305  // Deserialize cellAccessRelatedInfo
2306  std::bitset<1> cellAccessRelatedInfoOpts;
2307  bIterator = DeserializeSequence (&cellAccessRelatedInfoOpts,false,bIterator);
2308 
2309  // Deserialize plmn-IdentityList
2310  int numPlmnIdentityInfoElements;
2311  bIterator = DeserializeSequenceOf (&numPlmnIdentityInfoElements,6,1,bIterator);
2312  for (int i = 0; i < numPlmnIdentityInfoElements; i++)
2313  {
2314  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2315 
2316  // plmn-Identity
2317  bIterator = DeserializePlmnIdentity (&systemInformationBlockType1->cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity,bIterator);
2318  }
2319 
2320  // Deserialize trackingAreaCode
2321  std::bitset<16> trackingAreaCode;
2322  bIterator = DeserializeBitstring (&trackingAreaCode,bIterator);
2323 
2324  // Deserialize cellIdentity
2325  std::bitset<28> cellIdentity;
2326  bIterator = DeserializeBitstring (&cellIdentity,bIterator);
2327  systemInformationBlockType1->cellAccessRelatedInfo.cellIdentity = cellIdentity.to_ulong ();
2328 
2329  // Deserialize cellBarred
2330  bIterator = DeserializeEnum (2,&n,bIterator);
2331 
2332  // Deserialize intraFreqReselection
2333  bIterator = DeserializeEnum (2,&n,bIterator);
2334 
2335  // Deserialize csg-Indication
2336  bIterator = DeserializeBoolean (&systemInformationBlockType1->cellAccessRelatedInfo.csgIndication,bIterator);
2337 
2338  if (cellAccessRelatedInfoOpts[0])
2339  {
2340  // Deserialize csg-Identity
2341  std::bitset<27> csgIdentity;
2342  bIterator = DeserializeBitstring (&csgIdentity,bIterator);
2343  systemInformationBlockType1->cellAccessRelatedInfo.csgIdentity = csgIdentity.to_ulong ();
2344  }
2345 
2346  // Deserialize cellSelectionInfo
2347  std::bitset<1> qRxLevMinOffsetPresent;
2348  bIterator = DeserializeSequence (&qRxLevMinOffsetPresent,false,bIterator);
2349  bIterator = DeserializeInteger (&n,-70,-22,bIterator); //q-RxLevMin
2350  if (qRxLevMinOffsetPresent[0])
2351  {
2352  // Deserialize qRxLevMinOffset
2353  // ...
2354  }
2355 
2356  if (sysInfoBlkT1Opts[2])
2357  {
2358  // Deserialize p-Max
2359  // ...
2360  }
2361 
2362  // freqBandIndicator
2363  bIterator = DeserializeInteger (&n,1,64,bIterator);
2364 
2365  // schedulingInfoList
2366  int numSchedulingInfo;
2367  bIterator = DeserializeSequenceOf (&numSchedulingInfo,MAX_SI_MESSAGE,1,bIterator);
2368  for (int i = 0; i < numSchedulingInfo; i++)
2369  {
2370  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2371  bIterator = DeserializeEnum (7,&n,bIterator); // si-Periodicity
2372  int numSibType;
2373  bIterator = DeserializeSequenceOf (&numSibType,MAX_SIB - 1,0, bIterator); // sib-MappingInfo
2374  for (int j = 0; j < numSibType; j++)
2375  {
2376  bIterator = DeserializeEnum (16,&n,bIterator); // SIB-Type
2377  }
2378  }
2379 
2380  if (sysInfoBlkT1Opts[1])
2381  {
2382  // tdd-Config
2383  // ...
2384  }
2385 
2386  // si-WindowLength
2387  bIterator = DeserializeEnum (7,&n,bIterator);
2388 
2389  // systemInfoValueTag
2390  bIterator = DeserializeInteger (&n,0,31,bIterator);
2391 
2392  if (sysInfoBlkT1Opts[0])
2393  {
2394  // Deserialize nonCriticalExtension
2395  // ...
2396  }
2397  return bIterator;
2398 }
2399 
2402 {
2403  std::bitset<0> bitset0;
2404  int n;
2405 
2406  std::bitset<2> sysInfoBlkT2Opts;
2407  bIterator = DeserializeSequence (&sysInfoBlkT2Opts,true,bIterator);
2408  if (sysInfoBlkT2Opts[1])
2409  {
2410  // Deserialize ac-BarringInfo
2411  // ...
2412  }
2413 
2414  // Deserialize radioResourceConfigCommon
2415  bIterator = DeserializeRadioResourceConfigCommonSib (&systemInformationBlockType2->radioResourceConfigCommon, bIterator);
2416 
2417  // Deserialize ue-TimersAndConstants
2418  bIterator = DeserializeSequence (&bitset0,true,bIterator);
2419  bIterator = DeserializeEnum (8,&n,bIterator); // t300
2420  bIterator = DeserializeEnum (8,&n,bIterator); // t301
2421  bIterator = DeserializeEnum (7,&n,bIterator); // t310
2422  bIterator = DeserializeEnum (8,&n,bIterator); // n310
2423  bIterator = DeserializeEnum (7,&n,bIterator); // t311
2424  bIterator = DeserializeEnum (8,&n,bIterator); // n311
2425 
2426  // Deserialize freqInfo
2427  std::bitset<2> freqInfoOpts;
2428  bIterator = DeserializeSequence (&freqInfoOpts,false,bIterator);
2429  if (freqInfoOpts[1])
2430  {
2431  // Deserialize ul-CarrierFreq
2432  bIterator = DeserializeInteger (&n, 0, MAX_EARFCN, bIterator);
2433  systemInformationBlockType2->freqInfo.ulCarrierFreq = n;
2434  }
2435  if (freqInfoOpts[0])
2436  {
2437  // Deserialize ul-Bandwidth
2438  bIterator = DeserializeEnum (6, &n, bIterator);
2439  switch (n)
2440  {
2441  case 0:
2442  systemInformationBlockType2->freqInfo.ulBandwidth = 6;
2443  break;
2444  case 1:
2445  systemInformationBlockType2->freqInfo.ulBandwidth = 15;
2446  break;
2447  case 2:
2448  systemInformationBlockType2->freqInfo.ulBandwidth = 25;
2449  break;
2450  case 3:
2451  systemInformationBlockType2->freqInfo.ulBandwidth = 50;
2452  break;
2453  case 4:
2454  systemInformationBlockType2->freqInfo.ulBandwidth = 75;
2455  break;
2456  case 5:
2457  systemInformationBlockType2->freqInfo.ulBandwidth = 100;
2458  break;
2459  default:
2460  systemInformationBlockType2->freqInfo.ulBandwidth = 6;
2461  }
2462  }
2463 
2464  // additionalSpectrumEmission
2465  bIterator = DeserializeInteger (&n,1,32,bIterator);
2466 
2467  if (sysInfoBlkT2Opts[0])
2468  {
2469  // Deserialize mbsfn-SubframeConfigList
2470  // ...
2471  }
2472 
2473  // Deserialize timeAlignmentTimerCommon
2474  bIterator = DeserializeEnum (8,&n,bIterator);
2475 
2476  return bIterator;
2477 }
2478 
2479 
2482 {
2483  std::bitset<0> bitset0;
2484  int n;
2485 
2486  std::bitset<9> rrCfgCommOptions;
2487  bIterator = DeserializeSequence (&rrCfgCommOptions,true,bIterator);
2488 
2489  // rach-ConfigCommon
2490  if (rrCfgCommOptions[8])
2491  {
2492  bIterator = DeserializeRachConfigCommon (&radioResourceConfigCommon->rachConfigCommon, bIterator);
2493  }
2494 
2495  // prach-Config
2496  std::bitset<1> prachConfigInfoPresent;
2497  bIterator = DeserializeSequence (&prachConfigInfoPresent,false,bIterator);
2498 
2499  // prach-Config -> rootSequenceIndex
2500  bIterator = DeserializeInteger (&n,0,1023,bIterator);
2501 
2502  // prach-Config -> prach-ConfigInfo
2503  if (prachConfigInfoPresent[0])
2504  {
2505  // ...
2506  }
2507 
2508  // pdsch-ConfigCommon
2509  if (rrCfgCommOptions[7])
2510  {
2511  // ...
2512  }
2513 
2514  // pusch-ConfigCommon
2515  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2516 
2517  // pusch-ConfigCommon -> pusch-ConfigBasic
2518  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2519 
2520  // pusch-ConfigCommon -> pusch-ConfigBasic -> n-SB
2521  bIterator = DeserializeInteger (&n,1,4,bIterator);
2522 
2523  // pusch-ConfigCommon -> pusch-ConfigBasic -> hoppingMode
2524  bIterator = DeserializeEnum (2,&n,bIterator);
2525 
2526  // pusch-ConfigCommon -> pusch-ConfigBasic -> pusch-HoppingOffset
2527  bIterator = DeserializeInteger (&n,0,98,bIterator);
2528 
2529  // pusch-ConfigCommon -> pusch-ConfigBasic -> enable64QAM
2530  bool enable64QAM;
2531  bIterator = DeserializeBoolean (&enable64QAM,bIterator);
2532 
2533  // ul-ReferenceSignalsPUSCH
2534  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2535 
2536  // groupHoppingEnabled
2537  bool dummyBool;
2538  bIterator = DeserializeBoolean (&dummyBool,bIterator);
2539 
2540  // groupAssignmentPUSCH
2541  bIterator = DeserializeInteger (&n,0,29,bIterator);
2542 
2543  // sequenceHoppingEnabled
2544  bIterator = DeserializeBoolean (&dummyBool,bIterator);
2545 
2546  // cyclicShift
2547  bIterator = DeserializeInteger (&n,0,7,bIterator);
2548 
2549  // phich-Config
2550  if (rrCfgCommOptions[6])
2551  {
2552  // ...
2553  }
2554 
2555  // pucch-ConfigCommon
2556  if (rrCfgCommOptions[5])
2557  {
2558  // ...
2559  }
2560 
2561  // soundingRS-UL-ConfigCommon
2562  if (rrCfgCommOptions[4])
2563  {
2564  // ...
2565  }
2566 
2567  // uplinkPowerControlCommon
2568  if (rrCfgCommOptions[3])
2569  {
2570  // ...
2571  }
2572 
2573  // antennaInfoCommon
2574  if (rrCfgCommOptions[2])
2575  {
2576  // ...
2577  }
2578 
2579  // p-Max
2580  if (rrCfgCommOptions[1])
2581  {
2582  // ...
2583  }
2584 
2585  // tdd-Config
2586  if (rrCfgCommOptions[0])
2587  {
2588  // ...
2589  }
2590 
2591  // ul-CyclicPrefixLength
2592  bIterator = DeserializeEnum (2,&n,bIterator);
2593 
2594  return bIterator;
2595 }
2596 
2599 {
2600  std::bitset<0> bitset0;
2601  int n;
2602 
2603  bIterator = DeserializeSequence (&bitset0,true,bIterator);
2604 
2605  // preambleInfo
2606  std::bitset<1> preamblesGroupAConfigPresent;
2607  bIterator = DeserializeSequence (&preamblesGroupAConfigPresent,false,bIterator);
2608 
2609  // numberOfRA-Preambles
2610  bIterator = DeserializeEnum (16,&n,bIterator);
2611  switch (n)
2612  {
2613  case 0:
2614  rachConfigCommon->preambleInfo.numberOfRaPreambles = 4;
2615  break;
2616  case 1:
2617  rachConfigCommon->preambleInfo.numberOfRaPreambles = 8;
2618  break;
2619  case 2:
2620  rachConfigCommon->preambleInfo.numberOfRaPreambles = 12;
2621  break;
2622  case 3:
2623  rachConfigCommon->preambleInfo.numberOfRaPreambles = 16;
2624  break;
2625  case 4:
2626  rachConfigCommon->preambleInfo.numberOfRaPreambles = 20;
2627  break;
2628  case 5:
2629  rachConfigCommon->preambleInfo.numberOfRaPreambles = 24;
2630  break;
2631  case 6:
2632  rachConfigCommon->preambleInfo.numberOfRaPreambles = 28;
2633  break;
2634  case 7:
2635  rachConfigCommon->preambleInfo.numberOfRaPreambles = 32;
2636  break;
2637  case 8:
2638  rachConfigCommon->preambleInfo.numberOfRaPreambles = 36;
2639  break;
2640  case 9:
2641  rachConfigCommon->preambleInfo.numberOfRaPreambles = 40;
2642  break;
2643  case 10:
2644  rachConfigCommon->preambleInfo.numberOfRaPreambles = 44;
2645  break;
2646  case 11:
2647  rachConfigCommon->preambleInfo.numberOfRaPreambles = 48;
2648  break;
2649  case 12:
2650  rachConfigCommon->preambleInfo.numberOfRaPreambles = 52;
2651  break;
2652  case 13:
2653  rachConfigCommon->preambleInfo.numberOfRaPreambles = 56;
2654  break;
2655  case 14:
2656  rachConfigCommon->preambleInfo.numberOfRaPreambles = 60;
2657  break;
2658  case 15:
2659  rachConfigCommon->preambleInfo.numberOfRaPreambles = 64;
2660  break;
2661  default:
2662  rachConfigCommon->preambleInfo.numberOfRaPreambles = 0;
2663  }
2664 
2665  rachConfigCommon->preambleInfo.numberOfRaPreambles = n;
2666 
2667  if (preamblesGroupAConfigPresent[0])
2668  {
2669  // Deserialize preamblesGroupAConfig
2670  // ...
2671  }
2672 
2673  // powerRampingParameters
2674  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2675  bIterator = DeserializeEnum (4,&n,bIterator); // powerRampingStep
2676  bIterator = DeserializeEnum (16,&n,bIterator); // preambleInitialReceivedTargetPower
2677 
2678  // ra-SupervisionInfo
2679  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2680  bIterator = DeserializeEnum (11,&n,bIterator); // preambleTransMax
2681  switch (n)
2682  {
2683  case 0:
2684  rachConfigCommon->raSupervisionInfo.preambleTransMax = 3;
2685  break;
2686  case 1:
2687  rachConfigCommon->raSupervisionInfo.preambleTransMax = 4;
2688  break;
2689  case 2:
2690  rachConfigCommon->raSupervisionInfo.preambleTransMax = 5;
2691  break;
2692  case 3:
2693  rachConfigCommon->raSupervisionInfo.preambleTransMax = 6;
2694  break;
2695  case 4:
2696  rachConfigCommon->raSupervisionInfo.preambleTransMax = 7;
2697  break;
2698  case 5:
2699  rachConfigCommon->raSupervisionInfo.preambleTransMax = 8;
2700  break;
2701  case 6:
2702  rachConfigCommon->raSupervisionInfo.preambleTransMax = 10;
2703  break;
2704  case 7:
2705  rachConfigCommon->raSupervisionInfo.preambleTransMax = 20;
2706  break;
2707  case 8:
2708  rachConfigCommon->raSupervisionInfo.preambleTransMax = 50;
2709  break;
2710  case 9:
2711  rachConfigCommon->raSupervisionInfo.preambleTransMax = 100;
2712  break;
2713  case 10:
2714  rachConfigCommon->raSupervisionInfo.preambleTransMax = 200;
2715  break;
2716  default:
2717  rachConfigCommon->raSupervisionInfo.preambleTransMax = 0;
2718  }
2719 
2720  // ra-ResponseWindowSize
2721  bIterator = DeserializeEnum (8,&n,bIterator);
2722  switch (n)
2723  {
2724  case 0:
2725  rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 2;
2726  break;
2727  case 1:
2728  rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 3;
2729  break;
2730  case 2:
2731  rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 4;
2732  break;
2733  case 3:
2734  rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 5;
2735  break;
2736  case 4:
2737  rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 6;
2738  break;
2739  case 5:
2740  rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 7;
2741  break;
2742  case 6:
2743  rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 8;
2744  break;
2745  case 7:
2746  rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 10;
2747  break;
2748  default:
2749  rachConfigCommon->raSupervisionInfo.raResponseWindowSize = 0;
2750  }
2751 
2752  bIterator = DeserializeEnum (8,&n,bIterator); // mac-ContentionResolutionTimer
2753  bIterator = DeserializeInteger (&n,1,8,bIterator); //maxHARQ-Msg3Tx
2754  return bIterator;
2755 }
2756 
2759 {
2760  std::bitset<0> bitset0;
2761  int n;
2762 
2763  bIterator = DeserializeSequence (&bitset0,true,bIterator);
2764 
2765  // rach-ConfigCommon
2766  bIterator = DeserializeRachConfigCommon (&radioResourceConfigCommonSib->rachConfigCommon, bIterator);
2767 
2768  // bcch-Config
2769  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2770  bIterator = DeserializeEnum (4,&n,bIterator); // modificationPeriodCoeff
2771 
2772  // pcch-Config
2773  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2774  bIterator = DeserializeEnum (4,&n,bIterator); // defaultPagingCycle
2775  bIterator = DeserializeEnum (8,&n,bIterator); // nB
2776 
2777  // prach-Config
2778  std::bitset<1> prachConfigInfoPresent;
2779  bIterator = DeserializeSequence (&prachConfigInfoPresent,false,bIterator);
2780  // prach-Config -> rootSequenceIndex
2781  bIterator = DeserializeInteger (&n,0,1023,bIterator);
2782  // prach-Config -> prach-ConfigInfo
2783  if (prachConfigInfoPresent[0])
2784  {
2785  // ...
2786  }
2787 
2788  // pdsch-ConfigCommon
2789  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2790  bIterator = DeserializeInteger (&n,-60,50,bIterator); // referenceSignalPower
2791  bIterator = DeserializeInteger (&n,0,3,bIterator); // p-b
2792 
2793  // pusch-ConfigCommon
2794  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2795 
2796  // pusch-ConfigCommon -> pusch-ConfigBasic
2797  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2798 
2799  // pusch-ConfigCommon -> pusch-ConfigBasic -> n-SB
2800  bIterator = DeserializeInteger (&n,1,4,bIterator);
2801 
2802  // pusch-ConfigCommon -> pusch-ConfigBasic -> hoppingMode
2803  bIterator = DeserializeEnum (2,&n,bIterator);
2804 
2805  // pusch-ConfigCommon -> pusch-ConfigBasic -> pusch-HoppingOffset
2806  bIterator = DeserializeInteger (&n,0,98,bIterator);
2807 
2808  // pusch-ConfigCommon -> pusch-ConfigBasic -> enable64QAM
2809  bool dummyBoolean;
2810  bIterator = DeserializeBoolean (&dummyBoolean,bIterator);
2811 
2812  // ul-ReferenceSignalsPUSCH
2813  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2814 
2815  // groupHoppingEnabled
2816  bIterator = DeserializeBoolean (&dummyBoolean,bIterator);
2817 
2818  // groupAssignmentPUSCH
2819  bIterator = DeserializeInteger (&n,0,29,bIterator);
2820 
2821  // sequenceHoppingEnabled
2822  bIterator = DeserializeBoolean (&dummyBoolean,bIterator);
2823 
2824  // cyclicShift
2825  bIterator = DeserializeInteger (&n,0,7,bIterator);
2826 
2827  // pucch-ConfigCommon
2828  bIterator = DeserializeEnum (3,&n,bIterator); // deltaPUCCH-Shift
2829  bIterator = DeserializeInteger (&n,0,98,bIterator); // nRB-CQI
2830  bIterator = DeserializeInteger (&n,0,7,bIterator); // nCS-AN
2831  bIterator = DeserializeInteger (&n,0,2047,bIterator); // n1PUCCH-AN
2832 
2833  // soundingRS-UL-ConfigCommon
2834  int choice;
2835  bIterator = DeserializeChoice (2,false,&choice,bIterator);
2836  if (choice == 0)
2837  {
2838  bIterator = DeserializeNull (bIterator); // release
2839  }
2840  if (choice == 1)
2841  {
2842  // setup
2843  // ...
2844  }
2845 
2846  // uplinkPowerControlCommon
2847  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2848  bIterator = DeserializeInteger (&n,-126,24,bIterator); // p0-NominalPUSCH
2849  bIterator = DeserializeEnum (8,&n,bIterator); // alpha
2850  bIterator = DeserializeInteger (&n,-127,-96,bIterator); // p0-NominalPUCCH
2851  //deltaFList-PUCCH
2852  bIterator = DeserializeSequence (&bitset0,false,bIterator);
2853  bIterator = DeserializeEnum (3,&n,bIterator); // deltaF-PUCCH-Format1
2854  bIterator = DeserializeEnum (3,&n,bIterator); // deltaF-PUCCH-Format1b
2855  bIterator = DeserializeEnum (4,&n,bIterator); // deltaF-PUCCH-Format2
2856  bIterator = DeserializeEnum (3,&n,bIterator); // deltaF-PUCCH-Format2a
2857  bIterator = DeserializeEnum (3,&n,bIterator); // deltaF-PUCCH-Format2b
2858  bIterator = DeserializeInteger (&n,-1,6,bIterator); // deltaPreambleMsg3
2859 
2860  // ul-CyclicPrefixLength
2861  bIterator = DeserializeEnum (2,&n,bIterator);
2862 
2863  return bIterator;
2864 }
2865 
2868 {
2869  int n;
2870  std::bitset<0> b0;
2871  std::bitset<1> measResultNeighCellsPresent;
2872  bIterator = DeserializeSequence (&measResultNeighCellsPresent,true,bIterator);
2873 
2874  // Deserialize measId
2875  bIterator = DeserializeInteger (&n, 1, MAX_MEAS_ID, bIterator);
2876  measResults->measId = n;
2877 
2878  // Deserialize measResultServCell
2879  bIterator = DeserializeSequence (&b0,false,bIterator);
2880 
2881  // Deserialize rsrpResult
2882  bIterator = DeserializeInteger (&n, 0, 97, bIterator);
2883  measResults->rsrpResult = n;
2884 
2885  // Deserialize rsrqResult
2886  bIterator = DeserializeInteger (&n, 0, 34, bIterator);
2887  measResults->rsrqResult = n;
2888 
2889  measResults->haveMeasResultNeighCells = measResultNeighCellsPresent[0];
2890  if ( measResults->haveMeasResultNeighCells)
2891  {
2892  int measResultNeighCellsChoice;
2893 
2894  // Deserialize measResultNeighCells
2895  bIterator = DeserializeChoice (4,false,&measResultNeighCellsChoice,bIterator);
2896 
2897  if (measResultNeighCellsChoice == 0)
2898  {
2899  // Deserialize measResultListEUTRA
2900  int numElems;
2901  bIterator = DeserializeSequenceOf (&numElems,MAX_CELL_REPORT,1,bIterator);
2902 
2903  for (int i = 0; i < numElems; i++)
2904  {
2905  LteRrcSap::MeasResultEutra measResultEutra;
2906 
2907  std::bitset<1> isCgiInfoPresent;
2908  bIterator = DeserializeSequence (&isCgiInfoPresent,false,bIterator);
2909 
2910  // PhysCellId
2911  bIterator = DeserializeInteger (&n,0,503,bIterator);
2912  measResultEutra.physCellId = n;
2913 
2914  measResultEutra.haveCgiInfo = isCgiInfoPresent[0];
2915  if (isCgiInfoPresent[0])
2916  {
2917  std::bitset<1> havePlmnIdentityList;
2918  bIterator = DeserializeSequence (&havePlmnIdentityList,false,bIterator);
2919 
2920  // Deserialize cellGlobalId
2921  bIterator = DeserializeSequence (&b0,false,bIterator);
2922 
2923  // Deserialize plmn-Identity
2924  bIterator = DeserializePlmnIdentity (&measResultEutra.cgiInfo.plmnIdentity,bIterator);
2925 
2926  // Deserialize CellIdentity
2927  std::bitset<28> cellId;
2928  bIterator = DeserializeBitstring (&cellId,bIterator);
2929  measResultEutra.cgiInfo.cellIdentity = cellId.to_ulong ();
2930 
2931  // Deserialize trackingAreaCode
2932  std::bitset<16> trArCo;
2933  bIterator = DeserializeBitstring (&trArCo,bIterator);
2934  measResultEutra.cgiInfo.trackingAreaCode = trArCo.to_ulong ();
2935 
2936  // Deserialize plmn-IdentityList
2937  if (havePlmnIdentityList[0])
2938  {
2939  int numPlmnElems;
2940  bIterator = DeserializeSequenceOf (&numPlmnElems, 5, 1, bIterator);
2941 
2942  for ( int j = 0; j < numPlmnElems; j++)
2943  {
2944  uint32_t plmnId;
2945  bIterator = DeserializePlmnIdentity (&plmnId,bIterator);
2946  measResultEutra.cgiInfo.plmnIdentityList.push_back (plmnId);
2947  }
2948  }
2949  }
2950 
2951  // Deserialize measResult
2952  std::bitset<2> measResultOpts;
2953  bIterator = DeserializeSequence (&measResultOpts, true, bIterator);
2954 
2955  measResultEutra.haveRsrpResult = measResultOpts[1];
2956  if (measResultOpts[1])
2957  {
2958  // Deserialize rsrpResult
2959  bIterator = DeserializeInteger (&n,0,97,bIterator);
2960  measResultEutra.rsrpResult = n;
2961  }
2962 
2963  measResultEutra.haveRsrqResult = measResultOpts[0];
2964  if (measResultOpts[0])
2965  {
2966  // Deserialize rsrqResult
2967  bIterator = DeserializeInteger (&n,0,34,bIterator);
2968  measResultEutra.rsrqResult = n;
2969  }
2970 
2971  measResults->measResultListEutra.push_back (measResultEutra);
2972  }
2973  }
2974 
2975  if (measResultNeighCellsChoice == 1)
2976  {
2977  // Deserialize measResultListUTRA
2978  // ...
2979  }
2980 
2981  if (measResultNeighCellsChoice == 2)
2982  {
2983  // Deserialize measResultListGERAN
2984  // ...
2985  }
2986  if (measResultNeighCellsChoice == 3)
2987  {
2988  // Deserialize measResultsCDMA2000
2989  // ...
2990  }
2991  }
2992 
2993  return bIterator;
2994 }
2995 
2998 {
2999  int n;
3000  std::bitset<1> isMccPresent;
3001  bIterator = DeserializeSequence (&isMccPresent,false,bIterator);
3002 
3003  if (isMccPresent[0])
3004  {
3005  // Deserialize mcc
3006  // ...
3007  }
3008 
3009  // Deserialize mnc
3010  int mncDigits;
3011  int mnc = 0;
3012  bIterator = DeserializeSequenceOf (&mncDigits,3,2,bIterator);
3013 
3014  for (int j = mncDigits - 1; j >= 0; j--)
3015  {
3016  bIterator = DeserializeInteger (&n,0,9,bIterator);
3017  mnc += n * pow (10,j);
3018  }
3019 
3020  *plmnId = mnc;
3021 
3022  // cellReservedForOperatorUse
3023  bIterator = DeserializeEnum (2,&n,bIterator);
3024  return bIterator;
3025 }
3026 
3029 {
3030  std::bitset<0> bitset0;
3031  std::bitset<2> bitset2;
3032  std::bitset<11> bitset11;
3033  int n;
3034 
3035  // measConfig
3036  bIterator = DeserializeSequence (&bitset11,true,bIterator);
3037 
3038  if (bitset11[10])
3039  {
3040  // measObjectToRemoveList
3041  int measObjectToRemoveListElems;
3042  bIterator = DeserializeSequenceOf (&measObjectToRemoveListElems, MAX_OBJECT_ID, 1, bIterator);
3043 
3044  for (int i = 0; i < measObjectToRemoveListElems; i++)
3045  {
3046  bIterator = DeserializeInteger (&n, 1, MAX_OBJECT_ID, bIterator);
3047  measConfig->measObjectToRemoveList.push_back (n);
3048  }
3049  }
3050 
3051  if (bitset11[9])
3052  {
3053  // measObjectToAddModList
3054  int measObjectToAddModListElems;
3055  bIterator = DeserializeSequenceOf (&measObjectToAddModListElems, MAX_OBJECT_ID, 1, bIterator);
3056 
3057  for (int i = 0; i < measObjectToAddModListElems; i++)
3058  {
3060 
3061  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3062 
3063  bIterator = DeserializeInteger (&n, 1, MAX_OBJECT_ID, bIterator);
3064  elem.measObjectId = n;
3065 
3066  int measObjectChoice;
3067  bIterator = DeserializeChoice (4, true, &measObjectChoice, bIterator);
3068 
3069  switch (measObjectChoice)
3070  {
3071  case 1:
3072  // Deserialize measObjectUTRA
3073  // ...
3074  break;
3075 
3076  case 2:
3077  // Deserialize measObjectGERAN
3078  // ...
3079  break;
3080 
3081  case 3:
3082  // Deserialize measObjectCDMA2000
3083  // ...
3084  break;
3085 
3086  case 0:
3087  default:
3088  // Deserialize measObjectEUTRA
3089  std::bitset<5> measObjectEutraOpts;
3090  bIterator = DeserializeSequence (&measObjectEutraOpts, true, bIterator);
3091 
3092  // carrierFreq
3093  bIterator = DeserializeInteger (&n, 0, MAX_EARFCN, bIterator);
3094  elem.measObjectEutra.carrierFreq = n;
3095 
3096  // allowedMeasBandwidth
3097  bIterator = DeserializeEnum (6, &n, bIterator);
3098  switch (n)
3099  {
3100  case 0:
3102  break;
3103  case 1:
3105  break;
3106  case 2:
3108  break;
3109  case 3:
3111  break;
3112  case 4:
3114  break;
3115  case 5:
3116  default:
3118  break;
3119  }
3120 
3121  // presenceAntennaPort1
3122  bIterator = DeserializeBoolean (&elem.measObjectEutra.presenceAntennaPort1, bIterator);
3123 
3124  // neighCellConfig
3125  bIterator = DeserializeBitstring (&bitset2, bIterator);
3126  elem.measObjectEutra.neighCellConfig = bitset2.to_ulong ();
3127 
3128  // offsetFreq
3129  bIterator = DeserializeQoffsetRange (&elem.measObjectEutra.offsetFreq, bIterator);
3130 
3131  if (measObjectEutraOpts[4])
3132  {
3133  // cellsToRemoveList
3134  int numElems;
3135  bIterator = DeserializeSequenceOf (&numElems, MAX_CELL_MEAS, 1, bIterator);
3136 
3137  for (int i = 0; i < numElems; i++)
3138  {
3139  bIterator = DeserializeInteger (&n, 1, MAX_CELL_MEAS, bIterator);
3140  elem.measObjectEutra.cellsToRemoveList.push_back (n);
3141  }
3142  }
3143 
3144  if (measObjectEutraOpts[3])
3145  {
3146  // cellsToAddModList
3147  int numElems;
3148  bIterator = DeserializeSequenceOf (&numElems, MAX_CELL_MEAS, 1, bIterator);
3149 
3150  for (int i = 0; i < numElems; i++)
3151  {
3152  LteRrcSap::CellsToAddMod cellsToAddMod;
3153 
3154  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3155 
3156  // cellIndex
3157  bIterator = DeserializeInteger (&n, 1, MAX_CELL_MEAS, bIterator);
3158  cellsToAddMod.cellIndex = n;
3159 
3160  // PhysCellId
3161  bIterator = DeserializeInteger (&n, 0, 503, bIterator);
3162  cellsToAddMod.physCellId = n;
3163 
3164  // cellIndividualOffset
3165  bIterator = DeserializeQoffsetRange ( &cellsToAddMod.cellIndividualOffset, bIterator);
3166 
3167  elem.measObjectEutra.cellsToAddModList.push_back (cellsToAddMod);
3168  }
3169  }
3170 
3171  if (measObjectEutraOpts[2])
3172  {
3173  // blackCellsToRemoveList
3174  int numElems;
3175  bIterator = DeserializeSequenceOf (&numElems, MAX_CELL_MEAS, 1, bIterator);
3176 
3177  for (int i = 0; i < numElems; i++)
3178  {
3179  bIterator = DeserializeInteger (&n, 1, MAX_CELL_MEAS, bIterator);
3180  elem.measObjectEutra.blackCellsToRemoveList.push_back (n);
3181  }
3182  }
3183 
3184 
3185  if (measObjectEutraOpts[1])
3186  {
3187  // blackCellsToAddModList
3188  int numElems;
3189  bIterator = DeserializeSequenceOf (&numElems, MAX_CELL_MEAS, 1, bIterator);
3190 
3191  for (int i = 0; i < numElems; i++)
3192  {
3193  LteRrcSap::BlackCellsToAddMod blackCellsToAddMod;
3194  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3195 
3196  bIterator = DeserializeInteger (&n, 1, MAX_CELL_MEAS, bIterator);
3197  blackCellsToAddMod.cellIndex = n;
3198 
3199  // PhysCellIdRange
3200  std::bitset<1> isRangePresent;
3201  bIterator = DeserializeSequence (&isRangePresent, false, bIterator);
3202 
3203  // start
3204  bIterator = DeserializeInteger (&n, 0, 503, bIterator);
3205  blackCellsToAddMod.physCellIdRange.start = n;
3206 
3207  blackCellsToAddMod.physCellIdRange.haveRange = isRangePresent[0];
3208  // initialize range to silence compiler warning
3209  blackCellsToAddMod.physCellIdRange.range = 0;
3210  if (blackCellsToAddMod.physCellIdRange.haveRange)
3211  {
3212  // range
3213  bIterator = DeserializeEnum (16, &n, bIterator);
3214  switch (n)
3215  {
3216  case 0:
3217  blackCellsToAddMod.physCellIdRange.range = 4;
3218  break;
3219  case 1:
3220  blackCellsToAddMod.physCellIdRange.range = 8;
3221  break;
3222  case 2:
3223  blackCellsToAddMod.physCellIdRange.range = 12;
3224  break;
3225  case 3:
3226  blackCellsToAddMod.physCellIdRange.range = 16;
3227  break;
3228  case 4:
3229  blackCellsToAddMod.physCellIdRange.range = 24;
3230  break;
3231  case 5:
3232  blackCellsToAddMod.physCellIdRange.range = 32;
3233  break;
3234  case 6:
3235  blackCellsToAddMod.physCellIdRange.range = 48;
3236  break;
3237  case 7:
3238  blackCellsToAddMod.physCellIdRange.range = 64;
3239  break;
3240  case 8:
3241  blackCellsToAddMod.physCellIdRange.range = 84;
3242  break;
3243  case 9:
3244  blackCellsToAddMod.physCellIdRange.range = 96;
3245  break;
3246  case 10:
3247  blackCellsToAddMod.physCellIdRange.range = 128;
3248  break;
3249  case 11:
3250  blackCellsToAddMod.physCellIdRange.range = 168;
3251  break;
3252  case 12:
3253  blackCellsToAddMod.physCellIdRange.range = 252;
3254  break;
3255  case 13:
3256  blackCellsToAddMod.physCellIdRange.range = 504;
3257  break;
3258  default:
3259  blackCellsToAddMod.physCellIdRange.range = 0;
3260  }
3261  }
3262 
3263  elem.measObjectEutra.blackCellsToAddModList.push_back (blackCellsToAddMod);
3264  }
3265  }
3266 
3267  elem.measObjectEutra.haveCellForWhichToReportCGI = measObjectEutraOpts[0];
3268  if (measObjectEutraOpts[0])
3269  {
3270  // cellForWhichToReportCGI
3271  bIterator = DeserializeInteger (&n, 0, 503, bIterator);
3273  }
3274  }
3275  measConfig->measObjectToAddModList.push_back (elem);
3276  }
3277  }
3278 
3279  if (bitset11[8])
3280  {
3281  // reportConfigToRemoveList
3282  int reportConfigToRemoveListElems;
3283  bIterator = DeserializeSequenceOf (&reportConfigToRemoveListElems, MAX_REPORT_CONFIG_ID, 1, bIterator);
3284 
3285  for (int i = 0; i < reportConfigToRemoveListElems; i++)
3286  {
3287  bIterator = DeserializeInteger (&n, 1, MAX_REPORT_CONFIG_ID, bIterator);
3288  measConfig->reportConfigToRemoveList.push_back (n);
3289  }
3290  }
3291 
3292  if (bitset11[7])
3293  {
3294  // reportConfigToAddModList
3295  int reportConfigToAddModListElems;
3296  bIterator = DeserializeSequenceOf (&reportConfigToAddModListElems, MAX_REPORT_CONFIG_ID, 1, bIterator);
3297 
3298  for (int i = 0; i < reportConfigToAddModListElems; i++)
3299  {
3301 
3302  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3303  bIterator = DeserializeInteger (&n, 1, MAX_REPORT_CONFIG_ID, bIterator);
3304  elem.reportConfigId = n;
3305 
3306  // Deserialize reportConfig
3307  int reportConfigChoice;
3308  bIterator = DeserializeChoice (2, false, &reportConfigChoice, bIterator);
3309 
3310  if (reportConfigChoice == 0)
3311  {
3312  // reportConfigEUTRA
3313  bIterator = DeserializeSequence (&bitset0, true, bIterator);
3314 
3315  // triggerType
3316  int triggerTypeChoice;
3317  bIterator = DeserializeChoice (2, false, &triggerTypeChoice, bIterator);
3318 
3319  if (triggerTypeChoice == 0)
3320  {
3321  // event
3323  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3324 
3325  // eventId
3326  int eventIdChoice;
3327  bIterator = DeserializeChoice (5, true, &eventIdChoice, bIterator);
3328 
3329  switch (eventIdChoice)
3330  {
3331  case 0:
3333  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3334  bIterator = DeserializeThresholdEutra (&elem.reportConfigEutra.threshold1, bIterator);
3335  break;
3336 
3337  case 1:
3339  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3340  bIterator = DeserializeThresholdEutra (&elem.reportConfigEutra.threshold1, bIterator);
3341  break;
3342 
3343  case 2:
3345  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3346  bIterator = DeserializeInteger (&n, -30, 30, bIterator);
3347  elem.reportConfigEutra.a3Offset = n;
3348  bIterator = DeserializeBoolean (&elem.reportConfigEutra.reportOnLeave, bIterator);
3349  break;
3350 
3351  case 3:
3353  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3354  bIterator = DeserializeThresholdEutra (&elem.reportConfigEutra.threshold1, bIterator);
3355  break;
3356 
3357  case 4:
3358  default:
3360  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3361  bIterator = DeserializeThresholdEutra (&elem.reportConfigEutra.threshold1, bIterator);
3362  bIterator = DeserializeThresholdEutra (&elem.reportConfigEutra.threshold2, bIterator);
3363  }
3364 
3365  bIterator = DeserializeInteger (&n, 0, 30, bIterator);
3366  elem.reportConfigEutra.hysteresis = n;
3367 
3368  bIterator = DeserializeEnum (16, &n, bIterator);
3369  switch (n)
3370  {
3371  case 0:
3373  break;
3374  case 1:
3375  elem.reportConfigEutra.timeToTrigger = 40;
3376  break;
3377  case 2:
3378  elem.reportConfigEutra.timeToTrigger = 64;
3379  break;
3380  case 3:
3381  elem.reportConfigEutra.timeToTrigger = 80;
3382  break;
3383  case 4:
3384  elem.reportConfigEutra.timeToTrigger = 100;
3385  break;
3386  case 5:
3387  elem.reportConfigEutra.timeToTrigger = 128;
3388  break;
3389  case 6:
3390  elem.reportConfigEutra.timeToTrigger = 160;
3391  break;
3392  case 7:
3393  elem.reportConfigEutra.timeToTrigger = 256;
3394  break;
3395  case 8:
3396  elem.reportConfigEutra.timeToTrigger = 320;
3397  break;
3398  case 9:
3399  elem.reportConfigEutra.timeToTrigger = 480;
3400  break;
3401  case 10:
3402  elem.reportConfigEutra.timeToTrigger = 512;
3403  break;
3404  case 11:
3405  elem.reportConfigEutra.timeToTrigger = 640;
3406  break;
3407  case 12:
3408  elem.reportConfigEutra.timeToTrigger = 1024;
3409  break;
3410  case 13:
3411  elem.reportConfigEutra.timeToTrigger = 1280;
3412  break;
3413  case 14:
3414  elem.reportConfigEutra.timeToTrigger = 2560;
3415  break;
3416  case 15:
3417  default:
3418  elem.reportConfigEutra.timeToTrigger = 5120;
3419  break;
3420  }
3421  }
3422 
3423  if (triggerTypeChoice == 1)
3424  {
3425  // periodical
3427 
3428  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3429  bIterator = DeserializeEnum (2, &n, bIterator);
3430  if (n == 0)
3431  {
3433  }
3434  else
3435  {
3437  }
3438  }
3439 
3440  // triggerQuantity
3441  bIterator = DeserializeEnum (2, &n, bIterator);
3442  if (n == 0)
3443  {
3445  }
3446  else
3447  {
3449  }
3450 
3451  // reportQuantity
3452  bIterator = DeserializeEnum (2, &n, bIterator);
3453  if (n == 0)
3454  {
3456  }
3457  else
3458  {
3460  }
3461 
3462  // maxReportCells
3463  bIterator = DeserializeInteger (&n, 1, MAX_CELL_REPORT, bIterator);
3465 
3466  // reportInterval
3467  bIterator = DeserializeEnum (16, &n, bIterator);
3468  switch (n)
3469  {
3470  case 0:
3472  break;
3473  case 1:
3475  break;
3476  case 2:
3478  break;
3479  case 3:
3481  break;
3482  case 4:
3484  break;
3485  case 5:
3487  break;
3488  case 6:
3490  break;
3491  case 7:
3493  break;
3494  case 8:
3496  break;
3497  case 9:
3499  break;
3500  case 10:
3502  break;
3503  case 11:
3505  break;
3506  case 12:
3508  break;
3509  case 13:
3511  break;
3512  case 14:
3514  break;
3515  case 15:
3516  default:
3518  }
3519 
3520  // reportAmount
3521  bIterator = DeserializeEnum (8, &n, bIterator);
3522  switch (n)
3523  {
3524  case 0:
3526  break;
3527  case 1:
3529  break;
3530  case 2:
3532  break;
3533  case 3:
3535  break;
3536  case 4:
3537  elem.reportConfigEutra.reportAmount = 16;
3538  break;
3539  case 5:
3540  elem.reportConfigEutra.reportAmount = 32;
3541  break;
3542  case 6:
3543  elem.reportConfigEutra.reportAmount = 64;
3544  break;
3545  default:
3547  }
3548  }
3549 
3550  if (reportConfigChoice == 1)
3551  {
3552  // ReportConfigInterRAT
3553  // ...
3554  }
3555 
3556  measConfig->reportConfigToAddModList.push_back (elem);
3557  }
3558  }
3559 
3560  if (bitset11[6])
3561  {
3562  // measIdToRemoveList
3563  int measIdToRemoveListElems;
3564  bIterator = DeserializeSequenceOf (&measIdToRemoveListElems, MAX_MEAS_ID, 1, bIterator);
3565 
3566  for (int i = 0; i < measIdToRemoveListElems; i++)
3567  {
3568  bIterator = DeserializeInteger (&n, 1, MAX_MEAS_ID, bIterator);
3569  measConfig->measIdToRemoveList.push_back (n);
3570  }
3571  }
3572 
3573  if (bitset11[5])
3574  {
3575  // measIdToAddModList
3576  int measIdToAddModListElems;
3577  bIterator = DeserializeSequenceOf (&measIdToAddModListElems, MAX_MEAS_ID, 1, bIterator);
3578 
3579  for (int i = 0; i < measIdToAddModListElems; i++)
3580  {
3582 
3583  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3584 
3585  bIterator = DeserializeInteger (&n, 1, MAX_MEAS_ID, bIterator);
3586  elem.measId = n;
3587 
3588  bIterator = DeserializeInteger (&n, 1, MAX_OBJECT_ID, bIterator);
3589  elem.measObjectId = n;
3590 
3591  bIterator = DeserializeInteger (&n, 1, MAX_REPORT_CONFIG_ID, bIterator);
3592  elem.reportConfigId = n;
3593 
3594  measConfig->measIdToAddModList.push_back (elem);
3595  }
3596  }
3597 
3598  measConfig->haveQuantityConfig = bitset11[4];
3599  if (measConfig->haveQuantityConfig)
3600  {
3601  // quantityConfig
3602  std::bitset<4> quantityConfigOpts;
3603  bIterator = DeserializeSequence (&quantityConfigOpts, true, bIterator);
3604 
3605  if (quantityConfigOpts[3])
3606  {
3607  // quantityConfigEUTRA
3608  bIterator = DeserializeSequence (&bitset0,false,bIterator);
3609  bIterator = DeserializeEnum (16, &n, bIterator);
3610  switch (n)
3611  {
3612  case 0:
3613  measConfig->quantityConfig.filterCoefficientRSRP = 0;
3614  break;
3615  case 1:
3616  measConfig->quantityConfig.filterCoefficientRSRP = 1;
3617  break;
3618  case 2:
3619  measConfig->quantityConfig.filterCoefficientRSRP = 2;
3620  break;
3621  case 3:
3622  measConfig->quantityConfig.filterCoefficientRSRP = 3;
3623  break;
3624  case 4:
3625  measConfig->quantityConfig.filterCoefficientRSRP = 4;
3626  break;
3627  case 5:
3628  measConfig->quantityConfig.filterCoefficientRSRP = 5;
3629  break;
3630  case 6:
3631  measConfig->quantityConfig.filterCoefficientRSRP = 6;
3632  break;
3633  case 7:
3634  measConfig->quantityConfig.filterCoefficientRSRP = 7;
3635  break;
3636  case 8:
3637  measConfig->quantityConfig.filterCoefficientRSRP = 8;
3638  break;
3639  case 9:
3640  measConfig->quantityConfig.filterCoefficientRSRP = 9;
3641  break;
3642  case 10:
3643  measConfig->quantityConfig.filterCoefficientRSRP = 11;
3644  break;
3645  case 11:
3646  measConfig->quantityConfig.filterCoefficientRSRP = 13;
3647  break;
3648  case 12:
3649  measConfig->quantityConfig.filterCoefficientRSRP = 15;
3650  break;
3651  case 13:
3652  measConfig->quantityConfig.filterCoefficientRSRP = 17;
3653  break;
3654  case 14:
3655  measConfig->quantityConfig.filterCoefficientRSRP = 19;
3656  break;
3657  case 15:
3658  measConfig->quantityConfig.filterCoefficientRSRP = 0;
3659  break;
3660  default:
3661  measConfig->quantityConfig.filterCoefficientRSRP = 4;
3662  }
3663  bIterator = DeserializeEnum (16, &n, bIterator);
3664  switch (n)
3665  {
3666  case 0:
3667  measConfig->quantityConfig.filterCoefficientRSRQ = 0;
3668  break;
3669  case 1:
3670  measConfig->quantityConfig.filterCoefficientRSRQ = 1;
3671  break;
3672  case 2:
3673  measConfig->quantityConfig.filterCoefficientRSRQ = 2;
3674  break;
3675  case 3:
3676  measConfig->quantityConfig.filterCoefficientRSRQ = 3;
3677  break;
3678  case 4:
3679  measConfig->quantityConfig.filterCoefficientRSRQ = 4;
3680  break;
3681  case 5:
3682  measConfig->quantityConfig.filterCoefficientRSRQ = 5;
3683  break;
3684  case 6:
3685  measConfig->quantityConfig.filterCoefficientRSRQ = 6;
3686  break;
3687  case 7:
3688  measConfig->quantityConfig.filterCoefficientRSRQ = 7;
3689  break;
3690  case 8:
3691  measConfig->quantityConfig.filterCoefficientRSRQ = 8;
3692  break;
3693  case 9:
3694  measConfig->quantityConfig.filterCoefficientRSRQ = 9;
3695  break;
3696  case 10:
3697  measConfig->quantityConfig.filterCoefficientRSRQ = 11;
3698  break;
3699  case 11:
3700  measConfig->quantityConfig.filterCoefficientRSRQ = 13;
3701  break;
3702  case 12:
3703  measConfig->quantityConfig.filterCoefficientRSRQ = 15;
3704  break;
3705  case 13:
3706  measConfig->quantityConfig.filterCoefficientRSRQ = 17;
3707  break;
3708  case 14:
3709  measConfig->quantityConfig.filterCoefficientRSRQ = 19;
3710  break;
3711  case 15:
3712  measConfig->quantityConfig.filterCoefficientRSRQ = 0;
3713  break;
3714  default:
3715  measConfig->quantityConfig.filterCoefficientRSRQ = 4;
3716  }
3717  }
3718  if (quantityConfigOpts[2])
3719  {
3720  // quantityConfigUTRA
3721  // ...
3722  }
3723  if (quantityConfigOpts[1])
3724  {
3725  // quantityConfigGERAN
3726  // ...
3727  }
3728  if (quantityConfigOpts[0])
3729  {
3730  // quantityConfigCDMA2000
3731  // ...
3732  }
3733  }
3734 
3735  measConfig->haveMeasGapConfig = bitset11[3];
3736  if (measConfig->haveMeasGapConfig)
3737  {
3738  // measGapConfig
3739  int measGapConfigChoice;
3740  bIterator = DeserializeChoice (2, false, &measGapConfigChoice, bIterator);
3741  switch (measGapConfigChoice)
3742  {
3743  case 0:
3745  bIterator = DeserializeNull (bIterator);
3746  break;
3747  case 1:
3748  default:
3750  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3751 
3752  int gapOffsetChoice;
3753  bIterator = DeserializeChoice (2, true, &gapOffsetChoice, bIterator);
3754  switch (gapOffsetChoice)
3755  {
3756  case 0:
3758  bIterator = DeserializeInteger (&n, 0, 39, bIterator);
3759  measConfig->measGapConfig.gapOffsetValue = n;
3760  break;
3761  case 1:
3762  default:
3764  bIterator = DeserializeInteger (&n, 0, 79, bIterator);
3765  measConfig->measGapConfig.gapOffsetValue = n;
3766  }
3767  }
3768  }
3769 
3770  measConfig->haveSmeasure = bitset11[2];
3771  if (measConfig->haveSmeasure)
3772  {
3773  // s-Measure
3774  bIterator = DeserializeInteger (&n, 0, 97, bIterator);
3775  measConfig->sMeasure = n;
3776  }
3777 
3778  if (bitset11[1])
3779  {
3780  // preRegistrationInfoHRPD
3781  // ...
3782  }
3783 
3784  measConfig->haveSpeedStatePars = bitset11[0];
3785  if (measConfig->haveSpeedStatePars)
3786  {
3787  // speedStatePars
3788  int speedStateParsChoice;
3789  bIterator = DeserializeChoice (2, false, &speedStateParsChoice, bIterator);
3790  switch (speedStateParsChoice)
3791  {
3792  case 0:
3794  bIterator = DeserializeNull (bIterator);
3795  break;
3796  case 1:
3797  default:
3799  bIterator = DeserializeSequence (&bitset0, false, bIterator);
3800 
3801  // Deserialize mobilityStateParameters
3802  // Deserialize t-Evaluation
3803  bIterator = DeserializeEnum (8, &n, bIterator);
3804  switch (n)
3805  {
3806  case 0:
3808  break;
3809  case 1:
3811  break;
3812  case 2:
3814  break;
3815  case 3:
3817  break;
3818  case 4:
3820  break;
3821  default:
3823  }
3824  // Deserialize t-HystNormal
3825  bIterator = DeserializeEnum (8, &n, bIterator);
3826  switch (n)
3827  {
3828  case 0:
3830  break;
3831  case 1:
3833  break;
3834  case 2:
3836  break;
3837  case 3:
3839  break;
3840  case 4:
3842  break;
3843  default:
3845  }
3846 
3847  bIterator = DeserializeInteger (&n, 1, 16, bIterator);
3849 
3850  bIterator = DeserializeInteger (&n, 1, 16, bIterator);
3852 
3853  // Deserialize timeToTriggerSf
3854  bIterator = DeserializeEnum (4, &n, bIterator);
3855  measConfig->speedStatePars.timeToTriggerSf.sfMedium = (n + 1) * 25;
3856  bIterator = DeserializeEnum (4, &n, bIterator);
3857  measConfig->speedStatePars.timeToTriggerSf.sfHigh = (n + 1) * 25;
3858  }
3859  }
3860  return bIterator;
3861 }
3863 
3864 // Constructor
3866 {
3867  m_mmec = std::bitset<8> (0ul);
3868  m_mTmsi = std::bitset<32> (0ul);
3870  m_spare = std::bitset<1> (0ul);
3871 }
3872 
3873 // Destructor
3875 {
3876 }
3877 
3878 TypeId
3880 {
3881  static TypeId tid = TypeId ("ns3::RrcConnectionRequestHeader")
3882  .SetParent<Header> ()
3883  ;
3884  return tid;
3885 }
3886 
3887 void
3888 RrcConnectionRequestHeader::Print (std::ostream &os) const
3889 {
3890  os << "MMEC:" << m_mmec << std::endl;
3891  os << "MTMSI:" << m_mTmsi << std::endl;
3892  os << "EstablishmentCause:" << m_establishmentCause << std::endl;
3893  os << "Spare: " << m_spare << std::endl;
3894 }
3895 
3896 void
3898 {
3900 
3902 
3903  // Serialize RRCConnectionRequest sequence:
3904  // no default or optional fields. Extension marker not present.
3905  SerializeSequence (std::bitset<0> (),false);
3906 
3907  // Serialize criticalExtensions choice:
3908  // 2 options, selected: 0 (option: rrcConnectionRequest-r8)
3909  SerializeChoice (2,0,false);
3910 
3911  // Serialize RRCConnectionRequest-r8-IEs sequence:
3912  // no default or optional fields. Extension marker not present.
3913  SerializeSequence (std::bitset<0> (),false);
3914 
3915  // Serialize InitialUE-Identity choice:
3916  // 2 options, selected: 0 (option: s-TMSI)
3917  SerializeChoice (2,0,false);
3918 
3919  // Serialize S-TMSI sequence:
3920  // no default or optional fields. Extension marker not present.
3921  SerializeSequence (std::bitset<0> (),false);
3922 
3923  // Serialize mmec : MMEC ::= BIT STRING (SIZE (8))
3925 
3926  // Serialize m-TMSI ::= BIT STRING (SIZE (32))
3928 
3929  // Serialize establishmentCause : EstablishmentCause ::= ENUMERATED
3931 
3932  // Serialize spare : BIT STRING (SIZE (1))
3933  SerializeBitstring (std::bitset<1> ());
3934 
3935  // Finish serialization
3937 }
3938 
3939 uint32_t
3941 {
3942  std::bitset<1> dummy;
3943  std::bitset<0> optionalOrDefaultMask;
3944  int selectedOption;
3945 
3946  bIterator = DeserializeUlCcchMessage (bIterator);
3947 
3948  // Deserialize RCConnectionRequest sequence
3949  bIterator = DeserializeSequence (&optionalOrDefaultMask,false,bIterator);
3950 
3951  // Deserialize criticalExtensions choice:
3952  bIterator = DeserializeChoice (2,false,&selectedOption,bIterator);
3953 
3954  // Deserialize RRCConnectionRequest-r8-IEs sequence
3955  bIterator = DeserializeSequence (&optionalOrDefaultMask,false,bIterator);
3956 
3957  // Deserialize InitialUE-Identity choice
3958  bIterator = DeserializeChoice (2,false,&selectedOption,bIterator);
3959 
3960  // Deserialize S-TMSI sequence
3961  bIterator = DeserializeSequence (&optionalOrDefaultMask,false,bIterator);
3962 
3963  // Deserialize mmec
3964  bIterator = DeserializeBitstring (&m_mmec,bIterator);
3965 
3966  // Deserialize m-TMSI
3967  bIterator = DeserializeBitstring (&m_mTmsi,bIterator);
3968 
3969  // Deserialize establishmentCause
3970  bIterator = DeserializeEnum (8,&selectedOption,bIterator);
3971 
3972  // Deserialize spare
3973  bIterator = DeserializeBitstring (&dummy,bIterator);
3974 
3975  return GetSerializedSize ();
3976 }
3977 
3978 void
3980 {
3981  m_mTmsi = std::bitset<32> ((uint32_t)msg.ueIdentity);
3982  m_mmec = std::bitset<8> ((uint32_t)(msg.ueIdentity >> 32));
3983  m_isDataSerialized = false;
3984 }
3985 
3988 {
3990  msg.ueIdentity = (((uint64_t) m_mmec.to_ulong ()) << 32) | (m_mTmsi.to_ulong ());
3991 
3992  return msg;
3993 }
3994 
3995 std::bitset<8>
3997 {
3998  return m_mmec;
3999 }
4000 
4001 std::bitset<32>
4003 {
4004  return m_mTmsi;
4005 }
4006 
4007 
4010 {
4011 }
4012 
4014 {
4015 }
4016 
4017 void
4018 RrcConnectionSetupHeader::Print (std::ostream &os) const
4019 {
4020  os << "rrcTransactionIdentifier: " << (int)m_rrcTransactionIdentifier << std::endl;
4021  os << "radioResourceConfigDedicated:" << std::endl;
4023 }
4024 
4025 void
4027 {
4029 
4031 
4032  SerializeInteger (15,0,15);
4033 
4034  // Serialize RRCConnectionSetup sequence:
4035  // no default or optional fields. Extension marker not present.
4036  SerializeSequence (std::bitset<0> (),false);
4037 
4038  // Serialize rrc-TransactionIdentifier ::=INTEGER (0..3)
4040 
4041  // Serialize criticalExtensions choice:
4042  // 2 options, selected: 0 (option: c1)
4043  SerializeChoice (2,0,false);
4044 
4045  // Serialize c1 choice:
4046  // 8 options, selected: 0 (option: rrcConnectionSetup-r8)
4047  SerializeChoice (8,0,false);
4048 
4049  // Serialize rrcConnectionSetup-r8 sequence
4050  // 1 optional fields (not present). Extension marker not present.
4051  SerializeSequence (std::bitset<1> (0),false);
4052 
4053  // Serialize RadioResourceConfigDedicated sequence
4055 
4056  // Serialize nonCriticalExtension sequence
4057  // 2 optional fields, none present. No extension marker.
4058  SerializeSequence (std::bitset<2> (0),false);
4059 
4060  // Finish serialization
4062 }
4063 
4064 
4065 uint32_t
4067 {
4068  int n;
4069 
4070  std::bitset<0> bitset0;
4071  std::bitset<1> bitset1;
4072  std::bitset<2> bitset2;
4073 
4074  bIterator = DeserializeDlCcchMessage (bIterator);
4075 
4076  bIterator = DeserializeInteger (&n,0,15,bIterator);
4077 
4078  // Deserialize RRCConnectionSetup sequence
4079  bIterator = DeserializeSequence (&bitset0,false,bIterator);
4080 
4081  // Deserialize rrc-TransactionIdentifier ::=INTEGER (0..3)
4082  bIterator = DeserializeInteger (&n,0,3,bIterator);
4084 
4085  // Deserialize criticalExtensions choice
4086  int criticalExtensionChoice;
4087  bIterator = DeserializeChoice (2,false,&criticalExtensionChoice,bIterator);
4088  if (criticalExtensionChoice == 1)
4089  {
4090  // Deserialize criticalExtensionsFuture
4091  bIterator = DeserializeSequence (&bitset0,false,bIterator);
4092  }
4093  else if (criticalExtensionChoice == 0)
4094  {
4095  // Deserialize c1
4096  int c1;
4097  bIterator = DeserializeChoice (8,false,&c1,bIterator);
4098 
4099  if (c1 > 0)
4100  {
4101  // Deserialize spareX , X:=7..1
4102  bIterator = DeserializeNull (bIterator);
4103  }
4104  else if (c1 == 0)
4105  {
4106  // Deserialize rrcConnectionSetup-r8
4107  // 1 optional fields, no extension marker.
4108  bIterator = DeserializeSequence (&bitset1,false,bIterator);
4109 
4110  // Deserialize radioResourceConfigDedicated
4112 
4113  if (bitset1[0])
4114  {
4115  // Deserialize nonCriticalExtension
4116  // 2 optional fields, no extension marker.
4117  bIterator = DeserializeSequence (&bitset2,false,bIterator);
4118 
4119  // Deserialization of lateR8NonCriticalExtension and nonCriticalExtension
4120  // ...
4121  }
4122  }
4123  }
4124  return GetSerializedSize ();
4125 }
4126 
4127 void
4129 {
4132  m_isDataSerialized = false;
4133 }
4134 
4137 {
4141  return msg;
4142 }
4143 
4144 uint8_t
4146 {
4148 }
4149 
4150 bool
4152 {
4154 }
4155 
4156 std::list<LteRrcSap::SrbToAddMod>
4158 {
4160 }
4161 
4162 std::list<LteRrcSap::DrbToAddMod>
4164 {
4166 }
4167 
4168 std::list<uint8_t>
4170 {
4172 }
4173 
4176 {
4178 }
4179 
4182 {
4184 }
4185 
4187 
4189 {
4190 }
4191 
4193 {
4194 }
4195 
4196 void
4198 {
4200 
4201  // Serialize DCCH message
4203 
4204  // Serialize RRCConnectionSetupComplete sequence:
4205  // no default or optional fields. Extension marker not present.
4206  SerializeSequence (std::bitset<0> (),false);
4207 
4208  // Serialize rrc-TransactionIdentifier
4210 
4211  // Serialize criticalExtensions choice
4212  // 2 options, selected 0 (c1)
4213  SerializeChoice (2,0,false);
4214 
4215  // Choose spare3 NULL
4216  SerializeChoice (4,1,false);
4217 
4218  // Serialize spare3 NULL
4219  SerializeNull ();
4220 
4221  // Finish serialization
4223 }
4224 
4225 uint32_t
4227 {
4228  std::bitset<0> bitset0;
4229 
4230  bIterator = DeserializeUlDcchMessage (bIterator);
4231 
4232  bIterator = DeserializeSequence (&bitset0,false,bIterator);
4233 
4234  int n;
4235  bIterator = DeserializeInteger (&n,0,3,bIterator);
4237 
4238  bIterator = DeserializeChoice (2,false,&n,bIterator);
4239 
4240  if (n == 1)
4241  {
4242  // Deserialize criticalExtensionsFuture
4243  bIterator = DeserializeSequence (&bitset0,false,bIterator);
4244  }
4245  else if (n == 0)
4246  {
4247  // Deserialize c1
4248  int c1Chosen;
4249  bIterator = DeserializeChoice (4,false,&c1Chosen,bIterator);
4250 
4251  if (c1Chosen == 0)
4252  {
4253  // Deserialize rrcConnectionSetupComplete-r8
4254  // ...
4255  }
4256  else
4257  {
4258  bIterator = DeserializeNull (bIterator);
4259  }
4260  }
4261 
4262  return GetSerializedSize ();
4263 }
4264 
4265 void
4267 {
4268  os << "rrcTransactionIdentifier: " << (int) m_rrcTransactionIdentifier << std::endl;
4269 }
4270 
4271 void
4273 {
4275  m_isDataSerialized = false;
4276 }
4277 
4278 uint8_t
4280 {
4282 }
4283 
4286 {
4289  return msg;
4290 }
4291 
4293 
4295 {
4296 }
4297 
4299 {
4300 }
4301 
4302 void
4304 {
4306 
4307  // Serialize DCCH message
4309 
4310  // Serialize RRCConnectionSetupComplete sequence:
4311  // no default or optional fields. Extension marker not present.
4312  SerializeSequence (std::bitset<0> (),false);
4313 
4314  // Serialize rrc-TransactionIdentifier
4316 
4317  // Serialize criticalExtensions choice
4318  // 2 options, selected 1 (criticalExtensionsFuture)
4319  SerializeChoice (2,1,false);
4320 
4321  // Choose criticalExtensionsFuture
4322  SerializeSequence (std::bitset<0> (),false);
4323 
4324  // Finish serialization
4326 }
4327 
4328 uint32_t
4330 {
4331  std::bitset<0> bitset0;
4332  int n;
4333 
4334  bIterator = DeserializeUlDcchMessage (bIterator);
4335  bIterator = DeserializeSequence (&bitset0,false,bIterator);
4336 
4337  bIterator = DeserializeInteger (&n,0,3,bIterator);
4339 
4340  bIterator = DeserializeChoice (2,false,&n,bIterator);
4341 
4342  if (n == 1)
4343  {
4344  // Deserialize criticalExtensionsFuture
4345  bIterator = DeserializeSequence (&bitset0,false,bIterator);
4346  }
4347  else if (n == 0)
4348  {
4349  // Deserialize rrcConnectionReconfigurationComplete-r8
4350  // ...
4351  }
4352 
4353  return GetSerializedSize ();
4354 }
4355 
4356 void
4358 {
4359  os << "rrcTransactionIdentifier: " << (int) m_rrcTransactionIdentifier << std::endl;
4360 }
4361 
4362 void
4364 {
4366  m_isDataSerialized = false;
4367 }
4368 
4371 {
4374  return msg;
4375 }
4376 
4377 uint8_t
4379 {
4381 }
4382 
4384 
4386 {
4387 }
4388 
4390 {
4391 }
4392 
4393 void
4395 {
4397 
4399 
4400  // Serialize RRCConnectionSetupComplete sequence:
4401  // no default or optional fields. Extension marker not present.
4402  SerializeSequence (std::bitset<0> (),false);
4403 
4404  // Serialize rrc-TransactionIdentifier
4406 
4407  // Serialize criticalExtensions choice
4408  // 2 options, selected 0 (c1)
4409  SerializeChoice (2,0,false);
4410 
4411  // Serialize c1 choice
4412  // 8 options, selected 0 (rrcConnectionReconfiguration-r8)
4413  SerializeChoice (8,0,false);
4414 
4415  // Serialize RRCConnectionReconfiguration-r8-IEs sequence:
4416  // 6 optional fields. Extension marker not present.
4417  std::bitset<6> options;
4418  options.set (5,m_haveMeasConfig);
4419  options.set (4,m_haveMobilityControlInfo);
4420  options.set (3,0); // No dedicatedInfoNASList
4421  options.set (2,m_haveRadioResourceConfigDedicated);
4422  options.set (1,0); // No securityConfigHO
4423  options.set (0,0); // No nonCriticalExtension
4424  SerializeSequence (options,false);
4425 
4426  if (m_haveMeasConfig)
4427  {
4429  }
4430 
4432  {
4433  // Serialize MobilityControlInfo
4434 
4435  // 4 optional fields, extension marker present.
4436  std::bitset<4> mobCtrlIntoOptional;
4437  mobCtrlIntoOptional.set (3,m_mobilityControlInfo.haveCarrierFreq);
4438  mobCtrlIntoOptional.set (2,m_mobilityControlInfo.haveCarrierBandwidth);
4439  mobCtrlIntoOptional.set (1,0); // No additionalSpectrumEmission
4440  mobCtrlIntoOptional.set (0,m_mobilityControlInfo.haveRachConfigDedicated);
4441  SerializeSequence (mobCtrlIntoOptional,true);
4442 
4443  // Serialize targetPhysCellId
4445 
4447  {
4448  SerializeSequence (std::bitset<1> (1),false);
4451  }
4452 
4454  {
4455  SerializeSequence (std::bitset<1> (1),false);
4456 
4457  // Serialize dl-Bandwidth
4459  {
4460  case 6:
4461  SerializeEnum (16,0);
4462  break;
4463  case 15:
4464  SerializeEnum (16,1);
4465  break;
4466  case 25:
4467  SerializeEnum (16,2);
4468  break;
4469  case 50:
4470  SerializeEnum (16,3);
4471  break;
4472  case 75:
4473  SerializeEnum (16,4);
4474  break;
4475  case 100:
4476  SerializeEnum (16,5);
4477  break;
4478  default:
4479  SerializeEnum (16,6);
4480  }
4481 
4482  // Serialize ul-Bandwidth
4484  {
4485  case 6:
4486  SerializeEnum (16,0);
4487  break;
4488  case 15:
4489  SerializeEnum (16,1);
4490  break;
4491  case 25:
4492  SerializeEnum (16,2);
4493  break;
4494  case 50:
4495  SerializeEnum (16,3);
4496  break;
4497  case 75:
4498  SerializeEnum (16,4);
4499  break;
4500  case 100:
4501  SerializeEnum (16,5);
4502  break;
4503  default:
4504  SerializeEnum (16,6);
4505  }
4506  }
4507 
4508  // Serialize t304
4509  SerializeEnum (8,0);
4510 
4511  // Serialize newUE-Identitiy
4513 
4514  // Serialize radioResourceConfigCommon
4516 
4518  {
4519  SerializeSequence (std::bitset<0> (),false);
4522  }
4523  }
4524 
4526  {
4527  // Serialize RadioResourceConfigDedicated
4529  }
4530 
4531  // Finish serialization
4533 }
4534 
4535 uint32_t
4537 {
4538  std::bitset<0> bitset0;
4539 
4540  bIterator = DeserializeDlDcchMessage (bIterator);
4541 
4542  // RRCConnectionReconfiguration sequence
4543  bIterator = DeserializeSequence (&bitset0,false,bIterator);
4544 
4545  // rrc-TransactionIdentifier
4546  int n;
4547  bIterator = DeserializeInteger (&n,0,3,bIterator);
4549 
4550  // criticalExtensions
4551  int sel;
4552  bIterator = DeserializeChoice (2,false,&sel,bIterator);
4553  if (sel == 1)
4554  {
4555  // criticalExtensionsFuture
4556  bIterator = DeserializeSequence (&bitset0,false,bIterator);
4557  }
4558  else if (sel == 0)
4559  {
4560  // c1
4561  int c1Chosen;
4562  bIterator = DeserializeChoice (8,false,&c1Chosen,bIterator);
4563  if (c1Chosen > 0)
4564  {
4565  bIterator = DeserializeNull (bIterator);
4566  }
4567  else if (c1Chosen == 0)
4568  {
4569  // rrcConnectionReconfiguration-r8
4570  std::bitset<6> rrcConnRecOpts;
4571  bIterator = DeserializeSequence (&rrcConnRecOpts,false,bIterator);
4572 
4573  m_haveMeasConfig = rrcConnRecOpts[5];
4574  if (m_haveMeasConfig)
4575  {
4576  bIterator = DeserializeMeasConfig (&m_measConfig, bIterator);
4577  }
4578 
4579  m_haveMobilityControlInfo = rrcConnRecOpts[4];
4581  {
4582  // mobilityControlInfo
4583  std::bitset<4> mobCtrlOpts;
4584  bIterator = DeserializeSequence (&mobCtrlOpts,true,bIterator);
4585 
4586  // PhysCellId
4587  bIterator = DeserializeInteger (&n,0,503,bIterator);
4589 
4590  // carrierFreq
4591  m_mobilityControlInfo.haveCarrierFreq = mobCtrlOpts[3];
4593  {
4594  std::bitset<1> ulCarrierFreqPresent;
4595  bIterator = DeserializeSequence (&ulCarrierFreqPresent,false,bIterator);
4596 
4597  bIterator = DeserializeInteger (&n,0,MAX_EARFCN,bIterator);
4599 
4600  if (ulCarrierFreqPresent[0])
4601  {
4602  bIterator = DeserializeInteger (&n,0,MAX_EARFCN,bIterator);
4604  }
4605  }
4606 
4607  // carrierBandwidth
4610  {
4611  std::bitset<1> ulBandwidthPresent;
4612  bIterator = DeserializeSequence (&ulBandwidthPresent,false,bIterator);
4613 
4614  bIterator = DeserializeEnum (16,&n,bIterator);
4615  switch (n)
4616  {
4617  case 0:
4619  break;
4620  case 1:
4622  break;
4623  case 2:
4625  break;
4626  case 3:
4628  break;
4629  case 4:
4631  break;
4632  case 5:
4634  break;
4635  case 6:
4637  break;
4638  }
4639 
4640  if (ulBandwidthPresent[0])
4641  {
4642  bIterator = DeserializeEnum (16,&n,bIterator);
4643  switch (n)
4644  {
4645  case 0:
4647  break;
4648  case 1:
4650  break;
4651  case 2:
4653  break;
4654  case 3:
4656  break;
4657  case 4:
4659  break;
4660  case 5:
4662  break;
4663  case 6:
4665  break;
4666  }
4667  }
4668  }
4669 
4670  // additionalSpectrumEmission
4671  if (mobCtrlOpts[1])
4672  {
4673  // ...
4674  }
4675 
4676  // t304
4677  bIterator = DeserializeEnum (8,&n,bIterator);
4678 
4679  // newUE-Identity
4680  std::bitset<16> cRnti;
4681  bIterator = DeserializeBitstring (&cRnti, bIterator);
4682  m_mobilityControlInfo.newUeIdentity = cRnti.to_ulong ();
4683 
4684  // radioResourceConfigCommon
4686 
4689  {
4690  bIterator = DeserializeSequence (&bitset0, false, bIterator);
4691  bIterator = DeserializeInteger (&n,0,63, bIterator);
4693  bIterator = DeserializeInteger (&n,0,15, bIterator);
4695  }
4696  }
4697 
4698  // dedicatedInfoNASList
4699  if (rrcConnRecOpts[3])
4700  {
4701  // ...
4702  }
4703 
4704  // radioResourceConfigDedicated
4705  m_haveRadioResourceConfigDedicated = rrcConnRecOpts[2];
4707  {
4709  }
4710 
4711  // securityConfigHO
4712  if (rrcConnRecOpts[1])
4713  {
4714  // ...
4715  }
4716 
4717  // nonCriticalExtension
4718  if (rrcConnRecOpts[0])
4719  {
4720  // ...
4721  }
4722  }
4723  }
4724 
4725  return GetSerializedSize ();
4726 }
4727 
4728 void
4730 {
4731  os << "rrcTransactionIdentifier: " << (int) m_rrcTransactionIdentifier << std::endl;
4732  os << "haveMeasConfig: " << m_haveMeasConfig << std::endl;
4733  if (m_haveMeasConfig)
4734  {
4735  if (!m_measConfig.measObjectToRemoveList.empty ())
4736  {
4737  os << " measObjectToRemoveList: ";
4738  std::list<uint8_t> auxList = m_measConfig.measObjectToRemoveList;
4739  std::list<uint8_t>::iterator it = auxList.begin ();
4740  for (; it != auxList.end (); it++)
4741  {
4742  os << (int) *it << ", ";
4743  }
4744  os << std::endl;
4745  }
4746  if (!m_measConfig.reportConfigToRemoveList.empty ())
4747  {
4748  os << " reportConfigToRemoveList: ";
4749  std::list<uint8_t> auxList = m_measConfig.reportConfigToRemoveList;
4750  std::list<uint8_t>::iterator it = auxList.begin ();
4751  for (; it != auxList.end (); it++)
4752  {
4753  os << (int) *it << ", ";
4754  }
4755  os << std::endl;
4756  }
4757  if (!m_measConfig.measIdToRemoveList.empty ())
4758  {
4759  os << " measIdToRemoveList: ";
4760  std::list<uint8_t> auxList = m_measConfig.measIdToRemoveList;
4761  std::list<uint8_t>::iterator it = auxList.begin ();
4762  for (; it != auxList.end (); it++)
4763  {
4764  os << (int) *it << ", ";
4765  }
4766  os << std::endl;
4767  }
4768 
4769  if (!m_measConfig.measObjectToAddModList.empty ())
4770  {
4771  os << " measObjectToAddMod: " << std::endl;
4772  std::list<LteRrcSap::MeasObjectToAddMod> auxList = m_measConfig.measObjectToAddModList;
4773  std::list<LteRrcSap::MeasObjectToAddMod>::iterator it = auxList.begin ();
4774  for (; it != auxList.end (); it++)
4775  {
4776  os << " measObjectId: " << (int)it->measObjectId << std::endl;
4777  os << " carrierFreq: " << (int)it->measObjectEutra.carrierFreq << std::endl;
4778  os << " allowedMeasBandwidth: " << (int)it->measObjectEutra.allowedMeasBandwidth << std::endl;
4779  os << " presenceAntennaPort1: " << it->measObjectEutra.presenceAntennaPort1 << std::endl;
4780  os << " neighCellConfig: " << (int) it->measObjectEutra.neighCellConfig << std::endl;
4781  os << " offsetFreq: " << (int)it->measObjectEutra.offsetFreq << std::endl;
4782 
4783 
4784  if (!it->measObjectEutra.cellsToRemoveList.empty ())
4785  {
4786  os << " cellsToRemoveList: ";
4787  std::list<uint8_t> auxList = it->measObjectEutra.cellsToRemoveList;
4788  std::list<uint8_t>::iterator it = auxList.begin ();
4789  for (; it != auxList.end (); it++)
4790  {
4791  os << (int) *it << ", ";
4792  }
4793  os << std::endl;
4794  }
4795 
4796  if (!it->measObjectEutra.blackCellsToRemoveList.empty ())
4797  {
4798  os << " blackCellsToRemoveList: ";
4799  std::list<uint8_t> auxList = it->measObjectEutra.blackCellsToRemoveList;
4800  std::list<uint8_t>::iterator it = auxList.begin ();
4801  for (; it != auxList.end (); it++)
4802  {
4803  os << (int) *it << ", ";
4804  }
4805  os << std::endl;
4806  }
4807 
4808  if (!it->measObjectEutra.cellsToAddModList.empty ())
4809  {
4810  os << " cellsToAddModList: " << std::endl;
4811  std::list<LteRrcSap::CellsToAddMod> auxList = it->measObjectEutra.cellsToAddModList;
4812  std::list<LteRrcSap::CellsToAddMod>::iterator it = auxList.begin ();
4813  for (; it != auxList.end (); it++)
4814  {
4815  os << " cellIndex: " << (int)it->cellIndex << std::endl;
4816  os << " physCellId: " << (int)it->physCellId << std::endl;
4817  os << " cellIndividualOffset: " << (int)it->cellIndividualOffset << std::endl;
4818  os << " ------ " << std::endl;
4819  }
4820  }
4821 
4822  if (!it->measObjectEutra.blackCellsToAddModList.empty ())
4823  {
4824  os << " blackCellsToAddModList: " << std::endl;
4825  std::list<LteRrcSap::BlackCellsToAddMod> auxList = it->measObjectEutra.blackCellsToAddModList;
4826  std::list<LteRrcSap::BlackCellsToAddMod>::iterator it = auxList.begin ();
4827  for (; it != auxList.end (); it++)
4828  {
4829  os << " cellIndex: " << (int)it->cellIndex << std::endl;
4830  os << " physCellIdRange.start: " << (int)it->physCellIdRange.start << std::endl;
4831  os << " physCellIdRange.haveRange: " << it->physCellIdRange.haveRange << std::endl;
4832  os << " physCellIdRange.range: " << (int)it->physCellIdRange.range << std::endl;
4833  os << " ------ " << std::endl;
4834  }
4835  }
4836 
4837  os << " haveCellForWhichToReportCGI: " << it->measObjectEutra.haveCellForWhichToReportCGI << std::endl;
4838  os << " cellForWhichToReportCGI: " << (int)it->measObjectEutra.cellForWhichToReportCGI << std::endl;
4839  os << " ------------- " << std::endl;
4840  }
4841 
4842  }
4843 
4844  if (!m_measConfig.reportConfigToAddModList.empty ())
4845  {
4846  os << " reportConfigToAddModList: " << std::endl;
4847  std::list<LteRrcSap::ReportConfigToAddMod> auxList = m_measConfig.reportConfigToAddModList;
4848  std::list<LteRrcSap::ReportConfigToAddMod>::iterator it = auxList.begin ();
4849  for (; it != auxList.end (); it++)
4850  {
4851  os << " reportConfigId: " << (int)it->reportConfigId << std::endl;
4852  os << " reportConfigEutra.triggerType " << (int)it->reportConfigEutra.triggerType << std::endl;
4853  if (it->reportConfigEutra.triggerType == LteRrcSap::ReportConfigEutra::EVENT)
4854  {
4855  os << " reportConfigEutra.eventId " << (int)it->reportConfigEutra.eventId << std::endl;
4856  if (it->reportConfigEutra.eventId == LteRrcSap::ReportConfigEutra::EVENT_A3)
4857  {
4858  os << " reportConfigEutra.reportOnLeave " << (int)it->reportConfigEutra.reportOnLeave << std::endl;
4859  os << " reportConfigEutra.a3Offset " << (int)it->reportConfigEutra.a3Offset << std::endl;
4860  }
4861  else
4862  {
4863  os << " reportConfigEutra.threshold1.choice " << (int)it->reportConfigEutra.threshold1.choice << std::endl;
4864  os << " reportConfigEutra.threshold1.range " << (int)it->reportConfigEutra.threshold1.range << std::endl;
4865  if (it->reportConfigEutra.eventId == LteRrcSap::ReportConfigEutra::EVENT_A5)
4866  {
4867  os << " reportConfigEutra.threshold2.choice " << (int)it->reportConfigEutra.threshold2.choice << std::endl;
4868  os << " reportConfigEutra.threshold2.range " << (int)it->reportConfigEutra.threshold2.range << std::endl;
4869  }
4870  }
4871  os << " reportConfigEutra.hysteresis " << (int)it->reportConfigEutra.hysteresis << std::endl;
4872  os << " reportConfigEutra.timeToTrigger " << (int)it->reportConfigEutra.timeToTrigger << std::endl;
4873  }
4874  else
4875  {
4876  os << " reportConfigEutra.purpose " << (int)it->reportConfigEutra.purpose << std::endl;
4877  }
4878  os << " reportConfigEutra.triggerQuantity " << (int)it->reportConfigEutra.triggerQuantity << std::endl;
4879  os << " reportConfigEutra.reportQuantity " << (int)it->reportConfigEutra.reportQuantity << std::endl;
4880  os << " reportConfigEutra.maxReportCells " << (int)it->reportConfigEutra.maxReportCells << std::endl;
4881  os << " reportConfigEutra.reportInterval " << (int)it->reportConfigEutra.reportInterval << std::endl;
4882  os << " reportConfigEutra.reportAmount " << (int)it->reportConfigEutra.reportAmount << std::endl;
4883  }
4884  }
4885 
4886  if (!m_measConfig.measIdToAddModList.empty ())
4887  {
4888  os << " measIdToAddModList: " << std::endl;
4889  std::list<LteRrcSap::MeasIdToAddMod> auxList = m_measConfig.measIdToAddModList;
4890  std::list<LteRrcSap::MeasIdToAddMod>::iterator it = auxList.begin ();
4891  for (; it != auxList.end (); it++)
4892  {
4893  os << " measId: " << (int)it->measId << std::endl;
4894  os << " measObjectId: " << (int)it->measObjectId << std::endl;
4895  os << " reportConfigId: " << (int)it->reportConfigId << std::endl;
4896  os << " ------ " << std::endl;
4897  }
4898  }
4899 
4900  os << " haveQuantityConfig: " << m_measConfig.haveQuantityConfig << std::endl;
4902  {
4903  os << " filterCoefficientRSRP: " << (int)m_measConfig.quantityConfig.filterCoefficientRSRP << std::endl;
4904  os << " filterCoefficientRSRQ:" << (int)m_measConfig.quantityConfig.filterCoefficientRSRQ << std::endl;
4905  }
4906 
4907  os << " haveMeasGapConfig: " << m_measConfig.haveMeasGapConfig << std::endl;
4909  {
4910  os << " measGapConfig.type: " << m_measConfig.measGapConfig.type << std::endl;
4911  os << " measGapConfig.gap (gap0/1,value): (" << m_measConfig.measGapConfig.gapOffsetChoice
4912  << "," << (int) m_measConfig.measGapConfig.gapOffsetValue << ")" << std::endl;
4913  }
4914 
4915  os << " haveSmeasure: " << m_measConfig.haveSmeasure << std::endl;
4917  {
4918  os << " sMeasure: " << (int) m_measConfig.sMeasure << std::endl;
4919  }
4920 
4921  os << " haveSpeedStatePars: " << m_measConfig.haveSpeedStatePars << std::endl;
4923  {
4924  os << " speedStatePars.type: " << m_measConfig.speedStatePars.type << std::endl;
4925  os << " speedStatePars.mobilityStateParameters.tEvaluation: " << (int)m_measConfig.speedStatePars.mobilityStateParameters.tEvaluation << std::endl;
4926  os << " speedStatePars.mobilityStateParameters.tHystNormal: " << (int)m_measConfig.speedStatePars.mobilityStateParameters.tHystNormal << std::endl;
4927  os << " speedStatePars.mobilityStateParameters.nCellChangeMedium: " << (int)m_measConfig.speedStatePars.mobilityStateParameters.nCellChangeMedium << std::endl;
4928  os << " speedStatePars.mobilityStateParameters.nCellChangeHigh: " << (int)m_measConfig.speedStatePars.mobilityStateParameters.nCellChangeHigh << std::endl;
4929  os << " speedStatePars.timeToTriggerSf.sfMedium: " << (int)m_measConfig.speedStatePars.timeToTriggerSf.sfMedium << std::endl;
4930  os << " speedStatePars.timeToTriggerSf.sfHigh: " << (int)m_measConfig.speedStatePars.timeToTriggerSf.sfHigh << std::endl;
4931  }
4932  }
4933 
4934  os << "haveMobilityControlInfo: " << m_haveMobilityControlInfo << std::endl;
4936  {
4937  os << "targetPhysCellId: " << (int)m_mobilityControlInfo.targetPhysCellId << std::endl;
4938  os << "haveCarrierFreq: " << m_mobilityControlInfo.haveCarrierFreq << std::endl;
4940  {
4941  os << " carrierFreq.dlCarrierFreq: " << (int) m_mobilityControlInfo.carrierFreq.dlCarrierFreq << std::endl;
4942  os << " carrierFreq.dlCarrierFreq: " << (int) m_mobilityControlInfo.carrierFreq.ulCarrierFreq << std::endl;
4943  }
4944  os << "haveCarrierBandwidth: " << m_mobilityControlInfo.haveCarrierBandwidth << std::endl;
4946  {
4947  os << " carrierBandwidth.dlBandwidth: " << (int) m_mobilityControlInfo.carrierBandwidth.dlBandwidth << std::endl;
4948  os << " carrierBandwidth.ulBandwidth: " << (int) m_mobilityControlInfo.carrierBandwidth.ulBandwidth << std::endl;
4949  }
4950  os << "newUeIdentity: " << (int) m_mobilityControlInfo.newUeIdentity << std::endl;
4951  os << "haveRachConfigDedicated: " << m_mobilityControlInfo.haveRachConfigDedicated << std::endl;
4953  {
4954  os << "raPreambleIndex: " << (int) m_mobilityControlInfo.rachConfigDedicated.raPreambleIndex << std::endl;
4955  os << "raPrachMaskIndex: " << (int) m_mobilityControlInfo.rachConfigDedicated.raPrachMaskIndex << std::endl;
4956  }
4957  }
4958  os << "haveRadioResourceConfigDedicated: " << m_haveRadioResourceConfigDedicated << std::endl;
4960  {
4962  }
4963 }
4964 
4965 void
4967 {
4970  m_measConfig = msg.measConfig;
4975 
4976  m_isDataSerialized = false;
4977 }
4978 
4981 {
4983 
4986  msg.measConfig = m_measConfig;
4991 
4992  return msg;
4993 }
4994 
4995 uint8_t
4997 {
4999 }
5000 
5001 bool
5003 {
5004  return m_haveMeasConfig;
5005 }
5006 
5009 {
5010  return m_measConfig;
5011 }
5012 
5013 bool
5015 {
5017 }
5018 
5021 {
5022  return m_mobilityControlInfo;
5023 }
5024 
5025 bool
5027 {
5029 }
5030 
5033 {
5035 }
5036 
5037 bool
5039 {
5041 }
5042 
5043 std::list<LteRrcSap::SrbToAddMod>
5045 {
5047 }
5048 
5049 std::list<LteRrcSap::DrbToAddMod>
5051 {
5053 }
5054 
5055 std::list<uint8_t>
5057 {
5059 }
5060 
5063 {
5065 }
5066 
5067 
5069 
5071 {
5072 }
5073 
5074 void
5076 {
5078 
5079  // Serialize HandoverPreparationInformation sequence:
5080  // no default or optional fields. Extension marker not present.
5081  SerializeSequence (std::bitset<0> (),false);
5082 
5083  // Serialize criticalExtensions choice
5084  // 2 options, selected 0 (c1)
5085  SerializeChoice (2,0,false);
5086 
5087  // Serialize c1 choice
5088  // 8 options, selected 0 (handoverPreparationInformation-r8)
5089  SerializeChoice (8,0,false);
5090 
5091  // Serialize HandoverPreparationInformation-r8-IEs sequence
5092  // 4 optional fields, no extension marker.
5093  std::bitset<4> handoverPrepInfoOpts;
5094  handoverPrepInfoOpts.set (3,1); // as-Config present
5095  handoverPrepInfoOpts.set (2,0); // rrm-Config not present
5096  handoverPrepInfoOpts.set (1,0); // as-Context not present
5097  handoverPrepInfoOpts.set (0,0); // nonCriticalExtension not present
5098  SerializeSequence (handoverPrepInfoOpts,false);
5099 
5100  // Serialize ue-RadioAccessCapabilityInfo
5102 
5103  // Serialize as-Config
5104  SerializeSequence (std::bitset<0> (),true);
5105 
5106  // Serialize sourceMeasConfig
5108 
5109  // Serialize sourceRadioResourceConfig
5111 
5112  // Serialize sourceSecurityAlgorithmConfig
5113  SerializeSequence (std::bitset<0> (),false);
5114  // cipheringAlgorithm
5115  SerializeEnum (8,0);
5116  // integrityProtAlgorithm
5117  SerializeEnum (8,0);
5118 
5119  // Serialize sourceUE-Identity
5120  SerializeBitstring (std::bitset<16> (m_asConfig.sourceUeIdentity));
5121 
5122  // Serialize sourceMasterInformationBlock
5123  SerializeSequence (std::bitset<0> (),false);
5125  SerializeSequence (std::bitset<0> (),false); // phich-Config sequence
5126  SerializeEnum (2,0); // phich-Duration
5127  SerializeEnum (4,0); // phich-Resource
5128  SerializeBitstring (std::bitset<8> (m_asConfig.sourceMasterInformationBlock.systemFrameNumber)); // systemFrameNumber
5129  SerializeBitstring (std::bitset<10> (321)); // spare
5130 
5131  // Serialize sourceSystemInformationBlockType1 sequence
5133 
5134  // Serialize sourceSystemInformationBlockType2
5136 
5137  // Serialize AntennaInfoCommon
5138  SerializeSequence (std::bitset<0> (0),false);
5139  SerializeEnum (4,0); // antennaPortsCount
5140 
5141  // Serialize sourceDlCarrierFreq
5143 
5144  // Finish serialization
5146 }
5147 
5148 uint32_t
5150 {
5151  std::bitset<0> bitset0;
5152  int n;
5153 
5154  // Deserialize HandoverPreparationInformation sequence
5155  // 0 optional fields, no extension marker
5156  bIterator = DeserializeSequence (&bitset0,false,bIterator);
5157 
5158  // Deserialize criticalExtensions choice
5159  int criticalExtensionsChosen;
5160  bIterator = DeserializeChoice (2,false,&criticalExtensionsChosen,bIterator);
5161 
5162  if (criticalExtensionsChosen == 1)
5163  {
5164  // Deserialize criticalExtensionsFuture
5165  bIterator = DeserializeSequence (&bitset0,false,bIterator);
5166  }
5167  else if (criticalExtensionsChosen == 0)
5168  {
5169  // Deserialize c1 choice
5170  int c1Chosen;
5171  bIterator = DeserializeChoice (8,false,&c1Chosen,bIterator);
5172  if (c1Chosen > 0)
5173  {
5174  bIterator = DeserializeNull (bIterator);
5175  }
5176  else if (c1Chosen == 0)
5177  {
5178  // Deserialize handoverPreparationInformation-r8
5179  std::bitset<4> handoverPrepInfoOpts;
5180  bIterator = DeserializeSequence (&handoverPrepInfoOpts,false,bIterator);
5181 
5182  // Deserialize ue-RadioAccessCapabilityInfo
5183  bIterator = DeserializeSequenceOf (&n,MAX_RAT_CAPABILITIES,0,bIterator);
5184  for (int i = 0; i < n; i++)
5185  {
5186  // Deserialize UE-CapabilityRAT-Container
5187  // ...
5188  }
5189 
5190  if (handoverPrepInfoOpts[3])
5191  {
5192  // Deserialize as-Config sequence
5193  bIterator = DeserializeSequence (&bitset0,true,bIterator);
5194 
5195  // Deserialize sourceMeasConfig
5196  bIterator = DeserializeMeasConfig (&m_asConfig.sourceMeasConfig, bIterator);
5197 
5198  // Deserialize sourceRadioResourceConfig
5200 
5201  // Deserialize sourceSecurityAlgorithmConfig
5202  bIterator = DeserializeSequence (&bitset0,false,bIterator);
5203  bIterator = DeserializeEnum (8,&n,bIterator); // cipheringAlgorithm
5204  bIterator = DeserializeEnum (8,&n,bIterator); // integrityProtAlgorithm
5205 
5206  // Deserialize sourceUE-Identity
5207  std::bitset<16> cRnti;
5208  bIterator = DeserializeBitstring (&cRnti,bIterator);
5209  m_asConfig.sourceUeIdentity = cRnti.to_ulong ();
5210 
5211  // Deserialize sourceMasterInformationBlock
5212  bIterator = DeserializeSequence (&bitset0,false,bIterator);
5213  bIterator = DeserializeEnum (6,&n,bIterator); // dl-Bandwidth
5215 
5216  // phich-Config
5217  bIterator = DeserializeSequence (&bitset0,false,bIterator);
5218  bIterator = DeserializeEnum (2,&n,bIterator); // phich-Duration
5219  bIterator = DeserializeEnum (4,&n,bIterator); // phich-Resource
5220 
5221  // systemFrameNumber
5222  std::bitset<8> systemFrameNumber;
5223  bIterator = DeserializeBitstring (&systemFrameNumber,bIterator);
5224  m_asConfig.sourceMasterInformationBlock.systemFrameNumber = systemFrameNumber.to_ulong ();
5225  // spare
5226  std::bitset<10> spare;
5227  bIterator = DeserializeBitstring (&spare,bIterator);
5228 
5229  // Deserialize sourceSystemInformationBlockType1
5231 
5232  // Deserialize sourceSystemInformationBlockType2
5234 
5235  // Deserialize antennaInfoCommon
5236  bIterator = DeserializeSequence (&bitset0,false,bIterator);
5237  bIterator = DeserializeEnum (4,&n,bIterator); // antennaPortsCount
5238 
5239  // Deserialize sourceDl-CarrierFreq
5240  bIterator = DeserializeInteger (&n,0,MAX_EARFCN,bIterator);
5242  }
5243  if (handoverPrepInfoOpts[2])
5244  {
5245  // Deserialize rrm-Config
5246  // ...
5247  }
5248  if (handoverPrepInfoOpts[1])
5249  {
5250  // Deserialize as-Context
5251  // ...
5252  }
5253  if (handoverPrepInfoOpts[0])
5254  {
5255  // Deserialize nonCriticalExtension
5256  // ...
5257  }
5258  }
5259  }
5260 
5261  return GetSerializedSize ();
5262 }
5263 
5264 void
5266 {
5268  os << "sourceUeIdentity: " << m_asConfig.sourceUeIdentity << std::endl;
5269  os << "dlBandwidth: " << (int)m_asConfig.sourceMasterInformationBlock.dlBandwidth << std::endl;
5270  os << "systemFrameNumber: " << (int)m_asConfig.sourceMasterInformationBlock.systemFrameNumber << std::endl;
5271  os << "plmnIdentityInfo.plmnIdentity: " << (int) m_asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity << std::endl;
5272  os << "cellAccessRelatedInfo.cellIdentity " << (int)m_asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.cellIdentity << std::endl;
5273  os << "cellAccessRelatedInfo.csgIndication: " << m_asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIndication << std::endl;
5274  os << "cellAccessRelatedInfo.csgIdentity: " << (int)m_asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIdentity << std::endl;
5275  os << "sourceDlCarrierFreq: " << m_asConfig.sourceDlCarrierFreq << std::endl;
5276 }
5277 
5278 void
5280 {
5281  m_asConfig = msg.asConfig;
5282  m_isDataSerialized = false;
5283 }
5284 
5287 {
5289  msg.asConfig = m_asConfig;
5290 
5291  return msg;
5292 }
5293 
5296 {
5297  return m_asConfig;
5298 }
5299 
5301 
5303 {
5304 }
5305 
5307 {
5308 }
5309 
5310 void
5312 {
5314 
5316 
5317  // Serialize RrcConnectionReestablishmentReques sequence:
5318  // no default or optional fields. Extension marker not present.
5319  SerializeSequence (std::bitset<0> (),false);
5320 
5321  // Serialize criticalExtensions choice
5322  // chosen: rrcConnectionReestablishmentRequest-r8
5323  SerializeChoice (2,0,false);
5324 
5325  // Serialize RRCConnectionReestablishmentRequest-r8-IEs sequence
5326  // no default or optional fields. Extension marker not present.
5327  SerializeSequence (std::bitset<0> (),false);
5328 
5329  // Serialize ue-Identity
5330  SerializeSequence (std::bitset<0> (),false);
5331  // Serialize c-RNTI
5332  SerializeBitstring (std::bitset<16> (m_ueIdentity.cRnti));
5333  // Serialize physCellId
5335  // Serialize shortMAC-I
5336  SerializeBitstring (std::bitset<16> (0));
5337 
5338  // Serialize ReestablishmentCause
5339  switch (m_reestablishmentCause)
5340  {
5342  SerializeEnum (4,0);
5343  break;
5345  SerializeEnum (4,1);
5346  break;
5348  SerializeEnum (4,2);
5349  break;
5350  default:
5351  SerializeEnum (4,3);
5352  }
5353 
5354  // Serialize spare
5355  SerializeBitstring (std::bitset<2> (0));
5356 
5357  // Finish serialization
5359 }
5360 
5361 uint32_t
5363 {
5364  std::bitset<0> bitset0;
5365  int n;
5366 
5367  bIterator = DeserializeUlCcchMessage (bIterator);
5368 
5369  // Deserialize RrcConnectionReestablishmentRequest sequence
5370  // 0 optional fields, no extension marker
5371  bIterator = DeserializeSequence (&bitset0,false,bIterator);
5372 
5373  // Deserialize criticalExtensions choice
5374  bIterator = DeserializeChoice (2,false,&n,bIterator);
5375  if ( n == 1)
5376  {
5377  // Deserialize criticalExtensionsFuture
5378  bIterator = DeserializeSequence (&bitset0,false,bIterator);
5379  }
5380  else if ( n == 0)
5381  {
5382  // Deserialize RRCConnectionReestablishmentRequest-r8-IEs
5383  bIterator = DeserializeSequence (&bitset0,false,bIterator);
5384 
5385  // Deserialize ReestabUE-Identity sequence
5386  bIterator = DeserializeSequence (&bitset0,false,bIterator);
5387 
5388  // Deserialize c-RNTI
5389  std::bitset<16> cRnti;
5390  bIterator = DeserializeBitstring (&cRnti,bIterator);
5391  m_ueIdentity.cRnti = cRnti.to_ulong ();
5392 
5393  // Deserialize physCellId
5394  int physCellId;
5395  bIterator = DeserializeInteger (&physCellId,0,503,bIterator);
5396  m_ueIdentity.physCellId = physCellId;
5397 
5398  // Deserialize shortMAC-I
5399  std::bitset<16> shortMacI;
5400  bIterator = DeserializeBitstring (&shortMacI,bIterator);
5401 
5402  // Deserialize ReestablishmentCause
5403  int reestCs;
5404  bIterator = DeserializeEnum (4,&reestCs,bIterator);
5405  switch (reestCs)
5406  {
5407  case 0:
5409  break;
5410  case 1:
5412  break;
5413  case 2:
5415  break;
5416  case 3:
5417  break;
5418  }
5419 
5420  // Deserialize spare
5421  std::bitset<2> spare;
5422  bIterator = DeserializeBitstring (&spare,bIterator);
5423  }
5424 
5425  return GetSerializedSize ();
5426 }
5427 
5428 void
5430 {
5431  os << "ueIdentity.cRnti: " << (int)m_ueIdentity.cRnti << std::endl;
5432  os << "ueIdentity.physCellId: " << (int)m_ueIdentity.physCellId << std::endl;
5433  os << "m_reestablishmentCause: " << m_reestablishmentCause << std::endl;
5434 }
5435 
5436 void
5438 {
5439  m_ueIdentity = msg.ueIdentity;
5441  m_isDataSerialized = false;
5442 }
5443 
5446 {
5448  msg.ueIdentity = m_ueIdentity;
5450 
5451  return msg;
5452 }
5453 
5456 {
5457  return m_ueIdentity;
5458 }
5459 
5462 {
5463  return m_reestablishmentCause;
5464 }
5465 
5467 
5469 {
5470 }
5471 
5473 {
5474 }
5475 
5476 void
5478 {
5480 
5482 
5483  // Serialize RrcConnectionReestablishment sequence:
5484  // no default or optional fields. Extension marker not present.
5485  SerializeSequence (std::bitset<0> (),false);
5486 
5487  // Serialize rrc-TransactionIdentifier
5489 
5490  // Serialize criticalExtensions choice
5491  SerializeChoice (2,0,false);
5492 
5493  // Serialize c1 choice
5494  SerializeChoice (8,0,false);
5495 
5496  // Serialize RRCConnectionReestablishment-r8-IEs sequence
5497  // 1 optional field, no extension marker
5498  SerializeSequence (std::bitset<1> (0),false);
5499 
5500  // Serialize radioResourceConfigDedicated
5502 
5503  // Serialize nextHopChainingCount
5504  SerializeInteger (0,0,7);
5505 
5506  // Finish serialization
5508 }
5509 
5510 uint32_t
5512 {
5513  std::bitset<0> bitset0;
5514  int n;
5515 
5516  bIterator = DeserializeDlCcchMessage (bIterator);
5517 
5518  // Deserialize RrcConnectionReestablishment sequence
5519  // 0 optional fields, no extension marker
5520  bIterator = DeserializeSequence (&bitset0,false,bIterator);
5521 
5522  // Deserialize rrc-TransactionIdentifier
5523  bIterator = DeserializeInteger (&n,0,3,bIterator);
5525 
5526  // Deserialize criticalExtensions choice
5527  int criticalExtensionsChoice;
5528  bIterator = DeserializeChoice (2,false,&criticalExtensionsChoice,bIterator);
5529  if (criticalExtensionsChoice == 1)
5530  {
5531  // Deserialize criticalExtensionsFuture
5532  bIterator = DeserializeSequence (&bitset0,false,bIterator);
5533  }
5534  else if (criticalExtensionsChoice == 0)
5535  {
5536  // Deserialize c1
5537  int c1;
5538  bIterator = DeserializeChoice (8,false,&c1,bIterator);
5539  if (c1 > 0)
5540  {
5541  bIterator = DeserializeNull (bIterator);
5542  }
5543  else if (c1 == 0)
5544  {
5545  // Deserialize rrcConnectionReestablishment-r8
5546  // 1 optional field
5547  std::bitset<1> nonCriticalExtensionPresent;
5548  bIterator = DeserializeSequence (&nonCriticalExtensionPresent,false,bIterator);
5549 
5550  // Deserialize RadioResourceConfigDedicated
5552 
5553  // Deserialize nextHopChainingCount
5554  bIterator = DeserializeInteger (&n,0,7,bIterator);
5555  }
5556  }
5557 
5558  return GetSerializedSize ();
5559 }
5560 
5561 void
5563 {
5564  os << "rrcTransactionIdentifier: " << (int)m_rrcTransactionIdentifier << std::endl;
5565  os << "RadioResourceConfigDedicated: " << std::endl;
5567 }
5568 
5569 void
5571 {
5574  m_isDataSerialized = false;
5575 }
5576 
5579 {
5583  return msg;
5584 }
5585 
5586 uint8_t
5588 {
5590 }
5591 
5594 {
5596 }
5597 
5599 
5601 {
5602 }
5603 
5604 void
5606 {
5608 
5609  // Serialize DCCH message
5611 
5612  // Serialize RrcConnectionReestablishmentComplete sequence:
5613  // no default or optional fields. Extension marker not present.
5614  SerializeSequence (std::bitset<0> (),false);
5615 
5616  // Serialize rrc-TransactionIdentifier
5618 
5619  // Serialize criticalExtensions choice
5620  SerializeChoice (2,0,false);
5621 
5622  // Serialize rrcConnectionReestablishmentComplete-r8 sequence
5623  // 1 optional field (not present), no extension marker.
5624  SerializeSequence (std::bitset<1> (0),false);
5625 
5626  // Finish serialization
5628 }
5629 
5630 uint32_t
5632 {
5633  std::bitset<0> bitset0;
5634  int n;
5635 
5636  bIterator = DeserializeUlDcchMessage (bIterator);
5637 
5638  // Deserialize RrcConnectionReestablishmentComplete sequence
5639  // 0 optional fields, no extension marker
5640  bIterator = DeserializeSequence (&bitset0,