lwres_getaddrinfo.html revision e3f6b4d2195b2fcd28f769452d460d1b35f1952a
199767f8919635c4928607450d9e0abb932109ceToomas Soome - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
199767f8919635c4928607450d9e0abb932109ceToomas Soome - Copyright (C) 2000, 2001 Internet Software Consortium.
199767f8919635c4928607450d9e0abb932109ceToomas Soome - Permission to use, copy, modify, and distribute this software for any
199767f8919635c4928607450d9e0abb932109ceToomas Soome - purpose with or without fee is hereby granted, provided that the above
199767f8919635c4928607450d9e0abb932109ceToomas Soome - copyright notice and this permission notice appear in all copies.
199767f8919635c4928607450d9e0abb932109ceToomas Soome - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
199767f8919635c4928607450d9e0abb932109ceToomas Soome - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
199767f8919635c4928607450d9e0abb932109ceToomas Soome - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
199767f8919635c4928607450d9e0abb932109ceToomas Soome - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
199767f8919635c4928607450d9e0abb932109ceToomas Soome - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
199767f8919635c4928607450d9e0abb932109ceToomas Soome - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
199767f8919635c4928607450d9e0abb932109ceToomas Soome - PERFORMANCE OF THIS SOFTWARE.
199767f8919635c4928607450d9e0abb932109ceToomas Soome>lwres_getaddrinfo</TITLE
199767f8919635c4928607450d9e0abb932109ceToomas SoomeNAME="GENERATOR"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCONTENT="Modular DocBook HTML Stylesheet Version 1.73
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCLASS="REFENTRY"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeBGCOLOR="#FFFFFF"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeTEXT="#000000"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLINK="#0000FF"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeVLINK="#840084"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeALINK="#0000FF"
199767f8919635c4928607450d9e0abb932109ceToomas Soome>lwres_getaddrinfo</A
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCLASS="REFNAMEDIV"
199767f8919635c4928607450d9e0abb932109ceToomas Soome>lwres_getaddrinfo, lwres_freeaddrinfo -- socket address structure to host and service name</DIV
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCLASS="REFSYNOPSISDIV"
199767f8919635c4928607450d9e0abb932109ceToomas Soome>Synopsis</H2
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCLASS="FUNCSYNOPSIS"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCLASS="FUNCSYNOPSISINFO"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCLASS="FUNCDEF"
199767f8919635c4928607450d9e0abb932109ceToomas Soomelwres_getaddrinfo</CODE
199767f8919635c4928607450d9e0abb932109ceToomas Soome>(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res);</CODE
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCLASS="FUNCDEF"
199767f8919635c4928607450d9e0abb932109ceToomas Soomelwres_freeaddrinfo</CODE
199767f8919635c4928607450d9e0abb932109ceToomas Soome>(struct addrinfo *ai);</CODE
199767f8919635c4928607450d9e0abb932109ceToomas Soome>If the operating system does not provide a
199767f8919635c4928607450d9e0abb932109ceToomas Soome>struct addrinfo</SPAN
199767f8919635c4928607450d9e0abb932109ceToomas Soomethe following structure is used:
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCLASS="PROGRAMLISTING"
199767f8919635c4928607450d9e0abb932109ceToomas Soome>struct addrinfo {
199767f8919635c4928607450d9e0abb932109ceToomas Soome int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
199767f8919635c4928607450d9e0abb932109ceToomas Soome int ai_family; /* PF_xxx */
199767f8919635c4928607450d9e0abb932109ceToomas Soome int ai_socktype; /* SOCK_xxx */
199767f8919635c4928607450d9e0abb932109ceToomas Soome int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
199767f8919635c4928607450d9e0abb932109ceToomas Soome size_t ai_addrlen; /* length of ai_addr */
199767f8919635c4928607450d9e0abb932109ceToomas Soome char *ai_canonname; /* canonical name for hostname */
199767f8919635c4928607450d9e0abb932109ceToomas Soome struct sockaddr *ai_addr; /* binary address */
199767f8919635c4928607450d9e0abb932109ceToomas Soome struct addrinfo *ai_next; /* next structure in linked list */
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCLASS="REFSECT1"
199767f8919635c4928607450d9e0abb932109ceToomas Soome>DESCRIPTION</H2
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCLASS="FUNCTION"
199767f8919635c4928607450d9e0abb932109ceToomas Soome>lwres_getaddrinfo()</TT
199767f8919635c4928607450d9e0abb932109ceToomas Soomeis used to get a list of IP addresses and port numbers for host
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCLASS="PARAMETER"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCLASS="PARAMETER"