This file is indexed.

/usr/include/ns3.27/ns3/lte-rrc-header.h is in libns3-dev 3.27+dfsg-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Lluis Parcerisa <lparcerisa@cttc.cat>
 * Modified by:
 *          Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015)
 *          Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
 */

#ifndef RRC_HEADER_H
#define RRC_HEADER_H

#include "ns3/header.h"

#include <bitset>
#include <string>

#include "ns3/lte-rrc-sap.h"
#include "ns3/lte-asn1-header.h"

namespace ns3 {

/**
 * \ingroup lte
 */

/**
 * This class extends Asn1Header functions, adding serialization/deserialization
 * of some Information elements defined in 3GPP TS 36.331
 */
class RrcAsn1Header : public Asn1Header
{
public:
  RrcAsn1Header ();
  /**
   * Get message type
   *
   * \returns the message type
   */
  int GetMessageType ();

protected:
  /**
   * \brief Get the type ID.
   * \return the object TypeId
   */
  static TypeId GetTypeId (void);
  // Inherited from Asn1Header
  virtual TypeId GetInstanceTypeId (void) const;
  uint32_t Deserialize (Buffer::Iterator bIterator) = 0;
  virtual void PreSerialize (void) const = 0;

  // Serialization functions
  /**
   * Serialize SRB to add mod list function
   *
   * \param srbToAddModList std::list<LteRrcSap::SrbToAddMod>
   */
  void SerializeSrbToAddModList (std::list<LteRrcSap::SrbToAddMod> srbToAddModList) const;
  /**
   * Serialize DRB to add mod list function
   *
   * \param drbToAddModList std::list<LteRrcSap::SrbToAddMod>
   */
  void SerializeDrbToAddModList (std::list<LteRrcSap::DrbToAddMod> drbToAddModList) const;
  /**
   * Serialize logicala channel config function
   *
   * \param logicalChannelConfig LteRrcSap::LogicalChannelConfig
   */
  void SerializeLogicalChannelConfig (LteRrcSap::LogicalChannelConfig logicalChannelConfig) const;
  /**
   * Serialize radio resource config function
   *
   * \param radioResourceConfigDedicated LteRrcSap::RadioResourceConfigDedicated
   */
  void SerializeRadioResourceConfigDedicated (LteRrcSap::RadioResourceConfigDedicated radioResourceConfigDedicated) const;
  /**
   * Serialize physical config dedicated function
   *
   * \param physicalConfigDedicated LteRrcSap::PhysicalConfigDedicated
   */
  void SerializePhysicalConfigDedicated (LteRrcSap::PhysicalConfigDedicated physicalConfigDedicated) const;
  /**
   * Serialize physical config dedicated function
   *
   * \param pcdsc LteRrcSap::PhysicalConfigDedicatedSCell
   */
  void SerializePhysicalConfigDedicatedSCell (LteRrcSap::PhysicalConfigDedicatedSCell pcdsc) const;
  /**
   * Serialize system information block type 1 function
   *
   * \param systemInformationBlockType1 LteRrcSap::SystemInformationBlockType1
   */
  void SerializeSystemInformationBlockType1 (LteRrcSap::SystemInformationBlockType1 systemInformationBlockType1) const;
  /**
   * Serialize system information block type 2 function
   *
   * \param systemInformationBlockType2 LteRrcSap::SystemInformationBlockType2
   */
  void SerializeSystemInformationBlockType2 (LteRrcSap::SystemInformationBlockType2 systemInformationBlockType2) const;
  /**
   * Serialize system information block type 2 function
   *
   * \param radioResourceConfigCommon LteRrcSap::RadioResourceConfigCommon
   */
  void SerializeRadioResourceConfigCommon (LteRrcSap::RadioResourceConfigCommon radioResourceConfigCommon) const;
  /**
   * Serialize radio resource config common SIB function
   *
   * \param radioResourceConfigCommonSib LteRrcSap::RadioResourceConfigCommonSib
   */
  void SerializeRadioResourceConfigCommonSib (LteRrcSap::RadioResourceConfigCommonSib radioResourceConfigCommonSib) const;
  /**
   * Serialize measure results function
   *
   * \param measResults LteRrcSap::MeasResults
   */
  void SerializeMeasResults (LteRrcSap::MeasResults measResults) const;
  /**
   * Serialize PLMN identity function
   *
   * \param plmnId the PLMN ID
   */
  void SerializePlmnIdentity (uint32_t plmnId) const;
  /**
   * Serialize RACH config common function
   *
   * \param rachConfigCommon LteRrcSap::RachConfigCommon
   */
  void SerializeRachConfigCommon (LteRrcSap::RachConfigCommon rachConfigCommon) const;
  /**
   * Serialize measure config function
   *
   * \param measConfig LteRrcSap::MeasConfig
   */
  void SerializeMeasConfig (LteRrcSap::MeasConfig measConfig) const;
  /**
   * Serialize non critical extension config function
   *
   * \param nonCriticalExtensionConfiguration LteRrcSap::NonCriticalExtensionConfiguration
   */
  void SerializeNonCriticalExtensionConfiguration (LteRrcSap::NonCriticalExtensionConfiguration nonCriticalExtensionConfiguration) const;
  /**
   * Serialize radio resource config common SCell function
   *
   * \param rrccsc LteRrcSap::RadioResourceConfigCommonSCell
   */
  void SerializeRadioResourceConfigCommonSCell (LteRrcSap::RadioResourceConfigCommonSCell rrccsc) const;
  /**
   * Serialize radio resource dedicated SCell function
   *
   * \param rrcdsc LteRrcSap::RadioResourceConfigDedicatedSCell
   */
  void SerializeRadioResourceDedicatedSCell (LteRrcSap::RadioResourceConfigDedicatedSCell rrcdsc) const;
  /**
   * Serialize Q offset range function
   *
   * \param qOffsetRange q offset range
   */
  void SerializeQoffsetRange (int8_t qOffsetRange) const;
  /**
   * Serialize threshold eutra function
   *
   * \param thresholdEutra LteRrcSap::ThresholdEutra
   */
  void SerializeThresholdEutra (LteRrcSap::ThresholdEutra thresholdEutra) const;
  
