Namespace isolation

namespace isolation

Enums

enum CgroupMode

Values:

enumerator cg_off
enumerator cg_on

Functions

std::shared_ptr<NetworkNamespace> claimNetworkNamespace()
void returnNetworkNamespace(std::shared_ptr<NetworkNamespace> ns)
pid_t getCurrentTid()
void addCurrentThreadToTasks(const path &tasksPath)
void joinNamespace(const boost::filesystem::path &nsPath)

Variables

static const std::string BASE_DIR = "/sys/fs/cgroup/"
static const std::string CG_CPU = "cpu"
static const std::vector<std::string> controllers = {CG_CPU}
static std::mutex groupMutex
std::vector<std::shared_ptr<NetworkNamespace>> namespaces
bool namespacesInitialised = false
std::mutex namespacesLock
class CGroup

Public Functions

explicit CGroup(const std::string &name)
void addCurrentThread()
const std::string getName()
const CgroupMode getMode()
class NetworkNamespace

Public Functions

explicit NetworkNamespace(const std::string &name)
void addCurrentThread()
void removeCurrentThread()
const std::string getName()