File: netlink.3

package info (click to toggle)
manpages-es 1.55-9
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 7,468 kB
  • ctags: 6
  • sloc: sh: 1,629; makefile: 64
file content (85 lines) | stat: -rw-r--r-- 2,597 bytes parent folder | download | duplicates (4)
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
.\" 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.2 2005/02/21 15:12:12 pepin.jimenez Exp $
.\"
.\" Translated on Sun Jun 27 1999 by Juan Piernas <piernas@ditec.um.es>
.\"
.TH NETLINK 3 "14 mayo 1999" "Página man de Linux" "Manual del Programador de Linux"
.SH NOMBRE
netlink \- macros netlink
.SH SINOPSIS
.nf
.\" XXX what will glibc 2.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 DESCRIPCIÓN
.I netlink.h 
define varias macros estándares para acceder o crear un datagrama netlink.
En esencia son similares a las macros definidas en
.BR cmsg (3)
para los datos auxiliares. Se debería acceder al buffer pasado a y desde un
conector netlink usando únicamente estas macros.
.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 número de bytes que ocuparía 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 tenía activa la opción NLMSG_DONE (esta función no devuelve NULL al
final). El parámetro 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 OBSERVACIONES
Normalmente es mejor usar netlink a través de
.B libnetlink
que mediante la interfaz de bajo nivel del núcleo.

.SH VÉASE TAMBIÉN
.BR netlink (7)
.PP
and ftp://ftp.inr.ac.ru/ip-routing/iproute2* para libnetlink