20 #include "ns3/ipv4-header.h"
21 #include "ns3/packet.h"
79 .AddConstructor<TcpSeqErrorModel> ()
96 " killing=" << toKill);
121 .AddConstructor<TcpFlagErrorModel> ()
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
virtual void DoReset(void)
Re-initialize any state.
static TypeId GetTypeId(void)
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
A general (TCP-aware) error model.
General error model that can be used to corrupt packets.
An error model TCP aware: it drops the sequence number declared.
bool IsEnabled(void) const
TcpHeader::Flags_t m_flagsToKill
static TypeId GetTypeId(void)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual bool ShouldDrop(const Ipv4Header &ipHeader, const TcpHeader &tcpHeader, uint32_t packetSize)
Callback< void, const Ipv4Header &, const TcpHeader & > m_dropCallback
std::list< SequenceNumber32 > m_seqToKill
static TypeId GetTypeId(void)
Error model which drop packets with specified TCP flags.
virtual bool DoCorrupt(Ptr< Packet > p)
Corrupt a packet according to the specified model.
static const uint32_t packetSize
virtual bool ShouldDrop(const Ipv4Header &ipHeader, const TcpHeader &tcpHeader, uint32_t packetSize)
virtual void DoReset(void)
Re-initialize any state.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void AddHeader(const Header &header)
Add header to this packet.
virtual bool ShouldDrop(const Ipv4Header &ipHeader, const TcpHeader &tcpHeader, uint32_t packetSize)=0