Ignore:
Timestamp:
Sep 24, 2007 7:46:41 PM (17 years ago)
Author:
bennylp
Message:

Ticket #382: Updated ICE from draft-ietf-mmusic-ice-14 to ice-18 specification, and also done some other tweaks as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/ip_helper_win32.c

    r1419 r1450  
    3535#include <pj/string.h> 
    3636 
     37#ifndef PJ_IP_HELPER_IGNORE_LOOPBACK_IF 
     38#   define PJ_IP_HELPER_IGNORE_LOOPBACK_IF      1 
     39#endif 
     40 
    3741typedef DWORD (WINAPI *PFN_GetIpAddrTable)(PMIB_IPADDRTABLE pIpAddrTable,  
    3842                                           PULONG pdwSize,  
     
    4145                                              PULONG pdwSize,  
    4246                                              BOOL bOrder); 
     47typedef DWORD (WINAPI *PFN_GetIfEntry)(PMIB_IFROW pIfRow); 
    4348 
    4449static HANDLE s_hDLL; 
    4550static PFN_GetIpAddrTable s_pfnGetIpAddrTable; 
    4651static PFN_GetIpForwardTable s_pfnGetIpForwardTable; 
     52static PFN_GetIfEntry s_pfnGetIfEntry; 
    4753 
    4854static void unload_iphlp_module(void) 
     
    8490    return ERROR_NOT_SUPPORTED; 
    8591} 
     92 
     93 
     94#if PJ_IP_HELPER_IGNORE_LOOPBACK_IF 
     95static DWORD MyGetIfEntry(MIB_IFROW *pIfRow) 
     96{ 
     97    if(NULL == s_pfnGetIfEntry) { 
     98        s_pfnGetIfEntry = (PFN_GetIfEntry)  
     99            GetIpHlpApiProc(PJ_T("GetIfEntry")); 
     100    } 
     101     
     102    if(NULL != s_pfnGetIfEntry) { 
     103        return s_pfnGetIfEntry(pIfRow); 
     104    } 
     105     
     106    return ERROR_NOT_SUPPORTED; 
     107} 
     108#endif 
    86109 
    87110 
     
    135158    *p_cnt = 0; 
    136159    for (i=0; i<count; ++i) { 
     160        MIB_IFROW ifRow; 
     161 
    137162        /* Some Windows returns 0.0.0.0! */ 
    138163        if (pTab->table[i].dwAddr == 0) 
    139164            continue; 
     165 
     166#if PJ_IP_HELPER_IGNORE_LOOPBACK_IF 
     167        /* Investigate the type of this interface */ 
     168        pj_bzero(&ifRow, sizeof(ifRow)); 
     169        ifRow.dwIndex = pTab->table[i].dwIndex; 
     170        if (MyGetIfEntry(&ifRow) != 0) 
     171            continue; 
     172 
     173        if (ifRow.dwType == MIB_IF_TYPE_LOOPBACK) 
     174            continue; 
     175#endif 
     176 
    140177        ifs[*p_cnt].s_addr = pTab->table[i].dwAddr; 
    141178        (*p_cnt)++; 
Note: See TracChangeset for help on using the changeset viewer.