author | Craig Dowell <craigdo@ee.washington.edu> |
Wed, 05 Nov 2008 14:33:20 -0800 | |
changeset 3841 | 1e7abf5fca79 |
parent 3604 | a84d99890289 |
child 3852 | 9cf7ad0cac85 |
permissions | -rw-r--r-- |
1956 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2005,2006 INRIA |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License version 2 as |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
|
19 |
*/ |
|
20 |
#include "wifi-net-device.h" |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
21 |
#include "wifi-mac.h" |
1956 | 22 |
#include "wifi-phy.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
23 |
#include "wifi-remote-station-manager.h" |
1956 | 24 |
#include "wifi-channel.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
25 |
#include "ns3/llc-snap-header.h" |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
26 |
#include "ns3/packet.h" |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
27 |
#include "ns3/uinteger.h" |
2927
73b47ce1d805
get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2649
diff
changeset
|
28 |
#include "ns3/pointer.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
29 |
#include "ns3/node.h" |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
30 |
#include "ns3/trace-source-accessor.h" |
1956 | 31 |
|
32 |
namespace ns3 { |
|
33 |
||
2942
e37b7279e41e
add missing registration macro call
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2935
diff
changeset
|
34 |
NS_OBJECT_ENSURE_REGISTERED (WifiNetDevice); |
e37b7279e41e
add missing registration macro call
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2935
diff
changeset
|
35 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
36 |
TypeId |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
37 |
WifiNetDevice::GetTypeId (void) |
2053
012487e16e31
basic tracing support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2010
diff
changeset
|
38 |
{ |
2602
d9262bff6df2
add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2601
diff
changeset
|
39 |
static TypeId tid = TypeId ("ns3::WifiNetDevice") |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
40 |
.SetParent<NetDevice> () |
2961
2bcb3435483b
improve documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2942
diff
changeset
|
41 |
.AddAttribute ("Channel", "The channel attached to this device", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2961
diff
changeset
|
42 |
PointerValue (), |
2927
73b47ce1d805
get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2649
diff
changeset
|
43 |
MakePointerAccessor (&WifiNetDevice::DoGetChannel, |
73b47ce1d805
get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2649
diff
changeset
|
44 |
&WifiNetDevice::SetChannel), |
2935
c24722e09df2
use a specific type if you can
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2927
diff
changeset
|
45 |
MakePointerChecker<WifiChannel> ()) |
2961
2bcb3435483b
improve documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2942
diff
changeset
|
46 |
.AddAttribute ("Phy", "The PHY layer attached to this device.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2961
diff
changeset
|
47 |
PointerValue (), |
2927
73b47ce1d805
get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2649
diff
changeset
|
48 |
MakePointerAccessor (&WifiNetDevice::GetPhy, |
73b47ce1d805
get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2649
diff
changeset
|
49 |
&WifiNetDevice::SetPhy), |
73b47ce1d805
get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2649
diff
changeset
|
50 |
MakePointerChecker<WifiPhy> ()) |
2961
2bcb3435483b
improve documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2942
diff
changeset
|
51 |
.AddAttribute ("Mac", "The MAC layer attached to this device.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2961
diff
changeset
|
52 |
PointerValue (), |
2927
73b47ce1d805
get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2649
diff
changeset
|
53 |
MakePointerAccessor (&WifiNetDevice::GetMac, |
73b47ce1d805
get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2649
diff
changeset
|
54 |
&WifiNetDevice::SetMac), |
73b47ce1d805
get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2649
diff
changeset
|
55 |
MakePointerChecker<WifiMac> ()) |
2961
2bcb3435483b
improve documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2942
diff
changeset
|
56 |
.AddAttribute ("RemoteStationManager", "The station manager attached to this device.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2961
diff
changeset
|
57 |
PointerValue (), |
2927
73b47ce1d805
get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2649
diff
changeset
|
58 |
MakePointerAccessor (&WifiNetDevice::SetRemoteStationManager, |
73b47ce1d805
get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2649
diff
changeset
|
59 |
&WifiNetDevice::GetRemoteStationManager), |
73b47ce1d805
get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2649
diff
changeset
|
60 |
MakePointerChecker<WifiRemoteStationManager> ()) |
2961
2bcb3435483b
improve documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2942
diff
changeset
|
61 |
.AddTraceSource ("Rx", "Received payload from the MAC layer.", |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
62 |
MakeTraceSourceAccessor (&WifiNetDevice::m_rxLogger)) |
2961
2bcb3435483b
improve documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2942
diff
changeset
|
63 |
.AddTraceSource ("Tx", "Send payload to the MAC layer.", |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
64 |
MakeTraceSourceAccessor (&WifiNetDevice::m_txLogger)) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
65 |
; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
66 |
return tid; |
1964
041240a915f8
build and link
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1956
diff
changeset
|
67 |
} |
041240a915f8
build and link
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1956
diff
changeset
|
68 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
69 |
WifiNetDevice::WifiNetDevice () |
2562
01a2e3e1924d
initialize properly mtu field.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2551
diff
changeset
|
70 |
: m_mtu (0) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
71 |
{} |
1956 | 72 |
WifiNetDevice::~WifiNetDevice () |
2002
32903f9a7315
add dispose methods in subclasses of WifiNetDevice
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1999
diff
changeset
|
73 |
{} |
2530
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
74 |
|
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
75 |
void |
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
76 |
WifiNetDevice::DoDispose (void) |
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
77 |
{ |
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
78 |
m_node = 0; |
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
79 |
m_mac->Dispose (); |
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
80 |
m_phy->Dispose (); |
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
81 |
m_stationManager->Dispose (); |
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
82 |
m_mac = 0; |
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
83 |
m_phy = 0; |
2618
b2706c1a6c3b
release the channel.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
84 |
m_channel = 0; |
2530
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
85 |
m_stationManager = 0; |
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
86 |
// chain up. |
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
87 |
NetDevice::DoDispose (); |
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2528
diff
changeset
|
88 |
} |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
89 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
90 |
void |
2601
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
91 |
WifiNetDevice::SetMac (Ptr<WifiMac> mac) |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
92 |
{ |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
93 |
m_mac = mac; |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
94 |
if (m_mac != 0) |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
95 |
{ |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
96 |
if (m_stationManager != 0) |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
97 |
{ |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
98 |
m_mac->SetWifiRemoteStationManager (m_stationManager); |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
99 |
} |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
100 |
if (m_phy != 0) |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
101 |
{ |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
102 |
m_mac->SetWifiPhy (m_phy); |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
103 |
} |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
104 |
m_mac->SetForwardUpCallback (MakeCallback (&WifiNetDevice::ForwardUp, this)); |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
105 |
m_mac->SetLinkUpCallback (MakeCallback (&WifiNetDevice::LinkUp, this)); |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
106 |
m_mac->SetLinkDownCallback (MakeCallback (&WifiNetDevice::LinkDown, this)); |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
107 |
} |
1956 | 108 |
} |
2620
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
109 |
void |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
110 |
WifiNetDevice::SetPhy (Ptr<WifiPhy> phy) |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
111 |
{ |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
112 |
m_phy = phy; |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
113 |
if (m_phy != 0) |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
114 |
{ |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
115 |
if (m_channel != 0) |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
116 |
{ |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
117 |
m_channel->Add (this, m_phy); |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
118 |
m_phy->SetChannel (m_channel); |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
119 |
} |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
120 |
if (m_stationManager != 0) |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
121 |
{ |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
122 |
m_stationManager->SetupPhy (m_phy); |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
123 |
} |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
124 |
if (m_mac != 0) |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
125 |
{ |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
126 |
m_mac->SetWifiPhy (m_phy); |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
127 |
} |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
128 |
} |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
129 |
} |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
130 |
void |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
131 |
WifiNetDevice::SetRemoteStationManager (Ptr<WifiRemoteStationManager> manager) |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
132 |
{ |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
133 |
m_stationManager = manager; |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
134 |
if (m_stationManager != 0) |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
135 |
{ |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
136 |
if (m_phy != 0) |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
137 |
{ |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
138 |
m_stationManager->SetupPhy (m_phy); |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
139 |
} |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
140 |
if (m_mac != 0) |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
141 |
{ |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
142 |
m_mac->SetWifiRemoteStationManager (m_stationManager); |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
143 |
} |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
144 |
} |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
145 |
} |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
146 |
void |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
147 |
WifiNetDevice::SetChannel (Ptr<WifiChannel> channel) |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
148 |
{ |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
149 |
m_channel = channel; |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
150 |
if (m_channel != 0 && m_phy != 0) |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
151 |
{ |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
152 |
m_channel->Add (this, m_phy); |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
153 |
m_phy->SetChannel (m_channel); |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
154 |
} |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
155 |
} |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
156 |
Ptr<WifiMac> |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
157 |
WifiNetDevice::GetMac (void) const |
1998
41cd4e5694c2
dispose the channel from WifiNetDevice
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1995
diff
changeset
|
158 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
159 |
return m_mac; |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
160 |
} |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
161 |
Ptr<WifiPhy> |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
162 |
WifiNetDevice::GetPhy (void) const |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
163 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
164 |
return m_phy; |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
165 |
} |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
166 |
Ptr<WifiRemoteStationManager> |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
167 |
WifiNetDevice::GetRemoteStationManager (void) const |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
168 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
169 |
return m_stationManager; |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
170 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
171 |
|
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
172 |
void |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
173 |
WifiNetDevice::SetName(const std::string name) |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
174 |
{ |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
175 |
m_name = name; |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
176 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
177 |
std::string |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
178 |
WifiNetDevice::GetName(void) const |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
179 |
{ |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
180 |
return m_name; |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
181 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
182 |
void |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
183 |
WifiNetDevice::SetIfIndex(const uint32_t index) |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
184 |
{ |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
185 |
m_ifIndex = index; |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
186 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
187 |
uint32_t |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
188 |
WifiNetDevice::GetIfIndex(void) const |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
189 |
{ |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
190 |
return m_ifIndex; |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
191 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
192 |
Ptr<Channel> |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
193 |
WifiNetDevice::GetChannel (void) const |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
194 |
{ |
2601
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2600
diff
changeset
|
195 |
return m_channel; |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
196 |
} |
2620
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
197 |
Ptr<WifiChannel> |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
198 |
WifiNetDevice::DoGetChannel (void) const |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
199 |
{ |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
200 |
return m_channel; |
0131b5889305
make sure that all the Setters can be invoked in any order without memory leak
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2618
diff
changeset
|
201 |
} |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
202 |
Address |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
203 |
WifiNetDevice::GetAddress (void) const |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
204 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
205 |
return m_mac->GetAddress (); |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
206 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
207 |
bool |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
208 |
WifiNetDevice::SetMtu (const uint16_t mtu) |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
209 |
{ |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2961
diff
changeset
|
210 |
UintegerValue maxMsduSize; |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2961
diff
changeset
|
211 |
m_mac->GetAttribute ("MaxMsduSize", maxMsduSize); |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2961
diff
changeset
|
212 |
if (mtu > maxMsduSize.Get () || mtu == 0) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
213 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
214 |
return false; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
215 |
} |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
216 |
m_mtu = mtu; |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
217 |
return true; |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
218 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
219 |
uint16_t |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
220 |
WifiNetDevice::GetMtu (void) const |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
221 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
222 |
if (m_mtu == 0) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
223 |
{ |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2961
diff
changeset
|
224 |
UintegerValue maxMsduSize; |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2961
diff
changeset
|
225 |
m_mac->GetAttribute ("MaxMsduSize", maxMsduSize); |
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2961
diff
changeset
|
226 |
m_mtu = maxMsduSize.Get (); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
227 |
} |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
228 |
return m_mtu; |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
229 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
230 |
bool |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
231 |
WifiNetDevice::IsLinkUp (void) const |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
232 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
233 |
return m_phy != 0 && m_linkUp; |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
234 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
235 |
void |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
236 |
WifiNetDevice::SetLinkChangeCallback (Callback<void> callback) |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
237 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
238 |
m_linkChange = callback; |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
239 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
240 |
bool |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
241 |
WifiNetDevice::IsBroadcast (void) const |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
242 |
{ |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
243 |
return true; |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
244 |
} |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
245 |
Address |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
246 |
WifiNetDevice::GetBroadcast (void) const |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
247 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
248 |
return Mac48Address::GetBroadcast (); |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
249 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
250 |
bool |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
251 |
WifiNetDevice::IsMulticast (void) const |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
252 |
{ |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
253 |
return false; |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
254 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
255 |
Address |
3841
1e7abf5fca79
Apply Patch to address bug 294 -- due to vincent
Craig Dowell <craigdo@ee.washington.edu>
parents:
3604
diff
changeset
|
256 |
WifiNetDevice::GetMulticast (Ipv4Address multicastGroup) const |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
257 |
{ |
3549
4eaf02702f17
shared Mac48 multicast code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3517
diff
changeset
|
258 |
return Mac48Address::GetMulticast (multicastGroup); |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
259 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
260 |
bool |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
261 |
WifiNetDevice::IsPointToPoint (void) const |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
262 |
{ |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
263 |
return false; |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
264 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
265 |
bool |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
266 |
WifiNetDevice::Send(Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber) |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
267 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
268 |
NS_ASSERT (Mac48Address::IsMatchingType (dest)); |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
269 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
270 |
Mac48Address realTo = Mac48Address::ConvertFrom (dest); |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
271 |
|
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
272 |
LlcSnapHeader llc; |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
273 |
llc.SetType (protocolNumber); |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
274 |
packet->AddHeader (llc); |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
275 |
|
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
276 |
m_txLogger (packet, realTo); |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
277 |
|
3602
e8e41feee205
implement SendFrom correctly
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3584
diff
changeset
|
278 |
m_mac->Enqueue (packet, realTo); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
279 |
return true; |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
280 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
281 |
Ptr<Node> |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
282 |
WifiNetDevice::GetNode (void) const |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
283 |
{ |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
284 |
return m_node; |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
285 |
} |
2600
6c389d0c717d
add Application::SetNode and NetDevice::SetNode, use them from Node::AddApplication and Node::AddDevice. kill useless "Node" attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2562
diff
changeset
|
286 |
void |
6c389d0c717d
add Application::SetNode and NetDevice::SetNode, use them from Node::AddApplication and Node::AddDevice. kill useless "Node" attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2562
diff
changeset
|
287 |
WifiNetDevice::SetNode (Ptr<Node> node) |
6c389d0c717d
add Application::SetNode and NetDevice::SetNode, use them from Node::AddApplication and Node::AddDevice. kill useless "Node" attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2562
diff
changeset
|
288 |
{ |
6c389d0c717d
add Application::SetNode and NetDevice::SetNode, use them from Node::AddApplication and Node::AddDevice. kill useless "Node" attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2562
diff
changeset
|
289 |
m_node = node; |
6c389d0c717d
add Application::SetNode and NetDevice::SetNode, use them from Node::AddApplication and Node::AddDevice. kill useless "Node" attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2562
diff
changeset
|
290 |
} |
2470
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
291 |
bool |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
292 |
WifiNetDevice::NeedsArp (void) const |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
293 |
{ |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
294 |
return true; |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
295 |
} |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
296 |
void |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
297 |
WifiNetDevice::SetReceiveCallback (NetDevice::ReceiveCallback cb) |
254581fb9e9c
make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2292
diff
changeset
|
298 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
299 |
m_forwardUp = cb; |
1964
041240a915f8
build and link
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1956
diff
changeset
|
300 |
} |
2151
7c63780653f2
add constructors to specify the address of a device
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2146
diff
changeset
|
301 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
302 |
void |
3604
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
303 |
WifiNetDevice::ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to) |
1956 | 304 |
{ |
2649
e7c7618c50a2
make sure the Rx trace event also gets the llc header to be symetric with the tx event.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2620
diff
changeset
|
305 |
m_rxLogger (packet, from); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
306 |
LlcSnapHeader llc; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
307 |
packet->RemoveHeader (llc); |
3604
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
308 |
enum NetDevice::PacketType type; |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
309 |
if (to.IsBroadcast ()) |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
310 |
{ |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
311 |
type = NetDevice::PACKET_BROADCAST; |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
312 |
} |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
313 |
else if (to.IsMulticast ()) |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
314 |
{ |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
315 |
type = NetDevice::PACKET_MULTICAST; |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
316 |
} |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
317 |
else if (to == m_mac->GetAddress ()) |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
318 |
{ |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
319 |
type = NetDevice::PACKET_HOST; |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
320 |
} |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
321 |
else |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
322 |
{ |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
323 |
type = NetDevice::PACKET_OTHERHOST; |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
324 |
} |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
325 |
if (type != NetDevice::PACKET_OTHERHOST) |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
326 |
{ |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
327 |
m_forwardUp (this, packet, llc.GetType (), from); |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
328 |
} |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
329 |
if (!m_promiscRx.IsNull ()) |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
330 |
{ |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
331 |
m_promiscRx (this, packet, llc.GetType (), from, to, type); |
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
332 |
} |
2350
0b54480c4fd1
Hook trace sources into the trace system. Add WifiTrace to give a 'simple' API to tracing wifi-specific sources.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2349
diff
changeset
|
333 |
} |
2002
32903f9a7315
add dispose methods in subclasses of WifiNetDevice
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1999
diff
changeset
|
334 |
|
2151
7c63780653f2
add constructors to specify the address of a device
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2146
diff
changeset
|
335 |
void |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
336 |
WifiNetDevice::LinkUp (void) |
2151
7c63780653f2
add constructors to specify the address of a device
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2146
diff
changeset
|
337 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
338 |
m_linkUp = true; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
339 |
if (!m_linkChange.IsNull ()) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
340 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
341 |
m_linkChange (); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
342 |
} |
1956 | 343 |
} |
344 |
void |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
345 |
WifiNetDevice::LinkDown (void) |
2350
0b54480c4fd1
Hook trace sources into the trace system. Add WifiTrace to give a 'simple' API to tracing wifi-specific sources.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2349
diff
changeset
|
346 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
347 |
m_linkUp = false; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
348 |
if (!m_linkChange.IsNull ()) |
1964
041240a915f8
build and link
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1956
diff
changeset
|
349 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
350 |
m_linkChange (); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2510
diff
changeset
|
351 |
} |
2350
0b54480c4fd1
Hook trace sources into the trace system. Add WifiTrace to give a 'simple' API to tracing wifi-specific sources.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2349
diff
changeset
|
352 |
} |
1956 | 353 |
|
3480
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
354 |
bool |
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
355 |
WifiNetDevice::SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber) |
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
356 |
{ |
3517
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
357 |
NS_ASSERT (Mac48Address::IsMatchingType (dest)); |
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
358 |
NS_ASSERT (Mac48Address::IsMatchingType (source)); |
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
359 |
|
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
360 |
Mac48Address realTo = Mac48Address::ConvertFrom (dest); |
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
361 |
Mac48Address realFrom = Mac48Address::ConvertFrom (source); |
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
362 |
|
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
363 |
LlcSnapHeader llc; |
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
364 |
llc.SetType (protocolNumber); |
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
365 |
packet->AddHeader (llc); |
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
366 |
|
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
367 |
m_txLogger (packet, realTo); |
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
368 |
|
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
369 |
m_mac->Enqueue (packet, realTo, realFrom); |
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
370 |
|
5ba130a7f519
implement WifiNetDevice::SendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3480
diff
changeset
|
371 |
return true; |
3480
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
372 |
} |
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
373 |
|
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
374 |
void |
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
375 |
WifiNetDevice::SetPromiscReceiveCallback (PromiscReceiveCallback cb) |
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
376 |
{ |
3604
a84d99890289
implement promisc mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3603
diff
changeset
|
377 |
m_promiscRx = cb; |
3480
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
378 |
} |
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
379 |
|
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
380 |
bool |
3584
4eb48239b4dc
bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3549
diff
changeset
|
381 |
WifiNetDevice::SupportsSendFrom (void) const |
3480
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
382 |
{ |
3603
da21b3e410b6
implement SupportsSendFrom
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3602
diff
changeset
|
383 |
return m_mac->SupportsSendFrom (); |
3480
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
384 |
} |
a920df6b9f02
Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2965
diff
changeset
|
385 |
|
1956 | 386 |
} // namespace ns3 |
387 |