*/
typedef struct {
unlang_t self;
- unlang_t *parent; //!< The original instruction.
+ unlang_t *parent; //!< The original instruction.
- fr_unlang_resume_callback_t callback; //!< Function the yielding code indicated should
- //!< be called when the request could be resumed.
+ void *callback; //!< Function the yielding code indicated should
+ //!< be called when the request could be resumed.
- fr_unlang_action_t signal_callback; //!< Function the yielding module indicated should
- //!< be called when the request is poked via an action
- //!< may be removed in future.
+ fr_unlang_action_t signal_callback; //!< Function the yielding module indicated should
+ //!< be called when the request is poked via an action
+ //!< may be removed in future.
-
- void *resume_ctx; //!< Context data for the callback. Usually represents
- //!< the module's internal state at the time of yielding.
- void const *instance; //!< instance data
- void *thread; //!< thread data
+ void *resume_ctx; //!< Context data for the callback. Usually represents
+ ///< the module's internal state at the time of
+ ///< <yielding.
+ void const *instance; //!< instance data
+ void *thread; //!< thread data
} unlang_resume_t;
/** A naked xlat
* @param[in] request the request.
* @param[in] instance the module instance.
* @param[in] thread data specific to this module instance.
- * @param[in] ctx a local context for the callback.
+ * @param[in] rctx a local context for the callback.
* @param[in] fired the time the timeout event actually fired.
*/
-typedef void (*fr_unlang_timeout_callback_t)(REQUEST *request, void *instance, void *thread, void *ctx,
+typedef void (*fr_unlang_timeout_callback_t)(REQUEST *request, void *instance, void *thread, void *rctx,
struct timeval *fired);
/** A callback when the FD is ready for reading
* @param[in] request the current request.
* @param[in] instance the module instance.
* @param[in] thread data specific to this module instance.
- * @param[in] ctx a local context for the callback.
+ * @param[in] rctx a local context for the callback.
* @param[in] fd the file descriptor.
*/
-typedef void (*fr_unlang_fd_callback_t)(REQUEST *request, void *instance, void *thread, void *ctx, int fd);
+typedef void (*fr_unlang_fd_callback_t)(REQUEST *request, void *instance, void *thread, void *rctx, int fd);
/** A callback for when the request is resumed.
*
* @param[in] request the current request.
* @param[in] instance The module instance.
* @param[in] thread data specific to this module instance.
- * @param[in] ctx a local context for the callback.
+ * @param[in] rctx a local context for the callback.
* @return a normal rlm_rcode_t.
*/
-typedef rlm_rcode_t (*fr_unlang_resume_callback_t)(REQUEST *request, void *instance, void *thread, void *ctx);
+typedef rlm_rcode_t (*fr_unlang_resume_callback_t)(REQUEST *request, void *instance, void *thread, void *rctx);
/** A callback when the request gets a fr_state_action_t.
*
* @param[in] request The current request.
* @param[in] instance The module instance.
* @param[in] thread data specific to this module instance.
- * @param[in] ctx for the callback.
+ * @param[in] rctx for the callback.
* @param[in] action which is signalling the request.
*/
-typedef void (*fr_unlang_action_t)(REQUEST *request, void *instance, void *thread, void *ctx,
+typedef void (*fr_unlang_action_t)(REQUEST *request, void *instance, void *thread, void *rctx,
fr_state_action_t action);
/*
* @param[in] request The current request.
* @param[in] callback to call on unlang_resumable().
* @param[in] signal_callback to call on unlang_action().
- * @param[in] ctx to pass to the callbacks.
+ * @param[in] rctx to pass to the callbacks.
* @return
* unlang_resume_t on success
* NULL on error
*/
static unlang_resume_t *unlang_resume_alloc(REQUEST *request,
fr_unlang_resume_callback_t callback,
- fr_unlang_action_t signal_callback, void *ctx)
+ fr_unlang_action_t signal_callback, void *rctx)
{
unlang_resume_t *mr;
unlang_stack_t *stack = request->stack;
*/
mr->callback = callback;
mr->signal_callback = signal_callback;
- mr->resume_ctx = ctx;
+ mr->resume_ctx = rctx;
/*
* Replaces the current stack frame with a RESUME frame.
* @param[in] request The current request.
* @param[in] callback to call on unlang_resumable().
* @param[in] signal_callback to call on unlang_action().
- * @param[in] ctx to pass to the callbacks.
* @return always returns RLM_MODULE_YIELD.
+ * @param[in] rctx to pass to the callbacks.
*/
rlm_rcode_t unlang_module_yield(REQUEST *request, fr_unlang_resume_callback_t callback,
- fr_unlang_action_t signal_callback, void *ctx)
+ fr_unlang_action_t signal_callback, void *rctx)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
*/
sp = unlang_generic_to_module_call(frame->instruction);
- mr = unlang_resume_alloc(request, callback, signal_callback, ctx);
+ mr = unlang_resume_alloc(request, callback, signal_callback, rctx);
rad_assert(mr != NULL);
/*
*/
mr->callback = callback;
mr->signal_callback = signal_callback;
- mr->resume_ctx = ctx;
+ mr->resume_ctx = rctx;
}
return RLM_MODULE_YIELD;