equal
deleted
inserted
replaced
98 * |
98 * |
99 * This class is typically connected to an instance of ns3::Dcf |
99 * This class is typically connected to an instance of ns3::Dcf |
100 * and calls to its methods are forwards to the corresponding |
100 * and calls to its methods are forwards to the corresponding |
101 * ns3::Dcf methods. |
101 * ns3::Dcf methods. |
102 */ |
102 */ |
103 class MacLowNavListener { |
103 class MacLowDcfListener { |
104 public: |
104 public: |
105 MacLowNavListener (); |
105 MacLowDcfListener (); |
106 virtual ~MacLowNavListener (); |
106 virtual ~MacLowDcfListener (); |
107 /** |
107 /** |
108 * \param duration duration of NAV timer |
108 * \param duration duration of NAV timer |
109 */ |
109 */ |
110 virtual void NavStart (Time duration) = 0; |
110 virtual void NavStart (Time duration) = 0; |
111 /** |
111 /** |
112 * \param duration duration of NAV timer |
112 * \param duration duration of NAV timer |
113 */ |
113 */ |
114 virtual void NavReset (Time duration) = 0; |
114 virtual void NavReset (Time duration) = 0; |
|
115 virtual void AckTimeoutStart (Time duration) = 0; |
|
116 virtual void AckTimeoutReset () = 0; |
|
117 virtual void CtsTimeoutStart (Time duration) = 0; |
|
118 virtual void CtsTimeoutReset () = 0; |
115 }; |
119 }; |
116 |
120 |
117 /** |
121 /** |
118 * \brief control how a packet is transmitted. |
122 * \brief control how a packet is transmitted. |
119 * |
123 * |
304 void SetRxCallback (Callback<void,Ptr<Packet>,const WifiMacHeader *> callback); |
308 void SetRxCallback (Callback<void,Ptr<Packet>,const WifiMacHeader *> callback); |
305 /** |
309 /** |
306 * \param listener listen to NAV events for every incoming |
310 * \param listener listen to NAV events for every incoming |
307 * and outgoing packet. |
311 * and outgoing packet. |
308 */ |
312 */ |
309 void RegisterNavListener (MacLowNavListener *listener); |
313 void RegisterDcfListener (MacLowDcfListener *listener); |
310 |
314 |
311 /** |
315 /** |
312 * \param packet to send (does not include the 802.11 MAC header and checksum) |
316 * \param packet to send (does not include the 802.11 MAC header and checksum) |
313 * \param hdr header associated to the packet to send. |
317 * \param hdr header associated to the packet to send. |
314 * \param parameters transmission parameters of packet. |
318 * \param parameters transmission parameters of packet. |
373 Time GetAckDuration (Mac48Address to, WifiMode dataTxMode) const; |
377 Time GetAckDuration (Mac48Address to, WifiMode dataTxMode) const; |
374 void NotifyNav (const WifiMacHeader &hdr, WifiMode txMode, WifiPreamble preamble); |
378 void NotifyNav (const WifiMacHeader &hdr, WifiMode txMode, WifiPreamble preamble); |
375 void DoNavResetNow (Time duration); |
379 void DoNavResetNow (Time duration); |
376 bool DoNavStartNow (Time duration); |
380 bool DoNavStartNow (Time duration); |
377 bool IsNavZero (void) const; |
381 bool IsNavZero (void) const; |
|
382 void NotifyAckTimeoutStartNow (Time duration); |
|
383 void NotifyAckTimeoutResetNow (); |
|
384 void NotifyCtsTimeoutStartNow (Time duration); |
|
385 void NotifyCtsTimeoutResetNow (); |
378 void MaybeCancelPrevious (void); |
386 void MaybeCancelPrevious (void); |
379 |
387 |
380 void NavCounterResetCtsMissed (Time rtsEndRxTime); |
388 void NavCounterResetCtsMissed (Time rtsEndRxTime); |
381 void NormalAckTimeout (void); |
389 void NormalAckTimeout (void); |
382 void FastAckTimeout (void); |
390 void FastAckTimeout (void); |
395 virtual void DoDispose (void); |
403 virtual void DoDispose (void); |
396 |
404 |
397 Ptr<WifiPhy> m_phy; |
405 Ptr<WifiPhy> m_phy; |
398 Ptr<WifiRemoteStationManager> m_stationManager; |
406 Ptr<WifiRemoteStationManager> m_stationManager; |
399 MacLowRxCallback m_rxCallback; |
407 MacLowRxCallback m_rxCallback; |
400 typedef std::vector<MacLowNavListener *>::const_iterator NavListenersCI; |
408 typedef std::vector<MacLowDcfListener *>::const_iterator DcfListenersCI; |
401 typedef std::vector<MacLowNavListener *> NavListeners; |
409 typedef std::vector<MacLowDcfListener *> DcfListeners; |
402 NavListeners m_navListeners; |
410 DcfListeners m_dcfListeners; |
403 |
411 |
404 EventId m_normalAckTimeoutEvent; |
412 EventId m_normalAckTimeoutEvent; |
405 EventId m_fastAckTimeoutEvent; |
413 EventId m_fastAckTimeoutEvent; |
406 EventId m_superFastAckTimeoutEvent; |
414 EventId m_superFastAckTimeoutEvent; |
407 EventId m_fastAckFailedTimeoutEvent; |
415 EventId m_fastAckFailedTimeoutEvent; |