.\" -*- coding: UTF-8 -*- .\" Copyright 2000 Sam Varshavchik .\" .\" %%%LICENSE_START(VERBATIM) .\" 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. .\" %%%LICENSE_END .\" .\" References: RFC 2553 .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH GETIPNODEBYNAME 3 "15 Septiembre 2017" Linux "Manual del Programador de Linux" .SH NOMBRE getipnodebyname, getipnodebyaddr, freehostent \- obtiene nombres y direcciones de host .SH SINOPSIS .nf \fB#include \fP \fB#include \fP \fB#include \fP .PP \fBstruct hostent *getipnodebyname(const char *\fP\fIname\fP\fB, int \fP\fIaf\fP\fB,\fP \fB int \fP\fIflags\fP\fB, int *\fP\fIerror_num\fP\fB);\fP .PP \fBstruct hostent *getipnodebyaddr(const void *\fP\fIaddr\fP\fB, size_t \fP\fIlen\fP\fB,\fP \fB int \fP\fIaf\fP\fB, int *\fP\fIerror_num\fP\fB);\fP .PP \fBvoid freehostent(struct hostent *\fP\fIip\fP\fB);\fP .fi .SH DESCRIPCIÓN These functions are deprecated (and unavailable in glibc). Use \fBgetaddrinfo\fP(3) and \fBgetnameinfo\fP(3) instead. .PP Las funciones \fBgetipnodebyname\fP() y \fBgetipnodebyaddr\fP() devuelven los nombres y las direcciones de un host. Estas funciones devuelven un puntero a la siguiente estructura: .PP .in +4n .EX struct hostent { char *h_name; char **h_aliases; int h_addrtype; int h_length; char **h_addr_list; }; .EE .in .PP Estas funciones reemplazan a las funciones \fBgethostbyname\fP(3) y \fBgethostbyaddr\fP(3) , las cuales sólo podían manejar la familia de direcciones de red IPv4. Las funciones \fBgetipnodebyname\fP() y \fBgetipnodebyaddr\fP() pueden manejar múltiples familias de direcciones de red. .PP A diferencia de las funciones \fBgethostby\fP, estas funciones devuelven punteros a memoria reservada dinámicamente. La función \fBfreehostent\fP() se emplea para liberar la memoria dinámica asignada después de que el invocador deje de necesitar la estructura \fIhostent\fP. .SS "getipnodebyname() arguments" The \fBgetipnodebyname\fP() function looks up network addresses for the host specified by the \fIname\fP argument. The \fIaf\fP argument specifies one of the following values: .TP \fBAF_INET\fP The \fIname\fP argument points to a dotted\-quad IPv4 address or a name of an IPv4 network host. .TP \fBAF_INET6\fP The \fIname\fP argument points to a hexadecimal IPv6 address or a name of an IPv6 network host. .PP The \fIflags\fP argument specifies additional options. More than one option can be specified by bitwise OR\-ing them together. \fIflags\fP should be set to 0 if no options are desired. .TP \fBAI_V4MAPPED\fP Esta opción se usa con \fBAF_INET6\fP para solicitar una consulta de direcciones IPv4 en lugar de direcciones IPv6; las direcciones IPv4 serán convertidas a direcciones IPv6. .TP \fBAI_ALL\fP Esta opción se usa con \fBAI_V4MAPPED\fP para solicitar una consulta de direcciones IPv4 y IPv6. Cualquier dirección IPv4 encontrada se convertirá a una dirección IPv6. .TP \fBAI_ADDRCONFIG\fP Esta opción se usa con \fBAF_INET6\fP para solicitar que las consultas de direcciones IPv6 no se realicen a menos que el sistema tenga al menos una dirección IPv6 asignada a una interfaz de red, y que las consultas de direcciones IPv4 no se realicen a menos que el sistema tenga al menos una dirección IPv4 asignada a una interfaz de red. Esta opción puede usarse aislada o con la opción \fBAI_V4MAPPED.\fP .TP \fBAI_DEFAULT\fP Esta opción es equivalente a \fB(AI_ADDRCONFIG | AI_V4MAPPED)\fP. .SS "getipnodebyaddr() arguments" The \fBgetipnodebyaddr\fP() function looks up the name of the host whose network address is specified by the \fIaddr\fP argument. The \fIaf\fP argument specifies one of the following values: .TP \fBAF_INET\fP The \fIaddr\fP argument points to a \fIstruct in_addr\fP and \fIlen\fP must be set to \fIsizeof(struct in_addr)\fP. .TP \fBAF_INET6\fP The \fIaddr\fP argument points to a \fIstruct in6_addr\fP and \fIlen\fP must be set to \fIsizeof(struct in6_addr)\fP. .SH "VALOR DEVUELTO" NULL is returned if an error occurred, and \fIerror_num\fP will contain an error code from the following list: .TP \fBHOST_NOT_FOUND\fP No se encontró el nombre de host o la dirección de red. .TP \fBNO_ADDRESS\fP El servidor de nombres de dominio reconoció la dirección o nombre de red, pero no devolvió ninguna respuesta. Ésto puede suceder si el host tiene solamente direcciones IPv4 y se realiza una consulta de direcciones IPv6 solamente, o viceversa. .TP \fBNO_RECOVERY\fP El servidor de nombres de dominio devolvió una respuesta de fallo permanente. .TP \fBTRY_AGAIN\fP El servidor de nombres de dominio devolvió una respuesta de fallo temporal. Puede que tenga mejor suerte la próxima vez. .PP Una consulta exitosa devuelve un puntero a una estructura \fIhostent\fP que contiene los siguientes campos: .TP \fIh_name\fP Nombre oficial del host. .TP \fIh_aliases\fP Es un array de punteros a sinónimos no oficiales para el mismo host. Este array termina en un puntero null. .TP \fIh_addrtype\fP This is a copy of the \fIaf\fP argument to \fBgetipnodebyname\fP() or \fBgetipnodebyaddr\fP(). \fIh_addrtype\fP will always be \fBAF_INET\fP if the \fIaf\fP argument was \fBAF_INET\fP. \fIh_addrtype\fP will always be \fBAF_INET6\fP if the \fIaf\fP argument was \fBAF_INET6\fP. .TP \fIh_length\fP Este campo contendrá el valor \fIsizeof(struct in_addr)\fP si \fIh_addrtype\fP es \fBAF_INET\fP, y el valor \fIsizeof(struct in6_addr)\fP si \fIh_addrtype\fP es \fBAF_INET6\fP. .TP \fIh_addr_list\fP Es un array de uno o más punteros a estructuras de direcciones de red para el host. Este array termina en un puntero null. .SH "CONFORME A" .\" Not in POSIX.1-2001. RFC\ 2553. .SH NOTAS Estas funciones han estado presentes en glibc 2.1.91\-95, pero fueron eliminadas de nuevo. Muchos sistemas derivados de UNIX las soportan, pero todos las consideran obsoletas. .SH "VÉASE TAMBIÉN" \fBgetaddrinfo\fP(3), \fBgetnameinfo\fP(3), \fBinet_ntop\fP(3), \fBinet_pton\fP(3) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars . Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org>. .ME .