10 #define LOG_PREFIX inst->name
15 #include <freeradius-devel/server/pool.h>
24 ykclient_handle_done(yandle);
43 ykclient_handle_t *yandle, **marker;
45 status = ykclient_handle_init(
inst->ykc, &yandle);
46 if (status != YKCLIENT_OK) {
47 ERROR(
"%s", ykclient_strerror(status));
51 marker = talloc(ctx, ykclient_handle_t *);
65 if (!
inst->client_id) {
66 ERROR(
"validation.client_id must be set (to a valid id) when validation is enabled");
72 ERROR(
"validation.api_key must be set (to a valid key) when validation is enabled");
77 DEBUG(
"Initialising ykclient");
79 status = ykclient_global_init();
80 if (status != YKCLIENT_OK) {
82 ERROR(
"%s", ykclient_strerror(status));
87 status = ykclient_init(&
inst->ykc);
88 if (status != YKCLIENT_OK)
goto yk_error;
115 status = ykclient_set_url_templates(
inst->ykc,
count,
inst->uris);
116 if (status != YKCLIENT_OK) {
123 status = ykclient_set_client_b64(
inst->ykc,
inst->client_id,
inst->api_key);
124 if (status != YKCLIENT_OK) {
125 ERROR(
"%s", ykclient_strerror(status));
132 ykclient_done(&
inst->ykc);
143 ykclient_done(&
inst->ykc);
144 ykclient_global_done();
150 request_t *request,
char const *passcode)
155 ykclient_handle_t *yandle;
174 ykclient_handle_cleanup(yandle);
176 status = ykclient_request_process(
inst->ykc, yandle, passcode);
177 if (status != YKCLIENT_OK) {
178 REDEBUG(
"%s", ykclient_strerror(status));
180 case YKCLIENT_BAD_OTP:
181 case YKCLIENT_REPLAYED_OTP:
185 case YKCLIENT_NO_SUCH_CLIENT:
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
Configuration AVP similar to a fr_pair_t.
A section grouping multiple CONF_PAIR.
CONF_SECTION * cf_section_find(CONF_SECTION const *cs, char const *name1, char const *name2)
Find a CONF_SECTION with name1 and optionally name2.
CONF_PAIR * cf_pair_find(CONF_SECTION const *cs, char const *attr)
Search for a CONF_PAIR with a specific name.
char const * cf_pair_value(CONF_PAIR const *pair)
Return the value of a CONF_PAIR.
CONF_PAIR * cf_pair_find_next(CONF_SECTION const *cs, CONF_PAIR const *prev, char const *attr)
Find a pair with a name matching attr, after specified pair.
static fr_time_delta_t timeout
static bool is_zero(char const *value)
Check whether the string is all zeros.
module_instance_t const * mi
Instance of the module being instantiated.
Temporary structure to hold arguments for module calls.
fr_pool_t * module_rlm_connection_pool_init(CONF_SECTION *module, void *opaque, fr_pool_connection_create_t c, fr_pool_connection_alive_t a, char const *log_prefix, char const *trigger_prefix, fr_pair_list_t *trigger_args)
Initialise a module specific connection pool.
void fr_pool_connection_release(fr_pool_t *pool, request_t *request, void *conn)
Release a connection.
void fr_pool_free(fr_pool_t *pool)
Delete a connection pool.
void * fr_pool_connection_get(fr_pool_t *pool, request_t *request)
Reserve a connection in the connection pool.
#define RETURN_MODULE_RCODE(_rcode)
rlm_rcode_t
Return codes indicating the result of the module call.
@ RLM_MODULE_OK
The module is OK, continue.
@ RLM_MODULE_FAIL
Module failed, don't reply.
@ RLM_MODULE_REJECT
Immediately reject the request.
@ RLM_MODULE_NOTFOUND
User not found.
static int _mod_conn_free(rlm_cache_memcached_handle_t *mandle)
Free a connection handle.
static void * mod_conn_create(TALLOC_CTX *ctx, void *instance, fr_time_delta_t timeout)
Create a new memcached handle.
int rlm_yubikey_ykclient_init(CONF_SECTION *conf, rlm_yubikey_t *inst)
int rlm_yubikey_ykclient_detach(rlm_yubikey_t *inst)
unlang_action_t rlm_yubikey_validate(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request, char const *passcode)
void * data
Module's instance data.
init
Enter the EAP-IDENTITY state.
eap_aka_sim_process_conf_t * inst
#define talloc_get_type_abort_const
A time delta, a difference in time measured in nanoseconds.