A Discrete-Event Network Simulator
API
bridge-net-device.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 as
5  * published by the Free Software Foundation;
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  *
16  * Author: Gustavo Carneiro <gjc@inescporto.pt>
17  */
18 #include "bridge-net-device.h"
19 #include "ns3/node.h"
20 #include "ns3/channel.h"
21 #include "ns3/packet.h"
22 #include "ns3/log.h"
23 #include "ns3/boolean.h"
24 #include "ns3/simulator.h"
25 #include "ns3/uinteger.h"
26 
33 namespace ns3 {
34 
35 NS_LOG_COMPONENT_DEFINE ("BridgeNetDevice");
36 
37 NS_OBJECT_ENSURE_REGISTERED (BridgeNetDevice);
38 
39 
40 TypeId
42 {
43  static TypeId tid = TypeId ("ns3::BridgeNetDevice")
44  .SetParent<NetDevice> ()
45  .SetGroupName("Bridge")
46  .AddConstructor<BridgeNetDevice> ()
47  .AddAttribute ("Mtu", "The MAC-level Maximum Transmission Unit",
48  UintegerValue (1500),
51  MakeUintegerChecker<uint16_t> ())
52  .AddAttribute ("EnableLearning",
53  "Enable the learning mode of the Learning Bridge",
54  BooleanValue (true),
57  .AddAttribute ("ExpirationTime",
58  "Time it takes for learned MAC state entry to expire.",
59  TimeValue (Seconds (300)),
61  MakeTimeChecker ())
62  ;
63  return tid;
64 }
65 
66 
68  : m_node (0),
69  m_ifIndex (0)
70 {
72  m_channel = CreateObject<BridgeChannel> ();
73 }
74 
76 {
78 }
79 
80 void
82 {
84  for (std::vector< Ptr<NetDevice> >::iterator iter = m_ports.begin (); iter != m_ports.end (); iter++)
85  {
86  *iter = 0;
87  }
88  m_ports.clear ();
89  m_channel = 0;
90  m_node = 0;
92 }
93 
94 void
95 BridgeNetDevice::ReceiveFromDevice (Ptr<NetDevice> incomingPort, Ptr<const Packet> packet, uint16_t protocol,
96  Address const &src, Address const &dst, PacketType packetType)
97 {
99  NS_LOG_DEBUG ("UID is " << packet->GetUid ());
100 
103 
104  if (!m_promiscRxCallback.IsNull ())
105  {
106  m_promiscRxCallback (this, packet, protocol, src, dst, packetType);
107  }
108 
109  switch (packetType)
110  {
111  case PACKET_HOST:
112  if (dst48 == m_address)
113  {
114  Learn (src48, incomingPort);
115  m_rxCallback (this, packet, protocol, src);
116  }
117  break;
118 
119  case PACKET_BROADCAST:
120  case PACKET_MULTICAST:
121  m_rxCallback (this, packet, protocol, src);
122  ForwardBroadcast (incomingPort, packet, protocol, src48, dst48);
123  break;
124 
125  case PACKET_OTHERHOST:
126  if (dst48 == m_address)
127  {
128  Learn (src48, incomingPort);
129  m_rxCallback (this, packet, protocol, src);
130  }
131  else
132  {
133  ForwardUnicast (incomingPort, packet, protocol, src48, dst48);
134  }
135  break;
136  }
137 }
138 
139 void
141  uint16_t protocol, Mac48Address src, Mac48Address dst)
142 {
144  NS_LOG_DEBUG ("LearningBridgeForward (incomingPort=" << incomingPort->GetInstanceTypeId ().GetName ()
145  << ", packet=" << packet << ", protocol="<<protocol
146  << ", src=" << src << ", dst=" << dst << ")");
147 
148  Learn (src, incomingPort);
149  Ptr<NetDevice> outPort = GetLearnedState (dst);
150  if (outPort != NULL && outPort != incomingPort)
151  {
152  NS_LOG_LOGIC ("Learning bridge state says to use port `" << outPort->GetInstanceTypeId ().GetName () << "'");
153  outPort->SendFrom (packet->Copy (), src, dst, protocol);
154  }
155  else
156  {
157  NS_LOG_LOGIC ("No learned state: send through all ports");
158  for (std::vector< Ptr<NetDevice> >::iterator iter = m_ports.begin ();
159  iter != m_ports.end (); iter++)
160  {
161  Ptr<NetDevice> port = *iter;
162  if (port != incomingPort)
163  {
164  NS_LOG_LOGIC ("LearningBridgeForward (" << src << " => " << dst << "): "
165  << incomingPort->GetInstanceTypeId ().GetName ()
166  << " --> " << port->GetInstanceTypeId ().GetName ()
167  << " (UID " << packet->GetUid () << ").");
168  port->SendFrom (packet->Copy (), src, dst, protocol);
169  }
170  }
171  }
172 }
173 
174 void
176  uint16_t protocol, Mac48Address src, Mac48Address dst)
177 {
179  NS_LOG_DEBUG ("LearningBridgeForward (incomingPort=" << incomingPort->GetInstanceTypeId ().GetName ()
180  << ", packet=" << packet << ", protocol="<<protocol
181  << ", src=" << src << ", dst=" << dst << ")");
182  Learn (src, incomingPort);
183 
184  for (std::vector< Ptr<NetDevice> >::iterator iter = m_ports.begin ();
185  iter != m_ports.end (); iter++)
186  {
187  Ptr<NetDevice> port = *iter;
188  if (port != incomingPort)
189  {
190  NS_LOG_LOGIC ("LearningBridgeForward (" << src << " => " << dst << "): "
191  << incomingPort->GetInstanceTypeId ().GetName ()
192  << " --> " << port->GetInstanceTypeId ().GetName ()
193  << " (UID " << packet->GetUid () << ").");
194  port->SendFrom (packet->Copy (), src, dst, protocol);
195  }
196  }
197 }
198 
200 {
202  if (m_enableLearning)
203  {
204  LearnedState &state = m_learnState[source];
205  state.associatedPort = port;
207  }
208 }
209 
211 {
213  if (m_enableLearning)
214  {
215  Time now = Simulator::Now ();
216  std::map<Mac48Address, LearnedState>::iterator iter =
217  m_learnState.find (source);
218  if (iter != m_learnState.end ())
219  {
220  LearnedState &state = iter->second;
221  if (state.expirationTime > now)
222  {
223  return state.associatedPort;
224  }
225  else
226  {
227  m_learnState.erase (iter);
228  }
229  }
230  }
231  return NULL;
232 }
233 
234 uint32_t
236 {
238  return m_ports.size ();
239 }
240 
241 
244 {
246  return m_ports[n];
247 }
248 
249 void
251 {
253  NS_ASSERT (bridgePort != this);
254  if (!Mac48Address::IsMatchingType (bridgePort->GetAddress ()))
255  {
256  NS_FATAL_ERROR ("Device does not support eui 48 addresses: cannot be added to bridge.");
257  }
258  if (!bridgePort->SupportsSendFrom ())
259  {
260  NS_FATAL_ERROR ("Device does not support SendFrom: cannot be added to bridge.");
261  }
262  if (m_address == Mac48Address ())
263  {
265  }
266 
267  NS_LOG_DEBUG ("RegisterProtocolHandler for " << bridgePort->GetInstanceTypeId ().GetName ());
269  0, bridgePort, true);
270  m_ports.push_back (bridgePort);
271  m_channel->AddChannel (bridgePort->GetChannel ());
272 }
273 
274 void
275 BridgeNetDevice::SetIfIndex (const uint32_t index)
276 {
278  m_ifIndex = index;
279 }
280 
281 uint32_t
283 {
285  return m_ifIndex;
286 }
287 
290 {
292  return m_channel;
293 }
294 
295 void
297 {
300 }
301 
302 Address
304 {
306  return m_address;
307 }
308 
309 bool
310 BridgeNetDevice::SetMtu (const uint16_t mtu)
311 {
313  m_mtu = mtu;
314  return true;
315 }
316 
317 uint16_t
319 {
321  return m_mtu;
322 }
323 
324 
325 bool
327 {
329  return true;
330 }
331 
332 
333 void
335 {}
336 
337 
338 bool
340 {
342  return true;
343 }
344 
345 
346 Address
348 {
350  return Mac48Address ("ff:ff:ff:ff:ff:ff");
351 }
352 
353 bool
355 {
357  return true;
358 }
359 
360 Address
362 {
363  NS_LOG_FUNCTION (this << multicastGroup);
364  Mac48Address multicast = Mac48Address::GetMulticast (multicastGroup);
365  return multicast;
366 }
367 
368 
369 bool
371 {
373  return false;
374 }
375 
376 bool
378 {
380  return true;
381 }
382 
383 
384 bool
385 BridgeNetDevice::Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber)
386 {
388  return SendFrom (packet, m_address, dest, protocolNumber);
389 }
390 
391 bool
392 BridgeNetDevice::SendFrom (Ptr<Packet> packet, const Address& src, const Address& dest, uint16_t protocolNumber)
393 {
396 
397  // try to use the learned state if data is unicast
398  if (!dst.IsGroup ())
399  {
400  Ptr<NetDevice> outPort = GetLearnedState (dst);
401  if (outPort != NULL)
402  {
403  outPort->SendFrom (packet, src, dest, protocolNumber);
404  return true;
405  }
406  }
407 
408  // data was not unicast or no state has been learned for that mac
409  // address => flood through all ports.
410  Ptr<Packet> pktCopy;
411  for (std::vector< Ptr<NetDevice> >::iterator iter = m_ports.begin ();
412  iter != m_ports.end (); iter++)
413  {
414  pktCopy = packet->Copy ();
415  Ptr<NetDevice> port = *iter;
416  port->SendFrom (pktCopy, src, dest, protocolNumber);
417  }
418 
419  return true;
420 }
421 
422 
423 Ptr<Node>
425 {
427  return m_node;
428 }
429 
430 
431 void
433 {
435  m_node = node;
436 }
437 
438 
439 bool
441 {
443  return true;
444 }
445 
446 
447 void
449 {
451  m_rxCallback = cb;
452 }
453 
454 void
456 {
458  m_promiscRxCallback = cb;
459 }
460 
461 bool
463 {
465  return true;
466 }
467 
469 {
470  NS_LOG_FUNCTION (this << addr);
471  return Mac48Address::GetMulticast (addr);
472 }
473 
474 } // namespace ns3
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::NetDevice::PACKET_BROADCAST
@ PACKET_BROADCAST
Packet addressed to all.
Definition: net-device.h:300
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::BridgeNetDevice::AddBridgePort
void AddBridgePort(Ptr< NetDevice > bridgePort)
Add a 'port' to a bridge device.
Definition: bridge-net-device.cc:250
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
NS_ASSERT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:67
ns3::MakeTimeChecker
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:533
ns3::BooleanValue
AttributeValue implementation for Boolean.
Definition: boolean.h:37
ns3::Node::RegisterProtocolHandler
void RegisterProtocolHandler(ProtocolHandler handler, uint16_t protocolType, Ptr< NetDevice > device, bool promiscuous=false)
Definition: node.cc:229
ns3::Mac48Address::GetMulticast
static Mac48Address GetMulticast(Ipv4Address address)
Definition: mac48-address.cc:191
ns3::BridgeNetDevice::ForwardBroadcast
void ForwardBroadcast(Ptr< NetDevice > incomingPort, Ptr< const Packet > packet, uint16_t protocol, Mac48Address src, Mac48Address dst)
Forwards a broadcast or a multicast packet.
Definition: bridge-net-device.cc:175
ns3::Mac48Address::IsGroup
bool IsGroup(void) const
Definition: mac48-address.cc:164
ns3::Mac48Address::IsMatchingType
static bool IsMatchingType(const Address &address)
Definition: mac48-address.cc:110
ns3::Callback< void >
ns3::NetDevice::GetAddress
virtual Address GetAddress(void) const =0
ns3::Simulator::Now
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
ns3::BridgeNetDevice::ReceiveFromDevice
void ReceiveFromDevice(Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, Address const &source, Address const &destination, PacketType packetType)
Receives a packet from one bridged port.
Definition: bridge-net-device.cc:95
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::BridgeNetDevice::BridgeNetDevice
BridgeNetDevice()
Definition: bridge-net-device.cc:67
ns3::Callback::IsNull
bool IsNull(void) const
Check for null implementation.
Definition: callback.h:1386
ns3::BridgeNetDevice::GetMulticast
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
Definition: bridge-net-device.cc:361
ns3::BridgeNetDevice::SetAddress
virtual void SetAddress(Address address)
Set the address of this interface.
Definition: bridge-net-device.cc:296
ns3::BridgeNetDevice::ForwardUnicast
void ForwardUnicast(Ptr< NetDevice > incomingPort, Ptr< const Packet > packet, uint16_t protocol, Mac48Address src, Mac48Address dst)
Forwards a unicast packet.
Definition: bridge-net-device.cc:140
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
ns3::BridgeNetDevice::m_promiscRxCallback
NetDevice::PromiscReceiveCallback m_promiscRxCallback
promiscuous receive callback
Definition: bridge-net-device.h:205
ns3::Ipv6Address
Describes an IPv6 address.
Definition: ipv6-address.h:50
ns3::NetDevice::PACKET_HOST
@ PACKET_HOST
Packet addressed oo us.
Definition: net-device.h:298
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::NetDevice::SendFrom
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)=0
ns3::MakeBooleanAccessor
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: boolean.h:85
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
ns3::BridgeNetDevice::m_learnState
std::map< Mac48Address, LearnedState > m_learnState
Container for known address statuses.
Definition: bridge-net-device.h:219
ns3::BridgeNetDevice::IsBridge
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
Definition: bridge-net-device.cc:377
ns3::Ptr< NetDevice >
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
ns3::BridgeNetDevice::m_expirationTime
Time m_expirationTime
time it takes for learned MAC state to expire
Definition: bridge-net-device.h:208
ns3::BridgeNetDevice::GetChannel
virtual Ptr< Channel > GetChannel(void) const
Definition: bridge-net-device.cc:289
ns3::BridgeNetDevice::m_node
Ptr< Node > m_node
node owning this NetDevice
Definition: bridge-net-device.h:220
ns3::BridgeNetDevice::GetLearnedState
Ptr< NetDevice > GetLearnedState(Mac48Address source)
Gets the port associated to a source address.
Definition: bridge-net-device.cc:210
ns3::NetDevice::PACKET_OTHERHOST
@ PACKET_OTHERHOST
Packet addressed to someone else.
Definition: net-device.h:304
ns3::BridgeNetDevice::GetNode
virtual Ptr< Node > GetNode(void) const
Definition: bridge-net-device.cc:424
ns3::BridgeNetDevice::IsPointToPoint
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
Definition: bridge-net-device.cc:370
ns3::BridgeNetDevice::m_mtu
uint16_t m_mtu
MTU of the bridged NetDevice.
Definition: bridge-net-device.h:224
ns3::Address
a polymophic address class
Definition: address.h:91
ns3::BridgeNetDevice::GetMtu
virtual uint16_t GetMtu(void) const
Definition: bridge-net-device.cc:318
ns3::Mac48Address::ConvertFrom
static Mac48Address ConvertFrom(const Address &address)
Definition: mac48-address.cc:126
ns3::BridgeNetDevice::m_ports
std::vector< Ptr< NetDevice > > m_ports
bridged ports
Definition: bridge-net-device.h:222
ns3::BridgeNetDevice::SetIfIndex
virtual void SetIfIndex(const uint32_t index)
Definition: bridge-net-device.cc:275
ns3::BridgeNetDevice::~BridgeNetDevice
virtual ~BridgeNetDevice()
Definition: bridge-net-device.cc:75
ns3::BridgeNetDevice::GetNBridgePorts
uint32_t GetNBridgePorts(void) const
Gets the number of bridged 'ports', i.e., the NetDevices currently bridged.
Definition: bridge-net-device.cc:235
ns3::MakeBooleanChecker
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
first.address
address
Definition: first.py:44
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::BridgeNetDevice::m_ifIndex
uint32_t m_ifIndex
Interface index.
Definition: bridge-net-device.h:223
ns3::BridgeNetDevice::LearnedState::associatedPort
Ptr< NetDevice > associatedPort
port associated with the address
Definition: bridge-net-device.h:216
ns3::BridgeNetDevice::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: bridge-net-device.cc:41
ns3::BridgeNetDevice::GetBridgePort
Ptr< NetDevice > GetBridgePort(uint32_t n) const
Gets the n-th bridged port.
Definition: bridge-net-device.cc:243
ns3::BridgeNetDevice::GetIfIndex
virtual uint32_t GetIfIndex(void) const
Definition: bridge-net-device.cc:282
ns3::NetDevice::GetChannel
virtual Ptr< Channel > GetChannel(void) const =0
ns3::BridgeNetDevice::SetPromiscReceiveCallback
virtual void SetPromiscReceiveCallback(NetDevice::PromiscReceiveCallback cb)
Definition: bridge-net-device.cc:455
ns3::BridgeNetDevice::NeedsArp
virtual bool NeedsArp(void) const
Definition: bridge-net-device.cc:440
ns3::MakeCallback
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:1642
NS_LOG_LOGIC
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:289
bridge-net-device.h
ns3::BridgeNetDevice declaration.
NS_LOG_FUNCTION_NOARGS
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Definition: log-macros-enabled.h:209
ns3::BridgeNetDevice::IsLinkUp
virtual bool IsLinkUp(void) const
Definition: bridge-net-device.cc:326
ns3::BridgeNetDevice::SendFrom
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
Definition: bridge-net-device.cc:392
ns3::TypeId::GetName
std::string GetName(void) const
Get the name.
Definition: type-id.cc:977
ns3::BridgeNetDevice::m_rxCallback
NetDevice::ReceiveCallback m_rxCallback
receive callback
Definition: bridge-net-device.h:204
ns3::BridgeNetDevice::LearnedState
Structure holding the status of an address.
Definition: bridge-net-device.h:215
ns3::BridgeNetDevice::IsBroadcast
virtual bool IsBroadcast(void) const
Definition: bridge-net-device.cc:339
ns3::BridgeNetDevice::SupportsSendFrom
virtual bool SupportsSendFrom() const
Definition: bridge-net-device.cc:462
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
ns3::Packet::Copy
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:121
ns3::Object::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: object.cc:79
ns3::BridgeNetDevice::GetBroadcast
virtual Address GetBroadcast(void) const
Definition: bridge-net-device.cc:347
ns3::TimeValue
AttributeValue implementation for Time.
Definition: nstime.h:1353
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::BridgeNetDevice::LearnedState::expirationTime
Time expirationTime
time it takes for learned MAC state to expire
Definition: bridge-net-device.h:217
ns3::BridgeNetDevice::m_address
Mac48Address m_address
MAC address of the NetDevice.
Definition: bridge-net-device.h:207
ns3::NetDevice::PacketType
PacketType
Packet types are used as they are in Linux.
Definition: net-device.h:297
ns3::UintegerValue
Hold an unsigned integer type.
Definition: uinteger.h:44
ns3::BridgeNetDevice::AddLinkChangeCallback
virtual void AddLinkChangeCallback(Callback< void > callback)
Definition: bridge-net-device.cc:334
ns3::BridgeNetDevice::GetAddress
virtual Address GetAddress(void) const
Definition: bridge-net-device.cc:303
ns3::BridgeNetDevice::m_channel
Ptr< BridgeChannel > m_channel
virtual bridged channel
Definition: bridge-net-device.h:221
ns3::BridgeNetDevice::SetNode
virtual void SetNode(Ptr< Node > node)
Definition: bridge-net-device.cc:432
ns3::BridgeNetDevice::Send
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
Definition: bridge-net-device.cc:385
ns3::BridgeNetDevice
a virtual net device that bridges multiple LAN segments
Definition: bridge-net-device.h:72
ns3::MakeUintegerAccessor
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: uinteger.h:45
ns3::BridgeNetDevice::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition: bridge-net-device.cc:81
ns3::NetDevice::SupportsSendFrom
virtual bool SupportsSendFrom(void) const =0
ns3::BridgeNetDevice::m_enableLearning
bool m_enableLearning
true if the bridge will learn the node status
Definition: bridge-net-device.h:225
ns3::BridgeNetDevice::SetMtu
virtual bool SetMtu(const uint16_t mtu)
Definition: bridge-net-device.cc:310
ns3::BridgeNetDevice::Learn
void Learn(Mac48Address source, Ptr< NetDevice > port)
Learns the port a MAC address is sending from.
Definition: bridge-net-device.cc:199
ns3::BridgeNetDevice::SetReceiveCallback
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
Definition: bridge-net-device.cc:448
ns3::Object::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition: object.cc:346
sample-rng-plot.n
n
Definition: sample-rng-plot.py:37
ns3::BridgeNetDevice::IsMulticast
virtual bool IsMulticast(void) const
Definition: bridge-net-device.cc:354
ns3::MakeTimeAccessor
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: nstime.h:1354
ns3::Packet::GetUid
uint64_t GetUid(void) const
Returns the packet's Uid.
Definition: packet.cc:390
ns3::NetDevice
Network layer to device interface.
Definition: net-device.h:96
port
uint16_t port
Definition: dsdv-manet.cc:45
ns3::NetDevice::PACKET_MULTICAST
@ PACKET_MULTICAST
Packet addressed to multicast group.
Definition: net-device.h:302