14#ifdef BUILD_FOR_VALGRIND
15#include <valgrind/valgrind.h>
17#ifndef RUNNING_ON_VALGRIND
18#define RUNNING_ON_VALGRIND 0
19#warning Defaulting RUNNING_ON_VALGRIND to 0
23# include <linux/unistd.h>
30#define RESIPROCATE_SUBSYSTEM Subsystem::TRANSPORT
31#define DEFAULT_NET_NAMESPACE "/proc/1/ns/net"
32#define NET_NAMESPACE_DIR "/var/run/netns/"
41int NetNs::setNs(
const Data& netNs)
58 WarningLog(<<
"Permission denied opening global netns. Assuming already using global netns.");
62 throw Exception(
"Permission denied opening \"" +
deviceName +
"\" to set setns, may need to run as root",
81#define DO_SETNS(fd, flag) setns(fd, flag)
84#define DO_SETNS(fd, flag) syscall(__NR_setns, fd, flag)
103 throw Exception(
"Can't change to name space \"" + netNs +
"\"(fd:" +
114int NetNs::getPublicNetNs(std::vector<Data>&
netNsNames)
123 if(!
dirItr.is_directory())
148int NetNs::openNetNs(
const Data& netNs)
162bool NetNs::netNsExists(
const Data& netNs)
223 throw Exception(
"netns id: " +
Data(
netNsId) +
" does not exist",
229void NetNs::initDictionary()
#define WarningLog(args_)
#define resip_assert(x)
This file needs to work for both C and C++ code.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
bool empty() const noexcept
Checks whether the Data is empty.
dcm! – add UnusedChecking(_enum) below;