From 8f7a3cbbdd0c0a48277c341dd3a8ec8743ae9735 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Sat, 8 Sep 2018 17:44:06 +0200 Subject: New upstream version 1.13.90 --- src/platform/nm-netlink.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/platform/nm-netlink.h') diff --git a/src/platform/nm-netlink.h b/src/platform/nm-netlink.h index 185269ba..187685d8 100644 --- a/src/platform/nm-netlink.h +++ b/src/platform/nm-netlink.h @@ -62,7 +62,7 @@ nl_errno (int err) * normalizes the error and returns its positive value. */ return err >= 0 ? err - : ((err == G_MININT) ? NLE_BUG : -errno); + : ((err == G_MININT) ? NLE_BUG : -err); } static inline int @@ -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) @@ -296,8 +314,6 @@ struct nl_msg *nlmsg_alloc (void); struct nl_msg *nlmsg_alloc_size (size_t max); -struct nl_msg *nlmsg_alloc_inherit (struct nlmsghdr *hdr); - struct nl_msg *nlmsg_alloc_convert (struct nlmsghdr *hdr); struct nl_msg *nlmsg_alloc_simple (int nlmsgtype, int flags); -- cgit 1.3.0-6-gf8a5