* @param[in] rctx a local context for the callback.
* @return a normal rlm_rcode_t.
*/
-typedef rlm_rcode_t (*fr_module_unlang_resume_t)(REQUEST *request, void *instance, void *thread, void *rctx);
+typedef rlm_rcode_t (*fr_unlang_module_resume_t)(REQUEST *request, void *instance, void *thread, void *rctx);
/** A callback when the request gets a fr_state_signal_t.
*
* @param[in] rctx Resume ctx for the callback.
* @param[in] action which is signalling the request.
*/
-typedef void (*fr_module_unlang_signal_t)(REQUEST *request, void *instance, void *thread,
+typedef void (*fr_unlang_module_signal_t)(REQUEST *request, void *instance, void *thread,
void *rctx, fr_state_signal_t action);
/** Struct exported by a rlm_* module
void fr_request_async_bootstrap(REQUEST *request, fr_event_list_t *el); /* for unit_test_module */
/*
- * module_unlang.c
+ * unlang_module.c
*/
int unlang_event_module_timeout_add(REQUEST *request, fr_unlang_module_timeout_t callback,
void const *ctx, struct timeval *timeout);
int unlang_event_fd_delete(REQUEST *request, void const *ctx, int fd);
-rlm_rcode_t module_unlang_push_xlat(TALLOC_CTX *ctx, fr_value_box_t **out,
+rlm_rcode_t unlang_module_push_xlat(TALLOC_CTX *ctx, fr_value_box_t **out,
REQUEST *request, xlat_exp_t const *xlat,
- fr_module_unlang_resume_t callback,
- fr_module_unlang_signal_t signal_callback, void *uctx);
+ fr_unlang_module_resume_t callback,
+ fr_unlang_module_signal_t signal_callback, void *uctx);
-rlm_rcode_t unlang_module_yield(REQUEST *request, fr_module_unlang_resume_t callback,
- fr_module_unlang_signal_t signal_callback, void *ctx);
+rlm_rcode_t unlang_module_yield(REQUEST *request, fr_unlang_module_resume_t callback,
+ fr_unlang_module_signal_t signal_callback, void *ctx);
-void module_unlang_init(void);
+void unlang_module_init(void);
#ifdef __cplusplus
}
#endif
int i;
if(c->type==UNLANG_TYPE_MODULE_CALL) {
- module_unlang_call_t *single = unlang_generic_to_module_call(c);
+ unlang_module_call_t *single = unlang_generic_to_module_call(c);
DEBUG("%.*s%s {", indent, "\t\t\t\t\t\t\t\t\t\t\t",
single->module_instance->name);
} else if ((c->type > UNLANG_TYPE_MODULE_CALL) && (c->type <= UNLANG_TYPE_POLICY)) {
break;
case UNLANG_TYPE_MODULE_CALL: {
- module_unlang_call_t *single = unlang_generic_to_module_call(this);
+ unlang_module_call_t *single = unlang_generic_to_module_call(this);
DEBUG("%.*s%s", depth, modcall_spaces,
single->module_instance->name);
static unlang_t *compile_module(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_ITEM *ci, module_instance_t *this, unlang_group_type_t parentgroup_type, char const *realname)
{
unlang_t *c;
- module_unlang_call_t *single;
+ unlang_module_call_t *single;
/*
* Check if the module in question has the necessary
return NULL;
}
- single = talloc_zero(parent, module_unlang_call_t);
+ single = talloc_zero(parent, unlang_module_call_t);
single->module_instance = this;
single->method = this->module->methods[unlang_ctx->component];
- c = module_unlang_call_to_generic(single);
+ c = unlang_module_call_to_generic(single);
c->parent = parent;
c->next = NULL;
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
unlang_event_t *ev;
- module_unlang_call_t *sp;
+ unlang_module_call_t *sp;
unlang_frame_state_modcall_t *ms = talloc_get_type_abort(frame->state,
unlang_frame_state_modcall_t);
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
unlang_event_t *ev;
- module_unlang_call_t *sp;
+ unlang_module_call_t *sp;
unlang_frame_state_modcall_t *ms = talloc_get_type_abort(frame->state,
unlang_frame_state_modcall_t);
* This is typically called via an "async" action, i.e. an action
* outside of the normal processing of the request.
*
- * If there is no #fr_module_unlang_signal_t callback defined, the action is ignored.
+ * If there is no #fr_unlang_module_signal_t callback defined, the action is ignored.
*
* @param[in] request The current request.
* @param[in] action to signal.
* - RLM_MODULE_FAIL (or asserts) if the current frame is not a module call or
* resume frame.
*/
-rlm_rcode_t unlang_module_yield(REQUEST *request, fr_module_unlang_resume_t callback,
- fr_module_unlang_signal_t cancel, void *rctx)
+rlm_rcode_t unlang_module_yield(REQUEST *request, fr_unlang_module_resume_t callback,
+ fr_unlang_module_signal_t cancel, void *rctx)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
if (instance->mutex) pthread_mutex_unlock(instance->mutex);
}
-static unlang_action_t module_unlang_call(REQUEST *request,
+static unlang_action_t unlang_module_call(REQUEST *request,
rlm_rcode_t *presult, int *priority)
{
- module_unlang_call_t *sp;
+ unlang_module_call_t *sp;
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
unlang_t *instruction = frame->instruction;
* This is typically called via an "async" action, i.e. an action
* outside of the normal processing of the request.
*
- * If there is no #fr_module_unlang_signal_t callback defined, the action is ignored.
+ * If there is no #fr_unlang_module_signal_t callback defined, the action is ignored.
*
* @param[in] request The current request.
- * @param[in] rctx createed by #module_unlang_call.
+ * @param[in] rctx createed by #unlang_module_call.
* @param[in] action to signal.
*/
-static void module_unlang_signal(REQUEST *request, void *rctx, fr_state_signal_t action)
+static void unlang_module_signal(REQUEST *request, void *rctx, fr_state_signal_t action)
{
unlang_stack_frame_t *frame;
unlang_stack_t *stack = request->stack;
unlang_resume_t *mr;
- module_unlang_call_t *mc;
+ unlang_module_call_t *mc;
char const *caller;
unlang_frame_state_modcall_t *ms = NULL;
caller = request->module;
request->module = mc->module_instance->name;
- ((fr_module_unlang_signal_t)mr->signal)(request,
+ ((fr_unlang_module_signal_t)mr->signal)(request,
mc->module_instance->dl_inst->data, ms->thread->data,
rctx, action);
request->module = caller;
}
-static unlang_action_t module_unlang_resume(REQUEST *request, rlm_rcode_t *presult, UNUSED void *rctx)
+static unlang_action_t unlang_module_resume(REQUEST *request, rlm_rcode_t *presult, UNUSED void *rctx)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
unlang_t *instruction = frame->instruction;
unlang_resume_t *mr = unlang_generic_to_resume(instruction);
- module_unlang_call_t *mc = unlang_generic_to_module_call(mr->parent);
+ unlang_module_call_t *mc = unlang_generic_to_module_call(mr->parent);
int stack_depth = stack->depth;
char const *caller;
caller = request->module;
request->module = mc->module_instance->name;
safe_lock(mc->module_instance);
- *presult = request->rcode = ((fr_module_unlang_resume_t)mr->callback)(request,
+ *presult = request->rcode = ((fr_unlang_module_resume_t)mr->callback)(request,
mc->module_instance->dl_inst->data,
ms->thread->data, mr->rctx);
safe_unlock(mc->module_instance);
* @return
* - RLM_MODULE_YIELD.
*/
-rlm_rcode_t module_unlang_push_xlat(TALLOC_CTX *ctx, fr_value_box_t **out,
+rlm_rcode_t unlang_module_push_xlat(TALLOC_CTX *ctx, fr_value_box_t **out,
REQUEST *request, xlat_exp_t const *exp,
- fr_module_unlang_resume_t resume,
- fr_module_unlang_signal_t signal, void *rctx)
+ fr_unlang_module_resume_t resume,
+ fr_unlang_module_signal_t signal, void *rctx)
{
/*
* Push the resumption point
return RLM_MODULE_YIELD; /* This may allow us to do optimisations in future */
}
-void module_unlang_init(void)
+void unlang_module_init(void)
{
unlang_op_register(UNLANG_TYPE_MODULE_CALL,
&(unlang_op_t){
.name = "module",
- .func = module_unlang_call,
- .signal = module_unlang_signal,
- .resume = module_unlang_resume
+ .func = unlang_module_call,
+ .signal = unlang_module_signal,
+ .resume = unlang_module_resume
});
}
case UNLANG_TYPE_MODULE_CALL:
{
module_thread_instance_t *thread;
- module_unlang_call_t *sp;
+ unlang_module_call_t *sp;
sp = unlang_generic_to_module_call(instruction);
rad_assert(sp != NULL);
} else {
module_thread_instance_t *thread;
- module_unlang_call_t *sp;
+ unlang_module_call_t *sp;
sp = unlang_generic_to_module_call(child);
rad_assert(sp != NULL);
});
map_unlang_init();
- module_unlang_init();
+ unlang_module_init();
#endif
}
/** Types of unlang_t nodes
*
- * Here are our basic types: unlang_t, unlang_group_t, and module_unlang_call_t. For an
+ * Here are our basic types: unlang_t, unlang_group_t, and unlang_module_call_t. For an
* explanation of what they are all about, see doc/configurable_failover.rst
*/
typedef enum {
unlang_t self;
module_instance_t *module_instance; //!< Instance of the module we're calling.
module_method_t method;
-} module_unlang_call_t;
+} unlang_module_call_t;
/** Pushed onto the interpreter stack by a yielding module, indicates the resumption point
*
/** @name Conversion functions for converting #unlang_t to its specialisations
*
- * Simple conversions: #module_unlang_call_t and #unlang_group_t are subclasses of #unlang_t,
+ * Simple conversions: #unlang_module_call_t and #unlang_group_t are subclasses of #unlang_t,
* so we often want to go back and forth between them.
*
* @{
*/
-static inline module_unlang_call_t *unlang_generic_to_module_call(unlang_t *p)
+static inline unlang_module_call_t *unlang_generic_to_module_call(unlang_t *p)
{
rad_assert(p->type == UNLANG_TYPE_MODULE_CALL);
- return talloc_get_type_abort(p, module_unlang_call_t);
+ return talloc_get_type_abort(p, unlang_module_call_t);
}
static inline unlang_group_t *unlang_generic_to_group(unlang_t *p)
return (unlang_group_t *)p;
}
-static inline unlang_t *module_unlang_call_to_generic(module_unlang_call_t *p)
+static inline unlang_t *unlang_module_call_to_generic(unlang_module_call_t *p)
{
return (unlang_t *)p;
}