Kea: client_attribute.h Source File

| Kea 3.0.3-git

client_attribute.h
Go to the documentation of this file.
1// Copyright (C) 2023-2025 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef RADIUS_CLIENT_ATTRIBUTE_H
8#define RADIUS_CLIENT_ATTRIBUTE_H
9
10#include <exceptions/exceptions.h>
11#include <cc/cfg_to_element.h>
12#include <cc/data.h>
13#include <cc/simple_parser.h>
14#include <asiolink/io_address.h>
15#include <client_dictionary.h>
16#include <boost/multi_index_container.hpp>
17#include <boost/multi_index/hashed_index.hpp>
18#include <boost/multi_index/member.hpp>
19#include <boost/multi_index/sequenced_index.hpp>
20#include <boost/noncopyable.hpp>
21#include <boost/shared_ptr.hpp>
22#include <string>
23#include <vector>
24
25namespace isc {
26namespace radius {
27
29static constexpr size_t MAX_STRING_LEN = 253;
30
32using isc::data::TypeError;
33
35class Attribute;
36 typedef boost::shared_ptr<Attribute> AttributePtr;
37 typedef boost::shared_ptr<const Attribute> ConstAttributePtr;
38
40 class Attribute : public data::CfgToElement {
41protected:
42
48 explicit Attribute(const uint8_t type) : type_(type) {
49 }
50
51public:
53 virtual ~Attribute() = default;
54
58 uint8_t getType() const {
59 return (type_);
60 }
61
65 virtual AttrValueType getValueType() const = 0;
66
68
74 static AttributePtr fromText(const std::string& repr);
75
81 static AttributePtr fromBytes(const std::vector<uint8_t>& bytes);
82
84
91 static AttributePtr fromText(const AttrDefPtr& def,
92 const std::string& value);
93
100 static AttributePtr fromBytes(const AttrDefPtr& def,
101 const std::vector<uint8_t>& value);
102
106
113 static AttributePtr fromString(const uint8_t type,
114 const std::string& value);
115
122 static AttributePtr fromBinary(const uint8_t type,
123 const std::vector<uint8_t>& value);
124
131 static AttributePtr fromInt(const uint8_t type, const uint32_t value);
132
139 static AttributePtr fromIpAddr(const uint8_t type,
140 const asiolink::IOAddress& value);
141
148 static AttributePtr fromIpv6Addr(const uint8_t type,
149 const asiolink::IOAddress& value);
150
158 static AttributePtr fromIpv6Prefix(const uint8_t type,
159 const uint8_t len,
160 const asiolink::IOAddress& value);
161
163
167 virtual size_t getValueLen() const = 0;
168
173 virtual std::string toText(size_t indent = 0) const = 0;
174
178 virtual std::vector<uint8_t> toBytes() const = 0;
179
183
188 virtual std::string toString() const;
189
194 virtual std::vector<uint8_t> toBinary() const;
195
200 virtual uint32_t toInt() const;
201
206 virtual asiolink::IOAddress toIpAddr() const;
207
212 virtual asiolink::IOAddress toIpv6Addr() const;
213
218 virtual asiolink::IOAddress toIpv6Prefix() const;
219
224 virtual uint8_t toIpv6PrefixLen() const;
225
227 const uint8_t type_;
228};
229
232
234 class AttrString : public Attribute {
235protected:
240 AttrString(const uint8_t type, const std::string& value)
241 : Attribute(type), value_(value) {
242 if (value.empty()) {
243 isc_throw(BadValue, "value is empty");
244 }
245 if (value.size() > MAX_STRING_LEN) {
246 isc_throw(BadValue, "value is too large " << value.size()
247 << " > " << MAX_STRING_LEN);
248 }
249 }
250
255 AttrString(const uint8_t type, const std::vector<uint8_t>& value);
256
262 static AttributePtr fromText(const uint8_t type, const std::string& repr);
263
269 static AttributePtr fromBytes(const uint8_t type,
270 const std::vector<uint8_t>& bytes);
271
273 friend class Attribute;
274
275public:
279 virtual AttrValueType getValueType() const override {
280 return (PW_TYPE_STRING);
281 }
282
286 virtual size_t getValueLen() const override {
287 return (value_.size());
288 }
289
294 virtual std::string toText(size_t indent = 0) const override;
295
299 virtual std::vector<uint8_t> toBytes() const override;
300
304 virtual std::string toString() const override {
305 return (value_);
306 }
307
311 virtual std::vector<uint8_t> toBinary() const override;
312
316 virtual data::ElementPtr toElement() const override;
317
318private:
320 std::string value_;
321};
322
324 class AttrInt : public Attribute {
325protected:
326
331 AttrInt(const uint8_t type, const int32_t value)
332 : Attribute(type), value_(static_cast<uint32_t>(value)) {
333 }
334
339 AttrInt(const uint8_t type, const uint32_t value)
340 : Attribute(type), value_(value) {
341 }
342
348 static AttributePtr fromText(const uint8_t type, const std::string& repr);
349
355 static AttributePtr fromBytes(const uint8_t type,
356 const std::vector<uint8_t>& bytes);
357
359 friend class Attribute;
360
361public:
362
366 virtual AttrValueType getValueType() const override {
367 return (PW_TYPE_INTEGER);
368 }
369
373 virtual size_t getValueLen() const override {
374 return (4);
375 }
376
381 virtual std::string toText(size_t indent = 0) const override;
382
386 virtual std::vector<uint8_t> toBytes() const override;
387
391 virtual uint32_t toInt() const override {
392 return (value_);
393 }
394
398 virtual data::ElementPtr toElement() const override;
399
400private:
402 const uint32_t value_;
403};
404
406 class AttrIpAddr : public Attribute {
407protected:
408
413 AttrIpAddr(const uint8_t type, const asiolink::IOAddress& value)
414 : Attribute(type), value_(value) {
415 if (!value.isV4()) {
416 isc_throw(BadValue, "not v4 address " << value);
417 }
418 }
419
425 static AttributePtr fromText(const uint8_t type, const std::string& repr);
426
432 static AttributePtr fromBytes(const uint8_t type,
433 const std::vector<uint8_t>& bytes);
434
436 friend class Attribute;
437
438public:
442 virtual AttrValueType getValueType() const override {
443 return (PW_TYPE_IPADDR);
444 }
445
449 virtual size_t getValueLen() const override {
450 return (4);
451 }
452
457 virtual std::string toText(size_t indent = 0) const override;
458
462 virtual std::vector<uint8_t> toBytes() const override;
463
467 virtual asiolink::IOAddress toIpAddr() const override {
468 return (value_);
469 }
470
474 virtual data::ElementPtr toElement() const override;
475
476private:
478 asiolink::IOAddress value_;
479};
480
482 class AttrIpv6Addr : public Attribute {
483protected:
484
489 AttrIpv6Addr(const uint8_t type, const asiolink::IOAddress& value)
490 : Attribute(type), value_(value) {
491 if (!value.isV6()) {
492 isc_throw(BadValue, "not v6 address " << value);
493 }
494 }
495
501 static AttributePtr fromText(const uint8_t type, const std::string& repr);
502
508 static AttributePtr fromBytes(const uint8_t type,
509 const std::vector<uint8_t>& bytes);
510
512 friend class Attribute;
513
514public:
515
519 virtual AttrValueType getValueType() const override {
520 return (PW_TYPE_IPV6ADDR);
521 }
522
526 virtual size_t getValueLen() const override {
527 return (16);
528 }
529
534 virtual std::string toText(size_t indent = 0) const override;
535
539 virtual std::vector<uint8_t> toBytes() const override;
540
544 virtual asiolink::IOAddress toIpv6Addr() const override {
545 return (value_);
546 }
547
551 virtual data::ElementPtr toElement() const override;
552
553private:
555 asiolink::IOAddress value_;
556};
557
559 class AttrIpv6Prefix : public Attribute {
560protected:
561
567 AttrIpv6Prefix(const uint8_t type, const uint8_t len,
568 const asiolink::IOAddress& value)
569 : Attribute(type), len_(len), value_(value) {
570 if (!value.isV6()) {
571 isc_throw(BadValue, "not v6 address " << value);
572 }
573 if (len > 128) {
574 isc_throw(BadValue, "too long prefix "
575 << static_cast<unsigned>(len));
576 }
577 }
578
584 static AttributePtr fromText(const uint8_t type, const std::string& repr);
585
591 static AttributePtr fromBytes(const uint8_t type,
592 const std::vector<uint8_t>& bytes);
593
595 friend class Attribute;
596
597public:
598
602 virtual AttrValueType getValueType() const override {
603 return (PW_TYPE_IPV6PREFIX);
604 }
605
609 virtual size_t getValueLen() const override {
610 return (17);
611 }
612
617 virtual std::string toText(size_t indent = 0) const override;
618
622 virtual std::vector<uint8_t> toBytes() const override;
623
627 virtual asiolink::IOAddress toIpv6Prefix() const override {
628 return (value_);
629 }
630
634 virtual uint8_t toIpv6PrefixLen() const override {
635 return (len_);
636 }
637
641 virtual data::ElementPtr toElement() const override;
642
643private:
645 const uint8_t len_;
646
648 asiolink::IOAddress value_;
649};
650
652 class Attributes : public data::CfgToElement {
653public:
654
656 typedef boost::multi_index_container<
657 // This container stores pointers to attributes.
658 ConstAttributePtr,
659 // Start specification of indexes here.
660 boost::multi_index::indexed_by<
661 // Sequenced index to keep insert order.
662 boost::multi_index::sequenced<>,
663 // Hash index for direct retrieval.
664 boost::multi_index::hashed_non_unique<
665 boost::multi_index::member<
666 Attribute, const uint8_t, &Attribute::type_
667 >
668 >
669 >
670 > AttributeContainer;
671
673 Attributes() : container_() {
674 }
675
679 Attributes(const Attributes& other) : container_(other.container_) {
680 }
681
683 virtual ~Attributes() {
684 clear();
685 }
686
690 bool empty() const {
691 return (container_.empty());
692 }
693
697 size_t size() const {
698 return (container_.size());
699 }
700
704 void add(const ConstAttributePtr& attr);
705
712 bool del(const uint8_t type);
713
715 void clear() {
716 container_.clear();
717 }
718
722 void append(const Attributes& other);
723
728 size_t count(const uint8_t type) const;
729
734 ConstAttributePtr get(const uint8_t type) const;
735
740 std::string toText(size_t indent = 0) const;
741
745 data::ElementPtr toElement() const override;
746
751 static Attributes fromElement(const data::ConstElementPtr& attr_list);
752
756 AttributeContainer::iterator begin() {
757 return (container_.begin());
758 }
759
763 AttributeContainer::const_iterator begin() const {
764 return (container_.begin());
765 }
766
770 AttributeContainer::const_iterator cbegin() const {
771 return (container_.cbegin());
772 }
773
777 AttributeContainer::iterator end() {
778 return (container_.end());
779 }
780
784 AttributeContainer::const_iterator end() const {
785 return (container_.end());
786 }
787
789 AttributeContainer::const_iterator cend() const {
790 return (container_.cend());
791 }
792
793protected:
795 AttributeContainer container_;
796};
797
799 typedef boost::shared_ptr<Attributes> AttributesPtr;
800
801} // end of namespace isc::radius
802} // end of namespace isc
803
804#endif
if
if(!(yy_init))
Definition agent_lexer.cc:1900
cfg_to_element.h
isc::BadValue
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
Definition exceptions/exceptions.h:132
isc::asiolink::IOAddress
The IOAddress class represents an IP addresses (version agnostic).
Definition io_address.h:45
isc::asiolink::IOAddress::isV6
bool isV6() const
Convenience function to check for an IPv6 address.
Definition io_address.h:136
isc::asiolink::IOAddress::isV4
bool isV4() const
Convenience function to check for an IPv4 address.
Definition io_address.h:114
isc::radius::AttrInt::toInt
virtual uint32_t toInt() const override
To integer.
Definition client_attribute.h:391
isc::radius::AttrInt::fromText
static AttributePtr fromText(const uint8_t type, const std::string &repr)
From text.
Definition client_attribute.cc:310
isc::radius::AttrInt::toBytes
virtual std::vector< uint8_t > toBytes() const override
To bytes.
Definition client_attribute.cc:365
isc::radius::AttrInt::getValueLen
virtual size_t getValueLen() const override
Value length.
Definition client_attribute.h:373
isc::radius::AttrInt::toElement
virtual data::ElementPtr toElement() const override
Unparse attribute.
Definition client_attribute.cc:378
isc::radius::AttrInt::AttrInt
AttrInt(const uint8_t type, const uint32_t value)
Constructor (unsigned).
Definition client_attribute.h:339
isc::radius::AttrInt::Attribute
friend class Attribute
Make Attribute a friend class.
Definition client_attribute.h:359
isc::radius::AttrInt::toText
virtual std::string toText(size_t indent=0) const override
Returns text representation of the attribute.
Definition client_attribute.cc:349
isc::radius::AttrInt::AttrInt
AttrInt(const uint8_t type, const int32_t value)
Constructor (signed).
Definition client_attribute.h:331
isc::radius::AttrInt::fromBytes
static AttributePtr fromBytes(const uint8_t type, const std::vector< uint8_t > &bytes)
From bytes.
Definition client_attribute.cc:331
isc::radius::AttrInt::getValueType
virtual AttrValueType getValueType() const override
Get value type.
Definition client_attribute.h:366
isc::radius::AttrIpAddr::AttrIpAddr
AttrIpAddr(const uint8_t type, const asiolink::IOAddress &value)
Constructor.
Definition client_attribute.h:413
isc::radius::AttrIpAddr::toElement
virtual data::ElementPtr toElement() const override
Unparse attribute.
Definition client_attribute.cc:443
isc::radius::AttrIpAddr::toBytes
virtual std::vector< uint8_t > toBytes() const override
To bytes.
Definition client_attribute.cc:432
isc::radius::AttrIpAddr::fromText
static AttributePtr fromText(const uint8_t type, const std::string &repr)
From text.
Definition client_attribute.cc:392
isc::radius::AttrIpAddr::toIpAddr
virtual asiolink::IOAddress toIpAddr() const override
To IPv4 address.
Definition client_attribute.h:467
isc::radius::AttrIpAddr::fromBytes
static AttributePtr fromBytes(const uint8_t type, const std::vector< uint8_t > &bytes)
From bytes.
Definition client_attribute.cc:406
isc::radius::AttrIpAddr::getValueLen
virtual size_t getValueLen() const override
Value length.
Definition client_attribute.h:449
isc::radius::AttrIpAddr::Attribute
friend class Attribute
Make Attribute a friend class.
Definition client_attribute.h:436
isc::radius::AttrIpAddr::getValueType
virtual AttrValueType getValueType() const override
Get value type.
Definition client_attribute.h:442
isc::radius::AttrIpAddr::toText
virtual std::string toText(size_t indent=0) const override
Returns text representation of the attribute.
Definition client_attribute.cc:421
isc::radius::AttrIpv6Addr::toText
virtual std::string toText(size_t indent=0) const override
Returns text representation of the attribute.
Definition client_attribute.cc:486
isc::radius::AttrIpv6Addr::toIpv6Addr
virtual asiolink::IOAddress toIpv6Addr() const override
To IPv6 address.
Definition client_attribute.h:544
isc::radius::AttrIpv6Addr::fromBytes
static AttributePtr fromBytes(const uint8_t type, const std::vector< uint8_t > &bytes)
From bytes.
Definition client_attribute.cc:471
isc::radius::AttrIpv6Addr::toBytes
virtual std::vector< uint8_t > toBytes() const override
To bytes.
Definition client_attribute.cc:497
isc::radius::AttrIpv6Addr::getValueType
virtual AttrValueType getValueType() const override
Get value type.
Definition client_attribute.h:519
isc::radius::AttrIpv6Addr::getValueLen
virtual size_t getValueLen() const override
Value length.
Definition client_attribute.h:526
isc::radius::AttrIpv6Addr::fromText
static AttributePtr fromText(const uint8_t type, const std::string &repr)
From text.
Definition client_attribute.cc:457
isc::radius::AttrIpv6Addr::AttrIpv6Addr
AttrIpv6Addr(const uint8_t type, const asiolink::IOAddress &value)
Constructor.
Definition client_attribute.h:489
isc::radius::AttrIpv6Addr::Attribute
friend class Attribute
Make Attribute a friend class.
Definition client_attribute.h:512
isc::radius::AttrIpv6Addr::toElement
virtual data::ElementPtr toElement() const override
Unparse attribute.
Definition client_attribute.cc:508
isc::radius::AttrIpv6Prefix::toIpv6Prefix
virtual asiolink::IOAddress toIpv6Prefix() const override
To IPv6 prefix.
Definition client_attribute.h:627
isc::radius::AttrIpv6Prefix::AttrIpv6Prefix
AttrIpv6Prefix(const uint8_t type, const uint8_t len, const asiolink::IOAddress &value)
Constructor.
Definition client_attribute.h:567
isc::radius::AttrIpv6Prefix::toBytes
virtual std::vector< uint8_t > toBytes() const override
To bytes.
Definition client_attribute.cc:588
isc::radius::AttrIpv6Prefix::toElement
virtual data::ElementPtr toElement() const override
Unparse attribute.
Definition client_attribute.cc:602
isc::radius::AttrIpv6Prefix::getValueLen
virtual size_t getValueLen() const override
Value length.
Definition client_attribute.h:609
isc::radius::AttrIpv6Prefix::toIpv6PrefixLen
virtual uint8_t toIpv6PrefixLen() const override
To IPv6 prefix length.
Definition client_attribute.h:634
isc::radius::AttrIpv6Prefix::Attribute
friend class Attribute
Make Attribute a friend class.
Definition client_attribute.h:595
isc::radius::AttrIpv6Prefix::getValueType
virtual AttrValueType getValueType() const override
Get value type.
Definition client_attribute.h:602
isc::radius::AttrIpv6Prefix::fromText
static AttributePtr fromText(const uint8_t type, const std::string &repr)
From text.
Definition client_attribute.cc:522
isc::radius::AttrIpv6Prefix::fromBytes
static AttributePtr fromBytes(const uint8_t type, const std::vector< uint8_t > &bytes)
From bytes.
Definition client_attribute.cc:549
isc::radius::AttrIpv6Prefix::toText
virtual std::string toText(size_t indent=0) const override
Returns text representation of the attribute.
Definition client_attribute.cc:577
isc::radius::AttrString::fromBytes
static AttributePtr fromBytes(const uint8_t type, const std::vector< uint8_t > &bytes)
From bytes.
Definition client_attribute.cc:246
isc::radius::AttrString::fromText
static AttributePtr fromText(const uint8_t type, const std::string &repr)
From text.
Definition client_attribute.cc:234
isc::radius::AttrString::toBytes
virtual std::vector< uint8_t > toBytes() const override
To bytes.
Definition client_attribute.cc:268
isc::radius::AttrString::toElement
virtual data::ElementPtr toElement() const override
Unparse attribute.
Definition client_attribute.cc:288
isc::radius::AttrString::toText
virtual std::string toText(size_t indent=0) const override
Returns text representation of the attribute.
Definition client_attribute.cc:258
isc::radius::AttrString::AttrString
AttrString(const uint8_t type, const std::string &value)
Constructor.
Definition client_attribute.h:240
isc::radius::AttrString::toBinary
virtual std::vector< uint8_t > toBinary() const override
To binary.
Definition client_attribute.cc:278
isc::radius::AttrString::getValueLen
virtual size_t getValueLen() const override
Value length.
Definition client_attribute.h:286
isc::radius::AttrString::Attribute
friend class Attribute
Make Attribute a friend class.
Definition client_attribute.h:273
isc::radius::AttrString::toString
virtual std::string toString() const override
To string.
Definition client_attribute.h:304
isc::radius::AttrString::getValueType
virtual AttrValueType getValueType() const override
Get value type.
Definition client_attribute.h:279
isc::radius::Attribute
RADIUS attribute base class.
Definition client_attribute.h:40
isc::radius::Attribute::fromBytes
static AttributePtr fromBytes(const std::vector< uint8_t > &bytes)
From bytes (wire format).
Definition client_attribute.cc:91
isc::radius::Attribute::toString
virtual std::string toString() const
Specific get methods.
Definition client_attribute.cc:179
isc::radius::Attribute::getValueLen
virtual size_t getValueLen() const =0
Generic get methods.
isc::radius::Attribute::fromInt
static AttributePtr fromInt(const uint8_t type, const uint32_t value)
From integer with type.
Definition client_attribute.cc:158
isc::radius::Attribute::fromIpAddr
static AttributePtr fromIpAddr(const uint8_t type, const asiolink::IOAddress &value)
From IPv4 address with type.
Definition client_attribute.cc:163
isc::radius::Attribute::toInt
virtual uint32_t toInt() const
To integer.
Definition client_attribute.cc:191
isc::radius::Attribute::Attribute
Attribute(const uint8_t type)
Constructor.
Definition client_attribute.h:48
isc::radius::Attribute::fromString
static AttributePtr fromString(const uint8_t type, const std::string &value)
From type specific factories.
Definition client_attribute.cc:142
isc::radius::Attribute::toBytes
virtual std::vector< uint8_t > toBytes() const =0
To bytes (wire format).
isc::radius::Attribute::getType
uint8_t getType() const
Get type.
Definition client_attribute.h:58
isc::radius::Attribute::~Attribute
virtual ~Attribute()=default
Virtual destructor.
isc::radius::Attribute::toIpAddr
virtual asiolink::IOAddress toIpAddr() const
To IPv4 address.
Definition client_attribute.cc:197
isc::radius::Attribute::toIpv6Addr
virtual asiolink::IOAddress toIpv6Addr() const
To IPv6 address.
Definition client_attribute.cc:203
isc::radius::Attribute::fromBinary
static AttributePtr fromBinary(const uint8_t type, const std::vector< uint8_t > &value)
From binary with type.
Definition client_attribute.cc:150
isc::radius::Attribute::fromText
static AttributePtr fromText(const std::string &repr)
Generic factories.
Definition client_attribute.cc:28
isc::radius::Attribute::toIpv6PrefixLen
virtual uint8_t toIpv6PrefixLen() const
To IPv6 prefix length.
Definition client_attribute.cc:215
isc::radius::Attribute::fromIpv6Prefix
static AttributePtr fromIpv6Prefix(const uint8_t type, const uint8_t len, const asiolink::IOAddress &value)
From IPv6 prefix with type.
Definition client_attribute.cc:173
isc::radius::Attribute::toText
virtual std::string toText(size_t indent=0) const =0
Returns text representation of the attribute.
isc::radius::Attribute::fromIpv6Addr
static AttributePtr fromIpv6Addr(const uint8_t type, const asiolink::IOAddress &value)
From IPv6 address with type.
Definition client_attribute.cc:168
isc::radius::Attribute::toIpv6Prefix
virtual asiolink::IOAddress toIpv6Prefix() const
To IPv6 prefix.
Definition client_attribute.cc:209
isc::radius::Attribute::getValueType
virtual AttrValueType getValueType() const =0
Get value type.
isc::radius::Attribute::type_
const uint8_t type_
Type.
Definition client_attribute.h:227
isc::radius::Attribute::toBinary
virtual std::vector< uint8_t > toBinary() const
To binary.
Definition client_attribute.cc:185
isc::radius::Attributes
Collection of attributes.
Definition client_attribute.h:652
isc::radius::Attributes::AttributeContainer
boost::multi_index_container< ConstAttributePtr, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::hashed_non_unique< boost::multi_index::member< Attribute, const uint8_t, &Attribute::type_ > > > > AttributeContainer
Type of the container.
Definition client_attribute.h:670
isc::radius::Attributes::add
void add(const ConstAttributePtr &attr)
Adds instance of the attribute to the collection.
Definition client_attribute.cc:616
isc::radius::Attributes::container_
AttributeContainer container_
The container.
Definition client_attribute.h:795
isc::radius::Attributes::size
size_t size() const
Returns the number of elements.
Definition client_attribute.h:697
isc::radius::Attributes::begin
AttributeContainer::const_iterator begin() const
Get the iterator to the beginning.
Definition client_attribute.h:763
isc::radius::Attributes::toText
std::string toText(size_t indent=0) const
Returns text representation of the collection.
Definition client_attribute.cc:659
isc::radius::Attributes::Attributes
Attributes()
constructor.
Definition client_attribute.h:673
isc::radius::Attributes::empty
bool empty() const
Indicates the object is empty.
Definition client_attribute.h:690
isc::radius::Attributes::append
void append(const Attributes &other)
Append another collection.
Definition client_attribute.cc:635
isc::radius::Attributes::count
size_t count(const uint8_t type) const
Counts instance of the attribute in the collection.
Definition client_attribute.cc:642
isc::radius::Attributes::~Attributes
virtual ~Attributes()
Destructor.
Definition client_attribute.h:683
isc::radius::Attributes::cend
AttributeContainer::const_iterator cend() const
Get the const iterator to the past-the-end.
Definition client_attribute.h:789
isc::radius::Attributes::get
ConstAttributePtr get(const uint8_t type) const
Get instance of the attribute in the collection.
Definition client_attribute.cc:648
isc::radius::Attributes::toElement
data::ElementPtr toElement() const override
Unparse collection.
Definition client_attribute.cc:674
isc::radius::Attributes::Attributes
Attributes(const Attributes &other)
Copy constructor.
Definition client_attribute.h:679
isc::radius::Attributes::cbegin
AttributeContainer::const_iterator cbegin() const
Get the const iterator to the beginning.
Definition client_attribute.h:770
isc::radius::Attributes::clear
void clear()
Clear the collection.
Definition client_attribute.h:715
isc::radius::Attributes::begin
AttributeContainer::iterator begin()
Get the iterator to the beginning.
Definition client_attribute.h:756
isc::radius::Attributes::del
bool del(const uint8_t type)
Deletes an attribute from the collection.
Definition client_attribute.cc:624
isc::radius::Attributes::fromElement
static Attributes fromElement(const data::ConstElementPtr &attr_list)
Parse collection.
Definition client_attribute.cc:683
isc::radius::Attributes::end
AttributeContainer::iterator end()
Get the iterator to the past-the-end.
Definition client_attribute.h:777
isc::radius::Attributes::end
AttributeContainer::const_iterator end() const
Get the iterator to the past-the-end.
Definition client_attribute.h:784
client_dictionary.h
data.h
exceptions.h
isc_throw
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Definition exceptions/exceptions.h:210
io_address.h
simple_parser.h
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:30
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition data.h:29
isc::radius
Definition cfg_attribute.cc:21
isc::radius::AttributesPtr
boost::shared_ptr< Attributes > AttributesPtr
Shared pointers to attribute collection.
Definition client_attribute.h:799
isc::radius::ConstAttributePtr
boost::shared_ptr< const Attribute > ConstAttributePtr
Definition client_attribute.h:37
isc::radius::AttrValueType
AttrValueType
Attribute value types.
Definition client_dictionary.h:29
isc::radius::PW_TYPE_INTEGER
@ PW_TYPE_INTEGER
Definition client_dictionary.h:31
isc::radius::PW_TYPE_IPV6PREFIX
@ PW_TYPE_IPV6PREFIX
Definition client_dictionary.h:34
isc::radius::PW_TYPE_IPV6ADDR
@ PW_TYPE_IPV6ADDR
Definition client_dictionary.h:33
isc::radius::PW_TYPE_IPADDR
@ PW_TYPE_IPADDR
Definition client_dictionary.h:32
isc::radius::PW_TYPE_STRING
@ PW_TYPE_STRING
Definition client_dictionary.h:30
isc::radius::AttrDefPtr
boost::shared_ptr< AttrDef > AttrDefPtr
Shared pointers to Attribute definition.
Definition client_dictionary.h:76
isc::radius::AttributePtr
boost::shared_ptr< Attribute > AttributePtr
Definition client_attribute.h:36
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
isc::data::CfgToElement
Abstract class for configuration Cfg_* classes.
Definition cfg_to_element.h:29