#include <cstdint>
#include <ostream>
Go to the source code of this file.
|
class | WrappingInt32 |
| A 32-bit integer, expressed relative to an arbitrary initial sequence number (ISN) More...
|
|
|
uint64_t | unwrap (WrappingInt32 n, WrappingInt32 isn, uint64_t checkpoint) |
|
WrappingInt32 | wrap (uint64_t n, WrappingInt32 isn) |
|
|
bool | operator!= (WrappingInt32 a, WrappingInt32 b) |
| Whether the two integers are not equal. More...
|
|
WrappingInt32 | operator+ (WrappingInt32 a, uint32_t b) |
| The point b steps past a . More...
|
|
WrappingInt32 | operator- (WrappingInt32 a, uint32_t b) |
| The point b steps before a . More...
|
|
int32_t | operator- (WrappingInt32 a, WrappingInt32 b) |
| The offset of a relative to b More...
|
|
std::ostream & | operator<< (std::ostream &os, WrappingInt32 a) |
| Serializes the wrapping integer, a . More...
|
|
bool | operator== (WrappingInt32 a, WrappingInt32 b) |
| Whether the two integers are equal. More...
|
|
◆ operator!=()
◆ operator+()
◆ operator-() [1/2]
◆ operator-() [2/2]
The offset of a
relative to b
- Parameters
-
b | the starting point |
a | the ending point |
- Returns
- the number of increments needed to get from
b
to a
, negative if the number of decrements needed is less than or equal to the number of increments
Definition at line 47 of file wrapping_integers.hh.
◆ operator<<()
◆ operator==()
◆ unwrap()
Transform a 32-bit relative sequence number into a 64-bit absolute sequence number (zero-indexed)
- Parameters
-
n | The relative sequence number |
isn | The initial sequence number |
checkpoint | A recent absolute sequence number |
- Returns
- the absolute 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.
◆ wrap()
Transform a 64-bit absolute sequence number (zero-indexed) into a 32-bit relative sequence number
- Parameters
-
n | the absolute sequence number |
isn | the initial sequence number |
- Returns
- the relative sequence number