![]() |
Kea 3.1.1
|
RADIUS attribute holding integers. More...
#include <client_attribute.h>
Public Member Functions | |
virtual size_t | getValueLen () const override |
Value length. | |
virtual AttrValueType | getValueType () const override |
Get value type. | |
virtual std::vector< uint8_t > | toBytes () const override |
To bytes. | |
virtual data::ElementPtr | toElement () const override |
Unparse attribute. | |
virtual uint32_t | toInt () const override |
To integer. | |
virtual std::string | toText (size_t indent=0) const override |
Returns text representation of the attribute. | |
![]() | |
virtual | ~Attribute ()=default |
Virtual destructor. | |
uint8_t | getType () const |
Get type. | |
virtual std::vector< uint8_t > | toBinary () const |
To binary. | |
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. | |
virtual std::string | toString () const |
Specific get methods. | |
![]() | |
virtual | ~CfgToElement () |
Destructor. | |
Protected Member Functions | |
AttrInt (const uint8_t type, const int32_t value) | |
Constructor (signed). | |
AttrInt (const uint8_t type, const uint32_t value) | |
Constructor (unsigned). | |
![]() | |
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 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. | |
![]() | |
const uint8_t | type_ |
Type. | |
RADIUS attribute holding integers.
Definition at line 324 of file client_attribute.h.
|
inlineprotected |
Constructor (signed).
type | attribute type. |
value | integer value. |
Definition at line 331 of file client_attribute.h.
References Attribute.
Referenced by fromBytes(), and fromText().
|
inlineprotected |
Constructor (unsigned).
type | attribute type. |
value | integer value. |
Definition at line 339 of file client_attribute.h.
References Attribute.
|
staticprotected |
From bytes.
type | attribute type. |
bytes | binary value. |
Definition at line 331 of file client_attribute.cc.
References AttrInt(), isc::radius::AttrDefs::instance(), isc_throw, LOG_ERROR, isc::radius::RADIUS_INTEGER_ATTRIBUTE_FROM_BYTES_FAILED, and isc::radius::radius_logger.
Referenced by isc::radius::Attribute::fromBytes().
|
staticprotected |
From text.
type | attribute type. |
repr | value representation. |
Definition at line 310 of file client_attribute.cc.
References AttrInt(), isc::radius::AttrDefs::instance(), isc_throw, LOG_ERROR, isc::radius::RADIUS_INTEGER_ATTRIBUTE_FROM_TEXT_FAILED, and isc::radius::radius_logger.
Referenced by isc::radius::Attribute::fromText().
|
inlineoverridevirtual |
Value length.
Implements isc::radius::Attribute.
Definition at line 373 of file client_attribute.h.
|
inlineoverridevirtual |
Get value type.
Implements isc::radius::Attribute.
Definition at line 366 of file client_attribute.h.
References isc::radius::PW_TYPE_INTEGER.
|
overridevirtual |
To bytes.
Implements isc::radius::Attribute.
Definition at line 365 of file client_attribute.cc.
References isc::radius::Attribute::getType().
|
overridevirtual |
Unparse attribute.
Implements isc::data::CfgToElement.
Definition at line 378 of file client_attribute.cc.
References Element::create(), Element::createMap(), isc::radius::AttrDefs::getByType(), isc::radius::Attribute::getType(), and isc::radius::AttrDefs::instance().
|
inlineoverridevirtual |
To integer.
Reimplemented from isc::radius::Attribute.
Definition at line 391 of file client_attribute.h.
|
overridevirtual |
Returns text representation of the attribute.
indent | number of spaces before printing text. |
Implements isc::radius::Attribute.
Definition at line 349 of file client_attribute.cc.
References isc::radius::AttrDefs::getByValue(), isc::radius::AttrDefs::getName(), isc::radius::Attribute::getType(), and isc::radius::AttrDefs::instance().
|
friend |