diff --git a/src/platform/nm-netlink.h b/src/platform/nm-netlink.h index b938fa4a4d..8ae2641d6a 100644 --- a/src/platform/nm-netlink.h +++ b/src/platform/nm-netlink.h @@ -176,6 +176,12 @@ nla_get_u8 (const struct nlattr *nla) return *(const uint8_t *) nla_data (nla); } +static inline uint8_t +nla_get_s8 (const struct nlattr *nla) +{ + return *(const int8_t *) nla_data (nla); +} + static inline uint8_t nla_get_u8_cond (/*const*/ struct nlattr *const*tb, int attr, uint8_t default_val) { @@ -197,6 +203,12 @@ nla_get_u32(const struct nlattr *nla) return *(const uint32_t *) nla_data (nla); } +static inline int32_t +nla_get_s32(const struct nlattr *nla) +{ + return *(const int32_t *) nla_data (nla); +} + uint64_t nla_get_u64 (const struct nlattr *nla); static inline char * @@ -232,12 +244,18 @@ nla_put_string (struct nl_msg *msg, int attrtype, const char *str) #define NLA_PUT_U8(msg, attrtype, value) \ NLA_PUT_TYPE(msg, uint8_t, attrtype, value) +#define NLA_PUT_S8(msg, attrtype, value) \ + NLA_PUT_TYPE(msg, int8_t, attrtype, value) + #define NLA_PUT_U16(msg, attrtype, value) \ NLA_PUT_TYPE(msg, uint16_t, attrtype, value) #define NLA_PUT_U32(msg, attrtype, value) \ NLA_PUT_TYPE(msg, uint32_t, attrtype, value) +#define NLA_PUT_S32(msg, attrtype, value) \ + NLA_PUT_TYPE(msg, int32_t, attrtype, value) + #define NLA_PUT_U64(msg, attrtype, value) \ NLA_PUT_TYPE(msg, uint64_t, attrtype, value)