From b6b613a4e59e2177a2e899dc4e21ab660c05de3d Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Thu, 14 Sep 2006 18:51:01 +0000 Subject: Fix the local IP address resolution issue in PJSIP, PJMEDIA, and PJSUA, by adding a new API pj_gethostip() to resolve the default local IP address of local host. This new function will work even when local hostname resolution is not set correctly, by detecting the default IP interface in the system. Also fix compile warnings in iLBC. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@721 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/include/pj/addr_resolv.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'pjlib/include/pj') diff --git a/pjlib/include/pj/addr_resolv.h b/pjlib/include/pj/addr_resolv.h index 3d75798c..45194b30 100644 --- a/pjlib/include/pj/addr_resolv.h +++ b/pjlib/include/pj/addr_resolv.h @@ -21,10 +21,10 @@ /** * @file addr_resolv.h - * @brief Address resolve (pj_gethostbyname()). + * @brief IP address resolution. */ -#include +#include PJ_BEGIN_DECL @@ -84,6 +84,17 @@ typedef struct pj_hostent PJ_DECL(pj_status_t) pj_gethostbyname(const pj_str_t *name, pj_hostent *he); +/** + * Resolve the primary IP address of local host. + * + * @param ip_addr On successful resolution, this will be filled up with + * the host IP address, in network byte order. + * + * @return PJ_SUCCESS on success, or the appropriate error code. + */ +PJ_DECL(pj_status_t) pj_gethostip(pj_in_addr *ip_addr); + + /** @} */ PJ_END_DECL -- cgit v1.2.3