43#define TLV_TYPE_EARLY_NEG_FLAGS 0x0001
44#define TLV_TYPE_PROBE_REQUEST 0x0002
45#define TLV_TYPE_PROBE_REPLY 0x0003
48#define CTRL_MSG_TLV_HEADER_LEN 4
51#define CTRL_MSG_TLV_OPTIONAL_FLAG 0x8000
52#define CTRL_MSG_TLV_TYPE_MASK 0x7fff
Buffer management functions and garbage collection.
bool ctrl_msg_tlv_write_u16(struct buffer *buf, uint16_t type, bool optional, uint16_t value)
Write a complete TLV whose value is a single 16-bit integer to buf.
bool ctrl_msg_tlv_peek_header(const struct buffer *buf, struct ctrl_msg_tlv_header *hdr)
Read a TLV header from buf without consuming it.
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.
bool ctrl_msg_find_tlv(struct buffer *payload, uint16_t wanted_type, struct buffer *value)
Scan payload for the TLV of type wanted_type, skipping any other TLV type that is marked optional.
bool ctrl_msg_tlv_next(struct buffer *buf, struct ctrl_msg_tlv_header *hdr, struct buffer *value)
Read the next TLV from buf, advancing past its header and value.
Wrapper structure for dynamically allocated memory.