oracular (3) getipnodebyname.3.gz

Provided by: manpages-es-dev_4.23.1-1_all bug

NOMBRE

       getipnodebyname, getipnodebyaddr, freehostent - obtiene nombres y direcciones de host

BIBLIOTECA

       Biblioteca Estándar C (libc, -lc)

SINOPSIS

       #include <sys/types.h>
       #include <sys/socket.h>
       #include <netdb.h>

       [[a extinguir]] struct hostent *getipnodebyname(const char *name, int af,
                                                   int flags, int *error_num);
       [[a extinguir]] struct hostent *getipnodebyaddr(const void addr[.len],
                                                   size_t len, int af,
                                                   int *error_num);
       [[a extinguir]] void freehostent(struct hostent *ip);

DESCRIPCIÓN

       Estas funciones están obsoletas y tampoco están disponibles en glibc. Use getaddrinfo(3) y getnameinfo(3)
       en su lugar.

       Las funciones getipnodebyname()  y getipnodebyaddr()  devuelven los nombres y las direcciones de un host.
       Estas funciones devuelven un puntero a la siguiente estructura:

           struct hostent {
               char  *h_name;
               char **h_aliases;
               int    h_addrtype;
               int    h_length;
               char **h_addr_list;
           };

       Estas funciones reemplazan a las funciones gethostbyname(3)  y gethostbyaddr(3)  , las cuales sólo podían
       manejar la familia de direcciones de red IPv4.   Las  funciones  getipnodebyname()   y  getipnodebyaddr()
       pueden manejar múltiples familias de direcciones de red.

       A  diferencia  de  las  funciones  gethostby,  estas  funciones  devuelven  punteros  a memoria reservada
       dinámicamente.  La función freehostent() se emplea para liberar la memoria dinámica asignada  después  de
       que el invocador deje de necesitar la estructura hostent.

   parámetros de getipnodebyname()
       The  getipnodebyname()   function looks up network addresses for the host specified by the name argument.
       The af argument specifies one of the following values:

       AF_INET
              The name argument points to a dotted-quad IPv4 address or a name of an IPv4 network host.

       AF_INET6
              The name argument points to a hexadecimal IPv6 address or a name of an IPv6 network host.

       The flags argument specifies additional options.  More than one option can be specified by bitwise OR-ing
       them together.  flags should be set to 0 if no options are desired.

       AI_V4MAPPED
              Esta  opción  se  usa  con  AF_INET6  para  solicitar una consulta de direcciones IPv4 en lugar de
              direcciones IPv6; las direcciones IPv4 serán convertidas a direcciones IPv6.

       AI_ALL Esta opción se usa con AI_V4MAPPED para  solicitar  una  consulta  de  direcciones  IPv4  y  IPv6.
              Cualquier dirección IPv4 encontrada se convertirá a una dirección IPv6.

       AI_ADDRCONFIG
              Esta  opción  se  usa  con  AF_INET6  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
              AI_V4MAPPED.

       AI_DEFAULT
              Esta opción es equivalente a (AI_ADDRCONFIG | AI_V4MAPPED).

   parámetros de getipnodebyaddr()
       The  getipnodebyaddr()   function looks up the name of the host whose network address is specified by the
       addr argument.  The af argument specifies one of the following values:

       AF_INET
              The addr argument points to a struct in_addr and len must be set to sizeof(struct in_addr).

       AF_INET6
              The addr argument points to a struct in6_addr and len must be set to sizeof(struct in6_addr).

VALOR DEVUELTO

       NULL is returned if an error occurred, and error_num will contain an error code from the following list:

       HOST_NOT_FOUND
              No se encontró el nombre de host o la dirección de red.

       NO_ADDRESS
              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.

       NO_RECOVERY
              El servidor de nombres de dominio devolvió una respuesta de fallo permanente.

       TRY_AGAIN
              El servidor de nombres de dominio devolvió una respuesta de fallo temporal.  Puede que tenga mejor
              suerte la próxima vez.

       Una consulta exitosa devuelve un puntero a una estructura hostent que contiene los siguientes campos:

       h_name Nombre oficial del host.

       h_aliases
              Es  un  array  de  punteros a sinónimos no oficiales para el mismo host.  Este array termina en un
              puntero null.

       h_addrtype
              This is a copy of the af argument to getipnodebyname()   or  getipnodebyaddr().   h_addrtype  will
              always  be  AF_INET  if the af argument was AF_INET.  h_addrtype will always be AF_INET6 if the af
              argument was AF_INET6.

       h_length
              Este campo contendrá el valor  sizeof(struct  in_addr)  si  h_addrtype  es  AF_INET,  y  el  valor
              sizeof(struct in6_addr) si h_addrtype es AF_INET6.

       h_addr_list
              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.

ESTÁNDARES

       None.

HISTORIAL

       RFC 2553.

       Present in glibc 2.1.91-95, but removed again.  Several UNIX-like systems support them, but all call them
       deprecated.

VÉASE TAMBIÉN

       getaddrinfo(3), getnameinfo(3), inet_ntop(3), inet_pton(3)

TRADUCCIÓN

       La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars <mpi79470@alu.um.es>
       y Marcos Fouces <marcos@debian.org>

       Esta  traducción  es   documentación   libre;   lea   la   GNU   General   Public   License   Version   3
       ⟨https://www.gnu.org/licenses/gpl-3.0.html⟩  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
       ⟨debian-l10n-spanish@lists.debian.org⟩.