1 | /* $Id: NetworkServiceRunner.h 76562 2019-01-01 03:22:50Z 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 <iprt/err.h>
|
---|
25 | #include <iprt/types.h>
|
---|
26 | #include <iprt/string.h>
|
---|
27 | #include <iprt/mem.h>
|
---|
28 | #include <VBox/com/string.h>
|
---|
29 |
|
---|
30 | #include <string>
|
---|
31 |
|
---|
32 | #define TRUNKTYPE_WHATEVER "whatever"
|
---|
33 | #define TRUNKTYPE_NETFLT "netflt"
|
---|
34 | #define TRUNKTYPE_NETADP "netadp"
|
---|
35 | #define TRUNKTYPE_SRVNAT "srvnat"
|
---|
36 |
|
---|
37 | class NetworkServiceRunner
|
---|
38 | {
|
---|
39 | public:
|
---|
40 | NetworkServiceRunner(const char *aProcName);
|
---|
41 | virtual ~NetworkServiceRunner();
|
---|
42 |
|
---|
43 | int setOption(const std::string& key, const std::string& val);
|
---|
44 | void clearOptions();
|
---|
45 |
|
---|
46 | int start(bool aKillProcOnStop);
|
---|
47 | int stop();
|
---|
48 | bool isRunning();
|
---|
49 | void detachFromServer();
|
---|
50 |
|
---|
51 | static const std::string kNsrKeyName;
|
---|
52 | static const std::string kNsrKeyNetwork;
|
---|
53 | static const std::string kNsrKeyTrunkType;
|
---|
54 | static const std::string kNsrTrunkName;
|
---|
55 | static const std::string kNsrMacAddress;
|
---|
56 | static const std::string kNsrIpAddress;
|
---|
57 | static const std::string kNsrIpNetmask;
|
---|
58 | static const std::string kNsrKeyNeedMain;
|
---|
59 |
|
---|
60 | private:
|
---|
61 | struct Data;
|
---|
62 | Data *m;
|
---|
63 | };
|
---|
64 |
|
---|
65 | #endif /* !MAIN_INCLUDED_NetworkServiceRunner_h */
|
---|
66 |
|
---|