.\" Copyright 2000 Sam Varshavchik .\" .\" 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 el 6-agosto-2004 .\" .TH inet_pton 3 "18 diciembre 2000" "Linux Man Page" "Manual del Programador de Linux" .SH NOMBRE inet_pton \- Crea una estructura de dirección de red .SH SINOPSIS .nf .B #include .B #include .B #include .sp .BI "int inet_pton(int " "af" ", const char *" "src" ", void *" "dst" ); .SH DESCRIPCIÓN Esta función convierte la cadena de caracteres .I src en una estructura de dirección de red de la familia .I af , y copia la estructura de dirección de red a .IR dst . .PP .BR inet_pton (3) extiende la función de .BR inet_addr (3) para soportar múltiples familias de direcciones, .BR inet_addr (3) está considerada obsoleta hoy en día en favor de .BR inet_pton (3). Las siguientes familias de direcciones están soportadas actualmente: .TP .B AF_INET .I src apunta a una cadena de caracteres que contiene una dirección de red IPv4 en el formato decimal con puntos, "\fIddd.ddd.ddd.ddd\fP". La dirección es convertida a una estructura .I in_addr y copiada a .IR dst, que debe tener .I sizeof(struct in_addr) bytes de longitud. .TP .B AF_INET6 .I src apunta a una cadena de caracters que contiene una dirección de red IPv6 en cualquier formato de dirección IPv6 permitido. La dirección es convertida a una estructura .I in6_addr y copiada a .IR dst, que debe tener .I sizeof(struct in6_addr) bytes de longitud. .PP Ciertos formatos hexadecimales y octales antiguos de direcciones .B AF_INET no están soportados por .IR inet_pton , que los rechaza. .SH "VALOR DEVUELTO" .B inet_pton devuelve un valor negativo y asigna a .I errno el valor .B EAFNOSUPPORT si .I af no contiene una familia de direcciones válida. Devuelve cero si .I src no contiene una cadena de caracteres que represente una dirección de red válida en la familia de direcciones especificada. Devuelve un valor positivo si la dirección de red fue convertida con éxito. .SH "VÉASE TAMBIÉN" .BR inet_ntop (3) .SH FALLOS .B AF_INET6 no reconoce direcciones IPv4. Se debe pasar una dirección IPv4 debidamente mapeada a IPv6 en .I src en su lugar.