First page Back Continue Last page Overview Graphics
getaddrinfo()
int getaddrinfo(const char *nodename, const char *servname,
const struct addrinfo *hints,
struct addrinfo **res);
struct addrinfo {
int ai_flags; /* flags */
int ai_family; /* protocol family PF_xxx */
int ai_socktype; /* socket type SOCK_xxx */
int ai_protocol; /* protocol type; IPPROTO_xxx in IP */
socklen_t ai_addrlen; /* length of socket address structure */
char *ai_canonname; /* canonical name of the node */
struct sockaddr *ai_addr; /* socket address structure */
struct addrinfo *ai_next; /* next address information in the list */
};
Protocol independent Name-to-address translation function
Search by node name, service name and searching options
Socket address structure instead of raw address structure
MT-Safe
Notes: