| Kea 3.0.2-git

isc::radius::AttrIpv6Prefix Class Reference

RADIUS attribute holding IPv6 prefixes. More...

`#include <client_attribute.h>`

Inheritance diagram for isc::radius::AttrIpv6Prefix:
[legend]

## 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 asiolink::IOAddress | toIpv6Prefix () const override
| To IPv6 prefix.
virtual uint8_t | toIpv6PrefixLen () const override
| To IPv6 prefix length.
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 std::vector< uint8_t > | toBinary () const
| To binary.
virtual uint32_t | toInt () const
| To integer.
virtual asiolink::IOAddress | toIpAddr () const
| To IPv4 address.
virtual asiolink::IOAddress | toIpv6Addr () const
| To IPv6 address.
virtual std::string | toString () const
| Specific get methods.
Public Member Functions inherited from isc::data::CfgToElement
virtual | ~CfgToElement ()
| Destructor.

## Protected Member Functions
| AttrIpv6Prefix (const uint8_t type, const uint8_t len, const asiolink::IOAddress &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 holding IPv6 prefixes.

Definition at line 559 of file client_attribute.h.

## Constructor & Destructor Documentation

## ◆ AttrIpv6Prefix()

isc::radius::AttrIpv6Prefix::AttrIpv6Prefix | ( | const uint8_t | type,
|  | const uint8_t | len,
|  | const asiolink::IOAddress & | value )
| inline protected

Constructor.

Parameters

  type | attribute type.
  len | prefix length.
  value | IPv6 address value.

Definition at line 567 of file client_attribute.h.

References Attribute, if(), isc_throw, and isc::asiolink::IOAddress::isV6().

Referenced by fromBytes(), and fromText().

Here is the call graph for this function:

## Member Function Documentation

## ◆ fromBytes()

AttributePtr isc::radius::AttrIpv6Prefix::fromBytes | ( | const uint8_t | type,
|  | const std::vector< uint8_t > & | bytes )
| static protected

From bytes.

Parameters

  type | attribute type.
  bytes | binary value.

Returns
  pointer to the attribute or null.

Checked by caller.

Definition at line 549 of file client_attribute.cc.

References AttrIpv6Prefix(), isc::asiolink::IOAddress::fromBytes(), isc::radius::AttrDefs::instance(), isc_throw, LOG_ERROR, isc::radius::RADIUS_IPV6PREFIX_ATTRIBUTE_FROM_BYTES_FAILED, and isc::radius::radius_logger.

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

Here is the call graph for this function:

## ◆ fromText()

AttributePtr isc::radius::AttrIpv6Prefix::fromText | ( | const uint8_t | type,
|  | const std::string & | repr )
| static protected

From text.

Parameters

  type | attribute type.
  repr | value representation.

Returns
  pointer to the attribute or null.

Definition at line 522 of file client_attribute.cc.

References AttrIpv6Prefix(), isc::radius::AttrDefs::instance(), isc_throw, LOG_ERROR, isc::radius::RADIUS_IPV6PREFIX_ATTRIBUTE_FROM_TEXT_FAILED, and isc::radius::radius_logger.

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

Here is the call graph for this function:

## ◆ getValueLen()

virtual size_t isc::radius::AttrIpv6Prefix::getValueLen | ( |  | ) | const
| inline override virtual

Value length.

Returns
  Value length.

Implements isc::radius::Attribute.

Definition at line 609 of file client_attribute.h.

## ◆ getValueType()

virtual AttrValueType isc::radius::AttrIpv6Prefix::getValueType | ( |  | ) | const
| inline override virtual

Get value type.

Returns
  the value type.

Implements isc::radius::Attribute.

Definition at line 602 of file client_attribute.h.

References isc::radius::PW_TYPE_IPV6PREFIX.

## ◆ toBytes()

vector< uint8_t > isc::radius::AttrIpv6Prefix::toBytes | ( |  | ) | const
| override virtual

To bytes.

Returns
  binary representation.

Implements isc::radius::Attribute.

Definition at line 588 of file client_attribute.cc.

References isc::radius::Attribute::getType().

Here is the call graph for this function:

## ◆ toElement()

ElementPtr isc::radius::AttrIpv6Prefix::toElement | ( |  | ) | const
| override virtual

Unparse attribute.

Returns
  a pointer to unparsed attribute.

Implements isc::data::CfgToElement.

Definition at line 602 of file client_attribute.cc.

References Element::create(), Element::createMap(), isc::radius::AttrDefs::getByType(), isc::radius::Attribute::getType(), and isc::radius::AttrDefs::instance().

Here is the call graph for this function:

## ◆ toIpv6Prefix()

virtual asiolink::IOAddress isc::radius::AttrIpv6Prefix::toIpv6Prefix | ( |  | ) | const
| inline override virtual

To IPv6 prefix.

Returns
  the IPv6 address value.

Reimplemented from isc::radius::Attribute.

Definition at line 627 of file client_attribute.h.

## ◆ toIpv6PrefixLen()

virtual uint8_t isc::radius::AttrIpv6Prefix::toIpv6PrefixLen | ( |  | ) | const
| inline override virtual

To IPv6 prefix length.

Returns
  the IPv6 prefix length.

Reimplemented from isc::radius::Attribute.

Definition at line 634 of file client_attribute.h.

## ◆ toText()

string isc::radius::AttrIpv6Prefix::toText | ( | size_t | indent = 0 | ) | const
| override virtual

Returns text representation of the attribute.

Parameters

  indent | number of spaces before printing text.

Returns
  string with text representation.

Implements isc::radius::Attribute.

Definition at line 577 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 595 of file client_attribute.h.

References Attribute.

Referenced by AttrIpv6Prefix(), and Attribute.

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

- client_attribute.h
- client_attribute.cc