VirtualBox

Changeset 17333 in vbox


Ignore:
Timestamp:
Mar 4, 2009 9:14:29 AM (16 years ago)
Author:
vboxsync
Message:

Main: setIpConfig API, notimpl yet

Location:
trunk/src/VBox
Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp

    r17322 r17333  
    327327                networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam());
    328328                RTPrintf("GUID:            %lS\n", Bstr(interfaceGuid.toString()).raw());
    329                 ComPtr<IHostNetworkInterfaceIpConfig> ipConfig;
    330                 networkInterface->COMGETTER(IpConfig)(ipConfig.asOutParam());
    331329                ULONG IPAddress;
    332                 ipConfig->COMGETTER(IPAddress)(&IPAddress);
     330                networkInterface->COMGETTER(IPAddress)(&IPAddress);
    333331                RTPrintf("IPAddress:       %d.%d.%d.%d\n",
    334332                        ((uint8_t*)&IPAddress)[0],
     
    337335                        ((uint8_t*)&IPAddress)[3]);
    338336                ULONG NetworkMask;
    339                 ipConfig->COMGETTER(NetworkMask)(&NetworkMask);
     337                networkInterface->COMGETTER(NetworkMask)(&NetworkMask);
    340338                RTPrintf("NetworkMask:     %d.%d.%d.%d\n",
    341339                        ((uint8_t*)&NetworkMask)[0],
     
    344342                        ((uint8_t*)&NetworkMask)[3]);
    345343                Bstr IPV6Address;
    346                 ipConfig->COMGETTER(IPV6Address)(IPV6Address.asOutParam());
     344                networkInterface->COMGETTER(IPV6Address)(IPV6Address.asOutParam());
    347345                RTPrintf("IPV6Address:     %lS\n", IPV6Address.raw());
    348346                Bstr IPV6NetworkMask;
    349                 ipConfig->COMGETTER(IPV6NetworkMask)(IPV6NetworkMask.asOutParam());
     347                networkInterface->COMGETTER(IPV6NetworkMask)(IPV6NetworkMask.asOutParam());
    350348                RTPrintf("IPV6NetworkMask: %lS\n", IPV6NetworkMask.raw());
    351349                Bstr HardwareAddress;
  • trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp

    r17309 r17333  
    7272
    7373    return S_OK;
    74 }
    75 
    76 void HostNetworkInterface::uninit()
    77 {
    78     LogFlowThisFunc (("\n"));
    79 
    80     /* Enclose the state transition Ready->InUninit->NotReady */
    81     AutoUninitSpan autoUninitSpan (this);
    82     if (autoUninitSpan.uninitDone())
    83         return;
    84 
    85     m.ipConfig.setNull();
    8674}
    8775
     
    141129    mIfType = ifType;
    142130
    143     m.ipConfig.createObject();
    144 
    145     HRESULT hr = m.ipConfig->init (pIf);
    146     if(FAILED(hr))
    147         return hr;
    148 
     131    m.IPAddress = pIf->IPAddress.u;
     132    m.networkMask = pIf->IPNetMask.u;
     133    m.defaultGateway = pIf->IPDefaultGateway.u;
     134    m.IPV6Address = composeIPv6Address(&pIf->IPv6Address);
     135    m.IPV6NetworkMask = composeIPv6Address(&pIf->IPv6NetMask);
    149136    m.hardwareAddress = composeHardwareAddress(&pIf->MACAddress);
    150137#ifdef RT_OS_WINDOWS
     
    202189}
    203190
    204 STDMETHODIMP HostNetworkInterface::COMGETTER(IpConfig) (IHostNetworkInterfaceIpConfig **aIpConfig)
    205 {
    206     if (!aIpConfig)
    207         return E_POINTER;
    208 
    209     AutoCaller autoCaller (this);
    210     CheckComRCReturnRC (autoCaller.rc());
    211 
    212     m.ipConfig.queryInterfaceTo (aIpConfig);
     191
     192/**
     193 * Returns the IP address of the host network interface.
     194 *
     195 * @returns COM status code
     196 * @param   aIPAddress address of result pointer
     197 */
     198STDMETHODIMP HostNetworkInterface::COMGETTER(IPAddress) (ULONG *aIPAddress)
     199{
     200    CheckComArgOutPointerValid(aIPAddress);
     201
     202    AutoCaller autoCaller (this);
     203    CheckComRCReturnRC (autoCaller.rc());
     204
     205    *aIPAddress = m.IPAddress;
     206
     207    return S_OK;
     208}
     209
     210/**
     211 * Returns the netwok mask of the host network interface.
     212 *
     213 * @returns COM status code
     214 * @param   aNetworkMask address of result pointer
     215 */
     216STDMETHODIMP HostNetworkInterface::COMGETTER(NetworkMask) (ULONG *aNetworkMask)
     217{
     218    CheckComArgOutPointerValid(aNetworkMask);
     219
     220    AutoCaller autoCaller (this);
     221    CheckComRCReturnRC (autoCaller.rc());
     222
     223    *aNetworkMask = m.networkMask;
     224
     225    return S_OK;
     226}
     227
     228/**
     229 * Returns the default gateway of the host network interface.
     230 *
     231 * @returns COM status code
     232 * @param   aNetworkMask address of result pointer
     233 */
     234STDMETHODIMP HostNetworkInterface::COMGETTER(DefaultGateway) (ULONG *aDefaultGateway)
     235{
     236    CheckComArgOutPointerValid(aDefaultGateway);
     237
     238    AutoCaller autoCaller (this);
     239    CheckComRCReturnRC (autoCaller.rc());
     240
     241    *aDefaultGateway = m.defaultGateway;
     242
     243    return S_OK;
     244}
     245
     246/**
     247 * Returns the IP V6 address of the host network interface.
     248 *
     249 * @returns COM status code
     250 * @param   aIPV6Address address of result pointer
     251 */
     252STDMETHODIMP HostNetworkInterface::COMGETTER(IPV6Address) (BSTR *aIPV6Address)
     253{
     254    CheckComArgOutPointerValid(aIPV6Address);
     255
     256    AutoCaller autoCaller (this);
     257    CheckComRCReturnRC (autoCaller.rc());
     258
     259    m.IPV6Address.cloneTo (aIPV6Address);
     260
     261    return S_OK;
     262}
     263
     264/**
     265 * Returns the IP V6 network mask of the host network interface.
     266 *
     267 * @returns COM status code
     268 * @param   aIPV6Mask address of result pointer
     269 */
     270STDMETHODIMP HostNetworkInterface::COMGETTER(IPV6NetworkMask) (BSTR *aIPV6Mask)
     271{
     272    CheckComArgOutPointerValid(aIPV6Mask);
     273
     274    AutoCaller autoCaller (this);
     275    CheckComRCReturnRC (autoCaller.rc());
     276
     277    m.IPV6NetworkMask.cloneTo (aIPV6Mask);
    213278
    214279    return S_OK;
     
    288353}
    289354
     355STDMETHODIMP HostNetworkInterface::EnableStaticIpConfig (ULONG aIPAddress, ULONG aNetworkMask, ULONG aDefaultGateway)
     356{
     357    return E_NOTIMPL;
     358}
     359
     360STDMETHODIMP HostNetworkInterface::EnableStaticIpConfigV6 (BSTR aIPV6Address, BSTR aIPV6Mask)
     361{
     362    return E_NOTIMPL;
     363}
     364
     365STDMETHODIMP HostNetworkInterface::EnableDynamicIpConfig ()
     366{
     367    return E_NOTIMPL;
     368}
     369
    290370/* vi: set tabstop=4 shiftwidth=4 expandtab: */
  • trunk/src/VBox/Main/Makefile.kmk

    r17309 r17333  
    281281        HostFloppyDriveImpl.cpp \
    282282        HostNetworkInterfaceImpl.cpp \
    283         HostNetworkInterfaceIpConfigImpl.cpp \
    284283        GuestOSTypeImpl.cpp \
    285284        NetworkAdapterImpl.cpp \
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r17314 r17333  
    64486448
    64496449  <interface
    6450      name="IHostNetworkInterfaceIpConfig" extends="$unknown"
    6451      uuid="38f31587-1ad2-4593-ab0c-d16f6e36c0ee"
    6452      wsmap="managed"
    6453      >
    6454     <desc>
    6455       Reprents IP settings for one of host's network interfaces. IP V6 address and network
    6456       mask are strings of 32 hexdecimal digits grouped by four. Groups are
    6457       separated by colons.
    6458       For example, fe80:0000:0000:0000:021e:c2ff:fed2:b030.
    6459     </desc>
    6460 
    6461     <attribute name="IPAddress" type="unsigned long" readonly="yes">
    6462       <desc>Returns the IP V4 address of the interface.</desc>
    6463     </attribute>
    6464 
    6465     <attribute name="networkMask" type="unsigned long" readonly="yes">
    6466       <desc>Returns the network mask of the interface.</desc>
    6467     </attribute>
    6468 
    6469     <attribute name="defaultGateway" type="unsigned long" readonly="yes">
    6470       <desc>Returns the network mask of the interface.</desc>
    6471     </attribute>
    6472 
    6473     <attribute name="IPV6Address" type="wstring" readonly="yes">
    6474       <desc>Returns the IP V6 address of the interface.</desc>
    6475     </attribute>
    6476 
    6477     <attribute name="IPV6NetworkMask" type="wstring" readonly="yes">
    6478       <desc>Returns the IP V6 network mask of the interface.</desc>
    6479     </attribute>
    6480   </interface>
    6481 
    6482   <interface
    64836450     name="IHostNetworkInterface" extends="$unknown"
    6484      uuid="3fd5d8d9-c503-4c1a-b88c-e78fb78f8559"
     6451     uuid="b4467af7-9b16-479a-a812-c132cbd886a3"
    64856452     wsmap="managed"
    64866453     >
     
    64996466    </attribute>
    65006467
    6501     <attribute name="ipConfig" type="IHostNetworkInterfaceIpConfig" readonly="yes">
    6502       <desc>Returns the adapter ip config information </desc>
     6468    <attribute name="IPAddress" type="unsigned long" readonly="yes">
     6469      <desc>Returns the IP V4 address of the interface.</desc>
     6470    </attribute>
     6471
     6472    <attribute name="networkMask" type="unsigned long" readonly="yes">
     6473      <desc>Returns the network mask of the interface.</desc>
     6474    </attribute>
     6475
     6476    <attribute name="defaultGateway" type="unsigned long" readonly="yes">
     6477      <desc>Returns the network mask of the interface.</desc>
     6478    </attribute>
     6479
     6480    <attribute name="IPV6Address" type="wstring" readonly="yes">
     6481      <desc>Returns the IP V6 address of the interface.</desc>
     6482    </attribute>
     6483
     6484    <attribute name="IPV6NetworkMask" type="wstring" readonly="yes">
     6485      <desc>Returns the IP V6 network mask of the interface.</desc>
    65036486    </attribute>
    65046487
     
    65186501      <desc>specifies the host interface type.</desc>
    65196502    </attribute>
     6503   
     6504    <method name="enableStaticIpConfig">
     6505      <desc>sets and enables the static IP V4 configuration for the given interface.</desc>
     6506      <param name="IPAddress" type="unsigned long" dir="in">
     6507        <desc>
     6508          IP address.
     6509        </desc>
     6510      </param>
     6511      <param name="networkMask" type="unsigned long" dir="in">
     6512        <desc>
     6513          network mask.
     6514        </desc>
     6515      </param>
     6516      <param name="defaultGateway" type="unsigned long" dir="in">
     6517        <desc>
     6518          default gateway.
     6519        </desc>
     6520      </param>
     6521    </method>
     6522
     6523    <method name="enableStaticIpConfigV6">
     6524      <desc>sets and enables the static IP V6 configuration for the given interface.</desc>
     6525      <param name="IPV6Address" type="wstring" dir="in">
     6526        <desc>
     6527          IP address.
     6528        </desc>
     6529      </param>
     6530      <param name="IPV6NetworkMask" type="wstring" dir="in">
     6531        <desc>
     6532          network mask.
     6533        </desc>
     6534      </param>
     6535    </method>
     6536
     6537    <method name="enableDynamicIpConfig">
     6538      <desc>enables the dynamic IP configuration.</desc>
     6539    </method>
     6540
    65206541  </interface>
    65216542
  • trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h

    r17309 r17333  
    2727#include "VirtualBoxBase.h"
    2828#include "Collection.h"
    29 #include "HostNetworkInterfaceIpConfigImpl.h"
    30 
    3129#ifdef VBOX_WITH_HOSTNETIF_API
    3230/* class HostNetworkInterface; */
     
    6664    HRESULT init (Bstr aInterfaceName, HostNetworkInterfaceType_T ifType, struct NETIFINFO *pIfs);
    6765#endif
    68     void uninit();
    6966
    7067    // IHostNetworkInterface properties
    7168    STDMETHOD(COMGETTER(Name)) (BSTR *aInterfaceName);
    7269    STDMETHOD(COMGETTER(Id)) (OUT_GUID aGuid);
    73     STDMETHOD(COMGETTER(IpConfig)) (IHostNetworkInterfaceIpConfig **aIpConfig);
     70    STDMETHOD(COMGETTER(IPAddress)) (ULONG *aIPAddress);
     71    STDMETHOD(COMGETTER(NetworkMask)) (ULONG *aNetworkMask);
     72    STDMETHOD(COMGETTER(DefaultGateway)) (ULONG *aDefaultGateway);
     73    STDMETHOD(COMGETTER(IPV6Address)) (BSTR *aIPV6Address);
     74    STDMETHOD(COMGETTER(IPV6NetworkMask)) (BSTR *aIPV6Mask);
    7475    STDMETHOD(COMGETTER(HardwareAddress)) (BSTR *aHardwareAddress);
    7576    STDMETHOD(COMGETTER(MediumType)) (HostNetworkInterfaceMediumType_T *aType);
    7677    STDMETHOD(COMGETTER(Status)) (HostNetworkInterfaceStatus_T *aStatus);
    7778    STDMETHOD(COMGETTER(InterfaceType)) (HostNetworkInterfaceType_T *aType);
     79
     80    STDMETHOD(EnableStaticIpConfig) (ULONG aIPAddress, ULONG aNetworkMask, ULONG aDefaultGateway);
     81    STDMETHOD(EnableStaticIpConfigV6) (BSTR aIPV6Address, BSTR aIPV6Mask);
     82    STDMETHOD(EnableDynamicIpConfig) ();
    7883
    7984    // for VirtualBoxSupportErrorInfoImpl
     
    8792    struct Data
    8893    {
    89         Data() : mediumType (HostNetworkInterfaceMediumType_Unknown),
     94        Data() : IPAddress (0), networkMask (0), defaultGateway(0),
     95            mediumType (HostNetworkInterfaceMediumType_Unknown),
    9096            status(HostNetworkInterfaceStatus_Down){}
    9197
    92         ComObjPtr <HostNetworkInterfaceIpConfig> ipConfig;
     98        ULONG IPAddress;
     99        ULONG networkMask;
     100        ULONG defaultGateway;
     101        Bstr IPV6Address;
     102        Bstr IPV6NetworkMask;
    93103        Bstr hardwareAddress;
    94104        HostNetworkInterfaceMediumType_T mediumType;
  • trunk/src/VBox/Main/xpcom/server.cpp

    r17310 r17333  
    195195NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HostNetworkInterface, IHostNetworkInterface)
    196196
    197 NS_DECL_CLASSINFO(HostNetworkInterfaceIpConfig)
    198 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HostNetworkInterfaceIpConfig, IHostNetworkInterfaceIpConfig)
    199 
    200197NS_DECL_CLASSINFO(GuestOSType)
    201198NS_IMPL_THREADSAFE_ISUPPORTS1_CI(GuestOSType, IGuestOSType)
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