uint64_t dropped;
} fr_io_stats_t;
-/**
- * Tell an async process function if it should run or exit.
- */
-typedef enum {
- FR_IO_ACTION_INVALID = 0,
- FR_IO_ACTION_RUN,
- FR_IO_ACTION_DONE,
- FR_IO_ACTION_DUP,
-} fr_io_action_t;
-
/**
* Answer from an async process function if the worker should yield,
* reply, or drop the request.
* for the #fr_app_worker_t that gave us the
* entry point.
*/
-typedef fr_io_final_t (*fr_io_process_t)(void const *instance, REQUEST *request, fr_io_action_t action);
+typedef fr_io_final_t (*fr_io_process_t)(void const *instance, REQUEST *request);
/*
* Structures and definitions for the master IO handler.
if ((*request->async->original_recv_time == request->async->recv_time) &&
(request->async->fake ||
fr_channel_active(request->async->channel))) {
- final = request->async->process(request->async->process_inst, request, FR_IO_ACTION_RUN);
+ final = request->async->process(request->async->process_inst, request);
} else {
unlang_interpret_signal(request, FR_SIGNAL_CANCEL);
}
RDEBUG("server %s {", cf_section_name2(request->server_cs));
- final = request->async->process(request->async->process_inst, request, FR_IO_ACTION_RUN);
+ final = request->async->process(request->async->process_inst, request);
RDEBUG("} # server %s", cf_section_name2(request->server_cs));
fr_cond_assert(final == FR_IO_REPLY);
int fr_app_process_bootstrap(CONF_SECTION *server, dl_instance_t **type_submodule, CONF_SECTION *conf);
int fr_app_process_instantiate(CONF_SECTION *server, dl_instance_t **type_submodule, dl_instance_t **type_submodule_by_code, int code_max, CONF_SECTION *conf);
+
+/** Module methods which are allowed in virtual servers.
+ *
+ */
+typedef struct {
+ char const *name;
+ char const *name2;
+} virtual_server_method_t;
+
typedef struct {
char const *name;
char const *name2;
rlm_components_t component;
+ virtual_server_method_t *methods;
} virtual_server_compile_t;
#define COMPILE_TERMINATOR { .name = NULL, .name2 = NULL }
* (e.g. Access-Request -> Accounting-Request) unless
* we're in a subrequest.
*/
- final = request->async->process(request->async->process_inst, request, FR_IO_ACTION_RUN);
+ final = request->async->process(request->async->process_inst, request);
RDEBUG("} # server %s", server);
*
* This is a shim function added to 'fake' requests by the subrequest and parallel keywords.
*/
-fr_io_final_t unlang_io_process_interpret(UNUSED void const *instance, REQUEST *request, fr_io_action_t action)
+fr_io_final_t unlang_io_process_interpret(UNUSED void const *instance, REQUEST *request)
{
rlm_rcode_t rcode;
REQUEST_VERIFY(request);
- /*
- * Pass this through asynchronously to the module which
- * is waiting for something to happen.
- */
- if (action != FR_IO_ACTION_RUN) {
- unlang_interpret_signal(request, (fr_state_signal_t) action);
- return FR_IO_DONE;
- }
-
rcode = unlang_interpret_resume(request);
if (request->master_state == REQUEST_STOP_PROCESSING) return FR_IO_DONE;
*
* @{
*/
-fr_io_final_t unlang_io_process_interpret(UNUSED void const *instance, REQUEST *request, fr_io_action_t action);
+fr_io_final_t unlang_io_process_interpret(UNUSED void const *instance, REQUEST *request);
REQUEST *unlang_io_subrequest_alloc(REQUEST *parent, fr_dict_t const *namespace, bool detachable);
{ NULL }
};
-static fr_io_final_t mod_process(void const *instance, REQUEST *request, fr_io_action_t action)
+static fr_io_final_t mod_process(void const *instance, REQUEST *request)
{
VALUE_PAIR *vp;
rlm_rcode_t rcode;
REQUEST_VERIFY(request);
- /*
- * Pass this through asynchronously to the module which
- * is waiting for something to happen.
- */
- if (action != FR_IO_ACTION_RUN) {
- unlang_interpret_signal(request, (fr_state_signal_t) action);
- return FR_IO_DONE;
- }
-
switch (request->request_state) {
case REQUEST_INIT:
RDEBUG("Received %s ID %i",
}
}
-static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, UNUSED fr_io_action_t action)
+static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request)
{
rlm_rcode_t rcode;
CONF_SECTION *unlang;
};
-static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, fr_io_action_t action)
+static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request)
{
VALUE_PAIR *vp;
rlm_rcode_t rcode;
REQUEST_VERIFY(request);
- /*
- * Pass this through asynchronously to the module which
- * is waiting for something to happen.
- */
- if (action != FR_IO_ACTION_RUN) {
- unlang_interpret_signal(request, (fr_state_signal_t) action);
- return FR_IO_DONE;
- }
-
switch (request->request_state) {
case REQUEST_INIT:
if (request->parent && RDEBUG_ENABLED) {
talloc_free(msg);
}
-static fr_io_final_t mod_process(void const *instance, REQUEST *request, fr_io_action_t action)
+static fr_io_final_t mod_process(void const *instance, REQUEST *request)
{
proto_radius_auth_t const *inst = instance;
VALUE_PAIR *vp, *auth_type;
REQUEST_VERIFY(request);
- /*
- * Pass this through asynchronously to the module which
- * is waiting for something to happen.
- */
- if (action != FR_IO_ACTION_RUN) {
- unlang_interpret_signal(request, (fr_state_signal_t) action);
- return FR_IO_DONE;
- }
-
switch (request->request_state) {
case REQUEST_INIT:
if (request->parent && RDEBUG_ENABLED) {
{ NULL }
};
-static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, fr_io_action_t action)
+static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request)
{
VALUE_PAIR *vp;
rlm_rcode_t rcode;
REQUEST_VERIFY(request);
- /*
- * Pass this through asynchronously to the module which
- * is waiting for something to happen.
- */
- if (action != FR_IO_ACTION_RUN) {
- unlang_interpret_signal(request, (fr_state_signal_t) action);
- return FR_IO_DONE;
- }
-
switch (request->request_state) {
case REQUEST_INIT:
if (request->parent && RDEBUG_ENABLED) {
{ NULL }
};
-static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, fr_io_action_t action)
+static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request)
{
rlm_rcode_t rcode;
CONF_SECTION *unlang;
REQUEST_VERIFY(request);
- /*
- * Pass this through asynchronously to the module which
- * is waiting for something to happen.
- */
- if (action != FR_IO_ACTION_RUN) {
- unlang_interpret_signal(request, (fr_state_signal_t) action);
- return FR_IO_DONE;
- }
-
switch (request->request_state) {
case REQUEST_INIT:
request->component = "radius";
{ NULL }
};
-static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, fr_io_action_t action)
+static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request)
{
rlm_rcode_t rcode;
CONF_SECTION *unlang;
REQUEST_VERIFY(request);
- /*
- * Pass this through asynchronously to the module which
- * is waiting for something to happen.
- */
- if (action != FR_IO_ACTION_RUN) {
- unlang_interpret_signal(request, (fr_state_signal_t) action);
- return FR_IO_DONE;
- }
-
switch (request->request_state) {
case REQUEST_INIT:
if (request->parent && RDEBUG_ENABLED) {
{ NULL }
};
-static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, UNUSED fr_io_action_t action)
+static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request)
{
rlm_rcode_t rcode;
CONF_SECTION *unlang;
#define CLIENT_ADD (1)
#define CLIENT_NAK (257)
-static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, fr_io_action_t action)
+static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request)
{
rlm_rcode_t rcode;
CONF_SECTION *unlang;
REQUEST_VERIFY(request);
- /*
- * Pass this through asynchronously to the module which
- * is waiting for something to happen.
- */
- if (action != FR_IO_ACTION_RUN) {
- unlang_interpret_signal(request, (fr_state_signal_t) action);
- return FR_IO_DONE;
- }
-
switch (request->request_state) {
case REQUEST_INIT:
RDEBUG("Received %s ID %i", fr_vmps_codes[request->packet->code], request->packet->id);