1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
.\" This man page copyright 1998 by Andi Kleen. Subject to the GPL.
.\" This manpage copyright 1998 by Andi Kleen. Subject to the GPL.
.\" Based on the original comments from Alexey Kuznetsov
.\" $Id: netlink.3,v 1.1 1999/05/14 17:17:24 freitag Exp $
.\"
.\" Translated on Sun Jun 27 1999 by Juan Piernas <piernas@ditec.um.es>
.\"
.TH NETLINK 3 "14 mayo 1999" "Pgina man de Linux" "Manual del Programador de Linux"
.SH NOMBRE
netlink \- macros netlink
.SH SINOPSIS
.nf
.\" XXX what will glibc2.1 use here?
.B #include <asm/types.h>
.br
.B #include <linux/netlink.h>
.br
.BI "int NLMSG_ALIGN(size_t " len );
.br
.BI "int NLMSG_LENGTH(size_t " len );
.br
.BI "int NLMSG_SPACE(size_t " len );
.br
.BI "void *NLMSG_DATA(struct nlmsghdr *" nlh );
.br
.BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len );
.br
.BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len );
.br
.BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len );
.fi
.SH DESCRIPCIN
.I netlink.h
define varias macros estndares para acceder o crear un datagrama netlink.
En esencia son similares a las macros definidas en
.BR cmsg (3)
para los datos auxiliares. Se debera acceder al buffer pasado a y desde un
conector netlink usando nicamente estas macros.
.TP 0.8i
.TP
NLMSG_ALIGN
Redondea la longitud de un mensaje netlink hasta alinearlo adecuadamente.
.TP
NLMSG_LENGTH
Toma como argumento la longitud del contenido til y devuelve la longitud
alineada para almacenarlo en el campo
.B nlmsg_len
de
.IR nlmsghdr .
.TP
NLMSG_SPACE
Devuelve el nmero de bytes que ocupara un mensaje netlink con un contenido
til de la longitud pasada.
.TP
NLMSG_DATA
Devuelve un puntero al contenido til asociado con el
.I nlmsghdr
pasado.
.TP
.\" XXX this is bizarre, maybe the interface should be fixed.
NLMSG_NEXT
Obtiene el siguiente
.I nlmsghdr
en un mensaje multiparte. El invocador debe comprobar si el nlmsghdr actual
no tena activa la opcin NLMSG_DONE (esta funcin no devuelve NULL al
final). El parmetro longitud es un valor izquierdo (lvalue) que contiene la
longitud restante del buffer del mensaje. Esta macro lo decrementa en la
longitud de la cabecera del mensaje.
.TP
NLMSG_OK
Devuelve verdadero si el mensaje netlink no est truncado y es correcto para
se analizado.
.TP
NLMSG_PAYLOAD
Devuelve la longitud del contenido til asociado con
.IR nlmsghdr .
.SH NOTAS
Normalmente es mejor usar netlink a travs de
.B libnetlink
que mediante la interfaz de bajo nivel del ncleo.
.SH VASE TAMBIN
.BR netlink (7)
.PP
.BR ftp://ftp.inr.ac.ru/ip-routing/iproute2*
para libnetlink
|