1 .\" This manpage copyright 1998 by Andi Kleen. Subject to the GPL.
2 .\" Based on the original comments from Alexey Kuznetsov
3 .\" $Id: netlink.3,v 1.1 1999/05/14 17:17:24 freitag Exp $
4 .TH NETLINK 3 1999-05-14 "Linux Man Page" "Linux Programmer's Manual"
6 netlink \- Netlink macros
9 .\" FIXME what will glibc 2.1 use here?
10 .B #include <asm/types.h>
12 .B #include <linux/netlink.h>
14 .BI "int NLMSG_ALIGN(size_t " len );
16 .BI "int NLMSG_LENGTH(size_t " len );
18 .BI "int NLMSG_SPACE(size_t " len );
20 .BI "void *NLMSG_DATA(struct nlmsghdr *" nlh );
22 .BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len );
24 .BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len );
26 .BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len );
30 defines several standard macros to access or create a netlink datagram.
31 They are similar in spirit to the macros defined in
33 for auxiliary data. The buffer passed to and from a netlink socket should
34 be only accessed using these macros.
38 Round the length of a netlink message up to align it properly.
41 Gets the payload length as argument and returns the aligned length to store
49 Return the number of bytes a netlink message with payload of the passed length
53 Return a pointer to the payload associated with the passed
56 .\" FIXME this is bizarre, maybe the interface should be fixed.
60 in a multipart message.
61 The caller must check if the current nlmsghdr didn't have the NLMSG_DONE
62 set \(em this function doesn't return NULL on end.
63 The length parameter is an lvalue containing the remaining length
64 of the message buffer.
65 This macro decrements it by the length of the message header.
68 Return true if the netlink message is not truncated and ok to parse.
71 Return the length of the payload associated with the
75 It is often better to use netlink via
77 than via the low level kernel interface.
82 and ftp://ftp.inr.ac.ru/ip-routing/iproute2* for libnetlink