add constructors to specify the address of a device
This commit is contained in:
@@ -159,8 +159,12 @@ private:
|
||||
WifiNetDevice::WifiNetDevice (Ptr<Node> node)
|
||||
: NetDevice (node, Mac48Address::Allocate ())
|
||||
{
|
||||
SetMtu (2300);
|
||||
EnableBroadcast (Mac48Address ("ff:ff:ff:ff:ff:ff"));
|
||||
Construct ();
|
||||
}
|
||||
|
||||
WifiNetDevice::WifiNetDevice (Ptr<Node> node, Mac48Address self)
|
||||
: NetDevice (node, self)
|
||||
{
|
||||
Construct ();
|
||||
}
|
||||
|
||||
@@ -170,6 +174,9 @@ WifiNetDevice::~WifiNetDevice ()
|
||||
void
|
||||
WifiNetDevice::Construct (void)
|
||||
{
|
||||
SetMtu (2300);
|
||||
EnableBroadcast (Mac48Address ("ff:ff:ff:ff:ff:ff"));
|
||||
|
||||
// the physical layer.
|
||||
m_phy = Create<WifiPhy> (this);
|
||||
|
||||
@@ -364,6 +371,16 @@ WifiNetDevice::DoDispose (void)
|
||||
|
||||
AdhocWifiNetDevice::AdhocWifiNetDevice (Ptr<Node> node)
|
||||
: WifiNetDevice (node)
|
||||
{
|
||||
DoConstruct ();
|
||||
}
|
||||
AdhocWifiNetDevice::AdhocWifiNetDevice (Ptr<Node> node, Mac48Address self)
|
||||
: WifiNetDevice (node, self)
|
||||
{
|
||||
DoConstruct ();
|
||||
}
|
||||
void
|
||||
AdhocWifiNetDevice::DoConstruct (void)
|
||||
{
|
||||
m_ssid = WifiDefaultParameters::GetSsid ();
|
||||
m_dca = CreateDca (15, 1023, 2);
|
||||
@@ -378,6 +395,7 @@ AdhocWifiNetDevice::AdhocWifiNetDevice (Ptr<Node> node)
|
||||
m_rxMiddle->SetForwardCallback (MakeCallback (&MacHighAdhoc::Receive, high));
|
||||
m_high = high;
|
||||
}
|
||||
|
||||
AdhocWifiNetDevice::~AdhocWifiNetDevice ()
|
||||
{}
|
||||
Mac48Address
|
||||
@@ -426,6 +444,16 @@ AdhocWifiNetDevice::DoDispose (void)
|
||||
|
||||
NqstaWifiNetDevice::NqstaWifiNetDevice (Ptr<Node> node)
|
||||
: WifiNetDevice (node)
|
||||
{
|
||||
DoConstruct ();
|
||||
}
|
||||
NqstaWifiNetDevice::NqstaWifiNetDevice (Ptr<Node> node, Mac48Address self)
|
||||
: WifiNetDevice (node, self)
|
||||
{
|
||||
DoConstruct ();
|
||||
}
|
||||
void
|
||||
NqstaWifiNetDevice::DoConstruct (void)
|
||||
{
|
||||
m_ssid = WifiDefaultParameters::GetSsid ();
|
||||
m_dca = CreateDca (15, 1023, 2);
|
||||
@@ -444,6 +472,7 @@ NqstaWifiNetDevice::NqstaWifiNetDevice (Ptr<Node> node)
|
||||
m_rxMiddle->SetForwardCallback (MakeCallback (&MacHighNqsta::Receive, high));
|
||||
m_high = high;
|
||||
}
|
||||
|
||||
NqstaWifiNetDevice::~NqstaWifiNetDevice ()
|
||||
{}
|
||||
Mac48Address
|
||||
@@ -505,6 +534,17 @@ NqstaWifiNetDevice::DoDispose (void)
|
||||
|
||||
NqapWifiNetDevice::NqapWifiNetDevice (Ptr<Node> node)
|
||||
: WifiNetDevice (node)
|
||||
{
|
||||
DoConstruct ();
|
||||
}
|
||||
NqapWifiNetDevice::NqapWifiNetDevice (Ptr<Node> node, Mac48Address self)
|
||||
: WifiNetDevice (node, self)
|
||||
{
|
||||
DoConstruct ();
|
||||
|
||||
}
|
||||
void
|
||||
NqapWifiNetDevice::DoConstruct (void)
|
||||
{
|
||||
m_ssid = WifiDefaultParameters::GetSsid ();
|
||||
|
||||
|
||||
@@ -118,6 +118,7 @@ private:
|
||||
CallbackTraceSource<Packet, Mac48Address> m_txLogger;
|
||||
protected:
|
||||
WifiNetDevice (Ptr<Node> node);
|
||||
WifiNetDevice (Ptr<Node> node, Mac48Address self);
|
||||
void DoForwardUp (Packet packet, const Mac48Address &from);
|
||||
virtual void DoDispose (void);
|
||||
DcaTxop *CreateDca (uint32_t minCw, uint32_t maxCw, uint32_t aifsn) const;
|
||||
@@ -143,6 +144,7 @@ protected:
|
||||
class AdhocWifiNetDevice : public WifiNetDevice {
|
||||
public:
|
||||
AdhocWifiNetDevice (Ptr<Node> node);
|
||||
AdhocWifiNetDevice (Ptr<Node> node, Mac48Address self);
|
||||
virtual ~AdhocWifiNetDevice ();
|
||||
|
||||
virtual Mac48Address GetBssid (void) const;
|
||||
@@ -152,6 +154,7 @@ public:
|
||||
protected:
|
||||
virtual void DoDispose (void);
|
||||
private:
|
||||
void DoConstruct (void);
|
||||
void ForwardUp (void);
|
||||
virtual bool DoSendTo (const Packet &packet, Mac48Address const & to);
|
||||
virtual void NotifyConnected (void);
|
||||
@@ -178,6 +181,7 @@ public:
|
||||
* The ssid is initialized from \valueref{WifiSsid}.
|
||||
*/
|
||||
NqstaWifiNetDevice (Ptr<Node> node);
|
||||
NqstaWifiNetDevice (Ptr<Node> node, Mac48Address self);
|
||||
virtual ~NqstaWifiNetDevice ();
|
||||
|
||||
virtual Mac48Address GetBssid (void) const;
|
||||
@@ -193,6 +197,7 @@ public:
|
||||
protected:
|
||||
virtual void DoDispose (void);
|
||||
private:
|
||||
void DoConstruct (void);
|
||||
void Associated (void);
|
||||
void DisAssociated (void);
|
||||
virtual bool DoSendTo (const Packet &packet, Mac48Address const & to);
|
||||
@@ -218,6 +223,7 @@ public:
|
||||
* The ssid is initialized from \valueref{WifiSsid}.
|
||||
*/
|
||||
NqapWifiNetDevice (Ptr<Node> node);
|
||||
NqapWifiNetDevice (Ptr<Node> node, Mac48Address self);
|
||||
virtual ~NqapWifiNetDevice ();
|
||||
|
||||
virtual Mac48Address GetBssid (void) const;
|
||||
@@ -227,6 +233,7 @@ public:
|
||||
protected:
|
||||
virtual void DoDispose (void);
|
||||
private:
|
||||
void DoConstruct (void);
|
||||
virtual bool DoSendTo (const Packet &packet, Mac48Address const & to);
|
||||
virtual void NotifyConnected (void);
|
||||
friend class WifiNetDeviceFactory;
|
||||
|
||||
Reference in New Issue
Block a user