From fe61446fbe7fecfa0946812215e42396da6e0b9b Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sun, 18 Nov 2007 14:53:47 +0000 Subject: Ticket #415: implement IPv6 support in PJLIB git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1585 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/include/pj/addr_resolv.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'pjlib/include/pj/addr_resolv.h') diff --git a/pjlib/include/pj/addr_resolv.h b/pjlib/include/pj/addr_resolv.h index 39645cb6..e69abcf8 100644 --- a/pjlib/include/pj/addr_resolv.h +++ b/pjlib/include/pj/addr_resolv.h @@ -73,6 +73,16 @@ typedef struct pj_hostent /** Shortcut to h_addr_list[0] */ #define h_addr h_addr_list[0] +/** + * This structure describes address information pj_getaddrinfo(). + */ +typedef struct pj_addrinfo +{ + char ai_canonname[PJ_MAX_HOSTNAME]; /**< Canonical name for host*/ + pj_sockaddr ai_addr; /**< Binary address. */ +} pj_addrinfo; + + /** * This function fills the structure of type pj_hostent for a given host name. * @@ -95,6 +105,27 @@ PJ_DECL(pj_status_t) pj_gethostbyname(const pj_str_t *name, pj_hostent *he); PJ_DECL(pj_status_t) pj_gethostip(pj_in_addr *ip_addr); +/** + * This function translates the name of a service location (for example, + * a host name) and returns a set of addresses and associated information + * to be used in creating a socket with which to address the specified + * service. + * + * @param name Descriptive name or an address string, such as host + * name. + * @param af The desired address family to query. + * @param count On input, it specifies the number of elements in + * \a ai array. On output, this will be set with the + * number of address informations found for the + * specified name. + * + * @return PJ_SUCCESS on success, or the appropriate error code. + */ +PJ_DECL(pj_status_t) pj_getaddrinfo(const pj_str_t *nodename, int af, + unsigned *count, pj_addrinfo ai[]); + + + /** @} */ PJ_END_DECL -- cgit v1.2.3