File: inet_ntop.3

package info (click to toggle)
manpages-es 1.55-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,472 kB
  • ctags: 6
  • sloc: sh: 1,349; makefile: 63
file content (106 lines) | stat: -rw-r--r-- 3,170 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
.\" Copyright 2000 Sam Varshavchik <mrsam@courier-mta.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: RFC 2553
.\"
.\" Traducido por Miguel Pérez Ibars <mpi79470@alu.um.es> el 6-agosto-2004
.\"
.TH inet_ntop 3 "18 diciembre 2000" "Linux Man Page" "Manual del Programador de Linux"
.SH NOMBRE
inet_ntop \- Analiza estructuras de dirección de red
.SH SINOPSIS
.nf
.B #include <sys/types.h>
.B #include <sys/socket.h>
.B #include <arpa/inet.h>
.sp
.BI "const char *inet_ntop(int " "af" ", const void *" "src" ,
.BI "                      char *" "dst" ", size_t " "cnt" );
.SH DESCRIPCIÓN
Esta función convierte la estructura de dirección de red
.I src
en la familia de direcciones
.I af
en una cadena de caracteres, que es copiada a un buffer de caracteres
.IR dst ,
el cual tiene
.I cnt
bytes de longitud.
.PP
.BR inet_ntop (3)
extiende la función
.BR inet_ntoa (3)
para soportar múltiples familias de direcciones,
.BR inet_ntoa (3)
es considerada obsoleta en la actualidad en favor de
.BR inet_ntop (3).
Las siguientes familias de direcciones de red están actualmente soportadas:
.TP
.B AF_INET
.I src
apunta a una estructura
.I in_addr
(en orden de bytes de la red)
que es convertida a una dirección de red IPv4 
en el formato decimal con puntos, "\fIddd.ddd.ddd.ddd\fP".
El buffer
.I dst
debe tener al menos
.B INET_ADDRSTRLEN
bytes de longitud.
.TP
.B AF_INET6
.I src
apunta a una estructura 
.I struct in6_addr
(en orden de bytes de la red)
que es convertida a una representación de esta dirección 
en el formato de dirección de red IPv6 más apropiado para dicha dirección.
El buffer
.I dst
debe tener al menos
.B INET6_ADDRSTRLEN
bytes de longitud.
.SH "VALOR DEVUELTO"
.B inet_ntop
devuelve un puntero distinto de null a
.IR dst .
Se devuelve NULL cuando hubo un error, y se asigna a
.I errno
el valor
.B EAFNOSUPPORT
si
.I af
no contiene una familia de direcciones válida,
o el valor
.B ENOSPC
si la cadena con la dirección convertida sobrepasa el tamaño de
.IR dst
dado por el argumento
.I cnt.
.SH "VÉASE TAMBIÉN"
.BR inet_pton (3)
.SH FALLOS
.B AF_INET6
convierte
direcciones IPv4 traducidas a IPv6
a un formato IPv6.