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

(-)a/src/devices/bridge/bridge-channel.cc (-1 / +1 lines)
 Lines 34-40    Link Here 
34
}
34
}
35
35
36
BridgeChannel::BridgeChannel ()
36
BridgeChannel::BridgeChannel ()
37
  : Channel ("BridgeChannel")
37
  : Channel ()
38
{
38
{
39
  NS_LOG_FUNCTION_NOARGS ();
39
  NS_LOG_FUNCTION_NOARGS ();
40
}
40
}
(-)a/src/devices/bridge/bridge-net-device.cc (-23 / +10 lines)
 Lines 53-59    Link Here 
53
53
54
BridgeNetDevice::BridgeNetDevice ()
54
BridgeNetDevice::BridgeNetDevice ()
55
  : m_node (0),
55
  : m_node (0),
56
    m_name (""),
57
    m_ifIndex (0),
56
    m_ifIndex (0),
58
    m_mtu (0xffff)
57
    m_mtu (0xffff)
59
{
58
{
 Lines 121-127    Link Here 
121
                                 uint16_t protocol, Mac48Address src, Mac48Address dst)
120
                                 uint16_t protocol, Mac48Address src, Mac48Address dst)
122
{
121
{
123
  NS_LOG_FUNCTION_NOARGS ();
122
  NS_LOG_FUNCTION_NOARGS ();
124
  NS_LOG_DEBUG ("LearningBridgeForward (incomingPort=" << incomingPort->GetName ()
123
  NS_LOG_DEBUG ("LearningBridgeForward (incomingPort=" << incomingPort->GetInstanceTypeId ().GetName ()
125
                << ", packet=" << packet << ", protocol="<<protocol
124
                << ", packet=" << packet << ", protocol="<<protocol
126
                << ", src=" << src << ", dst=" << dst << ")");
125
                << ", src=" << src << ", dst=" << dst << ")");
127
126
 Lines 129-135    Link Here 
129
  Ptr<NetDevice> outPort = GetLearnedState (dst);
128
  Ptr<NetDevice> outPort = GetLearnedState (dst);
130
  if (outPort != NULL && outPort != incomingPort)
129
  if (outPort != NULL && outPort != incomingPort)
131
    {
130
    {
132
      NS_LOG_LOGIC ("Learning bridge state says to use port `" << outPort->GetName () << "'");
131
      NS_LOG_LOGIC ("Learning bridge state says to use port `" << outPort->GetInstanceTypeId ().GetName () << "'");
133
      outPort->SendFrom (packet->Copy (), src, dst, protocol);
132
      outPort->SendFrom (packet->Copy (), src, dst, protocol);
134
    }
133
    }
135
  else
134
  else
 Lines 141-148    Link Here 
141
          Ptr<NetDevice> port = *iter;
140
          Ptr<NetDevice> port = *iter;
142
          if (port != incomingPort)
141
          if (port != incomingPort)
143
            {
142
            {
144
              NS_LOG_LOGIC ("LearningBridgeForward (" << src << " => " << dst << "): " << incomingPort->GetName ()
143
              NS_LOG_LOGIC ("LearningBridgeForward (" << src << " => " << dst << "): " 
145
                            << " --> " << port->GetName ()
144
                            << incomingPort->GetInstanceTypeId ().GetName ()
145
                            << " --> " << port->GetInstanceTypeId ().GetName ()
146
                            << " (UID " << packet->GetUid () << ").");
146
                            << " (UID " << packet->GetUid () << ").");
147
              port->SendFrom (packet->Copy (), src, dst, protocol);
147
              port->SendFrom (packet->Copy (), src, dst, protocol);
148
            }
148
            }
 Lines 155-161    Link Here 
155
                                        uint16_t protocol, Mac48Address src, Mac48Address dst)
155
                                        uint16_t protocol, Mac48Address src, Mac48Address dst)
