VirtualBox

Ignore:
Timestamp:
Mar 2, 2009 4:23:00 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
43595
Message:

#2957: vboxnetadp is now a dummy device attached to intnet via vboxnetflt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetAdp/darwin/VBoxNetAdp-darwin.cpp

    r17184 r17256  
    101101 * The (common) global data.
    102102 */
     103#ifdef VBOXANETADP_DO_NOT_USE_NETFLT
    103104static VBOXNETADPGLOBALS g_VBoxNetAdpGlobals;
     105
     106#else /* !VBOXANETADP_DO_NOT_USE_NETFLT */
     107
     108/**
     109 * Generate a suitable MAC address.
     110 *
     111 * @param   pThis       The instance.
     112 * @param   pMac        Where to return the MAC address.
     113 */
     114DECLHIDDEN(void) vboxNetAdpComposeMACAddress(PVBOXNETADP pThis, PRTMAC pMac)
     115{
     116#if 0 /* Use a locally administered version of the OUI we use for the guest NICs. */
     117    pMac->au8[0] = 0x08 | 2;
     118    pMac->au8[1] = 0x00;
     119    pMac->au8[2] = 0x27;
     120#else /* this is what \0vb comes down to. It seems to be unassigned atm. */
     121    pMac->au8[0] = 0;
     122    pMac->au8[1] = 0x76;
     123    pMac->au8[2] = 0x62;
     124#endif
     125
     126    pMac->au8[3] = 0; /* pThis->uUnit >> 16; */
     127    pMac->au8[4] = 0; /* pThis->uUnit >> 8; */
     128    pMac->au8[5] = pThis->uUnit;
     129}
     130#endif /* !VBOXANETADP_DO_NOT_USE_NETFLT */
    104131
    105132
     
    117144}
    118145
     146#ifdef VBOXANETADP_DO_NOT_USE_NETFLT
    119147/**
    120148 * Reads and retains the host interface handle.
     
    440468}
    441469
    442 
     470#endif /* VBOXANETADP_DO_NOT_USE_NETFLT */
    443471static errno_t vboxNetAdpDarwinOutput(ifnet_t pIface, mbuf_t pMBuf)
    444472{
     473#ifdef VBOXANETADP_DO_NOT_USE_NETFLT
    445474    PVBOXNETADP pThis = VBOXNETADP_FROM_IFACE(pIface);
    446475    Assert(pThis);
     
    457486            vboxNetAdpCancelReceive(pThis);
    458487    }
     488#endif /* VBOXANETADP_DO_NOT_USE_NETFLT */
    459489    mbuf_freem_list(pMBuf);
    460490    return 0;
     
    508538
    509539
     540#ifdef VBOXANETADP_DO_NOT_USE_NETFLT
    510541
    511542int  vboxNetAdpPortOsXmit(PVBOXNETADP pThis, PINTNETSG pSG, uint32_t fDst)
     
    587618    return VINF_SUCCESS;
    588619}
     620#else /* !VBOXANETADP_DO_NOT_USE_NETFLT */
     621VBOXNETADP g_vboxnet0;
     622
     623#endif /* !VBOXANETADP_DO_NOT_USE_NETFLT */
    589624
    590625
     
    725760         * for establishing the connect to the support driver.
    726761         */
     762#ifdef VBOXANETADP_DO_NOT_USE_NETFLT
    727763        memset(&g_VBoxNetAdpGlobals, 0, sizeof(g_VBoxNetAdpGlobals));
    728764        rc = vboxNetAdpInitGlobals(&g_VBoxNetAdpGlobals);
     765#else /* !VBOXANETADP_DO_NOT_USE_NETFLT */
     766        RTMAC Mac;
     767        vboxNetAdpOsInit(&g_vboxnet0);
     768        vboxNetAdpComposeMACAddress(&g_vboxnet0, &Mac);
     769        rc = vboxNetAdpOsCreate(&g_vboxnet0, &Mac);
     770#endif /* !VBOXANETADP_DO_NOT_USE_NETFLT */
    729771        if (RT_SUCCESS(rc))
    730772        {
     
    739781        printf("VBoxAdpDrv: failed to initialize IPRT (rc=%d)\n", rc);
    740782
     783#ifdef VBOXANETADP_DO_NOT_USE_NETFLT
    741784    memset(&g_VBoxNetAdpGlobals, 0, sizeof(g_VBoxNetAdpGlobals));
     785#endif /* VBOXANETADP_DO_NOT_USE_NETFLT */
    742786    return KMOD_RETURN_FAILURE;
    743787}
     
    756800     * tracking for us!
    757801     */
     802#ifdef VBOXANETADP_DO_NOT_USE_NETFLT
    758803    int rc = vboxNetAdpTryDeleteGlobals(&g_VBoxNetAdpGlobals);
    759804    if (RT_FAILURE(rc))
     
    767812     */
    768813    memset(&g_VBoxNetAdpGlobals, 0, sizeof(g_VBoxNetAdpGlobals));
     814#else /* !VBOXANETADP_DO_NOT_USE_NETFLT */
     815    vboxNetAdpOsDestroy(&g_vboxnet0);
     816#endif /* !VBOXANETADP_DO_NOT_USE_NETFLT */
    769817
    770818    RTR0Term();
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