A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-rlc-am-header.h
Go to the documentation of this file.
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_AM_HEADER_H
22 #define LTE_RLC_AM_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 LteRlcAmHeader : public Header
40 {
41 public:
42 
48  LteRlcAmHeader ();
49  ~LteRlcAmHeader ();
50 
51  void SetDataPdu (void);
52  void SetControlPdu (uint8_t controlPduType);
53  bool IsDataPdu (void) const;
54  bool IsControlPdu (void) const;
55 
56  typedef enum {
60 
61  typedef enum {
62  STATUS_PDU = 000,
64 
65  //
66  // DATA PDU
67  //
68 
69  void SetSequenceNumber (SequenceNumber10 sequenceNumber);
71 
72  void SetFramingInfo (uint8_t framingInfo);
73  uint8_t GetFramingInfo () const;
74 
75  typedef enum {
76  FIRST_BYTE = 0x00,
79 
80  typedef enum {
81  LAST_BYTE = 0x00,
82  NO_LAST_BYTE = 0x01
84 
85  void PushExtensionBit (uint8_t extensionBit);
86  void PushLengthIndicator (uint16_t lengthIndicator);
87 
88  uint8_t PopExtensionBit (void);
89  uint16_t PopLengthIndicator (void);
90 
91  typedef enum {
95 
96  void SetResegmentationFlag (uint8_t resegFlag);
97  uint8_t GetResegmentationFlag () const;
98 
99  typedef enum {
100  PDU = 0,
103 
104  void SetPollingBit (uint8_t pollingBit);
105  uint8_t GetPollingBit () const;
106 
107  typedef enum {
110  } PollingBit_t;
111 
112  void SetLastSegmentFlag (uint8_t lsf);
113  uint8_t GetLastSegmentFlag () const;
114 
115  typedef enum {
119 
120  void SetSegmentOffset (uint16_t segmentOffset);
121  uint16_t GetSegmentOffset () const;
122  uint16_t GetLastOffset () const;
123 
124  //
125  // CONTROL PDU
126  //
127 
128  void SetAckSn (SequenceNumber10 ackSn);
129  SequenceNumber10 GetAckSn () const;
130 
131 
132  static TypeId GetTypeId (void);
133  virtual TypeId GetInstanceTypeId (void) const;
134  virtual void Print (std::ostream &os) const;
135  virtual uint32_t GetSerializedSize (void) const;
136  virtual void Serialize (Buffer::Iterator start) const;
137  virtual uint32_t Deserialize (Buffer::Iterator start);
138 
139 private:
140  uint16_t m_headerLength;
142 
143  // Data PDU fields
145  uint8_t m_pollingBit;
146  uint8_t m_framingInfo; // 2 bits
149  uint16_t m_segmentOffset;
150  uint16_t m_lastOffset;
151 
152  std::list <uint8_t> m_extensionBits; // Includes extensionBit of the fixed part
153  std::list <uint16_t> m_lengthIndicators;
154 
155  // Control PDU fields
157 
158  // Status PDU fields
161 
162  std::list <uint8_t> m_extensionBits1; // Includes E1 after ACK_SN
163  std::list <uint8_t> m_extensionBits2;
164 
165 };
166 
167 }; // namespace ns3
168 
169 #endif // LTE_RLC_AM_HEADER_H
uint8_t PopExtensionBit(void)
Protocol header serialization and deserialization.
Definition: header.h:42
std::list< uint8_t > m_extensionBits2
void SetResegmentationFlag(uint8_t resegFlag)
std::list< uint8_t > m_extensionBits
void SetSequenceNumber(SequenceNumber10 sequenceNumber)
virtual void Print(std::ostream &os) const
void SetPollingBit(uint8_t pollingBit)
std::list< uint16_t > m_lengthIndicators
iterator in a Buffer instance
Definition: buffer.h:98
uint8_t GetFramingInfo() const
virtual uint32_t GetSerializedSize(void) const
uint8_t GetLastSegmentFlag() const
void SetFramingInfo(uint8_t framingInfo)
void SetSegmentOffset(uint16_t segmentOffset)
bool IsDataPdu(void) const
uint8_t GetPollingBit() const
SequenceNumber10 m_sequenceNumber
uint16_t GetLastOffset() const
void PushLengthIndicator(uint16_t lengthIndicator)
void SetControlPdu(uint8_t controlPduType)
The packet header for the AM Radio Link Control (RLC) protocol packets.
SequenceNumber10 m_ackSn
virtual uint32_t Deserialize(Buffer::Iterator start)
uint8_t GetResegmentationFlag() const
static TypeId GetTypeId(void)
std::list< uint8_t > m_extensionBits1
virtual void Serialize(Buffer::Iterator start) const
bool IsControlPdu(void) const
uint16_t PopLengthIndicator(void)
uint16_t GetSegmentOffset() const
SequenceNumber10 m_nackSn
void SetAckSn(SequenceNumber10 ackSn)
void SetLastSegmentFlag(uint8_t lsf)
void PushExtensionBit(uint8_t extensionBit)
virtual TypeId GetInstanceTypeId(void) const
a unique identifier for an interface.
Definition: type-id.h:49
SequenceNumber10 GetAckSn() const
LteRlcAmHeader()
Constructor.
SequenceNumber10 GetSequenceNumber() const