156
{
156
{
157
  NS_LOG_FUNCTION_NOARGS ();
157
  NS_LOG_FUNCTION_NOARGS ();
158
  NS_LOG_DEBUG ("LearningBridgeForward (incomingPort=" << incomingPort->GetName ()
158
  NS_LOG_DEBUG ("LearningBridgeForward (incomingPort=" << incomingPort->GetInstanceTypeId ().GetName ()
159
                << ", packet=" << packet << ", protocol="<<protocol
159
                << ", packet=" << packet << ", protocol="<<protocol
160
                << ", src=" << src << ", dst=" << dst << ")");
160
                << ", src=" << src << ", dst=" << dst << ")");
161
  Learn (src, incomingPort);
161
  Learn (src, incomingPort);
 Lines 166-173    Link Here 
166
      Ptr<NetDevice> port = *iter;
166
      Ptr<NetDevice> port = *iter;
167
      if (port != incomingPort)
167
      if (port != incomingPort)
168
        {
168
        {
169
          NS_LOG_LOGIC ("LearningBridgeForward (" << src << " => " << dst << "): " << incomingPort->GetName ()
169
          NS_LOG_LOGIC ("LearningBridgeForward (" << src << " => " << dst << "): " 
170
                        << " --> " << port->GetName ()
170
                        << incomingPort->GetInstanceTypeId ().GetName ()
171
                        << " --> " << port->GetInstanceTypeId ().GetName ()
171
                        << " (UID " << packet->GetUid () << ").");
172
                        << " (UID " << packet->GetUid () << ").");
172
          port->SendFrom (packet->Copy (), src, dst, protocol);
173
          port->SendFrom (packet->Copy (), src, dst, protocol);
173
        }
174
        }
 Lines 242-248    Link Here 
242
      m_address = Mac48Address::ConvertFrom (bridgePort->GetAddress ());
243
      m_address = Mac48Address::ConvertFrom (bridgePort->GetAddress ());
243
    }
244
    }
244
245
245
  NS_LOG_DEBUG ("RegisterProtocolHandler for " << bridgePort->GetName ());
246
  NS_LOG_DEBUG ("RegisterProtocolHandler for " << bridgePort->GetInstanceTypeId ().GetName ());
246
  m_node->RegisterProtocolHandler (MakeCallback (&BridgeNetDevice::ReceiveFromDevice, this),
247
  m_node->RegisterProtocolHandler (MakeCallback (&BridgeNetDevice::ReceiveFromDevice, this),
247
                                   0, bridgePort, true);
248
                                   0, bridgePort, true);
248
  m_ports.push_back (bridgePort);
249
  m_ports.push_back (bridgePort);
 Lines 250-269    Link Here 
250
}
251
}
251
252
252
void 
253
void 
253
BridgeNetDevice::SetName(const std::string name)
254
{
255
  NS_LOG_FUNCTION_NOARGS ();
256
  m_name = name;
257
}
258
259
std::string 
260
BridgeNetDevice::GetName(void) const
261
{
262
  NS_LOG_FUNCTION_NOARGS ();
263
  return m_name;
264
}
265
266
void 
267
BridgeNetDevice::SetIfIndex(const uint32_t index)
254
BridgeNetDevice::SetIfIndex(const uint32_t index)
268
{
255
{
269
  NS_LOG_FUNCTION_NOARGS ();
256
  NS_LOG_FUNCTION_NOARGS ();
(-)a/src/devices/bridge/bridge-net-device.h (-3 lines)
 Lines 88-95    Link Here 
88
  Ptr<NetDevice> GetBridgePort (uint32_t n) const;
88
  Ptr<NetDevice> GetBridgePort (uint32_t n) const;
89
89
90
  // inherited from NetDevice base class.
90
  // inherited from NetDevice base class.
91
  virtual void SetName(const std::string name);
92
  virtual std::string GetName(void) const;
93
  virtual void SetIfIndex(const uint32_t index);
91
  virtual void SetIfIndex(const uint32_t index);
94
  virtual uint32_t GetIfIndex(void) const;
92
  virtual uint32_t GetIfIndex(void) const;
95
  virtual Ptr<Channel> GetChannel (void) const;
93
  virtual Ptr<Channel> GetChannel (void) const;
 Lines 140-146    Link Here 
140
  std::map<Mac48Address, LearnedState> m_learnState;
138
  std::map<Mac48Address, LearnedState> m_learnState;
141
  Ptr<Node> m_node;
139
  Ptr<Node> m_node;
142
  Ptr<BridgeChannel> m_channel;
140
  Ptr<BridgeChannel> m_channel;
143
  std::string m_name;
144
  std::vector< Ptr<NetDevice> > m_ports;
141
  std::vector< Ptr<NetDevice> > m_ports;
145
  uint32_t m_ifIndex;
142
  uint32_t m_ifIndex;
146
  uint16_t m_mtu;
143
  uint16_t m_mtu;
(-)a/src/devices/csma/csma-channel.cc (-1 / +1 lines)
 Lines 51-57    Link Here 
51
51
52
CsmaChannel::CsmaChannel ()
52
CsmaChannel::CsmaChannel ()
53
: 
53
: 
54
  Channel ("Csma Channel")
54
  Channel ()
55
{
55
{
56
  NS_LOG_FUNCTION_NOARGS ();
56
  NS_LOG_FUNCTION_NOARGS ();
57
  m_state = IDLE;
57
  m_state = IDLE;
(-)a/src/devices/csma/csma-net-device.cc (-35 / +1 lines)
 Lines 93-100    Link Here 
93
}
93
}
94
94
95
CsmaNetDevice::CsmaNetDevice ()
95
CsmaNetDevice::CsmaNetDevice ()
96
  : m_name (""),
96
 : m_linkUp (false)
97
    m_linkUp (false)
98
{
97
{
99
  NS_LOG_FUNCTION (this);
98
  NS_LOG_FUNCTION (this);
100
  m_txMachineState = READY;
99
  m_txMachineState = READY;
 Lines 775-794    Link Here 
775
}
774
}
776
775
777
  void 
776
  void 
778
CsmaNetDevice::SetName (const std::string name)
779
{
780
  NS_LOG_FUNCTION (name);
781
  m_name = name;
782
}
783
784
  std::string 
785
CsmaNetDevice::GetName (void) const
786
{
787
  NS_LOG_FUNCTION_NOARGS ();
788
  return m_name;
789
}
790
791
  void 
792
CsmaNetDevice::SetIfIndex (const uint32_t index)
777
CsmaNetDevice::SetIfIndex (const uint32_t index)
793
{
778
{
794
  NS_LOG_FUNCTION (index);
779
  NS_LOG_FUNCTION (index);
 Lines 950-974    Link Here 
950
  NS_LOG_FUNCTION (node);
935
  NS_LOG_FUNCTION (node);
951
936
952
  m_node = node;
937
  m_node = node;
953
  int count = -1;
954
  if (m_name.size () == 0)
955
    {
956
      for (uint32_t i = 0; i < node->GetNDevices (); i++)
957
        {
958
          Ptr<NetDevice> dev = node->GetDevice (i);
959
          if (dynamic_cast<CsmaNetDevice*> (PeekPointer (dev)))
960
            {
961
              count++;
962
              if (dev == this)
963
                {
964
                  break;
965
                }
966
            }
967
        }
968
      std::ostringstream s;
969
      s << "eth" << count;
970
      m_name = s.str ();
971
    }
972
}
938
}
973
939
974
  bool 
940
  bool 
(-)a/src/devices/csma/csma-net-device.h (-7 lines)
 Lines 306-313    Link Here 
306
  //
306
  //
307
  // The following methods are inherited from NetDevice base class.
307
  // The following methods are inherited from NetDevice base class.
308
  //
308
  //
309
  virtual void SetName (const std::string name);
310
  virtual std::string GetName (void) const;
311
  virtual void SetIfIndex (const uint32_t index);
309
  virtual void SetIfIndex (const uint32_t index);
312
  virtual uint32_t GetIfIndex (void) const;
310
  virtual uint32_t GetIfIndex (void) const;
313
  virtual Ptr<Channel> GetChannel (void) const;
311
  virtual Ptr<Channel> GetChannel (void) const;
 Lines 683-693    Link Here 
683
  uint32_t m_ifIndex;
681
  uint32_t m_ifIndex;
684
682
685
  /**
683
  /**
686
   * The human readable name of this device.
687
   */
688
  std::string m_name;
689
690
  /**
691
   * Flag indicating whether or not the link is up.  In this case,
684
   * Flag indicating whether or not the link is up.  In this case,
692
   * whether or not the device is connected to a channel.
685
   * whether or not the device is connected to a channel.
693
   */
686
   */
(-)a/src/devices/emu/emu-net-device.cc (-19 / +1 lines)
 Lines 67-77    Link Here 
67
                   Mac48AddressValue (Mac48Address ("ff:ff:ff:ff:ff:ff")),
67
                   Mac48AddressValue (Mac48Address ("ff:ff:ff:ff:ff:ff")),
68
                   MakeMac48AddressAccessor (&EmuNetDevice::m_address),
68
                   MakeMac48AddressAccessor (&EmuNetDevice::m_address),
69
                   MakeMac48AddressChecker ())
69
                   MakeMac48AddressChecker ())
