VirtualBox

Changeset 29491 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
May 14, 2010 5:46:22 PM (15 years ago)
Author:
vboxsync
Message:

IntNet: added MAC address notification and connect/disconnect interface callbacks.

File:
1 edited

Legend:

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

    r29362 r29491  
    36223622        }
    36233623
     3624        PINTNETTRUNKIF pTrunk = pNetwork->MacTab.pTrunk;
    36243625        RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock, &Tmp);
     3626        if (pTrunk && pTrunk->pIfPort)
     3627        {
     3628            Log(("IntNetR0IfSetMacAddress: pfnNotifyMacAddress hIf=%RX32\n", hIf));
     3629            pTrunk->pIfPort->pfnNotifyMacAddress(pTrunk->pIfPort, hIf, pMac);
     3630        }
    36253631    }
    36263632    else
     
    39643970    ASMAtomicWriteBool(&pIf->fDestroying, true);
    39653971
     3972    PINTNETNETWORK pNetwork = pIf->pNetwork;
     3973    PINTNETTRUNKIF pTrunk = pNetwork->MacTab.pTrunk;
     3974    if (pTrunk && pTrunk->pIfPort)
     3975    {
     3976        Log(("intnetR0IfDestruct: pfnDisconnectInterface hIf=%RX32\n", pIf->hIf));
     3977        pTrunk->pIfPort->pfnDisconnectInterface(pTrunk->pIfPort, pIf->hIf);
     3978    }
     3979
    39663980    /*
    39673981     * Delete the interface handle so the object no longer can be used.
     
    39793993     * of cleanup order we might have been orphaned by the network destructor.
    39803994     */
    3981     PINTNETNETWORK pNetwork = pIf->pNetwork;
    39823995    if (pNetwork)
    39833996    {
     
    40794092        intnetR0IfAddrCacheDestroy(&pIf->aAddrCache[i]);
    40804093
    4081      pIf->pvObj = NULL;
     4094    pIf->pvObj = NULL;
    40824095    RTMemFree(pIf);
    40834096}
     
    42004213                    pNetwork->MacTab.cEntries = iIf + 1;
    42014214                    pIf->pNetwork = pNetwork;
     4215
     4216                    /** @todo handle failure of pfnConnectInterface */
     4217                    PINTNETTRUNKIF pTrunk = pNetwork->MacTab.pTrunk;
     4218                    if (pTrunk && pTrunk->pIfPort)
     4219                    {
     4220                        Log(("intnetR0NetworkCreateIf: pfnConnectInterface hIf=%RX32\n", pIf->hIf));
     4221                        pTrunk->pIfPort->pfnConnectInterface(pTrunk->pIfPort, pIf->hIf);
     4222                    }
    42024223
    42034224                    RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock, &Tmp);
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