#ifndef SANDBOX_LINUX_SYSCALL_BROKER_BROKER_COMMAND_H_
#define SANDBOX_LINUX_SYSCALL_BROKER_BROKER_COMMAND_H_
#include <fcntl.h>
#include <stddef.h>
#include <stdint.h>
#include <bitset>
#include <initializer_list>
#include <utility>
namespace sandbox {
namespace syscall_broker {
class BrokerPermissionList;
constexpr int kCurrentProcessOpenFlagsMask = …;
enum BrokerCommand { … };
BrokerCommandSet;
inline BrokerCommandSet MakeBrokerCommandSet(
const std::initializer_list<BrokerCommand>& args) { … }
[[nodiscard]] const char* CommandAccessIsSafe(
const BrokerCommandSet& command_set,
const BrokerPermissionList& policy,
const char* requested_filename,
int requested_mode
);
[[nodiscard]] const char* CommandMkdirIsSafe(
const BrokerCommandSet& command_set,
const BrokerPermissionList& policy,
const char* requested_filename);
[[nodiscard]] std::pair<const char*, bool> CommandOpenIsSafe(
const BrokerCommandSet& command_set,
const BrokerPermissionList& policy,
const char* requested_filename,
int requested_flags
);
[[nodiscard]] const char* CommandReadlinkIsSafe(
const BrokerCommandSet& command_set,
const BrokerPermissionList& policy,
const char* requested_filename);
[[nodiscard]] std::pair<const char*, const char*> CommandRenameIsSafe(
const BrokerCommandSet& command_set,
const BrokerPermissionList& policy,
const char* old_filename,
const char* new_filename);
[[nodiscard]] const char* CommandRmdirIsSafe(
const BrokerCommandSet& command_set,
const BrokerPermissionList& policy,
const char* requested_filename);
[[nodiscard]] const char* CommandStatIsSafe(const BrokerCommandSet& command_set,
const BrokerPermissionList& policy,
const char* requested_filename);
[[nodiscard]] const char* CommandUnlinkIsSafe(
const BrokerCommandSet& command_set,
const BrokerPermissionList& policy,
const char* requested_filename);
[[nodiscard]] const char* CommandInotifyAddWatchIsSafe(
const BrokerCommandSet& command_set,
const BrokerPermissionList& policy,
const char* requested_filename,
uint32_t mask);
}
}
#endif