Backed out changeset ae9f7d5e2d56
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
#include "ns3/object.h"
|
||||
#include "ns3/log.h"
|
||||
#include "net-device.h"
|
||||
#include "ns3/packet.h"
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("NetDevice");
|
||||
|
||||
@@ -39,24 +38,4 @@ TypeId NetDevice::GetTypeId (void)
|
||||
NetDevice::~NetDevice ()
|
||||
{}
|
||||
|
||||
bool
|
||||
NetDevice::SupportsPromiscuousReceiveCallback (void) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
NetDevice::SetPromiscuousReceiveCallback (PromiscuousReceiveCallback cb)
|
||||
{
|
||||
NS_FATAL_ERROR ("promiscuous receive callback not supported for this device");
|
||||
}
|
||||
|
||||
bool
|
||||
NetDevice::SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
|
||||
{
|
||||
NS_FATAL_ERROR ("NetDevice " << GetInstanceTypeId ().GetName () << " does not support SendFrom.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
*
|
||||
* \return whether the Send operation succeeded
|
||||
*/
|
||||
virtual bool SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);
|
||||
virtual bool SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber) = 0;
|
||||
/**
|
||||
* \returns the node base class which contains this network
|
||||
* interface.
|
||||
@@ -297,12 +297,7 @@ public:
|
||||
* it. In that sense, it receives a superset of packets
|
||||
* received by the normal ReceivedCallback.
|
||||
*/
|
||||
virtual void SetPromiscuousReceiveCallback (PromiscuousReceiveCallback cb);
|
||||
|
||||
/**
|
||||
* \returns true if device supports promiscuous receive callback
|
||||
*/
|
||||
virtual bool SupportsPromiscuousReceiveCallback (void) const;
|
||||
virtual void SetPromiscuousReceiveCallback (PromiscuousReceiveCallback cb) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -96,10 +96,7 @@ Node::AddDevice (Ptr<NetDevice> device)
|
||||
device->SetNode (this);
|
||||
device->SetIfIndex(index);
|
||||
device->SetReceiveCallback (MakeCallback (&Node::ReceiveFromDevice, this));
|
||||
if (device->SupportsPromiscuousReceiveCallback ())
|
||||
{
|
||||
device->SetPromiscuousReceiveCallback (MakeCallback (&Node::PromiscuousReceiveFromDevice, this));
|
||||
}
|
||||
device->SetPromiscuousReceiveCallback (MakeCallback (&Node::PromiscuousReceiveFromDevice, this));
|
||||
NotifyDeviceAdded (device);
|
||||
return index;
|
||||
}
|
||||
@@ -194,10 +191,6 @@ Node::RegisterPromiscuousProtocolHandler (PromiscuousProtocolHandler handler,
|
||||
entry.handler = handler;
|
||||
entry.protocol = protocolType;
|
||||
entry.device = device;
|
||||
if (device)
|
||||
{
|
||||
NS_ASSERT (device->SupportsPromiscuousReceiveCallback ());
|
||||
}
|
||||
m_promiscuousHandlers.push_back (entry);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user