Kea 3.1.1
isc::radius::AttrDefs Class Reference

RADIUS attribute definitions. More...

#include <client_dictionary.h>

+ Inheritance diagram for isc::radius::AttrDefs:

Public Types

typedef std::unordered_map< std::string, std::string > 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::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.
 
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 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.
 

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
 Get attribute definition by name.
 
IntCstDefPtr getByName (const uint8_t type, const std::string &name) const
 Get integer constant definition by attribute type and 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.
 
std::string getName (const uint8_t type) const
 Get attribute name.
 
void readDictionary (const std::string &path)
 Read a dictionary from a file.
 
void readDictionary (std::istream &is)
 Read a dictionary from an input stream.
 

Static Public Member Functions

static AttrDefsinstance ()
 Returns a single instance.
 

Protected Member Functions

 AttrDefs ()
 Contructor.
 
virtual ~AttrDefs ()
 Destructor.
 
void parseLine (const std::string &line)
 Parse a dictionary line.
 

Protected Attributes

AttrDefAliases aliases_
 Attribute aliases.
 
AttrDefContainer container_
 Attribute definition container.
 
IntCstDefContainer ic_container_
 Integer constant definition container.
 

Detailed Description

RADIUS attribute definitions.

Definition at line 109 of file client_dictionary.h.

Member Typedef Documentation

◆ AttrDefAliases

typedef std::unordered_map<std::string, std::string> isc::radius::AttrDefs::AttrDefAliases

Type of the alias table (alias -> standard name map).

Definition at line 134 of file client_dictionary.h.

◆ AttrDefContainer

typedef 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_ > > > > isc::radius::AttrDefs::AttrDefContainer

Type of the attribute definition container.

Definition at line 131 of file client_dictionary.h.

◆ IntCstDefContainer

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 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_ > > > > > isc::radius::AttrDefs::IntCstDefContainer

Type of the integer constant definition container.

Definition at line 167 of file client_dictionary.h.

Constructor & Destructor Documentation

◆ AttrDefs()

isc::radius::AttrDefs::AttrDefs ( )
inlineprotected

Contructor.

Definition at line 247 of file client_dictionary.h.

References aliases_, container_, and ic_container_.

Referenced by instance().

◆ ~AttrDefs()

virtual isc::radius::AttrDefs::~AttrDefs ( )
inlineprotectedvirtual

Destructor.

Definition at line 251 of file client_dictionary.h.

References clear().

+ Here is the call graph for this function:

Member Function Documentation

◆ add() [1/2]

void isc::radius::AttrDefs::add ( AttrDefPtr def)

Add (or replace) an attribute definition.

Parameters
defattribute definition to add or replace.

Definition at line 94 of file client_dictionary.cc.

References aliases_, isc::radius::attrValueTypeToText(), container_, and isc_throw.

Referenced by parseLine().

+ Here is the call graph for this function:

◆ add() [2/2]

void isc::radius::AttrDefs::add ( IntCstDefPtr def)

Add (or replace) an integer constant definition.

Definition at line 164 of file client_dictionary.cc.

References getName(), ic_container_, and isc_throw.

+ Here is the call graph for this function:

◆ checkStandardDefs()

void isc::radius::AttrDefs::checkStandardDefs ( const AttrDefList & defs) const

Check if a list of standard attribute definitions are available and correct.

Parameters
defslist of standard attribute definitions.

Definition at line 295 of file client_dictionary.cc.

References isc::radius::attrValueTypeToText(), getByName(), and isc_throw.

Referenced by isc::radius::RadiusConfigParser::parse().

+ Here is the call graph for this function:

◆ clear()

void isc::radius::AttrDefs::clear ( )
inline

Clear definitions.

Definition at line 194 of file client_dictionary.h.

References aliases_, container_, and ic_container_.

Referenced by ~AttrDefs().

◆ getByName() [1/2]

AttrDefPtr isc::radius::AttrDefs::getByName ( const std::string & name) const

Get attribute definition by name.

Parameters
namename to look for.
Returns
pointer to the attribute definition or null.

Definition at line 77 of file client_dictionary.cc.

References aliases_, and container_.

Referenced by checkStandardDefs(), isc::radius::Attribute::fromText(), isc::radius::Attribute::fromText(), isc::radius::RadiusAttributeParser::parse(), and parseLine().

◆ getByName() [2/2]

IntCstDefPtr isc::radius::AttrDefs::getByName ( const uint8_t type,
const std::string & name ) const

Get integer constant definition by attribute type and name.

Parameters
typeattribute type.
namename to look for.
Returns
pointer to the integer constant definition or null.

Definition at line 144 of file client_dictionary.cc.

References ic_container_.

◆ getByType()

AttrDefPtr isc::radius::AttrDefs::getByType ( const uint8_t type) const

◆ getByValue()

IntCstDefPtr isc::radius::AttrDefs::getByValue ( const uint8_t type,
const uint32_t value ) const

Get integer constant definition by attribute type and value.

Parameters
typeattribute type.
valuevalue to look for.
Returns
pointer to the integer constant definition or null.

Definition at line 154 of file client_dictionary.cc.

References ic_container_.

Referenced by isc::radius::AttrInt::toText().

◆ getName()

string isc::radius::AttrDefs::getName ( const uint8_t type) const

Get attribute name.

Parameters
typetype to look for.

Definition at line 133 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(), and isc::radius::AttrString::toText().

+ Here is the call graph for this function:

◆ instance()

◆ parseLine()

void isc::radius::AttrDefs::parseLine ( const std::string & line)
protected

Parse a dictionary line.

Parameters
lineline to parse.
Todo
: consider end of line comments?

Definition at line 183 of file client_dictionary.cc.

References add(), getByName(), isc_throw, isc::radius::PW_TYPE_INTEGER, isc::radius::textToAttrValueType(), and isc::util::str::tokens().

Referenced by readDictionary().

+ Here is the call graph for this function:

◆ readDictionary() [1/2]

void isc::radius::AttrDefs::readDictionary ( const std::string & path)

Read a dictionary from a file.

Fills attribute and integer constant definition tables from a dictionary file.

Parameters
pathdictionary file path.

Definition at line 258 of file client_dictionary.cc.

References isc_throw, and readDictionary().

Referenced by isc::radius::RadiusConfigParser::parse(), and readDictionary().

+ Here is the call graph for this function:

◆ readDictionary() [2/2]

void isc::radius::AttrDefs::readDictionary ( std::istream & is)

Read a dictionary from an input stream.

Fills attribute and integer constant definition tables from a dictionary input stream.

Parameters
isinput stream.

Definition at line 277 of file client_dictionary.cc.

References isc_throw, and parseLine().

+ Here is the call graph for this function:

Member Data Documentation

◆ aliases_

AttrDefAliases isc::radius::AttrDefs::aliases_
protected

Attribute aliases.

Definition at line 264 of file client_dictionary.h.

Referenced by AttrDefs(), add(), clear(), and getByName().

◆ container_

AttrDefContainer isc::radius::AttrDefs::container_
protected

Attribute definition container.

Definition at line 261 of file client_dictionary.h.

Referenced by AttrDefs(), add(), clear(), getByName(), and getByType().

◆ ic_container_

IntCstDefContainer isc::radius::AttrDefs::ic_container_
protected

Integer constant definition container.

Definition at line 267 of file client_dictionary.h.

Referenced by AttrDefs(), add(), clear(), getByName(), and getByValue().


The documentation for this class was generated from the following files: