bug 491: It is painful to enable all checksums

This commit is contained in:
Mathieu Lacage
2009-06-19 09:13:29 +02:00
parent c79635f21e
commit e8a4113e96
10 changed files with 30 additions and 34 deletions

View File

@@ -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)