VirtualBox

Changeset 19130 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Apr 23, 2009 8:19:03 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
46337
Message:

NetAdp/win: static ip settings by default, dynamic calculation

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

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

    r19116 r19130  
    2222#define __STDC_LIMIT_MACROS
    2323#define __STDC_CONSTANT_MACROS
     24
     25#if defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT)
     26# include <VBox/WinNetConfig.h>
     27#endif /* #if defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT) */
    2428
    2529#ifdef RT_OS_LINUX
     
    123127#include <VBox/err.h>
    124128#include <VBox/settings.h>
    125 
    126 #if defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT)
    127 # include <VBox/WinNetConfig.h>
    128 #endif /* #if defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT) */
    129129
    130130#include <stdio.h>
  • trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp

    r18924 r19130  
    501501            if (FAILED(mVBox->SetExtraData(Bstr(Utf8StrFmt("HostOnly/%ls/IPV6Address", mInterfaceName.raw())), Bstr(aIPV6Address))))
    502502                return E_FAIL;
    503             if (FAILED(mVBox->SetExtraData(Bstr(Utf8StrFmt("HostOnly/%ls/IPV6NetMask", mInterfaceName.raw())), 
     503            if (FAILED(mVBox->SetExtraData(Bstr(Utf8StrFmt("HostOnly/%ls/IPV6NetMask", mInterfaceName.raw())),
    504504                                           Bstr(Utf8StrFmt("%u", aIPV6MaskPrefixLength)))))
    505505                return E_FAIL;
  • trunk/src/VBox/Main/win/NetIf-win.cpp

    r19083 r19130  
    13841384            if (hrc == S_OK)
    13851385            {
     1386                ULONG ip, mask;
     1387                hrc = VBoxNetCfgWinGenHostOnlyNetworkNetworkIp(&ip, &mask);
     1388                if(hrc == S_OK)
     1389                {
     1390                    /* ip returned by VBoxNetCfgWinGenHostOnlyNetworkNetworkIp is a network ip,
     1391                     * i.e. 192.168.xxx.0, assign  192.168.xxx.1 for the hostonly adapter */
     1392                    ip = ip | (1 << 24);
     1393                    hrc = VBoxNetCfgWinEnableStaticIpConfig((const GUID*)guid.raw(), ip, mask);
     1394                }
     1395
    13861396                /* write success followed by GUID */
    13871397                vrc = aClient->write (SVCHlpMsg::CreateHostOnlyNetworkInterface_OK);
     
    17701780        if (hr == S_OK)
    17711781        {
    1772             return collectNetIfInfo(name, Guid(IfGuid), pInfo);
     1782            memset(pInfo, 0, sizeof(NETIFINFO));
     1783            Guid guid(IfGuid);
     1784            pInfo->Uuid = *(guid.raw());
     1785
     1786            return collectNetIfInfo(name, guid, pInfo);
    17731787        }
    17741788    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette