src/node/simple-net-device.cc
author Lalith Suresh <suresh.lalith@gmail.com>
Sun, 18 Jul 2010 13:29:13 +0530
changeset 6339 366418369bda
parent 6109 c204cb0f18d8
permissions -rw-r--r--
Click now handles all packets pertaining to Mac High models
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2833
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
     2
/*
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
     3
 * Copyright (c) 2008 INRIA
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
     4
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
     7
 * published by the Free Software Foundation;
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
     8
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
    12
 * GNU General Public License for more details.
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
    13
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
    14
 * You should have received a copy of the GNU General Public License
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
    15
 * along with this program; if not, write to the Free Software
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
    17
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2831
diff changeset
    19
 */
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
#include "simple-net-device.h"
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    21
#include "simple-channel.h"
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
#include "node.h"
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
#include "ns3/packet.h"
6109
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    24
#include "ns3/log.h"
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    25
#include "ns3/pointer.h"
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    26
#include "ns3/error-model.h"
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    27
#include "ns3/trace-source-accessor.h"
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    28
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    29
NS_LOG_COMPONENT_DEFINE ("SimpleNetDevice");
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    30
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    31
namespace ns3 {
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    32
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    33
TypeId 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    34
SimpleNetDevice::GetTypeId (void)
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    36
  static TypeId tid = TypeId ("ns3::SimpleNetDevice")
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    37
    .SetParent<NetDevice> ()
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    38
    .AddConstructor<SimpleNetDevice> ()
6109
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    39
    .AddAttribute ("ReceiveErrorModel",
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    40
                   "The receiver error model used to simulate packet loss",
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    41
                   PointerValue (),
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    42
                   MakePointerAccessor (&SimpleNetDevice::m_receiveErrorModel),
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    43
                   MakePointerChecker<ErrorModel> ())
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    44
    .AddTraceSource ("PhyRxDrop",
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    45
                     "Trace source indicating a packet has been dropped by the device during reception",
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    46
                     MakeTraceSourceAccessor (&SimpleNetDevice::m_phyRxDropTrace))
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    47
    ;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    48
  return tid;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    49
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    50
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    51
SimpleNetDevice::SimpleNetDevice ()
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    52
  : m_channel (0),
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    53
    m_node (0),
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    54
    m_mtu (0xffff),
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    55
    m_ifIndex (0)
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    56
{}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    57
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    58
void 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    59
SimpleNetDevice::Receive (Ptr<Packet> packet, uint16_t protocol, 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    60
			  Mac48Address to, Mac48Address from)
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    61
{
6109
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    62
  NS_LOG_FUNCTION (packet << protocol << to << from);
3448
0bd851bb1225 Simplify promiscuous mode API: NetDevices always operate in promiscuous mode, normal receive callbacks receive extra destination address and packet type.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3442
diff changeset
    63
  NetDevice::PacketType packetType;
6109
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    64
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    65
  if (m_receiveErrorModel && m_receiveErrorModel->IsCorrupt (packet) )
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    66
    {
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    67
      m_phyRxDropTrace (packet);
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    68
      return;
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    69
    }
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
    70
3448
0bd851bb1225 Simplify promiscuous mode API: NetDevices always operate in promiscuous mode, normal receive callbacks receive extra destination address and packet type.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3442
diff changeset
    71
  if (to == m_address)
0bd851bb1225 Simplify promiscuous mode API: NetDevices always operate in promiscuous mode, normal receive callbacks receive extra destination address and packet type.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3442
diff changeset
    72
    {
0bd851bb1225 Simplify promiscuous mode API: NetDevices always operate in promiscuous mode, normal receive callbacks receive extra destination address and packet type.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3442
diff changeset
    73
      packetType = NetDevice::PACKET_HOST;
0bd851bb1225 Simplify promiscuous mode API: NetDevices always operate in promiscuous mode, normal receive callbacks receive extra destination address and packet type.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3442
diff changeset
    74
    }
3584
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3549
diff changeset
    75
  else if (to.IsBroadcast ())
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    76
    {
3448
0bd851bb1225 Simplify promiscuous mode API: NetDevices always operate in promiscuous mode, normal receive callbacks receive extra destination address and packet type.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3442
diff changeset
    77
      packetType = NetDevice::PACKET_HOST;
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    78
    }
4424
af26433b13bc remove Mac48Address::IsMulticast
Fabian Mauchle <f1mauchl@hsr.ch>
parents: 4322
diff changeset
    79
  else if (to.IsGroup ())
3448
0bd851bb1225 Simplify promiscuous mode API: NetDevices always operate in promiscuous mode, normal receive callbacks receive extra destination address and packet type.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3442
diff changeset
    80
    {
3584
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3549
diff changeset
    81
      packetType = NetDevice::PACKET_MULTICAST;
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3549
diff changeset
    82
    }
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3549
diff changeset
    83
  else 
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3549
diff changeset
    84
    {
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3549
diff changeset
    85
      packetType = NetDevice::PACKET_OTHERHOST;
3448
0bd851bb1225 Simplify promiscuous mode API: NetDevices always operate in promiscuous mode, normal receive callbacks receive extra destination address and packet type.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3442
diff changeset
    86
    }
3460
99698bc858e8 New API considering comments from Craig: NetDevice->Node uses two callbacks; Node->ProtocolHandlers uses a single API with a promiscuous flag.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3448
diff changeset
    87
  m_rxCallback (this, packet, protocol, from);
3584
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3549
diff changeset
    88
  if (!m_promiscCallback.IsNull ())
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3549
diff changeset
    89
    {
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3549
diff changeset
    90
      m_promiscCallback (this, packet, protocol, from, to, packetType);
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3549
diff changeset
    91
    }
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    92
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    93
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    94
void 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    95
SimpleNetDevice::SetChannel (Ptr<SimpleChannel> channel)
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    96
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    97
  m_channel = channel;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    98
  m_channel->Add (this);
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    99
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   100
6109
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
   101
void
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
   102
SimpleNetDevice::SetReceiveErrorModel (Ptr<ErrorModel> em)
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
   103
{
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
   104
  m_receiveErrorModel = em;
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
   105
}
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
   106
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   107
void 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   108
SimpleNetDevice::SetIfIndex(const uint32_t index)
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   109
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   110
  m_ifIndex = index;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   111
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   112
uint32_t 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   113
SimpleNetDevice::GetIfIndex(void) const
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   114
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   115
  return m_ifIndex;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   116
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   117
Ptr<Channel> 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   118
SimpleNetDevice::GetChannel (void) const
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   119
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   120
  return m_channel;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   121
}
4578
88434ff8f0a5 Finally make tap bridge work with VMs (bug 569)
Craig Dowell <craigdo@ee.washington.edu>
parents: 4424
diff changeset
   122
void
88434ff8f0a5 Finally make tap bridge work with VMs (bug 569)
Craig Dowell <craigdo@ee.washington.edu>
parents: 4424
diff changeset
   123
SimpleNetDevice::SetAddress (Address address)
88434ff8f0a5 Finally make tap bridge work with VMs (bug 569)
Craig Dowell <craigdo@ee.washington.edu>
parents: 4424
diff changeset
   124
{
88434ff8f0a5 Finally make tap bridge work with VMs (bug 569)
Craig Dowell <craigdo@ee.washington.edu>
parents: 4424
diff changeset
   125
  m_address = Mac48Address::ConvertFrom(address);
88434ff8f0a5 Finally make tap bridge work with VMs (bug 569)
Craig Dowell <craigdo@ee.washington.edu>
parents: 4424
diff changeset
   126
}
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   127
Address 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   128
SimpleNetDevice::GetAddress (void) const
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   129
{
4578
88434ff8f0a5 Finally make tap bridge work with VMs (bug 569)
Craig Dowell <craigdo@ee.washington.edu>
parents: 4424
diff changeset
   130
  //
88434ff8f0a5 Finally make tap bridge work with VMs (bug 569)
Craig Dowell <craigdo@ee.washington.edu>
parents: 4424
diff changeset
   131
  // Implicit conversion from Mac48Address to Address
88434ff8f0a5 Finally make tap bridge work with VMs (bug 569)
Craig Dowell <craigdo@ee.washington.edu>
parents: 4424
diff changeset
   132
  //
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   133
  return m_address;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   134
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   135
bool 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   136
SimpleNetDevice::SetMtu (const uint16_t mtu)
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   137
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   138
  m_mtu = mtu;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   139
  return true;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   140
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   141
uint16_t 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   142
SimpleNetDevice::GetMtu (void) const
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   143
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   144
  return m_mtu;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   145
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   146
bool 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   147
SimpleNetDevice::IsLinkUp (void) const
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   148
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   149
  return true;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   150
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   151
void 
4764
e90e1ef585b0 [Bug 653] NetDevice link change callback (SetLinkChangeCallback -> AddLinkChangeCallback).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4578
diff changeset
   152
SimpleNetDevice::AddLinkChangeCallback (Callback<void> callback)
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   153
{}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   154
bool 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   155
SimpleNetDevice::IsBroadcast (void) const
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   156
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   157
  return true;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   158
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   159
Address
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   160
SimpleNetDevice::GetBroadcast (void) const
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   161
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   162
  return Mac48Address ("ff:ff:ff:ff:ff:ff");
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   163
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   164
bool 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   165
SimpleNetDevice::IsMulticast (void) const
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   166
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   167
  return false;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   168
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   169
Address 
3841
1e7abf5fca79 Apply Patch to address bug 294 -- due to vincent
Craig Dowell <craigdo@ee.washington.edu>
parents: 3584
diff changeset
   170
SimpleNetDevice::GetMulticast (Ipv4Address multicastGroup) const
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   171
{
3549
4eaf02702f17 shared Mac48 multicast code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3480
diff changeset
   172
  return Mac48Address::GetMulticast (multicastGroup);
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   173
}
3852
9cf7ad0cac85 Initial IPv6 capability
vincent@clarinet.u-strasbg.fr
parents: 3841
diff changeset
   174
9cf7ad0cac85 Initial IPv6 capability
vincent@clarinet.u-strasbg.fr
parents: 3841
diff changeset
   175
Address SimpleNetDevice::GetMulticast (Ipv6Address addr) const
9cf7ad0cac85 Initial IPv6 capability
vincent@clarinet.u-strasbg.fr
parents: 3841
diff changeset
   176
{
9cf7ad0cac85 Initial IPv6 capability
vincent@clarinet.u-strasbg.fr
parents: 3841
diff changeset
   177
	return Mac48Address::GetMulticast (addr);
9cf7ad0cac85 Initial IPv6 capability
vincent@clarinet.u-strasbg.fr
parents: 3841
diff changeset
   178
}
9cf7ad0cac85 Initial IPv6 capability
vincent@clarinet.u-strasbg.fr
parents: 3841
diff changeset
   179
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   180
bool 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   181
SimpleNetDevice::IsPointToPoint (void) const
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   182
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   183
  return false;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   184
}
3936
e525995ce5dc implement IsBridged for net devices
Craig Dowell <craigdo@ee.washington.edu>
parents: 3852
diff changeset
   185
e525995ce5dc implement IsBridged for net devices
Craig Dowell <craigdo@ee.washington.edu>
parents: 3852
diff changeset
   186
bool 
e525995ce5dc implement IsBridged for net devices
Craig Dowell <craigdo@ee.washington.edu>
parents: 3852
diff changeset
   187
SimpleNetDevice::IsBridge (void) const
e525995ce5dc implement IsBridged for net devices
Craig Dowell <craigdo@ee.washington.edu>
parents: 3852
diff changeset
   188
{
e525995ce5dc implement IsBridged for net devices
Craig Dowell <craigdo@ee.washington.edu>
parents: 3852
diff changeset
   189
  return false;
e525995ce5dc implement IsBridged for net devices
Craig Dowell <craigdo@ee.washington.edu>
parents: 3852
diff changeset
   190
}
e525995ce5dc implement IsBridged for net devices
Craig Dowell <craigdo@ee.washington.edu>
parents: 3852
diff changeset
   191
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   192
bool 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   193
SimpleNetDevice::Send(Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber)
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   194
{
6109
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
   195
  NS_LOG_FUNCTION (packet << dest << protocolNumber);
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   196
  Mac48Address to = Mac48Address::ConvertFrom (dest);
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   197
  m_channel->Send (packet, protocolNumber, to, m_address, this);
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   198
  return true;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   199
}
3442
8eef02250bc9 Add a NetDevice::SendFrom API, for sending packets with a custom source MAC address (a.k.a. MAC spoofing). Only implemented for CsmaNetDevice for now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3435
diff changeset
   200
bool 
8eef02250bc9 Add a NetDevice::SendFrom API, for sending packets with a custom source MAC address (a.k.a. MAC spoofing). Only implemented for CsmaNetDevice for now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3435
diff changeset
   201
SimpleNetDevice::SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
8eef02250bc9 Add a NetDevice::SendFrom API, for sending packets with a custom source MAC address (a.k.a. MAC spoofing). Only implemented for CsmaNetDevice for now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3435
diff changeset
   202
{
8eef02250bc9 Add a NetDevice::SendFrom API, for sending packets with a custom source MAC address (a.k.a. MAC spoofing). Only implemented for CsmaNetDevice for now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3435
diff changeset
   203
  Mac48Address to = Mac48Address::ConvertFrom (dest);
8eef02250bc9 Add a NetDevice::SendFrom API, for sending packets with a custom source MAC address (a.k.a. MAC spoofing). Only implemented for CsmaNetDevice for now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3435
diff changeset
   204
  Mac48Address from = Mac48Address::ConvertFrom (source);
8eef02250bc9 Add a NetDevice::SendFrom API, for sending packets with a custom source MAC address (a.k.a. MAC spoofing). Only implemented for CsmaNetDevice for now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3435
diff changeset
   205
  m_channel->Send (packet, protocolNumber, to, from, this);
8eef02250bc9 Add a NetDevice::SendFrom API, for sending packets with a custom source MAC address (a.k.a. MAC spoofing). Only implemented for CsmaNetDevice for now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3435
diff changeset
   206
  return true;
8eef02250bc9 Add a NetDevice::SendFrom API, for sending packets with a custom source MAC address (a.k.a. MAC spoofing). Only implemented for CsmaNetDevice for now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3435
diff changeset
   207
}
8eef02250bc9 Add a NetDevice::SendFrom API, for sending packets with a custom source MAC address (a.k.a. MAC spoofing). Only implemented for CsmaNetDevice for now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3435
diff changeset
   208
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   209
Ptr<Node> 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   210
SimpleNetDevice::GetNode (void) const
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   211
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   212
  return m_node;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   213
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   214
void 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   215
SimpleNetDevice::SetNode (Ptr<Node> node)
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   216
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   217
  m_node = node;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   218
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   219
bool 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   220
SimpleNetDevice::NeedsArp (void) const
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   221
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   222
  return false;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   223
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   224
void 
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   225
SimpleNetDevice::SetReceiveCallback (NetDevice::ReceiveCallback cb)
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   226
{
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   227
  m_rxCallback = cb;
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   228
}
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   229
2831
8bb0479b0949 get rid of channel during dispose
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2673
diff changeset
   230
void
8bb0479b0949 get rid of channel during dispose
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2673
diff changeset
   231
SimpleNetDevice::DoDispose (void)
8bb0479b0949 get rid of channel during dispose
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2673
diff changeset
   232
{
8bb0479b0949 get rid of channel during dispose
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2673
diff changeset
   233
  m_channel = 0;
8bb0479b0949 get rid of channel during dispose
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2673
diff changeset
   234
  m_node = 0;
6109
c204cb0f18d8 [Bug 414] No error model for SimpleNetDevice
Tom Henderson <tomh@tomh.org>
parents: 4764
diff changeset
   235
  m_receiveErrorModel = 0;
2831
8bb0479b0949 get rid of channel during dispose
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2673
diff changeset
   236
  NetDevice::DoDispose ();
8bb0479b0949 get rid of channel during dispose
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2673
diff changeset
   237
}
8bb0479b0949 get rid of channel during dispose
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2673
diff changeset
   238
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   239
3480
a920df6b9f02 Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3460
diff changeset
   240
void
a920df6b9f02 Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3460
diff changeset
   241
SimpleNetDevice::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: 3460
diff changeset
   242
{
3584
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3549
diff changeset
   243
  m_promiscCallback = cb;
3480
a920df6b9f02 Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3460
diff changeset
   244
}
a920df6b9f02 Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3460
diff changeset
   245
a920df6b9f02 Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3460
diff changeset
   246
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
   247
SimpleNetDevice::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: 3460
diff changeset
   248
{
3584
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3549
diff changeset
   249
  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: 3460
diff changeset
   250
}
2673
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   251
a70e0c7aaf56 SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   252
} // namespace ns3