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>
62 AttrDef(
const uint8_t type,
const std::string& name,
96 const uint32_t vendor = 0)
123 const uint32_t value,
const uint32_t vendor = 0)
148 typedef boost::multi_index_container<
152 boost::multi_index::indexed_by<
154 boost::multi_index::hashed_unique<
155 boost::multi_index::composite_key<
157 boost::multi_index::member<
160 boost::multi_index::member<
166 boost::multi_index::hashed_unique<
167 boost::multi_index::composite_key<
169 boost::multi_index::member<
172 boost::multi_index::member<
181 typedef boost::multi_index_container<
185 boost::multi_index::indexed_by<
187 boost::multi_index::hashed_unique<
188 boost::multi_index::composite_key<
190 boost::multi_index::member<
193 boost::multi_index::member<
202 typedef boost::multi_index_container<
206 boost::multi_index::indexed_by<
208 boost::multi_index::hashed_unique<
209 boost::multi_index::composite_key<
211 boost::multi_index::member<
214 boost::multi_index::member<
217 boost::multi_index::member<
223 boost::multi_index::hashed_unique<
224 boost::multi_index::composite_key<
226 boost::multi_index::member<
229 boost::multi_index::member<
232 boost::multi_index::member<
260 const uint32_t vendor = 0)
const;
278 std::string
getName(
const uint8_t type,
const uint32_t vendor = 0)
const;
287 const uint32_t vendor = 0)
const;
296 const uint32_t vendor = 0)
const;
312 unsigned int depth = 0);
324 unsigned int depth = 0);
347 void parseLine(
const std::string& line, uint32_t& vendor,
RADIUS attribute aliases.
const uint32_t vendor_
vendor id (default 0).
const std::string alias_
alias.
const std::string name_
name.
AttrDefAlias(const std::string &alias, const std::string &name, const uint32_t vendor=0)
Constructor.
RADIUS attribute definition.
const std::string name_
name.
AttrDef(const uint8_t type, const std::string &name, const AttrValueType value_type, const uint32_t vendor=0)
Constructor.
const AttrValueType value_type_
value_type.
const uint32_t vendor_
vendor id (default 0).
void add(AttrDefPtr def)
Add (or replace) an attribute definition.
static AttrDefs & instance()
Returns a single instance.
AttrDefContainer container_
Attribute definition container.
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::composite_key< AttrDef, boost::multi_index::member< AttrDef, const uint32_t, &AttrDef::vendor_ >, boost::multi_index::member< AttrDef, const uint8_t, &AttrDef::type_ > > >, boost::multi_index::hashed_unique< boost::multi_index::composite_key< AttrDef, boost::multi_index::member< AttrDef, const uint32_t, &AttrDef::vendor_ >, boost::multi_index::member< AttrDef, const std::string, &AttrDef::name_ > > > > > AttrDefContainer
Type of the attribute definition container.
void readDictionary(const std::string &path, uint32_t &vendor, unsigned int depth=0)
Read a dictionary from a file.
IntCstDefPtr getByValue(const uint8_t type, const uint32_t value, const uint32_t vendor=0) 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 uint32_t, &IntCstDef::vendor_ >, 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 uint32_t, &IntCstDef::vendor_ >, 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 parseLine(const std::string &line, uint32_t &vendor, unsigned int depth)
Parse a dictionary line.
boost::multi_index_container< AttrDefAlias, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::composite_key< AttrDefAlias, boost::multi_index::member< AttrDefAlias, const uint32_t, &AttrDefAlias::vendor_ >, boost::multi_index::member< AttrDefAlias, const std::string, &AttrDefAlias::alias_ > > > > > AttrDefAliases
Type of the alias table (alias -> standard name map).
void clear()
Clear definitions.
std::string getName(const uint8_t type, const uint32_t vendor=0) const
Get attribute name.
AttrDefPtr getByName(const std::string &name, const uint32_t vendor=0) const
Get attribute definition by name and vendor.
void checkStandardDefs(const AttrDefList &defs) const
Check if a list of standard attribute definitions are available and correct.
AttrDefPtr getByType(const uint8_t type, const uint32_t vendor=0) const
Get attribute definition by type and vendor.
RADIUS integer constant definitions.
const std::string name_
name.
const uint8_t type_
attribute type.
IntCstDef(const uint8_t type, const std::string &name, const uint32_t value, const uint32_t vendor=0)
Constructor.
const uint32_t value_
value.
const uint32_t vendor_
vendor id (default 0).
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.