4
* interface for a replay database for packet security
14
#include "integers.h" /* for uint32_t */
15
#include "datatypes.h" /* for v128_t */
16
#include "err.h" /* for err_status_t */
19
* if the ith least significant bit is one, then the packet index
20
* window_end-i is in the database
24
uint32_t window_start; /* packet index of the first bit in bitmask */
28
#define rdb_bits_in_bitmask (8*sizeof(v128_t))
35
* returns err_status_ok on success, err_status_t_fail otherwise
45
* checks to see if index appears in rdb
47
* returns err_status_fail if the index already appears in rdb,
48
* returns err_status_ok otherwise
52
rdb_check(const rdb_t *rdb, uint32_t index);
57
* adds index to rdb_t (and does *not* check if index appears in db)
59
* returns err_status_ok on success, err_status_fail otherwise
64
rdb_add_index(rdb_t *rdb, uint32_t index);
67
* the functions rdb_increment() and rdb_get_value() are for use by
68
* senders, not receivers - DO NOT use these functions on the same
69
* rdb_t upon which rdb_add_index is used!
74
* rdb_increment(db) increments the sequence number in db, if it is
79
* err_status_ok no problem
80
* err_status_key_expired sequence number too high
84
rdb_increment(rdb_t *rdb);
87
* rdb_get_value(db) returns the current sequence number of db
91
rdb_get_value(const rdb_t *rdb);
94
#endif /* REPLAY_DB_H */