Lines Matching refs:tlv
258 #define TLV_DATA(tlv) ((void *)((char *)(tlv) + TLV_LENGTH(0))) argument
260 static inline int TLV_OK(const void *tlv, __u16 space) in TLV_OK() argument
272 (ntohs(((struct tlv_desc *)tlv)->tlv_len) <= space); in TLV_OK()
275 static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type) in TLV_CHECK() argument
277 return TLV_OK(tlv, space) && in TLV_CHECK()
278 (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type); in TLV_CHECK()
281 static inline int TLV_GET_LEN(struct tlv_desc *tlv) in TLV_GET_LEN() argument
283 return ntohs(tlv->tlv_len); in TLV_GET_LEN()
286 static inline void TLV_SET_LEN(struct tlv_desc *tlv, __u16 len) in TLV_SET_LEN() argument
288 tlv->tlv_len = htons(len); in TLV_SET_LEN()
291 static inline int TLV_CHECK_TYPE(struct tlv_desc *tlv, __u16 type) in TLV_CHECK_TYPE() argument
293 return (ntohs(tlv->tlv_type) == type); in TLV_CHECK_TYPE()
296 static inline void TLV_SET_TYPE(struct tlv_desc *tlv, __u16 type) in TLV_SET_TYPE() argument
298 tlv->tlv_type = htons(type); in TLV_SET_TYPE()
301 static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len) in TLV_SET() argument
307 tlv_ptr = (struct tlv_desc *)tlv; in TLV_SET()