VirtualBox

source: vbox/trunk/src/VBox/Main/include/NetworkServiceRunner.h@ 79862

Last change on this file since 79862 was 79761, checked in by vboxsync, 5 years ago

Main/DHCPServer,Dhcpd,VBoxManage: Added --log option to the DHCP server so we can start logging early. Added log rotation and limits. Put the config file next to the log and leases file. Validate DHCP options by reusing the parser code from the server, adding a bunch more DHCP options to the parser. Removed legacy and hardcoded configuration options from the dhcp server, it's all config file now. Fixed a bug in the option parsing of the VBoxManage dhcpserver add/modify commands. bugref:9288

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1/* $Id: NetworkServiceRunner.h 79761 2019-07-14 03:18:41Z vboxsync $ */
2/** @file
3 * VirtualBox Main - interface for VBox DHCP server.
4 */
5
6/*
7 * Copyright (C) 2009-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef MAIN_INCLUDED_NetworkServiceRunner_h
19#define MAIN_INCLUDED_NetworkServiceRunner_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include <VBox/com/string.h>
25
26
27/** @name Internal networking trunk type option values (NetworkServiceRunner::kpszKeyTrunkType)
28 * @{ */
29#define TRUNKTYPE_WHATEVER "whatever"
30#define TRUNKTYPE_NETFLT "netflt"
31#define TRUNKTYPE_NETADP "netadp"
32#define TRUNKTYPE_SRVNAT "srvnat"
33/** @} */
34
35/**
36 * Network service runner.
37 *
38 * Build arguments, starts and stops network service processes.
39 */
40class NetworkServiceRunner
41{
42public:
43 NetworkServiceRunner(const char *aProcName);
44 virtual ~NetworkServiceRunner();
45
46 /** @name Argument management
47 * @{ */
48 int addArgument(const char *pszArgument);
49 int addArgPair(const char *pszOption, const char *pszValue);
50 void resetArguments();
51 /** @} */
52
53 int start(bool aKillProcessOnStop);
54 int stop();
55 void detachFromServer();
56 bool isRunning();
57
58 RTPROCESS getPid() const;
59
60 /** @name Common options
61 * @{ */
62 static const char * const kpszKeyNetwork;
63 static const char * const kpszKeyTrunkType;
64 static const char * const kpszTrunkName;
65 static const char * const kpszMacAddress;
66 static const char * const kpszIpAddress;
67 static const char * const kpszIpNetmask;
68 static const char * const kpszKeyNeedMain;
69 /** @} */
70
71private:
72 struct Data;
73 Data *m;
74};
75
76#endif /* !MAIN_INCLUDED_NetworkServiceRunner_h */
77
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