summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-08-14 15:32:36 (GMT)
committerThomas Haller <thaller@redhat.com>2015-08-17 21:01:57 (GMT)
commit7bb956501ccd58ed3bbffc59de996f056e178683 (patch)
treeaf3a3fa3b9623692310a3b6b30c19c124c468304 /include
parent8818a571e72c51bcda309d89bfaf93a2f5524d68 (diff)
downloadlibnl-7bb956501ccd58ed3bbffc59de996f056e178683.zip
libnl-7bb956501ccd58ed3bbffc59de996f056e178683.tar.gz
libnl-7bb956501ccd58ed3bbffc59de996f056e178683.tar.bz2
lib/attr: add nla utility functions for s32
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/netlink/attr.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/netlink/attr.h b/include/netlink/attr.h
index b84b62e..fd8e299 100644
--- a/include/netlink/attr.h
+++ b/include/netlink/attr.h
@@ -103,6 +103,8 @@ extern uint8_t nla_get_u8(const struct nlattr *);
extern int nla_put_u8(struct nl_msg *, int, uint8_t);
extern uint16_t nla_get_u16(const struct nlattr *);
extern int nla_put_u16(struct nl_msg *, int, uint16_t);
+extern int32_t nla_get_s32(const struct nlattr *);
+extern int nla_put_s32(struct nl_msg *, int, int32_t);
extern uint32_t nla_get_u32(const struct nlattr *);
extern int nla_put_u32(struct nl_msg *, int, uint32_t);
extern uint64_t nla_get_u64(const struct nlattr *);
@@ -188,6 +190,15 @@ extern int nla_is_nested(const struct nlattr *);
* @arg attrtype Attribute type.
* @arg value Numeric value.
*/
+#define NLA_PUT_S32(msg, attrtype, value) \
+ NLA_PUT_TYPE(msg, int32_t, attrtype, value)
+
+/**
+ * Add 32 bit integer attribute to netlink message.
+ * @arg msg Netlink message.
+ * @arg attrtype Attribute type.
+ * @arg value Numeric value.
+ */
#define NLA_PUT_U32(msg, attrtype, value) \
NLA_PUT_TYPE(msg, uint32_t, attrtype, value)