VirtualBox

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

Last change on this file since 23575 was 23223, checked in by vboxsync, 15 years ago

API: big medium handling change and lots of assorted other cleanups and fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
Line 
1/* $Id: HostNetworkInterfaceImpl.h 23223 2009-09-22 15:50:03Z 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 VirtualBoxBase,
38 public VirtualBoxSupportErrorInfoImpl<HostNetworkInterface, IHostNetworkInterface>,
39 public VirtualBoxSupportTranslation<HostNetworkInterface>,
40 VBOX_SCRIPTABLE_IMPL(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 COM_INTERFACE_ENTRY (IDispatch)
54 END_COM_MAP()
55
56 DECLARE_EMPTY_CTOR_DTOR (HostNetworkInterface)
57
58 HRESULT FinalConstruct();
59 void FinalRelease();
60
61 // public initializer/uninitializer for internal purposes only
62 HRESULT init (Bstr interfaceName, Guid guid, HostNetworkInterfaceType_T ifType);
63#ifdef VBOX_WITH_HOSTNETIF_API
64 HRESULT init (Bstr aInterfaceName, HostNetworkInterfaceType_T ifType, struct NETIFINFO *pIfs);
65 HRESULT updateConfig ();
66#endif
67
68 // IHostNetworkInterface properties
69 STDMETHOD(COMGETTER(Name)) (BSTR *aInterfaceName);
70 STDMETHOD(COMGETTER(Id)) (BSTR *aGuid);
71 STDMETHOD(COMGETTER(DhcpEnabled)) (BOOL *aDhcpEnabled);
72 STDMETHOD(COMGETTER(IPAddress)) (BSTR *aIPAddress);
73 STDMETHOD(COMGETTER(NetworkMask)) (BSTR *aNetworkMask);
74 STDMETHOD(COMGETTER(IPV6Supported)) (BOOL *aIPV6Supported);
75 STDMETHOD(COMGETTER(IPV6Address)) (BSTR *aIPV6Address);
76 STDMETHOD(COMGETTER(IPV6NetworkMaskPrefixLength)) (ULONG *aIPV6NetworkMaskPrefixLength);
77 STDMETHOD(COMGETTER(HardwareAddress)) (BSTR *aHardwareAddress);
78 STDMETHOD(COMGETTER(MediumType)) (HostNetworkInterfaceMediumType_T *aType);
79 STDMETHOD(COMGETTER(Status)) (HostNetworkInterfaceStatus_T *aStatus);
80 STDMETHOD(COMGETTER(InterfaceType)) (HostNetworkInterfaceType_T *aType);
81 STDMETHOD(COMGETTER(NetworkName)) (BSTR *aNetworkName);
82
83 STDMETHOD(EnableStaticIpConfig) (IN_BSTR aIPAddress, IN_BSTR aNetworkMask);
84 STDMETHOD(EnableStaticIpConfigV6) (IN_BSTR aIPV6Address, ULONG aIPV6MaskPrefixLength);
85 STDMETHOD(EnableDynamicIpConfig) ();
86 STDMETHOD(DhcpRediscover) ();
87
88 // for VirtualBoxSupportErrorInfoImpl
89 static const wchar_t *getComponentName() { return L"HostNetworkInterface"; }
90
91 HRESULT setVirtualBox(VirtualBox *pVBox);
92private:
93 const Bstr mInterfaceName;
94 const Guid mGuid;
95 HostNetworkInterfaceType_T mIfType;
96
97 ComObjPtr<VirtualBox, ComWeakRef> mVBox;
98
99 struct Data
100 {
101 Data() : IPAddress (0), networkMask (0), dhcpEnabled(FALSE),
102 mediumType (HostNetworkInterfaceMediumType_Unknown),
103 status(HostNetworkInterfaceStatus_Down){}
104
105 ULONG IPAddress;
106 ULONG networkMask;
107 Bstr IPV6Address;
108 ULONG IPV6NetworkMaskPrefixLength;
109 ULONG realIPAddress;
110 ULONG realNetworkMask;
111 Bstr realIPV6Address;
112 ULONG realIPV6PrefixLength;
113 BOOL dhcpEnabled;
114 Bstr hardwareAddress;
115 HostNetworkInterfaceMediumType_T mediumType;
116 HostNetworkInterfaceStatus_T status;
117 } m;
118
119};
120
121#endif // ____H_H_HOSTNETWORKINTERFACEIMPL
122/* 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