Protocol++® (Protocolpp®)
v5.6.2
|
Public Member Functions | |
jreplay (std::shared_ptr< jrand > &rand, protocol_t prot, T &seqnum, TE &extseq, bool usext, uint32_t winsize) | |
jreplay (std::shared_ptr< jrand > &rand, protocol_t prot, T &seqnum, TE &extseq, bool usext, uint32_t winsize, jarray< uint8_t > &window) | |
virtual | ~jreplay ()=default |
Standard deconstructor. | |
uint32_t | antireplay (T &currseq, TE &currext) |
uint32_t | size () |
int | next (T &currseq, TE &currext, replay_t type=NORMAL) |
T | get_seqnum () |
TE | get_extseq () |
jarray< uint8_t > | get_window () |
std::string | print (bool pretty=false, int indent=10) |
jreplay (jreplay &jreplay)=delete | |
jreplay (const jreplay &jreplay)=delete | |
jreplay::jreplay | ( | std::shared_ptr< jrand > & | rand, |
protocol_t | prot, | ||
T & | seqnum, | ||
TE & | extseq, | ||
bool | usext, | ||
uint32_t | winsize | ||
) |
Constructor for replay
rand | - randomizer |
prot | - protocol for anti-replay |
seqnum | - sequence number to verify |
extseq | - extended sequence number to verify |
usext | - flag to indicate use of extended sequence number |
winsize | - number of packets to track in the window |
jreplay::jreplay | ( | std::shared_ptr< jrand > & | rand, |
protocol_t | prot, | ||
T & | seqnum, | ||
TE & | extseq, | ||
bool | usext, | ||
uint32_t | winsize, | ||
jarray< uint8_t > & | window | ||
) |
Constructor for replay
rand | - randomizer |
prot | - protocol for anti-replay |
seqnum | - sequence number to verify |
extseq | - extended sequence number to verify |
usext | - flag to indicate use of extended sequence number |
winsize | - number of packets to track in the window |
window | - initial replay window to start with populated with UNIT8_T values where one bit equals a packet e.g., 0xF0 would mean four packets have been received |
uint32_t jreplay::antireplay | ( | T & | currseq, |
TE & | currext | ||
) |
anti-replay function, uses an BYTE array to support any size window instead of being limited to 32, 64, or 128 packets
currseq | - received sequence number to verify |
currext | - received extended sequence number to verify |
0 - no error
1 - late error
2 - replay error
3 - rollover error (overflow)
4 - rollunder error (underflow)
5 - programming error
TE jreplay::get_extseq |
Return the current extended sequence number
T jreplay::get_seqnum |
Return current sequence number
jarray< uint8_t > jreplay::get_window |
Return the current anti-replay window
int jreplay::next | ( | T & | currseq, |
TE & | currext, | ||
replay_t | type = NORMAL |
||
) |
Return value to add to seqnum for next value for debug purposes If the user would like to create a LATE packet, this function may be called with the current sequence number and the type=LATE and this function will return the value the should be added to the sequence number to create the desired packet
type | - Type of seqnum/extseqnum to retrieve (NORMAL, WINDOW, REPLAY, LATE, OVERFLOW, UNDERFLOW) |
currseq | - Current seqnum |
currext | - Current extended seqnum |
std::string jreplay::print | ( | bool | pretty = false , |
int | indent = 10 |
||
) |
Return string representation of replay window
pretty | - adds formatting to the replay window to make it more readable as follows |
indent | - causes each line of the pretty print window to be indented the number of spaces requested |
uint32_t jreplay::size |
Return the size of the anti-replay window