23 #include "mac-messages.h"
24 #include "ns3/address-utils.h"
25 #include "ns3/uinteger.h"
27 #include "wimax-tlv.h"
32 NS_OBJECT_ENSURE_REGISTERED (ManagementMessageType);
34 ManagementMessageType::ManagementMessageType (
void)
39 ManagementMessageType::ManagementMessageType (uint8_t type)
44 ManagementMessageType::~ManagementMessageType (
void)
49 ManagementMessageType::SetType (uint8_t type)
55 ManagementMessageType::GetType (
void)
const
61 ManagementMessageType::GetName (
void)
const
63 return "Management Message Type";
67 ManagementMessageType::GetTypeId (
void)
70 TypeId (
"ns3::ManagementMessageType").SetParent<Header> ().AddConstructor<ManagementMessageType> ();
83 os <<
" management message type = " << (uint32_t) m_type;
109 NS_OBJECT_ENSURE_REGISTERED (
RngReq);
113 m_reqDlBurstProfile (0),
115 m_rangingAnomalies (0)
119 RngReq::~RngReq (
void)
124 RngReq::SetReqDlBurstProfile (uint8_t reqDlBurstProfile)
126 m_reqDlBurstProfile = reqDlBurstProfile;
130 RngReq::SetMacAddress (Mac48Address macAddress)
132 m_macAddress = macAddress;
136 RngReq::SetRangingAnomalies (uint8_t rangingAnomalies)
138 m_rangingAnomalies = rangingAnomalies;
142 RngReq::GetReqDlBurstProfile (
void)
const
144 return m_reqDlBurstProfile;
148 RngReq::GetMacAddress (
void)
const
154 RngReq::GetRangingAnomalies (
void)
const
156 return m_rangingAnomalies;
160 RngReq::GetName (
void)
const
166 RngReq::GetTypeId (
void)
168 static TypeId tid = TypeId (
"ns3::RngReq").SetParent<Header> ().AddConstructor<RngReq> ();
181 os <<
" requested dl burst profile = " << (uint32_t) m_reqDlBurstProfile <<
", mac address = " << m_macAddress
182 <<
", ranging anomalies = " << (uint32_t) m_rangingAnomalies;
186 RngReq::PrintDebug (
void)
const
188 NS_LOG_DEBUG (
" requested dl burst profile = " << (uint32_t) m_reqDlBurstProfile <<
", mac address = "
189 << m_macAddress <<
", ranging anomalies = "
190 << (uint32_t) m_rangingAnomalies);
196 return 1 + 1 + 6 + 1;
204 i.
WriteU8 (m_reqDlBurstProfile);
205 WriteTo (i, m_macAddress);
206 i.
WriteU8 (m_rangingAnomalies);
214 m_reqDlBurstProfile = i.
ReadU8 ();
215 ReadFrom (i, m_macAddress);
216 m_rangingAnomalies = i.
ReadU8 ();
223 NS_OBJECT_ENSURE_REGISTERED (
RngRsp);
228 m_powerLevelAdjust (0),
229 m_offsetFreqAdjust (0),
231 m_dlFreqOverride (0),
232 m_ulChnlIdOverride (0),
233 m_dlOperBurstProfile (0),
237 m_aasBdcastPermission (0),
239 m_initRangOppNumber (0),
244 RngRsp::~RngRsp (
void)
251 m_timingAdjust = timingAdjust;
257 m_powerLevelAdjust = powerLevelAdjust;
263 m_offsetFreqAdjust = offsetFreqAdjust;
267 RngRsp::SetRangStatus (uint8_t rangStatus)
269 m_rangStatus = rangStatus;
275 m_dlFreqOverride = dlFreqOverride;
281 m_ulChnlIdOverride = ulChnlIdOverride;
285 RngRsp::SetDlOperBurstProfile (uint16_t dlOperBurstProfile)
287 m_dlOperBurstProfile = dlOperBurstProfile;
291 RngRsp::SetMacAddress (Mac48Address macAddress)
293 m_macAddress = macAddress;
297 RngRsp::SetBasicCid (Cid basicCid)
299 m_basicCid = basicCid;
303 RngRsp::SetPrimaryCid (Cid primaryCid)
305 m_primaryCid = primaryCid;
309 RngRsp::SetAasBdcastPermission (uint8_t aasBdcastPermission)
311 m_aasBdcastPermission = aasBdcastPermission;
315 RngRsp::SetFrameNumber (uint32_t frameNumber)
317 m_frameNumber = frameNumber;
321 RngRsp::SetInitRangOppNumber (uint8_t initRangOppNumber)
323 m_initRangOppNumber = initRangOppNumber;
327 RngRsp::SetRangSubchnl (uint8_t rangSubchnl)
329 m_rangSubchnl = rangSubchnl;
335 return m_timingAdjust;
341 return m_powerLevelAdjust;
347 return m_offsetFreqAdjust;
351 RngRsp::GetRangStatus (
void)
const
359 return m_dlFreqOverride;
365 return m_ulChnlIdOverride;
371 return m_dlOperBurstProfile;
375 RngRsp::GetMacAddress (
void)
const
381 RngRsp::GetBasicCid (
void)
const
387 RngRsp::GetPrimaryCid (
void)
const
393 RngRsp::GetAasBdcastPermission (
void)
const
395 return m_aasBdcastPermission;
399 RngRsp::GetFrameNumber (
void)
const
401 return m_frameNumber;
405 RngRsp::GetInitRangOppNumber (
void)
const
407 return m_initRangOppNumber;
411 RngRsp::GetRangSubchnl (
void)
const
413 return m_rangSubchnl;
417 RngRsp::GetName (
void)
const
423 RngRsp::GetTypeId (
void)
425 static TypeId tid = TypeId (
"ns3::RngRsp").SetParent<Header> ().AddConstructor<RngRsp> ();
438 os <<
" timing adjust = " << m_timingAdjust <<
", power level adjust = " << (uint32_t) m_powerLevelAdjust
439 <<
", offset freq adjust = " << m_offsetFreqAdjust <<
", ranging status = " << (uint32_t) m_rangStatus
440 <<
", dl freq override = " << m_dlFreqOverride <<
", ul channel id override = " << (uint32_t) m_ulChnlIdOverride
441 <<
", dl operational burst profile = " << (uint32_t) m_dlOperBurstProfile <<
", mac address = " << m_macAddress
442 <<
", basic cid = " << m_basicCid <<
", primary management cid = " << m_primaryCid
443 <<
", aas broadcast permission = " << (uint32_t) m_aasBdcastPermission <<
", frame number = " << m_frameNumber
444 <<
", initial ranging opportunity number = " << (uint32_t) m_initRangOppNumber <<
", ranging subchannel = "
445 << (uint32_t) m_rangSubchnl;
451 return 1 + 4 + 1 + 4 + 1 + 4 + 1 + 2 + 6 + 2 + 2 + 1 + 4 + 1 + 1;
460 i.
WriteU8 (m_powerLevelAdjust);
464 i.
WriteU8 (m_ulChnlIdOverride);
466 WriteTo (i, m_macAddress);
469 i.
WriteU8 (m_aasBdcastPermission);
471 i.
WriteU8 (m_initRangOppNumber);
481 m_powerLevelAdjust = i.
ReadU8 ();
482 m_offsetFreqAdjust = i.
ReadU32 ();
483 m_rangStatus = i.
ReadU8 ();
484 m_dlFreqOverride = i.
ReadU32 ();
485 m_ulChnlIdOverride = i.
ReadU8 ();
486 m_dlOperBurstProfile = i.
ReadU16 ();
487 ReadFrom (i, m_macAddress);
490 m_aasBdcastPermission = i.
ReadU8 ();
492 m_initRangOppNumber = i.
ReadU8 ();
493 m_rangSubchnl = i.
ReadU8 ();
500 NS_OBJECT_ENSURE_REGISTERED (
DsaReq);
503 : m_transactionId (0),
516 DsaReq::~DsaReq (
void)
521 DsaReq::SetTransactionId (uint16_t transactionId)
523 m_transactionId = transactionId;
527 DsaReq::GetTransactionId (
void)
const
529 return m_transactionId;
558 DsaReq::GetName (
void)
const
564 DsaReq::GetTypeId (
void)
566 static TypeId tid = TypeId (
"ns3::DsaReq").SetParent<Header> ().AddConstructor<DsaReq> ();
579 os <<
" transaction id = " << (uint32_t) m_transactionId <<
", m_sfid = " << m_sfid <<
", cid = " << m_cid;
613 m_transactionId = i.
ReadU16 ();
623 return m_serviceFlow;
634 NS_OBJECT_ENSURE_REGISTERED (
DsaRsp);
637 : m_transactionId (0),
638 m_confirmationCode (0),
644 DsaRsp::~DsaRsp (
void)
649 DsaRsp::SetTransactionId (uint16_t transactionId)
651 m_transactionId = transactionId;
655 DsaRsp::GetTransactionId (
void)
const
657 return m_transactionId;
663 return m_serviceFlow;
673 DsaRsp::SetConfirmationCode (uint16_t confirmationCode)
675 m_confirmationCode = confirmationCode;
679 DsaRsp::GetConfirmationCode (
void)
const
681 return m_confirmationCode;
709 DsaRsp::GetName (
void)
const
715 DsaRsp::GetTypeId (
void)
717 static TypeId tid = TypeId (
"ns3::DsaRsp").SetParent<Header> ().AddConstructor<DsaRsp> ();
730 os <<
" transaction id = " << (uint32_t) m_transactionId <<
", confirmation code = " << (uint32_t) m_confirmationCode
731 <<
", m_sfid = " << m_sfid <<
", cid = " << m_cid;
755 i.
WriteU8 (m_confirmationCode);
764 m_transactionId = i.
ReadU16 ();
765 m_confirmationCode = i.
ReadU8 ();
774 NS_OBJECT_ENSURE_REGISTERED (
DsaAck);
777 : m_transactionId (0),
778 m_confirmationCode (0)
782 DsaAck::~DsaAck (
void)
787 DsaAck::SetTransactionId (uint16_t transactionId)
789 m_transactionId = transactionId;
793 DsaAck::GetTransactionId (
void)
const
795 return m_transactionId;
799 DsaAck::SetConfirmationCode (uint16_t confirmationCode)
801 m_confirmationCode = confirmationCode;
805 DsaAck::GetConfirmationCode (
void)
const
807 return m_confirmationCode;
811 DsaAck::GetName (
void)
const
817 DsaAck::GetTypeId (
void)
819 static TypeId tid = TypeId (
"ns3::DsaAck").SetParent<Header> ().AddConstructor<DsaAck> ();
832 os <<
" transaction id = " << (uint32_t) m_transactionId <<
", confirmation code = " << (uint32_t) m_confirmationCode;
846 i.
WriteU8 (m_confirmationCode);
853 m_transactionId = i.
ReadU16 ();
854 m_confirmationCode = i.
ReadU8 ();
uint32_t GetSerializedSize(void) const
void Print(std::ostream &os) const
void SetPowerLevelAdjust(uint8_t powerLevelAdjust)
set the relative change in transmission power level that the SS should make in order that transmissio...
void SetServiceFlow(ServiceFlow sf)
specify a service flow to be requested by this message
virtual TypeId GetInstanceTypeId(void) const
void SetServiceFlow(ServiceFlow sf)
specify a service flow to be requested by this message
virtual TypeId GetInstanceTypeId(void) const
ServiceFlow GetServiceFlow(void) const
uint32_t GetSfid(void) const
virtual uint32_t Deserialize(Buffer::Iterator start)
ServiceFlow GetServiceFlow(void) const
#define NS_LOG_COMPONENT_DEFINE(name)
uint32_t GetSfid(void) const
uint32_t GetDlFreqOverride(void) const
uint32_t GetSerializedSize(void) const
uint32_t Deserialize(Buffer::Iterator start)
This class implements the Type-Len-Value structure channel encodings as described by "IEEE Standard f...
uint32_t Deserialize(Buffer::Iterator start)
uint32_t GetDistanceFrom(Iterator const &o) const
uint32_t GetTimingAdjust(void) const
DsaReq()
This class implements the ranging request message described by "IEEE Standard for Local and metropoli...
iterator in a Buffer instance
virtual TypeId GetInstanceTypeId(void) const
virtual void Serialize(Buffer::Iterator start) const
void Serialize(Buffer::Iterator start) const
uint32_t Deserialize(Buffer::Iterator start)
uint16_t GetDlOperBurstProfile(void) const
void WriteU16(uint16_t data)
uint32_t Deserialize(Buffer::Iterator start)
uint32_t Deserialize(Buffer::Iterator start)
void SetTimingAdjust(uint32_t timingAdjust)
set the Tx timing offset adjustment (signed 32-bit).
void Print(std::ostream &os) const
virtual TypeId GetInstanceTypeId(void) const
uint32_t GetSerializedSize(void) const
void Print(std::ostream &os) const
void SetUlChnlIdOverride(uint8_t ulChnlIdOverride)
set the identifier of the uplink channel with which the SS is to redo initial ranging ...
void SetCid(Cid cid)
set the connection identifier
void Serialize(Buffer::Iterator start) const
void SetDlFreqOverride(uint32_t dlFreqOverride)
set the Center frequency, in kHz, of new downlink channel where the SS should redo initial ranging...
virtual uint32_t GetSerializedSize(void) const
void Serialize(Buffer::Iterator start) const
void SetOffsetFreqAdjust(uint32_t offsetFreqAdjust)
set the relative change in transmission frequency that the SS should take in order to better match th...
uint8_t GetPowerLevelAdjust(void) const
void Print(std::ostream &os) const
void Print(std::ostream &os) const
uint32_t GetSerializedSize(void) const
RngReq(void)
This class implements the DSA-REQ message described by "IEEE Standard for Local and metropolitan area...
void SetSfid(uint32_t sfid)
set the service flow identifier
void WriteU8(uint8_t data)
uint32_t GetSerializedSize(void) const
#define NS_LOG_DEBUG(msg)
uint32_t GetSerializedSize(void) const
void SetSfid(uint32_t sfid)
set the service flow identifier
uint32_t GetOffsetFreqAdjust(void) const
uint8_t GetUlChnlIdOverride(void) const
uint32_t Deserialize(Buffer::Iterator start)
virtual TypeId GetInstanceTypeId(void) const
uint16_t GetIdentifier(void) const
Tlv ToTlv(void) const
creates a TLV from this service flow
DsaRsp(void)
This class implements the DSA-RSP message described by "IEEE Standard for Local and metropolitan area...
void SetCid(Cid cid)
set the connection identifier
RngRsp(void)
This class implements the ranging response message described by "IEEE Standard for Local and metropol...
void WriteU32(uint32_t data)
void Serialize(Buffer::Iterator start) const
void Serialize(Buffer::Iterator start) const
void Print(std::ostream &os) const
virtual TypeId GetInstanceTypeId(void) const
DsaAck(void)
This class implements the DSA-ACK message described by "IEEE Standard for Local and metropolitan area...
void Serialize(Buffer::Iterator start) const