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