7 #ifndef CLIENT_CLASS_DEF_H
8 #define CLIENT_CLASS_DEF_H
19 #include <unordered_map>
70 void setName(
const std::string& name);
86 void setTest(
const std::string& test);
149 return (!(
equals(other)));
158 return (next_server_);
185 filename_ = filename;
239 bool depend_on_known_;
262 std::string filename_;
314 const std::string& test,
bool required,
bool depend_on_known,
319 const std::string& sname = std::string(),
320 const std::string& filename = std::string(),
329 void addClass(ClientClassDefPtr& class_def);
337 ClientClassDefPtr
findClass(
const std::string& name)
const;
350 const ClientClassDefListPtr&
getClasses()
const;
359 bool dependOnClass(
const std::string& name, std::string& dependent_class)
const;
394 ClientClassDefMapPtr map_;
397 ClientClassDefListPtr list_;
430 bool& depend_on_known,
436 #endif // CLIENT_CLASS_DEF_H
void setMatchExpr(const ExpressionPtr &match_expr)
Sets the class's match expression.
~ClientClassDictionary()
Destructor.
const ExpressionPtr & getMatchExpr() const
Fetches the class's match expression.
ClientClassDefPtr findClass(const std::string &name) const
Fetches the class definition for a given class name.
boost::shared_ptr< CfgOption > CfgOptionPtr
Non-const pointer.
void setDependOnKnown(bool depend_on_known)
Sets the depend on known flag aka use host flag.
const std::string & getSname() const
returns server-hostname value
Triplet< uint32_t > getValid() const
Return valid-lifetime value.
bool operator!=(const ClientClassDictionary &other) const
Inequality operator.
Base class for user context.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
void setRequired(bool required)
Sets the only if required flag.
std::string getTest() const
Fetches the class's original match expression.
std::unordered_map< std::string, ClientClassDefPtr > ClientClassDefMap
Defines a map of ClientClassDef's, keyed by the class name.
void setValid(const Triplet< uint32_t > &valid)
Sets new valid lifetime.
void setFilename(const std::string &filename)
sets the boot-file-name value
boost::shared_ptr< Element > ElementPtr
void addClass(const std::string &name, const ExpressionPtr &match_expr, const std::string &test, bool required, bool depend_on_known, const CfgOptionPtr &options, CfgOptionDefPtr defs=CfgOptionDefPtr(), isc::data::ConstElementPtr user_context=isc::data::ConstElementPtr(), asiolink::IOAddress next_server=asiolink::IOAddress("0.0.0.0"), const std::string &sname=std::string(), const std::string &filename=std::string(), const Triplet< uint32_t > &valid=Triplet< uint32_t >())
Adds a new class to the list.
bool equals(const ClientClassDictionary &other) const
Compares two ClientClassDictionary objects for equality.
bool getDependOnKnown() const
Fetches the depend on known flag aka use host flag.
const CfgOptionDefPtr & getCfgOptionDef() const
Fetches the class's option definitions.
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
boost::shared_ptr< ClientClassDefMap > ClientClassDefMapPtr
Defines a pointer to a ClientClassDefMap.
bool equals(const ClientClassDef &other) const
Compares two ClientClassDef objects for equality.
void setTest(const std::string &test)
Sets the class's original match expression.
Maintains a list of ClientClassDef's.
bool getRequired() const
Fetches the only if required flag.
ClientClassDictionary()
Constructor.
bool isClientClassDefined(ClientClassDictionaryPtr &class_dictionary, bool &depend_on_known, const ClientClass &client_class)
Check if a client class name is already defined, i.e.
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 CfgOptionPtr & getCfgOption() const
Fetches the class's option collection.
Abstract class for configuration Cfg_* classes.
boost::shared_ptr< ClientClassDictionary > ClientClassDictionaryPtr
Defines a pointer to a ClientClassDictionary.
Embodies a single client class definition.
boost::shared_ptr< const Element > ConstElementPtr
bool dependOnClass(const std::string &name, std::string &dependent_class) const
Checks direct dependency.
bool operator==(const ClientClassDef &other) const
Equality operator.
std::list< std::string > builtinNames
List of built-in client class names.
std::list< std::string > builtinPrefixes
List of built-in client class prefixes i.e.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
boost::shared_ptr< ClientClassDef > ClientClassDefPtr
a pointer to an ClientClassDef
const std::string & getFilename() const
returns boot-file-name value
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-dhcp-ddns.
bool operator==(const ClientClassDictionary &other) const
Equality operator.
const asiolink::IOAddress & getNextServer() const
returns next-server value
virtual ~ClientClassDef()
Destructor.
boost::shared_ptr< ClientClassDefList > ClientClassDefListPtr
Defines a pointer to a ClientClassDefList.
bool operator!=(const ClientClassDef &other) const
Inequality operator.
void setSname(const std::string &sname)
sets the server-name value
void removeClass(const std::string &name)
Removes a given class definition from the dictionary.
const ClientClassDefListPtr & getClasses() const
Fetches the dictionary's list of classes.
bool dependOnClass(const std::string &name) const
Checks direct dependency.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
void setName(const std::string &name)
Sets the class's name.
void setNextServer(const asiolink::IOAddress &addr)
sets the next-server value
void setCfgOption(const CfgOptionPtr &cfg_option)
Sets the class's option collection.
std::string getName() const
Fetches the class's name.
ClientClassDef(const std::string &name, const ExpressionPtr &match_expr, const CfgOptionPtr &options=CfgOptionPtr())
Constructor.
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)
friend std::ostream & operator<<(std::ostream &os, const ClientClassDef &x)
Provides a convenient text representation of the class.
boost::shared_ptr< Expression > ExpressionPtr
void setCfgOptionDef(const CfgOptionDefPtr &cfg_option_def)
Sets the class's option definition collection.