70
    .AddAttribute ("DeviceName", 
71
                   "The name of the underlying real device (e.g. eth1).",
72
                   StringValue ("eth1"),
73
                   MakeStringAccessor (&EmuNetDevice::m_deviceName),
74
                   MakeStringChecker ())
75
    .AddAttribute ("Start", 
70
    .AddAttribute ("Start", 
76
                   "The simulation time at which to spin up the device thread.",
71
                   "The simulation time at which to spin up the device thread.",
77
                   TimeValue (Seconds (0.)),
72
                   TimeValue (Seconds (0.)),
 Lines 102-109    Link Here 
102
  m_sock (-1),
97
  m_sock (-1),
103
  m_readThread (0),
98
  m_readThread (0),
104
  m_ifIndex (std::numeric_limits<uint32_t>::max ()),  // absurdly large value
99
  m_ifIndex (std::numeric_limits<uint32_t>::max ()),  // absurdly large value
105
  m_sll_ifindex (-1),
100
  m_sll_ifindex (-1)
106
  m_name ("Emu NetDevice")
107
{
101
{
108
  NS_LOG_FUNCTION (this);
102
  NS_LOG_FUNCTION (this);
109
  Start (m_tStart);
103
  Start (m_tStart);
 Lines 743-760    Link Here 
743
}
737
}
744
738
745
void 
739
void 
746
EmuNetDevice::SetName(const std::string name)
747
{
748
  m_name = name;
749
}
750
751
std::string 
752
EmuNetDevice::GetName(void) const
753
{
754
  return m_name;
755
}
756
757
void 
758
EmuNetDevice::SetIfIndex(const uint32_t index)
740
EmuNetDevice::SetIfIndex(const uint32_t index)
759
{
741
{
760
  m_ifIndex = index;
742
  m_ifIndex = index;
(-)a/src/devices/emu/emu-net-device.h (-8 lines)
 Lines 105-113    Link Here 
105
//
105
//
106
// Pure virtual methods inherited from NetDevice we must implement.
106
// Pure virtual methods inherited from NetDevice we must implement.
107
//
107
//
108
  virtual void SetName(const std::string name);
109
  virtual std::string GetName(void) const;
110
111
  virtual void SetIfIndex(const uint32_t index);
108
  virtual void SetIfIndex(const uint32_t index);
112
  virtual uint32_t GetIfIndex(void) const;
109
  virtual uint32_t GetIfIndex(void) const;
113
110
 Lines 328-338    Link Here 
328
  int32_t m_sll_ifindex;
325
  int32_t m_sll_ifindex;
329
326
330
  /**
327
  /**
331
   * The human readable name of this device.
332
   */
333
  std::string m_name;
334
335
  /**
336
   * Flag indicating whether or not the link is up.  In this case,
328
   * Flag indicating whether or not the link is up.  In this case,
337
   * whether or not the device is connected to a channel.
329
   * whether or not the device is connected to a channel.
338
   */
330
   */
(-)a/src/devices/point-to-point/point-to-point-channel.cc (-2 / +2 lines)
 Lines 43-53    Link Here 
43
}
43
}
44
44
45
//
45
//
46
// By default, you get a channel with the name "PointToPoint Channel" that 
46
// By default, you get a channel that 
47
// has an "infitely" fast transmission speed and zero delay.
47
// has an "infitely" fast transmission speed and zero delay.
48
PointToPointChannel::PointToPointChannel()
48
PointToPointChannel::PointToPointChannel()
49
: 
49
: 
50
  Channel ("PointToPoint Channel"), 
50
  Channel (), 
51
  m_delay (Seconds (0.)),
51
  m_delay (Seconds (0.)),
52
  m_nDevices (0)
52
  m_nDevices (0)
53
{
53
{
(-)a/src/devices/point-to-point/point-to-point-channel.h (-1 / +1 lines)
 Lines 50-56    Link Here 
50
  /**
50
  /**
51
   * \brief Create a PointToPointChannel
51
   * \brief Create a PointToPointChannel
52
   *
52
   *
53
   * By default, you get a channel with the name "PointToPoint Channel" that
53
   * By default, you get a channel that
54
   * has zero transmission delay.
54
   * has zero transmission delay.
55
   */
55
   */
56
  PointToPointChannel ();
56
  PointToPointChannel ();
(-)a/src/devices/point-to-point/point-to-point-net-device.cc (-13 lines)
 Lines 88-94    Link Here 
88
: 
88
: 
89
  m_txMachineState (READY),
89
  m_txMachineState (READY),
90
  m_channel (0), 
90
  m_channel (0), 
91
  m_name (""),
92
  m_linkUp (false)
91
  m_linkUp (false)
93
{
92
{
94
  NS_LOG_FUNCTION (this);
93
  NS_LOG_FUNCTION (this);
 Lines 282-299    Link Here 
282
}
281
}
283
282
284
  void 
283
  void 
285
PointToPointNetDevice::SetName(const std::string name)
286
{
287
  m_name = name;
288
}
289
290
  std::string 
291
PointToPointNetDevice::GetName(void) const
292
{
293
  return m_name;
294
}
295
296
  void 
297
PointToPointNetDevice::SetIfIndex(const uint32_t index)
284
PointToPointNetDevice::SetIfIndex(const uint32_t index)
298
{
285
{
299
  m_ifIndex = index;
286
  m_ifIndex = index;
(-)a/src/devices/point-to-point/point-to-point-net-device.h (-7 lines)
 Lines 226-237    Link Here 
226
   */
226
   */
227
  uint16_t GetFrameSize (void) const;
227
  uint16_t GetFrameSize (void) const;
228
228
229
//
230
// Pure virtual methods inherited from NetDevice we must implement.
231
//
232
  virtual void SetName(const std::string name);
233
  virtual std::string GetName(void) const;
234
235
  virtual void SetIfIndex(const uint32_t index);
229
  virtual void SetIfIndex(const uint32_t index);
236
  virtual uint32_t GetIfIndex(void) const;
230
  virtual uint32_t GetIfIndex(void) const;
237
231
 Lines 413-419    Link Here 
413
  NetDevice::ReceiveCallback m_rxCallback;
407
  NetDevice::ReceiveCallback m_rxCallback;
414
  NetDevice::PromiscReceiveCallback m_promiscCallback;
408
  NetDevice::PromiscReceiveCallback m_promiscCallback;
415
  uint32_t m_ifIndex;
409
  uint32_t m_ifIndex;
416
  std::string m_name;
417
  bool m_linkUp;
410
  bool m_linkUp;
418
  Callback<void> m_linkChangeCallback;
411
  Callback<void> m_linkChangeCallback;
419
412
(-)a/src/devices/wifi/wifi-net-device.cc (-10 lines)
 Lines 141-156    Link Here 
141
}
141
}
142
142
143
void 
143
void 
144
WifiNetDevice::SetName(const std::string name)
145
{
146
  m_name = name;
147
}
148
std::string 
149
WifiNetDevice::GetName(void) const
150
{
151
  return m_name;
152
}
153
void 
154
WifiNetDevice::SetIfIndex(const uint32_t index)
144
WifiNetDevice::SetIfIndex(const uint32_t index)
155
{
145
{
156
  m_ifIndex = index;
146
  m_ifIndex = index;
(-)a/src/devices/wifi/wifi-net-device.h (-3 lines)
 Lines 75-82    Link Here 
75
75
76
76
77
  // inherited from NetDevice base class.
77
  // inherited from NetDevice base class.
78
  virtual void SetName(const std::string name);
79
  virtual std::string GetName(void) const;
80
  virtual void SetIfIndex(const uint32_t index);
78
  virtual void SetIfIndex(const uint32_t index);
81
  virtual uint32_t GetIfIndex(void) const;
79
  virtual uint32_t GetIfIndex(void) const;
82
  virtual Ptr<Channel> GetChannel (void) const;
80
  virtual Ptr<Channel> GetChannel (void) const;
 Lines 121-127    Link Here 
121
  TracedCallback<Ptr<const Packet>, Mac48Address> m_rxLogger;
119
  TracedCallback<Ptr<const Packet>, Mac48Address> m_rxLogger;
122
  TracedCallback<Ptr<const Packet>, Mac48Address> m_txLogger;
120
  TracedCallback<Ptr<const Packet>, Mac48Address> m_txLogger;
123
  uint32_t m_ifIndex;
121
  uint32_t m_ifIndex;
124
  std::string m_name;
125
  bool m_linkUp;
122
  bool m_linkUp;
126
  Callback<void> m_linkChange;
123
  Callback<void> m_linkChange;
127
  mutable uint16_t m_mtu;
124
  mutable uint16_t m_mtu;
(-)a/src/node/channel.cc (-20 lines)
 Lines 35-68    Link Here 
35
}
35
}
36
36
37
Channel::Channel ()
37
Channel::Channel ()
38
  : m_name("Channel")
39
{
38
{
40
  NS_LOG_FUNCTION_NOARGS ();
39
  NS_LOG_FUNCTION_NOARGS ();
41
}
40
}
42
41
43
Channel::Channel (std::string name)
44
  : m_name(name)
45
{
46
  NS_LOG_FUNCTION (this << name);
47
}
48
42
49
Channel::~Channel ()
43
Channel::~Channel ()
50
{
44
{
51
  NS_LOG_FUNCTION_NOARGS ();
45
  NS_LOG_FUNCTION_NOARGS ();
52
}
46
}
53
47
54
  void
55
Channel::SetName(std::string name)
56
{
57
  NS_LOG_FUNCTION (this << name);
58
  m_name = name;
59
}
60
61
  std::string
62
Channel::GetName(void)
63
{
64
  NS_LOG_FUNCTION_NOARGS ();
65
  return m_name;
66
}
67
68
} // namespace ns3
48
} // namespace ns3
(-)a/src/node/channel.h (-7 / +1 lines)
 Lines 43-54    Link Here 
43
  static TypeId GetTypeId (void);
43
  static TypeId GetTypeId (void);
44
44
45
  Channel ();
45
  Channel ();
46
  Channel (std::string name);
47
  virtual ~Channel ();
46
  virtual ~Channel ();
48
47
49
  void SetName(std::string);
50
  std::string GetName(void);
51
52
  /**
48
  /**
53
   * \returns the number of NetDevices connected to this Channel.
49
   * \returns the number of NetDevices connected to this Channel.
54
   *
50
   *
 Lines 63-72    Link Here 
63
   */
59
   */
64
  virtual Ptr<NetDevice> GetDevice (uint32_t i) const = 0;
60
  virtual Ptr<NetDevice> GetDevice (uint32_t i) const = 0;
65
61
66
private:
67
  std::string   m_name;
68
};
62
};
69
63
70
}; // namespace ns3
64
} // namespace ns3
71
65
72
#endif /* NS3_CHANNEL_H */
66
#endif /* NS3_CHANNEL_H */
(-)a/src/node/net-device.h (-8 lines)
 Lines 68-81    Link Here 
