View | Details | Raw Unified | Return to bug 405
Collapse All | Expand All

(-)a/src/devices/wifi/adhoc-wifi-mac.cc (+12 lines)
 Lines 18-23    Link Here 
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
19
 */
20
20
21
#define NS_LOG_APPEND_CONTEXT if (m_netdevice) { std::clog << "[node " << \
22
      (m_netdevice->GetNode ()? m_netdevice->GetNode ()->GetId () : -1) \
23
      << " dev " << m_netdevice->GetIfIndex () << "] "; }
24
21
#include "adhoc-wifi-mac.h"
25
#include "adhoc-wifi-mac.h"
22
#include "dca-txop.h"
26
#include "dca-txop.h"
23
#include "mac-low.h"
27
#include "mac-low.h"
 Lines 26-31    Link Here 
26
#include "dcf-manager.h"
30
#include "dcf-manager.h"
27
#include "ns3/packet.h"
31
#include "ns3/packet.h"
28
#include "ns3/log.h"
32
#include "ns3/log.h"
33
#include "ns3/node.h"
29
34
30
NS_LOG_COMPONENT_DEFINE ("AdhocWifiMac");
35
NS_LOG_COMPONENT_DEFINE ("AdhocWifiMac");
31
36
 Lines 74-79    Link Here 
74
  m_dca = 0;
79
  m_dca = 0;
75
  m_stationManager = 0;
80
  m_stationManager = 0;
76
  WifiMac::DoDispose ();
81
  WifiMac::DoDispose ();
82
}
83
84
void
85
AdhocWifiMac::SetNetDevice (Ptr<NetDevice> netdevice)
86
{
87
  WifiMac::SetNetDevice (netdevice);
88
  m_low->SetNetDevice (netdevice);
77
}
89
}
78
90
79
void 
91
void 
(-)a/src/devices/wifi/adhoc-wifi-mac.h (+1 lines)
 Lines 78-83    Link Here 
78
  virtual void SetAddress (Mac48Address address);
78
  virtual void SetAddress (Mac48Address address);
79
  virtual void SetSsid (Ssid ssid);
79
  virtual void SetSsid (Ssid ssid);
80
  virtual Mac48Address GetBssid (void) const;
80
  virtual Mac48Address GetBssid (void) const;
81
  virtual void SetNetDevice (Ptr<NetDevice> netdevice);
81
82
82
private:
83
private:
83
  // inherited from Object base class.
84
  // inherited from Object base class.
(-)a/src/devices/wifi/mac-low.cc (+10 lines)
 Lines 17-22    Link Here 
17
 *
17
 *
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
19
 */
20
21
#define NS_LOG_APPEND_CONTEXT if (m_netdevice) { std::clog << "[node " << \
22
      (m_netdevice->GetNode ()? m_netdevice->GetNode ()->GetId () : -1) \
23
      << " dev " << m_netdevice->GetIfIndex () << "] "; }
20
24
21
#include "ns3/assert.h"
25
#include "ns3/assert.h"
22
#include "ns3/packet.h"
26
#include "ns3/packet.h"
 Lines 330-335    Link Here 
330
      m_listener->Cancel ();
334
      m_listener->Cancel ();
331
      m_listener = 0;
335
      m_listener = 0;
332
    }
336
    }
337
}
338
339
void
340
MacLow::SetNetDevice (Ptr<NetDevice> netdevice)
341
{
342
  m_netdevice = netdevice;
333
}
343
}
334
344
335
void
345
void
(-)a/src/devices/wifi/mac-low.h (+4 lines)
 Lines 33-38    Link Here 
33
#include "ns3/event-id.h"
33
#include "ns3/event-id.h"
34
#include "ns3/packet.h"
34
#include "ns3/packet.h"
35
#include "ns3/nstime.h"
35
#include "ns3/nstime.h"
36
#include "ns3/net-device.h"
36
37
37
namespace ns3 {
38
namespace ns3 {
38
39
 Lines 288-293    Link Here 
288
  void SetSlotTime (Time slotTime);
289
  void SetSlotTime (Time slotTime);
289
  void SetPifs (Time pifs);
290
  void SetPifs (Time pifs);
290
  void SetBssid (Mac48Address ad);
291
  void SetBssid (Mac48Address ad);
292
  void SetNetDevice (Ptr<NetDevice> netdevice);
291
  Mac48Address GetAddress (void) const;
293
  Mac48Address GetAddress (void) const;
292
  Time GetAckTimeout (void) const;
294
  Time GetAckTimeout (void) const;
293
  Time GetCtsTimeout (void) const;
295
  Time GetCtsTimeout (void) const;
 Lines 427-432    Link Here 
427
429
428
  Time m_lastNavStart;
430
  Time m_lastNavStart;
429
  Time m_lastNavDuration;
431
  Time m_lastNavDuration;
432
433
  Ptr<NetDevice> m_netdevice;
430
};
434
};
431
435
432
} // namespace ns3
436
} // namespace ns3
(-)a/src/devices/wifi/nqap-wifi-mac.cc (+12 lines)
 Lines 17-22    Link Here 
