VirtualBox

Ignore:
Timestamp:
Jul 11, 2008 1:21:35 PM (16 years ago)
Author:
vboxsync
Message:

Fixed the internal names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp

    r10485 r10524  
    171171 * @param   hIF         The interface handle to validate and translate.
    172172 */
    173 DECLINLINE(PINTNETIF) INTNETHandle2IFPtr(PINTNET pIntNet, INTNETIFHANDLE hIF)
     173DECLINLINE(PINTNETIF) intnetHandle2IFPtr(PINTNET pIntNet, INTNETIFHANDLE hIF)
    174174{
    175175    Assert(pIntNet);
     
    202202 * @param   pIF         The interface which we're allocating a handle for.
    203203 */
    204 static INTNETIFHANDLE INTNETHandleAllocate(PINTNET pIntNet, PINTNETIF pIF)
     204static INTNETIFHANDLE intnetHandleAllocate(PINTNET pIntNet, PINTNETIF pIF)
    205205{
    206206    Assert(pIF);
     
    287287 * @param   h           The handle we're freeing.
    288288 */
    289 static void INTNETHandleFree(PINTNET pIntNet, INTNETIFHANDLE h)
    290 {
    291     Assert(INTNETHandle2IFPtr(pIntNet, h));
     289static void intnetHandleFree(PINTNET pIntNet, INTNETIFHANDLE h)
     290{
     291    Assert(intnetHandle2IFPtr(pIntNet, h));
    292292    PINTNETHT       pHT = &pIntNet->IfHandles;
    293293    const uint32_t  i   = h & INTNET_HANDLE_INDEX_MASK;
     
    327327 *                      ensuring that there is sufficient space for the frame.
    328328 */
    329 static unsigned INTNETRingReadFrame(PINTNETBUF pBuf, PINTNETRINGBUF pRingBuf, void *pvFrame)
     329static unsigned intnetRingReadFrame(PINTNETBUF pBuf, PINTNETRINGBUF pRingBuf, void *pvFrame)
    330330{
    331331    Assert(pRingBuf->offRead < pBuf->cbBuf);
     
    359359 * @param   cbFrame     The size of the frame.
    360360 */
    361 static int INTNETRingWriteFrame(PINTNETBUF pBuf, PINTNETRINGBUF pRingBuf, const void *pvFrame, uint32_t cbFrame)
     361static int intnetRingWriteFrame(PINTNETBUF pBuf, PINTNETRINGBUF pRingBuf, const void *pvFrame, uint32_t cbFrame)
    362362{
    363363    /*
     
    465465{
    466466    LogFlow(("intnetIfSend: pIf=%p:{.hIf=%RX32}\n", pIf, pIf->hIf));
    467     int rc = INTNETRingWriteFrame(pIf->pIntBuf, &pIf->pIntBuf->Recv, pvFrame, cbFrame);
     467    int rc = intnetRingWriteFrame(pIf->pIntBuf, &pIf->pIntBuf->Recv, pvFrame, cbFrame);
    468468    if (VBOX_SUCCESS(rc))
    469469    {
     
    486486            RTSemEventSignal(pIf->Event);
    487487            RTThreadYield();
    488             rc = INTNETRingWriteFrame(pIf->pIntBuf, &pIf->pIntBuf->Recv, pvFrame, cbFrame);
     488            rc = intnetRingWriteFrame(pIf->pIntBuf, &pIf->pIntBuf->Recv, pvFrame, cbFrame);
    489489            if (VBOX_SUCCESS(rc))
    490490            {
     
    607607     */
    608608    AssertReturn(pIntNet, VERR_INVALID_PARAMETER);
    609     PINTNETIF pIf = INTNETHandle2IFPtr(pIntNet, hIf);
     609    PINTNETIF pIf = intnetHandle2IFPtr(pIntNet, hIf);
    610610    if (!pIf)
    611611        return VERR_INVALID_HANDLE;
     
    684684     */
    685685    AssertReturn(pIntNet, VERR_INVALID_PARAMETER);
    686     PINTNETIF pIf = INTNETHandle2IFPtr(pIntNet, hIf);
     686    PINTNETIF pIf = intnetHandle2IFPtr(pIntNet, hIf);
    687687    if (!pIf)
    688688        return VERR_INVALID_HANDLE;
     
    737737     */
    738738    AssertReturn(pIntNet, VERR_INVALID_PARAMETER);
    739     PINTNETIF pIf = INTNETHandle2IFPtr(pIntNet, hIf);
     739    PINTNETIF pIf = intnetHandle2IFPtr(pIntNet, hIf);
    740740    if (!pIf)
    741741        return VERR_INVALID_HANDLE;
     
    773773     */
    774774    AssertReturn(pIntNet, VERR_INVALID_PARAMETER);
    775     PINTNETIF pIf = INTNETHandle2IFPtr(pIntNet, hIf);
     775    PINTNETIF pIf = intnetHandle2IFPtr(pIntNet, hIf);
    776776    if (!pIf)
    777777        return VERR_INVALID_HANDLE;
     
    813813     */
    814814    AssertReturn(pIntNet, VERR_INVALID_PARAMETER);
    815     PINTNETIF pIf = INTNETHandle2IFPtr(pIntNet, hIf);
     815    PINTNETIF pIf = intnetHandle2IFPtr(pIntNet, hIf);
    816816    if (!pIf)
    817817    {
     
    862862     */
    863863    AssertReturn(pIntNet, VERR_INVALID_PARAMETER);
    864     PINTNETIF pIf = INTNETHandle2IFPtr(pIntNet, hIf);
     864    PINTNETIF pIf = intnetHandle2IFPtr(pIntNet, hIf);
    865865    if (!pIf)
    866866    {
     
    934934     */
    935935    AssertPtrReturn(pIntNet, VERR_INVALID_PARAMETER);
    936     PINTNETIF pIf = INTNETHandle2IFPtr(pIntNet, hIf);
     936    PINTNETIF pIf = intnetHandle2IFPtr(pIntNet, hIf);
    937937    if (!pIf)
    938938        return VERR_INVALID_HANDLE;
     
    967967 * @param   pvUser2     Pointer to the INTNET instance data.
    968968 */
    969 static DECLCALLBACK(void) INTNETIfDestruct(void *pvObj, void *pvUser1, void *pvUser2)
    970 {
    971     LogFlow(("INTNETIfDestruct: pvObj=%p pvUser1=%p pvUser2=%p\n", pvObj, pvUser1, pvUser2));
     969static DECLCALLBACK(void) intnetIfDestruct(void *pvObj, void *pvUser1, void *pvUser2)
     970{
     971    LogFlow(("intnetIfDestruct: pvObj=%p pvUser1=%p pvUser2=%p\n", pvObj, pvUser1, pvUser2));
    972972    PINTNETIF pIf = (PINTNETIF)pvUser1;
    973973    PINTNET   pIntNet = (PINTNET)pvUser2;
     
    978978    if (pIf->hIf != INTNET_HANDLE_INVALID)
    979979    {
    980         INTNETHandleFree(pIntNet, pIf->hIf);
     980        intnetHandleFree(pIntNet, pIf->hIf);
    981981        ASMAtomicXchgSize(&pIf->hIf, INTNET_HANDLE_INVALID);
    982982    }
     
    10861086 * @param   phIf        Where to store the interface handle.
    10871087 */
    1088 static int INTNETNetworkCreateIf(PINTNETNETWORK pNetwork, PSUPDRVSESSION pSession, unsigned cbSend, unsigned cbRecv, PINTNETIFHANDLE phIf)
    1089 {
    1090     LogFlow(("INTNETNetworkCreateIf: pNetwork=%p pSession=%p cbSend=%u cbRecv=%u phIf=%p\n",
     1088static int intnetNetworkCreateIf(PINTNETNETWORK pNetwork, PSUPDRVSESSION pSession, unsigned cbSend, unsigned cbRecv, PINTNETIFHANDLE phIf)
     1089{
     1090    LogFlow(("intnetNetworkCreateIf: pNetwork=%p pSession=%p cbSend=%u cbRecv=%u phIf=%p\n",
    10911091             pNetwork, pSession, cbSend, cbRecv, phIf));
    10921092
     
    11501150                 * Register the interface with the session.
    11511151                 */
    1152                 pIf->pvObj = SUPR0ObjRegister(pSession, SUPDRVOBJTYPE_INTERNAL_NETWORK_INTERFACE, INTNETIfDestruct, pIf, pNetwork->pIntNet);
     1152                pIf->pvObj = SUPR0ObjRegister(pSession, SUPDRVOBJTYPE_INTERNAL_NETWORK_INTERFACE, intnetIfDestruct, pIf, pNetwork->pIntNet);
    11531153                if (pIf->pvObj)
    11541154                {
    1155                     pIf->hIf = INTNETHandleAllocate(pNetwork->pIntNet, pIf);
     1155                    pIf->hIf = intnetHandleAllocate(pNetwork->pIntNet, pIf);
    11561156                    if (pIf->hIf != INTNET_HANDLE_INVALID)
    11571157                    {
    11581158                        *phIf = pIf->hIf;
    1159                         LogFlow(("INTNETNetworkCreateIf: returns VINF_SUCCESS *phIf=%p\n", *phIf));
     1159                        LogFlow(("intnetNetworkCreateIf: returns VINF_SUCCESS *phIf=%p\n", *phIf));
    11601160                        return VINF_SUCCESS;
    11611161                    }
     
    11631163
    11641164                    SUPR0ObjRelease(pIf->pvObj, pSession);
    1165                     LogFlow(("INTNETNetworkCreateIf: returns %Vrc\n", rc));
     1165                    LogFlow(("intnetNetworkCreateIf: returns %Vrc\n", rc));
    11661166                    return rc;
    11671167                }
     
    11791179    }
    11801180    RTMemFree(pIf);
    1181     LogFlow(("INTNETNetworkCreateIf: returns %Vrc\n", rc));
     1181    LogFlow(("intnetNetworkCreateIf: returns %Vrc\n", rc));
    11821182    return rc;
    11831183}
     
    11851185
    11861186/**
    1187  * Close a network which was opened/created using INTNETOpenNetwork()/INTNETCreateNetwork().
     1187 * Close a network which was opened/created using intnetOpenNetwork()/intnetCreateNetwork().
    11881188 *
    11891189 * @param   pNetwork    The network to close.
    11901190 * @param   pSession    The session handle.
    11911191 */
    1192 static int INTNETNetworkClose(PINTNETNETWORK pNetwork, PSUPDRVSESSION pSession)
    1193 {
    1194     LogFlow(("INTNETNetworkClose: pNetwork=%p pSession=%p\n", pNetwork, pSession));
     1192static int intnetNetworkClose(PINTNETNETWORK pNetwork, PSUPDRVSESSION pSession)
     1193{
     1194    LogFlow(("intnetNetworkClose: pNetwork=%p pSession=%p\n", pNetwork, pSession));
    11951195    AssertPtrReturn(pSession, VERR_INVALID_PARAMETER);
    11961196    AssertPtrReturn(pNetwork, VERR_INVALID_PARAMETER);
     
    12011201    int rc = SUPR0ObjRelease(pNetwork->pvObj, pSession);
    12021202    RTSpinlockRelease(pIntNet->Spinlock, &Tmp);
    1203     LogFlow(("INTNETNetworkClose: return %Vrc\n", rc));
     1203    LogFlow(("intnetNetworkClose: return %Vrc\n", rc));
    12041204    return rc;
    12051205}
     
    12141214 * @param   pvUser2     Pointer to the INTNET instance data.
    12151215 */
    1216 static DECLCALLBACK(void) INTNETNetworkDestruct(void *pvObj, void *pvUser1, void *pvUser2)
    1217 {
    1218     LogFlow(("INTNETNetworkDestruct: pvObj=%p pvUser1=%p pvUser2=%p\n", pvObj, pvUser1, pvUser2));
     1216static DECLCALLBACK(void) intnetNetworkDestruct(void *pvObj, void *pvUser1, void *pvUser2)
     1217{
     1218    LogFlow(("intnetNetworkDestruct: pvObj=%p pvUser1=%p pvUser2=%p\n", pvObj, pvUser1, pvUser2));
    12191219    RTSPINLOCKTMP   Tmp = RTSPINLOCKTMP_INITIALIZER;
    12201220    PINTNETNETWORK  pNetwork = (PINTNETNETWORK)pvUser1;
     
    12771277 * @param   ppNetwork   Where to store the pointer to the network on success.
    12781278 */
    1279 static int INTNETOpenNetwork(PINTNET pIntNet, PSUPDRVSESSION pSession, const char *pszNetwork, PINTNETNETWORK *ppNetwork)
    1280 {
    1281     LogFlow(("INTNETOpenNetwork: pIntNet=%p pSession=%p pszNetwork=%p:{%s} ppNetwork=%p\n",
     1279static int intnetOpenNetwork(PINTNET pIntNet, PSUPDRVSESSION pSession, const char *pszNetwork, PINTNETNETWORK *ppNetwork)
     1280{
     1281    LogFlow(("intnetOpenNetwork: pIntNet=%p pSession=%p pszNetwork=%p:{%s} ppNetwork=%p\n",
    12821282             pIntNet, pSession, pszNetwork, pszNetwork, ppNetwork));
    12831283
     
    13231323                }
    13241324            }
    1325             LogFlow(("INTNETOpenNetwork: returns %Vrc *ppNetwork=%p\n", rc, *ppNetwork));
     1325            LogFlow(("intnetOpenNetwork: returns %Vrc *ppNetwork=%p\n", rc, *ppNetwork));
    13261326            return rc;
    13271327        }
     
    13301330    RTSpinlockRelease(pIntNet->Spinlock, &Tmp);
    13311331
    1332     LogFlow(("INTNETOpenNetwork: returns VERR_FILE_NOT_FOUND\n"));
     1332    LogFlow(("intnetOpenNetwork: returns VERR_FILE_NOT_FOUND\n"));
    13331333    return VERR_FILE_NOT_FOUND;
    13341334}
     
    13491349 * @param   ppNetwork       Where to store the network.
    13501350 */
    1351 static int INTNETCreateNetwork(PINTNET pIntNet, PSUPDRVSESSION pSession, const char *pszNetwork, bool fRestrictAccess, PINTNETNETWORK *ppNetwork)
    1352 {
    1353     LogFlow(("INTNETCreateNetwork: pIntNet=%p pSession=%p pszNetwork=%p:{%s} ppNetwork=%p\n",
     1351static int intnetCreateNetwork(PINTNET pIntNet, PSUPDRVSESSION pSession, const char *pszNetwork, bool fRestrictAccess, PINTNETNETWORK *ppNetwork)
     1352{
     1353    LogFlow(("intnetCreateNetwork: pIntNet=%p pSession=%p pszNetwork=%p:{%s} ppNetwork=%p\n",
    13541354             pIntNet, pSession, pszNetwork, pszNetwork, ppNetwork));
    13551355
     
    13711371        {
    13721372            RTSpinlockRelease(pIntNet->Spinlock, &Tmp);
    1373             LogFlow(("INTNETCreateNetwork: returns VERR_ALREADY_EXISTS\n"));
     1373            LogFlow(("intnetCreateNetwork: returns VERR_ALREADY_EXISTS\n"));
    13741374            return VERR_ALREADY_EXISTS;
    13751375        }
     
    13951395         * Register the object in the current session.
    13961396         */
    1397         pNew->pvObj = SUPR0ObjRegister(pSession, SUPDRVOBJTYPE_INTERNAL_NETWORK, INTNETNetworkDestruct, pNew, pIntNet);
     1397        pNew->pvObj = SUPR0ObjRegister(pSession, SUPDRVOBJTYPE_INTERNAL_NETWORK, intnetNetworkDestruct, pNew, pIntNet);
    13981398        if (pNew->pvObj)
    13991399        {
     
    14161416            {
    14171417                *ppNetwork = pNew;
    1418                 LogFlow(("INTNETCreateNetwork: returns VINF_SUCCESS *ppNetwork=%p\n", pNew));
     1418                LogFlow(("intnetCreateNetwork: returns VINF_SUCCESS *ppNetwork=%p\n", pNew));
    14191419                return VINF_SUCCESS;
    14201420            }
     
    14221422            /* The release will destroy the object. */
    14231423            SUPR0ObjRelease(pNew->pvObj, pSession);
    1424             LogFlow(("INTNETCreateNetwork: returns %Vrc\n", rc));
     1424            LogFlow(("intnetCreateNetwork: returns %Vrc\n", rc));
    14251425            return rc;
    14261426        }
     
    14311431    }
    14321432    RTMemFree(pNew);
    1433     LogFlow(("INTNETCreateNetwork: returns %Vrc\n", rc));
     1433    LogFlow(("intnetCreateNetwork: returns %Vrc\n", rc));
    14341434    return rc;
    14351435}
     
    15081508     */
    15091509    PINTNETNETWORK pNetwork;
    1510     rc = INTNETOpenNetwork(pIntNet, pSession, pszNetwork, &pNetwork);
     1510    rc = intnetOpenNetwork(pIntNet, pSession, pszNetwork, &pNetwork);
    15111511    if (rc == VERR_FILE_NOT_FOUND)
    1512         rc = INTNETCreateNetwork(pIntNet, pSession, pszNetwork, !(fFlags & INTNET_OPEN_FLAGS_PUBLIC), &pNetwork);
     1512        rc = intnetCreateNetwork(pIntNet, pSession, pszNetwork, !(fFlags & INTNET_OPEN_FLAGS_PUBLIC), &pNetwork);
    15131513    if (VBOX_SUCCESS(rc))
    15141514    {
     
    15181518         * interface is destroyed or the last session is doing cleanup (order problems).
    15191519         */
    1520         rc = INTNETNetworkCreateIf(pNetwork, pSession, cbSend, cbRecv, phIf);
     1520        rc = intnetNetworkCreateIf(pNetwork, pSession, cbSend, cbRecv, phIf);
    15211521        if (VBOX_FAILURE(rc))
    1522             INTNETNetworkClose(pNetwork, pSession);
     1522            intnetNetworkClose(pNetwork, pSession);
    15231523    }
    15241524
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