VirtualBox

Ignore:
Timestamp:
Jul 26, 2008 2:11:55 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
33724
Message:

Main: Host interface networking on Darwin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r10797 r10898  
    855855                rc = CFGMR3InsertString(pCfg,   "Format",           "VMDK");                RC_CHECK();
    856856
    857                 /* 
     857                /*
    858858                 * Create cfgm nodes for async transport driver because VMDK is currently the only
    859859                 * one which may support async I/O. This has to be made generic based on the capabiliy flags
     
    11881188# endif
    11891189                    }
     1190
     1191#elif defined(RT_OS_DARWIN)
     1192                    if (fSniffer)
     1193                    {
     1194                        rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0);   RC_CHECK();
     1195                    }
     1196                    else
     1197                    {
     1198                        rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0);             RC_CHECK();
     1199                    }
     1200                    /* The name is on the form 'ifX: long name', chop it off at the colon. */
     1201                    Bstr hostInterfaceName;
     1202                    hrc = networkAdapter->COMGETTER(HostInterface)(hostInterfaceName.asOutParam()); H();
     1203                    char szTrunkName[8];
     1204                    strncpy(szTrunkName, Utf8Str(hostInterfaceName).raw(), sizeof(szTrunkName));
     1205                    char *pszColon = (char *)memchr(szTrunkName, ':', sizeof(szTrunkName));
     1206                    if (!pszColon)
     1207                    {
     1208                        hrc = networkAdapter->Detach();                              H();
     1209                        return VMSetError(pVM, VERR_INTERNAL_ERROR, RT_SRC_POS,
     1210                                          N_("Malformed host interface networking name '%ls'"),
     1211                                          hostInterfaceName.raw());
     1212                    }
     1213                    *pszColon = '\0';
     1214
     1215                    rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet");            RC_CHECK();
     1216                    rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg);                 RC_CHECK();
     1217                    rc = CFGMR3InsertString(pCfg, "TrunkName", szTrunkName);        RC_CHECK();
     1218                    char szNetwork[80];
     1219                    RTStrPrintf(szNetwork, sizeof(szNetwork), "HostInterfaceNetworking-%s\n", szTrunkName);
     1220                    rc = CFGMR3InsertString(pCfg, "Network", szNetwork);            RC_CHECK();
     1221
    11901222#elif defined(RT_OS_WINDOWS)
    11911223                    if (fSniffer)
     
    16871719                Bstr strNextExtraDataKey;
    16881720                Bstr strExtraDataValue;
    1689        
     1721
    16901722                /* get the next key */
    16911723                hrc = pMachine->GetNextExtraDataKey(strExtraDataKey, strNextExtraDataKey.asOutParam(),
    16921724                                                    strExtraDataValue.asOutParam());
    1693        
     1725
    16941726                /* stop if for some reason there's nothing more to request */
    16951727                if (FAILED(hrc) || !strNextExtraDataKey)
    16961728                    break;
    1697        
     1729
    16981730                strExtraDataKey = strNextExtraDataKey;
    16991731                Utf8Str strExtraDataKeyUtf8 = Utf8Str(strExtraDataKey);
    1700        
     1732
    17011733                /* we only care about keys starting with VBOX_SHARED_INFO_KEY_PREFIX */
    17021734                if (strncmp(strExtraDataKeyUtf8.raw(), VBOX_SHARED_INFO_KEY_PREFIX, VBOX_SHARED_INFO_PREFIX_LEN) != 0)
    17031735                    continue;
    17041736                char *pszCFGMValueName = (char*)strExtraDataKeyUtf8.raw() + VBOX_SHARED_INFO_PREFIX_LEN;
    1705        
     1737
    17061738                /* now let's have a look at the value */
    17071739                Utf8Str strCFGMValueUtf8 = Utf8Str(strExtraDataValue);
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