68
  virtual ~NetDevice();
68
  virtual ~NetDevice();
69
69
70
  /**
70
  /**
71
   * \param name name of the device (e.g. "eth0")
72
   */
73
  virtual void SetName(const std::string name) = 0;
74
  /**
75
   * \return name name of the device (e.g. "eth0")
76
   */
77
  virtual std::string GetName(void) const = 0;
78
  /**
79
   * \param index ifIndex of the device 
71
   * \param index ifIndex of the device 
80
   */
72
   */
81
  virtual void SetIfIndex(const uint32_t index) = 0;
73
  virtual void SetIfIndex(const uint32_t index) = 0;
(-)a/src/node/node.cc (-4 / +3 lines)
 Lines 225-231    Link Here 
225
Node::PromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
225
Node::PromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
226
                                const Address &from, const Address &to, NetDevice::PacketType packetType)
226
                                const Address &from, const Address &to, NetDevice::PacketType packetType)
227
{
227
{
228
  NS_LOG_FUNCTION(device->GetName ());
228
  NS_LOG_FUNCTION(this);
229
  return ReceiveFromDevice (device, packet, protocol, from, to, packetType, true);
229
  return ReceiveFromDevice (device, packet, protocol, from, to, packetType, true);
230
}
230
}
231
231
 Lines 233-239    Link Here 
