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