Share via


addrinfo

This structure is used by the getaddrinfo function to hold host address information.

struct addrinfo {
  int ai_flags;
  int ai_family;
  int ai_socktype;
  int ai_protocol;
  size_t ai_addrlen;
  char* ai_canonname;
  struct sockaddr* ai_addr;
  struct addrinfo* ai_next;
};

Members

  • ai_flags
    Flags that indicate options used in the getaddrinfo function. See AI_PASSIVE, AI_CANONNAME, and AI_NUMERICHOST.
  • ai_family
    Protocol family, such as PF_INET.
  • ai_socktype
    Socket type, such as SOCK_RAW, SOCK_STREAM, or SOCK_DGRAM.
  • ai_protocol
    Protocol, such as IPPROTO_TCP or IPPROTO_UDP. For protocols other than IPv4 and IPv6, set this valueto zero.
  • ai_addrlen
    Length of the ai_addr member.
  • ai_canonname
    Canonical name for the host.
  • ai_addr
    Pointer to a sockaddr structure.
  • ai_next
    Pointer to the next structure in a linked list. The last addrinfo structure of a linked list sets this value to NULL.

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Ws2tcpip.h.

See Also

getaddrinfo | sockaddr

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.