First page Back Continue Last page Overview Graphics
Historical Name-vs-Address Translation Functions (2)
Name to address
struct hostent *getipnodebyname(const char *name, int af, int flags,
int *error_num);
Address to name
struct hostent *getipnodebyaddr(const void *src, size_t len, int af,
int *error_num);
Pros
Support both IPv6/IPv4 in similar semantics of gethostby{name,addr}()
Searching options
- AI_DEFAULT to the flags for standard query
Numeric address, IPv4-mapped address
MT-Safe
- Free memory be freehostent()
Cons
No scopes
Uneasy to create socket
Not widely deployed, deprecated now
Notes: