static bool buf_write_u16(struct buffer *dest, uint16_t data)
Append a uint16_t to a buffer in network byte order.
static bool buf_write_u32(struct buffer *dest, uint32_t data)
Append a uint32_t to a buffer in network byte order.
static int buf_read_u16(struct buffer *buf)
Read and consume a uint16_t from the front of a buffer.
static int buf_len(const struct buffer *buf)
Return the length of the buffer content.
static uint64_t buf_read_u64(struct buffer *buf, bool *good)
Read and consume a uint64_t from the front of a buffer.
static uint32_t buf_read_u32(struct buffer *buf, bool *good)
Read and consume a uint32_t from the front of a buffer.
static bool buf_write_u64(struct buffer *dest, uint64_t data)
Append a uint64_t to a buffer in network byte order.
bool ctrl_msg_tlv_write_header(struct buffer *buf, uint16_t type, bool optional, uint16_t value_len)
Write a TLV header (type + optional flag + value length) to buf.
TLV framing shared by the TLV-based control messages of the wire protocol.
#define TLV_TYPE_PROBE_REQUEST
#define TLV_TYPE_PROBE_REPLY
bool probe_reply_write(struct buffer *buf, const struct probe_reply *r)
Write a complete probe reply TLV, header and value, to buf.
bool probe_request_read(struct buffer *buf, struct probe_request *r)
Read a probe request TLV value from buf.
bool probe_request_write(struct buffer *buf, const struct probe_request *r)
Write a complete probe request TLV, header and value, to buf.
bool probe_reply_read(struct buffer *buf, struct probe_reply *r)
Read a probe reply TLV value from buf.
Encoding and decoding of the server probe TLVs.
#define PROBE_REPLY_FLAG_LIFETIME_SHARED
the connect_lifetime holds against those other addresses too, so a reply from one of them can skip th...
#define PROBE_REPLY_FLAG_ADDRS_EQUAL
the other addresses of this remote are the same server, no need to probe them
#define PROBE_REPLY_LEN
request_id (u64), then priority, weight, max_latency_diff, connect_lifetime and flags (u16 each)
#define PROBE_REQUEST_LEN
request_id (u64), timestamp (u64), flags (u32)
#define PROBE_REPLY_FLAG_PROBE_MORE
the other addresses of this remote are distinct servers, so probe them too
Wrapper structure for dynamically allocated memory.
probe reply TLV, a server's answer to a probe request
uint16_t priority
DNS SRV style priority, lower is preferred.
uint16_t connect_lifetime
For how many seconds, counted from the moment the client sent its own probe request,...
uint16_t weight
DNS SRV style weight.
uint64_t request_id
echoes the request_id of the request
uint16_t max_latency_diff
candidate band in ms around the fastest server
uint16_t flags
PROBE_REPLY_FLAG_*.
probe request TLV, sent by a client to probe a server
uint32_t flags
PROBE_REQUEST_FLAG_*.
uint64_t timestamp
The client clock as a UNIX timestamp in seconds.
uint64_t request_id
identifies this probe, echoed in the reply