7#ifndef RADIUS_CLIENT_DICTIONARY_H
8#define RADIUS_CLIENT_DICTIONARY_H
18#include <boost/multi_index/composite_key.hpp>
19#include <boost/multi_index/hashed_index.hpp>
20#include <boost/multi_index/member.hpp>
21#include <boost/multi_index_container.hpp>
22#include <boost/noncopyable.hpp>
23#include <boost/shared_ptr.hpp>
64 AttrDef(
const uint8_t type,
const std::string& name,
98 const uint32_t vendor = 0)
125 const uint32_t value,
const uint32_t vendor = 0)
150 typedef boost::multi_index_container<
154 boost::multi_index::indexed_by<
156 boost::multi_index::hashed_unique<
157 boost::multi_index::composite_key<
159 boost::multi_index::member<
162 boost::multi_index::member<
168 boost::multi_index::hashed_unique<
169 boost::multi_index::composite_key<
171 boost::multi_index::member<
174 boost::multi_index::member<
183 typedef boost::multi_index_container<
187 boost::multi_index::indexed_by<
189 boost::multi_index::hashed_unique<
190 boost::multi_index::composite_key<
192 boost::multi_index::member<
195 boost::multi_index::member<
204 typedef boost::multi_index_container<
208 boost::multi_index::indexed_by<
210 boost::multi_index::hashed_unique<
211 boost::multi_index::composite_key<
213 boost::multi_index::member<
216 boost::multi_index::member<
219 boost::multi_index::member<
225 boost::multi_index::hashed_unique<
226 boost::multi_index::composite_key<
228 boost::multi_index::member<
231 boost::multi_index::member<
234 boost::multi_index::member<
262 const uint32_t vendor = 0)
const;
280 std::string
getName(
const uint8_t type,
const uint32_t vendor = 0)
const;
289 const uint32_t vendor = 0)
const;
298 const uint32_t vendor = 0)
const;
314 unsigned int depth = 0);
326 unsigned int depth = 0);
349 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.
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.
AttrValueType
Attribute value types.
Defines the logger used by the top-level component of kea-lfc.