22namespace ph = std::placeholders;
41 request, maxretries, servers,
52 send_attrs = request->getAttributes();
55 .arg(send_attrs ? send_attrs->toText() :
"no attributes");
67 int result = exchange->getRC();
68 if (result ==
OK_RC) {
77 resp_attrs = response->getAttributes();
78 code = response->getCode();
84 .arg(
static_cast<unsigned>(code))
85 .arg(resp_attrs ? resp_attrs->toText() :
"no attributes");
100 exchange->shutdown();
114 "to-be-set", attrs));
118 request, maxretries, servers,
129 send_attrs = request->getAttributes();
132 .arg(send_attrs ? send_attrs->toText() :
"no attributes");
144 int result = exchange->getRC();
145 if (result ==
OK_RC) {
150 MessagePtr response = exchange->getResponse();
154 resp_attrs = response->getAttributes();
155 code = response->getCode();
161 .arg(
static_cast<unsigned>(code))
162 .arg(resp_attrs ? resp_attrs->toText() :
"no attributes");
177 exchange->shutdown();
191 "to-be-set", attrs));
195 request, maxretries, servers,
206 send_attrs = request->getAttributes();
209 .arg(send_attrs ? send_attrs->toText() :
"no attributes");
221 int result = exchange->getRC();
222 if (result ==
OK_RC) {
226 MessagePtr response = exchange->getResponse();
230 resp_attrs = response->getAttributes();
231 code = response->getCode();
237 .arg(
static_cast<unsigned>(code))
238 .arg(resp_attrs ? resp_attrs->toText() :
"no attributes");
Collection of attributes.
static ExchangePtr create(const asiolink::IOServicePtr io_service, const MessagePtr &request, unsigned maxretries, const Servers &servers, Handler handler, RadiusProtocol protocol=PW_PROTO_UDP)
Factory.
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.
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.
boost::shared_ptr< RadiusTls > tls_
Pointer to tls (never null).
void setAccountingIdleTimer()
Set the accounting idle timer.
void unregisterExchange(ExchangePtr exchange)
Unregister Exchange.
boost::shared_ptr< RadiusAccess > auth_
Pointer to access (never null).
boost::shared_ptr< RadiusAccounting > acct_
Pointer to accounting (never null).
unsigned retries_
Retries.
void setAccessIdleTimer()
Set the access idle timer.
static RadiusImpl & instance()
RadiusImpl is a singleton class.
virtual void start()
Start communication.
RadiusStatus()
Constructor.
ExchangePtr exchange_
Exchange.
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.
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
std::function< void(int)> CallbackStatus
Type of callback for status termination.
const isc::log::MessageID RADIUS_AUTHENTICATION_STATUS
boost::shared_ptr< Attributes > AttributesPtr
Shared pointers to attribute collection.
const isc::log::MessageID RADIUS_TLS_STATUS_SUCCEED
const isc::log::MessageID RADIUS_ACCOUNTING_STATUS_FAILED
std::function< void(int)> CallbackAcct
Type of callback for accounting termination.
const isc::log::MessageID RADIUS_TLS_STATUS_FAILED
string exchangeRCtoText(const int rc)
ExchangeRC value -> name function.
const isc::log::MessageID RADIUS_ACCOUNTING_STATUS
std::vector< ServerPtr > Servers
Type of RADIUS server collection.
boost::shared_ptr< Exchange > ExchangePtr
Type of shared pointers to RADIUS exchange object.
string msgCodeToText(const uint8_t code)
MsgCode value -> name function.
const int RADIUS_DBG_TRACE
Radius logging levels.
const isc::log::MessageID RADIUS_AUTHENTICATION_STATUS_ERROR
const isc::log::MessageID RADIUS_AUTHENTICATION_STATUS_SUCCEED
const isc::log::MessageID RADIUS_ACCOUNTING_STATUS_ERROR
const isc::log::MessageID RADIUS_ACCOUNTING_STATUS_SUCCEED
const isc::log::MessageID RADIUS_TLS_STATUS
isc::log::Logger radius_logger("radius-hooks")
Radius Logger.
boost::shared_ptr< Message > MessagePtr
Shared pointers to message.
const isc::log::MessageID RADIUS_AUTHENTICATION_STATUS_FAILED
const isc::log::MessageID RADIUS_TLS_STATUS_ERROR
Defines the logger used by the top-level component of kea-lfc.