blob: f46edd6a2d8ee1f406a2d4e286be93dc85111d61 [file] [log] [blame]
Mike Frysinger3a446f22022-09-08 07:37:141// Copyright 2016 The ChromiumOS Authors
Kevin Cernekee95d4ae92016-06-19 17:26:292// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Garrick Evans3388a032020-03-24 02:25:555#ifndef PATCHPANEL_MANAGER_H_
6#define PATCHPANEL_MANAGER_H_
Kevin Cernekee95d4ae92016-06-19 17:26:297
Garrick Evans49879532018-12-03 04:15:368#include <map>
Kevin Cernekee95d4ae92016-06-19 17:26:299#include <memory>
Hugo Benichif8803502023-06-29 11:12:4210#include <optional>
Garrick Evans49879532018-12-03 04:15:3611#include <set>
Kevin Cernekee95d4ae92016-06-19 17:26:2912#include <string>
Jason Jeremy Imanf4156cb2019-11-14 06:36:2213#include <vector>
Kevin Cernekee95d4ae92016-06-19 17:26:2914
Chih-Yu Huang77d53dd2023-03-31 08:52:5615#include <base/files/scoped_file.h>
Kevin Cernekee95d4ae92016-06-19 17:26:2916#include <base/memory/weak_ptr.h>
Jie Jiange970cc22024-06-12 07:03:1017#include <chromeos/net-base/process_manager.h>
Hugo Benichi8135e562019-12-12 06:56:3618#include <patchpanel/proto_bindings/patchpanel_service.pb.h>
Kevin Cernekee95d4ae92016-06-19 17:26:2919
Garrick Evans3388a032020-03-24 02:25:5520#include "patchpanel/address_manager.h"
21#include "patchpanel/arc_service.h"
naoyatezuka88b26ef2023-08-17 04:27:2122#include "patchpanel/clat_service.h"
Jie Jiang493cde42020-07-17 12:43:3923#include "patchpanel/counters_service.h"
Garrick Evans3388a032020-03-24 02:25:5524#include "patchpanel/crostini_service.h"
Hugo Benichifcf81022020-12-04 02:01:3725#include "patchpanel/datapath.h"
Hugo Benichi8b891a62023-09-05 06:33:4526#include "patchpanel/dbus_client_notifier.h"
Hugo Benichiabcd7c92024-05-21 06:09:0627#include "patchpanel/downstream_network_info.h"
Hugo Benichi00a001b2024-05-22 07:37:1228#include "patchpanel/downstream_network_service.h"
Hugo Benichi8b4d2fc2023-10-23 05:11:2529#include "patchpanel/forwarding_service.h"
Taoyu Li0093a582022-07-13 09:29:2230#include "patchpanel/guest_ipv6_service.h"
Hugo Benichi44d11a32024-04-29 14:18:5531#include "patchpanel/lifeline_fd_service.h"
Chuwei Hee1c068a2023-06-02 02:51:3432#include "patchpanel/multicast_counters_service.h"
Chuwei Hed94b3222024-05-21 05:24:2333#include "patchpanel/multicast_forwarder.h"
Jason Jeremy Imanac627e62023-06-08 01:06:4934#include "patchpanel/multicast_metrics.h"
Jie Jiangc99d3be2024-06-15 06:41:3635#include "patchpanel/network/network_applier.h"
Jie Jiang01c1a2e2020-04-08 11:58:3036#include "patchpanel/network_monitor_service.h"
Chih-Yu Huang9cd750a2024-07-18 04:58:2237#include "patchpanel/qos_service.h"
Garrick Evans3388a032020-03-24 02:25:5538#include "patchpanel/routing_service.h"
Chih-Yu Huang26eee6e2023-06-08 06:08:2239#include "patchpanel/rtnl_client.h"
Garrick Evans3388a032020-03-24 02:25:5540#include "patchpanel/shill_client.h"
Taoyu Lia6c0dd22022-07-27 08:20:4441#include "patchpanel/subprocess_controller.h"
Hugo Benichi03be8962022-03-17 04:16:3842#include "patchpanel/system.h"
Kevin Cernekee95d4ae92016-06-19 17:26:2943
Garrick Evans3388a032020-03-24 02:25:5544namespace patchpanel {
Kevin Cernekee95d4ae92016-06-19 17:26:2945
Chih-Yu Huang77d53dd2023-03-31 08:52:5646// The core implementation of the patchpanel daemon.
Hugo Benichi8b4d2fc2023-10-23 05:11:2547class Manager : public ForwardingService {
Kevin Cernekee95d4ae92016-06-19 17:26:2948 public:
Chih-Yu Huang77d53dd2023-03-31 08:52:5649 // The caller should guarantee |system|, |process_manager|, |metrics| and
Chih-Yu Huang11c6d092024-07-17 08:53:0550 // |dbus_client_notifier| variables outlive the created Manager instance.
Chih-Yu Huang5e114cb2024-07-25 02:41:0851 Manager(const base::FilePath& cmd_path,
Jie Jiang0c389c52024-10-12 16:00:4652 const scoped_refptr<dbus::Bus>& bus,
Chih-Yu Huang5e114cb2024-07-25 02:41:0853 System* system,
54 net_base::ProcessManager* process_manager,
55 MetricsLibraryInterface* metrics,
56 DbusClientNotifier* dbus_client_notifier,
57 std::unique_ptr<ShillClient> shill_client,
58 std::unique_ptr<RTNLClient> rtnl_client);
Chih-Yu Huang11c6d092024-07-17 08:53:0559
Qijiang Fan6bc59e12020-11-10 17:51:0660 Manager(const Manager&) = delete;
61 Manager& operator=(const Manager&) = delete;
Chih-Yu Huang77d53dd2023-03-31 08:52:5662 virtual ~Manager();
Qijiang Fan6bc59e12020-11-10 17:51:0663
Chih-Yu Huang77d53dd2023-03-31 08:52:5664 // Queries the list of virtual devices managed by patchpanel.
Chih-Yu Huang16829772023-05-08 05:18:5265 GetDevicesResponse GetDevices() const;
Kevin Cernekee95d4ae92016-06-19 17:26:2966
Chih-Yu Huang77d53dd2023-03-31 08:52:5667 // Handles notification indicating ARC++ is booting up.
68 bool ArcStartup(pid_t pid);
Garrick Evans4ac09852020-01-16 05:09:2269
Chih-Yu Huang77d53dd2023-03-31 08:52:5670 // Handles notification indicating ARC++ is spinning down.
71 void ArcShutdown();
Garrick Evans4ac09852020-01-16 05:09:2272
Chih-Yu Huang77d53dd2023-03-31 08:52:5673 // Handles notification indicating ARCVM is booting up.
Hugo Benichi35e98b82023-10-17 15:10:0174 std::optional<patchpanel::ArcVmStartupResponse> ArcVmStartup(uint32_t cid);
Jason Jeremy Imanf4156cb2019-11-14 06:36:2275
Chih-Yu Huang77d53dd2023-03-31 08:52:5676 // Handles notification indicating ARCVM is spinning down.
77 void ArcVmShutdown(uint32_t cid);
78
79 // Handles notification indicating a Termina VM is booting up.
Hugo Benichic911b752023-07-31 04:02:1980 const CrostiniService::CrostiniDevice* const TerminaVmStartup(uint64_t vm_id);
Chih-Yu Huang77d53dd2023-03-31 08:52:5681
82 // Handles notification indicating a Termina VM is spinning down.
83 void TerminaVmShutdown(uint64_t vm_id);
84
Hugo Benichi9c6c5462023-05-14 15:34:4385 // Handles notification indicating a Parallels VM is booting up.
Hugo Benichic911b752023-07-31 04:02:1986 const CrostiniService::CrostiniDevice* const ParallelsVmStartup(
87 uint64_t vm_id, uint32_t subnet_index);
Chih-Yu Huang77d53dd2023-03-31 08:52:5688
Hugo Benichi9c6c5462023-05-14 15:34:4389 // Handles notification indicating a Parallels VM is spinning down.
90 void ParallelsVmShutdown(uint64_t vm_id);
Chih-Yu Huang77d53dd2023-03-31 08:52:5691
Chih-Yu Huang90ff6472023-08-25 06:12:0592 // Handles notification indicating a Bruschetta VM is booting up.
93 const CrostiniService::CrostiniDevice* const BruschettaVmStartup(
94 uint64_t vm_id);
95
96 // Handles notification indicating a Bruschetta VM is spinning down.
97 void BruschettaVmShutdown(uint64_t vm_id);
98
Damien Dejeanf608ff82023-11-08 12:47:0399 // Handles notification indicating a Borealis VM is booting up.
100 const CrostiniService::CrostiniDevice* const BorealisVmStartup(
101 uint64_t vm_id);
102
103 // Handles notification indicating a Borealis VM is spinning down.
104 void BorealisVmShutdown(uint64_t vm_id);
105
Chih-Yu Huang77d53dd2023-03-31 08:52:56106 // Connects and routes an existing network namespace created via minijail or
107 // through rtnetlink RTM_NEWNSID.
108 ConnectNamespaceResponse ConnectNamespace(
109 const patchpanel::ConnectNamespaceRequest& request,
Hugo Benichi44d11a32024-04-29 14:18:55110 base::ScopedFD client_fd);
Chih-Yu Huang77d53dd2023-03-31 08:52:56111
112 // Queries traffic counters.
113 std::map<CountersService::CounterKey, CountersService::Counter>
Chih-Yu Huang16829772023-05-08 05:18:52114 GetTrafficCounters(const std::set<std::string>& shill_devices) const;
Chih-Yu Huang77d53dd2023-03-31 08:52:56115
116 // Creates iptables rules requests from permission_broker.
117 bool ModifyPortRule(const patchpanel::ModifyPortRuleRequest& request);
118
119 // Starts or stops VPN lockdown.
120 void SetVpnLockdown(bool enable_vpn_lockdown);
121
122 // Creates iptables rules requests from dns-proxy.
123 bool SetDnsRedirectionRule(
124 const patchpanel::SetDnsRedirectionRuleRequest& request,
Hugo Benichi44d11a32024-04-29 14:18:55125 base::ScopedFD client_fd);
Chih-Yu Huang77d53dd2023-03-31 08:52:56126
Jie Jiangafb11632024-01-30 09:54:38127 // Tags the socket pointed by |sock_fd| for routing and other purposes.
128 bool TagSocket(const patchpanel::TagSocketRequest& request,
129 const base::ScopedFD& sock_fd);
130
Chuwei He5849a7c2024-06-25 08:16:59131 // Unimplemented, keep the call for future use.
132 void NotifyAndroidInteractiveState(bool is_interactive) {}
Chuwei Hebd0dec72023-04-13 07:39:25133
Chuwei He5849a7c2024-06-25 08:16:59134 // Start/Stop forwarding inbound WiFi multicast traffic for ARC when Android
135 // WiFi multicast lock held status changes (and only for ARC V+, any offload
136 // service also needs to be registered for |is_held| to be true).
137 // Start forwarding IPv4 and IPv6 multicast mDNS and SSDP traffic for WiFi
138 // interfaces only when |is_held| status is `true` for ARC WiFi interface.
Chuwei Hebd0dec72023-04-13 07:39:25139 void NotifyAndroidWifiMulticastLockChange(bool is_held);
140
Chuwei He629ee7f2023-08-28 06:12:13141 // Apply changes based on the socket connection event.
142 // Currently this is only used for ARC socket connections and applies QoS
143 // setup and resets the QoS setup on connection closed.
Chuwei He33fede02023-08-14 07:00:54144 void NotifySocketConnectionEvent(
145 const NotifySocketConnectionEventRequest& request);
146
Chuwei Heeb9f6492024-01-12 03:13:03147 // Apply changes based on the socket connection event from ARC VPN.
148 // Currently this is only used for ARC VPN traffic counting.
Chuwei He32c9b7b2024-01-23 05:39:32149 void NotifyARCVPNSocketConnectionEvent(
150 const NotifyARCVPNSocketConnectionEventRequest& request);
Chuwei Heeb9f6492024-01-12 03:13:03151
Chuwei Hebfcacfc2023-08-25 02:12:49152 // Set feature enabled flag.
Damien Dejeande59f982023-10-03 14:05:05153 bool SetFeatureFlag(patchpanel::SetFeatureFlagRequest::FeatureFlag flag,
Chuwei Hebfcacfc2023-08-25 02:12:49154 bool enabled);
155
Chuwei He867402a2024-05-22 05:02:19156 void StartIPv6NDPForwarding(
157 const ShillClient::Device& shill_device,
Chuwei Heca57f7e2024-05-30 05:41:14158 std::string_view ifname_virtual,
Chuwei He867402a2024-05-22 05:02:19159 std::optional<int> mtu = std::nullopt,
160 std::optional<int> hop_limit = std::nullopt) override;
161
162 void StopIPv6NDPForwarding(const ShillClient::Device& shill_device,
Chuwei Heca57f7e2024-05-30 05:41:14163 std::string_view ifname_virtual) override;
Chuwei He867402a2024-05-22 05:02:19164
165 void StartBroadcastForwarding(const ShillClient::Device& shill_device,
Chuwei Heca57f7e2024-05-30 05:41:14166 std::string_view ifname_virtual) override;
Chuwei He867402a2024-05-22 05:02:19167
168 void StopBroadcastForwarding(const ShillClient::Device& shill_device,
Chuwei Heca57f7e2024-05-30 05:41:14169 std::string_view ifname_virtual) override;
Chuwei He867402a2024-05-22 05:02:19170
Chuwei Hed94b3222024-05-21 05:24:23171 void StartMulticastForwarding(
172 const ShillClient::Device& shill_device,
Chuwei He4f4ab292024-06-06 02:33:57173 std::string_view ifname_virtual,
Chuwei Hed94b3222024-05-21 05:24:23174 MulticastForwarder::Direction dir =
175 MulticastForwarder::Direction::kTwoWays) override;
Chuwei He867402a2024-05-22 05:02:19176
Chuwei Hed94b3222024-05-21 05:24:23177 void StopMulticastForwarding(
178 const ShillClient::Device& shill_device,
Chuwei He4f4ab292024-06-06 02:33:57179 std::string_view ifname_virtual,
Chuwei Hed94b3222024-05-21 05:24:23180 MulticastForwarder::Direction dir =
181 MulticastForwarder::Direction::kTwoWays) override;
Hugo Benichi8b4d2fc2023-10-23 05:11:25182
Jie Jiangc99d3be2024-06-15 06:41:36183 void ConfigureNetwork(int ifindex,
184 const std::string& ifname,
185 NetworkApplier::Area area,
186 const net_base::NetworkConfig& network_config,
187 net_base::NetworkPriority priority,
Jie Jiangcd0402c2024-10-09 06:11:00188 NetworkApplier::Technology technology,
189 int session_id);
Jie Jiangc99d3be2024-06-15 06:41:36190
Hugo Benichi4b7db062024-05-22 07:37:51191 DownstreamNetworkService* downstream_network_service() {
Chih-Yu Huang9cd750a2024-07-18 04:58:22192 return &downstream_network_svc_;
Hugo Benichi4b7db062024-05-22 07:37:51193 }
Hugo Benichi00a001b2024-05-22 07:37:12194
Kevin Cernekee95d4ae92016-06-19 17:26:29195 private:
Chuwei Hebd0dec72023-04-13 07:39:25196 friend class ManagerTest;
197
Taoyu Li8dcef8a2024-01-31 07:55:02198 // The initialization tasks that are not necessary for handling dbus methods.
Jie Jiangfbd181e2024-03-08 02:12:40199 void RunDelayedInitialization();
Taoyu Li8dcef8a2024-01-31 07:55:02200
Chih-Yu Huang77d53dd2023-03-31 08:52:56201 // Callbacks from |shill_client_|.
Jason Jeremy Imanb6a18932021-07-27 06:22:14202 void OnShillDefaultLogicalDeviceChanged(
Hugo Benichif8803502023-06-29 11:12:42203 const ShillClient::Device* new_device,
204 const ShillClient::Device* prev_device);
Jason Jeremy Iman6a7c3952021-07-05 14:15:10205 void OnShillDefaultPhysicalDeviceChanged(
Hugo Benichif8803502023-06-29 11:12:42206 const ShillClient::Device* new_device,
207 const ShillClient::Device* prev_device);
Hugo Benichi93c556c2023-05-23 02:56:38208 void OnShillDevicesChanged(const std::vector<ShillClient::Device>& added,
209 const std::vector<ShillClient::Device>& removed);
Hugo Benichi9a2f91a2023-05-23 02:43:02210 void OnIPConfigsChanged(const ShillClient::Device& shill_device);
Hugo Benichid7abeca2023-05-23 01:08:56211 void OnIPv6NetworkChanged(const ShillClient::Device& shill_device);
Jie Jiang09104cc2024-09-08 06:03:42212 void OnDoHProvidersChanged();
Garrick Evans209a80a2020-11-30 05:42:40213
Chih-Yu Huang77d53dd2023-03-31 08:52:56214 // Callback from |network_monitor_svc_|.
Jie Jiang25c1b972020-11-12 06:42:53215 void OnNeighborReachabilityEvent(
216 int ifindex,
Chih-Yu Huang3e5aca22023-07-03 04:34:39217 const net_base::IPAddress& ip_addr,
Jie Jiang25c1b972020-11-12 06:42:53218 NeighborLinkMonitor::NeighborRole role,
219 NeighborReachabilityEventSignal::EventType event_type);
Jie Jiang84966852020-09-18 09:49:05220
Hugo Benichi44d11a32024-04-29 14:18:55221 // Tears down a ConnectedNamespace setup given its connected namespace id.
222 void OnConnectedNamespaceAutoclose(int connected_namespace_id);
223 // Tears down a DNS redirection rule request given the lifeline fd value
224 // committed by the client dns-proxy instance.
225 void OnDnsRedirectionRulesAutoclose(int lifeline_fd);
Hugo Benichiadf1ec52020-01-17 07:23:58226
Hugo Benichic911b752023-07-31 04:02:19227 const CrostiniService::CrostiniDevice* StartCrosVm(
228 uint64_t vm_id,
229 CrostiniService::VMType vm_type,
230 uint32_t subnet_index = kAnySubnetIndex);
Taoyu Li73d63a02023-09-28 04:33:23231 void StopCrosVm(uint64_t vm_id, CrostiniService::VMType vm_type);
Jason Jeremy Iman58b70912021-04-22 21:15:52232
Chih-Yu Huang26eee6e2023-06-08 06:08:22233 std::vector<DownstreamClientInfo> GetDownstreamClientInfo(
Chuwei Heca57f7e2024-05-30 05:41:14234 std::string_view downstream_ifname) const;
Chih-Yu Huang26eee6e2023-06-08 06:08:22235
Jason Jeremy Imana183d7a2021-08-05 16:35:40236 // Disable and re-enable IPv6 inside a namespace.
Chuwei Heca57f7e2024-05-30 05:41:14237 void RestartIPv6(std::string_view netns_name);
Jason Jeremy Imana183d7a2021-08-05 16:35:40238
Garrick Evanse94a14e2019-11-11 01:32:13239 // Dispatch |msg| to child processes.
240 void SendGuestMessage(const GuestMessage& msg);
Garrick Evans96e03042019-05-28 05:30:52241
Chih-Yu Huang11c6d092024-07-17 08:53:05242 // The factory of the WeakPtr. Declare it at the beginning to make the
243 // following services able to use it.
244 // Note: We should invalidate the WeakPtr manually before releasing the
245 // following services.
246 base::WeakPtrFactory<Manager> weak_factory_{this};
247
Hugo Benichi40a71b92024-04-23 06:05:03248 // patchpanel::System shared for all subsystems, owned by PatchpanelDaemon.
Chih-Yu Huang26eee6e2023-06-08 06:08:22249 System* system_;
Hugo Benichi00a001b2024-05-22 07:37:12250 // UMA metrics client. Owned by PatchpanelDaemon.
Chih-Yu Huang19e49822023-06-23 08:17:55251 MetricsLibraryInterface* metrics_;
Chih-Yu Huang77d53dd2023-03-31 08:52:56252 // The client of the Manager.
Hugo Benichi8b891a62023-09-05 06:33:45253 DbusClientNotifier* dbus_client_notifier_;
Hugo Benichia85c0db2021-11-01 05:20:37254 // Shill Dbus client.
Garrick Evans69b85872020-02-04 02:40:26255 std::unique_ptr<ShillClient> shill_client_;
Chih-Yu Huang26eee6e2023-06-08 06:08:22256 // rtnetlink client.
257 std::unique_ptr<RTNLClient> rtnl_client_;
258
Chih-Yu Huang11c6d092024-07-17 08:53:05259 // IPv4 prefix and address manager.
260 AddressManager addr_mgr_;
261 // LifelineFD management service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22262 LifelineFDService lifeline_fd_svc_;
Hugo Benichia85c0db2021-11-01 05:20:37263 // adb connection forwarder service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22264 SubprocessController adb_proxy_;
Hugo Benichia85c0db2021-11-01 05:20:37265 // IPv4 and IPv6 Multicast forwarder service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22266 SubprocessController mcast_proxy_;
Taoyu Li0093a582022-07-13 09:29:22267 // IPv6 neighbor discovery forwarder process handler.
Chih-Yu Huang9cd750a2024-07-18 04:58:22268 SubprocessController nd_proxy_;
Damien Dejeanc3f94d62024-04-12 07:47:50269 // Socket service process handler.
Chih-Yu Huang9cd750a2024-07-18 04:58:22270 SubprocessController socket_service_;
Chih-Yu Huang11c6d092024-07-17 08:53:05271 // High level routing and iptables controller service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22272 Datapath datapath_;
Chih-Yu Huang11c6d092024-07-17 08:53:05273 // Routing service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22274 RoutingService routing_svc_;
Chih-Yu Huang5e114cb2024-07-25 02:41:08275 // Conntrack monitor.
276 ConntrackMonitor conntrack_monitor_;
Hugo Benichia85c0db2021-11-01 05:20:37277 // Traffic counter service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22278 CountersService counters_svc_;
Chuwei Hee1c068a2023-06-02 02:51:34279 // Multicast packet counter service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22280 MulticastCountersService multicast_counters_svc_;
Chih-Yu Huang11c6d092024-07-17 08:53:05281 // Fetches and reports multicast packet count to UMA metrics.
Chih-Yu Huang9cd750a2024-07-18 04:58:22282 MulticastMetrics multicast_metrics_;
Chih-Yu Huang11c6d092024-07-17 08:53:05283 // IPv6 address provisioning / ndp forwarding service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22284 GuestIPv6Service ipv6_svc_;
Jie Jiang1d646272023-08-23 04:26:20285 // QoS service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22286 QoSService qos_svc_;
Hugo Benichi00a001b2024-05-22 07:37:12287 // TetheredNetwork and LocalOnlyNetwork management service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22288 DownstreamNetworkService downstream_network_svc_;
Chih-Yu Huang11c6d092024-07-17 08:53:05289 // ARC++/ARCVM service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22290 ArcService arc_svc_;
Chih-Yu Huang11c6d092024-07-17 08:53:05291 // Crostini and other VM service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22292 CrostiniService cros_svc_;
Chih-Yu Huang11c6d092024-07-17 08:53:05293 // L2 neighbor monitor service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22294 NetworkMonitorService network_monitor_svc_;
Chih-Yu Huang11c6d092024-07-17 08:53:05295 // CLAT service.
Chih-Yu Huang9cd750a2024-07-18 04:58:22296 ClatService clat_svc_;
Garrick Evansf4a93292019-03-13 05:19:43297
Hugo Benichiadf1ec52020-01-17 07:23:58298 // All namespaces currently connected through patchpanel ConnectNamespace
Hugo Benichi44d11a32024-04-29 14:18:55299 // API, keyed by the the namespace id of the ConnectedNamespace.
Hugo Benichifcf81022020-12-04 02:01:37300 std::map<int, ConnectedNamespace> connected_namespaces_;
Hugo Benichiadf1ec52020-01-17 07:23:58301 int connected_namespaces_next_id_{0};
Jason Jeremy Iman58b70912021-04-22 21:15:52302
Jason Jeremy Iman880a22f2022-07-13 05:51:55303 // DNS proxy's IPv4 and IPv6 addresses keyed by its guest interface.
Chih-Yu Huang1bacdd32023-06-27 03:46:10304 std::map<std::string, net_base::IPv4Address> dns_proxy_ipv4_addrs_;
305 std::map<std::string, net_base::IPv6Address> dns_proxy_ipv6_addrs_;
Jason Jeremy Iman880a22f2022-07-13 05:51:55306
Jason Jeremy Iman58b70912021-04-22 21:15:52307 // All rules currently created through patchpanel RedirectDns
Hugo Benichi44d11a32024-04-29 14:18:55308 // API, keyed by the host-side interface name of the ConnectedNamespace of the
309 // target dns-proxy instance to which the queries should be redirected.
Jason Jeremy Iman58b70912021-04-22 21:15:52310 std::map<int, DnsRedirectionRule> dns_redirection_rules_;
Kevin Cernekee95d4ae92016-06-19 17:26:29311};
312
Garrick Evans3388a032020-03-24 02:25:55313} // namespace patchpanel
Garrick Evans3388a032020-03-24 02:25:55314#endif // PATCHPANEL_MANAGER_H_