Changeset 3029
- Timestamp:
- Dec 8, 2009 4:53:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/ip_helper_win32.c
r3002 r3029 45 45 PULONG pdwSize, 46 46 BOOL bOrder); 47 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=048 47 typedef DWORD (WINAPI *PFN_GetAdapterAddresses)(ULONG Family, 49 48 ULONG Flags, … … 51 50 PIP_ADAPTER_ADDRESSES AdapterAddresses, 52 51 PULONG SizePointer); 53 #endif /* PJ_HAS_IPV6 */54 52 typedef DWORD (WINAPI *PFN_GetIpForwardTable)(PMIB_IPFORWARDTABLE pIpForwardTable, 55 53 PULONG pdwSize, … … 59 57 static HANDLE s_hDLL; 60 58 static PFN_GetIpAddrTable s_pfnGetIpAddrTable; 61 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 62 static PFN_GetAdapterAddresses s_pfnGetAdapterAddresses; 63 #endif /* PJ_HAS_IPV6 */ 59 static PFN_GetAdapterAddresses s_pfnGetAdapterAddresses; 64 60 static PFN_GetIpForwardTable s_pfnGetIpForwardTable; 65 61 static PFN_GetIfEntry s_pfnGetIfEntry; … … 73 69 s_pfnGetIpForwardTable = NULL; 74 70 s_pfnGetIfEntry = NULL; 75 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=076 71 s_pfnGetAdapterAddresses = NULL; 77 #endif78 72 } 79 73 … … 109 103 } 110 104 111 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0112 105 static DWORD MyGetAdapterAddresses(ULONG Family, 113 106 ULONG Flags, … … 118 111 if(NULL == s_pfnGetAdapterAddresses) { 119 112 s_pfnGetAdapterAddresses = (PFN_GetAdapterAddresses) 120 GetIpHlpApiProc("GetAdapter Addresses");113 GetIpHlpApiProc("GetAdaptersAddresses"); 121 114 } 122 115 … … 128 121 return ERROR_NOT_SUPPORTED; 129 122 } 130 #endif /* PJ_HAS_IPV6 */131 123 132 124 #if PJ_IP_HELPER_IGNORE_LOOPBACK_IF … … 231 223 * which works for both IPv4 and IPv6. 232 224 */ 233 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0234 225 static pj_status_t enum_ipv4_ipv6_interface(int af, 235 226 unsigned *p_cnt, 236 227 pj_sockaddr ifs[]) 237 228 { 238 pj_uint8_t buffer[1 024];229 pj_uint8_t buffer[1600]; 239 230 IP_ADAPTER_ADDRESSES *adapter = (IP_ADAPTER_ADDRESSES*)buffer; 240 231 ULONG size = sizeof(buffer); … … 252 243 } 253 244 245 *p_cnt = i; 254 246 return PJ_SUCCESS; 255 247 } 256 #endif257 248 258 249 … … 270 261 PJ_EAFNOTSUP); 271 262 272 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0273 263 status = enum_ipv4_ipv6_interface(af, p_cnt, ifs); 274 264 if (status != PJ_SUCCESS && (af==PJ_AF_INET || af==PJ_AF_UNSPEC)) 275 265 status = enum_ipv4_interface(p_cnt, ifs); 276 266 return status; 277 #else278 if (af==PJ_AF_INET6)279 return PJ_EIPV6NOTSUP;280 else if (af != PJ_AF_INET && af != PJ_AF_UNSPEC)281 return PJ_EAFNOTSUP;282 283 status = enum_ipv4_interface(p_cnt, ifs);284 return status;285 #endif286 267 } 287 268
Note: See TracChangeset
for help on using the changeset viewer.