1 | /* $Id: DHCPServerImpl.h 35638 2011-01-19 19:10:49Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | *
|
---|
5 | * VirtualBox COM class implementation
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2006-2009 Oracle Corporation
|
---|
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 |
|
---|
20 | #ifndef ____H_H_DHCPSERVERIMPL
|
---|
21 | #define ____H_H_DHCPSERVERIMPL
|
---|
22 |
|
---|
23 | #include "VirtualBoxBase.h"
|
---|
24 |
|
---|
25 | #ifdef VBOX_WITH_HOSTNETIF_API
|
---|
26 | struct NETIFINFO;
|
---|
27 | #endif
|
---|
28 |
|
---|
29 | namespace settings
|
---|
30 | {
|
---|
31 | struct DHCPServer;
|
---|
32 | }
|
---|
33 |
|
---|
34 | class ATL_NO_VTABLE DHCPServer :
|
---|
35 | public VirtualBoxBase,
|
---|
36 | VBOX_SCRIPTABLE_IMPL(IDHCPServer)
|
---|
37 | {
|
---|
38 | public:
|
---|
39 |
|
---|
40 | VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(DHCPServer, IDHCPServer)
|
---|
41 |
|
---|
42 | DECLARE_NOT_AGGREGATABLE (DHCPServer)
|
---|
43 |
|
---|
44 | DECLARE_PROTECT_FINAL_CONSTRUCT()
|
---|
45 |
|
---|
46 | BEGIN_COM_MAP (DHCPServer)
|
---|
47 | VBOX_DEFAULT_INTERFACE_ENTRIES(IDHCPServer)
|
---|
48 | END_COM_MAP()
|
---|
49 |
|
---|
50 | DECLARE_EMPTY_CTOR_DTOR (DHCPServer)
|
---|
51 |
|
---|
52 | HRESULT FinalConstruct();
|
---|
53 | void FinalRelease();
|
---|
54 |
|
---|
55 | HRESULT init(VirtualBox *aVirtualBox,
|
---|
56 | IN_BSTR aName);
|
---|
57 | HRESULT init(VirtualBox *aVirtualBox,
|
---|
58 | const settings::DHCPServer &data);
|
---|
59 | HRESULT saveSettings(settings::DHCPServer &data);
|
---|
60 |
|
---|
61 | void uninit();
|
---|
62 |
|
---|
63 | // IDHCPServer properties
|
---|
64 | STDMETHOD(COMGETTER(NetworkName))(BSTR *aName);
|
---|
65 | STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled);
|
---|
66 | STDMETHOD(COMSETTER(Enabled))(BOOL aEnabled);
|
---|
67 | STDMETHOD(COMGETTER(IPAddress))(BSTR *aIPAddress);
|
---|
68 | STDMETHOD(COMGETTER(NetworkMask))(BSTR *aNetworkMask);
|
---|
69 | STDMETHOD(COMGETTER(LowerIP))(BSTR *aIPAddress);
|
---|
70 | STDMETHOD(COMGETTER(UpperIP))(BSTR *aIPAddress);
|
---|
71 |
|
---|
72 | STDMETHOD(SetConfiguration)(IN_BSTR aIPAddress, IN_BSTR aNetworkMask, IN_BSTR aFromIPAddress, IN_BSTR aToIPAddress);
|
---|
73 |
|
---|
74 | STDMETHOD(Start)(IN_BSTR aNetworkName, IN_BSTR aTrunkName, IN_BSTR aTrunkType);
|
---|
75 | STDMETHOD(Stop)();
|
---|
76 |
|
---|
77 | private:
|
---|
78 | /** weak VirtualBox parent */
|
---|
79 | VirtualBox * const mVirtualBox;
|
---|
80 |
|
---|
81 | const Bstr mName;
|
---|
82 |
|
---|
83 | struct Data
|
---|
84 | {
|
---|
85 | Data() : enabled(FALSE) {}
|
---|
86 |
|
---|
87 | Bstr IPAddress;
|
---|
88 | Bstr networkMask;
|
---|
89 | Bstr lowerIP;
|
---|
90 | Bstr upperIP;
|
---|
91 | BOOL enabled;
|
---|
92 |
|
---|
93 | DHCPServerRunner dhcp;
|
---|
94 | } m;
|
---|
95 |
|
---|
96 | };
|
---|
97 |
|
---|
98 | #endif // ____H_H_DHCPSERVERIMPL
|
---|