VirtualBox

Ignore:
Timestamp:
Apr 23, 2010 5:25:58 PM (15 years ago)
Author:
vboxsync
Message:

SrvIntNet,VBoxNetFlt: Changing from getting to reporting (VBoxNetFlt reports stuff to SrvIntNet).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c

    r28070 r28666  
    525525}
    526526
     527static 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
    527534int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, void *pvContext)
    528535{
     
    544551    ASMAtomicUoWritePtr((void * volatile *)&pThis->u.s.ifp, ifp);
    545552    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);
    547554    ASMAtomicUoWriteBool(&pThis->fDisconnectedFromHost, false);
     555
    548556    /* Initialize deferred input queue */
    549557    bzero(&pThis->u.s.inq, sizeof(struct ifqueue));
     
    559567
    560568    NG_NODE_SET_PRIVATE(node, pThis);
     569
    561570    /* Attempt to name it vboxnetflt_<ifname> */
    562571    snprintf(nam, NG_NODESIZ, "vboxnetflt_%s", pThis->szName);
    563572    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);
    564581
    565582    return VINF_SUCCESS;
     
    704721}
    705722
    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 
    723723int vboxNetFltOsDisconnectIt(PVBOXNETFLTINS pThis)
    724724{
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