7#ifndef RADIUS_CLIENT_DICTIONARY_H
8#define RADIUS_CLIENT_DICTIONARY_H
12#include <boost/multi_index_container.hpp>
13#include <boost/multi_index/hashed_index.hpp>
14#include <boost/multi_index/member.hpp>
15#include <boost/multi_index/composite_key.hpp>
16#include <boost/noncopyable.hpp>
17#include <boost/shared_ptr.hpp>
20#include <unordered_map>
60 AttrDef(
const uint8_t type,
const std::string& name,
90 IntCstDef(
const uint8_t type,
const std::string& name,
113 typedef boost::multi_index_container<
117 boost::multi_index::indexed_by<
119 boost::multi_index::hashed_unique<
120 boost::multi_index::member<
125 boost::multi_index::hashed_unique<
126 boost::multi_index::member<
137 typedef boost::multi_index_container<
141 boost::multi_index::indexed_by<
143 boost::multi_index::hashed_unique<
144 boost::multi_index::composite_key<
146 boost::multi_index::member<
149 boost::multi_index::member<
155 boost::multi_index::hashed_unique<
156 boost::multi_index::composite_key<
158 boost::multi_index::member<
161 boost::multi_index::member<
203 std::string
getName(
const uint8_t type)
const;
RADIUS attribute definition.
const std::string name_
name.
AttrDef(const uint8_t type, const std::string &name, const AttrValueType value_type)
Constructor.
const AttrValueType value_type_
value_type.
void add(AttrDefPtr def)
Add (or replace) an attribute definition.
static AttrDefs & instance()
Returns a single instance.
std::unordered_map< std::string, std::string > AttrDefAliases
Type of the alias table (alias -> standard name map).
void readDictionary(const std::string &path)
Read a dictionary from a file.
AttrDefContainer container_
Attribute definition container.
AttrDefPtr getByName(const std::string &name) const
Get attribute definition by name.
IntCstDefContainer ic_container_
Integer constant definition container.
AttrDefAliases aliases_
Attribute aliases.
boost::multi_index_container< AttrDefPtr, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::member< AttrDef, const uint8_t, &AttrDef::type_ > >, boost::multi_index::hashed_unique< boost::multi_index::member< AttrDef, const std::string, &AttrDef::name_ > > > > AttrDefContainer
Type of the attribute definition container.
std::string getName(const uint8_t type) const
Get attribute name.
AttrDefPtr getByType(const uint8_t type) const
Get attribute definition by type.
IntCstDefPtr getByValue(const uint8_t type, const uint32_t value) const
Get integer constant definition by attribute type and value.
boost::multi_index_container< IntCstDefPtr, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::composite_key< IntCstDef, boost::multi_index::member< IntCstDef, const uint8_t, &IntCstDef::type_ >, boost::multi_index::member< IntCstDef, const std::string, &IntCstDef::name_ > > >, boost::multi_index::hashed_unique< boost::multi_index::composite_key< IntCstDef, boost::multi_index::member< IntCstDef, const uint8_t, &IntCstDef::type_ >, boost::multi_index::member< IntCstDef, const uint32_t, &IntCstDef::value_ > > > > > IntCstDefContainer
Type of the integer constant definition container.
virtual ~AttrDefs()
Destructor.
void clear()
Clear definitions.
void parseLine(const std::string &line)
Parse a dictionary line.
void checkStandardDefs(const AttrDefList &defs) const
Check if a list of standard attribute definitions are available and correct.
RADIUS integer constant definitions.
const std::string name_
name.
const uint8_t type_
attribute type.
const uint32_t value_
value.
IntCstDef(const uint8_t type, const std::string &name, const uint32_t value)
Constructor.
boost::shared_ptr< IntCstDef > IntCstDefPtr
Shared pointers to Integer constant definition.
std::list< AttrDef > AttrDefList
List of Attribute definitions.
AttrValueType
Attribute value types.
boost::shared_ptr< AttrDef > AttrDefPtr
Shared pointers to Attribute definition.
AttrValueType textToAttrValueType(const string &name)
AttrValueType name -> value function.
string attrValueTypeToText(const AttrValueType value)
AttrValueType value -> name function.
Defines the logger used by the top-level component of kea-lfc.