- Timestamp:
- May 14, 2010 5:46:22 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/intnet.h
r28830 r29491 648 648 649 649 /** 650 * Notifies when the MAC address of an interface is set or changes. 651 * 652 * @param pIfPort Pointer to this structure. 653 * @param hIf The handle of the network interface. 654 * @param pMac Pointer to the MAC address of the connecting VM NIC. 655 */ 656 DECLR0CALLBACKMEMBER(void, pfnNotifyMacAddress,(PINTNETTRUNKIFPORT pIfPort, INTNETIFHANDLE hIf, PCRTMAC pMac)); 657 658 /** 659 * Called when an interface is connected to the network. 660 * 661 * @returns IPRT status code. 662 * @param pIfPort Pointer to this structure. 663 * @param hIf The handle of the network interface. 664 */ 665 DECLR0CALLBACKMEMBER(int, pfnConnectInterface,(PINTNETTRUNKIFPORT pIfPort, INTNETIFHANDLE hIf)); 666 667 /** 668 * Called when an interface is disconnected from the network. 669 * 670 * @returns IPRT status code. 671 * @param pIfPort Pointer to this structure. 672 * @param hIf The handle of the network interface. 673 */ 674 DECLR0CALLBACKMEMBER(int, pfnDisconnectInterface,(PINTNETTRUNKIFPORT pIfPort, INTNETIFHANDLE hIf)); 675 676 /** 650 677 * Waits for the interface to become idle. 651 678 * -
trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
r29362 r29491 3622 3622 } 3623 3623 3624 PINTNETTRUNKIF pTrunk = pNetwork->MacTab.pTrunk; 3624 3625 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 } 3625 3631 } 3626 3632 else … … 3964 3970 ASMAtomicWriteBool(&pIf->fDestroying, true); 3965 3971 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 3966 3980 /* 3967 3981 * Delete the interface handle so the object no longer can be used. … … 3979 3993 * of cleanup order we might have been orphaned by the network destructor. 3980 3994 */ 3981 PINTNETNETWORK pNetwork = pIf->pNetwork;3982 3995 if (pNetwork) 3983 3996 { … … 4079 4092 intnetR0IfAddrCacheDestroy(&pIf->aAddrCache[i]); 4080 4093 4081 4094 pIf->pvObj = NULL; 4082 4095 RTMemFree(pIf); 4083 4096 } … … 4200 4213 pNetwork->MacTab.cEntries = iIf + 1; 4201 4214 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 } 4202 4223 4203 4224 RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock, &Tmp); -
trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c
r29464 r29491 535 535 536 536 /** 537 * @copydoc INTNETTRUNKIFPORT::pfnNotifyMacAddress 538 */ 539 static DECLCALLBACK(void) vboxNetFltPortNotifyMacAddress(PINTNETTRUNKIFPORT pIfPort, INTNETIFHANDLE hIf, PCRTMAC pMac) 540 { 541 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); 542 543 /* 544 * Input validation. 545 */ 546 AssertPtr(pThis); 547 AssertPtr(pSG); 548 Assert(pThis->MyPort.u32Version == INTNETTRUNKIFPORT_VERSION); 549 550 vboxNetFltRetain(pThis, false /* fBusy */); 551 vboxNetFltPortOsNotifyMacAddress(pThis, hIf, pMac); 552 vboxNetFltRelease(pThis, false /* fBusy */); 553 } 554 555 556 /** 557 * @copydoc INTNETTRUNKIFPORT::pfnConnectInterface 558 */ 559 static DECLCALLBACK(int) vboxNetFltPortConnectInterface(PINTNETTRUNKIFPORT pIfPort, INTNETIFHANDLE hIf) 560 { 561 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); 562 int rc = VINF_SUCCESS; 563 564 /* 565 * Input validation. 566 */ 567 AssertPtr(pThis); 568 AssertPtr(pSG); 569 Assert(pThis->MyPort.u32Version == INTNETTRUNKIFPORT_VERSION); 570 571 vboxNetFltRetain(pThis, false /* fBusy */); 572 rc = vboxNetFltPortOsConnectInterface(pThis, hIf); 573 vboxNetFltRelease(pThis, false /* fBusy */); 574 575 return rc; 576 } 577 578 579 /** 580 * @copydoc INTNETTRUNKIFPORT::pfnDisconnectInterface 581 */ 582 static DECLCALLBACK(int) vboxNetFltPortDisconnectInterface(PINTNETTRUNKIFPORT pIfPort, INTNETIFHANDLE hIf) 583 { 584 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); 585 int rc = VINF_SUCCESS; 586 587 /* 588 * Input validation. 589 */ 590 AssertPtr(pThis); 591 AssertPtr(pSG); 592 Assert(pThis->MyPort.u32Version == INTNETTRUNKIFPORT_VERSION); 593 594 vboxNetFltRetain(pThis, false /* fBusy */); 595 rc = vboxNetFltPortOsDisconnectInterface(pThis, hIf); 596 vboxNetFltRelease(pThis, false /* fBusy */); 597 598 return rc; 599 } 600 601 602 /** 537 603 * @copydoc INTNETTRUNKIFPORT::pfnDisconnectAndRelease 538 604 */ … … 933 999 pNew->MyPort.pfnWaitForIdle = vboxNetFltPortWaitForIdle; 934 1000 pNew->MyPort.pfnXmit = vboxNetFltPortXmit; 1001 pNew->MyPort.pfnNotifyMacAddress = vboxNetFltPortNotifyMacAddress; 1002 pNew->MyPort.pfnConnectInterface = vboxNetFltPortConnectInterface; 1003 pNew->MyPort.pfnDisconnectInterface = vboxNetFltPortDisconnectInterface; 935 1004 pNew->MyPort.u32VersionEnd = INTNETTRUNKIFPORT_VERSION; 936 1005 pNew->pSwitchPort = pSwitchPort; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFltInternal.h
r29108 r29491 380 380 381 381 /** 382 * This is called when a network interface has obtained a new MAC address. 383 * 384 * @param pThis The instance. 385 * @param hIf The handle to the network. 386 * @param pMac Pointer to the new MAC address. 387 */ 388 DECLHIDDEN(void) vboxNetFltPortOsNotifyMacAddress(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf, PCRTMAC pMac); 389 390 /** 391 * This is called when an interface is connected to the network. 392 * 393 * @return IPRT status code. 394 * @param pThis The instance. 395 * @param hIf The handle to the network. 396 */ 397 DECLHIDDEN(int) vboxNetFltPortOsConnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf); 398 399 /** 400 * This is called when a VM host disconnects from the network. 401 * 402 * @param pThis The instance. 403 * @param hIf The handle to the network. 404 */ 405 DECLHIDDEN(int) vboxNetFltPortOsDisconnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf); 406 407 /** 382 408 * This is called to when disconnecting from a network. 383 409 * -
trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
r28830 r29491 1191 1191 } 1192 1192 1193 1194 void vboxNetFltPortOsNotifyMacAddress(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf, PCRTMAC pMac) 1195 { 1196 NOREF(pThis); NOREF(hIf); NOREF(pMac); 1197 } 1198 1199 1200 int vboxNetFltPortOsConnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf) 1201 { 1202 /* Nothing to do */ 1203 NOREF(pThis); NOREF(hIf); 1204 return VINF_SUCCESS; 1205 } 1206 1207 1208 int vboxNetFltPortOsDisconnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf) 1209 { 1210 /* Nothing to do */ 1211 NOREF(pThis); NOREF(hIf); 1212 return VINF_SUCCESS; 1213 } 1214 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
r28830 r29491 745 745 return VINF_SUCCESS; 746 746 } 747 748 void vboxNetFltPortOsNotifyMacAddress(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf, PCRTMAC pMac) 749 { 750 NOREF(pThis); NOREF(hIf); NOREF(pMac); 751 } 752 753 int vboxNetFltPortOsConnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf) 754 { 755 /* Nothing to do */ 756 NOREF(pThis); NOREF(hIf); 757 return VINF_SUCCESS; 758 } 759 760 int vboxNetFltPortOsDisconnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf) 761 { 762 /* Nothing to do */ 763 NOREF(pThis); NOREF(hIf); 764 return VINF_SUCCESS; 765 } 766 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
r28830 r29491 1765 1765 } 1766 1766 1767 1768 void vboxNetFltPortOsNotifyMacAddress(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf, PCRTMAC pMac) 1769 { 1770 NOREF(pThis); NOREF(hIf); NOREF(pMac); 1771 } 1772 1773 1774 int vboxNetFltPortOsConnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf) 1775 { 1776 /* Nothing to do */ 1777 NOREF(pThis); NOREF(hIf); 1778 return VINF_SUCCESS; 1779 } 1780 1781 1782 int vboxNetFltPortOsDisconnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf) 1783 { 1784 /* Nothing to do */ 1785 NOREF(pThis); NOREF(hIf); 1786 return VINF_SUCCESS; 1787 } 1788 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r28961 r29491 3705 3705 3706 3706 3707 void vboxNetFltPortOsNotifyMacAddress(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf, PCRTMAC pMac) 3708 { 3709 NOREF(pThis); NOREF(hIf); NOREF(pMac); 3710 } 3711 3712 3713 int vboxNetFltPortOsConnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf) 3714 { 3715 /* Nothing to do */ 3716 NOREF(pThis); NOREF(hIf); 3717 return VINF_SUCCESS; 3718 } 3719 3720 3721 int vboxNetFltPortOsDisconnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf) 3722 { 3723 /* Nothing to do */ 3724 NOREF(pThis); NOREF(hIf); 3725 return VINF_SUCCESS; 3726 } 3727 3728 3707 3729 int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, PINTNETSG pSG, uint32_t fDst) 3708 3730 { -
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFltBow-solaris.c
r29469 r29491 1094 1094 } 1095 1095 1096 1097 void vboxNetFltPortOsNotifyMacAddress(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf, PCRTMAC pMac) 1098 { 1099 LogRel((DEVICE_NAME ":vboxNetFltPortOSNotifyMacAddress %s %.6Rhxs\n", pThis->szName, pMac)); 1100 } 1101 1102 1103 int vboxNetFltPortOsConnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf) 1104 { 1105 LogRel((DEVICE_NAME ":vboxNetFltPortOsConnectInterface\n")); 1106 return VINF_SUCCESS; 1107 } 1108 1109 1110 int vboxNetFltPortOsDisconnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf) 1111 { 1112 LogRel((DEVICE_NAME ":vboxNetFltPortOsDisconnectInterface\n")); 1113 return VINF_SUCCESS; 1114 } 1115 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.c
r29464 r29491 3777 3777 } 3778 3778 3779 void vboxNetFltPortOsNotifyMacAddress(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf, PCRTMAC pMac) 3780 { 3781 NOREF(pThis); NOREF(hIf); NOREF(pMac); 3782 } 3783 3784 int vboxNetFltPortOsConnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf) 3785 { 3786 /* Nothing to do */ 3787 NOREF(pThis); NOREF(hIf); 3788 return VINF_SUCCESS; 3789 } 3790 3791 int vboxNetFltPortOsDisconnectInterface(PVBOXNETFLTINS pThis, INTNETIFHANDLE hIf) 3792 { 3793 /* Nothing to do */ 3794 NOREF(pThis); NOREF(hIf); 3795 return VINF_SUCCESS; 3796 } 3797
Note:
See TracChangeset
for help on using the changeset viewer.