1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Feature - Skipping ahead in TCP flows. (#163)

* Skipping forward in TCP streams, from an out-of-order callback.

- Added the ability to skip forward in a flow to a sequence number, with the intention of doing so in an out of order callback.
- Re-ordered Flow packet processing, to allow skipTo in out of order callback on stream start (flow sequence number is 0).
- Fixed missing seq_compare in flow code.

* Renamed skipTo to advance_sequence.
This commit is contained in:
Patrick Michel
2016-10-23 18:47:56 +02:00
committed by Matias Fontanini
parent 2e013847d9
commit aaba3dd46a
4 changed files with 75 additions and 14 deletions

View File

@@ -165,6 +165,24 @@ public:
*/
void process_packet(PDU& pdu);
/**
* \brief Skip forward to a sequence number
*
* This allows to recover from packet loss, if we just do not see all packets of
* an original stream. This recovery can only sensibly triggered from the application
* layer.
*
* This method is particularly useful to call from an out of order callback, if
* the application wants to skip forward to this out of order block. The application
* will then get the normal data callback!
*
* IMPORTANT: If you call this method with a sequence number that is not exactly a
* TCP fragment boundary, the flow will never recover from this.
*
* \param seq The sequence number to skip to.
*/
void advance_sequence(uint32_t seq);
/**
* Indicates whether this flow uses IPv6 addresses
*/