1 .\" This manpage copyright 1998 by Andi Kleen.
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Subject to the GPL.
7 .\" Based on the original comments from Alexey Kuznetsov
8 .\" $Id: netlink.3,v 1.1 1999/05/14 17:17:24 freitag Exp $
10 .TH NETLINK 3 2014-03-20 "GNU" "Linux Programmer's Manual"
12 netlink \- Netlink macros
15 .B #include <asm/types.h>
17 .B #include <linux/netlink.h>
19 .BI "int NLMSG_ALIGN(size_t " len );
21 .BI "int NLMSG_LENGTH(size_t " len );
23 .BI "int NLMSG_SPACE(size_t " len );
25 .BI "void *NLMSG_DATA(struct nlmsghdr *" nlh );
27 .BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len );
29 .BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len );
31 .BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len );
35 defines several standard macros to access or create a netlink datagram.
36 They are similar in spirit to the macros defined in
39 The buffer passed to and from a netlink socket should
40 be accessed using only these macros.
43 Round the length of a netlink message up to align it properly.
46 Given the payload length,
48 this macro returns the aligned length to store in the
54 Return the number of bytes that a netlink message with payload of
59 Return a pointer to the payload associated with the passed
62 .\" this is bizarre, maybe the interface should be fixed.
66 in a multipart message.
67 The caller must check if the current
71 set\(emthis function doesn't return NULL on end.
74 argument is an lvalue containing the remaining length
75 of the message buffer.
76 This macro decrements it by the length of the message header.
79 Return true if the netlink message is not truncated and
80 is in a form suitable for parsing.
83 Return the length of the payload associated with the
86 These macros are nonstandard Linux extensions.
88 It is often better to use netlink via
90 than via the low-level kernel interface.
95 This page is part of release 3.79 of the Linux
98 A description of the project,
99 information about reporting bugs,
100 and the latest version of this page,
102 \%http://www.kernel.org/doc/man\-pages/.