VirtualBox

Changeset 28706 in vbox


Ignore:
Timestamp:
Apr 25, 2010 3:10:30 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
60578
Message:

IntNet: Moved the instance pointer from VMMR0.cpp to SrvIntNetR0.cpp and dropped it as an argument to the IntNet API. Also renamed the prefixed to camelcase as 6-7 capital letters in a row is painful to write and read.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/intnet.h

    r28666 r28706  
    3939RT_C_DECLS_BEGIN
    4040
    41 
    42 /** Pointer to an internal network ring-0 instance. */
    43 typedef struct INTNET *PINTNET;
    4441
    4542/**
     
    749746 * The trunk connection type.
    750747 *
    751  * Used by INTNETR0Open and assoicated interfaces.
     748 * Used by IntNetR0Open and assoicated interfaces.
    752749 */
    753750typedef enum INTNETTRUNKTYPE
     
    773770} INTNETTRUNKTYPE;
    774771
    775 /** @name INTNETR0Open flags.
     772/** @name IntNetR0Open flags.
    776773 * @{ */
    777774/** Share the MAC address with the host when sending something to the wire via the trunk.
     
    808805
    809806/**
    810  * Request buffer for INTNETR0OpenReq / VMMR0_DO_INTNET_OPEN.
    811  * @see INTNETR0Open.
     807 * Request buffer for IntNetR0OpenReq / VMMR0_DO_INTNET_OPEN.
     808 * @see IntNetR0Open.
    812809 */
    813810typedef struct INTNETOPENREQ
     
    834831    INTNETIFHANDLE  hIf;
    835832} INTNETOPENREQ;
    836 /** Pointer to an INTNETR0OpenReq / VMMR0_DO_INTNET_OPEN request buffer. */
     833/** Pointer to an IntNetR0OpenReq / VMMR0_DO_INTNET_OPEN request buffer. */
    837834typedef INTNETOPENREQ *PINTNETOPENREQ;
    838835
    839 INTNETR0DECL(int) INTNETR0OpenReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETOPENREQ pReq);
    840 
    841 
    842 /**
    843  * Request buffer for INTNETR0IfCloseReq / VMMR0_DO_INTNET_IF_CLOSE.
    844  * @see INTNETR0IfClose.
     836INTNETR0DECL(int) IntNetR0OpenReq(PSUPDRVSESSION pSession, PINTNETOPENREQ pReq);
     837
     838
     839/**
     840 * Request buffer for IntNetR0IfCloseReq / VMMR0_DO_INTNET_IF_CLOSE.
     841 * @see IntNetR0IfClose.
    845842 */
    846843typedef struct INTNETIFCLOSEREQ
     
    854851    INTNETIFHANDLE  hIf;
    855852} 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. */
    857855typedef INTNETIFCLOSEREQ *PINTNETIFCLOSEREQ;
    858856
    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.
     857INTNETR0DECL(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.
    865864 */
    866865typedef struct INTNETIFGETRING3BUFFERREQ
     
    876875    R3PTRTYPE(PINTNETBUF)   pRing3Buf;
    877876} 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. */
    879879typedef INTNETIFGETRING3BUFFERREQ *PINTNETIFGETRING3BUFFERREQ;
    880880
    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.
     881INTNETR0DECL(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.
    887888 */
    888889typedef struct INTNETIFSETPROMISCUOUSMODEREQ
     
    898899    bool            fPromiscuous;
    899900} 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. */
    901903typedef INTNETIFSETPROMISCUOUSMODEREQ *PINTNETIFSETPROMISCUOUSMODEREQ;
    902904
    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.
     905INTNETR0DECL(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.
    909912 */
    910913typedef struct INTNETIFSETMACADDRESSREQ
     
    920923    RTMAC           Mac;
    921924} 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. */
    923927typedef INTNETIFSETMACADDRESSREQ *PINTNETIFSETMACADDRESSREQ;
    924928
    925 INTNETR0DECL(int) INTNETR0IfSetMacAddressReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFSETMACADDRESSREQ pReq);
    926 
    927 
    928 /**
    929  * Request buffer for INTNETR0IfSetActiveReq / VMMR0_DO_INTNET_IF_SET_ACTIVE.
    930  * @see INTNETR0IfSetActive.
     929INTNETR0DECL(int) IntNetR0IfSetMacAddressReq(PSUPDRVSESSION pSession, PINTNETIFSETMACADDRESSREQ pReq);
     930
     931
     932/**
     933 * Request buffer for IntNetR0IfSetActiveReq / VMMR0_DO_INTNET_IF_SET_ACTIVE.
     934 * @see IntNetR0IfSetActive.
    931935 */
    932936typedef struct INTNETIFSETACTIVEREQ
     
    942946    bool            fActive;
    943947} 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. */
    945950typedef INTNETIFSETACTIVEREQ *PINTNETIFSETACTIVEREQ;
    946951
    947 INTNETR0DECL(int) INTNETR0IfSetActiveReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFSETACTIVEREQ pReq);
    948 
    949 
    950 /**
    951  * Request buffer for INTNETR0IfSendReq / VMMR0_DO_INTNET_IF_SEND.
    952  * @see INTNETR0IfSend.
     952INTNETR0DECL(int) IntNetR0IfSetActiveReq(PSUPDRVSESSION pSession, PINTNETIFSETACTIVEREQ pReq);
     953
     954
     955/**
     956 * Request buffer for IntNetR0IfSendReq / VMMR0_DO_INTNET_IF_SEND.
     957 * @see IntNetR0IfSend.
    953958 */
    954959typedef struct INTNETIFSENDREQ
     
    962967    INTNETIFHANDLE  hIf;
    963968} INTNETIFSENDREQ;
    964 /** Pointer to an INTNETR0IfSend() argument package. */
     969/** Pointer to an IntNetR0IfSend() argument package. */
    965970typedef INTNETIFSENDREQ *PINTNETIFSENDREQ;
    966971
    967 INTNETR0DECL(int) INTNETR0IfSendReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFSENDREQ pReq);
    968 
    969 
    970 /**
    971  * Request buffer for INTNETR0IfWaitReq / VMMR0_DO_INTNET_IF_WAIT.
    972  * @see INTNETR0IfWait.
     972INTNETR0DECL(int) IntNetR0IfSendReq(PSUPDRVSESSION pSession, PINTNETIFSENDREQ pReq);
     973
     974
     975/**
     976 * Request buffer for IntNetR0IfWaitReq / VMMR0_DO_INTNET_IF_WAIT.
     977 * @see IntNetR0IfWait.
    973978 */
    974979typedef struct INTNETIFWAITREQ
     
    984989    uint32_t        cMillies;
    985990} INTNETIFWAITREQ;
    986 /** Pointer to an INTNETR0IfWaitReq / VMMR0_DO_INTNET_IF_WAIT request buffer. */
     991/** Pointer to an IntNetR0IfWaitReq / VMMR0_DO_INTNET_IF_WAIT request buffer. */
    987992typedef INTNETIFWAITREQ *PINTNETIFWAITREQ;
    988993
    989 INTNETR0DECL(int) INTNETR0IfWaitReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFWAITREQ pReq);
     994INTNETR0DECL(int) IntNetR0IfWaitReq(PSUPDRVSESSION pSession, PINTNETIFWAITREQ pReq);
    990995
    991996
     
    9951000 */
    9961001
    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);
     1002INTNETR0DECL(int)      IntNetR0Init(void);
     1003INTNETR0DECL(void)     IntNetR0Term(void);
     1004INTNETR0DECL(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);
     1007INTNETR0DECL(uint32_t) IntNetR0GetNetworkCount(void);
     1008
     1009INTNETR0DECL(int) IntNetR0IfClose(             INTNETIFHANDLE hIf, PSUPDRVSESSION pSession);
     1010INTNETR0DECL(int) IntNetR0IfGetRing0Buffer(    INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PINTNETBUF *ppRing0Buf);
     1011INTNETR0DECL(int) IntNetR0IfGetRing3Buffer(    INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, R3PTRTYPE(PINTNETBUF) *ppRing3Buf);
     1012INTNETR0DECL(int) IntNetR0IfSetPromiscuousMode(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fPromiscuous);
     1013INTNETR0DECL(int) IntNetR0IfSetMacAddress(     INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PCRTMAC pMac);
     1014INTNETR0DECL(int) IntNetR0IfSetActive(         INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fActive);
     1015INTNETR0DECL(int) IntNetR0IfSend(              INTNETIFHANDLE hIf, PSUPDRVSESSION pSession);
     1016INTNETR0DECL(int) IntNetR0IfWait(              INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, uint32_t cMillies);
    11031017
    11041018/** @} */
  • trunk/include/VBox/vmm.h

    r28425 r28706  
    325325    /** The start of the R0 service operations. */
    326326    VMMR0_DO_SRV_START,
    327     /** Call INTNETR0Open(). */
     327    /** Call IntNetR0Open(). */
    328328    VMMR0_DO_INTNET_OPEN,
    329     /** Call INTNETR0IfClose(). */
     329    /** Call IntNetR0IfClose(). */
    330330    VMMR0_DO_INTNET_IF_CLOSE,
    331     /** Call INTNETR0IfGetRing3Buffer(). */
     331    /** Call IntNetR0IfGetRing3Buffer(). */
    332332    VMMR0_DO_INTNET_IF_GET_RING3_BUFFER,
    333     /** Call INTNETR0IfSetPromiscuousMode(). */
     333    /** Call IntNetR0IfSetPromiscuousMode(). */
    334334    VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE,
    335     /** Call INTNETR0IfSetMacAddress(). */
     335    /** Call IntNetR0IfSetMacAddress(). */
    336336    VMMR0_DO_INTNET_IF_SET_MAC_ADDRESS,
    337     /** Call INTNETR0IfSetActive(). */
     337    /** Call IntNetR0IfSetActive(). */
    338338    VMMR0_DO_INTNET_IF_SET_ACTIVE,
    339     /** Call INTNETR0IfSend(). */
     339    /** Call IntNetR0IfSend(). */
    340340    VMMR0_DO_INTNET_IF_SEND,
    341     /** Call INTNETR0IfWait(). */
     341    /** Call IntNetR0IfWait(). */
    342342    VMMR0_DO_INTNET_IF_WAIT,
    343343    /** The end of the R0 service operations. */
  • trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp

    r28701 r28706  
    385385typedef struct INTNET
    386386{
     387    /** Magic number (INTNET_MAGIC). */
     388    uint32_t volatile       u32Magic;
    387389    /** Mutex protecting the creation, opening and destruction of both networks and
    388390     * interfaces.  (This means all operations affecting the pNetworks list.) */
     
    393395    RTHANDLETABLE           hHtIfs;
    394396} INTNET;
    395 
     397/** Pointer to an internal network ring-0 instance. */
     398typedef 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. */
     408static PINTNET volatile g_pIntNet = NULL;
    396409
    397410
     
    25532566         * Edit the source address so that it it's the same as the host.
    25542567         */
    2555         /* ASSUME frame from INTNETR0IfSend! */
     2568        /* ASSUME frame from IntNetR0IfSend! */
    25562569        AssertReturnVoid(pSG->cSegsUsed == 1);
    25572570        AssertReturnVoid(pSG->cbTotal >= sizeof(RTNETETHERHDR));
     
    32273240 *
    32283241 * @returns VBox status code.
    3229  * @param   pIntNet     The instance data.
    32303242 * @param   hIf         The interface handle.
    32313243 * @param   pSession    The caller's session.
    32323244 */
    3233 INTNETR0DECL(int) INTNETR0IfSend(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession)
    3234 {
    3235     Log5(("INTNETR0IfSend: pIntNet=%p hIf=%RX32\n", pIntNet, hIf));
     3245INTNETR0DECL(int) IntNetR0IfSend(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession)
     3246{
     3247    Log5(("IntNetR0IfSend: hIf=%RX32\n", hIf));
    32363248
    32373249    /*
    32383250     * Validate input and translate the handle.
    32393251     */
    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
    32413256    PINTNETIF pIf = (PINTNETIF)RTHandleTableLookupWithCtx(pIntNet->hHtIfs, hIf, pSession);
    32423257    if (!pIf)
     
    33353350
    33363351/**
    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.
    33413355 * @param   pSession        The caller's session.
    33423356 * @param   pReq            The request packet.
    33433357 */
    3344 INTNETR0DECL(int) INTNETR0IfSendReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFSENDREQ pReq)
     3358INTNETR0DECL(int) IntNetR0IfSendReq(PSUPDRVSESSION pSession, PINTNETIFSENDREQ pReq)
    33453359{
    33463360    if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq)))
    33473361        return VERR_INVALID_PARAMETER;
    3348     return INTNETR0IfSend(pIntNet, pReq->hIf, pSession);
     3362    return IntNetR0IfSend(pReq->hIf, pSession);
    33493363}
    33503364
     
    33543368 *
    33553369 * @returns VBox status code.
    3356  * @param   pIntNet         The instance data.
    33573370 * @param   hIf             The interface handle.
    33583371 * @param   pSession        The caller's session.
    33593372 * @param   ppRing3Buf      Where to store the address of the ring-3 mapping.
    33603373 */
    3361 INTNETR0DECL(int) INTNETR0IfGetRing3Buffer(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, R3PTRTYPE(PINTNETBUF) *ppRing3Buf)
    3362 {
    3363     LogFlow(("INTNETR0IfGetRing3Buffer: pIntNet=%p hIf=%RX32 ppRing3Buf=%p\n", pIntNet, hIf, ppRing3Buf));
     3374INTNETR0DECL(int) IntNetR0IfGetRing3Buffer(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, R3PTRTYPE(PINTNETBUF) *ppRing3Buf)
     3375{
     3376    LogFlow(("IntNetR0IfGetRing3Buffer: hIf=%RX32 ppRing3Buf=%p\n", hIf, ppRing3Buf));
    33643377
    33653378    /*
    33663379     * Validate input.
    33673380     */
    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
    33693385    AssertPtrReturn(ppRing3Buf, VERR_INVALID_PARAMETER);
    33703386    *ppRing3Buf = 0;
     
    33873403
    33883404    intnetR0IfRelease(pIf, pSession);
    3389     LogFlow(("INTNETR0IfGetRing3Buffer: returns %Rrc *ppRing3Buf=%p\n", rc, *ppRing3Buf));
     3405    LogFlow(("IntNetR0IfGetRing3Buffer: returns %Rrc *ppRing3Buf=%p\n", rc, *ppRing3Buf));
    33903406    return rc;
    33913407}
     
    33933409
    33943410/**
    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.
    33993414 * @param   pSession        The caller's session.
    34003415 * @param   pReq            The request packet.
    34013416 */
    3402 INTNETR0DECL(int) INTNETR0IfGetRing3BufferReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFGETRING3BUFFERREQ pReq)
     3417INTNETR0DECL(int) IntNetR0IfGetRing3BufferReq(PSUPDRVSESSION pSession, PINTNETIFGETRING3BUFFERREQ pReq)
    34033418{
    34043419    if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq)))
    34053420        return VERR_INVALID_PARAMETER;
    3406     return INTNETR0IfGetRing3Buffer(pIntNet, pReq->hIf, pSession, &pReq->pRing3Buf);
     3421    return IntNetR0IfGetRing3Buffer(pReq->hIf, pSession, &pReq->pRing3Buf);
    34073422}
    34083423
     
    34123427 *
    34133428 * @returns VBox status code.
    3414  * @param   pIntNet         The instance data.
    34153429 * @param   hIf             The interface handle.
    34163430 * @param   pSession        The caller's session.
    34173431 * @param   ppRing0Buf      Where to store the address of the ring-3 mapping.
    34183432 */
    3419 INTNETR0DECL(int) INTNETR0IfGetRing0Buffer(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PINTNETBUF *ppRing0Buf)
    3420 {
    3421     LogFlow(("INTNETR0IfGetRing0Buffer: pIntNet=%p hIf=%RX32 ppRing0Buf=%p\n", pIntNet, hIf, ppRing0Buf));
     3433INTNETR0DECL(int) IntNetR0IfGetRing0Buffer(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PINTNETBUF *ppRing0Buf)
     3434{
     3435    LogFlow(("IntNetR0IfGetRing0Buffer: hIf=%RX32 ppRing0Buf=%p\n", hIf, ppRing0Buf));
    34223436
    34233437    /*
    34243438     * Validate input.
    34253439     */
     3440    PINTNET pIntNet = g_pIntNet;
     3441    AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER);
     3442    AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC);
     3443
    34263444    AssertPtrReturn(ppRing0Buf, VERR_INVALID_PARAMETER);
    34273445    *ppRing0Buf = NULL;
    3428     AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER);
    34293446    PINTNETIF pIf = (PINTNETIF)RTHandleTableLookupWithCtx(pIntNet->hHtIfs, hIf, pSession);
    34303447    if (!pIf)
     
    34433460    }
    34443461    intnetR0IfRelease(pIf, pSession);
    3445     LogFlow(("INTNETR0IfGetRing0Buffer: returns %Rrc *ppRing0Buf=%p\n", rc, *ppRing0Buf));
     3462    LogFlow(("IntNetR0IfGetRing0Buffer: returns %Rrc *ppRing0Buf=%p\n", rc, *ppRing0Buf));
    34463463    return rc;
    34473464}
     
    34533470 *
    34543471 * @returns VBox status code.
    3455  * @param   pIntNet     The instance data.
    34563472 * @param   hIF         The interface handle.
    34573473 * @param   paPages     Where to store the addresses. (The reserved fields will be set to zero.)
    34583474 * @param   cPages
    34593475 */
    3460 INTNETR0DECL(int) INTNETR0IfGetPhysBuffer(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPPAGE paPages, unsigned cPages)
     3476INTNETR0DECL(int) IntNetR0IfGetPhysBuffer(INTNETIFHANDLE hIf, PSUPPAGE paPages, unsigned cPages)
    34613477{
    34623478    /*
    34633479     * Validate input.
    34643480     */
    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
    34663485    AssertPtrReturn(paPages, VERR_INVALID_PARAMETER);
    34673486    AssertPtrReturn((uint8_t *)&paPages[cPages] - 1, VERR_INVALID_PARAMETER);
     
    34923511 *
    34933512 * @returns VBox status code.
    3494  * @param   pIntNet         The instance handle.
    34953513 * @param   hIf             The interface handle.
    34963514 * @param   pSession        The caller's session.
    34973515 * @param   fPromiscuous    Set if the interface should be in promiscuous mode, clear if not.
    34983516 */
    3499 INTNETR0DECL(int) INTNETR0IfSetPromiscuousMode(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fPromiscuous)
    3500 {
    3501     LogFlow(("INTNETR0IfSetPromiscuousMode: pIntNet=%p hIf=%RX32 fPromiscuous=%d\n", pIntNet, hIf, fPromiscuous));
     3517INTNETR0DECL(int) IntNetR0IfSetPromiscuousMode(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fPromiscuous)
     3518{
     3519    LogFlow(("IntNetR0IfSetPromiscuousMode: hIf=%RX32 fPromiscuous=%d\n", hIf, fPromiscuous));
    35023520
    35033521    /*
    35043522     * Validate & translate input.
    35053523     */
    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
    35073528    PINTNETIF pIf = (PINTNETIF)RTHandleTableLookupWithCtx(pIntNet->hHtIfs, hIf, pSession);
    35083529    if (!pIf)
    35093530    {
    3510         Log(("INTNETR0IfSetPromiscuousMode: returns VERR_INVALID_HANDLE\n"));
     3531        Log(("IntNetR0IfSetPromiscuousMode: returns VERR_INVALID_HANDLE\n"));
    35113532        return VERR_INVALID_HANDLE;
    35123533    }
     
    35263547        if (pIf->fPromiscuous != fPromiscuous)
    35273548        {
    3528             Log(("INTNETR0IfSetPromiscuousMode: hIf=%RX32: Changed from %d -> %d\n",
     3549            Log(("IntNetR0IfSetPromiscuousMode: hIf=%RX32: Changed from %d -> %d\n",
    35293550                 hIf, !fPromiscuous, !!fPromiscuous));
    35303551            ASMAtomicUoWriteBool(&pIf->fPromiscuous, fPromiscuous);
     
    35483569
    35493570/**
    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.
    35543574 * @param   pSession        The caller's session.
    35553575 * @param   pReq            The request packet.
    35563576 */
    3557 INTNETR0DECL(int) INTNETR0IfSetPromiscuousModeReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFSETPROMISCUOUSMODEREQ pReq)
     3577INTNETR0DECL(int) IntNetR0IfSetPromiscuousModeReq(PSUPDRVSESSION pSession, PINTNETIFSETPROMISCUOUSMODEREQ pReq)
    35583578{
    35593579    if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq)))
    35603580        return VERR_INVALID_PARAMETER;
    3561     return INTNETR0IfSetPromiscuousMode(pIntNet, pReq->hIf, pSession, pReq->fPromiscuous);
     3581    return IntNetR0IfSetPromiscuousMode(pReq->hIf, pSession, pReq->fPromiscuous);
    35623582}
    35633583
     
    35673587 *
    35683588 * @returns VBox status code.
    3569  * @param   pIntNet         The instance handle.
    35703589 * @param   hIf             The interface handle.
    35713590 * @param   pSession        The caller's session.
    35723591 * @param   pMAC            The new MAC address.
    35733592 */
    3574 INTNETR0DECL(int) INTNETR0IfSetMacAddress(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PCRTMAC pMac)
    3575 {
    3576     LogFlow(("INTNETR0IfSetMacAddress: pIntNet=%p hIf=%RX32 pMac=%p:{%.6Rhxs}\n", pIntNet, hIf, pMac, pMac));
     3593INTNETR0DECL(int) IntNetR0IfSetMacAddress(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PCRTMAC pMac)
     3594{
     3595    LogFlow(("IntNetR0IfSetMacAddress: hIf=%RX32 pMac=%p:{%.6Rhxs}\n", hIf, pMac, pMac));
    35773596
    35783597    /*
    35793598     * Validate & translate input.
    35803599     */
     3600    PINTNET pIntNet = g_pIntNet;
    35813601    AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER);
     3602    AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC);
     3603
    35823604    AssertPtrReturn(pMac, VERR_INVALID_PARAMETER);
    35833605    PINTNETIF pIf = (PINTNETIF)RTHandleTableLookupWithCtx(pIntNet->hHtIfs, hIf, pSession);
    35843606    if (!pIf)
    35853607    {
    3586         Log(("INTNETR0IfSetMacAddress: returns VERR_INVALID_HANDLE\n"));
     3608        Log(("IntNetR0IfSetMacAddress: returns VERR_INVALID_HANDLE\n"));
    35873609        return VERR_INVALID_HANDLE;
    35883610    }
     
    36023624        if (memcmp(&pIf->MacAddr, pMac, sizeof(pIf->MacAddr)))
    36033625        {
    3604             Log(("INTNETR0IfSetMacAddress: hIf=%RX32: Changed from %.6Rhxs -> %.6Rhxs\n",
     3626            Log(("IntNetR0IfSetMacAddress: hIf=%RX32: Changed from %.6Rhxs -> %.6Rhxs\n",
    36053627                 hIf, &pIf->MacAddr, pMac));
    36063628
     
    36243646
    36253647/**
    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.
    36303651 * @param   pSession        The caller's session.
    36313652 * @param   pReq            The request packet.
    36323653 */
    3633 INTNETR0DECL(int) INTNETR0IfSetMacAddressReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFSETMACADDRESSREQ pReq)
     3654INTNETR0DECL(int) IntNetR0IfSetMacAddressReq(PSUPDRVSESSION pSession, PINTNETIFSETMACADDRESSREQ pReq)
    36343655{
    36353656    if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq)))
    36363657        return VERR_INVALID_PARAMETER;
    3637     return INTNETR0IfSetMacAddress(pIntNet, pReq->hIf, pSession, &pReq->Mac);
     3658    return IntNetR0IfSetMacAddress(pReq->hIf, pSession, &pReq->Mac);
    36383659}
    36393660
     
    37163737 *
    37173738 * @returns VBox status code.
    3718  * @param   pIntNet         The instance handle.
    37193739 * @param   hIf             The interface handle.
    37203740 * @param   pSession        The caller's session.
    37213741 * @param   fActive         The new state.
    37223742 */
    3723 INTNETR0DECL(int) INTNETR0IfSetActive(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fActive)
    3724 {
    3725     LogFlow(("INTNETR0IfSetActive: pIntNet=%p hIf=%RX32 fActive=%RTbool\n", pIntNet, hIf, fActive));
     3743INTNETR0DECL(int) IntNetR0IfSetActive(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fActive)
     3744{
     3745    LogFlow(("IntNetR0IfSetActive: hIf=%RX32 fActive=%RTbool\n", hIf, fActive));
    37263746
    37273747    /*
    37283748     * Validate & translate input.
    37293749     */
     3750    PINTNET pIntNet = g_pIntNet;
    37303751    AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER);
     3752    AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC);
     3753
    37313754    PINTNETIF pIf = (PINTNETIF)RTHandleTableLookupWithCtx(pIntNet->hHtIfs, hIf, pSession);
    37323755    if (!pIf)
    37333756    {
    3734         Log(("INTNETR0IfSetActive: returns VERR_INVALID_HANDLE\n"));
     3757        Log(("IntNetR0IfSetActive: returns VERR_INVALID_HANDLE\n"));
    37353758        return VERR_INVALID_HANDLE;
    37363759    }
     
    37593782
    37603783/**
    3761  * VMMR0 request wrapper for INTNETR0IfSetActive.
    3762  *
    3763  * @returns see INTNETR0IfSetActive.
     3784 * VMMR0 request wrapper for IntNetR0IfSetActive.
     3785 *
     3786 * @returns see IntNetR0IfSetActive.
    37643787 * @param   pIntNet         The internal networking instance.
    37653788 * @param   pSession        The caller's session.
    37663789 * @param   pReq            The request packet.
    37673790 */
    3768 INTNETR0DECL(int) INTNETR0IfSetActiveReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFSETACTIVEREQ pReq)
     3791INTNETR0DECL(int) IntNetR0IfSetActiveReq(PSUPDRVSESSION pSession, PINTNETIFSETACTIVEREQ pReq)
    37693792{
    37703793    if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq)))
    37713794        return VERR_INVALID_PARAMETER;
    3772     return INTNETR0IfSetActive(pIntNet, pReq->hIf, pSession, pReq->fActive);
     3795    return IntNetR0IfSetActive(pReq->hIf, pSession, pReq->fActive);
    37733796}
    37743797
     
    37793802 *
    37803803 * @returns VBox status code.
    3781  * @param   pIntNet         The instance handle.
    37823804 * @param   hIf             The interface handle.
    37833805 * @param   pSession        The caller's session.
     
    37853807 *                          used if indefinite wait is desired.
    37863808 */
    3787 INTNETR0DECL(int) INTNETR0IfWait(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, uint32_t cMillies)
    3788 {
    3789     Log4(("INTNETR0IfWait: pIntNet=%p hIf=%RX32 cMillies=%u\n", pIntNet, hIf, cMillies));
     3809INTNETR0DECL(int) IntNetR0IfWait(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, uint32_t cMillies)
     3810{
     3811    Log4(("IntNetR0IfWait: hIf=%RX32 cMillies=%u\n", hIf, cMillies));
    37903812
    37913813    /*
    37923814     * Get and validate essential handles.
    37933815     */
     3816    PINTNET pIntNet = g_pIntNet;
    37943817    AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER);
     3818    AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC);
     3819
    37953820    PINTNETIF pIf = (PINTNETIF)RTHandleTableLookupWithCtx(pIntNet->hHtIfs, hIf, pSession);
    37963821    if (!pIf)
    37973822    {
    3798         Log(("INTNETR0IfWait: returns VERR_INVALID_HANDLE\n"));
     3823        Log(("IntNetR0IfWait: returns VERR_INVALID_HANDLE\n"));
    37993824        return VERR_INVALID_HANDLE;
    38003825    }
     
    38043829        &&  hRecvEvent != NIL_RTSEMEVENT)
    38053830    {
    3806         Log(("INTNETR0IfWait: returns VERR_SEM_DESTROYED\n"));
     3831        Log(("IntNetR0IfWait: returns VERR_SEM_DESTROYED\n"));
    38073832        return VERR_SEM_DESTROYED;
    38083833    }
     
    38363861    else
    38373862        rc = VERR_SEM_DESTROYED;
    3838     Log4(("INTNETR0IfWait: returns %Rrc\n", rc));
     3863    Log4(("IntNetR0IfWait: returns %Rrc\n", rc));
    38393864    return rc;
    38403865}
     
    38423867
    38433868/**
    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.
    38483872 * @param   pSession        The caller's session.
    38493873 * @param   pReq            The request packet.
    38503874 */
    3851 INTNETR0DECL(int) INTNETR0IfWaitReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFWAITREQ pReq)
     3875INTNETR0DECL(int) IntNetR0IfWaitReq(PSUPDRVSESSION pSession, PINTNETIFWAITREQ pReq)
    38523876{
    38533877    if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq)))
    38543878        return VERR_INVALID_PARAMETER;
    3855     return INTNETR0IfWait(pIntNet, pReq->hIf, pSession, pReq->cMillies);
     3879    return IntNetR0IfWait(pReq->hIf, pSession, pReq->cMillies);
    38563880}
    38573881
     
    38653889 * @param   pSession        The caller's session.
    38663890 */
    3867 INTNETR0DECL(int) INTNETR0IfClose(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession)
    3868 {
    3869     LogFlow(("INTNETR0IfClose: pIntNet=%p hIf=%RX32\n", pIntNet, hIf));
     3891INTNETR0DECL(int) IntNetR0IfClose(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession)
     3892{
     3893    LogFlow(("IntNetR0IfClose: hIf=%RX32\n", hIf));
    38703894
    38713895    /*
    38723896     * Validate and free the handle.
    38733897     */
     3898    PINTNET pIntNet = g_pIntNet;
    38743899    AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER);
     3900    AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC);
     3901
    38753902    PINTNETIF pIf = (PINTNETIF)RTHandleTableFreeWithCtx(pIntNet->hHtIfs, hIf, pSession);
    38763903    if (!pIf)
     
    38973924
    38983925    int rc = SUPR0ObjRelease(pvObj, pSession);
    3899     LogFlow(("INTNETR0IfClose: returns %Rrc\n", rc));
     3926    LogFlow(("IntNetR0IfClose: returns %Rrc\n", rc));
    39003927    return rc;
    39013928}
     
    39033930
    39043931/**
    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.
    39093935 * @param   pSession        The caller's session.
    39103936 * @param   pReq            The request packet.
    39113937 */
    3912 INTNETR0DECL(int) INTNETR0IfCloseReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETIFCLOSEREQ pReq)
     3938INTNETR0DECL(int) IntNetR0IfCloseReq(PSUPDRVSESSION pSession, PINTNETIFCLOSEREQ pReq)
    39133939{
    39143940    if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq)))
    39153941        return VERR_INVALID_PARAMETER;
    3916     return INTNETR0IfClose(pIntNet, pReq->hIf, pSession);
     3942    return IntNetR0IfClose(pReq->hIf, pSession);
    39173943}
    39183944
     
    51795205 *
    51805206 * @returns VBox status code.
    5181  * @param   pIntNet         The internal network instance.
    51825207 * @param   pSession        The session handle.
    51835208 * @param   pszNetwork      The network name.
     
    51905215 * @param   phIf            Where to store the handle to the network interface.
    51915216 */
    5192 INTNETR0DECL(int) INTNETR0Open(PINTNET pIntNet, PSUPDRVSESSION pSession, const char *pszNetwork,
     5217INTNETR0DECL(int) IntNetR0Open(PSUPDRVSESSION pSession, const char *pszNetwork,
    51935218                               INTNETTRUNKTYPE enmTrunkType, const char *pszTrunk, uint32_t fFlags,
    5194                                unsigned cbSend, unsigned cbRecv, PINTNETIFHANDLE phIf)
    5195 {
    5196     LogFlow(("INTNETR0Open: pIntNet=%p pSession=%p pszNetwork=%p:{%s} enmTrunkType=%d pszTrunk=%p:{%s} fFlags=%#x cbSend=%u cbRecv=%u phIf=%p\n",
    5197              pIntNet, 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));
    51985223
    51995224    /*
    52005225     * Validate input.
    52015226     */
     5227    PINTNET pIntNet = g_pIntNet;
    52025228    AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER);
     5229    AssertReturn(pIntNet->u32Magic, VERR_INVALID_MAGIC);
    52035230
    52045231    AssertPtrReturn(pszNetwork, VERR_INVALID_PARAMETER);
     
    52735300
    52745301    RTSemMutexRelease(pIntNet->hMtxCreateOpenDestroy);
    5275     LogFlow(("INTNETR0Open: return %Rrc *phIf=%RX32\n", rc, *phIf));
     5302    LogFlow(("IntNetR0Open: return %Rrc *phIf=%RX32\n", rc, *phIf));
    52765303    return rc;
    52775304}
     
    52825309 *
    52835310 * @returns see GMMR0MapUnmapChunk.
    5284  * @param   pIntNet         The internal networking instance.
    52855311 * @param   pSession        The caller's session.
    52865312 * @param   pReq            The request packet.
    52875313 */
    5288 INTNETR0DECL(int) INTNETR0OpenReq(PINTNET pIntNet, PSUPDRVSESSION pSession, PINTNETOPENREQ pReq)
     5314INTNETR0DECL(int) IntNetR0OpenReq(PSUPDRVSESSION pSession, PINTNETOPENREQ pReq)
    52895315{
    52905316    if (RT_UNLIKELY(pReq->Hdr.cbReq != sizeof(*pReq)))
    52915317        return VERR_INVALID_PARAMETER;
    5292     return INTNETR0Open(pIntNet, pSession, &pReq->szNetwork[0], pReq->enmTrunkType, pReq->szTrunk,
     5318    return IntNetR0Open(pSession, &pReq->szNetwork[0], pReq->enmTrunkType, pReq->szTrunk,
    52935319                        pReq->fFlags, pReq->cbSend, pReq->cbRecv, &pReq->hIf);
    52945320}
     
    52965322
    52975323/**
     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 */
     5331INTNETR0DECL(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/**
    52985361 * 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 */
     5363INTNETR0DECL(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;
    53095372    if (!pIntNet)
    53105373        return;
    53115374    AssertPtrReturnVoid(pIntNet);
     5375    AssertReturnVoid(pIntNet->u32Magic == INTNET_MAGIC);
    53125376
    53135377    /*
    53145378     * There is not supposed to be any networks hanging around at this time.
    53155379     */
     5380    AssertReturnVoid(ASMAtomicCmpXchgU32(&pIntNet->u32Magic, ~INTNET_MAGIC, INTNET_MAGIC));
    53165381    Assert(pIntNet->pNetworks == NULL);
    53175382    if (pIntNet->hMtxCreateOpenDestroy != NIL_RTSEMMUTEX)
     
    53325397
    53335398/**
    5334  * Create an instance of the Ring-0 internal networking service.
     5399 * Initalizes the internal network ring-0 service.
    53355400 *
    53365401 * @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 */
     5403INTNETR0DECL(int) IntNetR0Init(void)
     5404{
     5405    LogFlow(("IntNetR0Init:\n"));
    53425406    int rc = VERR_NO_MEMORY;
    53435407    PINTNET pIntNet = (PINTNET)RTMemAllocZ(sizeof(*pIntNet));
     
    53535417            if (RT_SUCCESS(rc))
    53545418            {
    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));
    53575422                return VINF_SUCCESS;
    53585423            }
     
    53625427        RTMemFree(pIntNet);
    53635428    }
    5364     *ppIntNet = NULL;
    5365     LogFlow(("INTNETR0Create: returns %Rrc\n", rc));
     5429    LogFlow(("IntNetR0Init: returns %Rrc\n", rc));
    53665430    return rc;
    53675431}
  • trunk/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp

    r28623 r28706  
    190190 * Sends the data @a pvBuf points to.
    191191 */
    192 static int tstIntNetSendBuf(PINTNET pIntNet, PINTNETRINGBUF pRingBuf, INTNETIFHANDLE hIf,
     192static int tstIntNetSendBuf(PINTNETRINGBUF pRingBuf, INTNETIFHANDLE hIf,
    193193                            PSUPDRVSESSION pSession, void const *pvBuf, size_t cbBuf)
    194194{
     
    197197    int rc = intnetR0RingWriteFrame(pRingBuf, &Sg, NULL);
    198198    if (RT_SUCCESS(rc))
    199         rc = INTNETR0IfSend(pIntNet, hIf, pSession);
     199        rc = IntNetR0IfSend(hIf, pSession);
    200200    return rc;
    201201}
     
    204204typedef struct MYARGS
    205205{
    206     PINTNET         pIntNet;
    207206    PINTNETBUF      pBuf;
    208207    INTNETIFHANDLE  hIf;
     
    258257        RTTEST_CHECK_RC_OK(g_hTest, rc = intnetR0RingWriteFrame(&pArgs->pBuf->Send, &Sg, NULL));
    259258        if (RT_SUCCESS(rc))
    260             RTTEST_CHECK_RC_OK(g_hTest, rc = INTNETR0IfSend(pArgs->pIntNet, pArgs->hIf, g_pSession));
     259            RTTEST_CHECK_RC_OK(g_hTest, rc = IntNetR0IfSend(pArgs->hIf, g_pSession));
    261260        cbSent += cb;
    262261    }
     
    271270    for (unsigned c = 0; c < 20; c++)
    272271    {
    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,
    274273                                                          abBuf, sizeof(RTMAC) * 2 + sizeof(unsigned) * 4));
    275274        RTThreadSleep(1);
     
    363362         * Wait for data.
    364363         */
    365         int rc = INTNETR0IfWait(pArgs->pIntNet, pArgs->hIf, g_pSession, RT_INDEFINITE_WAIT);
     364        int rc = IntNetR0IfWait(pArgs->hIf, g_pSession, RT_INDEFINITE_WAIT);
    366365        switch (rc)
    367366        {
     
    390389typedef struct TSTSTATE
    391390{
    392     PINTNET         pIntNet;
    393 
    394391    PINTNETBUF      pBuf0;
    395392    INTNETIFHANDLE  hIf0;
     
    410407{
    411408    pThis->hIf0 = INTNET_HANDLE_INVALID;
    412     RTTESTI_CHECK_RC_OK_RET(INTNETR0Open(pThis->pIntNet, g_pSession, pszNetwork, kIntNetTrunkType_None, "",
     409    RTTESTI_CHECK_RC_OK_RET(IntNetR0Open(g_pSession, pszNetwork, kIntNetTrunkType_None, "",
    413410                                         0/*fFlags*/, cbSend, cbRecv, &pThis->hIf0), rcCheck);
    414411    RTTESTI_CHECK_RET(pThis->hIf0 != INTNET_HANDLE_INVALID, VERR_INTERNAL_ERROR);
    415     RTTESTI_CHECK_RC_RET(INTNETR0IfGetRing0Buffer(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);
    416413    RTTESTI_CHECK_RET(pThis->pBuf0, VERR_INTERNAL_ERROR);
    417414
    418415
    419416    pThis->hIf1 = INTNET_HANDLE_INVALID;
    420     RTTESTI_CHECK_RC_OK_RET(INTNETR0Open(pThis->pIntNet, g_pSession, pszNetwork, kIntNetTrunkType_None, "",
     417    RTTESTI_CHECK_RC_OK_RET(IntNetR0Open(g_pSession, pszNetwork, kIntNetTrunkType_None, "",
    421418                                         0/*fFlags*/, cbSend, cbRecv, &pThis->hIf1), rcCheck);
    422419    RTTESTI_CHECK_RET(pThis->hIf1 != INTNET_HANDLE_INVALID, VERR_INTERNAL_ERROR);
    423     RTTESTI_CHECK_RC_RET(INTNETR0IfGetRing0Buffer(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);
    424421    RTTESTI_CHECK_RET(pThis->pBuf1, VERR_INTERNAL_ERROR);
    425422
     
    435432{
    436433    int rc;
    437     RTTESTI_CHECK_RC_OK(rc = INTNETR0IfClose(pThis->pIntNet, pThis->hIf0, g_pSession));
     434    RTTESTI_CHECK_RC_OK(rc = IntNetR0IfClose(pThis->hIf0, g_pSession));
    438435    if (RT_SUCCESS(rc))
    439436    {
     
    442439    }
    443440
    444     RTTESTI_CHECK_RC_OK(rc = INTNETR0IfClose(pThis->pIntNet, pThis->hIf1, g_pSession));
     441    RTTESTI_CHECK_RC_OK(rc = IntNetR0IfClose(pThis->hIf1, g_pSession));
    445442    if (RT_SUCCESS(rc))
    446443    {
     
    450447
    451448    /* The network should be dead now. */
    452     RTTESTI_CHECK(pThis->pIntNet->pNetworks == NULL);
     449    RTTESTI_CHECK(IntNetR0GetNetworkCount() == 0);
    453450}
    454451
     
    462459    Args0.hIf         = pThis->hIf0;
    463460    Args0.pBuf        = pThis->pBuf0;
    464     Args0.pIntNet     = pThis->pIntNet;
    465461    Args0.Mac.au16[0] = 0x8086;
    466462    Args0.Mac.au16[1] = 0;
     
    471467    Args1.hIf         = pThis->hIf1;
    472468    Args1.pBuf        = pThis->pBuf1;
    473     Args1.pIntNet     = pThis->pIntNet;
    474469    Args1.Mac.au16[0] = 0x8086;
    475470    Args1.Mac.au16[1] = 0;
     
    592587    static uint16_t const s_au16Frame[7] = { /* dst:*/ 0xffff, 0xffff, 0xffff, /*src:*/0x8086, 0, 0, 0x0800 };
    593588
    594     RTTESTI_CHECK_RC_RETV(tstIntNetSendBuf(pThis->pIntNet, &pThis->pBuf0->Send, pThis->hIf0,
     589    RTTESTI_CHECK_RC_RETV(tstIntNetSendBuf(&pThis->pBuf0->Send, pThis->hIf0,
    595590                                           g_pSession, &s_au16Frame, sizeof(s_au16Frame)),
    596591                          VINF_SUCCESS);
    597592
    598593    /* No echo, please */
    599     RTTESTI_CHECK_RC_RETV(INTNETR0IfWait(pThis->pIntNet, pThis->hIf0, g_pSession, 1), VERR_TIMEOUT);
     594    RTTESTI_CHECK_RC_RETV(IntNetR0IfWait(pThis->hIf0, g_pSession, 1), VERR_TIMEOUT);
    600595
    601596    /* The other interface should see it though.  But Wait should only return once, thank you. */
    602     RTTESTI_CHECK_RC_RETV(INTNETR0IfWait(pThis->pIntNet, pThis->hIf1, g_pSession, 1), VINF_SUCCESS);
    603     RTTESTI_CHECK_RC_RETV(INTNETR0IfWait(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);
    604599
    605600    /* Receive the data. */
     
    631626    static uint16_t const s_au16Frame[7] = { /* dst:*/ 0x8086, 0, 0,      /*src:*/0x8086, 0, 1, 0x0800 };
    632627
    633     RTTESTI_CHECK_RC_RETV(tstIntNetSendBuf(pThis->pIntNet, &pThis->pBuf1->Send, pThis->hIf1,
     628    RTTESTI_CHECK_RC_RETV(tstIntNetSendBuf(&pThis->pBuf1->Send, pThis->hIf1,
    634629                                           g_pSession, s_au16Frame, sizeof(s_au16Frame)),
    635630                          VINF_SUCCESS);
    636631
    637632    /* No echo, please */
    638     RTTESTI_CHECK_RC_RETV(INTNETR0IfWait(pThis->pIntNet, pThis->hIf1, g_pSession, 1), VERR_TIMEOUT);
     633    RTTESTI_CHECK_RC_RETV(IntNetR0IfWait(pThis->hIf1, g_pSession, 1), VERR_TIMEOUT);
    639634
    640635    /* The other interface should see it though.  But Wait should only return once, thank you. */
    641     RTTESTI_CHECK_RC_RETV(INTNETR0IfWait(pThis->pIntNet, pThis->hIf0, g_pSession, 1), VINF_SUCCESS);
    642     RTTESTI_CHECK_RC_RETV(INTNETR0IfWait(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);
    643638
    644639    /* Receive the data. */
     
    666661     * Create an INTNET instance.
    667662     */
    668     RTTestISub("INTNETR0Create");
    669     RTTESTI_CHECK_RC_RETV(INTNETR0Create(&pThis->pIntNet), VINF_SUCCESS);
     663    RTTestISub("IntNetR0Init");
     664    RTTESTI_CHECK_RC_RETV(IntNetR0Init(), VINF_SUCCESS);
    670665
    671666    /*
     
    676671    if (RT_FAILURE(rc))
    677672        return;
    678     RTTESTI_CHECK_RC(INTNETR0IfSetActive(pThis->pIntNet, pThis->hIf0, g_pSession, true), VINF_SUCCESS);
    679     RTTESTI_CHECK_RC(INTNETR0IfSetActive(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);
    680675
    681676    /*
    682677     * Test basic waiting.
    683678     */
    684     RTTestISub("INTNETR0IfWait");
    685     RTTESTI_CHECK_RC(INTNETR0IfWait(pThis->pIntNet, pThis->hIf0, g_pSession, 1), VERR_TIMEOUT);
    686     RTTESTI_CHECK_RC(INTNETR0IfWait(pThis->pIntNet, pThis->hIf0, g_pSession, 0), VERR_TIMEOUT);
    687     RTTESTI_CHECK_RC(INTNETR0IfWait(pThis->pIntNet, pThis->hIf1, g_pSession, 1), VERR_TIMEOUT);
    688     RTTESTI_CHECK_RC(INTNETR0IfWait(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);
    689684
    690685    /*
     
    718713     */
    719714    tstCloseInterfaces(pThis);
    720     INTNETR0Destroy(pThis->pIntNet);
     715    IntNetR0Term();
    721716}
    722717
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r28425 r28706  
    7070*   Global Variables                                                           *
    7171*******************************************************************************/
    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. */
    7574PFNRT g_VMMGCDeps[] =
    7675{
     
    110109                    if (RT_SUCCESS(rc))
    111110                    {
    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();
    116112                        if (RT_SUCCESS(rc))
    117113                        {
    118                             LogFlow(("ModuleInit: returns success. g_pIntNet=%p\n", g_pIntNet));
     114                            LogFlow(("ModuleInit: returns success.\n"));
    119115                            return VINF_SUCCESS;
    120116                        }
    121117
    122118                        /* bail out */
    123                         g_pIntNet = NULL;
    124119                        LogFlow(("ModuleTerm: returns %Rrc\n", rc));
    125120#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE
     
    150145
    151146    /*
    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();
    159150
    160151    /*
    161152     * PGM (Darwin) and HWACCM global cleanup.
    162      * Destroy the GMM and GVMM instances.
    163153     */
    164154#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE
     
    168158    HWACCMR0Term();
    169159
     160    /*
     161     * Destroy the GMM and GVMM instances.
     162     */
    170163    GMMR0Term();
    171164    GVMMR0Term();
     
    998991            if (u64Arg || !pReq || !vmmR0IsValidSession(pVM, pReq->pSession, pSession) || idCpu != NIL_VMCPUID)
    999992                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);
    1003994        }
    1004995
     
    1006997            if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFCLOSEREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID)
    1007998                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);
    10111000
    10121001        case VMMR0_DO_INTNET_IF_GET_RING3_BUFFER:
    10131002            if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFGETRING3BUFFERREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID)
    10141003                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);
    10181005
    10191006        case VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE:
    10201007            if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFSETPROMISCUOUSMODEREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID)
    10211008                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);
    10251010
    10261011        case VMMR0_DO_INTNET_IF_SET_MAC_ADDRESS:
    10271012            if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFSETMACADDRESSREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID)
    10281013                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);
    10321015
    10331016        case VMMR0_DO_INTNET_IF_SET_ACTIVE:
    10341017            if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFSETACTIVEREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID)
    10351018                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);
    10391020
    10401021        case VMMR0_DO_INTNET_IF_SEND:
    10411022            if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFSENDREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID)
    10421023                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);
    10461025
    10471026        case VMMR0_DO_INTNET_IF_WAIT:
    10481027            if (u64Arg || !pReqHdr || !vmmR0IsValidSession(pVM, ((PINTNETIFWAITREQ)pReqHdr)->pSession, pSession) || idCpu != NIL_VMCPUID)
    10491028                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);
    10531030
    10541031        /*
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette