46#define PACKET_ID_MAX UINT32_MAX
47#define PACKET_ID_EPOCH_MAX 0x0000ffffffffffffull
50#define PACKET_ID_MASK 0x0000ffffffffffffull
58#define PACKET_ID_WRAP_TRIGGER 0xFF000000
61#define htonpid(x) htonl(x)
64#define ntohpid(x) ntohl(x)
67#define htontime(x) htonl((net_time_t)x)
70#define ntohtime(x) ((time_t)ntohl(x))
76#define packet_id_format "%" PRIu64
84#define MIN_SEQ_BACKTRACK 0
85#define MAX_SEQ_BACKTRACK 65536
86#define DEFAULT_SEQ_BACKTRACK 64
93#define MIN_TIME_BACKTRACK 0
94#define MAX_TIME_BACKTRACK 600
95#define DEFAULT_TIME_BACKTRACK 15
104#define SEQ_REAP_INTERVAL 5
252static inline unsigned int
Buffer management functions and garbage collection.
#define CIRC_LIST(name, type)
uint64_t packet_id_print_type
static void reset_packet_id_send(struct packet_id_send *p)
Reset the current send packet id to its initial state.
void packet_id_init(struct packet_id *p, int seq_backtrack, int time_backtrack, const char *name, int unit)
#define SEQ_REAP_INTERVAL
bool packet_id_write_epoch(struct packet_id_send *p, uint16_t epoch, struct buffer *buf)
Writes the packet ID containing both the epoch and the packet id to the buffer specified by buf.
uint16_t packet_id_read_epoch(struct packet_id_net *p, struct buffer *buf)
Reads the packet ID containing both the epoch and the per-epoch counter from the buf.
void packet_id_free(struct packet_id *p)
bool packet_id_test(struct packet_id_rec *p, const struct packet_id_net *pin)
bool packet_id_read(struct packet_id_net *pin, struct buffer *buf, bool long_form)
static bool packet_id_close_to_wrapping(const struct packet_id_send *p)
void packet_id_move_recv(struct packet_id_rec *dest, struct packet_id_rec *src)
Move the packet id recv structure from src to dest.
static unsigned int packet_id_size(bool long_form)
static void packet_id_reap_test(struct packet_id_rec *p)
void packet_id_reap(struct packet_id_rec *p)
const char * packet_id_net_print(const struct packet_id_net *pin, bool print_timestamp, struct gc_arena *gc)
void packet_id_add(struct packet_id_rec *p, const struct packet_id_net *pin)
static bool packet_id_initialized(const struct packet_id *pid)
Is this struct packet_id initialized?
#define PACKET_ID_WRAP_TRIGGER
bool packet_id_write(struct packet_id_send *p, struct buffer *buf, bool long_form, bool prepend)
Write a packet ID to buf, and update the packet ID state.
Wrapper structure for dynamically allocated memory.
Garbage collection arena used to keep track of dynamically allocated memory.
Data structure for describing the packet id that is received/send to the network.
uint64_t max_backtrack_stat
struct seq_list * seq_list
struct packet_id_send send