Android-cuttlefish cvd tool
Classes | Namespaces | Functions | Variables
alloc_utils.h File Reference
#include <pwd.h>
#include <sys/wait.h>
#include <unistd.h>
#include <atomic>
#include <optional>
#include <sstream>
#include "cuttlefish/common/libs/fs/shared_fd.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::EthernetNetworkConfig
 
struct  cuttlefish::GatewayConfig
 

Namespaces

namespace  cuttlefish
 

Functions

int cuttlefish::RunExternalCommand (const std::string &command)
 
std::optional< std::string > cuttlefish::GetUserName (uid_t uid)
 
bool cuttlefish::AddTapIface (const std::string &name)
 
bool cuttlefish::CreateTap (const std::string &name)
 
bool cuttlefish::BringUpIface (const std::string &name)
 
bool cuttlefish::ShutdownIface (const std::string &name)
 
bool cuttlefish::DestroyIface (const std::string &name)
 
bool cuttlefish::DeleteIface (const std::string &name)
 
bool cuttlefish::CreateBridge (const std::string &name)
 
bool cuttlefish::DestroyBridge (const std::string &name)
 
bool cuttlefish::CreateEbtables (const std::string &name, bool use_ipv4, bool use_ebtables_legacy)
 
bool cuttlefish::DestroyEbtables (const std::string &name, bool use_ipv4, bool use_ebtables_legacy)
 
bool cuttlefish::EbtablesBroute (const std::string &name, bool use_ipv4, bool add, bool use_ebtables_legacy)
 
bool cuttlefish::EbtablesFilter (const std::string &name, bool use_ipv4, bool add, bool use_ebtables_legacy)
 
bool cuttlefish::CreateMobileIface (const std::string &name, uint16_t id, const std::string &ipaddr)
 
bool cuttlefish::DestroyMobileIface (const std::string &name, uint16_t id, const std::string &ipaddr)
 
bool cuttlefish::CreateEthernetIface (const std::string &name, const std::string &bridge_name, bool has_ipv4_bridge, bool has_ipv6_bridge, bool use_ebtables_legacy)
 
bool cuttlefish::DestroyEthernetIface (const std::string &name, bool has_ipv4_bridge, bool has_ipv6_bridge, bool use_ebtables_legacy)
 
void cuttlefish::CleanupEthernetIface (const std::string &name, const EthernetNetworkConfig &config)
 
bool cuttlefish::IptableConfig (const std::string &network, bool add)
 
bool cuttlefish::LinkTapToBridge (const std::string &tap_name, const std::string &bridge_name)
 
bool cuttlefish::SetupBridgeGateway (const std::string &bridge_name, const std::string &ipaddr)
 
void cuttlefish::CleanupBridgeGateway (const std::string &name, const std::string &ipaddr, const GatewayConfig &config)
 
bool cuttlefish::CreateEthernetBridgeIface (const std::string &name, const std::string &ipaddr)
 
bool cuttlefish::DestroyEthernetBridgeIface (const std::string &name, const std::string &ipaddr)
 
bool cuttlefish::AddGateway (const std::string &name, const std::string &gateway, const std::string &netmask)
 
bool cuttlefish::DestroyGateway (const std::string &name, const std::string &gateway, const std::string &netmask)
 
bool cuttlefish::StartDnsmasq (const std::string &bridge_name, const std::string &gateway, const std::string &dhcp_range)
 
bool cuttlefish::StopDnsmasq (const std::string &name)
 

Variables

constexpr char cuttlefish::kEbtablesName [] = "ebtables"
 
constexpr char cuttlefish::kEbtablesLegacyName [] = "ebtables-legacy"
 
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