From: Alan T. DeKok Date: Mon, 28 May 2018 00:41:15 +0000 (-0400) Subject: s/fr_app_process_t/fr_app_worker_t/ X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f242c8ede12bc3daa6d6f2e583d80975224c9bee;p=thirdparty%2Ffreeradius-server.git s/fr_app_process_t/fr_app_worker_t/ This structure is called by the worker to process a particular application --- diff --git a/src/lib/io/application.h b/src/lib/io/application.h index 303eafdba50..cbfc32ada81 100644 --- a/src/lib/io/application.h +++ b/src/lib/io/application.h @@ -123,8 +123,8 @@ typedef struct { ///< to all #fr_app_io_t can be performed by the #fr_app_t. fr_app_entry_point_set_t entry_point_set;//!< Callback to Set the entry point into the state machine - ///< provided by the fr_app_process_t. - ///< We need a function this as the #fr_app_process_t might + ///< provided by the fr_app_worker_t. + ///< We need a function this as the #fr_app_worker_t might ///< change based on the packet we received. fr_app_priority_get_t priority; //!< Assign a priority to the packet. @@ -132,7 +132,7 @@ typedef struct { /** Public structure describing an application (protocol) specialisation * - * The fr_app_process_t provides the state machine that's used to process + * The fr_app_worker_t provides the state machine that's used to process * the packet after its been decoded. */ typedef struct { @@ -141,7 +141,7 @@ typedef struct { fr_app_bootstrap_t bootstrap; fr_app_instantiate_t instantiate; fr_io_process_t entry_point; //!< Entry point into the protocol subtype's state machine. -} fr_app_process_t; +} fr_app_worker_t; /** Public structure describing an I/O path for a protocol * diff --git a/src/lib/io/io.h b/src/lib/io/io.h index c0d1b5efce1..8a1141f351a 100644 --- a/src/lib/io/io.h +++ b/src/lib/io/io.h @@ -306,8 +306,8 @@ typedef int (*fr_io_signal_t)(void const *instance); /** Process a request through the transport async state machine. * - * @param[in] instance Usually the #fr_app_process_t instance data. - * for the #fr_app_process_t that gave us the + * @param[in] instance Usually the #fr_app_worker_t instance data. + * 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); diff --git a/src/modules/proto_detail/proto_detail.c b/src/modules/proto_detail/proto_detail.c index a5b8f8045d6..f626538cfeb 100644 --- a/src/modules/proto_detail/proto_detail.c +++ b/src/modules/proto_detail/proto_detail.c @@ -389,12 +389,12 @@ static ssize_t mod_encode(UNUSED void const *instance, REQUEST *request, uint8_t static void mod_entry_point_set(void const *instance, REQUEST *request) { proto_detail_t const *inst = talloc_get_type_abort_const(instance, proto_detail_t); - fr_app_process_t const *app_process; + fr_app_worker_t const *app_process; /* * Only one "process" function: proto_detail_process. */ - app_process = (fr_app_process_t const *)inst->type_submodule->module->common; + app_process = (fr_app_worker_t const *)inst->type_submodule->module->common; request->server_cs = inst->server_cs; request->async->process = app_process->entry_point; @@ -522,9 +522,9 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf) * Instantiate the process module. */ while ((cp = cf_pair_find_next(conf, cp, "type"))) { - fr_app_process_t const *app_process; + fr_app_worker_t const *app_process; - app_process = (fr_app_process_t const *)inst->type_submodule->module->common; + app_process = (fr_app_worker_t const *)inst->type_submodule->module->common; if (app_process->instantiate && (app_process->instantiate(inst->type_submodule->data, inst->type_submodule->conf) < 0)) { cf_log_err(conf, "Instantiation failed for \"%s\"", app_process->name); @@ -588,7 +588,7 @@ static int mod_bootstrap(void *instance, CONF_SECTION *conf) */ while ((cp = cf_pair_find_next(conf, cp, "type"))) { dl_t const *module = talloc_get_type_abort_const(inst->type_submodule->module, dl_t); - fr_app_process_t const *app_process = (fr_app_process_t const *)module->common; + fr_app_worker_t const *app_process = (fr_app_worker_t const *)module->common; if (app_process->bootstrap && (app_process->bootstrap(inst->type_submodule->data, inst->type_submodule->conf) < 0)) { diff --git a/src/modules/proto_detail/proto_detail_process.c b/src/modules/proto_detail/proto_detail_process.c index 268a104c599..49eec3d7f5e 100644 --- a/src/modules/proto_detail/proto_detail_process.c +++ b/src/modules/proto_detail/proto_detail_process.c @@ -231,8 +231,8 @@ static int mod_instantiate(void *instance, CONF_SECTION *listen_cs) return 0; } -extern fr_app_process_t proto_detail_process; -fr_app_process_t proto_detail_process = { +extern fr_app_worker_t proto_detail_process; +fr_app_worker_t proto_detail_process = { .magic = RLM_MODULE_INIT, .name = "detail_process", .inst_size = sizeof(proto_detail_process_t), diff --git a/src/modules/proto_dhcpv4/proto_dhcpv4.c b/src/modules/proto_dhcpv4/proto_dhcpv4.c index 1c3664342c1..5528aa09a0d 100644 --- a/src/modules/proto_dhcpv4/proto_dhcpv4.c +++ b/src/modules/proto_dhcpv4/proto_dhcpv4.c @@ -429,9 +429,9 @@ static void mod_entry_point_set(void const *instance, REQUEST *request) * 'track' can be NULL when there's no network listener. */ if (inst->io.app_io && (track->dynamic == request->async->recv_time)) { - fr_app_process_t const *app_process; + fr_app_worker_t const *app_process; - app_process = (fr_app_process_t const *) inst->dynamic_submodule->module->common; + app_process = (fr_app_worker_t const *) inst->dynamic_submodule->module->common; request->async->process = app_process->entry_point; track->dynamic = 0; @@ -444,7 +444,7 @@ static void mod_entry_point_set(void const *instance, REQUEST *request) return; } - request->async->process = ((fr_app_process_t const *)type_submodule->module->common)->entry_point; + request->async->process = ((fr_app_worker_t const *)type_submodule->module->common)->entry_point; request->async->process_inst = type_submodule->data; } @@ -650,11 +650,11 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf) */ i = 0; while ((cp = cf_pair_find_next(conf, cp, "type"))) { - fr_app_process_t const *app_process; + fr_app_worker_t const *app_process; fr_dict_enum_t const *enumv; int code; - app_process = (fr_app_process_t const *)inst->type_submodule[i]->module->common; + app_process = (fr_app_worker_t const *)inst->type_submodule[i]->module->common; if (app_process->instantiate && (app_process->instantiate(inst->type_submodule[i]->data, inst->type_submodule[i]->conf) < 0)) { cf_log_err(conf, "Instantiation failed for \"%s\"", app_process->name); @@ -715,9 +715,9 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf) * Instantiate proto_dhcpv4_dynamic_client */ { - fr_app_process_t const *app_process; + fr_app_worker_t const *app_process; - app_process = (fr_app_process_t const *)inst->dynamic_submodule->module->common; + app_process = (fr_app_worker_t const *)inst->dynamic_submodule->module->common; if (app_process->instantiate && (app_process->instantiate(inst->dynamic_submodule->data, conf) < 0)) { cf_log_err(conf, "Instantiation failed for \"%s\"", app_process->name); return -1; @@ -759,7 +759,7 @@ static int mod_bootstrap(void *instance, CONF_SECTION *conf) while ((cp = cf_pair_find_next(conf, cp, "type"))) { char const *value; dl_t const *module = talloc_get_type_abort_const(inst->type_submodule[i]->module, dl_t); - fr_app_process_t const *app_process = (fr_app_process_t const *)module->common; + fr_app_worker_t const *app_process = (fr_app_worker_t const *)module->common; if (app_process->bootstrap && (app_process->bootstrap(inst->type_submodule[i]->data, inst->type_submodule[i]->conf) < 0)) { diff --git a/src/modules/proto_dhcpv4/proto_dhcpv4_base.c b/src/modules/proto_dhcpv4/proto_dhcpv4_base.c index 5331c176861..ce5706bf111 100644 --- a/src/modules/proto_dhcpv4/proto_dhcpv4_base.c +++ b/src/modules/proto_dhcpv4/proto_dhcpv4_base.c @@ -223,8 +223,8 @@ static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, } -extern fr_app_process_t proto_dhcpv4_base; -fr_app_process_t proto_dhcpv4_base = { +extern fr_app_worker_t proto_dhcpv4_base; +fr_app_worker_t proto_dhcpv4_base = { .magic = RLM_MODULE_INIT, .name = "dhcpv4_base", .entry_point = mod_process, diff --git a/src/modules/proto_radius/proto_radius.c b/src/modules/proto_radius/proto_radius.c index 020fd941862..67c93179301 100644 --- a/src/modules/proto_radius/proto_radius.c +++ b/src/modules/proto_radius/proto_radius.c @@ -515,9 +515,9 @@ static void mod_entry_point_set(void const *instance, REQUEST *request) * 'track' can be NULL when there's no network listener. */ if (inst->io.app_io && (track->dynamic == request->async->recv_time)) { - fr_app_process_t const *app_process; + fr_app_worker_t const *app_process; - app_process = (fr_app_process_t const *) inst->dynamic_submodule->module->common; + app_process = (fr_app_worker_t const *) inst->dynamic_submodule->module->common; request->async->process = app_process->entry_point; request->async->process_inst = inst->dynamic_submodule; @@ -531,7 +531,7 @@ static void mod_entry_point_set(void const *instance, REQUEST *request) return; } - request->async->process = ((fr_app_process_t const *)type_submodule->module->common)->entry_point; + request->async->process = ((fr_app_worker_t const *)type_submodule->module->common)->entry_point; request->async->process_inst = type_submodule->data; } @@ -765,11 +765,11 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf) */ i = 0; while ((cp = cf_pair_find_next(conf, cp, "type"))) { - fr_app_process_t const *app_process; + fr_app_worker_t const *app_process; fr_dict_enum_t const *enumv; int code; - app_process = (fr_app_process_t const *)inst->type_submodule[i]->module->common; + app_process = (fr_app_worker_t const *)inst->type_submodule[i]->module->common; if (app_process->instantiate && (app_process->instantiate(inst->type_submodule[i]->data, inst->type_submodule[i]->conf) < 0)) { cf_log_err(conf, "Instantiation failed for \"%s\"", app_process->name); @@ -827,9 +827,9 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf) * Instantiate proto_radius_dynamic_client */ { - fr_app_process_t const *app_process; + fr_app_worker_t const *app_process; - app_process = (fr_app_process_t const *)inst->dynamic_submodule->module->common; + app_process = (fr_app_worker_t const *)inst->dynamic_submodule->module->common; if (app_process->instantiate && (app_process->instantiate(inst->dynamic_submodule->data, conf) < 0)) { cf_log_err(conf, "Instantiation failed for \"%s\"", app_process->name); return -1; @@ -867,7 +867,7 @@ static int mod_bootstrap(void *instance, CONF_SECTION *conf) while ((cp = cf_pair_find_next(conf, cp, "type"))) { char const *value; dl_t const *module = talloc_get_type_abort_const(inst->type_submodule[i]->module, dl_t); - fr_app_process_t const *app_process = (fr_app_process_t const *)module->common; + fr_app_worker_t const *app_process = (fr_app_worker_t const *)module->common; if (app_process->bootstrap && (app_process->bootstrap(inst->type_submodule[i]->data, inst->type_submodule[i]->conf) < 0)) { diff --git a/src/modules/proto_radius/proto_radius_acct.c b/src/modules/proto_radius/proto_radius_acct.c index 6f7a0f92d8d..b5e478a8f85 100644 --- a/src/modules/proto_radius/proto_radius_acct.c +++ b/src/modules/proto_radius/proto_radius_acct.c @@ -185,8 +185,8 @@ static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, } -extern fr_app_process_t proto_radius_acct; -fr_app_process_t proto_radius_acct = { +extern fr_app_worker_t proto_radius_acct; +fr_app_worker_t proto_radius_acct = { .magic = RLM_MODULE_INIT, .name = "radius_acct", .entry_point = mod_process, diff --git a/src/modules/proto_radius/proto_radius_auth.c b/src/modules/proto_radius/proto_radius_auth.c index c3769007092..cc28e754883 100644 --- a/src/modules/proto_radius/proto_radius_auth.c +++ b/src/modules/proto_radius/proto_radius_auth.c @@ -625,8 +625,8 @@ static int mod_instantiate(UNUSED void *instance, CONF_SECTION *process_app_cs) return 0; } -extern fr_app_process_t proto_radius_auth; -fr_app_process_t proto_radius_auth = { +extern fr_app_worker_t proto_radius_auth; +fr_app_worker_t proto_radius_auth = { .magic = RLM_MODULE_INIT, .name = "radius_auth", .config = proto_radius_auth_config, diff --git a/src/modules/proto_radius/proto_radius_coa.c b/src/modules/proto_radius/proto_radius_coa.c index c4b4bb321fd..8cf991d7b3b 100644 --- a/src/modules/proto_radius/proto_radius_coa.c +++ b/src/modules/proto_radius/proto_radius_coa.c @@ -236,8 +236,8 @@ static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, } -extern fr_app_process_t proto_radius_coa; -fr_app_process_t proto_radius_coa = { +extern fr_app_worker_t proto_radius_coa; +fr_app_worker_t proto_radius_coa = { .magic = RLM_MODULE_INIT, .name = "radius_coa", .entry_point = mod_process, diff --git a/src/modules/proto_radius/proto_radius_dynamic_client.c b/src/modules/proto_radius/proto_radius_dynamic_client.c index b629be97e33..24e50b3a12c 100644 --- a/src/modules/proto_radius/proto_radius_dynamic_client.c +++ b/src/modules/proto_radius/proto_radius_dynamic_client.c @@ -234,8 +234,8 @@ static int mod_instantiate(UNUSED void *instance, CONF_SECTION *listen_cs) return 0; } -extern fr_app_process_t proto_radius_dynamic_client; -fr_app_process_t proto_radius_dynamic_client = { +extern fr_app_worker_t proto_radius_dynamic_client; +fr_app_worker_t proto_radius_dynamic_client = { .magic = RLM_MODULE_INIT, .name = "radius_dynamic_client", .instantiate = mod_instantiate, diff --git a/src/modules/proto_radius/proto_radius_status.c b/src/modules/proto_radius/proto_radius_status.c index 128ea920d57..dd92ffa2216 100644 --- a/src/modules/proto_radius/proto_radius_status.c +++ b/src/modules/proto_radius/proto_radius_status.c @@ -197,8 +197,8 @@ static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, } -extern fr_app_process_t proto_radius_status; -fr_app_process_t proto_radius_status = { +extern fr_app_worker_t proto_radius_status; +fr_app_worker_t proto_radius_status = { .magic = RLM_MODULE_INIT, .name = "radius_status", .entry_point = mod_process, diff --git a/src/modules/proto_vmps/proto_vmps.c b/src/modules/proto_vmps/proto_vmps.c index 2778947f572..f5549549689 100644 --- a/src/modules/proto_vmps/proto_vmps.c +++ b/src/modules/proto_vmps/proto_vmps.c @@ -385,9 +385,9 @@ static void mod_entry_point_set(void const *instance, REQUEST *request) * 'track' can be NULL when there's no network listener. */ if (inst->io.app_io && (track->dynamic == request->async->recv_time)) { - fr_app_process_t const *app_process; + fr_app_worker_t const *app_process; - app_process = (fr_app_process_t const *) inst->dynamic_submodule->module->common; + app_process = (fr_app_worker_t const *) inst->dynamic_submodule->module->common; request->async->process = app_process->entry_point; track->dynamic = 0; @@ -589,10 +589,10 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf) */ i = 0; while ((cp = cf_pair_find_next(conf, cp, "type"))) { - fr_app_process_t const *app_process; + fr_app_worker_t const *app_process; fr_dict_enum_t const *enumv; - app_process = (fr_app_process_t const *)inst->type_submodule[i]->module->common; + app_process = (fr_app_worker_t const *)inst->type_submodule[i]->module->common; if (app_process->instantiate && (app_process->instantiate(inst->type_submodule[i]->data, inst->type_submodule[i]->conf) < 0)) { cf_log_err(conf, "Instantiation failed for \"%s\"", app_process->name); @@ -652,9 +652,9 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf) * Instantiate proto_vmps_dynamic_client */ { - fr_app_process_t const *app_process; + fr_app_worker_t const *app_process; - app_process = (fr_app_process_t const *)inst->dynamic_submodule->module->common; + app_process = (fr_app_worker_t const *)inst->dynamic_submodule->module->common; if (app_process->instantiate && (app_process->instantiate(inst->dynamic_submodule->data, conf) < 0)) { cf_log_err(conf, "Instantiation failed for \"%s\"", app_process->name); return -1; @@ -696,7 +696,7 @@ static int mod_bootstrap(void *instance, CONF_SECTION *conf) while ((cp = cf_pair_find_next(conf, cp, "type"))) { char const *value; dl_t const *module = talloc_get_type_abort_const(inst->type_submodule[i]->module, dl_t); - fr_app_process_t const *app_process = (fr_app_process_t const *)module->common; + fr_app_worker_t const *app_process = (fr_app_worker_t const *)module->common; if (app_process->bootstrap && (app_process->bootstrap(inst->type_submodule[i]->data, inst->type_submodule[i]->conf) < 0)) { diff --git a/src/modules/proto_vmps/proto_vmps_all.c b/src/modules/proto_vmps/proto_vmps_all.c index 1a67f50ad31..b7430bcffb7 100644 --- a/src/modules/proto_vmps/proto_vmps_all.c +++ b/src/modules/proto_vmps/proto_vmps_all.c @@ -193,8 +193,8 @@ static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, } -extern fr_app_process_t proto_vmps_all; -fr_app_process_t proto_vmps_all = { +extern fr_app_worker_t proto_vmps_all; +fr_app_worker_t proto_vmps_all = { .magic = RLM_MODULE_INIT, .name = "vmps_all", .entry_point = mod_process, diff --git a/src/modules/proto_vmps/proto_vmps_dynamic_client.c b/src/modules/proto_vmps/proto_vmps_dynamic_client.c index 717fd88872a..962a833bfa7 100644 --- a/src/modules/proto_vmps/proto_vmps_dynamic_client.c +++ b/src/modules/proto_vmps/proto_vmps_dynamic_client.c @@ -204,8 +204,8 @@ static int mod_instantiate(UNUSED void *instance, CONF_SECTION *listen_cs) return 0; } -extern fr_app_process_t proto_vmps_dynamic_client; -fr_app_process_t proto_vmps_dynamic_client = { +extern fr_app_worker_t proto_vmps_dynamic_client; +fr_app_worker_t proto_vmps_dynamic_client = { .magic = RLM_MODULE_INIT, .name = "vmps_dynamic_client", .instantiate = mod_instantiate,