Changeset 28706 in vbox
- Timestamp:
- Apr 25, 2010 3:10:30 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60578
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/intnet.h
r28666 r28706 39 39 RT_C_DECLS_BEGIN 40 40 41 42 /** Pointer to an internal network ring-0 instance. */43 typedef struct INTNET *PINTNET;44 41 45 42 /** … … 749 746 * The trunk connection type. 750 747 * 751 * Used by I NTNETR0Open and assoicated interfaces.748 * Used by IntNetR0Open and assoicated interfaces. 752 749 */ 753 750 typedef enum INTNETTRUNKTYPE … … 773 770 } INTNETTRUNKTYPE; 774 771 775 /** @name I NTNETR0Open flags.772 /** @name IntNetR0Open flags. 776 773 * @{ */ 777 774 /** Share the MAC address with the host when sending something to the wire via the trunk. … … 808 805 809 806 /** 810 * Request buffer for I NTNETR0OpenReq / VMMR0_DO_INTNET_OPEN.811 * @see I NTNETR0Open.807 * Request buffer for IntNetR0OpenReq / VMMR0_DO_INTNET_OPEN. 808 * @see IntNetR0Open. 812 809 */ 813 810 typedef struct INTNETOPENREQ … … 834 831 INTNETIFHANDLE hIf; 835 832 } INTNETOPENREQ; 836 /** Pointer to an I NTNETR0OpenReq / VMMR0_DO_INTNET_OPEN request buffer. */833 /** Pointer to an IntNetR0OpenReq / VMMR0_DO_INTNET_OPEN request buffer. */ 837 834 typedef INTNETOPENREQ *PINTNETOPENREQ; 838 835 839 INTNETR0DECL(int) I NTNETR0OpenReq(PINTNET pIntNet,PSUPDRVSESSION pSession, PINTNETOPENREQ pReq);840 841 842 /** 843 * Request buffer for I NTNETR0IfCloseReq / VMMR0_DO_INTNET_IF_CLOSE.844 * @see I NTNETR0IfClose.836 INTNETR0DECL(int) IntNetR0OpenReq(PSUPDRVSESSION pSession, PINTNETOPENREQ pReq); 837 838 839 /** 840 * Request buffer for IntNetR0IfCloseReq / VMMR0_DO_INTNET_IF_CLOSE. 841 * @see IntNetR0IfClose. 845 842 */ 846 843 typedef struct INTNETIFCLOSEREQ … … 854 851 INTNETIFHANDLE hIf; 855 852 } INTNETIFCLOSEREQ; 856 /** Pointer to an INTNETR0IfCloseReq / VMMR0_DO_INTNET_IF_CLOSE request buffer. */ 853 /** Pointer to an IntNetR0IfCloseReq / VMMR0_DO_INTNET_IF_CLOSE request 854 * buffer. */ 857 855 typedef INTNETIFCLOSEREQ *PINTNETIFCLOSEREQ; 858 856 859 INTNETR0DECL(int) INTNETR0IfCloseReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFCLOSEREQ pReq); 860 861 862 /** 863 * Request buffer for INTNETR0IfGetRing3BufferReq / VMMR0_DO_INTNET_IF_GET_RING3_BUFFER. 864 * @see INTNETR0IfGetRing3Buffer. 857 INTNETR0DECL(int) IntNetR0IfCloseReq(PSUPDRVSESSION pSession, PINTNETIFCLOSEREQ pReq); 858 859 860 /** 861 * Request buffer for IntNetR0IfGetRing3BufferReq / 862 * VMMR0_DO_INTNET_IF_GET_RING3_BUFFER. 863 * @see IntNetR0IfGetRing3Buffer. 865 864 */ 866 865 typedef struct INTNETIFGETRING3BUFFERREQ … … 876 875 R3PTRTYPE(PINTNETBUF) pRing3Buf; 877 876 } INTNETIFGETRING3BUFFERREQ; 878 /** Pointer to an INTNETR0IfGetRing3BufferReq / VMMR0_DO_INTNET_IF_GET_RING3_BUFFER request buffer. */ 877 /** Pointer to an IntNetR0IfGetRing3BufferReq / 878 * VMMR0_DO_INTNET_IF_GET_RING3_BUFFER request buffer. */ 879 879 typedef INTNETIFGETRING3BUFFERREQ *PINTNETIFGETRING3BUFFERREQ; 880 880 881 INTNETR0DECL(int) INTNETR0IfGetRing3BufferReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFGETRING3BUFFERREQ pReq); 882 883 884 /** 885 * Request buffer for INTNETR0IfSetPromiscuousModeReq / VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE. 886 * @see INTNETR0IfSetPromiscuousMode. 881 INTNETR0DECL(int) IntNetR0IfGetRing3BufferReq(PSUPDRVSESSION pSession, PINTNETIFGETRING3BUFFERREQ pReq); 882 883 884 /** 885 * Request buffer for IntNetR0IfSetPromiscuousModeReq / 886 * VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE. 887 * @see IntNetR0IfSetPromiscuousMode. 887 888 */ 888 889 typedef struct INTNETIFSETPROMISCUOUSMODEREQ … … 898 899 bool fPromiscuous; 899 900 } INTNETIFSETPROMISCUOUSMODEREQ; 900 /** Pointer to an INTNETR0IfSetPromiscuousModeReq / VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE request buffer. */ 901 /** Pointer to an IntNetR0IfSetPromiscuousModeReq / 902 * VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE request buffer. */ 901 903 typedef INTNETIFSETPROMISCUOUSMODEREQ *PINTNETIFSETPROMISCUOUSMODEREQ; 902 904 903 INTNETR0DECL(int) INTNETR0IfSetPromiscuousModeReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFSETPROMISCUOUSMODEREQ pReq); 904 905 906 /** 907 * Request buffer for INTNETR0IfSetMacAddressReq / VMMR0_DO_INTNET_IF_SET_MAC_ADDRESS. 908 * @see INTNETR0IfSetMacAddress. 905 INTNETR0DECL(int) IntNetR0IfSetPromiscuousModeReq(PSUPDRVSESSION pSession, PINTNETIFSETPROMISCUOUSMODEREQ pReq); 906 907 908 /** 909 * Request buffer for IntNetR0IfSetMacAddressReq / 910 * VMMR0_DO_INTNET_IF_SET_MAC_ADDRESS. 911 * @see IntNetR0IfSetMacAddress. 909 912 */ 910 913 typedef struct INTNETIFSETMACADDRESSREQ … … 920 923 RTMAC Mac; 921 924 } INTNETIFSETMACADDRESSREQ; 922 /** Pointer to an INTNETR0IfSetMacAddressReq / VMMR0_DO_INTNET_IF_SET_MAC_ADDRESS request buffer. */ 925 /** Pointer to an IntNetR0IfSetMacAddressReq / 926 * VMMR0_DO_INTNET_IF_SET_MAC_ADDRESS request buffer. */ 923 927 typedef INTNETIFSETMACADDRESSREQ *PINTNETIFSETMACADDRESSREQ; 924 928 925 INTNETR0DECL(int) I NTNETR0IfSetMacAddressReq(PINTNET pIntNet,PSUPDRVSESSION pSession, PINTNETIFSETMACADDRESSREQ pReq);926 927 928 /** 929 * Request buffer for I NTNETR0IfSetActiveReq / VMMR0_DO_INTNET_IF_SET_ACTIVE.930 * @see I NTNETR0IfSetActive.929 INTNETR0DECL(int) IntNetR0IfSetMacAddressReq(PSUPDRVSESSION pSession, PINTNETIFSETMACADDRESSREQ pReq); 930 931 932 /** 933 * Request buffer for IntNetR0IfSetActiveReq / VMMR0_DO_INTNET_IF_SET_ACTIVE. 934 * @see IntNetR0IfSetActive. 931 935 */ 932 936 typedef struct INTNETIFSETACTIVEREQ … … 942 946 bool fActive; 943 947 } INTNETIFSETACTIVEREQ; 944 /** Pointer to an INTNETR0IfSetActiveReq / VMMR0_DO_INTNET_IF_SET_ACTIVE request buffer. */ 948 /** Pointer to an IntNetR0IfSetActiveReq / VMMR0_DO_INTNET_IF_SET_ACTIVE 949 * request buffer. */ 945 950 typedef INTNETIFSETACTIVEREQ *PINTNETIFSETACTIVEREQ; 946 951 947 INTNETR0DECL(int) I NTNETR0IfSetActiveReq(PINTNET pIntNet,PSUPDRVSESSION pSession, PINTNETIFSETACTIVEREQ pReq);948 949 950 /** 951 * Request buffer for I NTNETR0IfSendReq / VMMR0_DO_INTNET_IF_SEND.952 * @see I NTNETR0IfSend.952 INTNETR0DECL(int) IntNetR0IfSetActiveReq(PSUPDRVSESSION pSession, PINTNETIFSETACTIVEREQ pReq); 953 954 955 /** 956 * Request buffer for IntNetR0IfSendReq / VMMR0_DO_INTNET_IF_SEND. 957 * @see IntNetR0IfSend. 953 958 */ 954 959 typedef struct INTNETIFSENDREQ … … 962 967 INTNETIFHANDLE hIf; 963 968 } INTNETIFSENDREQ; 964 /** Pointer to an I NTNETR0IfSend() argument package. */969 /** Pointer to an IntNetR0IfSend() argument package. */ 965 970 typedef INTNETIFSENDREQ *PINTNETIFSENDREQ; 966 971 967 INTNETR0DECL(int) I NTNETR0IfSendReq(PINTNET pIntNet,PSUPDRVSESSION pSession, PINTNETIFSENDREQ pReq);968 969 970 /** 971 * Request buffer for I NTNETR0IfWaitReq / VMMR0_DO_INTNET_IF_WAIT.972 * @see I NTNETR0IfWait.972 INTNETR0DECL(int) IntNetR0IfSendReq(PSUPDRVSESSION pSession, PINTNETIFSENDREQ pReq); 973 974 975 /** 976 * Request buffer for IntNetR0IfWaitReq / VMMR0_DO_INTNET_IF_WAIT. 977 * @see IntNetR0IfWait. 973 978 */ 974 979 typedef struct INTNETIFWAITREQ … … 984 989 uint32_t cMillies; 985 990 } INTNETIFWAITREQ; 986 /** Pointer to an I NTNETR0IfWaitReq / VMMR0_DO_INTNET_IF_WAIT request buffer. */991 /** Pointer to an IntNetR0IfWaitReq / VMMR0_DO_INTNET_IF_WAIT request buffer. */ 987 992 typedef INTNETIFWAITREQ *PINTNETIFWAITREQ; 988 993 989 INTNETR0DECL(int) I NTNETR0IfWaitReq(PINTNET pIntNet,PSUPDRVSESSION pSession, PINTNETIFWAITREQ pReq);994 INTNETR0DECL(int) IntNetR0IfWaitReq(PSUPDRVSESSION pSession, PINTNETIFWAITREQ pReq); 990 995 991 996 … … 995 1000 */ 996 1001 997 /** 998 * Create an instance of the Ring-0 internal networking service. 999 * 1000 * @returns VBox status code. 1001 * @param ppIntNet Where to store the instance pointer. 1002 */ 1003 INTNETR0DECL(int) INTNETR0Create(PINTNET *ppIntNet); 1004 1005 /** 1006 * Destroys an instance of the Ring-0 internal networking service. 1007 * 1008 * @param pIntNet Pointer to the instance data. 1009 */ 1010 INTNETR0DECL(void) INTNETR0Destroy(PINTNET pIntNet); 1011 1012 /** 1013 * Opens a network interface and connects it to the specified network. 1014 * 1015 * @returns VBox status code. 1016 * @param pIntNet The internal network instance. 1017 * @param pSession The session handle. 1018 * @param pszNetwork The network name. 1019 * @param enmTrunkType The trunk type. 1020 * @param pszTrunk The trunk name. Its meaning is specfic to the type. 1021 * @param fFlags Flags, see INTNET_OPEN_FLAGS_*. 1022 * @param fRestrictAccess Whether new participants should be subjected to access check or not. 1023 * @param cbSend The send buffer size. 1024 * @param cbRecv The receive buffer size. 1025 * @param phIf Where to store the handle to the network interface. 1026 */ 1027 INTNETR0DECL(int) INTNETR0Open(PINTNET pIntNet, PSUPDRVSESSION pSession, const char *pszNetwork, 1028 INTNETTRUNKTYPE enmTrunkType, const char *pszTrunk, uint32_t fFlags, 1029 unsigned cbSend, unsigned cbRecv, PINTNETIFHANDLE phIf); 1030 1031 /** 1032 * Close an interface. 1033 * 1034 * @returns VBox status code. 1035 * @param pIntNet The instance handle. 1036 * @param hIf The interface handle. 1037 * @param pSession The caller's session. 1038 */ 1039 INTNETR0DECL(int) INTNETR0IfClose(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession); 1040 1041 /** 1042 * Gets the ring-0 address of the current buffer. 1043 * 1044 * @returns VBox status code. 1045 * @param pIntNet The instance data. 1046 * @param hIf The interface handle. 1047 * @param pSession The caller's session. 1048 * @param ppRing0Buf Where to store the address of the ring-3 mapping. 1049 */ 1050 INTNETR0DECL(int) INTNETR0IfGetRing0Buffer(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PINTNETBUF *ppRing0Buf); 1051 1052 /** 1053 * Maps the default buffer into ring 3. 1054 * 1055 * @returns VBox status code. 1056 * @param pIntNet The instance data. 1057 * @param hIf The interface handle. 1058 * @param pSession The caller's session. 1059 * @param ppRing3Buf Where to store the address of the ring-3 mapping. 1060 */ 1061 INTNETR0DECL(int) INTNETR0IfGetRing3Buffer(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, R3PTRTYPE(PINTNETBUF) *ppRing3Buf); 1062 1063 /** 1064 * Sets the promiscuous mode property of an interface. 1065 * 1066 * @returns VBox status code. 1067 * @param pIntNet The instance handle. 1068 * @param hIf The interface handle. 1069 * @param pSession The caller's session. 1070 * @param fPromiscuous Set if the interface should be in promiscuous mode, clear if not. 1071 */ 1072 INTNETR0DECL(int) INTNETR0IfSetPromiscuousMode( PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fPromiscuous); 1073 INTNETR0DECL(int) INTNETR0IfSetMacAddress( PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PCRTMAC pMac); 1074 INTNETR0DECL(int) INTNETR0IfSetActive( PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fActive); 1075 1076 /** 1077 * Sends one or more frames. 1078 * 1079 * The function will first the frame which is passed as the optional 1080 * arguments pvFrame and cbFrame. These are optional since it also 1081 * possible to chain together one or more frames in the send buffer 1082 * which the function will process after considering it's arguments. 1083 * 1084 * @returns VBox status code. 1085 * @param pIntNet The instance data. 1086 * @param hIf The interface handle. 1087 * @param pSession The caller's session. 1088 */ 1089 INTNETR0DECL(int) INTNETR0IfSend(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession); 1090 1091 /** 1092 * Wait for the interface to get signaled. 1093 * The interface will be signaled when is put into the receive buffer. 1094 * 1095 * @returns VBox status code. 1096 * @param pIntNet The instance handle. 1097 * @param hIf The interface handle. 1098 * @param pSession The caller's session. 1099 * @param cMillies Number of milliseconds to wait. RT_INDEFINITE_WAIT should be 1100 * used if indefinite wait is desired. 1101 */ 1102 INTNETR0DECL(int) INTNETR0IfWait(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, uint32_t cMillies); 1002 INTNETR0DECL(int) IntNetR0Init(void); 1003 INTNETR0DECL(void) IntNetR0Term(void); 1004 INTNETR0DECL(int) IntNetR0Open(PSUPDRVSESSION pSession, const char *pszNetwork, 1005 INTNETTRUNKTYPE enmTrunkType, const char *pszTrunk, uint32_t fFlags, 1006 uint32_t cbSend, uint32_t cbRecv, PINTNETIFHANDLE phIf); 1007 INTNETR0DECL(uint32_t) IntNetR0GetNetworkCount(void); 1008 1009 INTNETR0DECL(int) IntNetR0IfClose( INTNETIFHANDLE hIf, PSUPDRVSESSION pSession); 1010 INTNETR0DECL(int) IntNetR0IfGetRing0Buffer( INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PINTNETBUF *ppRing0Buf); 1011 INTNETR0DECL(int) IntNetR0IfGetRing3Buffer( INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, R3PTRTYPE(PINTNETBUF) *ppRing3Buf); 1012 INTNETR0DECL(int) IntNetR0IfSetPromiscuousMode(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fPromiscuous); 1013 INTNETR0DECL(int) IntNetR0IfSetMacAddress( INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PCRTMAC pMac); 1014 INTNETR0DECL(int) IntNetR0IfSetActive( INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fActive); 1015 INTNETR0DECL(int) IntNetR0IfSend( INTNETIFHANDLE hIf, PSUPDRVSESSION pSession); 1016 INTNETR0DECL(int) IntNetR0IfWait( INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, uint32_t cMillies); 1103 1017 1104 1018 /** @} */ -
trunk/include/VBox/vmm.h
r28425 r28706 325 325 /** The start of the R0 service operations. */ 326 326 VMMR0_DO_SRV_START, 327 /** Call I NTNETR0Open(). */327 /** Call IntNetR0Open(). */ 328 328 VMMR0_DO_INTNET_OPEN, 329 /** Call I NTNETR0IfClose(). */329 /** Call IntNetR0IfClose(). */ 330 330 VMMR0_DO_INTNET_IF_CLOSE, 331 /** Call I NTNETR0IfGetRing3Buffer(). */331 /** Call IntNetR0IfGetRing3Buffer(). */ 332 332 VMMR0_DO_INTNET_IF_GET_RING3_BUFFER, 333 /** Call I NTNETR0IfSetPromiscuousMode(). */333 /** Call IntNetR0IfSetPromiscuousMode(). */ 334 334 VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE, 335 /** Call I NTNETR0IfSetMacAddress(). */335 /** Call IntNetR0IfSetMacAddress(). */ 336 336 VMMR0_DO_INTNET_IF_SET_MAC_ADDRESS, 337 /** Call I NTNETR0IfSetActive(). */337 /** Call IntNetR0IfSetActive(). */ 338 338 VMMR0_DO_INTNET_IF_SET_ACTIVE, 339 /** Call I NTNETR0IfSend(). */339 /** Call IntNetR0IfSend(). */ 340 340 VMMR0_DO_INTNET_IF_SEND, 341 /** Call I NTNETR0IfWait(). */341 /** Call IntNetR0IfWait(). */ 342 342 VMMR0_DO_INTNET_IF_WAIT, 343 343 /** The end of the R0 service operations. */ -
trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
r28701 r28706 385 385 typedef struct INTNET 386 386 { 387 /** Magic number (INTNET_MAGIC). */ 388 uint32_t volatile u32Magic; 387 389 /** Mutex protecting the creation, opening and destruction of both networks and 388 390 * interfaces. (This means all operations affecting the pNetworks list.) */ … … 393 395 RTHANDLETABLE hHtIfs; 394 396 } INTNET; 395 397 /** Pointer to an internal network ring-0 instance. */ 398 typedef struct INTNET *PINTNET; 399 400 /** Magic number for the internal network instance data (Hayao Miyazaki). */ 401 #define INTNET_MAGIC UINT32_C(0x19410105) 402 403 404 /******************************************************************************* 405 * Global Variables * 406 *******************************************************************************/ 407 /** Pointer to the internal network instance data. */ 408 static PINTNET volatile g_pIntNet = NULL; 396 409 397 410 … … 2553 2566 * Edit the source address so that it it's the same as the host. 2554 2567 */ 2555 /* ASSUME frame from I NTNETR0IfSend! */2568 /* ASSUME frame from IntNetR0IfSend! */ 2556 2569 AssertReturnVoid(pSG->cSegsUsed == 1); 2557 2570 AssertReturnVoid(pSG->cbTotal >= sizeof(RTNETETHERHDR)); … … 3227 3240 * 3228 3241 * @returns VBox status code. 3229 * @param pIntNet The instance data.3230 3242 * @param hIf The interface handle. 3231 3243 * @param pSession The caller's session. 3232 3244 */ 3233 INTNETR0DECL(int) I NTNETR0IfSend(PINTNET pIntNet,INTNETIFHANDLE hIf, PSUPDRVSESSION pSession)3234 { 3235 Log5(("I NTNETR0IfSend: pIntNet=%p hIf=%RX32\n", pIntNet, hIf));3245 INTNETR0DECL(int) IntNetR0IfSend(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession) 3246 { 3247 Log5(("IntNetR0IfSend: hIf=%RX32\n", hIf)); 3236 3248 3237 3249 /* 3238 3250 * Validate input and translate the handle. 3239 3251 */ 3240 AssertReturn(pIntNet, VERR_INVALID_PARAMETER); 3252 PINTNET pIntNet = g_pIntNet; 3253 AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER); 3254 AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC); 3255 3241 3256 PINTNETIF pIf = (PINTNETIF)RTHandleTableLookupWithCtx(pIntNet->hHtIfs, hIf, pSession); 3242 3257 if (!pIf) … … 3335 3350 3336 3351 /** 3337 * VMMR0 request wrapper for INTNETR0IfSend. 3338 * 3339 * @returns see INTNETR0IfSend. 3340 * @param pIntNet The internal networking instance. 3352 * VMMR0 request wrapper for IntNetR0IfSend. 3353 * 3354 * @returns see IntNetR0IfSend. 3341 3355 * @param pSession The caller's session. 3342 3356 * @param pReq The request packet. 3343 3357 */ 3344 INTNETR0DECL(int) I NTNETR0IfSendReq(PINTNET pIntNet,PSUPDRVSESSION pSession, PINTNETIFSENDREQ pReq)3358 INTNETR0DECL(int) IntNetR0IfSendReq(PSUPDRVSESSION pSession, PINTNETIFSENDREQ pReq) 3345 3359 { 3346 3360 if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq))) 3347 3361 return VERR_INVALID_PARAMETER; 3348 return I NTNETR0IfSend(pIntNet,pReq->hIf, pSession);3362 return IntNetR0IfSend(pReq->hIf, pSession); 3349 3363 } 3350 3364 … … 3354 3368 * 3355 3369 * @returns VBox status code. 3356 * @param pIntNet The instance data.3357 3370 * @param hIf The interface handle. 3358 3371 * @param pSession The caller's session. 3359 3372 * @param ppRing3Buf Where to store the address of the ring-3 mapping. 3360 3373 */ 3361 INTNETR0DECL(int) I NTNETR0IfGetRing3Buffer(PINTNET pIntNet,INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, R3PTRTYPE(PINTNETBUF) *ppRing3Buf)3362 { 3363 LogFlow(("I NTNETR0IfGetRing3Buffer: pIntNet=%p hIf=%RX32 ppRing3Buf=%p\n", pIntNet, hIf, ppRing3Buf));3374 INTNETR0DECL(int) IntNetR0IfGetRing3Buffer(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, R3PTRTYPE(PINTNETBUF) *ppRing3Buf) 3375 { 3376 LogFlow(("IntNetR0IfGetRing3Buffer: hIf=%RX32 ppRing3Buf=%p\n", hIf, ppRing3Buf)); 3364 3377 3365 3378 /* 3366 3379 * Validate input. 3367 3380 */ 3368 AssertReturn(pIntNet, VERR_INVALID_PARAMETER); 3381 PINTNET pIntNet = g_pIntNet; 3382 AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER); 3383 AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC); 3384 3369 3385 AssertPtrReturn(ppRing3Buf, VERR_INVALID_PARAMETER); 3370 3386 *ppRing3Buf = 0; … … 3387 3403 3388 3404 intnetR0IfRelease(pIf, pSession); 3389 LogFlow(("I NTNETR0IfGetRing3Buffer: returns %Rrc *ppRing3Buf=%p\n", rc, *ppRing3Buf));3405 LogFlow(("IntNetR0IfGetRing3Buffer: returns %Rrc *ppRing3Buf=%p\n", rc, *ppRing3Buf)); 3390 3406 return rc; 3391 3407 } … … 3393 3409 3394 3410 /** 3395 * VMMR0 request wrapper for INTNETR0IfGetRing3Buffer. 3396 * 3397 * @returns see INTNETR0IfGetRing3Buffer. 3398 * @param pIntNet The internal networking instance. 3411 * VMMR0 request wrapper for IntNetR0IfGetRing3Buffer. 3412 * 3413 * @returns see IntNetR0IfGetRing3Buffer. 3399 3414 * @param pSession The caller's session. 3400 3415 * @param pReq The request packet. 3401 3416 */ 3402 INTNETR0DECL(int) I NTNETR0IfGetRing3BufferReq(PINTNET pIntNet,PSUPDRVSESSION pSession, PINTNETIFGETRING3BUFFERREQ pReq)3417 INTNETR0DECL(int) IntNetR0IfGetRing3BufferReq(PSUPDRVSESSION pSession, PINTNETIFGETRING3BUFFERREQ pReq) 3403 3418 { 3404 3419 if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq))) 3405 3420 return VERR_INVALID_PARAMETER; 3406 return I NTNETR0IfGetRing3Buffer(pIntNet,pReq->hIf, pSession, &pReq->pRing3Buf);3421 return IntNetR0IfGetRing3Buffer(pReq->hIf, pSession, &pReq->pRing3Buf); 3407 3422 } 3408 3423 … … 3412 3427 * 3413 3428 * @returns VBox status code. 3414 * @param pIntNet The instance data.3415 3429 * @param hIf The interface handle. 3416 3430 * @param pSession The caller's session. 3417 3431 * @param ppRing0Buf Where to store the address of the ring-3 mapping. 3418 3432 */ 3419 INTNETR0DECL(int) I NTNETR0IfGetRing0Buffer(PINTNET pIntNet,INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PINTNETBUF *ppRing0Buf)3420 { 3421 LogFlow(("I NTNETR0IfGetRing0Buffer: pIntNet=%p hIf=%RX32 ppRing0Buf=%p\n", pIntNet, hIf, ppRing0Buf));3433 INTNETR0DECL(int) IntNetR0IfGetRing0Buffer(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PINTNETBUF *ppRing0Buf) 3434 { 3435 LogFlow(("IntNetR0IfGetRing0Buffer: hIf=%RX32 ppRing0Buf=%p\n", hIf, ppRing0Buf)); 3422 3436 3423 3437 /* 3424 3438 * Validate input. 3425 3439 */ 3440 PINTNET pIntNet = g_pIntNet; 3441 AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER); 3442 AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC); 3443 3426 3444 AssertPtrReturn(ppRing0Buf, VERR_INVALID_PARAMETER); 3427 3445 *ppRing0Buf = NULL; 3428 AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER);3429 3446 PINTNETIF pIf = (PINTNETIF)RTHandleTableLookupWithCtx(pIntNet->hHtIfs, hIf, pSession); 3430 3447 if (!pIf) … … 3443 3460 } 3444 3461 intnetR0IfRelease(pIf, pSession); 3445 LogFlow(("I NTNETR0IfGetRing0Buffer: returns %Rrc *ppRing0Buf=%p\n", rc, *ppRing0Buf));3462 LogFlow(("IntNetR0IfGetRing0Buffer: returns %Rrc *ppRing0Buf=%p\n", rc, *ppRing0Buf)); 3446 3463 return rc; 3447 3464 } … … 3453 3470 * 3454 3471 * @returns VBox status code. 3455 * @param pIntNet The instance data.3456 3472 * @param hIF The interface handle. 3457 3473 * @param paPages Where to store the addresses. (The reserved fields will be set to zero.) 3458 3474 * @param cPages 3459 3475 */ 3460 INTNETR0DECL(int) I NTNETR0IfGetPhysBuffer(PINTNET pIntNet,INTNETIFHANDLE hIf, PSUPPAGE paPages, unsigned cPages)3476 INTNETR0DECL(int) IntNetR0IfGetPhysBuffer(INTNETIFHANDLE hIf, PSUPPAGE paPages, unsigned cPages) 3461 3477 { 3462 3478 /* 3463 3479 * Validate input. 3464 3480 */ 3465 AssertReturn(pIntNet, VERR_INVALID_PARAMETER); 3481 PINTNET pIntNet = g_pIntNet; 3482 AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER); 3483 AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC); 3484 3466 3485 AssertPtrReturn(paPages, VERR_INVALID_PARAMETER); 3467 3486 AssertPtrReturn((uint8_t *)&paPages[cPages] - 1, VERR_INVALID_PARAMETER); … … 3492 3511 * 3493 3512 * @returns VBox status code. 3494 * @param pIntNet The instance handle.3495 3513 * @param hIf The interface handle. 3496 3514 * @param pSession The caller's session. 3497 3515 * @param fPromiscuous Set if the interface should be in promiscuous mode, clear if not. 3498 3516 */ 3499 INTNETR0DECL(int) I NTNETR0IfSetPromiscuousMode(PINTNET pIntNet,INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fPromiscuous)3500 { 3501 LogFlow(("I NTNETR0IfSetPromiscuousMode: pIntNet=%p hIf=%RX32 fPromiscuous=%d\n", pIntNet, hIf, fPromiscuous));3517 INTNETR0DECL(int) IntNetR0IfSetPromiscuousMode(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fPromiscuous) 3518 { 3519 LogFlow(("IntNetR0IfSetPromiscuousMode: hIf=%RX32 fPromiscuous=%d\n", hIf, fPromiscuous)); 3502 3520 3503 3521 /* 3504 3522 * Validate & translate input. 3505 3523 */ 3506 AssertReturn(pIntNet, VERR_INVALID_PARAMETER); 3524 PINTNET pIntNet = g_pIntNet; 3525 AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER); 3526 AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC); 3527 3507 3528 PINTNETIF pIf = (PINTNETIF)RTHandleTableLookupWithCtx(pIntNet->hHtIfs, hIf, pSession); 3508 3529 if (!pIf) 3509 3530 { 3510 Log(("I NTNETR0IfSetPromiscuousMode: returns VERR_INVALID_HANDLE\n"));3531 Log(("IntNetR0IfSetPromiscuousMode: returns VERR_INVALID_HANDLE\n")); 3511 3532 return VERR_INVALID_HANDLE; 3512 3533 } … … 3526 3547 if (pIf->fPromiscuous != fPromiscuous) 3527 3548 { 3528 Log(("I NTNETR0IfSetPromiscuousMode: hIf=%RX32: Changed from %d -> %d\n",3549 Log(("IntNetR0IfSetPromiscuousMode: hIf=%RX32: Changed from %d -> %d\n", 3529 3550 hIf, !fPromiscuous, !!fPromiscuous)); 3530 3551 ASMAtomicUoWriteBool(&pIf->fPromiscuous, fPromiscuous); … … 3548 3569 3549 3570 /** 3550 * VMMR0 request wrapper for INTNETR0IfSetPromiscuousMode. 3551 * 3552 * @returns see INTNETR0IfSetPromiscuousMode. 3553 * @param pIntNet The internal networking instance. 3571 * VMMR0 request wrapper for IntNetR0IfSetPromiscuousMode. 3572 * 3573 * @returns see IntNetR0IfSetPromiscuousMode. 3554 3574 * @param pSession The caller's session. 3555 3575 * @param pReq The request packet. 3556 3576 */ 3557 INTNETR0DECL(int) I NTNETR0IfSetPromiscuousModeReq(PINTNET pIntNet,PSUPDRVSESSION pSession, PINTNETIFSETPROMISCUOUSMODEREQ pReq)3577 INTNETR0DECL(int) IntNetR0IfSetPromiscuousModeReq(PSUPDRVSESSION pSession, PINTNETIFSETPROMISCUOUSMODEREQ pReq) 3558 3578 { 3559 3579 if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq))) 3560 3580 return VERR_INVALID_PARAMETER; 3561 return I NTNETR0IfSetPromiscuousMode(pIntNet,pReq->hIf, pSession, pReq->fPromiscuous);3581 return IntNetR0IfSetPromiscuousMode(pReq->hIf, pSession, pReq->fPromiscuous); 3562 3582 } 3563 3583 … … 3567 3587 * 3568 3588 * @returns VBox status code. 3569 * @param pIntNet The instance handle.3570 3589 * @param hIf The interface handle. 3571 3590 * @param pSession The caller's session. 3572 3591 * @param pMAC The new MAC address. 3573 3592 */ 3574 INTNETR0DECL(int) I NTNETR0IfSetMacAddress(PINTNET pIntNet,INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PCRTMAC pMac)3575 { 3576 LogFlow(("I NTNETR0IfSetMacAddress: pIntNet=%p hIf=%RX32 pMac=%p:{%.6Rhxs}\n", pIntNet, hIf, pMac, pMac));3593 INTNETR0DECL(int) IntNetR0IfSetMacAddress(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PCRTMAC pMac) 3594 { 3595 LogFlow(("IntNetR0IfSetMacAddress: hIf=%RX32 pMac=%p:{%.6Rhxs}\n", hIf, pMac, pMac)); 3577 3596 3578 3597 /* 3579 3598 * Validate & translate input. 3580 3599 */ 3600 PINTNET pIntNet = g_pIntNet; 3581 3601 AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER); 3602 AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC); 3603 3582 3604 AssertPtrReturn(pMac, VERR_INVALID_PARAMETER); 3583 3605 PINTNETIF pIf = (PINTNETIF)RTHandleTableLookupWithCtx(pIntNet->hHtIfs, hIf, pSession); 3584 3606 if (!pIf) 3585 3607 { 3586 Log(("I NTNETR0IfSetMacAddress: returns VERR_INVALID_HANDLE\n"));3608 Log(("IntNetR0IfSetMacAddress: returns VERR_INVALID_HANDLE\n")); 3587 3609 return VERR_INVALID_HANDLE; 3588 3610 } … … 3602 3624 if (memcmp(&pIf->MacAddr, pMac, sizeof(pIf->MacAddr))) 3603 3625 { 3604 Log(("I NTNETR0IfSetMacAddress: hIf=%RX32: Changed from %.6Rhxs -> %.6Rhxs\n",3626 Log(("IntNetR0IfSetMacAddress: hIf=%RX32: Changed from %.6Rhxs -> %.6Rhxs\n", 3605 3627 hIf, &pIf->MacAddr, pMac)); 3606 3628 … … 3624 3646 3625 3647 /** 3626 * VMMR0 request wrapper for INTNETR0IfSetMacAddress. 3627 * 3628 * @returns see INTNETR0IfSetMacAddress. 3629 * @param pIntNet The internal networking instance. 3648 * VMMR0 request wrapper for IntNetR0IfSetMacAddress. 3649 * 3650 * @returns see IntNetR0IfSetMacAddress. 3630 3651 * @param pSession The caller's session. 3631 3652 * @param pReq The request packet. 3632 3653 */ 3633 INTNETR0DECL(int) I NTNETR0IfSetMacAddressReq(PINTNET pIntNet,PSUPDRVSESSION pSession, PINTNETIFSETMACADDRESSREQ pReq)3654 INTNETR0DECL(int) IntNetR0IfSetMacAddressReq(PSUPDRVSESSION pSession, PINTNETIFSETMACADDRESSREQ pReq) 3634 3655 { 3635 3656 if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq))) 3636 3657 return VERR_INVALID_PARAMETER; 3637 return I NTNETR0IfSetMacAddress(pIntNet,pReq->hIf, pSession, &pReq->Mac);3658 return IntNetR0IfSetMacAddress(pReq->hIf, pSession, &pReq->Mac); 3638 3659 } 3639 3660 … … 3716 3737 * 3717 3738 * @returns VBox status code. 3718 * @param pIntNet The instance handle.3719 3739 * @param hIf The interface handle. 3720 3740 * @param pSession The caller's session. 3721 3741 * @param fActive The new state. 3722 3742 */ 3723 INTNETR0DECL(int) I NTNETR0IfSetActive(PINTNET pIntNet,INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fActive)3724 { 3725 LogFlow(("I NTNETR0IfSetActive: pIntNet=%p hIf=%RX32 fActive=%RTbool\n", pIntNet, hIf, fActive));3743 INTNETR0DECL(int) IntNetR0IfSetActive(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fActive) 3744 { 3745 LogFlow(("IntNetR0IfSetActive: hIf=%RX32 fActive=%RTbool\n", hIf, fActive)); 3726 3746 3727 3747 /* 3728 3748 * Validate & translate input. 3729 3749 */ 3750 PINTNET pIntNet = g_pIntNet; 3730 3751 AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER); 3752 AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC); 3753 3731 3754 PINTNETIF pIf = (PINTNETIF)RTHandleTableLookupWithCtx(pIntNet->hHtIfs, hIf, pSession); 3732 3755 if (!pIf) 3733 3756 { 3734 Log(("I NTNETR0IfSetActive: returns VERR_INVALID_HANDLE\n"));3757 Log(("IntNetR0IfSetActive: returns VERR_INVALID_HANDLE\n")); 3735 3758 return VERR_INVALID_HANDLE; 3736 3759 } … … 3759 3782 3760 3783 /** 3761 * VMMR0 request wrapper for I NTNETR0IfSetActive.3762 * 3763 * @returns see I NTNETR0IfSetActive.3784 * VMMR0 request wrapper for IntNetR0IfSetActive. 3785 * 3786 * @returns see IntNetR0IfSetActive. 3764 3787 * @param pIntNet The internal networking instance. 3765 3788 * @param pSession The caller's session. 3766 3789 * @param pReq The request packet. 3767 3790 */ 3768 INTNETR0DECL(int) I NTNETR0IfSetActiveReq(PINTNET pIntNet,PSUPDRVSESSION pSession, PINTNETIFSETACTIVEREQ pReq)3791 INTNETR0DECL(int) IntNetR0IfSetActiveReq(PSUPDRVSESSION pSession, PINTNETIFSETACTIVEREQ pReq) 3769 3792 { 3770 3793 if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq))) 3771 3794 return VERR_INVALID_PARAMETER; 3772 return I NTNETR0IfSetActive(pIntNet,pReq->hIf, pSession, pReq->fActive);3795 return IntNetR0IfSetActive(pReq->hIf, pSession, pReq->fActive); 3773 3796 } 3774 3797 … … 3779 3802 * 3780 3803 * @returns VBox status code. 3781 * @param pIntNet The instance handle.3782 3804 * @param hIf The interface handle. 3783 3805 * @param pSession The caller's session. … … 3785 3807 * used if indefinite wait is desired. 3786 3808 */ 3787 INTNETR0DECL(int) I NTNETR0IfWait(PINTNET pIntNet,INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, uint32_t cMillies)3788 { 3789 Log4(("I NTNETR0IfWait: pIntNet=%p hIf=%RX32 cMillies=%u\n", pIntNet, hIf, cMillies));3809 INTNETR0DECL(int) IntNetR0IfWait(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, uint32_t cMillies) 3810 { 3811 Log4(("IntNetR0IfWait: hIf=%RX32 cMillies=%u\n", hIf, cMillies)); 3790 3812 3791 3813 /* 3792 3814 * Get and validate essential handles. 3793 3815 */ 3816 PINTNET pIntNet = g_pIntNet; 3794 3817 AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER); 3818 AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC); 3819 3795 3820 PINTNETIF pIf = (PINTNETIF)RTHandleTableLookupWithCtx(pIntNet->hHtIfs, hIf, pSession); 3796 3821 if (!pIf) 3797 3822 { 3798 Log(("I NTNETR0IfWait: returns VERR_INVALID_HANDLE\n"));3823 Log(("IntNetR0IfWait: returns VERR_INVALID_HANDLE\n")); 3799 3824 return VERR_INVALID_HANDLE; 3800 3825 } … … 3804 3829 && hRecvEvent != NIL_RTSEMEVENT) 3805 3830 { 3806 Log(("I NTNETR0IfWait: returns VERR_SEM_DESTROYED\n"));3831 Log(("IntNetR0IfWait: returns VERR_SEM_DESTROYED\n")); 3807 3832 return VERR_SEM_DESTROYED; 3808 3833 } … … 3836 3861 else 3837 3862 rc = VERR_SEM_DESTROYED; 3838 Log4(("I NTNETR0IfWait: returns %Rrc\n", rc));3863 Log4(("IntNetR0IfWait: returns %Rrc\n", rc)); 3839 3864 return rc; 3840 3865 } … … 3842 3867 3843 3868 /** 3844 * VMMR0 request wrapper for INTNETR0IfWait. 3845 * 3846 * @returns see INTNETR0IfWait. 3847 * @param pIntNet The internal networking instance. 3869 * VMMR0 request wrapper for IntNetR0IfWait. 3870 * 3871 * @returns see IntNetR0IfWait. 3848 3872 * @param pSession The caller's session. 3849 3873 * @param pReq The request packet. 3850 3874 */ 3851 INTNETR0DECL(int) I NTNETR0IfWaitReq(PINTNET pIntNet,PSUPDRVSESSION pSession, PINTNETIFWAITREQ pReq)3875 INTNETR0DECL(int) IntNetR0IfWaitReq(PSUPDRVSESSION pSession, PINTNETIFWAITREQ pReq) 3852 3876 { 3853 3877 if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq))) 3854 3878 return VERR_INVALID_PARAMETER; 3855 return I NTNETR0IfWait(pIntNet,pReq->hIf, pSession, pReq->cMillies);3879 return IntNetR0IfWait(pReq->hIf, pSession, pReq->cMillies); 3856 3880 } 3857 3881 … … 3865 3889 * @param pSession The caller's session. 3866 3890 */ 3867 INTNETR0DECL(int) I NTNETR0IfClose(PINTNET pIntNet,INTNETIFHANDLE hIf, PSUPDRVSESSION pSession)3868 { 3869 LogFlow(("I NTNETR0IfClose: pIntNet=%p hIf=%RX32\n", pIntNet, hIf));3891 INTNETR0DECL(int) IntNetR0IfClose(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession) 3892 { 3893 LogFlow(("IntNetR0IfClose: hIf=%RX32\n", hIf)); 3870 3894 3871 3895 /* 3872 3896 * Validate and free the handle. 3873 3897 */ 3898 PINTNET pIntNet = g_pIntNet; 3874 3899 AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER); 3900 AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC); 3901 3875 3902 PINTNETIF pIf = (PINTNETIF)RTHandleTableFreeWithCtx(pIntNet->hHtIfs, hIf, pSession); 3876 3903 if (!pIf) … … 3897 3924 3898 3925 int rc = SUPR0ObjRelease(pvObj, pSession); 3899 LogFlow(("I NTNETR0IfClose: returns %Rrc\n", rc));3926 LogFlow(("IntNetR0IfClose: returns %Rrc\n", rc)); 3900 3927 return rc; 3901 3928 } … … 3903 3930 3904 3931 /** 3905 * VMMR0 request wrapper for INTNETR0IfCloseReq. 3906 * 3907 * @returns see INTNETR0IfClose. 3908 * @param pIntNet The internal networking instance. 3932 * VMMR0 request wrapper for IntNetR0IfCloseReq. 3933 * 3934 * @returns see IntNetR0IfClose. 3909 3935 * @param pSession The caller's session. 3910 3936 * @param pReq The request packet. 3911 3937 */ 3912 INTNETR0DECL(int) I NTNETR0IfCloseReq(PINTNET pIntNet,PSUPDRVSESSION pSession, PINTNETIFCLOSEREQ pReq)3938 INTNETR0DECL(int) IntNetR0IfCloseReq(PSUPDRVSESSION pSession, PINTNETIFCLOSEREQ pReq) 3913 3939 { 3914 3940 if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq))) 3915 3941 return VERR_INVALID_PARAMETER; 3916 return I NTNETR0IfClose(pIntNet,pReq->hIf, pSession);3942 return IntNetR0IfClose(pReq->hIf, pSession); 3917 3943 } 3918 3944 … … 5179 5205 * 5180 5206 * @returns VBox status code. 5181 * @param pIntNet The internal network instance.5182 5207 * @param pSession The session handle. 5183 5208 * @param pszNetwork The network name. … … 5190 5215 * @param phIf Where to store the handle to the network interface. 5191 5216 */ 5192 INTNETR0DECL(int) I NTNETR0Open(PINTNET pIntNet,PSUPDRVSESSION pSession, const char *pszNetwork,5217 INTNETR0DECL(int) IntNetR0Open(PSUPDRVSESSION pSession, const char *pszNetwork, 5193 5218 INTNETTRUNKTYPE enmTrunkType, const char *pszTrunk, uint32_t fFlags, 5194 u nsigned cbSend, unsignedcbRecv, PINTNETIFHANDLE phIf)5195 { 5196 LogFlow(("I NTNETR0Open: pIntNet=%ppSession=%p pszNetwork=%p:{%s} enmTrunkType=%d pszTrunk=%p:{%s} fFlags=%#x cbSend=%u cbRecv=%u phIf=%p\n",5197 p IntNet, pSession, pszNetwork, pszNetwork, enmTrunkType, pszTrunk, pszTrunk, fFlags, cbSend, cbRecv, phIf));5219 uint32_t cbSend, uint32_t cbRecv, PINTNETIFHANDLE phIf) 5220 { 5221 LogFlow(("IntNetR0Open: pSession=%p pszNetwork=%p:{%s} enmTrunkType=%d pszTrunk=%p:{%s} fFlags=%#x cbSend=%u cbRecv=%u phIf=%p\n", 5222 pSession, pszNetwork, pszNetwork, enmTrunkType, pszTrunk, pszTrunk, fFlags, cbSend, cbRecv, phIf)); 5198 5223 5199 5224 /* 5200 5225 * Validate input. 5201 5226 */ 5227 PINTNET pIntNet = g_pIntNet; 5202 5228 AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER); 5229 AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC); 5203 5230 5204 5231 AssertPtrReturn(pszNetwork, VERR_INVALID_PARAMETER); … … 5273 5300 5274 5301 RTSemMutexRelease(pIntNet->hMtxCreateOpenDestroy); 5275 LogFlow(("I NTNETR0Open: return %Rrc *phIf=%RX32\n", rc, *phIf));5302 LogFlow(("IntNetR0Open: return %Rrc *phIf=%RX32\n", rc, *phIf)); 5276 5303 return rc; 5277 5304 } … … 5282 5309 * 5283 5310 * @returns see GMMR0MapUnmapChunk. 5284 * @param pIntNet The internal networking instance.5285 5311 * @param pSession The caller's session. 5286 5312 * @param pReq The request packet. 5287 5313 */ 5288 INTNETR0DECL(int) I NTNETR0OpenReq(PINTNET pIntNet,PSUPDRVSESSION pSession, PINTNETOPENREQ pReq)5314 INTNETR0DECL(int) IntNetR0OpenReq(PSUPDRVSESSION pSession, PINTNETOPENREQ pReq) 5289 5315 { 5290 5316 if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq))) 5291 5317 return VERR_INVALID_PARAMETER; 5292 return I NTNETR0Open(pIntNet,pSession, &pReq->szNetwork[0], pReq->enmTrunkType, pReq->szTrunk,5318 return IntNetR0Open(pSession, &pReq->szNetwork[0], pReq->enmTrunkType, pReq->szTrunk, 5293 5319 pReq->fFlags, pReq->cbSend, pReq->cbRecv, &pReq->hIf); 5294 5320 } … … 5296 5322 5297 5323 /** 5324 * Count the internal networks. 5325 * 5326 * This is mainly for providing the testcase with some introspection to validate 5327 * behavior when closing interfaces. 5328 * 5329 * @returns The number of networks. 5330 */ 5331 INTNETR0DECL(uint32_t) IntNetR0GetNetworkCount(void) 5332 { 5333 /* 5334 * Grab the instance. 5335 */ 5336 PINTNET pIntNet = g_pIntNet; 5337 if (!pIntNet) 5338 return 0; 5339 AssertPtrReturn(pIntNet, 0); 5340 AssertReturn(pIntNet->u32Magic == INTNET_MAGIC, 0); 5341 5342 /* 5343 * Grab the mutex and count the networks. 5344 */ 5345 int rc = RTSemMutexRequest(pIntNet->hMtxCreateOpenDestroy, RT_INDEFINITE_WAIT); 5346 if (RT_FAILURE(rc)) 5347 return 0; 5348 5349 uint32_t cNetworks = 0; 5350 for (PINTNETNETWORK pCur = pIntNet->pNetworks; pCur; pCur = pCur->pNext) 5351 cNetworks++; 5352 5353 RTSemMutexRelease(pIntNet->hMtxCreateOpenDestroy); 5354 5355 return cNetworks; 5356 } 5357 5358 5359 5360 /** 5298 5361 * Destroys an instance of the Ring-0 internal networking service. 5299 * 5300 * @param pIntNet Pointer to the instance data. 5301 */ 5302 INTNETR0DECL(void) INTNETR0Destroy(PINTNET pIntNet) 5303 { 5304 LogFlow(("INTNETR0Destroy: pIntNet=%p\n", pIntNet));5305 5306 /*5307 * Allow NULL pointers.5308 */5362 */ 5363 INTNETR0DECL(void) IntNetR0Term(void) 5364 { 5365 LogFlow(("IntNetR0Term:\n")); 5366 5367 /* 5368 * Zap the global pointer and validate it. 5369 */ 5370 PINTNET pIntNet = g_pIntNet; 5371 g_pIntNet = NULL; 5309 5372 if (!pIntNet) 5310 5373 return; 5311 5374 AssertPtrReturnVoid(pIntNet); 5375 AssertReturnVoid(pIntNet->u32Magic == INTNET_MAGIC); 5312 5376 5313 5377 /* 5314 5378 * There is not supposed to be any networks hanging around at this time. 5315 5379 */ 5380 AssertReturnVoid(ASMAtomicCmpXchgU32(&pIntNet->u32Magic, ~INTNET_MAGIC, INTNET_MAGIC)); 5316 5381 Assert(pIntNet->pNetworks == NULL); 5317 5382 if (pIntNet->hMtxCreateOpenDestroy != NIL_RTSEMMUTEX) … … 5332 5397 5333 5398 /** 5334 * Create an instance of the Ring-0 internal networkingservice.5399 * Initalizes the internal network ring-0 service. 5335 5400 * 5336 5401 * @returns VBox status code. 5337 * @param ppIntNet Where to store the instance pointer. 5338 */ 5339 INTNETR0DECL(int) INTNETR0Create(PINTNET *ppIntNet) 5340 { 5341 LogFlow(("INTNETR0Create: ppIntNet=%p\n", ppIntNet)); 5402 */ 5403 INTNETR0DECL(int) IntNetR0Init(void) 5404 { 5405 LogFlow(("IntNetR0Init:\n")); 5342 5406 int rc = VERR_NO_MEMORY; 5343 5407 PINTNET pIntNet = (PINTNET)RTMemAllocZ(sizeof(*pIntNet)); … … 5353 5417 if (RT_SUCCESS(rc)) 5354 5418 { 5355 *ppIntNet = pIntNet; 5356 LogFlow(("INTNETR0Create: returns VINF_SUCCESS *ppIntNet=%p\n", pIntNet)); 5419 pIntNet->u32Magic = INTNET_MAGIC; 5420 g_pIntNet = pIntNet; 5421 LogFlow(("IntNetR0Init: returns VINF_SUCCESS pIntNet=%p\n", pIntNet)); 5357 5422 return VINF_SUCCESS; 5358 5423 } … … 5362 5427 RTMemFree(pIntNet); 5363 5428 } 5364 *ppIntNet = NULL; 5365 LogFlow(("INTNETR0Create: returns %Rrc\n", rc)); 5429 LogFlow(("IntNetR0Init: returns %Rrc\n", rc)); 5366 5430 return rc; 5367 5431 } -
trunk/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp
r28623 r28706 190 190 * Sends the data @a pvBuf points to. 191 191 */ 192 static int tstIntNetSendBuf(PINTNET pIntNet, PINTNETRINGBUF pRingBuf, INTNETIFHANDLE hIf,192 static int tstIntNetSendBuf(PINTNETRINGBUF pRingBuf, INTNETIFHANDLE hIf, 193 193 PSUPDRVSESSION pSession, void const *pvBuf, size_t cbBuf) 194 194 { … … 197 197 int rc = intnetR0RingWriteFrame(pRingBuf, &Sg, NULL); 198 198 if (RT_SUCCESS(rc)) 199 rc = I NTNETR0IfSend(pIntNet,hIf, pSession);199 rc = IntNetR0IfSend(hIf, pSession); 200 200 return rc; 201 201 } … … 204 204 typedef struct MYARGS 205 205 { 206 PINTNET pIntNet;207 206 PINTNETBUF pBuf; 208 207 INTNETIFHANDLE hIf; … … 258 257 RTTEST_CHECK_RC_OK(g_hTest, rc = intnetR0RingWriteFrame(&pArgs->pBuf->Send, &Sg, NULL)); 259 258 if (RT_SUCCESS(rc)) 260 RTTEST_CHECK_RC_OK(g_hTest, rc = I NTNETR0IfSend(pArgs->pIntNet,pArgs->hIf, g_pSession));259 RTTEST_CHECK_RC_OK(g_hTest, rc = IntNetR0IfSend(pArgs->hIf, g_pSession)); 261 260 cbSent += cb; 262 261 } … … 271 270 for (unsigned c = 0; c < 20; c++) 272 271 { 273 RTTEST_CHECK_RC_OK(g_hTest, rc = tstIntNetSendBuf( pArgs->pIntNet,&pArgs->pBuf->Send, pArgs->hIf, g_pSession,272 RTTEST_CHECK_RC_OK(g_hTest, rc = tstIntNetSendBuf(&pArgs->pBuf->Send, pArgs->hIf, g_pSession, 274 273 abBuf, sizeof(RTMAC) * 2 + sizeof(unsigned) * 4)); 275 274 RTThreadSleep(1); … … 363 362 * Wait for data. 364 363 */ 365 int rc = I NTNETR0IfWait(pArgs->pIntNet,pArgs->hIf, g_pSession, RT_INDEFINITE_WAIT);364 int rc = IntNetR0IfWait(pArgs->hIf, g_pSession, RT_INDEFINITE_WAIT); 366 365 switch (rc) 367 366 { … … 390 389 typedef struct TSTSTATE 391 390 { 392 PINTNET pIntNet;393 394 391 PINTNETBUF pBuf0; 395 392 INTNETIFHANDLE hIf0; … … 410 407 { 411 408 pThis->hIf0 = INTNET_HANDLE_INVALID; 412 RTTESTI_CHECK_RC_OK_RET(I NTNETR0Open(pThis->pIntNet,g_pSession, pszNetwork, kIntNetTrunkType_None, "",409 RTTESTI_CHECK_RC_OK_RET(IntNetR0Open(g_pSession, pszNetwork, kIntNetTrunkType_None, "", 413 410 0/*fFlags*/, cbSend, cbRecv, &pThis->hIf0), rcCheck); 414 411 RTTESTI_CHECK_RET(pThis->hIf0 != INTNET_HANDLE_INVALID, VERR_INTERNAL_ERROR); 415 RTTESTI_CHECK_RC_RET(I NTNETR0IfGetRing0Buffer(pThis->pIntNet,pThis->hIf0, g_pSession, &pThis->pBuf0), VINF_SUCCESS, rcCheck);412 RTTESTI_CHECK_RC_RET(IntNetR0IfGetRing0Buffer(pThis->hIf0, g_pSession, &pThis->pBuf0), VINF_SUCCESS, rcCheck); 416 413 RTTESTI_CHECK_RET(pThis->pBuf0, VERR_INTERNAL_ERROR); 417 414 418 415 419 416 pThis->hIf1 = INTNET_HANDLE_INVALID; 420 RTTESTI_CHECK_RC_OK_RET(I NTNETR0Open(pThis->pIntNet,g_pSession, pszNetwork, kIntNetTrunkType_None, "",417 RTTESTI_CHECK_RC_OK_RET(IntNetR0Open(g_pSession, pszNetwork, kIntNetTrunkType_None, "", 421 418 0/*fFlags*/, cbSend, cbRecv, &pThis->hIf1), rcCheck); 422 419 RTTESTI_CHECK_RET(pThis->hIf1 != INTNET_HANDLE_INVALID, VERR_INTERNAL_ERROR); 423 RTTESTI_CHECK_RC_RET(I NTNETR0IfGetRing0Buffer(pThis->pIntNet,pThis->hIf1, g_pSession, &pThis->pBuf1), VINF_SUCCESS, rcCheck);420 RTTESTI_CHECK_RC_RET(IntNetR0IfGetRing0Buffer(pThis->hIf1, g_pSession, &pThis->pBuf1), VINF_SUCCESS, rcCheck); 424 421 RTTESTI_CHECK_RET(pThis->pBuf1, VERR_INTERNAL_ERROR); 425 422 … … 435 432 { 436 433 int rc; 437 RTTESTI_CHECK_RC_OK(rc = I NTNETR0IfClose(pThis->pIntNet,pThis->hIf0, g_pSession));434 RTTESTI_CHECK_RC_OK(rc = IntNetR0IfClose(pThis->hIf0, g_pSession)); 438 435 if (RT_SUCCESS(rc)) 439 436 { … … 442 439 } 443 440 444 RTTESTI_CHECK_RC_OK(rc = I NTNETR0IfClose(pThis->pIntNet,pThis->hIf1, g_pSession));441 RTTESTI_CHECK_RC_OK(rc = IntNetR0IfClose(pThis->hIf1, g_pSession)); 445 442 if (RT_SUCCESS(rc)) 446 443 { … … 450 447 451 448 /* The network should be dead now. */ 452 RTTESTI_CHECK( pThis->pIntNet->pNetworks == NULL);449 RTTESTI_CHECK(IntNetR0GetNetworkCount() == 0); 453 450 } 454 451 … … 462 459 Args0.hIf = pThis->hIf0; 463 460 Args0.pBuf = pThis->pBuf0; 464 Args0.pIntNet = pThis->pIntNet;465 461 Args0.Mac.au16[0] = 0x8086; 466 462 Args0.Mac.au16[1] = 0; … … 471 467 Args1.hIf = pThis->hIf1; 472 468 Args1.pBuf = pThis->pBuf1; 473 Args1.pIntNet = pThis->pIntNet;474 469 Args1.Mac.au16[0] = 0x8086; 475 470 Args1.Mac.au16[1] = 0; … … 592 587 static uint16_t const s_au16Frame[7] = { /* dst:*/ 0xffff, 0xffff, 0xffff, /*src:*/0x8086, 0, 0, 0x0800 }; 593 588 594 RTTESTI_CHECK_RC_RETV(tstIntNetSendBuf( pThis->pIntNet,&pThis->pBuf0->Send, pThis->hIf0,589 RTTESTI_CHECK_RC_RETV(tstIntNetSendBuf(&pThis->pBuf0->Send, pThis->hIf0, 595 590 g_pSession, &s_au16Frame, sizeof(s_au16Frame)), 596 591 VINF_SUCCESS); 597 592 598 593 /* No echo, please */ 599 RTTESTI_CHECK_RC_RETV(I NTNETR0IfWait(pThis->pIntNet,pThis->hIf0, g_pSession, 1), VERR_TIMEOUT);594 RTTESTI_CHECK_RC_RETV(IntNetR0IfWait(pThis->hIf0, g_pSession, 1), VERR_TIMEOUT); 600 595 601 596 /* The other interface should see it though. But Wait should only return once, thank you. */ 602 RTTESTI_CHECK_RC_RETV(I NTNETR0IfWait(pThis->pIntNet,pThis->hIf1, g_pSession, 1), VINF_SUCCESS);603 RTTESTI_CHECK_RC_RETV(I NTNETR0IfWait(pThis->pIntNet,pThis->hIf1, g_pSession, 0), VERR_TIMEOUT);597 RTTESTI_CHECK_RC_RETV(IntNetR0IfWait(pThis->hIf1, g_pSession, 1), VINF_SUCCESS); 598 RTTESTI_CHECK_RC_RETV(IntNetR0IfWait(pThis->hIf1, g_pSession, 0), VERR_TIMEOUT); 604 599 605 600 /* Receive the data. */ … … 631 626 static uint16_t const s_au16Frame[7] = { /* dst:*/ 0x8086, 0, 0, /*src:*/0x8086, 0, 1, 0x0800 }; 632 627 633 RTTESTI_CHECK_RC_RETV(tstIntNetSendBuf( pThis->pIntNet,&pThis->pBuf1->Send, pThis->hIf1,628 RTTESTI_CHECK_RC_RETV(tstIntNetSendBuf(&pThis->pBuf1->Send, pThis->hIf1, 634 629 g_pSession, s_au16Frame, sizeof(s_au16Frame)), 635 630 VINF_SUCCESS); 636 631 637 632 /* No echo, please */ 638 RTTESTI_CHECK_RC_RETV(I NTNETR0IfWait(pThis->pIntNet,pThis->hIf1, g_pSession, 1), VERR_TIMEOUT);633 RTTESTI_CHECK_RC_RETV(IntNetR0IfWait(pThis->hIf1, g_pSession, 1), VERR_TIMEOUT); 639 634 640 635 /* The other interface should see it though. But Wait should only return once, thank you. */ 641 RTTESTI_CHECK_RC_RETV(I NTNETR0IfWait(pThis->pIntNet,pThis->hIf0, g_pSession, 1), VINF_SUCCESS);642 RTTESTI_CHECK_RC_RETV(I NTNETR0IfWait(pThis->pIntNet,pThis->hIf0, g_pSession, 0), VERR_TIMEOUT);636 RTTESTI_CHECK_RC_RETV(IntNetR0IfWait(pThis->hIf0, g_pSession, 1), VINF_SUCCESS); 637 RTTESTI_CHECK_RC_RETV(IntNetR0IfWait(pThis->hIf0, g_pSession, 0), VERR_TIMEOUT); 643 638 644 639 /* Receive the data. */ … … 666 661 * Create an INTNET instance. 667 662 */ 668 RTTestISub("I NTNETR0Create");669 RTTESTI_CHECK_RC_RETV(I NTNETR0Create(&pThis->pIntNet), VINF_SUCCESS);663 RTTestISub("IntNetR0Init"); 664 RTTESTI_CHECK_RC_RETV(IntNetR0Init(), VINF_SUCCESS); 670 665 671 666 /* … … 676 671 if (RT_FAILURE(rc)) 677 672 return; 678 RTTESTI_CHECK_RC(I NTNETR0IfSetActive(pThis->pIntNet,pThis->hIf0, g_pSession, true), VINF_SUCCESS);679 RTTESTI_CHECK_RC(I NTNETR0IfSetActive(pThis->pIntNet,pThis->hIf1, g_pSession, true), VINF_SUCCESS);673 RTTESTI_CHECK_RC(IntNetR0IfSetActive(pThis->hIf0, g_pSession, true), VINF_SUCCESS); 674 RTTESTI_CHECK_RC(IntNetR0IfSetActive(pThis->hIf1, g_pSession, true), VINF_SUCCESS); 680 675 681 676 /* 682 677 * Test basic waiting. 683 678 */ 684 RTTestISub("I NTNETR0IfWait");685 RTTESTI_CHECK_RC(I NTNETR0IfWait(pThis->pIntNet,pThis->hIf0, g_pSession, 1), VERR_TIMEOUT);686 RTTESTI_CHECK_RC(I NTNETR0IfWait(pThis->pIntNet,pThis->hIf0, g_pSession, 0), VERR_TIMEOUT);687 RTTESTI_CHECK_RC(I NTNETR0IfWait(pThis->pIntNet,pThis->hIf1, g_pSession, 1), VERR_TIMEOUT);688 RTTESTI_CHECK_RC(I NTNETR0IfWait(pThis->pIntNet,pThis->hIf1, g_pSession, 0), VERR_TIMEOUT);679 RTTestISub("IntNetR0IfWait"); 680 RTTESTI_CHECK_RC(IntNetR0IfWait(pThis->hIf0, g_pSession, 1), VERR_TIMEOUT); 681 RTTESTI_CHECK_RC(IntNetR0IfWait(pThis->hIf0, g_pSession, 0), VERR_TIMEOUT); 682 RTTESTI_CHECK_RC(IntNetR0IfWait(pThis->hIf1, g_pSession, 1), VERR_TIMEOUT); 683 RTTESTI_CHECK_RC(IntNetR0IfWait(pThis->hIf1, g_pSession, 0), VERR_TIMEOUT); 689 684 690 685 /* … … 718 713 */ 719 714 tstCloseInterfaces(pThis); 720 I NTNETR0Destroy(pThis->pIntNet);715 IntNetR0Term(); 721 716 } 722 717 -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r28425 r28706 70 70 * Global Variables * 71 71 *******************************************************************************/ 72 /** Pointer to the internal networking service instance. */ 73 PINTNET g_pIntNet = 0; 74 72 /** Drag in necessary library bits. 73 * The runtime lives here (in VMMR0.r0) and VBoxDD*R0.r0 links against us. */ 75 74 PFNRT g_VMMGCDeps[] = 76 75 { … … 110 109 if (RT_SUCCESS(rc)) 111 110 { 112 LogFlow(("ModuleInit: g_pIntNet=%p\n", g_pIntNet)); 113 g_pIntNet = NULL; 114 LogFlow(("ModuleInit: g_pIntNet=%p should be NULL now...\n", g_pIntNet)); 115 rc = INTNETR0Create(&g_pIntNet); 111 rc = IntNetR0Init(); 116 112 if (RT_SUCCESS(rc)) 117 113 { 118 LogFlow(("ModuleInit: returns success. g_pIntNet=%p\n", g_pIntNet));114 LogFlow(("ModuleInit: returns success.\n")); 119 115 return VINF_SUCCESS; 120 116 } 121 117 122 118 /* bail out */ 123 g_pIntNet = NULL;124 119 LogFlow(("ModuleTerm: returns %Rrc\n", rc)); 125 120 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE … … 150 145 151 146 /* 152 * Destroy the internal networking instance. 153 */ 154 if (g_pIntNet) 155 { 156 INTNETR0Destroy(g_pIntNet); 157 g_pIntNet = NULL; 158 } 147 * Terminate the internal network service. 148 */ 149 IntNetR0Term(); 159 150 160 151 /* 161 152 * PGM (Darwin) and HWACCM global cleanup. 162 * Destroy the GMM and GVMM instances.163 153 */ 164 154 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE … … 168 158 HWACCMR0Term(); 169 159 160 /* 161 * Destroy the GMM and GVMM instances. 162 */ 170 163 GMMR0Term(); 171 164 GVMMR0Term(); … … 998 991 if (u64Arg || !pReq || !vmmR0IsValidSession(pVM, pReq->pSession, pSession) || idCpu != NIL_VMCPUID) 999 992 return VERR_INVALID_PARAMETER; 1000 if (!g_pIntNet) 1001 return VERR_NOT_SUPPORTED; 1002 return INTNETR0OpenReq(g_pIntNet, pSession, pReq); 993 return IntNetR0OpenReq(pSession, pReq); 1003 994 } 1004 995 … … 1006 997 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFCLOSEREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID) 1007 998 return VERR_INVALID_PARAMETER; 1008 if (!g_pIntNet) 1009 return VERR_NOT_SUPPORTED; 1010 return INTNETR0IfCloseReq(g_pIntNet, pSession, (PINTNETIFCLOSEREQ)pReqHdr); 999 return IntNetR0IfCloseReq(pSession, (PINTNETIFCLOSEREQ)pReqHdr); 1011 1000 1012 1001 case VMMR0_DO_INTNET_IF_GET_RING3_BUFFER: 1013 1002 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFGETRING3BUFFERREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID) 1014 1003 return VERR_INVALID_PARAMETER; 1015 if (!g_pIntNet) 1016 return VERR_NOT_SUPPORTED; 1017 return INTNETR0IfGetRing3BufferReq(g_pIntNet, pSession, (PINTNETIFGETRING3BUFFERREQ)pReqHdr); 1004 return IntNetR0IfGetRing3BufferReq(pSession, (PINTNETIFGETRING3BUFFERREQ)pReqHdr); 1018 1005 1019 1006 case VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE: 1020 1007 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFSETPROMISCUOUSMODEREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID) 1021 1008 return VERR_INVALID_PARAMETER; 1022 if (!g_pIntNet) 1023 return VERR_NOT_SUPPORTED; 1024 return INTNETR0IfSetPromiscuousModeReq(g_pIntNet, pSession, (PINTNETIFSETPROMISCUOUSMODEREQ)pReqHdr); 1009 return IntNetR0IfSetPromiscuousModeReq(pSession, (PINTNETIFSETPROMISCUOUSMODEREQ)pReqHdr); 1025 1010 1026 1011 case VMMR0_DO_INTNET_IF_SET_MAC_ADDRESS: 1027 1012 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFSETMACADDRESSREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID) 1028 1013 return VERR_INVALID_PARAMETER; 1029 if (!g_pIntNet) 1030 return VERR_NOT_SUPPORTED; 1031 return INTNETR0IfSetMacAddressReq(g_pIntNet, pSession, (PINTNETIFSETMACADDRESSREQ)pReqHdr); 1014 return IntNetR0IfSetMacAddressReq(pSession, (PINTNETIFSETMACADDRESSREQ)pReqHdr); 1032 1015 1033 1016 case VMMR0_DO_INTNET_IF_SET_ACTIVE: 1034 1017 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFSETACTIVEREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID) 1035 1018 return VERR_INVALID_PARAMETER; 1036 if (!g_pIntNet) 1037 return VERR_NOT_SUPPORTED; 1038 return INTNETR0IfSetActiveReq(g_pIntNet, pSession, (PINTNETIFSETACTIVEREQ)pReqHdr); 1019 return IntNetR0IfSetActiveReq(pSession, (PINTNETIFSETACTIVEREQ)pReqHdr); 1039 1020 1040 1021 case VMMR0_DO_INTNET_IF_SEND: 1041 1022 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFSENDREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID) 1042 1023 return VERR_INVALID_PARAMETER; 1043 if (!g_pIntNet) 1044 return VERR_NOT_SUPPORTED; 1045 return INTNETR0IfSendReq(g_pIntNet, pSession, (PINTNETIFSENDREQ)pReqHdr); 1024 return IntNetR0IfSendReq(pSession, (PINTNETIFSENDREQ)pReqHdr); 1046 1025 1047 1026 case VMMR0_DO_INTNET_IF_WAIT: 1048 1027 if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFWAITREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID) 1049 1028 return VERR_INVALID_PARAMETER; 1050 if (!g_pIntNet) 1051 return VERR_NOT_SUPPORTED; 1052 return INTNETR0IfWaitReq(g_pIntNet, pSession, (PINTNETIFWAITREQ)pReqHdr); 1029 return IntNetR0IfWaitReq(pSession, (PINTNETIFWAITREQ)pReqHdr); 1053 1030 1054 1031 /*
Note:
See TracChangeset
for help on using the changeset viewer.