LteRlcUmTxEntity.h Source File

Simu5G: LteRlcUmTxEntity.h Source File
Simu5G
LteRlcUmTxEntity.h
1//
2// Simu5G
3//
4// Authors: Giovanni Nardini, Giovanni Stea, Antonio Virdis (University of Pisa), Andras Varga (OpenSim Ltd)
5//
6// This file is part of a software released under the license included in file
7// "license.pdf". Please read LICENSE and README files before using it.
8// The above files and the present reference are part of the software itself,
9// and cannot be removed from it.
10//
11
12#ifndef _SIMU5G_LTERLCUMTXENTITY_H_
13#define _SIMU5G_LTERLCUMTXENTITY_H_
14
15#include "simu5g/stack/rlc/um/RlcUmTxEntityBase.h"
16#include "simu5g/mec/utils/MecCommon.h"
17
18namespace simu5g {
19
20using namespace omnetpp;
21
29{
30 protected:
31 struct FragmentInfo {
32 inet::Packet *pkt = nullptr;
33 int size = 0;
34 };
35 FragmentInfo *fragmentInfo = nullptr;
36
37 /*
38 * @author Alessandro Noferi
39 * burst tracking for packetFlowObserver (discarded packets and delay);
40 * null-safe via hasListeners().
41 */
42 RlcBurstStatus burstStatus_;
43
44 // The SDU enqueue buffer.
45 inet::cPacketQueue sduQueue_;
46
47 // Whether the first item in the queue is a fragment or a whole SDU.
48 bool firstIsFragment_ = false;
49
50 // The maximum available queue size, in bytes (0: unlimited).
51 unsigned int queueSize_;
52
53 // The currently stored amount of data in the SDU queue, in bytes.
54 unsigned int queueLength_ = 0;
55
56 // Next PDU sequence number to be assigned.
57 unsigned int sno_ = 0;
58
59 public:
60
61 ~LteRlcUmTxEntity() override { delete fragmentInfo; }
62
63 // force the sequence number
64 void setNextSequenceNumber(unsigned int nextSno) { sno_ = nextSno; }
65
66 // remove the last SDU from the queue
67 virtual void removeDataFromQueue();
68
69 void clearQueue() override;
70 bool isTxBufferEmpty() const override { return sduQueue_.isEmpty(); }
71 int64_t getBufferOccupancy() const override { return queueLength_; }
72
73 protected:
74
75 void initMode() override;
76 bool storeSdu(inet::Packet *pkt) override;
77 void rlcPduMake(int pduSize) override;
78 // Unused by the LTE FI/concatenation path; kept at the base's own default.
79 unsigned int snFieldLength() const override { return 12; }
80
81 // enqueue an upper-layer SDU into the TX buffer; false if the queue is full
82 virtual bool enque(inet::cPacket *pkt);
83};
84
85} //namespace
86
87#endif
LTE (TS 36.322) RLC UM transmission entity.
Definition LteRlcUmTxEntity.h:29
Common shell of the RLC UM transmission entity.
Definition RlcUmTxEntityBase.h:40
Definition AlertReceiver.h:24