17
 *
17
 *
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
19
 */
20
21
#define NS_LOG_APPEND_CONTEXT if (m_netdevice) { std::clog << "[node " << \
22
      (m_netdevice->GetNode ()? m_netdevice->GetNode ()->GetId () : -1) \
23
      << " dev " << m_netdevice->GetIfIndex () << "] "; }
24
20
#include "ns3/assert.h"
25
#include "ns3/assert.h"
21
#include "ns3/log.h"
26
#include "ns3/log.h"
22
#include "ns3/simulator.h"
27
#include "ns3/simulator.h"
 Lines 98-103    Link Here 
98
  m_beaconDca = 0;
103
  m_beaconDca = 0;
99
  m_beaconEvent.Cancel ();
104
  m_beaconEvent.Cancel ();
100
  WifiMac::DoDispose ();
105
  WifiMac::DoDispose ();
106
}
107
108
void
109
NqapWifiMac::SetNetDevice (Ptr<NetDevice> netdevice)
110
{
111
  WifiMac::SetNetDevice (netdevice);
112
  m_low->SetNetDevice (netdevice);
101
}
113
}
102
114
103
void
115
void
(-)a/src/devices/wifi/nqap-wifi-mac.h (+1 lines)
 Lines 84-89    Link Here 
84
  virtual void SetAddress (Mac48Address address);
84
  virtual void SetAddress (Mac48Address address);
85
  virtual void SetSsid (Ssid ssid);
85
  virtual void SetSsid (Ssid ssid);
86
  virtual Mac48Address GetBssid (void) const;
86
  virtual Mac48Address GetBssid (void) const;
87
  virtual void SetNetDevice (Ptr<NetDevice> netdevice);
87
88
88
  /**
89
  /**
89
   * \param interval the interval between two beacon transmissions.
90
   * \param interval the interval between two beacon transmissions.
(-)a/src/devices/wifi/nqsta-wifi-mac.cc (+13 lines)
 Lines 18-23    Link Here 
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
19
 */
20
20
21
#define NS_LOG_APPEND_CONTEXT if (m_netdevice) { std::clog << "[node " << \
22
      (m_netdevice->GetNode ()? m_netdevice->GetNode ()->GetId () : -1) \
23
      << " dev " << m_netdevice->GetIfIndex () << "] "; }
24
25
21
#include "ns3/packet.h"
26
#include "ns3/packet.h"
22
#include "ns3/simulator.h"
27
#include "ns3/simulator.h"
23
#include "ns3/assert.h"
28
#include "ns3/assert.h"
 Lines 36-41    Link Here 
