Changeset 62696 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Jul 29, 2016 2:50:18 PM (8 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h
r55192 r62696 623 623 AssertMsg(SLIST_EMPTY(&m->m_pkthdr.tags), ("doing fast free of mbuf with tags")); 624 624 625 uma_zfree_arg(zone_mbuf, m, (void *) MB_NOTAGS);625 uma_zfree_arg(zone_mbuf, m, (void *)(uintptr_t)MB_NOTAGS); 626 626 } 627 627 #endif -
trunk/src/VBox/Devices/Network/slirp/ip_icmpwin.c
r62692 r62696 71 71 * XXX: this is system-wide, but what about multiple NAT threads? 72 72 */ 73 static void *pfIcmpCallback;73 static PIO_APC_ROUTINE pfnIcmpCallback; 74 74 75 75 … … 77 77 icmpwin_init(PNATState pData) 78 78 { 79 if (pf IcmpCallback == NULL)79 if (pfnIcmpCallback == NULL) 80 80 { 81 81 OSVERSIONINFO osvi; … … 89 89 90 90 if (osvi.dwMajorVersion >= 6) 91 pf IcmpCallback = icmpwin_callback_apc;91 pfnIcmpCallback = icmpwin_callback_apc; 92 92 else 93 pf IcmpCallback =icmpwin_callback_old;93 pfnIcmpCallback = (PIO_APC_ROUTINE)icmpwin_callback_old; 94 94 } 95 95 … … 176 176 reqdata = pong->buf; 177 177 m_copydata(m, sizeof(struct ip) + sizeof(struct icmp_echo), 178 reqsize, reqdata);178 (int)reqsize, reqdata); 179 179 } 180 180 … … 189 189 190 190 status = IcmpSendEcho2(pData->icmp_socket.sh, NULL, 191 pfIcmpCallback, pong,191 (FARPROC)pfnIcmpCallback, pong, 192 192 dst, reqdata, (WORD)reqsize, &opts, 193 193 pong->buf, (DWORD)pong->bufsize, … … 250 250 if (pong != NULL) 251 251 icmpwin_callback(pong); 252 RT_NOREF2(iob, reserved); 252 253 } 253 254 … … 389 390 /* fill in ip (ip_output0() does the boilerplate for us) */ 390 391 ip->ip_tos = reply->Options.Tos; 391 ip->ip_len = sizeof(*ip) + sizeof(*icmp) + reqsize;392 ip->ip_len = sizeof(*ip) + sizeof(*icmp) + (int)reqsize; 392 393 ip->ip_off = 0; 393 394 ip->ip_ttl = reply->Options.Ttl; … … 402 403 icmp->icmp_echo_seq = pong->reqicmph.icmp_echo_seq; 403 404 404 m_append(pData, m, reqsize, reply->Data);405 m_append(pData, m, (int)reqsize, reply->Data); 405 406 406 407 icmp->icmp_cksum = in_cksum_skip(m, ip->ip_len, sizeof(*ip)); … … 485 486 486 487 ip->ip_tos = 0; 487 ip->ip_len = sizeof(*ip) + sizeof(*icmp) + reqsize;488 ip->ip_len = sizeof(*ip) + sizeof(*icmp) + (int)reqsize; 488 489 ip->ip_off = 0; 489 490 ip->ip_ttl = IPDEFTTL; … … 524 525 m = m_gethdr(pData, M_NOWAIT, MT_HEADER); 525 526 else 526 m = m_getjcl(pData, M_NOWAIT, MT_HEADER, M_PKTHDR, slirp_size(pData));527 m = m_getjcl(pData, M_NOWAIT, MT_HEADER, M_PKTHDR, (int)slirp_size(pData)); 527 528 528 529 if (m == NULL) … … 537 538 return m; 538 539 } 540 -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r62692 r62696 236 236 * Loging macros 237 237 */ 238 #if VBOX_WITH_DEBUG_NAT_SOCKETS238 #ifdef VBOX_WITH_DEBUG_NAT_SOCKETS 239 239 # if defined(RT_OS_WINDOWS) 240 240 # define DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset) \ … … 254 254 } while (0) 255 255 # endif /* !RT_OS_WINDOWS */ 256 #else /* !VBOX_WITH_DEBUG_NAT_SOCKETS */256 #else /* !VBOX_WITH_DEBUG_NAT_SOCKETS */ 257 257 # define DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset) do {} while (0) 258 258 #endif /* !VBOX_WITH_DEBUG_NAT_SOCKETS */ … … 341 341 WSAStartup(MAKEWORD(2, 0), &Data); 342 342 343 rc = RTLdrLoadSystem("Iphlpapi.dll", /* :fNoUnload */ true, &hLdrMod);343 rc = RTLdrLoadSystem("Iphlpapi.dll", true /*fNoUnload*/, &hLdrMod); 344 344 if (RT_SUCCESS(rc)) 345 345 { 346 rc = RTLdrGetSymbol(hLdrMod, "GetAdaptersAddresses", (void **)&pData->pf GetAdaptersAddresses);346 rc = RTLdrGetSymbol(hLdrMod, "GetAdaptersAddresses", (void **)&pData->pfnGetAdaptersAddresses); 347 347 if (RT_FAILURE(rc)) 348 348 LogRel(("NAT: Can't find GetAdapterAddresses in Iphlpapi.dll\n")); … … 411 411 #endif 412 412 flags |= pData->i32AliasMode; /* do transparent proxying */ 413 flags = LibAliasSetMode(pData->proxy_alias, flags, ~0 );413 flags = LibAliasSetMode(pData->proxy_alias, flags, ~0U); 414 414 proxy_addr.s_addr = RT_H2N_U32(RT_N2H_U32(pData->special_addr.s_addr) | CTL_ALIAS); 415 415 LibAliasSetAddress(pData->proxy_alias, proxy_addr); … … 1070 1070 /* should we ignore return value? */ 1071 1071 bool fRet = slirpConnectOrWrite(pData, so, true); 1072 LogFunc(("fRet:%RTbool\n", fRet)); 1072 LogFunc(("fRet:%RTbool\n", fRet)); NOREF(fRet); 1073 1073 if (slirpVerifyAndFreeSocket(pData, so)) 1074 1074 CONTINUE(tcp); … … 1380 1380 struct ethhdr *eh; 1381 1381 1382 m->m_len = cbBuf;1382 m->m_len = (int)cbBuf; Assert((size_t)m->m_len == cbBuf); 1383 1383 if (cbBuf < ETH_HLEN) 1384 1384 { … … 1431 1431 struct ethhdr *eh; 1432 1432 uint8_t *mbuf = NULL; 1433 size_t mlen = 0;1433 int mlen; 1434 1434 STAM_PROFILE_START(&pData->StatIF_encap, a); 1435 1435 LogFlowFunc(("ENTER: pData:%p, eth_proto:%RX16, m:%p, flags:%d\n", -
trunk/src/VBox/Devices/Network/slirp/slirp.h
r62692 r62696 178 178 # include <time.h> 179 179 #else 180 # ifndef HAVE_SYS_TIME_H 181 # define HAVE_SYS_TIME_H 0 182 # endif 180 183 # if HAVE_SYS_TIME_H 181 184 # include <sys/time.h> -
trunk/src/VBox/Devices/Network/slirp/slirp_dns.c
r62692 r62696 48 48 /* determine size of buffer */ 49 49 size = 0; 50 ret = pData->pf GetAdaptersAddresses(AF_INET, 0, NULL /* reserved */, pAdapterAddr, &size);50 ret = pData->pfnGetAdaptersAddresses(AF_INET, 0, NULL /* reserved */, pAdapterAddr, &size); 51 51 if (ret != ERROR_BUFFER_OVERFLOW) 52 52 { … … 66 66 return -1; 67 67 } 68 ret = pData->pf GetAdaptersAddresses(AF_INET, 0, NULL /* reserved */, pAdapterAddr, &size);68 ret = pData->pfnGetAdaptersAddresses(AF_INET, 0, NULL /* reserved */, pAdapterAddr, &size); 69 69 if (ret != ERROR_SUCCESS) 70 70 { -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r62511 r62696 144 144 int soMaxConn; 145 145 #ifdef RT_OS_WINDOWS 146 ULONG (WINAPI * pf GetAdaptersAddresses)(ULONG, ULONG, PVOID, PIP_ADAPTER_ADDRESSES, PULONG);146 ULONG (WINAPI * pfnGetAdaptersAddresses)(ULONG, ULONG, PVOID, PIP_ADAPTER_ADDRESSES, PULONG); 147 147 #endif 148 148 struct dns_list_head pDnsList;
Note:
See TracChangeset
for help on using the changeset viewer.