![]() |
Kea 3.1.3
|
RADIUS attribute definitions. More...
#include <client_dictionary.h>
Public Types | |
typedef 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). | |
typedef 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. | |
typedef 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. | |
Public Member Functions | |
void | add (AttrDefPtr def) |
Add (or replace) an attribute definition. | |
void | add (IntCstDefPtr def) |
Add (or replace) an integer constant definition. | |
void | checkStandardDefs (const AttrDefList &defs) const |
Check if a list of standard attribute definitions are available and correct. | |
void | clear () |
Clear definitions. | |
AttrDefPtr | getByName (const std::string &name, const uint32_t vendor=0) const |
Get attribute definition by name and vendor. | |
IntCstDefPtr | getByName (const uint8_t type, const std::string &name, const uint32_t vendor=0) const |
Get integer constant definition by attribute type and name. | |
AttrDefPtr | getByType (const uint8_t type, const uint32_t vendor=0) const |
Get attribute definition by type and vendor. | |
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. | |
std::string | getName (const uint8_t type, const uint32_t vendor=0) const |
Get attribute name. | |
void | readDictionary (const std::string &path, uint32_t &vendor, unsigned int depth=0) |
Read a dictionary from a file. | |
void | readDictionary (std::istream &is, uint32_t &vendor, unsigned int depth=0) |
Read a dictionary from an input stream. | |
Static Public Member Functions | |
static AttrDefs & | instance () |
Returns a single instance. | |
Protected Member Functions | |
AttrDefs () | |
Contructor. | |
virtual | ~AttrDefs () |
Destructor. | |
void | parseLine (const std::string &line, uint32_t &vendor, unsigned int depth) |
Parse a dictionary line. | |
Protected Attributes | |
AttrDefAliases | aliases_ |
Attribute aliases. | |
AttrDefContainer | container_ |
Attribute definition container. | |
IntCstDefContainer | ic_container_ |
Integer constant definition container. | |
RADIUS attribute definitions.
Definition at line 144 of file client_dictionary.h.
typedef 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_ > > > > > isc::radius::AttrDefs::AttrDefAliases |
Type of the alias table (alias -> standard name map).
Definition at line 199 of file client_dictionary.h.
typedef 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_ > > > > > isc::radius::AttrDefs::AttrDefContainer |
Type of the attribute definition container.
Definition at line 178 of file client_dictionary.h.
typedef 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_ > > > > > isc::radius::AttrDefs::IntCstDefContainer |
Type of the integer constant definition container.
Definition at line 238 of file client_dictionary.h.
|
inlineprotected |
Contructor.
Definition at line 334 of file client_dictionary.h.
References aliases_, container_, and ic_container_.
Referenced by instance().
|
inlineprotectedvirtual |
Destructor.
Definition at line 338 of file client_dictionary.h.
References clear().
void isc::radius::AttrDefs::add | ( | AttrDefPtr | def | ) |
Add (or replace) an attribute definition.
def | attribute definition to add or replace. |
Definition at line 98 of file client_dictionary.cc.
References aliases_, isc::radius::attrValueTypeToText(), container_, and isc_throw.
Referenced by parseLine().
void isc::radius::AttrDefs::add | ( | IntCstDefPtr | def | ) |
Add (or replace) an integer constant definition.
Definition at line 179 of file client_dictionary.cc.
References getName(), ic_container_, isc_throw, and isc::radius::PW_VENDOR_SPECIFIC.
void isc::radius::AttrDefs::checkStandardDefs | ( | const AttrDefList & | defs | ) | const |
Check if a list of standard attribute definitions are available and correct.
defs | list of standard attribute definitions. |
Definition at line 442 of file client_dictionary.cc.
References isc::radius::attrValueTypeToText(), getByName(), and isc_throw.
Referenced by isc::radius::RadiusConfigParser::parse().
|
inline |
Clear definitions.
Definition at line 268 of file client_dictionary.h.
References aliases_, container_, and ic_container_.
Referenced by ~AttrDefs().
AttrDefPtr isc::radius::AttrDefs::getByName | ( | const std::string & | name, |
const uint32_t | vendor = 0 ) const |
Get attribute definition by name and vendor.
name | name to look for. |
vendor | vendor id to look for (default 0). |
Definition at line 81 of file client_dictionary.cc.
References aliases_, and container_.
Referenced by checkStandardDefs(), isc::radius::RadiusAttributeParser::parse(), and parseLine().
IntCstDefPtr isc::radius::AttrDefs::getByName | ( | const uint8_t | type, |
const std::string & | name, | ||
const uint32_t | vendor = 0 ) const |
Get integer constant definition by attribute type and name.
type | attribute type. |
name | name to look for. |
vendor | vendor id to look for (default 0). |
Definition at line 157 of file client_dictionary.cc.
References ic_container_.
AttrDefPtr isc::radius::AttrDefs::getByType | ( | const uint8_t | type, |
const uint32_t | vendor = 0 ) const |
Get attribute definition by type and vendor.
type | type to look for. |
vendor | vendor id to look for (default 0). |
Definition at line 71 of file client_dictionary.cc.
References container_.
Referenced by isc::radius::Attribute::fromBytes(), isc::radius::Attributes::fromElement(), getName(), isc::radius::RadiusAttributeParser::parse(), isc::radius::AttrInt::toElement(), isc::radius::AttrIpAddr::toElement(), isc::radius::AttrIpv6Addr::toElement(), isc::radius::AttrIpv6Prefix::toElement(), isc::radius::AttrString::toElement(), and isc::radius::AttrVsa::toElement().
IntCstDefPtr isc::radius::AttrDefs::getByValue | ( | const uint8_t | type, |
const uint32_t | value, | ||
const uint32_t | vendor = 0 ) const |
Get integer constant definition by attribute type and value.
type | attribute type. |
value | value to look for. |
vendor | vendor id to look for (default 0). |
Definition at line 168 of file client_dictionary.cc.
References ic_container_.
Referenced by isc::radius::AttrInt::toText().
string isc::radius::AttrDefs::getName | ( | const uint8_t | type, |
const uint32_t | vendor = 0 ) const |
Get attribute name.
type | type to look for. |
vendor | vendor id to look for (default 0). |
Definition at line 146 of file client_dictionary.cc.
References getByType().
Referenced by add(), isc::radius::AttrInt::toText(), isc::radius::AttrIpAddr::toText(), isc::radius::AttrIpv6Addr::toText(), isc::radius::AttrIpv6Prefix::toText(), isc::radius::AttrString::toText(), and isc::radius::AttrVsa::toText().
|
static |
Returns a single instance.
AttrDefs is a singleton and this method is the only way of accessing it.
Definition at line 65 of file client_dictionary.cc.
References AttrDefs().
Referenced by isc::radius::Message::decode(), isc::radius::Attribute::fromBytes(), isc::radius::AttrInt::fromBytes(), isc::radius::AttrIpAddr::fromBytes(), isc::radius::AttrIpv6Addr::fromBytes(), isc::radius::AttrIpv6Prefix::fromBytes(), isc::radius::Attributes::fromElement(), isc::radius::AttrInt::fromText(), isc::radius::AttrIpAddr::fromText(), isc::radius::AttrIpv6Addr::fromText(), isc::radius::AttrIpv6Prefix::fromText(), isc::radius::RadiusAttributeParser::parse(), isc::radius::RadiusConfigParser::parse(), isc::radius::AttrInt::toElement(), isc::radius::AttrIpAddr::toElement(), isc::radius::AttrIpv6Addr::toElement(), isc::radius::AttrIpv6Prefix::toElement(), isc::radius::AttrString::toElement(), isc::radius::AttrVsa::toElement(), isc::radius::AttrInt::toText(), isc::radius::AttrIpAddr::toText(), isc::radius::AttrIpv6Addr::toText(), isc::radius::AttrIpv6Prefix::toText(), isc::radius::AttrString::toText(), and isc::radius::AttrVsa::toText().
|
protected |
Parse a dictionary line.
line | line to parse. |
vendor | reference to the current vendor id. |
depth | recursion depth. |
Definition at line 210 of file client_dictionary.cc.
References add(), getByName(), isc_throw, isc::radius::PW_TYPE_INTEGER, isc::radius::PW_TYPE_VSA, isc::radius::PW_VENDOR_SPECIFIC, readDictionary(), isc::radius::textToAttrValueType(), and isc::util::str::tokens().
Referenced by readDictionary().
void isc::radius::AttrDefs::readDictionary | ( | const std::string & | path, |
uint32_t & | vendor, | ||
unsigned int | depth = 0 ) |
Read a dictionary from a file.
Fills attribute and integer constant definition tables from a dictionary file. Recursion depth is initialized to 0, incremented by includes and limited to 5.
path | dictionary file path. |
vendor | reference to the current vendor id. |
depth | recursion depth. |
Referenced by isc::radius::RadiusConfigParser::parse(), and parseLine().
void isc::radius::AttrDefs::readDictionary | ( | std::istream & | is, |
uint32_t & | vendor, | ||
unsigned int | depth = 0 ) |
Read a dictionary from an input stream.
Fills attribute and integer constant definition tables from a dictionary input stream. Recursion depth is initialized to 0, incremented by includes and limited to 5.
is | input stream. |
vendor | reference to the current vendor id. |
depth | recursion depth. |
Definition at line 424 of file client_dictionary.cc.
References isc_throw, and parseLine().
|
protected |
Attribute aliases.
Definition at line 354 of file client_dictionary.h.
Referenced by AttrDefs(), add(), clear(), and getByName().
|
protected |
Attribute definition container.
Definition at line 351 of file client_dictionary.h.
Referenced by AttrDefs(), add(), clear(), getByName(), and getByType().
|
protected |
Integer constant definition container.
Definition at line 357 of file client_dictionary.h.
Referenced by AttrDefs(), add(), clear(), getByName(), and getByValue().