VirtualBox

source: vbox/trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h@ 17872

Last change on this file since 17872 was 17865, checked in by vboxsync, 16 years ago

Main/dhcp API, E_NOTIMPL yet

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1/* $Id: HostNetworkInterfaceImpl.h 17865 2009-03-14 10:05:29Z vboxsync $ */
2
3/** @file
4 *
5 * VirtualBox COM class implementation
6 */
7
8/*
9 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.virtualbox.org. This file is free software;
13 * you can redistribute it and/or modify it under the terms of the GNU
14 * General Public License (GPL) as published by the Free Software
15 * Foundation, in version 2 as it comes in the "COPYING" file of the
16 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
20 * Clara, CA 95054 USA or visit http://www.sun.com if you need
21 * additional information or have any questions.
22 */
23
24#ifndef ____H_HOSTNETWORKINTERFACEIMPL
25#define ____H_HOSTNETWORKINTERFACEIMPL
26
27#include "VirtualBoxBase.h"
28#include "VirtualBoxImpl.h"
29
30#ifdef VBOX_WITH_HOSTNETIF_API
31/* class HostNetworkInterface; */
32/* #include "netif.h" */
33struct NETIFINFO;
34#endif
35
36class ATL_NO_VTABLE HostNetworkInterface :
37 public VirtualBoxBaseNEXT,
38 public VirtualBoxSupportErrorInfoImpl <HostNetworkInterface, IHostNetworkInterface>,
39 public VirtualBoxSupportTranslation <HostNetworkInterface>,
40 public IHostNetworkInterface
41{
42public:
43
44 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (HostNetworkInterface)
45
46 DECLARE_NOT_AGGREGATABLE (HostNetworkInterface)
47
48 DECLARE_PROTECT_FINAL_CONSTRUCT()
49
50 BEGIN_COM_MAP (HostNetworkInterface)
51 COM_INTERFACE_ENTRY (ISupportErrorInfo)
52 COM_INTERFACE_ENTRY (IHostNetworkInterface)
53 END_COM_MAP()
54
55 NS_DECL_ISUPPORTS
56
57 DECLARE_EMPTY_CTOR_DTOR (HostNetworkInterface)
58
59 HRESULT FinalConstruct();
60 void FinalRelease();
61
62 // public initializer/uninitializer for internal purposes only
63 HRESULT init (Bstr interfaceName, Guid guid, HostNetworkInterfaceType_T ifType);
64#ifdef VBOX_WITH_HOSTNETIF_API
65 HRESULT init (Bstr aInterfaceName, HostNetworkInterfaceType_T ifType, struct NETIFINFO *pIfs);
66 HRESULT updateConfig ();
67#endif
68
69 // IHostNetworkInterface properties
70 STDMETHOD(COMGETTER(Name)) (BSTR *aInterfaceName);
71 STDMETHOD(COMGETTER(Id)) (OUT_GUID aGuid);
72 STDMETHOD(COMGETTER(DhcpEnabled)) (BOOL *aDhcpEnabled);
73 STDMETHOD(COMGETTER(IPAddress)) (BSTR *aIPAddress);
74 STDMETHOD(COMGETTER(NetworkMask)) (BSTR *aNetworkMask);
75 STDMETHOD(COMGETTER(IPV6Supported)) (BOOL *aIPV6Supported);
76 STDMETHOD(COMGETTER(IPV6Address)) (BSTR *aIPV6Address);
77 STDMETHOD(COMGETTER(IPV6NetworkMaskPrefixLength)) (ULONG *aIPV6NetworkMaskPrefixLength);
78 STDMETHOD(COMGETTER(HardwareAddress)) (BSTR *aHardwareAddress);
79 STDMETHOD(COMGETTER(MediumType)) (HostNetworkInterfaceMediumType_T *aType);
80 STDMETHOD(COMGETTER(Status)) (HostNetworkInterfaceStatus_T *aStatus);
81 STDMETHOD(COMGETTER(InterfaceType)) (HostNetworkInterfaceType_T *aType);
82 STDMETHOD(COMGETTER(NetworkName)) (BSTR *aNetworkName);
83
84 STDMETHOD(EnableStaticIpConfig) (IN_BSTR aIPAddress, IN_BSTR aNetworkMask);
85 STDMETHOD(EnableStaticIpConfigV6) (IN_BSTR aIPV6Address, ULONG aIPV6MaskPrefixLength);
86 STDMETHOD(EnableDynamicIpConfig) ();
87 STDMETHOD(DhcpRediscover) ();
88
89 // for VirtualBoxSupportErrorInfoImpl
90 static const wchar_t *getComponentName() { return L"HostNetworkInterface"; }
91
92 HRESULT setVirtualBox(VirtualBox *pVBox);
93private:
94 const Bstr mInterfaceName;
95 const Guid mGuid;
96 HostNetworkInterfaceType_T mIfType;
97
98 ComObjPtr <VirtualBox, ComWeakRef> mVBox;
99
100 struct Data
101 {
102 Data() : IPAddress (0), networkMask (0), dhcpEnabled(FALSE),
103 mediumType (HostNetworkInterfaceMediumType_Unknown),
104 status(HostNetworkInterfaceStatus_Down){}
105
106 ULONG IPAddress;
107 ULONG networkMask;
108 Bstr IPV6Address;
109 ULONG IPV6NetworkMaskPrefixLength;
110 BOOL dhcpEnabled;
111 Bstr hardwareAddress;
112 HostNetworkInterfaceMediumType_T mediumType;
113 HostNetworkInterfaceStatus_T status;
114 } m;
115
116};
117
118#endif // ____H_H_HOSTNETWORKINTERFACEIMPL
119/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

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