Changeset 14194 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Nov 14, 2008 5:10:28 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r14189 r14194 89 89 /*for send event from guest*/ 90 90 HANDLE hSendEvent; 91 HANDLE hNetEvent; 91 92 #endif 92 93 /** Send buffer */ … … 193 194 LogRel(("NAT: link up\n")); 194 195 slirp_link_up(pThis->pNATState); 196 #ifdef VBOX_WITH_SIMPLEFIED_SLIRP_SYNC 197 # ifndef RT_OS_WINDOWS 198 int rc = RTFileWrite(pThis->PipeWrite, "2", 2, NULL); 199 AssertRC(rc); 200 # else 201 WSASetEvent(pThis->hNetEvent); 202 # endif 203 #endif 195 204 break; 196 205 … … 199 208 LogRel(("NAT: link down\n")); 200 209 slirp_link_down(pThis->pNATState); 210 #ifdef VBOX_WITH_SIMPLEFIED_SLIRP_SYNC 211 # ifndef RT_OS_WINDOWS 212 int rc = RTFileWrite(pThis->PipeWrite, "2", 2, NULL); 213 AssertRC(rc); 214 # else 215 WSASetEvent(pThis->hNetEvent); 216 # endif 217 #endif 201 218 break; 202 219 … … 325 342 * see WSAWaitForMultipleEvents documentation: return value is a minimal index in array 326 343 */ 327 if ((event - WSA_WAIT_EVENT_0) > 0)344 if ((event - WSA_WAIT_EVENT_0) >= VBOX_SEND_EVENT_INDEX) { 328 345 slirp_select_poll(pThis->pNATState, &ReadFDs, &WriteFDs, &XcptFDs); 329 346 330 if ((event - WSA_WAIT_EVENT_0) == 0)347 if ((event - WSA_WAIT_EVENT_0) == VBOX_SEND_EVENT_INDEX) 331 348 { 332 349 /** XXX distinguish between drvNATSend and wakeup only */ … … 335 352 RTSemEventSignal(pThis->semSndMutex); 336 353 } 354 if ((event - WSA_WAIT_EVENT_0) == VBOX_NET_EVENT_INDEX) { 355 WSAResetEvent(pThis->hNetEvent); 356 break; 357 } 337 358 # endif /* RT_OS_WINDOWS */ 338 359 } … … 355 376 int rc = RTFileWrite(pThis->PipeWrite, "2", 2, NULL); 356 377 AssertRC(rc); 378 # else 379 WSASetEvent(pThis->hNetEvent); 380 # endif 357 381 RTSemEventSignal(pThis->semSndMutex); 358 #endif359 382 return VINF_SUCCESS; 360 383 } … … 706 729 # else 707 730 pThis->hSendEvent = WSACreateEvent(); 708 slirp_register_external_event(pThis->pNATState, pThis->hSendEvent); 731 pThis->hNetEvent = WSACreateEvent(); 732 slirp_register_external_event(pThis->pNATState, pThis->hSendEvent, VBOX_SEND_EVENT_INDEX); 733 slirp_register_external_event(pThis->pNATState, pThis->hNetEvent, VBOX_NET_EVENT_INDEX); 709 734 # endif 710 735 -
trunk/src/VBox/Devices/Network/slirp/libslirp.h
r14130 r14194 50 50 51 51 #if defined(VBOX_WITH_SIMPLEFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 52 #define VBOX_NET_EVENT_INDEX 0 53 #define VBOX_SEND_EVENT_INDEX 1 54 #define VBOX_SOCKET_EVENT_INDEX 2 52 55 HANDLE *slirp_get_events(PNATState pData); 53 void slirp_register_external_event(PNATState pData, HANDLE hEvent );56 void slirp_register_external_event(PNATState pData, HANDLE hEvent, int index); 54 57 #endif 55 58 #ifdef __cplusplus -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r14188 r14194 935 935 return pData->phEvents; 936 936 } 937 void slirp_register_external_event(PNATState pData, HANDLE hEvent )938 { 939 pData->phEvents[ VBOX_SEND_EVENT_INDEX] = hEvent;940 } 941 #endif 937 void slirp_register_external_event(PNATState pData, HANDLE hEvent, int index) 938 { 939 pData->phEvents[index] = hEvent; 940 } 941 #endif -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r14186 r14194 117 117 struct socket *udp_last_so; 118 118 #if defined(VBOX_WITH_SIMPLEFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 119 #define VBOX_SEND_EVENT_INDEX 0120 #define VBOX_SOCKET_EVENT_INDEX 1121 119 #define VBOX_SOCKET_EVENT (pData->phEvents[VBOX_SOCKET_EVENT_INDEX]) 122 #define VBOX_EVENT_COUNT 2120 #define VBOX_EVENT_COUNT 3 123 121 HANDLE phEvents[VBOX_EVENT_COUNT]; 124 122 #endif
Note:
See TracChangeset
for help on using the changeset viewer.