19 #ifndef TCPERRORCHANNEL_H 20 #define TCPERRORCHANNEL_H 22 #include "ns3/error-model.h" 23 #include "ns3/tcp-header.h" 24 #include "ns3/ipv4-header.h" 179 #endif // TCPERRORCHANNEL_H virtual void DoReset(void)
Re-initialize any state.
static TypeId GetTypeId(void)
Get the type ID.
void SetDropCallback(Callback< void, const Ipv4Header &, const TcpHeader &, Ptr< const Packet > > cb)
Set the drop callback.
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.
TcpHeader::Flags_t m_flagsToKill
Flags a packet should have to be dropped.
void SetKillRepeat(int16_t killNumber)
Set how many packets should be killed.
static TypeId GetTypeId(void)
Get the type ID.
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)
Check if the packet should be dropped.
void AddSeqToKill(const SequenceNumber32 &seq)
Add the sequence number to the list of segments to be killed.
std::list< SequenceNumber32 > m_seqToKill
List of the sequence numbers to be dropped.
int16_t m_killNumber
The number of times the packet should be killed.
static TypeId GetTypeId(void)
Get the type ID.
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)
Check if the packet should be dropped.
virtual void DoReset(void)
Re-initialize any state.
a unique identifier for an interface.
Callback< void, const Ipv4Header &, const TcpHeader &, Ptr< const Packet > > m_dropCallback
Drop callback.
void SetFlagToKill(TcpHeader::Flags_t flags)
Set the flags of the segment that should be killed.
virtual bool ShouldDrop(const Ipv4Header &ipHeader, const TcpHeader &tcpHeader, uint32_t packetSize)=0
Check if the packet should be dropped.