typedef int (*fr_app_bootstrap_t)( void *instance, CONF_SECTION *cs);
/** Set the next state executed by the request to be one of the application subtype's entry points
*
+ * @param[in] instance of the #fr_app_t.
* @param[in] request To set the next state function for.
*/
-typedef void (*fr_app_set_process_t)(REQUEST *request, void const *uctx);
+typedef void (*fr_app_set_process_t)(void const *instance, REQUEST *request);
/** Allows submodules to receive uctx data (a structure provided by their parent)
*
fr_app_io_t const *app_io; //!< I/O path functions.
void *app_io_instance; //!< I/O path specific context.
+ fr_app_t const *app;
+ void const *app_instance;
+
fr_io_decode_t decode; //!< Function to decode packet to request (worker)
fr_io_encode_t encode; //!< Function to encode request to packet (worker)
-
- fr_app_set_process_t set_process; //!< Set the state machine entry point for a request.
- void const *app_ctx;
};
/**
* Call the main protocol handlr to set the right async
* process function.
*/
- listen->set_process(request, listen->app_ctx);
+ listen->app->set_process(listen->app_instance, request);
rad_assert(request->async->process != NULL);
return len;
}
-static void mod_set_process(REQUEST *request, void const *instance)
+static void mod_set_process(void const *instance, REQUEST *request)
{
proto_radius_ctx_t const *inst = talloc_get_type_abort(instance, proto_radius_ctx_t);
fr_app_process_t const *process;
listen->app_io = inst->app_io;
listen->app_io_instance = inst->io_submodule->inst;
- listen->set_process = mod_set_process;
- listen->app_ctx = instance;
+ listen->app = &proto_radius;
+ listen->app_instance = instance;
listen->encode = mod_encode;
listen->decode = mod_decode;