diff --git a/src/devices/csma/csma-net-device.cc b/src/devices/csma/csma-net-device.cc index 87ed536d0..4534f0866 100644 --- a/src/devices/csma/csma-net-device.cc +++ b/src/devices/csma/csma-net-device.cc @@ -111,6 +111,12 @@ CsmaNetDevice::DoDispose () NetDevice::DoDispose (); } +void +CsmaNetDevice::SetAddress (Mac48Address self) +{ + m_address = self; +} + void CsmaNetDevice::SetSendEnable (bool sendEnable) { diff --git a/src/devices/csma/csma-net-device.h b/src/devices/csma/csma-net-device.h index b8b5f3163..df1787757 100644 --- a/src/devices/csma/csma-net-device.h +++ b/src/devices/csma/csma-net-device.h @@ -180,6 +180,8 @@ enum CsmaEncapsulationMode { void SetSendEnable (bool); void SetReceiveEnable (bool); + void SetAddress (Mac48Address self); + // inherited from NetDevice base class. virtual void SetName(const std::string name); diff --git a/src/devices/point-to-point/point-to-point-net-device.cc b/src/devices/point-to-point/point-to-point-net-device.cc index c8d68d2c2..2d57a8688 100644 --- a/src/devices/point-to-point/point-to-point-net-device.cc +++ b/src/devices/point-to-point/point-to-point-net-device.cc @@ -87,6 +87,12 @@ PointToPointNetDevice::PointToPointNetDevice () PointToPointNetDevice::~PointToPointNetDevice () {} +void +PointToPointNetDevice::SetAddress (Mac48Address self) +{ + m_address = self; +} + void PointToPointNetDevice::AddHeader(Ptr p, uint16_t protocolNumber) { diff --git a/src/devices/point-to-point/point-to-point-net-device.h b/src/devices/point-to-point/point-to-point-net-device.h index ba0160508..6d7737b3a 100644 --- a/src/devices/point-to-point/point-to-point-net-device.h +++ b/src/devices/point-to-point/point-to-point-net-device.h @@ -145,6 +145,8 @@ public: */ void Receive (Ptr p); + void SetAddress (Mac48Address self); + // inherited from NetDevice base class. virtual void SetName(const std::string name); virtual std::string GetName(void) const;