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

Allow asking whether segment was acked

This commit is contained in:
Matias Fontanini
2016-02-13 22:45:11 -08:00
parent 2498ebf7d6
commit abe94ece52
5 changed files with 72 additions and 1 deletions

View File

@@ -129,6 +129,14 @@ public:
* \brief Retrieves all acked intervals by Selective ACKs
*/
const interval_set_type& acked_intervals() const;
/**
* \brief Indicates whether the given segment has been already ACKed
*
* \param sequence_number The segment's sequence number
* \param length The segment's length
*/
bool is_segment_acked(uint32_t sequence_number, uint32_t length) const;
private:
void process_sack(const std::vector<uint32_t>& sack);
void cleanup_sacked_intervals(uint32_t old_ack, uint32_t new_ack);

View File

@@ -282,6 +282,18 @@ public:
* \brief Indicates whether ACK number tracking is enabled
*/
bool ack_tracking_enabled() const;
#ifdef HAVE_ACK_TRACKER
/**
* Retrieves the ACK tracker for this Flow (const)
*/
const AckTracker& ack_tracker() const;
/**
* Retrieves the ACK tracker for this Flow
*/
AckTracker& ack_tracker();
#endif // HAVE_ACK_TRACKER
private:
// Compress all flags into just one struct using bitfields
struct flags {