src/devices/wifi/dca-txop.h
changeset 2350 0b54480c4fd1
parent 2349 b1df486516a4
child 2508 18b690d1e74b
equal deleted inserted replaced
2349:b1df486516a4 2350:0b54480c4fd1
    24 #include <stdint.h>
    24 #include <stdint.h>
    25 #include "ns3/callback.h"
    25 #include "ns3/callback.h"
    26 #include "ns3/packet.h"
    26 #include "ns3/packet.h"
    27 #include "ns3/callback-trace-source.h"
    27 #include "ns3/callback-trace-source.h"
    28 #include "ns3/nstime.h"
    28 #include "ns3/nstime.h"
       
    29 #include "ns3/object.h"
    29 #include "wifi-mac-header.h"
    30 #include "wifi-mac-header.h"
    30 #include "wifi-mode.h"
    31 #include "wifi-mode.h"
    31 
    32 
    32 namespace ns3 {
    33 namespace ns3 {
    33 
    34 
    59  * it has been retransmitted up until the ssrc or slrc thresholds.
    60  * it has been retransmitted up until the ssrc or slrc thresholds.
    60  *
    61  *
    61  * The rts/cts policy is similar to the fragmentation policy: when
    62  * The rts/cts policy is similar to the fragmentation policy: when
    62  * a packet is bigger than a threshold, the rts/cts protocol is used.
    63  * a packet is bigger than a threshold, the rts/cts protocol is used.
    63  */
    64  */
    64 class DcaTxop 
    65 class DcaTxop : public Object
    65 {
    66 {
    66 public:
    67 public:
    67   typedef Callback <void, WifiMacHeader const&> TxOk;
    68   typedef Callback <void, WifiMacHeader const&> TxOk;
    68   typedef Callback <void, WifiMacHeader const&> TxFailed;
    69   typedef Callback <void, WifiMacHeader const&> TxFailed;
    69 
    70 
    78    * \valueref{WifiRtsCtsThreshold}, and, \valueref{WifiFragmentationThreshold}.
    79    * \valueref{WifiRtsCtsThreshold}, and, \valueref{WifiFragmentationThreshold}.
    79    */
    80    */
    80   DcaTxop (uint32_t cwMin, uint32_t cwMax, uint32_t aifsn, DcfManager *manager);
    81   DcaTxop (uint32_t cwMin, uint32_t cwMax, uint32_t aifsn, DcfManager *manager);
    81   ~DcaTxop ();
    82   ~DcaTxop ();
    82 
    83 
    83   void SetLow (MacLow *low);
    84   void SetLow (Ptr<MacLow> low);
    84   void SetParameters (MacParameters *parameters);
    85   void SetParameters (MacParameters *parameters);
    85   void SetStations (MacStations *stations);
    86   void SetStations (MacStations *stations);
    86   void SetTxMiddle (MacTxMiddle *txMiddle);
    87   void SetTxMiddle (MacTxMiddle *txMiddle);
    87   /**
    88   /**
    88    * \param callback the callback to invoke when a 
    89    * \param callback the callback to invoke when a 
   113   class PhyListener;
   114   class PhyListener;
   114   class Dcf;
   115   class Dcf;
   115   friend class Dcf;
   116   friend class Dcf;
   116   friend class TransmissionListener;
   117   friend class TransmissionListener;
   117 
   118 
   118   MacLow *Low (void);
   119   // Inherited from ns3::Object
       
   120   virtual Ptr<TraceResolver> GetTraceResolver (void) const;  
       
   121   Ptr<MacLow> Low (void);
   119   MacParameters *Parameters (void);
   122   MacParameters *Parameters (void);
   120 
   123 
   121   /* dcf notifications forwarded here */
   124   /* dcf notifications forwarded here */
   122   bool NeedsAccess (void) const;
   125   bool NeedsAccess (void) const;
   123   void NotifyAccessGranted (void);
   126   void NotifyAccessGranted (void);
   149   DcfManager *m_manager;
   152   DcfManager *m_manager;
   150   TxOk m_txOkCallback;
   153   TxOk m_txOkCallback;
   151   TxFailed m_txFailedCallback;
   154   TxFailed m_txFailedCallback;
   152   WifiMacQueue *m_queue;
   155   WifiMacQueue *m_queue;
   153   MacTxMiddle *m_txMiddle;
   156   MacTxMiddle *m_txMiddle;
   154   MacLow *m_low;
   157   Ptr <MacLow> m_low;
   155   MacStations *m_stations;
   158   MacStations *m_stations;
   156   MacParameters *m_parameters;
   159   MacParameters *m_parameters;
   157   TransmissionListener *m_transmissionListener;
   160   TransmissionListener *m_transmissionListener;
   158   RandomStream *m_rng;
   161   RandomStream *m_rng;
   159   
   162