.\" -*- coding: UTF-8 -*- .\" Copyright 2000 Sam Varshavchik .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" References: RFC 2553 .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH getipnodebyname 3 "30 Marzo 2023" "Páginas de manual de Linux 6.05.01" .SH NOMBRE getipnodebyname, getipnodebyaddr, freehostent \- obtiene nombres y direcciones de host .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP \fB#include \fP \fB#include \fP .PP \fB[[a extinguir]] struct 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 \fB[[a extinguir]] struct hostent *getipnodebyaddr(const void \fP\fIaddr\fP\fB[.\fP\fIlen\fP\fB],\fP \fB size_t \fP\fIlen\fP\fB, int \fP\fIaf\fP\fB,\fP \fB int *\fP\fIerror_num\fP\fB);\fP \fB[[a extinguir]] void freehostent(struct hostent *\fP\fIip\fP\fB);\fP .fi .SH DESCRIPCIÓN Estas funciones están obsoletas y tampoco están disponibles en glibc. Use \fBgetaddrinfo\fP(3) y \fBgetnameinfo\fP(3) en su lugar. .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 "parámetros de getipnodebyname()" 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 "parámetros de getipnodebyaddr()" 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 ESTÁNDARES None. .SH HISTORIAL .\" Not in POSIX.1-2001. RFC\ 2553. .PP Present in glibc 2.1.91\-95, but removed again. Several UNIX\-like systems support them, but all call them deprecated. .SH "VÉASE TAMBIÉN" \fBgetaddrinfo\fP(3), \fBgetnameinfo\fP(3), \fBinet_ntop\fP(3), \fBinet_pton\fP(3) .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars y Marcos Fouces . .PP 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. .PP 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 .