VirtualBox

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

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

NetIf/win: moved Create/Remove hostonly if to NetIf API, some API fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1/* $Id: HostNetworkInterfaceImpl.h 17494 2009-03-06 16:55:44Z vboxsync $ */
2
3/** @file
4 *
5 * VirtualBox COM class implementation
6 */
7
8/*
9 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.215389.xyz. 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 "Collection.h"
29#ifdef VBOX_WITH_HOSTNETIF_API
30/* class HostNetworkInterface; */
31/* #include "netif.h" */
32struct NETIFINFO;
33#endif
34
35class ATL_NO_VTABLE HostNetworkInterface :
36 public VirtualBoxBaseNEXT,
37 public VirtualBoxSupportErrorInfoImpl <HostNetworkInterface, IHostNetworkInterface>,
38 public VirtualBoxSupportTranslation <HostNetworkInterface>,
39 public IHostNetworkInterface
40{
41public:
42
43 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (HostNetworkInterface)
44
45 DECLARE_NOT_AGGREGATABLE (HostNetworkInterface)
46
47 DECLARE_PROTECT_FINAL_CONSTRUCT()
48
49 BEGIN_COM_MAP (HostNetworkInterface)
50 COM_INTERFACE_ENTRY (ISupportErrorInfo)
51 COM_INTERFACE_ENTRY (IHostNetworkInterface)
52 END_COM_MAP()
53
54 NS_DECL_ISUPPORTS
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)) (OUT_GUID aGuid);
71 STDMETHOD(COMGETTER(IPAddress)) (ULONG *aIPAddress);
72 STDMETHOD(COMGETTER(NetworkMask)) (ULONG *aNetworkMask);
73 STDMETHOD(COMGETTER(IPV6Supported)) (BOOL *aIPV6Supported);
74 STDMETHOD(COMGETTER(IPV6Address)) (BSTR *aIPV6Address);
75 STDMETHOD(COMGETTER(IPV6NetworkMask)) (BSTR *aIPV6Mask);
76 STDMETHOD(COMGETTER(HardwareAddress)) (BSTR *aHardwareAddress);
77 STDMETHOD(COMGETTER(MediumType)) (HostNetworkInterfaceMediumType_T *aType);
78 STDMETHOD(COMGETTER(Status)) (HostNetworkInterfaceStatus_T *aStatus);
79 STDMETHOD(COMGETTER(InterfaceType)) (HostNetworkInterfaceType_T *aType);
80
81 STDMETHOD(EnableStaticIpConfig) (ULONG aIPAddress, ULONG aNetworkMask);
82 STDMETHOD(EnableStaticIpConfigV6) (IN_BSTR aIPV6Address, ULONG aIPV6MaskPrefixLength);
83 STDMETHOD(EnableDynamicIpConfig) ();
84
85 // for VirtualBoxSupportErrorInfoImpl
86 static const wchar_t *getComponentName() { return L"HostNetworkInterface"; }
87
88 HRESULT setVirtualBox(VirtualBox *pVBox);
89 HRESULT getVirtualBox(VirtualBox **ppVBox);
90private:
91 const Bstr mInterfaceName;
92 const Guid mGuid;
93 HostNetworkInterfaceType_T mIfType;
94
95 ComObjPtr <VirtualBox, ComWeakRef> mVBox;
96
97 struct Data
98 {
99 Data() : IPAddress (0), networkMask (0),
100 mediumType (HostNetworkInterfaceMediumType_Unknown),
101 status(HostNetworkInterfaceStatus_Down){}
102
103 ULONG IPAddress;
104 ULONG networkMask;
105 Bstr IPV6Address;
106 Bstr IPV6NetworkMask;
107 Bstr hardwareAddress;
108 HostNetworkInterfaceMediumType_T mediumType;
109 HostNetworkInterfaceStatus_T status;
110 } m;
111
112};
113
114#endif // ____H_H_HOSTNETWORKINTERFACEIMPL
115/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

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