From cd2fabe2f1978223ee2f50129b4a21ba6c8abc92 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Mon, 30 Apr 2007 10:05:46 +0200 Subject: [PATCH] add NetDevice::NeedsArp method --- src/devices/p2p/p2p-net-device.cc | 6 ++++++ src/devices/p2p/p2p-net-device.h | 1 + src/node/net-device.cc | 6 ++++++ src/node/net-device.h | 4 +++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/devices/p2p/p2p-net-device.cc b/src/devices/p2p/p2p-net-device.cc index 2510598b3..cb3b930bc 100644 --- a/src/devices/p2p/p2p-net-device.cc +++ b/src/devices/p2p/p2p-net-device.cc @@ -360,4 +360,10 @@ PointToPointNetDevice::DoGetChannel(void) const return m_channel; } +bool +PointToPointNetDevice::DoNeedsArp (void) const +{ + return false; +} + } // namespace ns3 diff --git a/src/devices/p2p/p2p-net-device.h b/src/devices/p2p/p2p-net-device.h index a19314462..12f02530a 100644 --- a/src/devices/p2p/p2p-net-device.h +++ b/src/devices/p2p/p2p-net-device.h @@ -254,6 +254,7 @@ private: * @see class TraceResolver */ virtual TraceResolver *DoCreateTraceResolver (TraceContext const &context); + virtual bool DoNeedsArp (void) const; /** * Enumeration of the states of the transmit machine of the net device. */ diff --git a/src/node/net-device.cc b/src/node/net-device.cc index 00ffece6c..8ce2bf869 100644 --- a/src/node/net-device.cc +++ b/src/node/net-device.cc @@ -220,4 +220,10 @@ NetDevice::GetNode (void) const return m_node; } +bool +NetDevice::NeedsArp (void) const +{ + return DoNeedsArp (); +} + }; // namespace ns3 diff --git a/src/node/net-device.h b/src/node/net-device.h index ceaa18d1c..116901275 100644 --- a/src/node/net-device.h +++ b/src/node/net-device.h @@ -152,6 +152,8 @@ class NetDevice { */ bool Send(Packet& p, const MacAddress& dest, uint16_t protocolNumber); + bool NeedsArp (void) const; + protected: /** * Enable broadcast support. This method should be @@ -222,7 +224,7 @@ class NetDevice { * subclasses to forward packets. Subclasses MUST override this method. */ virtual bool SendTo (Packet& p, const MacAddress& dest) = 0; - + virtual bool DoNeedsArp (void) const = 0; virtual TraceResolver *DoCreateTraceResolver (TraceContext const &context) = 0; virtual Channel *DoGetChannel (void) const = 0; Node* m_node;