  // Deserialization functions
  /**
   * Deserialize DRB to add mod list function
   *
   * \param drbToAddModLis std::list<LteRrcSap::DrbToAddMod> *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeDrbToAddModList (std::list<LteRrcSap::DrbToAddMod> *drbToAddModLis, Buffer::Iterator bIterator);
  /**
   * Deserialize SRB to add mod list function
   *
   * \param srbToAddModList std::list<LteRrcSap::SrbToAddMod> *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeSrbToAddModList (std::list<LteRrcSap::SrbToAddMod> *srbToAddModList, Buffer::Iterator bIterator);
  /**
   * Deserialize logical channel config function
   *
   * \param logicalChannelConfig LteRrcSap::LogicalChannelConfig *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeLogicalChannelConfig (LteRrcSap::LogicalChannelConfig *logicalChannelConfig, Buffer::Iterator bIterator);
  /**
   * Deserialize radio resource config dedicated function
   *
   * \param radioResourceConfigDedicated LteRrcSap::RadioResourceConfigDedicated *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeRadioResourceConfigDedicated (LteRrcSap::RadioResourceConfigDedicated *radioResourceConfigDedicated, Buffer::Iterator bIterator);
  /**
   * Deserialize physical config dedicated function
   *
   * \param physicalConfigDedicated LteRrcSap::PhysicalConfigDedicated *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializePhysicalConfigDedicated (LteRrcSap::PhysicalConfigDedicated *physicalConfigDedicated, Buffer::Iterator bIterator);
  /**
   * Deserialize system information block type 1 function
   *
   * \param systemInformationBlockType1 LteRrcSap::SystemInformationBlockType1 *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeSystemInformationBlockType1 (LteRrcSap::SystemInformationBlockType1 *systemInformationBlockType1, Buffer::Iterator bIterator);
  /**
   * Deserialize system information block type 2 function
   *
   * \param systemInformationBlockType2 LteRrcSap::SystemInformationBlockType2 *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeSystemInformationBlockType2 (LteRrcSap::SystemInformationBlockType2 *systemInformationBlockType2, Buffer::Iterator bIterator);
  /**
   * Deserialize radio resource config common function
   *
   * \param radioResourceConfigCommon LteRrcSap::RadioResourceConfigCommon *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeRadioResourceConfigCommon (LteRrcSap::RadioResourceConfigCommon *radioResourceConfigCommon, Buffer::Iterator bIterator);
  /**
   * Deserialize radio resource config common SIB function
   *
   * \param radioResourceConfigCommonSib LteRrcSap::RadioResourceConfigCommonSib *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeRadioResourceConfigCommonSib (LteRrcSap::RadioResourceConfigCommonSib *radioResourceConfigCommonSib, Buffer::Iterator bIterator);
  /**
   * Deserialize measure results function
   *
   * \param measResults LteRrcSap::MeasResults *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeMeasResults (LteRrcSap::MeasResults *measResults, Buffer::Iterator bIterator);
  /**
   * Deserialize PLMN identity function
   *
   * \param plmnId the PLMN ID
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializePlmnIdentity (uint32_t *plmnId, Buffer::Iterator bIterator);
  /**
   * Deserialize RACH config common function
   *
   * \param rachConfigCommon LteRrcSap::RachConfigCommon *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeRachConfigCommon (LteRrcSap::RachConfigCommon * rachConfigCommon, Buffer::Iterator bIterator);
  /**
   * Deserialize measure config function
   *
   * \param measConfig LteRrcSap::MeasConfig *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeMeasConfig (LteRrcSap::MeasConfig * measConfig, Buffer::Iterator bIterator);
  /**
   * Deserialize Qoffset range function
   *
   * \param qOffsetRange Qoffset range
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeQoffsetRange (int8_t * qOffsetRange, Buffer::Iterator bIterator);
  /**
   * Deserialize threshold eutra function
   *
   * \param thresholdEutra LteRrcSap::ThresholdEutra *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeThresholdEutra (LteRrcSap::ThresholdEutra * thresholdEutra, Buffer::Iterator bIterator);
  /**
   * Deserialize non critical extension config function
   *
   * \param nonCriticalExtension LteRrcSap::NonCriticalExtensionConfiguration *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeNonCriticalExtensionConfig (LteRrcSap::NonCriticalExtensionConfiguration * nonCriticalExtension, Buffer::Iterator bIterator);
  /**
   * Deserialize cell identification function
   *
   * \param ci LteRrcSap::CellIdentification *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeCellIdentification (LteRrcSap::CellIdentification * ci, Buffer::Iterator bIterator);
  /**
   * Deserialize radio resource config common SCell function
   *
   * \param rrccsc LteRrcSap::RadioResourceConfigCommonSCell *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeRadioResourceConfigCommonSCell (LteRrcSap::RadioResourceConfigCommonSCell * rrccsc, Buffer::Iterator bIterator);
  /**
   * Deserialize radio resource config dedicated SCell function
   *
   * \param rrcdsc LteRrcSap::RadioResourceConfigDedicatedSCell *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeRadioResourceConfigDedicatedSCell (LteRrcSap::RadioResourceConfigDedicatedSCell * rrcdsc, Buffer::Iterator bIterator);
  /**
   * Deserialize physical config dedicated SCell function
   *
   * \param pcdsc LteRrcSap::PhysicalConfigDedicatedSCell *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializePhysicalConfigDedicatedSCell (LteRrcSap::PhysicalConfigDedicatedSCell *pcdsc, Buffer::Iterator bIterator);

  /**
   * This function prints the object, for debugging purposes.
   * @param os The output stream to use (i.e. std::cout)
   */
  void Print (std::ostream &os) const;
  /**
   * This function prints RadioResourceConfigDedicated IE, for debugging purposes.
   * @param os The output stream to use (i.e. std::cout)
   * @param radioResourceConfigDedicated The information element to be printed
   */
  void Print (std::ostream &os, LteRrcSap::RadioResourceConfigDedicated radioResourceConfigDedicated) const;

