NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
privilege-helper.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
25
#ifndef NFD_CORE_PRIVILEGE_HELPER_HPP
26
#define NFD_CORE_PRIVILEGE_HELPER_HPP
27
28
#include "
common.hpp
"
29
30
#include <unistd.h>
31
32
namespace
nfd {
33
34
class
PrivilegeHelper
35
{
36
public
:
37
40
class
Error
41
{
42
public
:
43
explicit
44
Error
(
const
std::string&
what
)
45
: m_whatMessage(what)
46
{
47
}
48
49
const
char
*
50
what
()
const
51
{
52
return
m_whatMessage.c_str();
53
}
54
55
private
:
56
const
std::string m_whatMessage;
57
};
58
59
static
void
60
initialize
(
const
std::string& userName,
const
std::string& groupName);
61
62
static
void
63
drop
();
64
65
static
void
66
runElevated
(
function
<
void
()> f);
67
68
private
:
69
70
static
void
71
raise
();
72
73
private
:
74
75
static
uid_t s_normalUid;
76
static
gid_t s_normalGid;
77
78
static
uid_t s_privilegedUid;
79
static
gid_t s_privilegedGid;
80
};
81
82
}
// namespace nfd
83
84
#endif // NFD_CORE_PRIVILEGE_HELPER_HPP
nfd::PrivilegeHelper::runElevated
static void runElevated(function< void()> f)
Definition:
privilege-helper.cpp:179
nfd::PrivilegeHelper::Error
PrivilegeHelper::Error represents a serious seteuid/gid failure and should only be caught by main in ...
Definition:
privilege-helper.hpp:40
nfd::PrivilegeHelper::drop
static void drop()
Definition:
privilege-helper.cpp:132
nfd::PrivilegeHelper::Error::Error
Error(const std::string &what)
Definition:
privilege-helper.hpp:44
common.hpp
nfd::PrivilegeHelper::initialize
static void initialize(const std::string &userName, const std::string &groupName)
Definition:
privilege-helper.cpp:42
nfd::PrivilegeHelper
Definition:
privilege-helper.hpp:34
nfd::PrivilegeHelper::Error::what
const char * what() const
Definition:
privilege-helper.hpp:50
ndnSIM
NFD
core
privilege-helper.hpp
Generated on Wed Feb 18 2015 16:31:16 for ndnSIM by
1.8.7