diff options
author | Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com> | 2018-10-05 16:25:19 -0700 |
---|---|---|
committer | David Ahern <dsahern@gmail.com> | 2018-10-07 10:31:35 -0700 |
commit | d791f3ad869659da4b151eded060840a88d9656a (patch) | |
tree | 42a7f0b424a9b2c1b1f0f2a614c2f2a5854e0208 /include/libnetlink.h | |
parent | de63cd90444ac9fdf238f950c16cafe351846691 (diff) |
libnetlink: Add helper for getting a __s32 from netlink msgs
This function retrieves a signed 32-bit integer from a netlink message
and returns it.
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Diffstat (limited to 'include/libnetlink.h')
-rw-r--r-- | include/libnetlink.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/libnetlink.h b/include/libnetlink.h index a133470c..04264b87 100644 --- a/include/libnetlink.h +++ b/include/libnetlink.h @@ -203,6 +203,10 @@ static inline __u64 rta_getattr_u64(const struct rtattr *rta) memcpy(&tmp, RTA_DATA(rta), sizeof(__u64)); return tmp; } +static inline __s32 rta_getattr_s32(const struct rtattr *rta) +{ + return *(__s32 *)RTA_DATA(rta); +} static inline __s64 rta_getattr_s64(const struct rtattr *rta) { __s64 tmp; |