20namespace ph = std::placeholders;
39 request, maxretries, servers,
50 send_attrs = request->getAttributes();
53 .arg(send_attrs ? send_attrs->toText() :
"no attributes");
65 int result = exchange->getRC();
66 if (result ==
OK_RC) {
75 resp_attrs = response->getAttributes();
76 code = response->getCode();
82 .arg(
static_cast<unsigned>(code))
83 .arg(resp_attrs ? resp_attrs->toText() :
"no attributes");
112 "to-be-set", attrs));
116 request, maxretries, servers,
127 send_attrs = request->getAttributes();
130 .arg(send_attrs ? send_attrs->toText() :
"no attributes");
142 int result = exchange->getRC();
143 if (result ==
OK_RC) {
148 MessagePtr response = exchange->getResponse();
152 resp_attrs = response->getAttributes();
153 code = response->getCode();
159 .arg(
static_cast<unsigned>(code))
160 .arg(resp_attrs ? resp_attrs->toText() :
"no attributes");
175 exchange->shutdown();
189 "to-be-set", attrs));
193 request, maxretries, servers,
204 send_attrs = request->getAttributes();
207 .arg(send_attrs ? send_attrs->toText() :
"no attributes");
219 int result = exchange->getRC();
220 if (result ==
OK_RC) {
224 MessagePtr response = exchange->getResponse();
228 resp_attrs = response->getAttributes();
229 code = response->getCode();
235 .arg(
static_cast<unsigned>(code))
236 .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.