  /// Stores RRC message type, according to 3GPP TS 36.331
  int m_messageType;
};


/**
 * This class only serves to discriminate which message type has been received
 * in uplink (ue to eNb) for channel DCCH
 */
class RrcUlDcchMessage : public RrcAsn1Header
{
public:
  RrcUlDcchMessage ();
  ~RrcUlDcchMessage ();

  // Inherited from RrcAsn1Header
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;
  void PreSerialize () const;

protected:
  /**
   * Serialize UL DCCH message function
   *
   * \param msgType message type
   */
  void SerializeUlDcchMessage (int msgType) const;
  /**
   * Deserialize UL DCCH message function
   *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeUlDcchMessage (Buffer::Iterator bIterator);
};

/**
 * This class only serves to discriminate which message type has been received
 * in downlink (eNb to ue) for channel DCCH
 */
class RrcDlDcchMessage : public RrcAsn1Header
{
public:
  RrcDlDcchMessage ();
  ~RrcDlDcchMessage ();

  // Inherited from RrcAsn1Header
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;
  void PreSerialize () const;

protected:
  /**
   * Serialize DL DCCH message function
   *
   * \param msgType message type
   */
  void SerializeDlDcchMessage (int msgType) const;
  /**
   * Deserialize DL DCCH message function
   *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeDlDcchMessage (Buffer::Iterator bIterator);
};

/**
 * This class only serves to discriminate which message type has been received
 * in uplink (ue to eNb) for channel CCCH
 */
class RrcUlCcchMessage : public RrcAsn1Header
{
public:
  RrcUlCcchMessage ();
  ~RrcUlCcchMessage ();

