7#ifndef TCPERRORCHANNEL_H
8#define TCPERRORCHANNEL_H
10#include "ns3/error-model.h"
11#include "ns3/ipv4-header.h"
12#include "ns3/tcp-header.h"
General error model that can be used to corrupt packets.
Smart pointer class similar to boost::intrusive_ptr.
Error model which drop packets with specified TCP flags.
TcpHeader::Flags_t m_flagsToKill
Flags a packet should have to be dropped.
void SetFlagToKill(TcpHeader::Flags_t flags)
Set the flags of the segment that should be killed.
bool ShouldDrop(const Ipv4Header &ipHeader, const TcpHeader &tcpHeader, uint32_t packetSize) override
Check if the packet should be dropped.
void DoReset() override
Re-initialize any state.
void SetKillRepeat(int16_t killNumber)
Set how many packets should be killed.
int16_t m_killNumber
The number of times the packet should be killed.
static TypeId GetTypeId()
Get the type ID.
A general (TCP-aware) error model.
void SetDropCallback(Callback< void, const Ipv4Header &, const TcpHeader &, Ptr< const Packet > > cb)
Set the drop callback.
bool DoCorrupt(Ptr< Packet > p) override
Corrupt a packet according to the specified model.
Callback< void, const Ipv4Header &, const TcpHeader &, Ptr< const Packet > > m_dropCallback
Drop callback.
virtual bool ShouldDrop(const Ipv4Header &ipHeader, const TcpHeader &tcpHeader, uint32_t packetSize)=0
Check if the packet should be dropped.
static TypeId GetTypeId()
Get the type ID.
An error model TCP aware: it drops the sequence number declared.
static TypeId GetTypeId()
Get the type ID.
bool ShouldDrop(const Ipv4Header &ipHeader, const TcpHeader &tcpHeader, uint32_t packetSize) override
Check if the packet should be dropped.
void AddSeqToKill(const SequenceNumber32 &seq)
Add the sequence number to the list of segments to be killed.
void DoReset() override
Re-initialize any state.
std::list< SequenceNumber32 > m_seqToKill
List of the sequence numbers to be dropped.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const uint32_t packetSize
Packet size generated at the AP.