Lines Matching refs:tlv
252 #define TLV_DATA(tlv) ((void *)((char *)(tlv) + TLV_LENGTH(0))) argument
254 static inline int TLV_OK(const void *tlv, __u16 space) in TLV_OK() argument
266 (ntohs(((struct tlv_desc *)tlv)->tlv_len) <= space); in TLV_OK()
269 static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type) in TLV_CHECK() argument
271 return TLV_OK(tlv, space) && in TLV_CHECK()
272 (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type); in TLV_CHECK()
275 static inline int TLV_GET_LEN(struct tlv_desc *tlv) in TLV_GET_LEN() argument
277 return ntohs(tlv->tlv_len); in TLV_GET_LEN()
280 static inline void TLV_SET_LEN(struct tlv_desc *tlv, __u16 len) in TLV_SET_LEN() argument
282 tlv->tlv_len = htons(len); in TLV_SET_LEN()
285 static inline int TLV_CHECK_TYPE(struct tlv_desc *tlv, __u16 type) in TLV_CHECK_TYPE() argument
287 return (ntohs(tlv->tlv_type) == type); in TLV_CHECK_TYPE()
290 static inline void TLV_SET_TYPE(struct tlv_desc *tlv, __u16 type) in TLV_SET_TYPE() argument
292 tlv->tlv_type = htons(type); in TLV_SET_TYPE()
295 static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len) in TLV_SET() argument
301 tlv_ptr = (struct tlv_desc *)tlv; in TLV_SET()