author | Manuel Requena <manuel.requena@cttc.es> |
Tue, 26 Mar 2013 10:41:49 +0100 | |
changeset 10019 | 6efd95740e39 |
parent 8572 | ada66b065cc2 |
permissions | -rw-r--r-- |
8360 | 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" |
|
8572
ada66b065cc2
Fix processing of the sequence number
Manuel Requena <manuel.requena@cttc.es>
parents:
8360
diff
changeset
|
25 |
#include "ns3/lte-rlc-sequence-number.h" |
8360 | 26 |
|
27 |
#include <list> |
|
28 |
||
29 |
namespace ns3 { |
|
30 |
||
31 |
/** |
|
32 |
* \ingroup lte |
|
33 |
* \brief The packet header for the Radio Link Control (RLC) protocol packets |
|
34 |
* |
|
35 |
* This class has fields corresponding to those in an RLC header as well as |
|
36 |
* methods for serialization to and deserialization from a byte buffer. |
|
37 |
* It follows 3GPP TS 36.322 Radio Link Control (RLC) protocol specification. |
|
38 |
*/ |
|
39 |
class LteRlcHeader : public Header |
|
40 |
{ |
|
41 |
public: |
|
42 |
||
43 |
/** |
|
44 |
* \brief Constructor |
|
45 |
* |
|
46 |
* Creates a null header |
|
47 |
*/ |
|
48 |
LteRlcHeader (); |
|
49 |
~LteRlcHeader (); |
|
50 |
||
51 |
void SetFramingInfo (uint8_t framingInfo); |
|
8572
ada66b065cc2
Fix processing of the sequence number
Manuel Requena <manuel.requena@cttc.es>
parents:
8360
diff
changeset
|
52 |
void SetSequenceNumber (SequenceNumber10 sequenceNumber); |
8360 | 53 |
|
54 |
uint8_t GetFramingInfo () const; |
|
8572
ada66b065cc2
Fix processing of the sequence number
Manuel Requena <manuel.requena@cttc.es>
parents:
8360
diff
changeset
|
55 |
SequenceNumber10 GetSequenceNumber () const; |
8360 | 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 |
|
8572
ada66b065cc2
Fix processing of the sequence number
Manuel Requena <manuel.requena@cttc.es>
parents:
8360
diff
changeset
|
89 |
SequenceNumber10 m_sequenceNumber; |
8360 | 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 |