10#include <boost/shared_ptr.hpp>
72 const std::vector<uint8_t>&
getId()
const;
91 std::string
toText(
char delim_char=0x0)
const;
121 std::vector<uint8_t> id_;
208 void setProperty(
const std::string& name,
const std::string& value);
216 std::string
getProperty(
const std::string& name)
const;
Encapsulates a unique identifier for a DHCP client.
const std::vector< uint8_t > & getId() const
Returns a const reference to the actual id value.
bool operator!=(const UserId &other) const
Compares two UserIds for inequality.
UserId(UserIdType id_type, const std::vector< uint8_t > &id)
Constructor.
static UserIdType lookupType(const std::string &type_str)
Returns the id type for a given text label.
std::string toText(char delim_char=0x0) const
Returns textual representation of the id.
static const char * DUID_STR
Define the text label DUID id type.
static std::string lookupTypeStr(UserIdType type)
Returns the text label for a given id type.
bool operator==(const UserId &other) const
Compares two UserIds for equality.
UserIdType getType() const
Returns the user id type.
bool operator<(const UserId &other) const
Performs less than comparison of two UserIds.
static const char * HW_ADDRESS_STR
Defines the text label hardware address id type.
UserIdType
Defines the supported types of user ids.
@ HW_ADDRESS
Hardware addresses (MAC) are used for IPv4 clients.
@ DUID
DUIDs are used for IPv6 clients.
Represents a unique DHCP user This class is used to represent a specific DHCP user who is identified ...
std::string getProperty(const std::string &name) const
Fetches the string value for a given property name.
User(const UserId &user_id)
Constructor.
void setProperties(const PropertyMap &properties)
Sets the user's properties from a given property map.
const UserId & getUserId() const
Returns the user's id.
void setProperty(const std::string &name, const std::string &value)
Sets a given property to the given value.
const PropertyMap & getProperties() const
Returns a reference to the map of properties.
void delProperty(const std::string &name)
Removes the given property from the property map.
Defines the logger used by the user check hooks library.
boost::shared_ptr< UserId > UserIdPtr
Defines a smart pointer to UserId.
std::map< std::string, std::string > PropertyMap
Defines a map of string values keyed by string labels.
boost::shared_ptr< User > UserPtr
Defines a smart pointer to a User.
std::ostream & operator<<(std::ostream &os, const UserId &user_id)
Outputs the UserId contents in a string to the given stream.