No need to make NetDevice::SendFrom pure virtual; instead just give a fatal error if used in runtime (it's only used by the learning bridge, anyway, so...).
--- a/src/devices/wifi/wifi-net-device.cc Fri Jul 18 11:23:29 2008 +0100
+++ b/src/devices/wifi/wifi-net-device.cc Fri Jul 18 11:41:22 2008 +0100
@@ -283,12 +283,6 @@
m_mac->Enqueue (packet, realTo);
return true;
}
-bool
-WifiNetDevice::SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
-{
- NS_FATAL_ERROR ("WifiNetDevice::SendFrom not implemented.");
- return false;
-}
Ptr<Node>
WifiNetDevice::GetNode (void) const
{
--- a/src/devices/wifi/wifi-net-device.h Fri Jul 18 11:23:29 2008 +0100
+++ b/src/devices/wifi/wifi-net-device.h Fri Jul 18 11:41:22 2008 +0100
@@ -96,7 +96,6 @@
virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
virtual bool IsPointToPoint (void) const;
virtual bool Send(Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber);
- virtual bool SendFrom (Ptr<Packet> packet, const Address& src, const Address& dest, uint16_t protocolNumber);
virtual Ptr<Node> GetNode (void) const;
virtual void SetNode (Ptr<Node> node);
virtual bool NeedsArp (void) const;
--- a/src/node/net-device.cc Fri Jul 18 11:23:29 2008 +0100
+++ b/src/node/net-device.cc Fri Jul 18 11:41:22 2008 +0100
@@ -52,5 +52,11 @@
NS_ASSERT (!SupportsPromiscuous ());
}
+bool
+NetDevice::SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
+{
+ NS_FATAL_ERROR ("NetDevice::SendFrom not implemented for " << GetInstanceTypeId ().GetName ());
+ return false;
+}
} // namespace ns3
--- a/src/node/net-device.h Fri Jul 18 11:23:29 2008 +0100
+++ b/src/node/net-device.h Fri Jul 18 11:41:22 2008 +0100
@@ -228,7 +228,7 @@
*
* \return whether the Send operation succeeded
*/
- virtual bool SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber) = 0;
+ virtual bool SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);
/**
* \returns the node base class which contains this network
* interface.