VirtualBox

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

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

#3569: DHCP Server is now started from VBoxSVC and terminates with it.

  • 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 18208 2009-03-24 17:01:32Z 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
31/* class DHCPServer; */
32/* #include "netif.h" */
33struct NETIFINFO;
34#endif
35
36class ATL_NO_VTABLE DHCPServer :
37 public VirtualBoxBaseNEXT,
38 public VirtualBoxSupportErrorInfoImpl <DHCPServer, IDHCPServer>,
39 public VirtualBoxSupportTranslation <DHCPServer>,
40 public IDHCPServer
41{
42public:
43
44 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (DHCPServer)
45
46 DECLARE_NOT_AGGREGATABLE (DHCPServer)
47
48 DECLARE_PROTECT_FINAL_CONSTRUCT()
49
50 BEGIN_COM_MAP (DHCPServer)
51 COM_INTERFACE_ENTRY (ISupportErrorInfo)
52 COM_INTERFACE_ENTRY (IDHCPServer)
53 END_COM_MAP()
54
55 NS_DECL_ISUPPORTS
56
57 DECLARE_EMPTY_CTOR_DTOR (DHCPServer)
58
59 HRESULT FinalConstruct();
60 void FinalRelease();
61
62 HRESULT init(VirtualBox *aVirtualBox, IN_BSTR aName);
63 HRESULT init(VirtualBox *aVirtualBox, const settings::Key &aNode);
64 HRESULT saveSettings (settings::Key &aParentNode);
65
66 void uninit();
67
68 // IDHCPServer properties
69 STDMETHOD(COMGETTER(NetworkName)) (BSTR *aName);
70 STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
71 STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
72 STDMETHOD(COMGETTER(IPAddress)) (BSTR *aIPAddress);
73 STDMETHOD(COMGETTER(NetworkMask)) (BSTR *aNetworkMask);
74 STDMETHOD(COMGETTER(LowerIP)) (BSTR *aIPAddress);
75 STDMETHOD(COMGETTER(UpperIP)) (BSTR *aIPAddress);
76
77 STDMETHOD(SetConfiguration) (IN_BSTR aIPAddress, IN_BSTR aNetworkMask, IN_BSTR aFromIPAddress, IN_BSTR aToIPAddress);
78
79 STDMETHOD(Start) (IN_BSTR aNetworkName, IN_BSTR aTrunkName, IN_BSTR aTrunkType);
80 STDMETHOD(Stop) ();
81
82 // for VirtualBoxSupportErrorInfoImpl
83 static const wchar_t *getComponentName() { return L"DHCPServer"; }
84
85private:
86 /** weak VirtualBox parent */
87 const ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox;
88
89 const Bstr mName;
90
91 struct Data
92 {
93 Data() : enabled(FALSE) {}
94
95 Bstr IPAddress;
96 Bstr networkMask;
97 Bstr lowerIP;
98 Bstr upperIP;
99 BOOL enabled;
100
101 DHCPServerRunner dhcp;
102 } m;
103
104};
105
106#endif // ____H_H_DHCPSERVERIMPL
107/* 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