Kea 3.1.8
radius_status.h
Go to the documentation of this file.
1// Copyright (C) 2020-2026 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_STATUS_H
8#define RADIUS_STATUS_H
9
10#include <client_exchange.h>
11#include <radius.h>
12#include <dhcp/iface_mgr.h>
13#include <dhcpsrv/subnet_id.h>
14#include <dhcpsrv/timer_mgr.h>
15
16#include <functional>
17#include <sstream>
18
19namespace isc {
20namespace radius {
21
25typedef std::function<void(int)> CallbackStatus;
26
29public:
30
33 }
34
36 virtual ~RadiusStatus() = default;
37
41 virtual void start() {
42 exchange_->start();
43 }
44
46 int getRC() const {
47 return (exchange_->getRC());
48 }
49
54 MessagePtr request = exchange_->getRequest();
55 if (request) {
56 return (request->getAttributes());
57 }
58 return (AttributesPtr());
59 }
60
65 MessagePtr response = exchange_->getResponse();
66 if (response) {
67 return (response->getAttributes());
68 }
69 return (AttributesPtr());
70 }
71
76 return (exchange_);
77 }
78
79protected:
82};
83
88public:
89
94 RadiusAuthStatus(const AttributesPtr& send_attrs,
95 const CallbackStatus& handler);
96
98 virtual ~RadiusAuthStatus() = default;
99
101 virtual void start() override;
102
107 static void invokeCallback(const CallbackStatus& callback,
108 const ExchangePtr exchange);
109};
110
112typedef boost::shared_ptr<RadiusAuthStatus> RadiusAuthStatusPtr;
113
118public:
119
124 RadiusAcctStatus(const AttributesPtr& send_attrs,
125 const CallbackStatus& handler);
126
128 virtual ~RadiusAcctStatus() = default;
129
131 virtual void start() override;
132
137 static void invokeCallback(const CallbackStatus& callback,
138 const ExchangePtr exchange);
139};
140
142typedef boost::shared_ptr<RadiusAcctStatus> RadiusAcctStatusPtr;
143
148public:
149
154 RadiusTlsStatus(const AttributesPtr& send_attrs,
155 const CallbackStatus& handler);
156
158 virtual ~RadiusTlsStatus() = default;
159
161 virtual void start() override;
162
167 static void invokeCallback(const CallbackStatus& callback,
168 const ExchangePtr exchange);
169};
170
172typedef boost::shared_ptr<RadiusTlsStatus> RadiusTlsStatusPtr;
173
174} // end of namespace radius
175} // end of namespace isc
176#endif // RADIUS_STATUS_H
RadiusAcctStatus(const AttributesPtr &send_attrs, const CallbackStatus &handler)
Constructor.
virtual void start() override
Start communication.
static void invokeCallback(const CallbackStatus &callback, const ExchangePtr exchange)
Invoke accounting status callback.
virtual ~RadiusAcctStatus()=default
Destructor.
static void invokeCallback(const CallbackStatus &callback, const ExchangePtr exchange)
Invoke access status callback.
RadiusAuthStatus(const AttributesPtr &send_attrs, const CallbackStatus &handler)
Constructor.
virtual void start() override
Start communication.
virtual ~RadiusAuthStatus()=default
Destructor.
virtual ~RadiusStatus()=default
Destructor.
AttributesPtr getRespAttrs() const
Get response attributes.
int getRC() const
Get the error code.
virtual void start()
Start communication.
ExchangePtr getExchange()
Get the exchange.
AttributesPtr getReqAttrs() const
Get request attributes.
ExchangePtr exchange_
Exchange.
virtual ~RadiusTlsStatus()=default
Destructor.
RadiusTlsStatus(const AttributesPtr &send_attrs, const CallbackStatus &handler)
Constructor.
static void invokeCallback(const CallbackStatus &callback, const ExchangePtr exchange)
Invoke access status callback.
virtual void start() override
Start communication.
std::function< void(int)> CallbackStatus
Type of callback for status termination.
boost::shared_ptr< Attributes > AttributesPtr
Shared pointers to attribute collection.
boost::shared_ptr< RadiusTlsStatus > RadiusTlsStatusPtr
Pointer to access status.
boost::shared_ptr< Exchange > ExchangePtr
Type of shared pointers to RADIUS exchange object.
boost::shared_ptr< RadiusAuthStatus > RadiusAuthStatusPtr
Pointer to access status.
boost::shared_ptr< Message > MessagePtr
Shared pointers to message.
boost::shared_ptr< RadiusAcctStatus > RadiusAcctStatusPtr
Pointer to accounting status.
Defines the logger used by the top-level component of kea-lfc.