Protocol++® (Protocolpp®)  v5.6.2
jreplay Class Reference

#include "include/jreplay.h"

Detailed Description

Anti-Replay Class for Protocol++® (ProtocolPP®)

This class uses the sliding window anti-replay method found in the IPsec specification to track any number of packets. To allow large numbers of packets, the class uses a BYTE array instead of an unsigned integer to track received packets. The replay window can either be initialized to an empty window or with a windows that's provided. The double template is for use with current protocols that may have an extended packet number. This assumes that the extended packet number is the same size as the seqnum.

Example initialzed empty window to track 16 packets

16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
---------------------------------------------------------------------
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
---------------------------------------------------------------------
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 C
* * * * * * * * * * * * * * * * u
P P P P P P P P P P P P P P P P r
r r r r r r r r r r r r r r r r r
e e e e e e e e e e e e e e e e e
v v v v v v v v v v v v v v v v n
i i i i i i i i i i i i i i i i t
o o o o o o o o o o o o o o o o
u u u u u u u u u u u u u u u u
s s s s s s s s s s s s s s s s

Example of LATE packet

16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
---------------------------------------------------------------------
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
---------------------------------------------------------------------
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 C
* * * * * * * * * * * * * * * * u
P P P P P P P P P P P P P P P P r
r r r r r r r r r r r r r r r r r
e e e e e e e e e e e e e e e e e
v v v v v v v v v v v v v v v v n
i i i i i i i i i i i i i i i i t
o o o o o o o o o o o o o o o o
u u u u u u u u u u u u u u u u
s s s s s s s s s s s s s s s s

For the LATE example, say we receive a packet that has a packet number placing it 18 packets behind the current packet. As shown in the example, the packet would not be recorded in the window and would be dropped. Packet numbers would not be updated and a LATE error would be returned

Example of packet in the window

16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
---------------------------------------------------------------------
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
---------------------------------------------------------------------
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 C
* * * * * * * * * * * * * * * * u
P P P P P P P P P P P P P P P P r
r r r r r r r r r r r r r r r r r
e e e e e e e e e e e e e e e e e
v v v v v v v v v v v v v v v v n
i i i i i i i i i i i i i i i i t
o o o o o o o o o o o o o o o o
u u u u u u u u u u u u u u u u
s s s s s s s s s s s s s s s s

For the packet in window example, say we receive a packet that has a packet number placing it 9 packets behind the current packet. As shown in the example, the packet would be recorded in the window in the spot nine packets behind the current packet. Packet numbers would not be updated and no error would be returned

Example of REPLAY packet

16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
---------------------------------------------------------------------
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
---------------------------------------------------------------------
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 C
* * * * * * * * * * * * * * * * u
P P P P P P P P P P P P P P P P r
r r r r r r r r r r r r r r r r r
e e e e e e e e e e e e e e e e e
v v v v v v v v v v v v v v v v n
i i i i i i i i i i i i i i i i t
o o o o o o o o o o o o o o o o
u u u u u u u u u u u u u u u u
s s s s s s s s s s s s s s s s

For the REPLAY example, say we receive a packet that has a packet number placing it 9 packets behind the current packet. As shown in the example, the packet would coincide with the previously received packet nine packets behind the current packet. The packet would be discarded and a REPLAY error would be returned. Packet numbers would not be updated

Example of EARLY packet

16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
---------------------------------------------------------------------
| 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 |
---------------------------------------------------------------------
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 C
* * * * * * * * * * * * * * * * u
P P P P P P P P P P P P P P P P r
r r r r r r r r r r r r r r r r r
e e e e e e e e e e e e e e e e e
v v v v v v v v v v v v v v v v n
i i i i i i i i i i i i i i i i t
o o o o o o o o o o o o o o o o
u u u u u u u u u u u u u u u u
s s s s s s s s s s s s s s s s

For the EARLY example, say we receive a packet that has a packet number placing it 2 packets ahead of the current packet. As shown in the example, window would be shifted left by two packets and a one would be placed in the current packet position. Packet numbers will be updated to reflect the newer packet number received. No error is reported

Over and underflow support Finally, the anti-replay window also supports OVERFLOW and UNDERFLOW of the sequence numbers. When detected, these errors are returned by the anti_replay() function status uint32_t

For API Documentation:

See also
ProtocolPP::jreplay
ProtocolPP::jarray

For Additional Documentation:

See also
jreplay
jarray
Protocol++® (ProtocolPP®) written by : John Peter Greninger • © John Peter Greninger 2015-2024 • All Rights Reserved
All copyrights and trademarks are the property of their respective owners

The source code contained or described herein and all documents related to the source code (herein called "Material") are owned by John Peter Greninger and Sheila Rocha Greninger. Title to the Material remains with John Peter Greninger and Sheila Rocha Greninger. The Material contains trade secrets and proprietary and confidential information of John Peter Greninger and Sheila Rocha Greninger. The Material is protected by worldwide copyright and trade secret laws and treaty provisions. No part of the Material may be used, copied, reproduced, modified, published, uploaded, posted, transmitted, distributed, or disclosed in any way without prior express written consent of John Peter Greninger and Sheila Rocha Greninger (both are required)

No license under any patent, copyright, trade secret, or other intellectual property right is granted to or conferred upon you by disclosure or delivery of the Materials, either expressly, by implication, inducement, estoppel, or otherwise. Any license under such intellectual property rights must be express and approved by John Peter Greninger and Sheila Rocha Greninger in writing

Licensing information can be found at www.protocolpp.com/license with use of the binary forms permitted provided that the following conditions are met:

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution
  • Any and all modifications must be returned to John Peter Greninger at GitHub.com https://github.com/jpgreninger/protocolpp for evaluation. Inclusion of modifications in the source code shall be determined solely by John Peter Greninger. Failure to provide modifications shall render this license NULL and VOID and revoke any rights to use of Protocol++®
  • Commercial use (incidental or not) requires a fee-based license obtainable at www.protocolpp.com/shop
  • Academic or research use requires prior written and notarized permission from John Peter and Sheila Rocha Greninger

Use of the source code requires purchase of the source code. Source code can be purchased at www.protocolpp.com/shop

  • US Copyrights at https://www.copyright.gov/
    • TXu002059872 (Version 1.0.0)
    • TXu002066632 (Version 1.2.7)
    • TXu002082674 (Version 1.4.0)
    • TXu002097880 (Version 2.0.0)
    • TXu002169236 (Version 3.0.1)
    • TXu002182417 (Version 4.0.0)
    • TXu002219402 (Version 5.0.0)
    • TXu002272076 (Version 5.2.1)
    • TXu002383571 (Version 5.4.3)

The name of its contributor may not be used to endorse or promote products derived from this software without specific prior written permission and licensing

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE


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