7 #ifndef CLIENT_CLASS_DEF_H 8 #define CLIENT_CLASS_DEF_H 20 #include <unordered_map> 67 std::string getName()
const;
72 void setName(
const std::string& name);
83 std::string getTest()
const;
88 void setTest(
const std::string& test);
91 bool getRequired()
const;
96 void setRequired(
bool required);
99 bool getDependOnKnown()
const;
104 void setDependOnKnown(
bool depend_on_known);
142 return (equals(other));
151 return (!(equals(other)));
160 return (next_server_);
187 filename_ = filename;
221 preferred_ = preferred;
262 bool depend_on_known_;
285 std::string filename_;
372 void addClass(
const std::string& name,
const ExpressionPtr& match_expr,
373 const std::string& test,
bool required,
bool depend_on_known,
378 const std::string& sname = std::string(),
379 const std::string& filename = std::string(),
382 bool is_template =
false);
390 void addClass(ClientClassDefPtr& class_def);
398 ClientClassDefPtr findClass(
const std::string& name)
const;
406 void removeClass(
const std::string& name);
411 void removeClass(
const uint64_t
id);
416 const ClientClassDefListPtr& getClasses()
const;
430 bool dependOnClass(
const std::string& name, std::string& dependent_class)
const;
443 void initMatchExpr(uint16_t family);
457 return (equals(other));
466 return (!equals(other));
483 ClientClassDefMapPtr map_;
486 ClientClassDefListPtr list_;
518 bool& depend_on_known,
524 #endif // CLIENT_CLASS_DEF_H
This class represents configuration element which is associated with database identifier, modification timestamp and servers.
boost::shared_ptr< CfgOption > CfgOptionPtr
Non-const pointer.
bool operator==(const ClientClassDictionary &other) const
Equality operator.
Base class for user context.
std::unordered_map< std::string, ClientClassDefPtr > ClientClassDefMap
Defines a map of ClientClassDef's, keyed by the class name.
void setFilename(const std::string &filename)
sets the boot-file-name value
boost::shared_ptr< Element > ElementPtr
const asiolink::IOAddress & getNextServer() const
returns next-server value
void setValid(const util::Triplet< uint32_t > &valid)
Sets new valid lifetime.
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
boost::shared_ptr< ClientClassDefMap > ClientClassDefMapPtr
Defines a pointer to a ClientClassDefMap.
Maintains a list of ClientClassDef's.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
bool isClientClassDefined(ClientClassDictionaryPtr &class_dictionary, bool &depend_on_known, const ClientClass &client_class)
Check if a client class name is already defined, i.e.
bool operator==(const ClientClassDef &other) const
Equality operator.
void setPreferred(const util::Triplet< uint32_t > &preferred)
Sets new preferred lifetime.
DuplicateClientClassDef(const char *file, size_t line, const char *what)
Error that occurs when an attempt is made to add a duplicate class to a class dictionary.
const std::string & getFilename() const
returns boot-file-name value
Abstract class for configuration Cfg_* classes.
boost::shared_ptr< ClientClassDictionary > ClientClassDictionaryPtr
Defines a pointer to a ClientClassDictionary.
Embodies a single client class definition.
util::Triplet< uint32_t > getValid() const
Return valid-lifetime value.
boost::shared_ptr< const Element > ConstElementPtr
bool dependOnClass(const TokenPtr &token, const std::string &name)
Checks dependency on a token.
util::Triplet< uint32_t > getPreferred() const
Return preferred-lifetime value.
std::list< std::string > builtinNames
List of classes for which test expressions cannot be defined.
std::list< std::string > builtinPrefixes
The prefixes used to check if a class is BuiltIn class.
boost::shared_ptr< isc::dhcp::Pkt > PktPtr
A pointer to either Pkt4 or Pkt6 packet.
boost::shared_ptr< ClientClassDef > ClientClassDefPtr
a pointer to an ClientClassDef
std::vector< ClientClassDefPtr > ClientClassDefList
Defines a list of ClientClassDefPtr's, using insert order.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-lfc.
static const std::string SPAWN_CLASS_PREFIX
This is a prefix added to the spawned class name.
boost::shared_ptr< ClientClassDefList > ClientClassDefListPtr
Defines a pointer to a ClientClassDefList.
void setSname(const std::string &sname)
sets the server-name value
std::ostream & operator<<(std::ostream &os, const OpaqueDataTuple &tuple)
Inserts the OpaqueDataTuple as a string into stream.
bool operator!=(const ClientClassDictionary &other) const
Inequality operator.
bool operator!=(const ClientClassDef &other) const
Inequality operator.
void setNextServer(const asiolink::IOAddress &addr)
sets the next-server value
bool isClientClassBuiltIn(const ClientClass &client_class)
Check if a client class name is builtin.
std::string ClientClass
Defines a single class name.
The IOAddress class represents an IP addresses (version agnostic)
boost::shared_ptr< Expression > ExpressionPtr
const std::string & getSname() const
returns server-hostname value