INET Framework for OMNeT++/OMNEST
|
Reassembly buffer for fragmented IPv4 datagrams. More...
#include <IPv4FragBuf.h>
Classes | |
struct | DatagramBuffer |
struct | Key |
Public Member Functions | |
IPv4FragBuf () | |
Ctor. More... | |
~IPv4FragBuf () | |
Dtor. More... | |
void | init (ICMP *icmp) |
Initialize fragmentation buffer. More... | |
IPv4Datagram * | addFragment (IPv4Datagram *datagram, simtime_t now) |
Takes a fragment and inserts it into the reassembly buffer. More... | |
void | purgeStaleFragments (simtime_t lastupdate) |
Throws out all fragments which are incomplete and their last update (last fragment arrival) was before "lastupdate", and sends ICMP TIME EXCEEDED message about them. More... | |
Protected Types | |
typedef std::map< Key, DatagramBuffer > | Buffers |
Protected Attributes | |
Buffers | bufs |
ICMP * | icmpModule |
Reassembly buffer for fragmented IPv4 datagrams.
|
protected |
inet::IPv4FragBuf::IPv4FragBuf | ( | ) |
Ctor.
inet::IPv4FragBuf::~IPv4FragBuf | ( | ) |
IPv4Datagram * inet::IPv4FragBuf::addFragment | ( | IPv4Datagram * | datagram, |
simtime_t | now | ||
) |
Takes a fragment and inserts it into the reassembly buffer.
If this fragment completes a datagram, the full reassembled datagram is returned, otherwise nullptr.
Referenced by inet::IPv4::reassembleAndDeliver().
void inet::IPv4FragBuf::init | ( | ICMP * | icmp | ) |
Initialize fragmentation buffer.
ICMP module is needed for sending TIME_EXCEEDED ICMP message in purgeStaleFragments().
Referenced by inet::IPv4::initialize().
void inet::IPv4FragBuf::purgeStaleFragments | ( | simtime_t | lastupdate | ) |
Throws out all fragments which are incomplete and their last update (last fragment arrival) was before "lastupdate", and sends ICMP TIME EXCEEDED message about them.
Timeout should be between 60 seconds and 120 seconds (RFC1122). This method should be called more frequently, maybe every 10..30 seconds or so.
Referenced by inet::IPv4::reassembleAndDeliver().
|
protected |
Referenced by addFragment(), purgeStaleFragments(), and ~IPv4FragBuf().
|
protected |
Referenced by init(), IPv4FragBuf(), and purgeStaleFragments().