2017-07-06 03:30:27 +00:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <fnd/types.h>
|
2018-10-14 05:45:09 +00:00
|
|
|
#include <fnd/IByteModel.h>
|
2017-07-06 03:30:27 +00:00
|
|
|
|
2018-08-07 07:17:51 +00:00
|
|
|
namespace nn
|
|
|
|
{
|
|
|
|
namespace hac
|
2017-07-06 03:30:27 +00:00
|
|
|
{
|
2018-10-18 12:48:16 +00:00
|
|
|
class ServiceAccessControlEntry :
|
2018-10-14 05:45:09 +00:00
|
|
|
public fnd::IByteModel
|
2017-07-06 03:30:27 +00:00
|
|
|
{
|
2017-07-06 11:17:21 +00:00
|
|
|
public:
|
2018-06-29 04:00:15 +00:00
|
|
|
ServiceAccessControlEntry();
|
|
|
|
ServiceAccessControlEntry(const std::string& name, bool isServer);
|
|
|
|
ServiceAccessControlEntry(const ServiceAccessControlEntry& other);
|
2017-07-06 11:17:21 +00:00
|
|
|
|
2018-06-29 04:00:15 +00:00
|
|
|
void operator=(const ServiceAccessControlEntry& other);
|
|
|
|
bool operator==(const ServiceAccessControlEntry& other) const;
|
|
|
|
bool operator!=(const ServiceAccessControlEntry& other) const;
|
2017-07-06 11:17:21 +00:00
|
|
|
|
2018-10-18 12:48:16 +00:00
|
|
|
// IByteModel
|
2018-06-24 08:18:54 +00:00
|
|
|
void toBytes();
|
|
|
|
void fromBytes(const byte_t* bytes, size_t len);
|
|
|
|
const fnd::Vec<byte_t>& getBytes() const;
|
2017-07-06 11:17:21 +00:00
|
|
|
|
|
|
|
// variables
|
2017-07-15 08:28:01 +00:00
|
|
|
void clear();
|
2017-07-06 11:17:21 +00:00
|
|
|
bool isServer() const;
|
|
|
|
void setIsServer(bool isServer);
|
|
|
|
const std::string& getName() const;
|
|
|
|
void setName(const std::string& name);
|
|
|
|
private:
|
2018-06-29 04:00:15 +00:00
|
|
|
const std::string kModuleName = "SERVICE_ACCESS_CONTROL_ENTRY";
|
2017-07-06 11:17:21 +00:00
|
|
|
static const size_t kMaxServiceNameLen = 8;
|
|
|
|
|
2018-06-29 04:00:15 +00:00
|
|
|
enum ServiceAccessControlEntryFlag
|
2017-07-06 11:17:21 +00:00
|
|
|
{
|
2018-06-24 08:18:54 +00:00
|
|
|
SAC_IS_SERVER = _BIT(7),
|
|
|
|
SAC_NAME_LEN_MASK = _BIT(7) - 1
|
2017-07-06 11:17:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// raw binary
|
2018-06-24 08:18:54 +00:00
|
|
|
fnd::Vec<byte_t> mRawBinary;
|
2017-07-06 11:17:21 +00:00
|
|
|
|
|
|
|
// variables
|
|
|
|
bool mIsServer;
|
|
|
|
std::string mName;
|
2017-07-06 03:30:27 +00:00
|
|
|
};
|
2018-08-07 07:17:51 +00:00
|
|
|
}
|
2017-07-06 11:17:21 +00:00
|
|
|
}
|