  // Inherited from RrcAsn1Header 
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;
  void PreSerialize () const;

protected:
  /**
   * Serialize UL CCCH message function
   *
   * \param msgType message type
   */
  void SerializeUlCcchMessage (int msgType) const;
  /**
   * Deserialize DL CCCH message function
   *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeUlCcchMessage (Buffer::Iterator bIterator);
};

/**
 * This class only serves to discriminate which message type has been received
 * in downlink (eNb to ue) for channel CCCH
 */
class RrcDlCcchMessage : public RrcAsn1Header
{
public:
  RrcDlCcchMessage ();
  ~RrcDlCcchMessage ();

  // Inherited from RrcAsn1Header 
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;
  void PreSerialize () const;

protected:
  /**
   * Serialize DL CCCH message function
   *
   * \param msgType message type
   */
  void SerializeDlCcchMessage (int msgType) const;
  /**
   * Deserialize DL CCCH message function
   *
   * \param bIterator buffer iterator
   * \returns buffer iterator
   */
  Buffer::Iterator DeserializeDlCcchMessage (Buffer::Iterator bIterator);
};

/**
* This class manages the serialization/deserialization of RrcConnectionRequest IE
*/
class RrcConnectionRequestHeader : public RrcUlCcchMessage
{
public:
  RrcConnectionRequestHeader ();
  ~RrcConnectionRequestHeader ();

  /**
   * \brief Get the type ID.
   * \return the object TypeId
   */
  static TypeId GetTypeId (void);
  // Inherited from RrcAsn1Header 
  void PreSerialize () const;
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;

  /**
   * Receives a RrcConnectionRequest IE and stores the contents into the class attributes
   * @param msg The information element to parse
   */
  void SetMessage (LteRrcSap::RrcConnectionRequest msg);

  /**
   * Returns a RrcConnectionRequest IE from the values in the class attributes
   * @return A RrcConnectionRequest, as defined in LteRrcSap
   */
  LteRrcSap::RrcConnectionRequest GetMessage () const;

  /**
   * Get MMEC attribute
   * @return m_mmec attribute
   */
  std::bitset<8> GetMmec () const;

  /**
   * Get M-TMSI attribute
   * @return m_tmsi attribute
   */
  std::bitset<32> GetMtmsi () const;

private:
  std::bitset<8> m_mmec; ///< MMEC
  std::bitset<32> m_mTmsi; ///< TMSI
  /// EstablishmentCause enumeration
  enum
  {
    EMERGENCY = 0, HIGHPRIORITYACCESS, MT_ACCESS,
    MO_SIGNALLING, MO_DATA, SPARE3, SPARE2, SPARE1
  } m_establishmentCause; ///< the establishent cause
  std::bitset<1> m_spare; ///< spare bit
};

/**
* This class manages the serialization/deserialization of RrcConnectionSetup IE
*/
class RrcConnectionSetupHeader : public RrcDlCcchMessage
{
public:
  RrcConnectionSetupHeader ();
  ~RrcConnectionSetupHeader ();

  // Inherited from RrcAsn1Header 
  void PreSerialize () const;
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;

  /**
  * Receives a RrcConnectionSetup IE and stores the contents into the class attributes
  * @param msg The information element to parse
  */
  void SetMessage (LteRrcSap::RrcConnectionSetup msg);

  /**
  * Returns a RrcConnectionSetup IE from the values in the class attributes
  * @return A RrcConnectionSetup, as defined in LteRrcSap
  */
  LteRrcSap::RrcConnectionSetup GetMessage () const;

  /**
  * Getter for m_rrcTransactionIdentifier
  * @return m_rrcTransactionIdentifier
  */
  uint8_t GetRrcTransactionIdentifier () const;

