bug 491: It is painful to enable all checksums
This commit is contained in:
@@ -28,6 +28,8 @@
|
||||
#include "ns3/uinteger.h"
|
||||
#include "ns3/log.h"
|
||||
#include "ns3/assert.h"
|
||||
#include "ns3/global-value.h"
|
||||
#include "ns3/boolean.h"
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Node");
|
||||
|
||||
@@ -35,6 +37,11 @@ namespace ns3{
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (Node);
|
||||
|
||||
GlobalValue g_checksumEnabled = GlobalValue ("ChecksumEnabled",
|
||||
"A global switch to enable all checksums for all protocols",
|
||||
BooleanValue (false),
|
||||
MakeBooleanChecker ());
|
||||
|
||||
TypeId
|
||||
Node::GetTypeId (void)
|
||||
{
|
||||
@@ -222,6 +229,14 @@ Node::UnregisterProtocolHandler (ProtocolHandler handler)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
Node::ChecksumEnabled (void)
|
||||
{
|
||||
BooleanValue val;
|
||||
g_checksumEnabled.GetValue (val);
|
||||
return val.Get ();
|
||||
}
|
||||
|
||||
bool
|
||||
Node::PromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
|
||||
const Address &from, const Address &to, NetDevice::PacketType packetType)
|
||||
|
||||
Reference in New Issue
Block a user