1 | /* $Id: CloudGateway.h 85359 2020-07-15 19:08:02Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Implementation of local and cloud gateway management.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2019-2020 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_CloudGateway_h
|
---|
19 | #define MAIN_INCLUDED_CloudGateway_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | struct GatewayInfo
|
---|
25 | {
|
---|
26 | Bstr mTargetVM;
|
---|
27 | Utf8Str mGatewayVM;
|
---|
28 | Utf8Str mGatewayInstanceId;
|
---|
29 | Utf8Str mPublicSshKey;
|
---|
30 | Bstr mCloudProvider;
|
---|
31 | Bstr mCloudProfile;
|
---|
32 | Utf8Str mCloudPublicIp;
|
---|
33 | Utf8Str mCloudSecondaryPublicIp;
|
---|
34 | RTMAC mCloudMacAddress;
|
---|
35 | RTMAC mLocalMacAddress;
|
---|
36 | int mAdapterSlot;
|
---|
37 |
|
---|
38 | HRESULT setCloudMacAddress(const Utf8Str& mac);
|
---|
39 | HRESULT setLocalMacAddress(const Utf8Str& mac);
|
---|
40 |
|
---|
41 | Utf8Str getCloudMacAddressWithoutColons() const;
|
---|
42 | Utf8Str getLocalMacAddressWithoutColons() const;
|
---|
43 | Utf8Str getLocalMacAddressWithColons() const;
|
---|
44 |
|
---|
45 | GatewayInfo() {}
|
---|
46 |
|
---|
47 | GatewayInfo(const GatewayInfo& other)
|
---|
48 | : mGatewayVM(other.mGatewayVM),
|
---|
49 | mGatewayInstanceId(other.mGatewayInstanceId),
|
---|
50 | mPublicSshKey(other.mPublicSshKey),
|
---|
51 | mCloudProvider(other.mCloudProvider),
|
---|
52 | mCloudProfile(other.mCloudProfile),
|
---|
53 | mCloudPublicIp(other.mCloudPublicIp),
|
---|
54 | mCloudSecondaryPublicIp(other.mCloudSecondaryPublicIp),
|
---|
55 | mCloudMacAddress(other.mCloudMacAddress),
|
---|
56 | mLocalMacAddress(other.mLocalMacAddress),
|
---|
57 | mAdapterSlot(other.mAdapterSlot)
|
---|
58 | {}
|
---|
59 |
|
---|
60 | GatewayInfo& operator=(const GatewayInfo& other)
|
---|
61 | {
|
---|
62 | mGatewayVM = other.mGatewayVM;
|
---|
63 | mGatewayInstanceId = other.mGatewayInstanceId;
|
---|
64 | mPublicSshKey = other.mPublicSshKey;
|
---|
65 | mCloudProvider = other.mCloudProvider;
|
---|
66 | mCloudProfile = other.mCloudProfile;
|
---|
67 | mCloudPublicIp = other.mCloudPublicIp;
|
---|
68 | mCloudSecondaryPublicIp = other.mCloudSecondaryPublicIp;
|
---|
69 | mCloudMacAddress = other.mCloudMacAddress;
|
---|
70 | mLocalMacAddress = other.mLocalMacAddress;
|
---|
71 | mAdapterSlot = other.mAdapterSlot;
|
---|
72 | return *this;
|
---|
73 | }
|
---|
74 |
|
---|
75 | void setNull()
|
---|
76 | {
|
---|
77 | mGatewayVM.setNull();
|
---|
78 | mGatewayInstanceId.setNull();
|
---|
79 | mPublicSshKey.setNull();
|
---|
80 | mCloudProvider.setNull();
|
---|
81 | mCloudProfile.setNull();
|
---|
82 | mCloudPublicIp.setNull();
|
---|
83 | mCloudSecondaryPublicIp.setNull();
|
---|
84 | memset(&mCloudMacAddress, 0, sizeof(mCloudMacAddress));
|
---|
85 | memset(&mLocalMacAddress, 0, sizeof(mLocalMacAddress));
|
---|
86 | mAdapterSlot = -1;
|
---|
87 | }
|
---|
88 | };
|
---|
89 |
|
---|
90 | class CloudNetwork;
|
---|
91 |
|
---|
92 | HRESULT startGateways(ComPtr<IVirtualBox> virtualBox, ComPtr<ICloudNetwork> network, GatewayInfo& pGateways);
|
---|
93 | HRESULT stopGateways(ComPtr<IVirtualBox> virtualBox, const GatewayInfo& gateways);
|
---|
94 |
|
---|
95 | #endif /* !MAIN_INCLUDED_CloudGateway_h */
|
---|
96 |
|
---|