master
h 31 lines 888 Bytes
Raw
1 // Copyright (C) Microsoft Corporation. All rights reserved.
2
3 #pragma once
4
5 #include "INetworkingEngine.h"
6 #include "GnsChannel.h"
7 #include "WslCoreConfig.h"
8 #include "WslCoreNetworkEndpointSettings.h"
9
10 namespace wsl::core {
11
12 class BridgedNetworking : public INetworkingEngine
13 {
14 public:
15 BridgedNetworking(HCS_SYSTEM system, const Config& config);
16 ~BridgedNetworking() override = default;
17
18 void Initialize() override;
19 void TraceLoggingRundown() noexcept override;
20 void FillInitialConfiguration(LX_MINI_INIT_NETWORKING_CONFIGURATION& message) override;
21 void StartPortTracker(wil::unique_socket&& socket) override;
22
23 private:
24 // Handle for the Hcn* Api. Owned by the caller (WslCoreVm), this is a non-owning copy
25 const HCS_SYSTEM m_system{};
26
27 const Config& m_config;
28 wsl::core::networking::EphemeralHcnEndpoint m_endpoint;
29 };
30
31 } // namespace wsl::core