freeaddrinfo()--Free Address Information


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

  void freeaddrinfo(struct addrinfo *ai);


  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: Yes

The freeaddrinfo() function frees one or more addrinfo structures returned by getaddrinfo(), along with any additional storage associated with those structures. If the ai_next field of the structure is not null, the entire list of structures is freed.


Parameters

ai
(Input) The pointer to a struct addrinfo that was returned by getaddrinfo().

The structure struct addrinfo is defined in <netdb.h>.

      struct addrinfo {
        int     ai_flags;     /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST, .. */
        int     ai_family;    /* PF_xxx */
        int     ai_socktype;  /* SOCK_xxx */
        int     ai_protocol;  /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
        socklen_t ai_addrlen; /* length of ai_addr */
        char   *ai_canonname; /* canonical name for nodename */
        struct sockaddr  *ai_addr; /* binary address */
        struct addrinfo  *ai_next; /* next structure in linked list */
      };

Authorities

No authorization is required.


Usage Notes

  1. The freeaddrinfo() API supports the freeing of arbitrary sublists of an addrinfo list originally returned by getaddrinfo().

Related Information




API introduced: V5R2

[ Back to top | UNIX-Type APIs | APIs by category ]