47#define PACKET_ID_MAX UINT32_MAX
48#define PACKET_ID_EPOCH_MAX 0x0000ffffffffffffull
51#define PACKET_ID_MASK 0x0000ffffffffffffull
59#define PACKET_ID_WRAP_TRIGGER 0xFF000000
62#define htonpid(x) htonl(x)
65#define ntohpid(x) ntohl(x)
68#define htontime(x) htonl((net_time_t)x)
71#define ntohtime(x) ((time_t)ntohl(x))
77#define packet_id_format "%" PRIu64
85#define MIN_SEQ_BACKTRACK 0
86#define MAX_SEQ_BACKTRACK 65536
87#define DEFAULT_SEQ_BACKTRACK 64
94#define MIN_TIME_BACKTRACK 0
95#define MAX_TIME_BACKTRACK 600
96#define DEFAULT_TIME_BACKTRACK 15
105#define SEQ_REAP_INTERVAL 5
267 bool long_form,
bool prepend);
#define CIRC_LIST(name, type)
static bool packet_id_persist_enabled(const struct packet_id_persist *p)
uint64_t packet_id_print_type
void packet_id_persist_save(struct packet_id_persist *p)
static void reset_packet_id_send(struct packet_id_send *p)
Reset the current send packet id to its initial state.
const char * packet_id_persist_print(const struct packet_id_persist *p, struct gc_arena *gc)
void packet_id_persist_load_obj(const struct packet_id_persist *p, struct packet_id *pid)
void packet_id_init(struct packet_id *p, int seq_backtrack, int time_backtrack, const char *name, int unit)
#define SEQ_REAP_INTERVAL
void packet_id_persist_close(struct packet_id_persist *p)
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 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)
static void packet_id_persist_save_obj(struct packet_id_persist *p, const struct packet_id *pid)
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?
void packet_id_persist_load(struct packet_id_persist *p, const char *filename)
void packet_id_persist_init(struct packet_id_persist *p)
#define PACKET_ID_WRAP_TRIGGER
static int packet_id_size(bool long_form)
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.
packet_id_type id_last_written
uint64_t max_backtrack_stat
struct seq_list * seq_list
struct packet_id_send send