5G-LENA
nr-v3.0-29-g83cc959
The 5G/NR module for the ns-3 simulator
|
Mac variable-size Header. More...
#include "nr-mac-header-vs.h"
Public Member Functions | |
NrMacHeaderVs () | |
NrMacHeaderVs constructor. | |
uint32_t | Deserialize (Buffer::Iterator start) override |
Deserialize from a buffer. More... | |
TypeId | GetInstanceTypeId () const override |
GetInstanceTypeId. More... | |
uint8_t | GetLcId () const |
Retrieve the LC ID of this header. More... | |
uint32_t | GetSerializedSize () const override |
Get the serialized size. More... | |
uint16_t | GetSize () const |
GetS the stored size (L in the standard) More... | |
bool | operator== (const NrMacHeaderVs &o) const |
IsEqual. More... | |
void | Print (std::ostream &os) const override |
Print the struct on a ostream. More... | |
void | Serialize (Buffer::Iterator start) const override |
Serialize on a buffer. More... | |
virtual void | SetLcId (uint8_t lcId) |
Set the LC ID. More... | |
void | SetSize (uint16_t size) |
Set the size to store (L in the standard) More... | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
GetTypeId. More... | |
Static Public Attributes | |
static const uint8_t | LC_ID_1 = 1 |
Identity of the logical channel 1. | |
static const uint8_t | LC_ID_10 = 10 |
Identity of the logical channel 10. | |
static const uint8_t | LC_ID_11 = 11 |
Identity of the logical channel 11. | |
static const uint8_t | LC_ID_12 = 12 |
Identity of the logical channel 12. | |
static const uint8_t | LC_ID_13 = 13 |
Identity of the logical channel 13. | |
static const uint8_t | LC_ID_14 = 14 |
Identity of the logical channel 14. | |
static const uint8_t | LC_ID_15 = 15 |
Identity of the logical channel 15. | |
static const uint8_t | LC_ID_16 = 16 |
Identity of the logical channel 16. | |
static const uint8_t | LC_ID_17 = 17 |
Identity of the logical channel 17. | |
static const uint8_t | LC_ID_18 = 18 |
Identity of the logical channel 18. | |
static const uint8_t | LC_ID_19 = 19 |
Identity of the logical channel 19. | |
static const uint8_t | LC_ID_2 = 2 |
Identity of the logical channel 2. | |
static const uint8_t | LC_ID_20 = 20 |
Identity of the logical channel 20. | |
static const uint8_t | LC_ID_21 = 21 |
Identity of the logical channel 21. | |
static const uint8_t | LC_ID_22 = 22 |
Identity of the logical channel 22. | |
static const uint8_t | LC_ID_23 = 23 |
Identity of the logical channel 23. | |
static const uint8_t | LC_ID_24 = 24 |
Identity of the logical channel 24. | |
static const uint8_t | LC_ID_25 = 25 |
Identity of the logical channel 25. | |
static const uint8_t | LC_ID_26 = 26 |
Identity of the logical channel 26. | |
static const uint8_t | LC_ID_27 = 27 |
Identity of the logical channel 27. | |
static const uint8_t | LC_ID_28 = 28 |
Identity of the logical channel 28. | |
static const uint8_t | LC_ID_29 = 29 |
Identity of the logical channel 29. | |
static const uint8_t | LC_ID_3 = 3 |
Identity of the logical channel 3. | |
static const uint8_t | LC_ID_30 = 30 |
Identity of the logical channel 30. | |
static const uint8_t | LC_ID_31 = 31 |
Identity of the logical channel 31. | |
static const uint8_t | LC_ID_32 = 32 |
Identity of the logical channel 32. | |
static const uint8_t | LC_ID_4 = 4 |
Identity of the logical channel 4. | |
static const uint8_t | LC_ID_5 = 5 |
Identity of the logical channel 5. | |
static const uint8_t | LC_ID_6 = 6 |
Identity of the logical channel 6. | |
static const uint8_t | LC_ID_7 = 7 |
Identity of the logical channel 7. | |
static const uint8_t | LC_ID_8 = 8 |
Identity of the logical channel 8. | |
static const uint8_t | LC_ID_9 = 9 |
Identity of the logical channel 9. | |
Protected Attributes | |
uint8_t | m_lcid {0} |
LC ID. | |
uint16_t | m_size {0} |
Size (L in the standard) | |
Mac variable-size Header.
This standard-compliant variable-size subheader can be 16 or 24 bits. The final length depends on the size of the part that follows:
+-----+-----+-------------------------------------------------+ | | | | | 0 | 0 | m_lcId | Oct 1 | | | | +-----+-----+-------------------------------------------------+ | | | m_size (lower 8bit) | Oct 2 | | +-------------------------------------------------------------+ | | | m_size (higher 8bit) | Oct 3 (optional) | | +-------------------------------------------------------------+
Do not confuse m_size with the serialized size that is obtained through GetSerializedSize(). The former is, technically, the size of the block that follows this header, while the serialized size can be 2 or 3 bytes, depending on the m_size value. The standard supports m_size that can take up to the UINT16T_MAX value.
Please refer to TS 38.321 section 6.1.2 for more information.
Users, don't use this header directly: you've been warned.
Using this header requires to know the size of the data that will follow this header, and then to set the LCID (that can be from 1 to 32). This header can be used only to indicate that, following this header, there will be a data SDU. If you need to indicate that there is a variable-sized CE, you need to use one of the subclasses NrMacHeaderVsUl or NrMacHeaderVsDl, respectively for UL (from UE to GNB) or DL (from GNB to UE).
Definition at line 59 of file nr-mac-header-vs.h.
|
override |
Deserialize from a buffer.
start | start position |
Definition at line 70 of file nr-mac-header-vs.cc.
|
override |
GetInstanceTypeId.
Definition at line 33 of file nr-mac-header-vs.cc.
References GetTypeId().
uint8_t ns3::NrMacHeaderVs::GetLcId | ( | ) | const |
Retrieve the LC ID of this header.
Definition at line 143 of file nr-mac-header-vs.cc.
References m_lcid.
|
override |
Get the serialized size.
Definition at line 112 of file nr-mac-header-vs.cc.
References m_size.
uint16_t ns3::NrMacHeaderVs::GetSize | ( | ) | const |
GetS the stored size (L in the standard)
Definition at line 155 of file nr-mac-header-vs.cc.
References m_size.
|
static |
GetTypeId.
Definition at line 25 of file nr-mac-header-vs.cc.
Referenced by GetInstanceTypeId().
bool ns3::NrMacHeaderVs::operator== | ( | const NrMacHeaderVs & | o | ) | const |
IsEqual.
o | another instance |
Definition at line 129 of file nr-mac-header-vs.cc.
|
override |
Print the struct on a ostream.
os | ostream |
Definition at line 123 of file nr-mac-header-vs.cc.
|
override |
Serialize on a buffer.
start | start position |
Definition at line 44 of file nr-mac-header-vs.cc.
|
virtual |
Set the LC ID.
lcId | LC ID |
It will assert if the value is not inside the vector of allowed one. To not make any error, please use one of the pre-defined const values in this class.
Reimplemented in ns3::NrMacHeaderVsUl, and ns3::NrMacHeaderVsDl.
Definition at line 135 of file nr-mac-header-vs.cc.
References m_lcid.
Referenced by ns3::NrMacHeaderVsDl::SetLcId(), and ns3::NrMacHeaderVsUl::SetLcId().
void ns3::NrMacHeaderVs::SetSize | ( | uint16_t | size | ) |
Set the size to store (L in the standard)
size | the size to store (L in the standard) |
Definition at line 149 of file nr-mac-header-vs.cc.
References m_size.