Lines Matching refs:tlv
53 * the payload consists of zero or more type/length/value (TLV) items
59 * of an "error string" TLV in the reply message instead of the TLV(s) the
147 * TLV types defined for TIPC
150 #define TIPC_TLV_NONE 0 /* no TLV present */
151 #define TIPC_TLV_VOID 1 /* empty TLV (0 data bytes)*/
236 * The error string TLV is a null-terminated string describing the cause
242 #define TIPC_CFG_TLV_ERROR "\x80" /* request contains incorrect TLV(s) */
250 /* prototypes TLV structures for proposed commands */
264 * A TLV consists of a descriptor, followed by the TLV value.
265 * TLV descriptor fields are stored in network byte order;
266 * TLV values must also be stored in network byte order (where applicable).
267 * TLV descriptors must be aligned to addresses which are multiple of 4,
268 * so up to 3 bytes of padding may exist at the end of the TLV value area.
269 * There must not be any padding between the TLV descriptor and its value.
273 __be16 tlv_len; /* TLV length (descriptor + value) */
274 __be16 tlv_type; /* TLV identifier */
282 #define TLV_DATA(tlv) ((void *)((char *)(tlv) + TLV_LENGTH(0)))
284 static __inline__ int TLV_OK(const void *tlv, __u16 space)
287 * Would also like to check that "tlv" is a multiple of 4,
289 * - Tried doing (!(tlv & (TLV_ALIGNTO-1))), but GCC compiler
291 * - Tried casting "tlv" to integer type, but causes warning about size
296 (ntohs(((struct tlv_desc *)tlv)->tlv_len) <= space);
299 static __inline__ int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type)
301 return TLV_OK(tlv, space) &&
302 (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type);
305 static __inline__ int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
311 tlv_ptr = (struct tlv_desc *)tlv;
320 * A TLV list descriptor simplifies processing of messages
325 struct tlv_desc *tlv_ptr; /* ptr to current TLV */
326 __u32 tlv_space; /* # bytes from curr TLV to list end */