  /**
  * Getter for m_radioResourceConfigDedicated
  * @return m_radioResourceConfigDedicated
  */
  LteRrcSap::RadioResourceConfigDedicated GetRadioResourceConfigDedicated () const; 

  /**
  * Gets m_radioResourceConfigDedicated.havePhysicalConfigDedicated
  * @return m_radioResourceConfigDedicated.havePhysicalConfigDedicated
  */
  bool HavePhysicalConfigDedicated () const;

  /**
  * Gets m_radioResourceConfigDedicated.physicalConfigDedicated
  * @return m_radioResourceConfigDedicated.physicalConfigDedicated
  */
  LteRrcSap::PhysicalConfigDedicated GetPhysicalConfigDedicated () const;

  /**
  * Gets m_radioResourceConfigDedicated.srbToAddModList
  * @return m_radioResourceConfigDedicated.srbToAddModList
  */
  std::list<LteRrcSap::SrbToAddMod> GetSrbToAddModList () const;

  /**
  * Gets m_radioResourceConfigDedicated.drbToAddModList
  * @return m_radioResourceConfigDedicated.drbToAddModList
  */
  std::list<LteRrcSap::DrbToAddMod> GetDrbToAddModList () const;

  /**
  * Gets m_radioResourceConfigDedicated.drbToReleaseList
  * @return m_radioResourceConfigDedicated.drbToReleaseList
  */
  std::list<uint8_t> GetDrbToReleaseList () const;

private:
  uint8_t m_rrcTransactionIdentifier; ///< RRC transaction identifier
  mutable LteRrcSap::RadioResourceConfigDedicated m_radioResourceConfigDedicated; ///< radio resource config dedicated
};

/**
* This class manages the serialization/deserialization of RrcConnectionSetupComplete IE
*/
class RrcConnectionSetupCompleteHeader : public RrcUlDcchMessage
{
public:
  RrcConnectionSetupCompleteHeader ();
  ~RrcConnectionSetupCompleteHeader ();

  // Inherited from RrcAsn1Header 
  void PreSerialize () const;
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;

  /**
  * Receives a RrcConnectionSetupCompleted IE and stores the contents into the class attributes
  * @param msg The information element to parse
  */
  void SetMessage (LteRrcSap::RrcConnectionSetupCompleted msg);

  /**
  * Returns a RrcConnectionSetupCompleted IE from the values in the class attributes
  * @return A RrcConnectionSetupCompleted, as defined in LteRrcSap
  */
  LteRrcSap::RrcConnectionSetupCompleted GetMessage () const;

  /**
  * Getter for m_rrcTransactionIdentifier
  * @return m_rrcTransactionIdentifier
  */
  uint8_t GetRrcTransactionIdentifier () const;

private:
  uint8_t m_rrcTransactionIdentifier; ///< RRC transaction identifier

};

/**
* This class manages the serialization/deserialization of RrcConnectionSetupComplete IE
*/
class RrcConnectionReconfigurationCompleteHeader : public RrcUlDcchMessage
{
public:
  RrcConnectionReconfigurationCompleteHeader ();
  ~RrcConnectionReconfigurationCompleteHeader ();

  // Inherited from RrcAsn1Header 
  void PreSerialize () const;
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;

  /**
  * Receives a RrcConnectionReconfigurationCompleted IE and stores the contents into the class attributes
  * @param msg The information element to parse
  */
  void SetMessage (LteRrcSap::RrcConnectionReconfigurationCompleted msg);

  /**
  * Returns a RrcConnectionReconfigurationCompleted IE from the values in the class attributes
  * @return A RrcConnectionReconfigurationCompleted, as defined in LteRrcSap
  */
  LteRrcSap::RrcConnectionReconfigurationCompleted GetMessage () const;

  /**
  * Getter for m_rrcTransactionIdentifier
  * @return m_rrcTransactionIdentifier
  */ 
  uint8_t GetRrcTransactionIdentifier () const;

private:
  uint8_t m_rrcTransactionIdentifier; ///< RRC transaction identifier

};

/**
* This class manages the serialization/deserialization of RrcConnectionReconfiguration IE
*/
class RrcConnectionReconfigurationHeader : public RrcDlDcchMessage
{
public:
  RrcConnectionReconfigurationHeader ();
  ~RrcConnectionReconfigurationHeader ();

  // Inherited from RrcAsn1Header 
  void PreSerialize () const;
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;

