1 .\" This manpage copyright 1998 by Andi Kleen.
3 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .\" Based on the original comments from Alexey Kuznetsov
6 .\" $Id: netlink.3,v 1.1 1999/05/14 17:17:24 freitag Exp $
8 .TH NETLINK 3 2014-03-20 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
10 netlink \- Netlink macros
13 .RI ( libc ", " \-lc )
16 .B #include <asm/types.h>
17 .B #include <linux/netlink.h>
19 .BI "int NLMSG_ALIGN(size_t " len );
20 .BI "int NLMSG_LENGTH(size_t " len );
21 .BI "int NLMSG_SPACE(size_t " len );
22 .BI "void *NLMSG_DATA(struct nlmsghdr *" nlh );
23 .BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len );
24 .BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len );
25 .BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len );
29 defines several standard macros to access or create a netlink datagram.
30 They are similar in spirit to the macros defined in
33 The buffer passed to and from a netlink socket should
34 be accessed using only these macros.
37 Round the length of a netlink message up to align it properly.
40 Given the payload length,
42 this macro returns the aligned length to store in the
48 Return the number of bytes that a netlink message with payload of
53 Return a pointer to the payload associated with the passed
56 .\" this is bizarre, maybe the interface should be fixed.
60 in a multipart message.
61 The caller must check if the current
65 set\(emthis function doesn't return NULL on end.
68 argument is an lvalue containing the remaining length
69 of the message buffer.
70 This macro decrements it by the length of the message header.
73 Return true if the netlink message is not truncated and
74 is in a form suitable for parsing.
77 Return the length of the payload associated with the
80 These macros are nonstandard Linux extensions.
82 It is often better to use netlink via
84 than via the low-level kernel interface.