summaryrefslogtreecommitdiff
path: root/pjlib
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-09-24 19:46:41 +0000
committerBenny Prijono <bennylp@teluu.com>2007-09-24 19:46:41 +0000
commitc326f938bbf72127885ac09179912b8a2cbfb030 (patch)
tree3ed5b986b9ec57dc1a5c3614f68ea3fcfeee907d /pjlib
parent21f0a8aa71305095f9d7682c571ca56c1559ac6e (diff)
Ticket #382: Updated ICE from draft-ietf-mmusic-ice-14 to ice-18 specification, and also done some other tweaks as well
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1450 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r--pjlib/include/pj/doxygen.h2
-rw-r--r--pjlib/src/pj/ip_helper_win32.c37
2 files changed, 38 insertions, 1 deletions
diff --git a/pjlib/include/pj/doxygen.h b/pjlib/include/pj/doxygen.h
index fa09c40f..f65066f9 100644
--- a/pjlib/include/pj/doxygen.h
+++ b/pjlib/include/pj/doxygen.h
@@ -55,7 +55,7 @@
*
* @subsection doc_ver_subsec Version
*
- * This document corresponds to PJLIB version 0.5.10.
+ * This document corresponds to PJLIB version 0.7.0-trunk.
*
*
* @subsection find_samples_subsec How to Read This Document
diff --git a/pjlib/src/pj/ip_helper_win32.c b/pjlib/src/pj/ip_helper_win32.c
index 69ff16a2..1a937d72 100644
--- a/pjlib/src/pj/ip_helper_win32.c
+++ b/pjlib/src/pj/ip_helper_win32.c
@@ -34,16 +34,22 @@
#include <pj/errno.h>
#include <pj/string.h>
+#ifndef PJ_IP_HELPER_IGNORE_LOOPBACK_IF
+# define PJ_IP_HELPER_IGNORE_LOOPBACK_IF 1
+#endif
+
typedef DWORD (WINAPI *PFN_GetIpAddrTable)(PMIB_IPADDRTABLE pIpAddrTable,
PULONG pdwSize,
BOOL bOrder);
typedef DWORD (WINAPI *PFN_GetIpForwardTable)(PMIB_IPFORWARDTABLE pIpForwardTable,
PULONG pdwSize,
BOOL bOrder);
+typedef DWORD (WINAPI *PFN_GetIfEntry)(PMIB_IFROW pIfRow);
static HANDLE s_hDLL;
static PFN_GetIpAddrTable s_pfnGetIpAddrTable;
static PFN_GetIpForwardTable s_pfnGetIpForwardTable;
+static PFN_GetIfEntry s_pfnGetIfEntry;
static void unload_iphlp_module(void)
{
@@ -85,6 +91,23 @@ static DWORD MyGetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable,
}
+#if PJ_IP_HELPER_IGNORE_LOOPBACK_IF
+static DWORD MyGetIfEntry(MIB_IFROW *pIfRow)
+{
+ if(NULL == s_pfnGetIfEntry) {
+ s_pfnGetIfEntry = (PFN_GetIfEntry)
+ GetIpHlpApiProc(PJ_T("GetIfEntry"));
+ }
+
+ if(NULL != s_pfnGetIfEntry) {
+ return s_pfnGetIfEntry(pIfRow);
+ }
+
+ return ERROR_NOT_SUPPORTED;
+}
+#endif
+
+
static DWORD MyGetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable,
PULONG pdwSize,
BOOL bOrder)
@@ -134,9 +157,23 @@ PJ_DEF(pj_status_t) pj_enum_ip_interface(unsigned *p_cnt,
count = (pTab->dwNumEntries < *p_cnt) ? pTab->dwNumEntries : *p_cnt;
*p_cnt = 0;
for (i=0; i<count; ++i) {
+ MIB_IFROW ifRow;
+
/* Some Windows returns 0.0.0.0! */
if (pTab->table[i].dwAddr == 0)
continue;
+
+#if PJ_IP_HELPER_IGNORE_LOOPBACK_IF
+ /* Investigate the type of this interface */
+ pj_bzero(&ifRow, sizeof(ifRow));
+ ifRow.dwIndex = pTab->table[i].dwIndex;
+ if (MyGetIfEntry(&ifRow) != 0)
+ continue;
+
+ if (ifRow.dwType == MIB_IF_TYPE_LOOPBACK)
+ continue;
+#endif
+
ifs[*p_cnt].s_addr = pTab->table[i].dwAddr;
(*p_cnt)++;
}