  /**
  * Receives a RrcConnectionReconfiguration IE and stores the contents into the class attributes
  * @param msg The information element to parse
  */ 
  void SetMessage (LteRrcSap::RrcConnectionReconfiguration msg);

  /**
  * Returns a RrcConnectionReconfiguration IE from the values in the class attributes
  * @return A RrcConnectionReconfiguration, as defined in LteRrcSap
  */
  LteRrcSap::RrcConnectionReconfiguration GetMessage () const; 

  /**
  * Getter for m_haveMeasConfig
  * @return m_haveMeasConfig
  */
  bool GetHaveMeasConfig ();

  /**
  * Getter for m_measConfig
  * @return m_measConfig
  */
  LteRrcSap::MeasConfig GetMeasConfig ();

  /**
  * Getter for m_haveMobilityControlInfo
  * @return m_haveMobilityControlInfo
  */
  bool GetHaveMobilityControlInfo ();

  /**
  * Getter for m_mobilityControlInfo
  * @return m_mobilityControlInfo
  */
  LteRrcSap::MobilityControlInfo GetMobilityControlInfo ();

  /**
  * Getter for m_haveRadioResourceConfigDedicated
  * @return m_haveRadioResourceConfigDedicated
  */
  bool GetHaveRadioResourceConfigDedicated ();

  /**
  * Getter for m_radioResourceConfigDedicated
  * @return m_radioResourceConfigDedicated
  */
  LteRrcSap::RadioResourceConfigDedicated GetRadioResourceConfigDedicated ();

  /**
  * Getter for m_rrcTransactionIdentifier
  * @return m_rrcTransactionIdentifier
  */
  uint8_t GetRrcTransactionIdentifier () const;

  /**
  * Getter for m_radioResourceConfigDedicated
  * @return m_radioResourceConfigDedicated
  */
  LteRrcSap::RadioResourceConfigDedicated GetRadioResourceConfigDedicated () const; 

  /**
  * Getter for m_haveNonCriticalExtension
  * @return m_haveNonCriticalExtension
  */
  bool GetHaveNonCriticalExtensionConfig ();

  /**
  * Getter for m_nonCriticalExtension
  * @return m_nonCriticalExtension
  */
  LteRrcSap::NonCriticalExtensionConfiguration GetNonCriticalExtensionConfig ();  

  /**
  * Gets m_radioResourceConfigDedicated.havePhysicalConfigDedicated
  * @return m_radioResourceConfigDedicated.havePhysicalConfigDedicated
  */
  bool HavePhysicalConfigDedicated () const;

  /**
  * Gets m_radioResourceConfigDedicated.physicalConfigDedicated
  * @return m_radioResourceConfigDedicated.physicalConfigDedicated
  */
  LteRrcSap::PhysicalConfigDedicated GetPhysicalConfigDedicated () const;

  /**
  * Gets m_radioResourceConfigDedicated.srbToAddModList
  * @return m_radioResourceConfigDedicated.srbToAddModList
  */
  std::list<LteRrcSap::SrbToAddMod> GetSrbToAddModList () const;

  /**
  * Gets m_radioResourceConfigDedicated.drbToAddModList
  * @return m_radioResourceConfigDedicated.drbToAddModList
  */
  std::list<LteRrcSap::DrbToAddMod> GetDrbToAddModList () const;

  /**
  * Gets m_radioResourceConfigDedicated.drbToReleaseList
  * @return m_radioResourceConfigDedicated.drbToReleaseList
  */
  std::list<uint8_t> GetDrbToReleaseList () const;

private:
  uint8_t m_rrcTransactionIdentifier; ///< RRC transaction identifier
  bool m_haveMeasConfig; ///< have measure config?
  LteRrcSap::MeasConfig m_measConfig; ///< the measure config
  bool m_haveMobilityControlInfo; ///< have mobility control info?
  LteRrcSap::MobilityControlInfo m_mobilityControlInfo; ///< the modility control info
  bool m_haveRadioResourceConfigDedicated; ///< have radio resource config dedicated?
  LteRrcSap::RadioResourceConfigDedicated m_radioResourceConfigDedicated; ///< the radio resource config dedicated
  bool m_haveNonCriticalExtension; ///< Have critical extension
  LteRrcSap::NonCriticalExtensionConfiguration m_nonCriticalExtension; ///< the critical extension
};

/**
* This class manages the serialization/deserialization of HandoverPreparationInfo IE
*/
class HandoverPreparationInfoHeader : public RrcAsn1Header
{
public:
  HandoverPreparationInfoHeader ();

