Android-cuttlefish cvd tool
Namespaces | Functions
alloc_utils.cpp File Reference
#include "allocd/alloc_utils.h"
#include <fcntl.h>
#include <net/if.h>
#include <pwd.h>
#include <stdint.h>
#include <string.h>
#include <fstream>
#include <optional>
#include <sstream>
#include <string>
#include <string_view>
#include "absl/base/no_destructor.h"
#include "absl/log/log.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "allocd/alloc_driver.h"
#include "cuttlefish/common/libs/fs/shared_fd.h"
#include "cuttlefish/common/libs/utils/files.h"
#include "cuttlefish/common/libs/utils/network.h"
#include "cuttlefish/host/commands/cvd/utils/common.h"
#include "cuttlefish/process/execute.h"
#include "cuttlefish/result/result.h"
Include dependency graph for alloc_utils.cpp:

Namespaces

namespace  cuttlefish
 
namespace  cuttlefish::anonymous_namespace{alloc_utils.cpp}
 

Functions

Result< std::string > cuttlefish::anonymous_namespace{alloc_utils.cpp}::SearchForIptables ()
 
Result< std::string > cuttlefish::anonymous_namespace{alloc_utils.cpp}::SearchForDnsmasq ()
 
bool cuttlefish::CreateEthernetIface (std::string_view name, std::string_view bridge_name)
 
std::string cuttlefish::MobileGatewayName (std::string_view ipaddr, uint16_t id)
 
std::string cuttlefish::MobileNetworkName (std::string_view ipaddr, std::string_view netmask, uint16_t id)
 
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::DestroyEthernetIface (std::string_view name)
 
void cuttlefish::CleanupEthernetIface (std::string_view name)
 
bool cuttlefish::CreateTap (std::string_view name)
 
bool cuttlefish::DestroyIface (std::string_view name)
 
std::optional< std::string > cuttlefish::GetUserName (uid_t uid)
 
bool cuttlefish::DestroyBridge (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::StartDnsmasq (std::string_view bridge_name, std::string_view gateway, std::string_view dhcp_range)
 
bool cuttlefish::StopDnsmasq (std::string_view name)
 
bool cuttlefish::CreateEthernetBridgeIface (std::string_view name, std::string_view ipaddr)
 
bool cuttlefish::DestroyEthernetBridgeIface (std::string_view name, std::string_view ipaddr)
 
Result< std::string > cuttlefish::IptablesPath ()
 
Result< std::string > cuttlefish::DnsmasqPath ()