Kea: radius_service.cc Source File

| Kea 3.0.0

radius_service.cc
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#include <config.h>
8
9#include <radius_service.h>
10
11using namespace std;
12using namespace isc;
13using namespace isc::data;
14
15namespace isc {
16namespace radius {
17
18RadiusService::RadiusService(const std::string& name)
19 : name_(name), enabled_(false), peer_updates_(true),
20 max_pending_requests_(0) {
21}
22
23 ElementPtr
24RadiusService::toElement() const {
25 ElementPtr result = Element::createMap();
26
27 // servers.
28 if (!servers_.empty()) {
29 ElementPtr servers = Element::createList();
30 for (auto const& server : servers_) {
31 if (server) {
32 servers->add(server->toElement());
33 }
34 }
35 result->set("servers", servers);
36 }
37
38 // attributes.
39 result->set("attributes", attributes_.toElement());
40
41 return (result);
42}
43
44} // end of namespace isc::radius
45} // end of namespace isc
Element::createMap
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
Definition data.cc:304
Element::createList
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
Definition data.cc:299
isc::radius::RadiusService::peer_updates_
bool peer_updates_
Peer updates flag.
Definition radius_service.h:47
isc::radius::RadiusService::attributes_
CfgAttributes attributes_
Attribute configurations.
Definition radius_service.h:53
isc::radius::RadiusService::enabled_
bool enabled_
Enable flag.
Definition radius_service.h:44
isc::radius::RadiusService::RadiusService
RadiusService(const std::string &name)
Constructor.
Definition radius_service.cc:18
isc::radius::RadiusService::toElement
data::ElementPtr toElement() const override
Unparse service configuration.
Definition radius_service.cc:24
isc::radius::RadiusService::max_pending_requests_
size_t max_pending_requests_
Maximum number of pending requests.
Definition radius_service.h:56
isc::radius::RadiusService::servers_
Servers servers_
Server list.
Definition radius_service.h:50
isc::radius::RadiusService::name_
std::string name_
Name (access or accounting).
Definition radius_service.h:41
isc::data
Definition base_stamped_element.cc:12
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
isc::radius
Definition cfg_attribute.cc:21
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
radius_service.h