A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
lte-rlc-header.h
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 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: Manuel Requena <manuel.requena@cttc.es>
19  */
20 
21 #ifndef LTE_RLC_HEADER_H
22 #define LTE_RLC_HEADER_H
23 
24 #include "ns3/header.h"
25 #include "ns3/lte-rlc-sequence-number.h"
26 
27 #include <list>
28 
29 namespace ns3 {
30 
39 class LteRlcHeader : public Header
40 {
41 public:
42 
48  LteRlcHeader ();
49  ~LteRlcHeader ();
50 
51  void SetFramingInfo (uint8_t framingInfo);
52  void SetSequenceNumber (SequenceNumber10 sequenceNumber);
53 
54  uint8_t GetFramingInfo () const;
55  SequenceNumber10 GetSequenceNumber () const;
56 
57  void PushExtensionBit (uint8_t extensionBit);
58  void PushLengthIndicator (uint16_t lengthIndicator);
59 
60  uint8_t PopExtensionBit (void);
61  uint16_t PopLengthIndicator (void);
62 
63  typedef enum {
64  DATA_FIELD_FOLLOWS = 0,
65  E_LI_FIELDS_FOLLOWS = 1
66  } ExtensionBit_t;
67 
68  typedef enum {
69  FIRST_BYTE = 0x00,
70  NO_FIRST_BYTE = 0x02
71  } FramingInfoFirstByte_t;
72 
73  typedef enum {
74  LAST_BYTE = 0x00,
75  NO_LAST_BYTE = 0x01
76  } FramingInfoLastByte_t;
77 
78 
79  static TypeId GetTypeId (void);
80  virtual TypeId GetInstanceTypeId (void) const;
81  virtual void Print (std::ostream &os) const;
82  virtual uint32_t GetSerializedSize (void) const;
83  virtual void Serialize (Buffer::Iterator start) const;
84  virtual uint32_t Deserialize (Buffer::Iterator start);
85 
86 private:
87  uint16_t m_headerLength;
88  uint8_t m_framingInfo; // 2 bits
89  SequenceNumber10 m_sequenceNumber;
90 
91  std::list <uint8_t> m_extensionBits; // Includes extensionBit of the fixed part
92  std::list <uint16_t> m_lengthIndicators;
93 
94 };
95 
96 }; // namespace ns3
97 
98 #endif // LTE_RLC_HEADER_H
Protocol header serialization and deserialization.
Definition: header.h:42
virtual uint32_t Deserialize(Buffer::Iterator start)
virtual uint32_t GetSerializedSize(void) const
virtual void Print(std::ostream &os) const
iterator in a Buffer instance
Definition: buffer.h:98
The packet header for the Radio Link Control (RLC) protocol packets.
virtual void Serialize(Buffer::Iterator start) const
virtual TypeId GetInstanceTypeId(void) const
LteRlcHeader()
Constructor.
a unique identifier for an interface.
Definition: type-id.h:44