  // Inherited from RrcAsn1Header 
  void PreSerialize () const;
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;

  /**
  * Receives a HandoverPreparationInfo IE and stores the contents into the class attributes
  * @param msg The information element to parse
  */ 
  void SetMessage (LteRrcSap::HandoverPreparationInfo msg);

  /**
  * Returns a HandoverPreparationInfo IE from the values in the class attributes
  * @return A HandoverPreparationInfo, as defined in LteRrcSap
  */
  LteRrcSap::HandoverPreparationInfo GetMessage () const;

  /**
  * Getter for m_asConfig
  * @return m_asConfig
  */ 
  LteRrcSap::AsConfig GetAsConfig () const;

private:
  LteRrcSap::AsConfig m_asConfig; ///< AS config
};

/**
* This class manages the serialization/deserialization of RRCConnectionReestablishmentRequest IE
*/
class RrcConnectionReestablishmentRequestHeader : public RrcUlCcchMessage
{
public:
  RrcConnectionReestablishmentRequestHeader ();
  ~RrcConnectionReestablishmentRequestHeader ();

  // Inherited from RrcAsn1Header 
  void PreSerialize () const;
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;

  /**
  * Receives a RrcConnectionReestablishmentRequest IE and stores the contents into the class attributes
  * @param msg The information element to parse
  */ 
  void SetMessage (LteRrcSap::RrcConnectionReestablishmentRequest msg);

  /**
  * Returns a RrcConnectionReestablishmentRequest IE from the values in the class attributes
  * @return A RrcConnectionReestablishmentRequest, as defined in LteRrcSap
  */
  LteRrcSap::RrcConnectionReestablishmentRequest GetMessage () const;

  /**
  * Getter for m_ueIdentity
  * @return m_ueIdentity
  */
  LteRrcSap::ReestabUeIdentity GetUeIdentity () const;

  /**
  * Getter for m_reestablishmentCause
  * @return m_reestablishmentCause
  */
  LteRrcSap::ReestablishmentCause GetReestablishmentCause () const;

private:
  LteRrcSap::ReestabUeIdentity m_ueIdentity; ///< UE identity
  LteRrcSap::ReestablishmentCause m_reestablishmentCause; ///< reestablishment cause
};

/**
* This class manages the serialization/deserialization of RrcConnectionReestablishment IE
*/
class RrcConnectionReestablishmentHeader : public RrcDlCcchMessage
{
public:
  RrcConnectionReestablishmentHeader ();
  ~RrcConnectionReestablishmentHeader ();

  // Inherited from RrcAsn1Header 
  void PreSerialize () const;
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;

  /**
  * Receives a RrcConnectionReestablishment IE and stores the contents into the class attributes
  * @param msg The information element to parse
  */ 
  void SetMessage (LteRrcSap::RrcConnectionReestablishment msg);

  /**
  * Returns a RrcConnectionReestablishment IE from the values in the class attributes
  * @return A RrcConnectionReestablishment, as defined in LteRrcSap
  */
  LteRrcSap::RrcConnectionReestablishment GetMessage () const;

  /**
  * Getter for m_rrcTransactionIdentifier attribute
  * @return m_rrcTransactionIdentifier
  */
  uint8_t GetRrcTransactionIdentifier () const;

  /**
  * Getter for m_radioResourceConfigDedicated attribute
  * @return m_radioResourceConfigDedicated
  */
  LteRrcSap::RadioResourceConfigDedicated GetRadioResourceConfigDedicated () const;

private:
  uint8_t m_rrcTransactionIdentifier; ///< RRC transaction identifier
  LteRrcSap::RadioResourceConfigDedicated m_radioResourceConfigDedicated; ///< radio resource config dedicated
};

/**
* This class manages the serialization/deserialization of RrcConnectionReestablishmentComplete IE
*/
class RrcConnectionReestablishmentCompleteHeader : public RrcUlDcchMessage
{
public:
  RrcConnectionReestablishmentCompleteHeader ();

  // Inherited from RrcAsn1Header 
  void PreSerialize () const;
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;

  /**
  * Receives a RrcConnectionReestablishmentComplete IE and stores the contents into the class attributes
  * @param msg The information element to parse
  */ 
  void SetMessage (LteRrcSap::RrcConnectionReestablishmentComplete msg);

