VirtualBox

source: vbox/trunk/src/VBox/Main/include/DHCPServerImpl.h@ 22384

Last change on this file since 22384 was 22183, checked in by vboxsync, 15 years ago

Main: fix more windows warnings + burns

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1/* $Id: DHCPServerImpl.h 22183 2009-08-11 17:00:33Z 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_H_DHCPSERVERIMPL
25#define ____H_H_DHCPSERVERIMPL
26
27#include "VirtualBoxBase.h"
28#include "VirtualBoxImpl.h"
29
30#ifdef VBOX_WITH_HOSTNETIF_API
31struct NETIFINFO;
32#endif
33
34namespace settings
35{
36 struct DHCPServer;
37}
38
39class ATL_NO_VTABLE DHCPServer :
40 public VirtualBoxBase,
41 public VirtualBoxSupportErrorInfoImpl<DHCPServer, IDHCPServer>,
42 public VirtualBoxSupportTranslation<DHCPServer>,
43 VBOX_SCRIPTABLE_IMPL(IDHCPServer)
44{
45public:
46
47 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (DHCPServer)
48
49 DECLARE_NOT_AGGREGATABLE (DHCPServer)
50
51 DECLARE_PROTECT_FINAL_CONSTRUCT()
52
53 BEGIN_COM_MAP (DHCPServer)
54 COM_INTERFACE_ENTRY (ISupportErrorInfo)
55 COM_INTERFACE_ENTRY (IDHCPServer)
56 COM_INTERFACE_ENTRY (IDispatch)
57 END_COM_MAP()
58
59 NS_DECL_ISUPPORTS
60
61 DECLARE_EMPTY_CTOR_DTOR (DHCPServer)
62
63 HRESULT FinalConstruct();
64 void FinalRelease();
65
66 HRESULT init(VirtualBox *aVirtualBox,
67 IN_BSTR aName);
68 HRESULT init(VirtualBox *aVirtualBox,
69 const settings::DHCPServer &data);
70 HRESULT saveSettings(settings::DHCPServer &data);
71
72 void uninit();
73
74 // IDHCPServer properties
75 STDMETHOD(COMGETTER(NetworkName))(BSTR *aName);
76 STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled);
77 STDMETHOD(COMSETTER(Enabled))(BOOL aEnabled);
78 STDMETHOD(COMGETTER(IPAddress))(BSTR *aIPAddress);
79 STDMETHOD(COMGETTER(NetworkMask))(BSTR *aNetworkMask);
80 STDMETHOD(COMGETTER(LowerIP))(BSTR *aIPAddress);
81 STDMETHOD(COMGETTER(UpperIP))(BSTR *aIPAddress);
82
83 STDMETHOD(SetConfiguration)(IN_BSTR aIPAddress, IN_BSTR aNetworkMask, IN_BSTR aFromIPAddress, IN_BSTR aToIPAddress);
84
85 STDMETHOD(Start)(IN_BSTR aNetworkName, IN_BSTR aTrunkName, IN_BSTR aTrunkType);
86 STDMETHOD(Stop)();
87
88 // for VirtualBoxSupportErrorInfoImpl
89 static const wchar_t *getComponentName() { return L"DHCPServer"; }
90
91private:
92 /** weak VirtualBox parent */
93 const ComObjPtr<VirtualBox, ComWeakRef> mVirtualBox;
94
95 const Bstr mName;
96
97 struct Data
98 {
99 Data() : enabled(FALSE) {}
100
101 Bstr IPAddress;
102 Bstr networkMask;
103 Bstr lowerIP;
104 Bstr upperIP;
105 BOOL enabled;
106
107 DHCPServerRunner dhcp;
108 } m;
109
110};
111
112#endif // ____H_H_DHCPSERVERIMPL
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