Go to the documentation of this file.
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);
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.
void packet_id_persist_init(struct packet_id_persist *p)
uint64_t max_backtrack_stat
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.
static bool packet_id_persist_enabled(const struct packet_id_persist *p)
const char * packet_id_net_print(const struct packet_id_net *pin, bool print_timestamp, struct gc_arena *gc)
CIRC_LIST(seq_list, time_t)
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.
static bool packet_id_initialized(const struct packet_id *pid)
Is this struct packet_id initialized?
#define SEQ_REAP_INTERVAL
const char * packet_id_persist_print(const struct packet_id_persist *p, struct gc_arena *gc)
bool packet_id_read(struct packet_id_net *pin, struct buffer *buf, bool long_form)
void packet_id_persist_close(struct packet_id_persist *p)
void packet_id_persist_load(struct packet_id_persist *p, const char *filename)
static void packet_id_persist_save_obj(struct packet_id_persist *p, const struct packet_id *pid)
static void reset_packet_id_send(struct packet_id_send *p)
Reset the current send packet id to its initial state.
uint64_t packet_id_print_type
#define PACKET_ID_WRAP_TRIGGER
bool packet_id_test(struct packet_id_rec *p, const struct packet_id_net *pin)
void packet_id_persist_load_obj(const struct packet_id_persist *p, struct packet_id *pid)
Wrapper structure for dynamically allocated memory.
void packet_id_persist_save(struct packet_id_persist *p)
static void packet_id_reap_test(struct packet_id_rec *p)
Garbage collection arena used to keep track of dynamically allocated memory.
void packet_id_init(struct packet_id *p, int seq_backtrack, int time_backtrack, const char *name, int unit)
void packet_id_free(struct packet_id *p)
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.
packet_id_type id_last_written
struct packet_id_send send
static int packet_id_size(bool long_form)
void packet_id_add(struct packet_id_rec *p, const struct packet_id_net *pin)
Data structure for describing the packet id that is received/send to the network.
static bool packet_id_close_to_wrapping(const struct packet_id_send *p)
void packet_id_reap(struct packet_id_rec *p)
struct seq_list * seq_list