On Wed, Jun 21, 2017 at 04:01:19PM +0300, Dmitry V. Levin wrote:
[...]
> So far I have no better ideas than to introduce a local header,
> e.g. netlink.h, containing, besides an include guard, something like this:
> 
> #include <sys/socket.h>
> #include <linux/netlink.h>
> 
> #undef NLMSG_HDRLEN
> #define NLMSG_HDRLEN ((unsigned int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
> 
> #ifndef NLA_ALIGN
> # define NLA_ALIGN(len) (((len) + 3) & ~3)
> #endif
> 
> #undef NLA_HDRLEN
> #define NLA_HDRLEN ((unsigned int) NLA_ALIGN(sizeof(struct nlattr)))
> 
> #ifndef NLA_TYPE_MASK
> # define NLA_F_NESTED         (1 << 15)
> # define NLA_F_NET_BYTEORDER  (1 << 14)
> # define NLA_TYPE_MASK                ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
> #endif

While we are here, a fallback definition for NLMSG_MIN_TYPE seems to be
needed as well, this constant was introduced along with NLMSG_HDRLEN.


-- 
ldv

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to