Kea 3.1.3
isc::radius::AttrDefs Class Reference

RADIUS attribute definitions. More...

#include <client_dictionary.h>

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

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 AttrDefsinstance ()
 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.
 

Detailed Description

RADIUS attribute definitions.

Definition at line 144 of file client_dictionary.h.

Member Typedef Documentation

◆ AttrDefAliases

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.

◆ AttrDefContainer

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.

◆ 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 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.

Constructor & Destructor Documentation

◆ AttrDefs()

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

Contructor.

Definition at line 334 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 338 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 98 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 179 of file client_dictionary.cc.

References getName(), ic_container_, isc_throw, and isc::radius::PW_VENDOR_SPECIFIC.

+ 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 442 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 268 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 uint32_t vendor = 0 ) const

Get attribute definition by name and vendor.

Parameters
namename to look for.
vendorvendor id to look for (default 0).
Returns
pointer to the attribute definition or null.

Definition at line 81 of file client_dictionary.cc.

References aliases_, and container_.

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

◆ getByName() [2/2]

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.

Parameters
typeattribute type.
namename to look for.
vendorvendor id to look for (default 0).
Returns
pointer to the integer constant definition or null.

Definition at line 157 of file client_dictionary.cc.

References ic_container_.

◆ getByType()

AttrDefPtr isc::radius::AttrDefs::getByType ( const uint8_t type,
const uint32_t vendor = 0 ) const

Get attribute definition by type and vendor.

Parameters
typetype to look for.
vendorvendor id to look for (default 0).
Returns
pointer to the attribute definition or null.

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().

◆ getByValue()

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.

Parameters
typeattribute type.
valuevalue to look for.
vendorvendor id to look for (default 0).
Returns
pointer to the integer constant definition or null.

Definition at line 168 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 uint32_t vendor = 0 ) const

Get attribute name.

Parameters
typetype to look for.
vendorvendor 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().

+ Here is the call graph for this function:

◆ instance()

◆ parseLine()

void isc::radius::AttrDefs::parseLine ( const std::string & line,
uint32_t & vendor,
unsigned int depth )
protected

Parse a dictionary line.

Parameters
lineline to parse.
vendorreference to the current vendor id.
depthrecursion depth.
Todo
: consider end of line comments?

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().

+ Here is the call graph for this function:

◆ readDictionary() [1/2]

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.

Parameters
pathdictionary file path.
vendorreference to the current vendor id.
depthrecursion depth.

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

◆ readDictionary() [2/2]

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.

Parameters
isinput stream.
vendorreference to the current vendor id.
depthrecursion depth.

Definition at line 424 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 354 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 351 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 357 of file client_dictionary.h.

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


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