36
#include "mac-rx-middle.h"
41
#include "mac-rx-middle.h"
37
42
38
NS_LOG_COMPONENT_DEFINE ("NqstaWifiMac");
43
NS_LOG_COMPONENT_DEFINE ("NqstaWifiMac");
44
39
45
40
/*
46
/*
41
 * The state machine for this NQSTA is:
47
 * The state machine for this NQSTA is:
 Lines 131-136    Link Here 
131
  m_phy = 0;
137
  m_phy = 0;
132
  m_dca = 0;
138
  m_dca = 0;
133
  WifiMac::DoDispose ();
139
  WifiMac::DoDispose ();
140
}
141
142
void
143
NqstaWifiMac::SetNetDevice (Ptr<NetDevice> netdevice)
144
{
145
  WifiMac::SetNetDevice (netdevice);
146
  m_low->SetNetDevice (netdevice);
134
}
147
}
135
148
136
void 
149
void 
(-)a/src/devices/wifi/nqsta-wifi-mac.h (+1 lines)
 Lines 86-91    Link Here 
86
  virtual void SetAddress (Mac48Address address);
86
  virtual void SetAddress (Mac48Address address);
87
  virtual void SetSsid (Ssid ssid);
87
  virtual void SetSsid (Ssid ssid);
88
  virtual Mac48Address GetBssid (void) const;
88
  virtual Mac48Address GetBssid (void) const;
89
  virtual void SetNetDevice (Ptr<NetDevice> netdevice);
89
90
90
  /**
91
  /**
91
   * \param missed the number of beacons which must be missed
92
   * \param missed the number of beacons which must be missed
(-)a/src/devices/wifi/wifi-mac-header.cc (-7 / +7 lines)
 Lines 779-787    Link Here 
779
void 
779
void 
780
WifiMacHeader::PrintFrameControl (std::ostream &os) const
780
WifiMacHeader::PrintFrameControl (std::ostream &os) const
781
{
781
{
782
  os << "ToDS=" << m_ctrlToDs << ", FromDS=" << m_ctrlFromDs 
782
  os << "ToDS=" << int (m_ctrlToDs) << ", FromDS=" << int (m_ctrlFromDs) 
783
     << ", MoreFrag=" << m_ctrlMoreFrag << ", Retry=" << m_ctrlRetry 
783
     << ", MoreFrag=" << int (m_ctrlMoreFrag) << ", Retry=" << int (m_ctrlRetry) 
784
     << ", MoreData=" << m_ctrlMoreData 
784
     << ", MoreData=" << int (m_ctrlMoreData) 
785
    ;
785
    ;
786
}
786
}
787
787
 Lines 818-825    Link Here 
818
      PrintFrameControl (os);
818
      PrintFrameControl (os);
819
      os << " Duration/ID=" << m_duration << "us"
819
      os << " Duration/ID=" << m_duration << "us"
820
         << ", DA=" << m_addr1 << ", SA=" << m_addr2
820
         << ", DA=" << m_addr1 << ", SA=" << m_addr2
821
         << ", BSSID=" << m_addr3 << ", FragNumber=" << m_seqFrag
821
         << ", BSSID=" << m_addr3 << ", FragNumber=" << int (m_seqFrag)
822
         << ", SeqNumber=" << m_seqSeq;
822
         << ", SeqNumber=" << int (m_seqSeq);
823
      break;
823
      break;
824
    case WIFI_MAC_DATA:
824
    case WIFI_MAC_DATA:
825
      PrintFrameControl (os);
825
      PrintFrameControl (os);
 Lines 844-851    Link Here 
844
        {
844
        {
845
          NS_ASSERT (false);
845
          NS_ASSERT (false);
846
        }
846
        }
847
      os << ", FragNumber=" << m_seqFrag
847
      os << ", FragNumber=" << int (m_seqFrag)
848
         << ", SeqNumber=" << m_seqSeq;
848
         << ", SeqNumber=" << int (m_seqSeq);
849
      break;
849
      break;
850
    case WIFI_MAC_DATA_CFACK:
850
    case WIFI_MAC_DATA_CFACK:
851
    case WIFI_MAC_DATA_CFPOLL:
851
    case WIFI_MAC_DATA_CFPOLL:
(-)a/src/devices/wifi/wifi-mac.cc (+6 lines)
 Lines 23-28    Link Here 
23
namespace ns3 {
23
namespace ns3 {
24
24
25
NS_OBJECT_ENSURE_REGISTERED (WifiMac);
25
NS_OBJECT_ENSURE_REGISTERED (WifiMac);
26
27
void
28
WifiMac::SetNetDevice (Ptr<NetDevice> netdevice)
29
{
30
  m_netdevice = netdevice;
31
}
26
32
27
Time
33
Time
28
WifiMac::GetDefaultMaxPropagationDelay (void)
34
WifiMac::GetDefaultMaxPropagationDelay (void)
(-)a/src/devices/wifi/wifi-mac.h (-1 / +7 lines)
 Lines 22-27    Link Here 
22
22
23
#include "ns3/packet.h"
23
#include "ns3/packet.h"
24
#include "ns3/mac48-address.h"
24
#include "ns3/mac48-address.h"
25
#include "ns3/net-device.h"
25
#include "ns3/wifi-channel.h"
26
#include "ns3/wifi-channel.h"
26
27
27
#include "wifi-phy.h"
28
#include "wifi-phy.h"
 Lines 37-46    Link Here 
37
 * DCA, EDCA, etc) and all the high-level MAC functionality
38
 * DCA, EDCA, etc) and all the high-level MAC functionality
38
 * (association/disassociation state machines).
39
 * (association/disassociation state machines).
39
 *
40
 *
40
 */
41
*/
41
class WifiMac : public Object
42
class WifiMac : public Object
42
{
43
{
43
public:
44
public:
45
46
  virtual void SetNetDevice (Ptr<NetDevice> netdevice);
44
47
45
  struct ScanningEntry
48
  struct ScanningEntry
46
  {
49
  {
 Lines 149-154    Link Here 
149
                                    ScanningCallback callback,
152
                                    ScanningCallback callback,
150
                                    Ptr<NetDevice> netdevice);
153
                                    Ptr<NetDevice> netdevice);
151
154
155
protected:
156
  Ptr<NetDevice> m_netdevice;
157
152
private:
158
private:
153
  friend class WifiNetDevice;
159
  friend class WifiNetDevice;
154
  /**
160
  /**
(-)a/src/devices/wifi/wifi-net-device.cc (+1 lines)
 Lines 107-112    Link Here 
107
      m_mac->SetForwardUpCallback (MakeCallback (&WifiNetDevice::ForwardUp, this));
107
      m_mac->SetForwardUpCallback (MakeCallback (&WifiNetDevice::ForwardUp, this));
108
      m_mac->SetLinkUpCallback (MakeCallback (&WifiNetDevice::LinkUp, this));
108
      m_mac->SetLinkUpCallback (MakeCallback (&WifiNetDevice::LinkUp, this));
109
      m_mac->SetLinkDownCallback (MakeCallback (&WifiNetDevice::LinkDown, this));
109
      m_mac->SetLinkDownCallback (MakeCallback (&WifiNetDevice::LinkDown, this));
110
      m_mac->SetNetDevice (this);
110
    }
111
    }
111
}
112
}
112
void 
113
void 

Return to bug 405