Sponge
CS144's user-space TCP library
Functions
wrapping_integers.cc File Reference
#include "wrapping_integers.hh"
Include dependency graph for wrapping_integers.cc:

Go to the source code of this file.

Functions

template<typename... Targs>
void DUMMY_CODE (Targs &&...)
 
uint64_t unwrap (WrappingInt32 n, WrappingInt32 isn, uint64_t checkpoint)
 
WrappingInt32 wrap (uint64_t n, WrappingInt32 isn)
 

Function Documentation

◆ DUMMY_CODE()

template<typename... Targs>
void DUMMY_CODE ( Targs &&  ...)

Definition at line 9 of file wrapping_integers.cc.

◆ unwrap()

uint64_t unwrap ( WrappingInt32  n,
WrappingInt32  isn,
uint64_t  checkpoint 
)

Transform a WrappingInt32 into an "absolute" 64-bit sequence number (zero-indexed)

Parameters
nThe relative sequence number
isnThe initial sequence number
checkpointA recent absolute 64-bit sequence number
Returns
the 64-bit sequence number that wraps to n and is closest to checkpoint
Note
Each of the two streams of the TCP connection has its own ISN. One stream runs from the local TCPSender to the remote TCPReceiver and has one ISN, and the other stream runs from the remote TCPSender to the local TCPReceiver and has a different ISN.

Definition at line 31 of file wrapping_integers.cc.

◆ wrap()

WrappingInt32 wrap ( uint64_t  n,
WrappingInt32  isn 
)

Transform an "absolute" 64-bit sequence number (zero-indexed) into a WrappingInt32

Parameters
nThe input absolute 64-bit sequence number
isnThe initial sequence number

Definition at line 16 of file wrapping_integers.cc.