Android-cuttlefish cvd tool
interface.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include <string>
19
20namespace cuttlefish {
21
22constexpr std::string_view kCvdallocInterfacePrefix = "cvd-pi";
23constexpr std::string_view kCvdallocEthernetBridgeName = "cvd-pi-ebr";
24constexpr std::string_view kCvdallocWirelessBridgeName = "cvd-pi-wbr";
25constexpr char kCvdallocMobileIpPrefix[] = "192.168.144";
26constexpr char kCvdallocWirelessIpPrefix[] = "192.168.160";
27constexpr char kCvdallocWirelessApIpPrefix[] = "192.168.176";
28constexpr char kCvdallocEthernetIpPrefix[] = "192.168.192";
29
30std::string CvdallocInterfaceName(const std::string& name, int num);
31std::string InstanceToMobileGatewayAddress(int num);
32std::string InstanceToMobileAddress(int num);
33std::string InstanceToMobileBroadcast(int num);
34std::string InstanceToWifiGatewayAddress(int num);
35std::string InstanceToWifiAddress(int num);
36std::string InstanceToWifiBroadcast(int num);
37std::string InstanceToBridgedWifiGatewayAddress(int num);
38std::string InstanceToBridgedWifiAddress(int num);
39std::string InstanceToBridgedWifiBroadcast(int num);
40
41} // namespace cuttlefish
char * name
Definition: libf2fs.c:1403
Definition: alloc_driver.h:20
std::string InstanceToWifiAddress(int num)
Definition: interface.cpp:44
std::string CvdallocInterfaceName(const std::string &name, int num)
Definition: cvdalloc.h:24
constexpr char kCvdallocWirelessIpPrefix[]
Definition: interface.h:26
std::string InstanceToMobileGatewayAddress(int num)
Definition: interface.cpp:28
constexpr char kCvdallocWirelessApIpPrefix[]
Definition: interface.h:27
constexpr char kCvdallocMobileIpPrefix[]
Definition: interface.h:25
constexpr std::string_view kCvdallocEthernetBridgeName
Definition: interface.h:23
std::string InstanceToMobileAddress(int num)
Definition: interface.cpp:32
std::string InstanceToWifiBroadcast(int num)
Definition: interface.cpp:48
std::string InstanceToMobileBroadcast(int num)
Definition: interface.cpp:36
std::string InstanceToBridgedWifiAddress(int num)
Definition: interface.cpp:56
constexpr char kCvdallocEthernetIpPrefix[]
Definition: interface.h:28
constexpr std::string_view kCvdallocInterfacePrefix
Definition: cvdalloc.h:22
constexpr std::string_view kCvdallocWirelessBridgeName
Definition: interface.h:24
std::string InstanceToBridgedWifiBroadcast(int num)
Definition: interface.cpp:60
std::string InstanceToBridgedWifiGatewayAddress(int num)
Definition: interface.cpp:52
std::string InstanceToWifiGatewayAddress(int num)
Definition: interface.cpp:40