60 return "MAC Header Type";
68 .SetGroupName(
"Wimax")
224 return "Generic Mac Header";
232 .SetGroupName(
"Wimax")
248 <<
", eks (encryption key sequence) = " << (
uint32_t)
m_eks <<
", len (length) = " <<
m_len
271 uint8_t headerBuffer[6];
272 memset(headerBuffer, 0, 6);
274 headerBuffer[0] = ((
m_ht << 7) & 0x80) | ((
m_ec << 6) & 0x40) | (
m_type & 0x3F);
275 headerBuffer[1] = ((
m_esf << 7) & 0x80) | ((
m_ci << 6) & 0x40) | ((
m_eks << 4) & 0x30) |
276 ((
m_rsv1 << 3) & 0x08) | (((uint8_t)(
m_len >> 8)) & 0x07);
277 headerBuffer[2] = (uint8_t)(
m_len);
281 headerBuffer[5] = crc;
282 for (
int j = 0; j < 6; j++)
301 uint8_t headerBuffer[6];
302 for (
int j = 0; j < 6; j++)
304 headerBuffer[j] = i.
ReadU8();
306 m_ht = (headerBuffer[0] >> 7) & 0x01;
307 m_ec = (headerBuffer[0] >> 6) & 0x01;
308 m_type = (headerBuffer[0]) & 0x3F;
309 m_esf = (headerBuffer[1] >> 7) & 0x01;
310 m_ci = (headerBuffer[1] >> 6) & 0x01;
311 m_eks = (headerBuffer[1] >> 4) & 0x03;
312 m_rsv1 = (headerBuffer[1] >> 3) & 0x01;
313 uint16_t lenmsb = (headerBuffer[1] & 0x07);
314 uint16_t lenlsb = headerBuffer[2];
315 m_len = ((lenmsb << 8) & 0x0700) | (lenlsb & 0x00FF);
316 uint16_t cidmsb = headerBuffer[3];
317 uint16_t cidlsb = headerBuffer[4];
318 uint16_t cid = ((cidmsb << 8) & 0xFF00) | (cidlsb & 0x00FF);
320 m_hcs = headerBuffer[5];
424 return "Bandwidth Request Header";
430 static TypeId tid =
TypeId(
"ns3::BandwidthRequestHeader")
432 .SetGroupName(
"Wimax")
447 <<
", br (bandwidth request) = " <<
m_br <<
", cid = ";
473 uint8_t headerBuffer[6];
474 uint8_t br_msb1 = (((
uint32_t)
m_br) >> 16) & 0x00000007;
476 uint8_t br_lsb =
m_br & 0x000000FF;
478 ((
m_ht << 7) & 0x80) | ((
m_ec << 6) & 0x40) | ((
m_type << 3) & 0x38) | br_msb1;
479 headerBuffer[1] = br_msb2;
480 headerBuffer[2] = br_lsb;
485 for (
int j = 0; j < 6; j++)
504 uint8_t headerBuffer[6];
505 for (
int j = 0; j < 6; j++)
507 headerBuffer[j] = i.
ReadU8();
510 m_ht = (headerBuffer[0] >> 7) & 0x01;
511 m_ec = (headerBuffer[0] >> 6) & 0x01;
512 m_type = (headerBuffer[0] >> 3) & 0x07;
513 uint32_t br_msb1 = headerBuffer[0] & 0x00000007;
514 uint32_t br_msb2 = headerBuffer[1] & 0x000000FF;
515 uint32_t br_lsb = headerBuffer[2] & 0x000000FF;
517 uint16_t cidmsb = headerBuffer[3];
518 uint16_t cidlsb = headerBuffer[4];
519 uint16_t cid = ((cidmsb << 8) & 0xFF00) | (cidlsb & 0x00FF);
521 m_hcs = headerBuffer[5];
587 return "Grant Management Subheader";
593 static TypeId tid =
TypeId(
"ns3::GrantManagementSubheader")
595 .SetGroupName(
"Wimax")
610 <<
", pbr (piggyback request) = " <<
m_pbr;
680 return "Fragmentation Subheader";
686 static TypeId tid =
TypeId(
"ns3::FragmentationSubheader")
688 .SetGroupName(
"Wimax")
703 <<
", fsn (fragmentation sequence number) = " << (
uint32_t)
m_fsn <<
"\n";
This class implements the bandwidth-request mac Header as described by IEEE Standard for Local and me...
uint8_t m_ec
Encryption Control.
uint8_t GetHt() const
Get HT field.
uint32_t GetSerializedSize() const override
~BandwidthRequestHeader() override
void SetBr(uint32_t br)
Set BR field.
uint32_t GetBr() const
Get BR field.
void SetEc(uint8_t ec)
Set EC field.
void SetType(uint8_t type)
Set type field.
uint8_t GetHcs() const
Get HCS field.
bool check_hcs() const
Check HCS.
uint8_t c_hcs
calculated header check sequence; this is used to check if the received header is correct or not
uint8_t m_hcs
Header Check Sequence.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint8_t GetEc() const
Get EC field.
void SetHcs(uint8_t hcs)
Set HCS field.
Cid GetCid() const
Get CID field.
void SetHt(uint8_t ht)
Set HT field.
void SetCid(Cid cid)
Set CID field.
uint32_t m_br
Bandwidth Request.
void Serialize(Buffer::Iterator start) const override
void Print(std::ostream &os) const override
std::string GetName() const
Get name field.
uint8_t GetType() const
Get type field.
Cid m_cid
Connection identifier.
uint32_t Deserialize(Buffer::Iterator start) override
static TypeId GetTypeId()
Get the type ID.
iterator in a Buffer instance
void WriteU8(uint8_t data)
void WriteU16(uint16_t data)
uint32_t GetDistanceFrom(const Iterator &o) const
uint16_t GetIdentifier() const
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t CRC8Calculate(const uint8_t *data, int length)