| getipnodebyname(3) | Library Functions Manual | getipnodebyname(3) |
getipnodebyname, getipnodebyaddr, freehostent - obtiene nombres y direcciones de host
Biblioteca Estándar C (libc, -lc)
#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);
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.
The getipnodebyname() function looks up network addresses for the host specified by the name argument. The af argument specifies one of the following values:
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.
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:
NULL is returned if an error occurred, and error_num will contain an error code from the following list:
Una consulta exitosa devuelve un puntero a una estructura hostent que contiene los siguientes campos:
None.
RFC 2553.
Present in glibc 2.1.91-95, but removed again. Several UNIX-like systems support them, but all call them deprecated.
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 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.
| 2 Mayo 2024 | Páginas de Manual de Linux 6.9.1 |