VirtualBox

Changeset 28706 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Apr 25, 2010 3:10:30 PM (15 years ago)
Author:
vboxsync
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/include/VBox
Files:
2 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. */
Note: See TracChangeset for help on using the changeset viewer.

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