Kea 3.1.1
isc::radius::AttrString Class Reference

RADIUS attribute derived classes: do not use them directly outside unit tests, instead use Attribute class/static factory methods. More...

#include <client_attribute.h>

+ Inheritance diagram for isc::radius::AttrString:

Public Member Functions

virtual size_t getValueLen () const override
 Value length.
 
virtual AttrValueType getValueType () const override
 Get value type.
 
virtual std::vector< uint8_t > toBinary () const override
 To binary.
 
virtual std::vector< uint8_t > toBytes () const override
 To bytes.
 
virtual data::ElementPtr toElement () const override
 Unparse attribute.
 
virtual std::string toString () const override
 To string.
 
virtual std::string toText (size_t indent=0) const override
 Returns text representation of the attribute.
 
- Public Member Functions inherited from isc::radius::Attribute
virtual ~Attribute ()=default
 Virtual destructor.
 
uint8_t getType () const
 Get type.
 
virtual uint32_t toInt () const
 To integer.
 
virtual asiolink::IOAddress toIpAddr () const
 To IPv4 address.
 
virtual asiolink::IOAddress toIpv6Addr () const
 To IPv6 address.
 
virtual asiolink::IOAddress toIpv6Prefix () const
 To IPv6 prefix.
 
virtual uint8_t toIpv6PrefixLen () const
 To IPv6 prefix length.
 
- Public Member Functions inherited from isc::data::CfgToElement
virtual ~CfgToElement ()
 Destructor.
 

Protected Member Functions

 AttrString (const uint8_t type, const std::string &value)
 Constructor.
 
 AttrString (const uint8_t type, const std::vector< uint8_t > &value)
 Constructor.
 
- Protected Member Functions inherited from isc::radius::Attribute
 Attribute (const uint8_t type)
 Constructor.
 

Static Protected Member Functions

static AttributePtr fromBytes (const uint8_t type, const std::vector< uint8_t > &bytes)
 From bytes.
 
static AttributePtr fromText (const uint8_t type, const std::string &repr)
 From text.
 

Friends

class Attribute
 Make Attribute a friend class.
 

Additional Inherited Members

- Static Public Member Functions inherited from isc::radius::Attribute
static AttributePtr fromBinary (const uint8_t type, const std::vector< uint8_t > &value)
 From binary with type.
 
static AttributePtr fromBytes (const AttrDefPtr &def, const std::vector< uint8_t > &value)
 From bytes with definition.
 
static AttributePtr fromBytes (const std::vector< uint8_t > &bytes)
 From bytes (wire format).
 
static AttributePtr fromInt (const uint8_t type, const uint32_t value)
 From integer with type.
 
static AttributePtr fromIpAddr (const uint8_t type, const asiolink::IOAddress &value)
 From IPv4 address with type.
 
static AttributePtr fromIpv6Addr (const uint8_t type, const asiolink::IOAddress &value)
 From IPv6 address with type.
 
static AttributePtr fromIpv6Prefix (const uint8_t type, const uint8_t len, const asiolink::IOAddress &value)
 From IPv6 prefix with type.
 
static AttributePtr fromString (const uint8_t type, const std::string &value)
 From type specific factories.
 
static AttributePtr fromText (const AttrDefPtr &def, const std::string &value)
 From definition generic factories.
 
static AttributePtr fromText (const std::string &repr)
 Generic factories.
 
- Public Attributes inherited from isc::radius::Attribute
const uint8_t type_
 Type.
 

Detailed Description

RADIUS attribute derived classes: do not use them directly outside unit tests, instead use Attribute class/static factory methods.

RADIUS attribute holding strings.

Definition at line 234 of file client_attribute.h.

Constructor & Destructor Documentation

◆ AttrString() [1/2]

isc::radius::AttrString::AttrString ( const uint8_t type,
const std::string & value )
inlineprotected

Constructor.

Parameters
typeattribute type.
valuestring value.

Definition at line 240 of file client_attribute.h.

References Attribute, and if().

