]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/netlink.3
sync
[thirdparty/man-pages.git] / man3 / netlink.3
CommitLineData
fea681da
MK
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"
5.SH NAME
6netlink \- Netlink macros
7.SH SYNOPSIS
8.nf
a749f870 9.\" FIXME what will glibc 2.1 use here?
fea681da
MK
10.B #include <asm/types.h>
11.br
12.B #include <linux/netlink.h>
13.br
14.BI "int NLMSG_ALIGN(size_t " len );
15.br
16.BI "int NLMSG_LENGTH(size_t " len );
17.br
18.BI "int NLMSG_SPACE(size_t " len );
19.br
20.BI "void *NLMSG_DATA(struct nlmsghdr *" nlh );
21.br
22.BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len );
23.br
24.BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len );
25.br
26.BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len );
27.fi
28.SH DESCRIPTION
bd12ab88 29.I <linux/netlink.h>
fea681da
MK
30defines several standard macros to access or create a netlink datagram.
31They are similar in spirit to the macros defined in
32.BR cmsg (3)
33for auxiliary data. The buffer passed to and from a netlink socket should
34be only accessed using these macros.
35.TP
fea681da
MK
36NLMSG_ALIGN
37Round the length of a netlink message up to align it properly.
38.TP
39NLMSG_LENGTH
40Gets the payload length as argument and returns the aligned length to store
41in the
42.B nlmsg_len
43field of the
44.IR nlmsghdr .
fea681da
MK
45.TP
46NLMSG_SPACE
47Return the number of bytes a netlink message with payload of the passed length
48would occupy.
49.TP
50NLMSG_DATA
51Return a pointer to the payload associated with the passed
52.IR nlmsghdr .
53.TP
a749f870 54.\" FIXME this is bizarre, maybe the interface should be fixed.
fea681da
MK
55NLMSG_NEXT
56Get the next
57.I nlmsghdr
df8a3cac
MK
58in a multipart message.
59The caller must check if the current nlmsghdr didn't have the NLMSG_DONE
60set \(em this function doesn't return NULL on end.
61The length parameter is an lvalue containing the remaining length
62of the message buffer.
63This macro decrements it by the length of the message header.
fea681da
MK
64.TP
65NLMSG_OK
66Return true if the netlink message is not truncated and ok to parse.
67.TP
68NLMSG_PAYLOAD
69Return the length of the payload associated with the
70.IR nlmsghdr .
fea681da
MK
71.SH NOTES
72It is often better to use netlink via
73.B libnetlink
74than via the low level kernel interface.
fea681da
MK
75.SH "SEE ALSO"
76.BR netlink (7)
77.PP
78and ftp://ftp.inr.ac.ru/ip-routing/iproute2* for libnetlink