1 | /* $Id: DHCPServerImpl.h 30760 2010-07-09 13:12:04Z 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.alldomusa.eu.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 | #include "DHCPServerRunner.h"
|
---|
26 |
|
---|
27 | #ifdef VBOX_WITH_HOSTNETIF_API
|
---|
28 | struct NETIFINFO;
|
---|
29 | #endif
|
---|
30 |
|
---|
31 | namespace settings
|
---|
32 | {
|
---|
33 | struct DHCPServer;
|
---|
34 | }
|
---|
35 |
|
---|
36 | class ATL_NO_VTABLE DHCPServer :
|
---|
37 | public VirtualBoxBase,
|
---|
38 | VBOX_SCRIPTABLE_IMPL(IDHCPServer)
|
---|
39 | {
|
---|
40 | public:
|
---|
41 |
|
---|
42 | VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(DHCPServer, IDHCPServer)
|
---|
43 |
|
---|
44 | DECLARE_NOT_AGGREGATABLE (DHCPServer)
|
---|
45 |
|
---|
46 | DECLARE_PROTECT_FINAL_CONSTRUCT()
|
---|
47 |
|
---|
48 | BEGIN_COM_MAP (DHCPServer)
|
---|
49 | COM_INTERFACE_ENTRY (ISupportErrorInfo)
|
---|
50 | COM_INTERFACE_ENTRY (IDHCPServer)
|
---|
51 | COM_INTERFACE_ENTRY (IDispatch)
|
---|
52 | END_COM_MAP()
|
---|
53 |
|
---|
54 | DECLARE_EMPTY_CTOR_DTOR (DHCPServer)
|
---|
55 |
|
---|
56 | HRESULT FinalConstruct();
|
---|
57 | void FinalRelease();
|
---|
58 |
|
---|
59 | HRESULT init(VirtualBox *aVirtualBox,
|
---|
60 | IN_BSTR aName);
|
---|
61 | HRESULT init(VirtualBox *aVirtualBox,
|
---|
62 | const settings::DHCPServer &data);
|
---|
63 | HRESULT saveSettings(settings::DHCPServer &data);
|
---|
64 |
|
---|
65 | void uninit();
|
---|
66 |
|
---|
67 | // IDHCPServer properties
|
---|
68 | STDMETHOD(COMGETTER(NetworkName))(BSTR *aName);
|
---|
69 | STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled);
|
---|
70 | STDMETHOD(COMSETTER(Enabled))(BOOL aEnabled);
|
---|
71 | STDMETHOD(COMGETTER(IPAddress))(BSTR *aIPAddress);
|
---|
72 | STDMETHOD(COMGETTER(NetworkMask))(BSTR *aNetworkMask);
|
---|
73 | STDMETHOD(COMGETTER(LowerIP))(BSTR *aIPAddress);
|
---|
74 | STDMETHOD(COMGETTER(UpperIP))(BSTR *aIPAddress);
|
---|
75 |
|
---|
76 | STDMETHOD(SetConfiguration)(IN_BSTR aIPAddress, IN_BSTR aNetworkMask, IN_BSTR aFromIPAddress, IN_BSTR aToIPAddress);
|
---|
77 |
|
---|
78 | STDMETHOD(Start)(IN_BSTR aNetworkName, IN_BSTR aTrunkName, IN_BSTR aTrunkType);
|
---|
79 | STDMETHOD(Stop)();
|
---|
80 |
|
---|
81 | private:
|
---|
82 | /** weak VirtualBox parent */
|
---|
83 | VirtualBox * const mVirtualBox;
|
---|
84 |
|
---|
85 | const Bstr mName;
|
---|
86 |
|
---|
87 | struct Data
|
---|
88 | {
|
---|
89 | Data() : enabled(FALSE) {}
|
---|
90 |
|
---|
91 | Bstr IPAddress;
|
---|
92 | Bstr networkMask;
|
---|
93 | Bstr lowerIP;
|
---|
94 | Bstr upperIP;
|
---|
95 | BOOL enabled;
|
---|
96 |
|
---|
97 | DHCPServerRunner dhcp;
|
---|
98 | } m;
|
---|
99 |
|
---|
100 | };
|
---|
101 |
|
---|
102 | #endif // ____H_H_DHCPSERVERIMPL
|
---|