Referenced by fromBytes(), and fromText().

+ Here is the call graph for this function:

◆ AttrString() [2/2]

isc::radius::AttrString::AttrString ( const uint8_t type,
const std::vector< uint8_t > & value )
protected

Constructor.

Parameters
typeattribute type.
valuebinary value.

Definition at line 220 of file client_attribute.cc.

References Attribute, and if().

+ Here is the call graph for this function:

Member Function Documentation

◆ fromBytes()

AttributePtr isc::radius::AttrString::fromBytes ( const uint8_t type,
const std::vector< uint8_t > & bytes )
staticprotected

From bytes.

Parameters
typeattribute type.
bytesbinary value.
Returns
pointer to the attribute or null.

Definition at line 246 of file client_attribute.cc.

References AttrString(), and isc_throw.

Referenced by isc::radius::Attribute::fromBytes().

+ Here is the call graph for this function:

◆ fromText()

AttributePtr isc::radius::AttrString::fromText ( const uint8_t type,
const std::string & repr )
staticprotected

From text.

Parameters
typeattribute type.
reprvalue representation.
Returns
pointer to the attribute or null.

Definition at line 234 of file client_attribute.cc.

References AttrString(), and isc_throw.

Referenced by isc::radius::Attribute::fromText().

+ Here is the call graph for this function:

◆ getValueLen()

virtual size_t isc::radius::AttrString::getValueLen ( ) const
inlineoverridevirtual

Value length.

Returns
Value length.

Implements isc::radius::Attribute.

Definition at line 286 of file client_attribute.h.

Referenced by toBinary(), and toBytes().

◆ getValueType()

virtual AttrValueType isc::radius::AttrString::getValueType ( ) const
inlineoverridevirtual

Get value type.

Returns
the value type.

Implements isc::radius::Attribute.

Definition at line 279 of file client_attribute.h.

References isc::radius::PW_TYPE_STRING.

◆ toBinary()

vector< uint8_t > isc::radius::AttrString::toBinary ( ) const
overridevirtual

To binary.

Returns
the string value as a binary.

Reimplemented from isc::radius::Attribute.

Definition at line 278 of file client_attribute.cc.

References getValueLen().

+ Here is the call graph for this function:

◆ toBytes()

vector< uint8_t > isc::radius::AttrString::toBytes ( ) const
overridevirtual

To bytes.

Returns
binary representation.

Implements isc::radius::Attribute.

Definition at line 268 of file client_attribute.cc.

References isc::radius::Attribute::getType(), and getValueLen().

+ Here is the call graph for this function:

◆ toElement()

ElementPtr isc::radius::AttrString::toElement ( ) const
overridevirtual

Unparse attribute.

Returns
a pointer to unparsed attribute.

Implements isc::data::CfgToElement.

Definition at line 288 of file client_attribute.cc.

References Element::create(), Element::createMap(), isc::util::encode::encodeHex(), isc::radius::AttrDefs::getByType(), isc::radius::Attribute::getType(), isc::radius::AttrDefs::instance(), and isc::util::str::isPrintable().

+ Here is the call graph for this function:

◆ toString()

virtual std::string isc::radius::AttrString::toString ( ) const
inlineoverridevirtual

To string.

Returns
the string value.

Reimplemented from isc::radius::Attribute.

Definition at line 304 of file client_attribute.h.

◆ toText()

string isc::radius::AttrString::toText ( size_t indent = 0) const
overridevirtual

Returns text representation of the attribute.

Parameters
indentnumber of spaces before printing text.
Returns
string with text representation.

Implements isc::radius::Attribute.

Definition at line 258 of file client_attribute.cc.

References isc::radius::AttrDefs::getName(), isc::radius::Attribute::getType(), and isc::radius::AttrDefs::instance().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ Attribute

friend class Attribute
friend

Make Attribute a friend class.

Definition at line 273 of file client_attribute.h.

References Attribute.

Referenced by AttrString(), AttrString(), and Attribute.


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