  /**
  * Returns a RrcConnectionReestablishmentComplete IE from the values in the class attributes
  * @return A RrcConnectionReestablishmentComplete, as defined in LteRrcSap
  */
  LteRrcSap::RrcConnectionReestablishmentComplete GetMessage () const;

  /**
  * Getter for m_rrcTransactionIdentifier attribute
  * @return m_rrcTransactionIdentifier
  */
  uint8_t GetRrcTransactionIdentifier () const;

private:
  uint8_t m_rrcTransactionIdentifier; ///< RRC transaction identifier
};

/**
* This class manages the serialization/deserialization of RrcConnectionReestablishmentReject IE
*/
class RrcConnectionReestablishmentRejectHeader : public RrcDlCcchMessage
{
public:
  RrcConnectionReestablishmentRejectHeader ();
  ~RrcConnectionReestablishmentRejectHeader ();

  // Inherited from RrcAsn1Header 
  void PreSerialize () const;
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;

  /**
  * Receives a RrcConnectionReestablishmentReject IE and stores the contents into the class attributes
  * @param msg The information element to parse
  */ 
  void SetMessage (LteRrcSap::RrcConnectionReestablishmentReject msg);

  /**
  * Returns a RrcConnectionReestablishmentReject IE from the values in the class attributes
  * @return A RrcConnectionReestablishmentReject, as defined in LteRrcSap
  */
  LteRrcSap::RrcConnectionReestablishmentReject GetMessage () const;

private:
  LteRrcSap::RrcConnectionReestablishmentReject m_rrcConnectionReestablishmentReject; ///< RRC connection reestablishmnet reject
};

/**
* This class manages the serialization/deserialization of RrcConnectionRelease IE
*/
class RrcConnectionReleaseHeader : public RrcDlDcchMessage
{
public:
  RrcConnectionReleaseHeader ();
  ~RrcConnectionReleaseHeader ();

  // Inherited from RrcAsn1Header 
  void PreSerialize () const;
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;

  /**
  * Receives a RrcConnectionRelease IE and stores the contents into the class attributes
  * @param msg The information element to parse
  */ 
  void SetMessage (LteRrcSap::RrcConnectionRelease msg);

  /**
  * Returns a RrcConnectionRelease IE from the values in the class attributes
  * @return A RrcConnectionRelease, as defined in LteRrcSap
  */
  LteRrcSap::RrcConnectionRelease GetMessage () const;

private:
  LteRrcSap::RrcConnectionRelease m_rrcConnectionRelease; ///< RRC connection release
};

/**
* This class manages the serialization/deserialization of RrcConnectionReject IE
*/
class RrcConnectionRejectHeader : public RrcDlCcchMessage
{
public:
  RrcConnectionRejectHeader ();
  ~RrcConnectionRejectHeader ();

  // Inherited from RrcAsn1Header 
  void PreSerialize () const;
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;

  /**
  * Receives a RrcConnectionReject IE and stores the contents into the class attributes
  * @param msg The information element to parse
  */ 
  void SetMessage (LteRrcSap::RrcConnectionReject msg);

  /**
  * Returns a RrcConnectionReject IE from the values in the class attributes
  * @return A RrcConnectionReject, as defined in LteRrcSap
  */
  LteRrcSap::RrcConnectionReject GetMessage () const;

private:
  LteRrcSap::RrcConnectionReject m_rrcConnectionReject; ///< RRC connection reject
};

/**
* This class manages the serialization/deserialization of MeasurementReport IE
*/
class MeasurementReportHeader : public RrcUlDcchMessage
{
public:
  MeasurementReportHeader ();
  ~MeasurementReportHeader ();

  // Inherited from RrcAsn1Header 
  void PreSerialize () const;
  uint32_t Deserialize (Buffer::Iterator bIterator);
  void Print (std::ostream &os) const;

  /**
  * Receives a MeasurementReport IE and stores the contents into the class attributes
  * @param msg The information element to parse
  */
  void SetMessage (LteRrcSap::MeasurementReport msg);

  /**
  * Returns a MeasurementReport IE from the values in the class attributes
  * @return A MeasurementReport, as defined in LteRrcSap
  */
  LteRrcSap::MeasurementReport GetMessage () const;

private:
  LteRrcSap::MeasurementReport m_measurementReport; ///< measurement report

};

} // namespace ns3

#endif // RRC_HEADER_H