Android-cuttlefish cvd tool
Classes | Namespaces | Functions | Variables
alloc_utils.h File Reference
#include <pwd.h>
#include <stdint.h>
#include <sys/wait.h>
#include <unistd.h>
#include <optional>
#include <string>
#include <string_view>
#include "cuttlefish/result/result.h"
Include dependency graph for alloc_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cuttlefish::GatewayConfig
 

Namespaces

namespace  cuttlefish
 

Functions

int cuttlefish::RunExternalCommand (const std::string &command)
 
Result< std::string > cuttlefish::IptablesPath ()
 
Result< std::string > cuttlefish::DnsmasqPath ()
 
std::optional< std::string > cuttlefish::GetUserName (uid_t uid)
 
bool cuttlefish::CreateTap (std::string_view name)
 
bool cuttlefish::DestroyIface (std::string_view name)
 
bool cuttlefish::DestroyBridge (std::string_view name)
 
bool cuttlefish::CreateMobileIface (std::string_view name, uint16_t id, std::string_view ipaddr)
 
bool cuttlefish::DestroyMobileIface (std::string_view name, uint16_t id, std::string_view ipaddr)
 
bool cuttlefish::CreateEthernetIface (std::string_view name, std::string_view bridge_name)
 
bool cuttlefish::DestroyEthernetIface (std::string_view name)
 
void cuttlefish::CleanupEthernetIface (std::string_view name)
 
bool cuttlefish::SetupBridgeGateway (std::string_view bridge_name, std::string_view ipaddr)
 
void cuttlefish::CleanupBridgeGateway (std::string_view name, std::string_view ipaddr, const GatewayConfig &config)
 
bool cuttlefish::CreateEthernetBridgeIface (std::string_view name, std::string_view ipaddr)
 
bool cuttlefish::DestroyEthernetBridgeIface (std::string_view name, std::string_view ipaddr)
 
bool cuttlefish::StartDnsmasq (std::string_view bridge_name, std::string_view gateway, std::string_view dhcp_range)
 
bool cuttlefish::StopDnsmasq (std::string_view name)
 

Variables

constexpr char cuttlefish::kWirelessIp [] = "192.168.96"
 
constexpr char cuttlefish::kMobileIp [] = "192.168.97"
 
constexpr char cuttlefish::kEthernetIp [] = "192.168.98"
 
constexpr int cuttlefish::kSocketMode = 0666
 
constexpr uint32_t cuttlefish::kMaxIfaceNameId = 63