Changeset 50379 in vbox for trunk/include
- Timestamp:
- Feb 10, 2014 10:22:43 AM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 92134
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxNetSend.h
r50322 r50379 25 25 */ 26 26 27 #ifndef __VBoxNetSend_h__ 28 #define __VBoxNetSend_h__ 27 /** @todo move this to src/VBox/HostDrivers/darwin as a .cpp file. */ 28 #ifndef ___VBox_VBoxNetSend_h 29 #define ___VBox_VBoxNetSend_h 29 30 30 31 #if defined(RT_OS_DARWIN) 31 32 32 # include <iprt/err.h>33 # include <iprt/assert.h>34 # include <iprt/string.h>33 # include <iprt/err.h> 34 # include <iprt/assert.h> 35 # include <iprt/string.h> 35 36 36 # include <sys/socket.h>37 # include <net/kpi_interface.h>37 # include <sys/socket.h> 38 # include <net/kpi_interface.h> 38 39 RT_C_DECLS_BEGIN /* Buggy 10.4 headers, fixed in 10.5. */ 39 # include <sys/kpi_mbuf.h>40 # include <sys/kpi_mbuf.h> 40 41 RT_C_DECLS_END 41 # include <net/if.h>42 # include <net/if.h> 42 43 43 44 RT_C_DECLS_BEGIN 44 45 45 # if defined(IN_RING0)46 # if defined(IN_RING0) 46 47 47 48 /** 48 * Constructs and submits a dummy packet to ifnet_input(). This is a workaround 49 * for "stuck dock icon" issue. When the first packet goes through the interface 50 * DLIL grabs a reference to the thread that submits the packet and holds it 51 * until the interface is destroyed. By submitting this dummy we make DLIL grab 52 * the thread of a non-GUI process. 49 * Constructs and submits a dummy packet to ifnet_input(). 50 * 51 * This is a workaround for "stuck dock icon" issue. When the first packet goes 52 * through the interface DLIL grabs a reference to the thread that submits the 53 * packet and holds it until the interface is destroyed. By submitting this 54 * dummy we make DLIL grab the thread of a non-GUI process. 53 55 * 54 56 * Most of this function was copied from vboxNetFltDarwinMBufFromSG(). … … 58 60 * thread. We submit dummy as if it was coming from this interface. 59 61 */ 60 inline intVBoxNetSendDummy(ifnet_t pIfNet)62 DECLINLINE(int) VBoxNetSendDummy(ifnet_t pIfNet) 61 63 { 62 int rc = 0; 63 size_t cbTotal = 50; /* No Ethernet header */ 64 mbuf_how_t How = MBUF_WAITOK; 64 int rc = VINF_SUCCESS; 65 65 66 mbuf_t pPkt = NULL; 66 size_t cbTotal = 50; /* No Ethernet header */ 67 mbuf_how_t How = MBUF_WAITOK; 68 mbuf_t pPkt = NULL; 67 69 errno_t err = mbuf_allocpacket(How, cbTotal, NULL, &pPkt); 68 70 if (!err) … … 96 98 } 97 99 98 # endif /* IN_RING0 */100 # endif /* IN_RING0 */ 99 101 100 102 RT_C_DECLS_END … … 102 104 #endif /* RT_OS_DARWIN */ 103 105 104 #endif /* __VBoxNetSend_h__ */ 106 #endif /* !___VBox_VBoxNetSend_h */ 107
Note:
See TracChangeset
for help on using the changeset viewer.