add SetAddress methods.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 19 Mar 2008 11:19:05 -0700
changeset 2655 a71d888ca2e8
parent 2654 4fe950c01030
child 2656 b426a0e0355e
add SetAddress methods.
src/devices/csma/csma-net-device.cc
src/devices/csma/csma-net-device.h
src/devices/point-to-point/point-to-point-net-device.cc
src/devices/point-to-point/point-to-point-net-device.h
--- a/src/devices/csma/csma-net-device.cc	Wed Mar 19 11:11:34 2008 -0700
+++ b/src/devices/csma/csma-net-device.cc	Wed Mar 19 11:19:05 2008 -0700
@@ -111,6 +111,12 @@
   NetDevice::DoDispose ();
 }
 
+void 
+CsmaNetDevice::SetAddress (Mac48Address self)
+{
+  m_address = self;
+}
+
 void
 CsmaNetDevice::SetSendEnable (bool sendEnable)
 {
--- a/src/devices/csma/csma-net-device.h	Wed Mar 19 11:11:34 2008 -0700
+++ b/src/devices/csma/csma-net-device.h	Wed Mar 19 11:19:05 2008 -0700
@@ -180,6 +180,8 @@
   void SetSendEnable (bool);
   void SetReceiveEnable (bool);
 
+  void SetAddress (Mac48Address self);
+
 
   // inherited from NetDevice base class.
   virtual void SetName(const std::string name);
--- a/src/devices/point-to-point/point-to-point-net-device.cc	Wed Mar 19 11:11:34 2008 -0700
+++ b/src/devices/point-to-point/point-to-point-net-device.cc	Wed Mar 19 11:19:05 2008 -0700
@@ -88,6 +88,12 @@
 {}
 
 void 
+PointToPointNetDevice::SetAddress (Mac48Address self)
+{
+  m_address = self;
+}
+
+void 
 PointToPointNetDevice::AddHeader(Ptr<Packet> p, uint16_t protocolNumber)
 {
   NS_LOG_FUNCTION;
--- a/src/devices/point-to-point/point-to-point-net-device.h	Wed Mar 19 11:11:34 2008 -0700
+++ b/src/devices/point-to-point/point-to-point-net-device.h	Wed Mar 19 11:19:05 2008 -0700
@@ -145,6 +145,8 @@
    */
   void Receive (Ptr<Packet> p);
 
+  void SetAddress (Mac48Address self);
+
   // inherited from NetDevice base class.
   virtual void SetName(const std::string name);
   virtual std::string GetName(void) const;