1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (C) 2023-2025 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include <config.h>

#include <radius_service.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.

using namespace std;
using namespace isc;
using namespace isc::data;

namespace isc {
namespace radius {

RadiusService::RadiusService(const std::string& name)
    : name_(name), enabled_(false), peer_updates_(true),
      max_pending_requests_(0) {
}

ElementPtr
RadiusService::toElement() const {
    ElementPtr result = Element::createMap();

    // servers.
    if (!servers_.empty()) {
        ElementPtr servers = Element::createList();
        for (auto const& server : servers_) {
            if (server) {
                servers->add(server->toElement());
            }
        }
        result->set("servers", servers);
    }

    // attributes.
    result->set("attributes", attributes_.toElement());

    return (result);
}

} // end of namespace isc::radius
} // end of namespace isc