Changeset 28666 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
- Timestamp:
- Apr 23, 2010 5:25:58 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
r28070 r28666 525 525 } 526 526 527 static bool vboxNetFltFreeBsdIsPromiscuous(PVBOXNETFLTINS pThis) 528 { 529 /** @todo This isn't taking into account that we put the interface in 530 * promiscuous mode. */ 531 return (pThis->u.s.flags & IFF_PROMISC) ? true : false; 532 } 533 527 534 int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, void *pvContext) 528 535 { … … 544 551 ASMAtomicUoWritePtr((void * volatile *)&pThis->u.s.ifp, ifp); 545 552 pThis->u.s.node = node; 546 bcopy(IF_LLADDR(ifp), &pThis->u.s.Mac , ETHER_ADDR_LEN);553 bcopy(IF_LLADDR(ifp), &pThis->u.s.MacAddr, ETHER_ADDR_LEN); 547 554 ASMAtomicUoWriteBool(&pThis->fDisconnectedFromHost, false); 555 548 556 /* Initialize deferred input queue */ 549 557 bzero(&pThis->u.s.inq, sizeof(struct ifqueue)); … … 559 567 560 568 NG_NODE_SET_PRIVATE(node, pThis); 569 561 570 /* Attempt to name it vboxnetflt_<ifname> */ 562 571 snprintf(nam, NG_NODESIZ, "vboxnetflt_%s", pThis->szName); 563 572 ng_name_node(node, nam); 573 574 /* Report MAC address, promiscuous mode and GSO capabilities. */ 575 /** @todo keep these reports up to date, either by polling for changes or 576 * intercept some control flow if possible. */ 577 Assert(pThis->pSwitchPort); 578 pThis->pSwitchPort->pfnReportMacAddress(pThis->pSwitchPort, &pThis->u.s.MacAddr); 579 pThis->pSwitchPort->pfnReportPromiscuousMode(pThis->pSwitchPort, vboxNetFltFreeBsdIsPromiscuous(pThis)); 580 pThis->pSwitchPort->pfnReportGsoCapabilities(pThis->pSwitchPort, 0, INTNETTRUNKDIR_WIRE | INTNETTRUNKDIR_HOST); 564 581 565 582 return VINF_SUCCESS; … … 704 721 } 705 722 706 bool vboxNetFltPortOsIsPromiscuous(PVBOXNETFLTINS pThis)707 {708 return (pThis->u.s.flags & IFF_PROMISC) ? true : false;709 }710 711 void vboxNetFltPortOsGetMacAddress(PVBOXNETFLTINS pThis, PRTMAC pMac)712 {713 *pMac = pThis->u.s.Mac;714 }715 716 bool vboxNetFltPortOsIsHostMac(PVBOXNETFLTINS pThis, PCRTMAC pMac)717 {718 return pThis->u.s.Mac.au16[0] == pMac->au16[0]719 && pThis->u.s.Mac.au16[1] == pMac->au16[1]720 && pThis->u.s.Mac.au16[2] == pMac->au16[2];721 }722 723 723 int vboxNetFltOsDisconnectIt(PVBOXNETFLTINS pThis) 724 724 {
Note:
See TracChangeset
for help on using the changeset viewer.