233
Node::NonPromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
233
Node::NonPromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
234
                                   const Address &from)
234
                                   const Address &from)
235
{
235
{
236
  NS_LOG_FUNCTION(device->GetName ());
236
  NS_LOG_FUNCTION(this);
237
  return ReceiveFromDevice (device, packet, protocol, from, from, NetDevice::PacketType (0), false);
237
  return ReceiveFromDevice (device, packet, protocol, from, from, NetDevice::PacketType (0), false);
238
}
238
}
239
239
 Lines 242-249    Link Here 
242
                         const Address &from, const Address &to, NetDevice::PacketType packetType, bool promiscuous)
242
                         const Address &from, const Address &to, NetDevice::PacketType packetType, bool promiscuous)
243
{
243
{
244
  NS_LOG_DEBUG("Node " << GetId () << " ReceiveFromDevice:  dev "
244
  NS_LOG_DEBUG("Node " << GetId () << " ReceiveFromDevice:  dev "
245
               << device->GetIfIndex () << " ("
245
               << device->GetIfIndex () << " (type=" << device->GetInstanceTypeId ().GetName ()
246
               << device->GetName () << " type " << device->GetInstanceTypeId ().GetName ()
247
               << ") Packet UID " << packet->GetUid ());
246
               << ") Packet UID " << packet->GetUid ());
248
  bool found = false;
247
  bool found = false;
249
248
(-)a/src/node/simple-net-device.cc (-11 lines)
 Lines 38-44    Link Here 
38
  : m_channel (0),
38
  : m_channel (0),
39
    m_node (0),
39
    m_node (0),
40
    m_mtu (0xffff),
40
    m_mtu (0xffff),
41
    m_name (""),
42
    m_ifIndex (0)
41
    m_ifIndex (0)
43
{}
42
{}
44
43
 Lines 84-99    Link Here 
84
}
83
}
85
84
86
void 
85
void 
87
SimpleNetDevice::SetName(const std::string name)
88
{
89
  m_name = name;
90
}
91
std::string 
92
SimpleNetDevice::GetName(void) const
93
{
94
  return m_name;
95
}
96
void 
97
SimpleNetDevice::SetIfIndex(const uint32_t index)
86
SimpleNetDevice::SetIfIndex(const uint32_t index)
98
{
87
{
99
  m_ifIndex = index;
88
  m_ifIndex = index;
(-)a/src/node/simple-net-device.h (-3 lines)
 Lines 46-53    Link Here 
46
  void SetAddress (Mac48Address address);
46
  void SetAddress (Mac48Address address);
47
47
48
  // inherited from NetDevice base class.
48
  // inherited from NetDevice base class.
49
  virtual void SetName(const std::string name);
50
  virtual std::string GetName(void) const;
51
  virtual void SetIfIndex(const uint32_t index);
49
  virtual void SetIfIndex(const uint32_t index);
52
  virtual uint32_t GetIfIndex(void) const;
50
  virtual uint32_t GetIfIndex(void) const;
53
  virtual Ptr<Channel> GetChannel (void) const;
51
  virtual Ptr<Channel> GetChannel (void) const;
 Lines 82-88    Link Here 
82
  NetDevice::PromiscReceiveCallback m_promiscCallback;
80
  NetDevice::PromiscReceiveCallback m_promiscCallback;
83
  Ptr<Node> m_node;
81
  Ptr<Node> m_node;
84
  uint16_t m_mtu;
82
  uint16_t m_mtu;
85
  std::string m_name;
86
  uint32_t m_ifIndex;
83
  uint32_t m_ifIndex;
87
  Mac48Address m_address;
84
  Mac48Address m_address;
88
};
85
};

Return to bug 498