Manpage of NETLINK
NETLINKSection: Linux Programmer's Manual (3)
NAMEnetlink - Netlink macros
#include <linux/netlink.h>int NLMSG_ALIGN(size_t len);
int NLMSG_LENGTH(size_t len);
int NLMSG_SPACE(size_t len);
void *NLMSG_DATA(struct nlmsghdr *nlh);
struct nlmsghdr *NLMSG_ (struct nlmsghdr *nlh, int len);
int NLMSG_OK(struct nlmsghdr *nlh, int len);
int NLMSG_PAYLOAD(struct nlmsghdr *nlh, int len);
DESCRIPTION<linux/netlink.h>defines several standard macros to access or create a netlink datagram. They are similar in spirit to the macros defined in cmsg(3) for auxiliary data. The buffer passed to and from a netlink socket should be accessed using only these macros.
- Round the length of a netlink message up to align it properly.
- Given the payload length, len, this macro returns the aligned length to store in the nlmsg_lenfield of the nlmsghdr.
- Return the number of bytes that a netlink message with payload of lenwould occupy.
- Return a pointer to the payload associated with the passed nlmsghdr.
- NLMSG_ () Get the nlmsghdrin a multipart message. The caller must check if the current nlmsghdrdidn't have the NLMSG_DONEset---this function doesn't return NULL on end. The lenargument is an lvalue containing the remaining length of the message buffer. This macro decrements it by the length of the message header.
- Return true if the netlink message is not truncated and is in a form suitable for parsing.
- Return the length of the payload associated with the nlmsghdr.
CONFORMING TOThese macros are nonstandard Linux extensions.
NOTESIt is often better to use netlink via libnetlinkthan via the low-level kernel interface.
SEE ALSOlibnetlink(3), netlink(7)
This document was created by man2html, using the manual pages.
Time: 16:30:15 GMT, March 14, 2017 Click Here!