diff options
| author | Richard Alpe <richard.alpe@ericsson.com> | 2015-02-09 03:50:06 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-02-09 16:20:47 -0500 |
| commit | f2b3b2d4ccbf9666f5f42a21347cd1aaa532b2fa (patch) | |
| tree | 36a8eea16c58cd54f91ced3862da77803b223dcf /include/uapi/linux | |
| parent | 9ab154658a7ff2c5076607e02f18581c6859fc2a (diff) | |
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.
Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/tipc_config.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/uapi/linux/tipc_config.h b/include/uapi/linux/tipc_config.h index f9226566c1b8..087b0ef82c07 100644 --- a/include/uapi/linux/tipc_config.h +++ b/include/uapi/linux/tipc_config.h | |||
| @@ -277,11 +277,21 @@ static inline int TLV_GET_LEN(struct tlv_desc *tlv) | |||
| 277 | return ntohs(tlv->tlv_len); | 277 | return ntohs(tlv->tlv_len); |
| 278 | } | 278 | } |
| 279 | 279 | ||
| 280 | static inline void TLV_SET_LEN(struct tlv_desc *tlv, __u16 len) | ||
| 281 | { | ||
| 282 | tlv->tlv_len = htons(len); | ||
| 283 | } | ||
| 284 | |||
| 280 | static inline int TLV_CHECK_TYPE(struct tlv_desc *tlv, __u16 type) | 285 | static inline int TLV_CHECK_TYPE(struct tlv_desc *tlv, __u16 type) |
| 281 | { | 286 | { |
| 282 | return (ntohs(tlv->tlv_type) == type); | 287 | return (ntohs(tlv->tlv_type) == type); |
| 283 | } | 288 | } |
| 284 | 289 | ||
| 290 | static inline void TLV_SET_TYPE(struct tlv_desc *tlv, __u16 type) | ||
| 291 | { | ||
| 292 | tlv->tlv_type = htons(type); | ||
| 293 | } | ||
| 294 | |||
| 285 | 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) |
| 286 | { | 296 | { |
| 287 | struct tlv_desc *tlv_ptr; | 297 | struct tlv_desc *tlv_ptr; |
