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>
16 .B #include <linux/netlink.h>
18 .BI "int NLMSG_ALIGN(size_t " len );
19 .BI "int NLMSG_LENGTH(size_t " len );
20 .BI "int NLMSG_SPACE(size_t " len );
21 .BI "void *NLMSG_DATA(struct nlmsghdr *" nlh );
22 .BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len );
23 .BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len );
24 .BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len );
28 defines several standard macros to access or create a netlink datagram.
29 They are similar in spirit to the macros defined in
32 The buffer passed to and from a netlink socket should
33 be accessed using only these macros.
36 Round the length of a netlink message up to align it properly.
39 Given the payload length,
41 this macro returns the aligned length to store in the
47 Return the number of bytes that a netlink message with payload of
52 Return a pointer to the payload associated with the passed
55 .\" this is bizarre, maybe the interface should be fixed.
59 in a multipart message.
60 The caller must check if the current
64 set\(emthis function doesn't return NULL on end.
67 argument is an lvalue containing the remaining length
68 of the message buffer.
69 This macro decrements it by the length of the message header.
72 Return true if the netlink message is not truncated and
73 is in a form suitable for parsing.
76 Return the length of the payload associated with the
79 These macros are nonstandard Linux extensions.
81 It is often better to use netlink via
83 than via the low-level kernel interface.