History

tipc: convert legacy nl link stat to nl compat

Add functionality for safely appending string data to a TLV without keeping write count in the caller. Convert TIPC_CMD_SHOW_LINK_STATS to compat dumpit.

Richard Alpe committed 11 years ago

Commit f2b3b2d1 parent 9ab15467 files · +215 −192Browse files

Showing the changes to include/uapi/linux (1 of 7 files). Show all

Unified · Split

include/uapi/linux/tipc_config.h+10−0
@@ -277,11 +277,21 @@ static inline int TLV_GET_LEN(struct tlv_desc *tlv) · 276 unmodified lines
277277 return ntohs(tlv->tlv_len);
278278 }
279279
280+static inline void TLV_SET_LEN(struct tlv_desc *tlv, __u16 len)
281+{
282+ tlv->tlv_len = htons(len);
283+}
284+
280285 static inline int TLV_CHECK_TYPE(struct tlv_desc *tlv, __u16 type)
281286 {
282287 return (ntohs(tlv->tlv_type) == type);
283288 }
284289
290+static inline void TLV_SET_TYPE(struct tlv_desc *tlv, __u16 type)
291+{
292+ tlv->tlv_type = htons(type);
293+}
294+
285295 static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
286296 {
287297 struct tlv_desc *tlv_ptr;