File: ether_aton.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 (118 lines) | stat: -rw-r--r-- 4,332 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright 2002 Ian Redfern (redferni@logica.com)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" References consulted:
.\"     Linux libc source code
.\"     FreeBSD 4.4 man pages
.\"
.\" Minor additions, aeb, 2002-07-20
.\"
.\" Traducido por Miguel Pérez Ibars <mpi79470@alu.um.es> el 11-julio-2004
.\"
.TH ETHER_ATON 3  "20 julio 2002" "BSD" "Manual del Programador de Linux"
.SH NOMBRE
ether_aton, ether_ntoa, ether_ntohost, ether_hosttonn, ether_line, 
ether_ntoa_r, ether_aton_r \- rutinas de manipulación de direcciones Ethernet
.SH SINOPSIS
.nf
.B #include <netinet/ether.h>
.sp
.BI "char *"
.BI "ether_ntoa(const struct ether_addr *" addr );
.sp
.BI "struct ether_addr *"
.BI "ether_aton(const char *" asc );
.sp
.BI "int"
.BI "ether_ntohost(char *" hostname ", const struct ether_addr *" addr );
.sp
.BI "int"
.BI "ether_hostton(const char *" hostname ", struct ether_addr *" addr );
.sp
.BI "int"
.BI "ether_line(const char *" line ", struct ether_addr *" addr ,
.BI "    char *" hostname );
.sp
/* extensiones de GNU */
.br
.BI "char *"
.BI "ether_ntoa_r(const struct ether_addr *" addr ", char *" buf );
.sp
.BI "struct ether_addr *"
.BI "ether_aton_r(const char *" asc ", struct ether_addr *" addr );
.fi
.SH DESCRIPCIÓN
\fBether_aton()\fP convierte la dirección de host Ethernet de 48 bits \fIasc\fP
en la notación estándar de dígitos-hexadecimales-y-puntos a datos binarios
en el orden de bytes de la red y devuelve un puntero a éstos en un buffer
reservado estáticamente, que será sobreescrito por llamadas posteriores.
\fBether_aton\fP devuelve NULL si la dirección no es válida.
.PP
La función \fBether_ntoa()\fP convierte la dirección de host Ethernet
\fIaddr\fP dada en el orden de bytes de la red a una cadena en la notación
estándar de dígitos-hexadecimales-y-puntos, omitiendo los ceros del principio.
La cadena se devuelve en almacenamiento estático, que será sobreescrito
por llamadas posteriores.
.PP
La función \fBether_ntohost()\fP asocia una dirección Ethernet con su 
correspondiente nombre de host en
.B /etc/ethers
y devuelve un valor distinto de cero si no se encontró ninguna correspondencia.
.PP
La función \fBether_hostton()\fP asocia un nombre de host con su correspondiente
dirección Ethernet en
.B /etc/ethers
y devuelve un valor distinto de cero si no se encontró ninguna correspondencia.
.PP
La función \fBether_line()\fP analiza una línea con el formato de
.B /etc/ethers
(dirección ethernet seguida de espacios y seguida por el nombre
de host; '#' introduce un comentario) y devuelve un par
dirección - nombre de host, o un valor distinto de cero si no pudo ser analizada.
El buffer apuntado por
.I hostname
debe ser suficientemente grande, p.e., tener la misma longitud que
.IR line .
.PP
Las funciones \fBether_ntoa_r\fP y \fBether_aton_r\fP son versiones
reentrantes e hilo-seguro de \fBether_ntoa\fP y \fBether_aton\fP
respectivamente, y no usan buffers estáticos.
.PP
La estructura \fIether_addr\fP está definida en \fInet/ethernet.h\fP como:
.sp
.RS
.nf
.ta 8n 16n
struct ether_addr {
  u_int8_t ether_addr_octet[6];
}
.ta
.fi
.RE
.SH FALLOS
La implementación de glibc 2.2.5 de ether_line() no funciona correctamente.
.SH "CONFORME A"
BSD 4.3, SunOS
.SH "VÉASE TAMBIÉN"
.BR ethers (5)