netlink(3) Library Functions Manual netlink(3)

netlink - Macros pour netlink

Bibliothèque C standard (libc-lc)

#include <asm/types.h>
#include <linux/netlink.h>
int NLMSG_ALIGN(size_t size);
int NLMSG_LENGTH(size_t size);
int NLMSG_SPACE(size_t size);
void *NLMSG_DATA(struct nlmsghdr *nlh);
struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *nlh, int size);
int NLMSG_OK(struct nlmsghdr *nlh, int size);
int NLMSG_PAYLOAD(struct nlmsghdr *nlh, int size);

<linux/netlink.h> définit plusieurs macros standard pour accéder ou créer un datagramme netlink. Elles sont similaires dans leurs principes aux macros définies dans cmsg(3) pour les données auxiliaires. Le tampon passé à un socket netlink ne devrait pas être manipulé autrement que par ces macros.

Round the size of a netlink message up to align it properly.
Given the payload size, size, this macro returns the aligned size to store in the nlmsg_len field of the nlmsghdr.
Return the number of bytes that a netlink message with payload of size would occupy.
Retourne un pointeur sur l'objet associé au nlmsghdr passé.
Get the next nlmsghdr in a multipart message. The caller must check if the current nlmsghdr didn't have the NLMSG_DONE set—this function doesn't return NULL on end. The size argument is an lvalue containing the remaining size of the message buffer. This macro decrements it by the size of the message header.
Renvoie vrai si le message netlink n'est pas tronqué et est dans un format adapté au traitement.
Return the size of the payload associated with the nlmsghdr.

Il vaut souvent mieux utiliser la bibliothèque netlink via libnetlink que par les interfaces de bas niveau du noyau.

Linux.

libnetlink(3), netlink(7)

La traduction française de cette page de manuel a été créée par Christophe Blaess https://www.blaess.fr/christophe/, Stéphan Rafin <stephan.rafin@laposte.net>, Thierry Vignaud <tvignaud@mandriva.com>, François Micaux, Alain Portal <aportal@univ-montp2.fr>, Jean-Philippe Guérard <fevrier@tigreraye.org>, Jean-Luc Coulon (f5ibh) <jean-luc.coulon@wanadoo.fr>, Julien Cristau <jcristau@debian.org>, Thomas Huriaux <thomas.huriaux@gmail.com>, Nicolas François <nicolas.francois@centraliens.net>, Florentin Duneau <fduneau@gmail.com>, Simon Paillard <simon.paillard@resel.enst-bretagne.fr>, Denis Barbier <barbier@debian.org> et David Prévot <david@tilapin.org>

Cette traduction est une documentation libre ; veuillez vous reporter à la GNU General Public License version 3 concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE.

Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à debian-l10n-french@lists.debian.org.

17 novembre 2024 Pages du manuel de Linux 6.12