A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-pdcp-header.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Manuel Requena <manuel.requena@cttc.es>
18 */
19
20#ifndef LTE_PDCP_HEADER_H
21#define LTE_PDCP_HEADER_H
22
23#include "ns3/header.h"
24
25#include <list>
26
27namespace ns3
28{
29
30/**
31 * \ingroup lte
32 * \brief The packet header for the Packet Data Convergence Protocol (PDCP) packets
33 *
34 * This class has fields corresponding to those in an PDCP header as well as
35 * methods for serialization to and deserialization from a byte buffer.
36 * It follows 3GPP TS 36.323 Packet Data Convergence Protocol (PDCP) specification.
37 */
38class LtePdcpHeader : public Header
39{
40 public:
41 /**
42 * \brief Constructor
43 *
44 * Creates a null header
45 */
47 ~LtePdcpHeader() override;
48
49 /**
50 * \brief Set DC bit
51 *
52 * \param dcBit DC bit to set
53 */
54 void SetDcBit(uint8_t dcBit);
55 /**
56 * \brief Set sequence number
57 *
58 * \param sequenceNumber sequence number
59 */
60 void SetSequenceNumber(uint16_t sequenceNumber);
61
62 /**
63 * \brief Get DC bit
64 *
65 * \returns DC bit
66 */
67 uint8_t GetDcBit() const;
68 /**
69 * \brief Get sequence number
70 *
71 * \returns sequence number
72 */
73 uint16_t GetSequenceNumber() const;
74
75 /// DcBit_t typedef
76 enum
77 {
79 DATA_PDU = 1
80 } DcBit_t; ///< DcBit_t typedef
81
82 /**
83 * \brief Get the type ID.
84 * \return the object TypeId
85 */
86 static TypeId GetTypeId();
87 TypeId GetInstanceTypeId() const override;
88 void Print(std::ostream& os) const override;
89 uint32_t GetSerializedSize() const override;
90 void Serialize(Buffer::Iterator start) const override;
92
93 private:
94 uint8_t m_dcBit; ///< the DC bit
95 uint16_t m_sequenceNumber; ///< the sequence number
96};
97
98} // namespace ns3
99
100#endif // LTE_PDCP_HEADER_H
iterator in a Buffer instance
Definition: buffer.h:100
Protocol header serialization and deserialization.
Definition: header.h:44
The packet header for the Packet Data Convergence Protocol (PDCP) packets.
uint16_t GetSequenceNumber() const
Get sequence number.
void SetDcBit(uint8_t dcBit)
Set DC bit.
void Print(std::ostream &os) const override
uint32_t Deserialize(Buffer::Iterator start) override
uint8_t m_dcBit
the DC bit
static TypeId GetTypeId()
Get the type ID.
uint32_t GetSerializedSize() const override
LtePdcpHeader()
Constructor.
void SetSequenceNumber(uint16_t sequenceNumber)
Set sequence number.
~LtePdcpHeader() override
uint16_t m_sequenceNumber
the sequence number
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void Serialize(Buffer::Iterator start) const override
uint8_t GetDcBit() const
Get DC bit.
enum ns3::LtePdcpHeader::@58 DcBit_t
DcBit_t typedef.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.