A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-pdcp-tag.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 CTTC
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Jaume Nin <jaume.nin@cttc.es>
7 * Nicola Baldo <nbaldo@cttc.es>
8 */
9
10#include "lte-pdcp-tag.h"
11
12#include "ns3/tag.h"
13#include "ns3/uinteger.h"
14
15namespace ns3
16{
17
19
21 : m_senderTimestamp(Seconds(0))
22{
23 // Nothing to do here
24}
25
26PdcpTag::PdcpTag(Time senderTimestamp)
27 : m_senderTimestamp(senderTimestamp)
28
29{
30 // Nothing to do here
31}
32
35{
36 static TypeId tid =
37 TypeId("ns3::PdcpTag").SetParent<Tag>().SetGroupName("Lte").AddConstructor<PdcpTag>();
38 return tid;
39}
40
43{
44 return GetTypeId();
45}
46
49{
50 return sizeof(Time);
51}
52
53void
55{
56 int64_t senderTimestamp = m_senderTimestamp.GetNanoSeconds();
57 i.Write((const uint8_t*)&senderTimestamp, sizeof(int64_t));
58}
59
60void
62{
63 int64_t senderTimestamp;
64 i.Read((uint8_t*)&senderTimestamp, 8);
65 m_senderTimestamp = NanoSeconds(senderTimestamp);
66}
67
68void
69PdcpTag::Print(std::ostream& os) const
70{
72}
73
74Time
79
80void
82{
83 this->m_senderTimestamp = senderTimestamp;
84}
85
86} // namespace ns3
Tag to calculate the per-PDU delay from eNb PDCP to UE PDCP.
void SetSenderTimestamp(Time senderTimestamp)
Set the sender timestamp.
void Serialize(TagBuffer i) const override
Time GetSenderTimestamp() const
Get the instant when the PDCP delivers the PDU to the MAC SAP provider.
Time m_senderTimestamp
sender timestamp
void Print(std::ostream &os) const override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
static TypeId GetTypeId()
Get the type ID.
uint32_t GetSerializedSize() const override
void Deserialize(TagBuffer i) override
PdcpTag()
Create an empty PDCP tag.
read and write tag data
Definition tag-buffer.h:41
void Read(uint8_t *buffer, uint32_t size)
void Write(const uint8_t *buffer, uint32_t size)
tag a set of bytes in a packet
Definition tag.h:28
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
int64_t GetNanoSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition nstime.h:407
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1344
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Every class exported by the ns3 library is enclosed in the ns3 namespace.