diff options
Diffstat (limited to 'include/uapi/linux/tipc_config.h')
-rw-r--r-- | include/uapi/linux/tipc_config.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/uapi/linux/tipc_config.h b/include/uapi/linux/tipc_config.h index 876d0a14863c..087b0ef82c07 100644 --- a/include/uapi/linux/tipc_config.h +++ b/include/uapi/linux/tipc_config.h | |||
@@ -272,6 +272,26 @@ static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type) | |||
272 | (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type); | 272 | (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type); |
273 | } | 273 | } |
274 | 274 | ||
275 | static inline int TLV_GET_LEN(struct tlv_desc *tlv) | ||
276 | { | ||
277 | return ntohs(tlv->tlv_len); | ||
278 | } | ||
279 | |||
280 | static inline void TLV_SET_LEN(struct tlv_desc *tlv, __u16 len) | ||
281 | { | ||
282 | tlv->tlv_len = htons(len); | ||
283 | } | ||
284 | |||
285 | static inline int TLV_CHECK_TYPE(struct tlv_desc *tlv, __u16 type) | ||
286 | { | ||
287 | return (ntohs(tlv->tlv_type) == type); | ||
288 | } | ||
289 | |||
290 | static inline void TLV_SET_TYPE(struct tlv_desc *tlv, __u16 type) | ||
291 | { | ||
292 | tlv->tlv_type = htons(type); | ||
293 | } | ||
294 | |||
275 | static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len) | 295 | static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len) |
276 | { | 296 | { |
277 | struct tlv_desc *tlv_ptr; | 297 | struct tlv_desc *tlv_ptr; |