Protocol++® (Protocolpp®)  v5.6.2
ProtocolPP::jreplay< T, TE > Class Template Reference

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)
 
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
 

Constructor & Destructor Documentation

◆ jreplay() [1/2]

template<typename T , typename TE >
jreplay::jreplay ( std::shared_ptr< jrand > &  rand,
protocol_t  prot,
T &  seqnum,
TE &  extseq,
bool  usext,
uint32_t  winsize 
)

Constructor for replay

Parameters
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
Here is the call graph for this function:

◆ jreplay() [2/2]

template<typename T , typename TE >
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

Parameters
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
Here is the call graph for this function:

Member Function Documentation

◆ antireplay()

template<typename T , typename TE >
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

Parameters
currseq- received sequence number to verify
currext- received extended sequence number to verify
Returns
value indicating type of error

0 - no error

1 - late error

2 - replay error

3 - rollover error (overflow)

4 - rollunder error (underflow)

5 - programming error

◆ get_extseq()

template<typename T , typename TE >
TE jreplay::get_extseq

Return the current extended sequence number

Returns
size of the window

◆ get_seqnum()

template<typename T , typename TE >
T jreplay::get_seqnum

Return current sequence number

Returns
size of the window

◆ get_window()

template<typename T , typename TE >
jarray< uint8_t > jreplay::get_window

Return the current anti-replay window

Returns
the window

◆ next()

template<typename T , typename TE >
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

Parameters
type- Type of seqnum/extseqnum to retrieve (NORMAL, WINDOW, REPLAY, LATE, OVERFLOW, UNDERFLOW)
currseq- Current seqnum
currext- Current extended seqnum
Returns
amount to add (or subtract) to the current seqnum for the type requested

◆ print()

template<typename T , typename TE >
std::string jreplay::print ( bool  pretty = false,
int  indent = 10 
)

Return string representation of replay window

Parameters
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
Returns
string representation of replay window array
Screen Capture of Anti-Replay Pretty-Print
Here is the call graph for this function:

◆ size()

template<typename T , typename TE >
uint32_t jreplay::size

Return the size of the anti-replay window

Returns
size of the window

The documentation for this class was generated from the following file: