}
-static int mod_instantiate(UNUSED void *instance, CONF_SECTION *listen_cs)
-{
- int rcode;
- CONF_SECTION *server_cs;
-
- rad_assert(listen_cs);
-
- server_cs = cf_item_to_section(cf_parent(listen_cs));
- rad_assert(strcmp(cf_section_name1(server_cs), "server") == 0);
-
- rcode = unlang_compile_subsection(server_cs, "recv", "Accounting-Request", MOD_PREACCT);
- if (rcode < 0) return rcode;
- if (rcode == 0) {
- cf_log_err(server_cs, "Failed finding 'recv Accounting-Request { ... }' section of virtual server %s",
- cf_section_name2(server_cs));
- return -1;
- }
-
- rcode = unlang_compile_subsection(server_cs, "send", "Accounting-Response", MOD_ACCOUNTING);
- if (rcode < 0) return rcode;
-
- rcode = unlang_compile_subsection(server_cs, "send", "Do-Not-Respond", MOD_POST_AUTH);
- if (rcode < 0) return rcode;
-
- rcode = unlang_compile_subsection(server_cs, "send", "Protocol-Error", MOD_POST_AUTH);
- if (rcode < 0) return rcode;
-
- return 0;
-}
-
extern fr_app_process_t proto_radius_acct;
fr_app_process_t proto_radius_acct = {
.magic = RLM_MODULE_INIT,
.name = "radius_acct",
- .instantiate = mod_instantiate,
.process = mod_process,
};
*/
static int auth_listen_compile(CONF_SECTION *server_cs, UNUSED CONF_SECTION *listen_cs)
{
- int rcode;
CONF_SECTION *subcs = NULL;
- rcode = unlang_compile_subsection(server_cs, "recv", "Access-Request", MOD_AUTHORIZE);
- if (rcode < 0) return rcode;
-
- if (rcode == 0) {
- cf_log_err(server_cs, "Failed finding 'recv Access-Request { ... }' section of virtual server %s",
- cf_section_name2(server_cs));
- return -1;
- }
-
- rcode = unlang_compile_subsection(server_cs, "send", "Access-Accept", MOD_POST_AUTH);
- if (rcode < 0) return rcode;
-
- rcode = unlang_compile_subsection(server_cs, "send", "Access-Reject", MOD_POST_AUTH);
- if (rcode < 0) return rcode;
-
- rcode = unlang_compile_subsection(server_cs, "send", "Do-Not-Respond", MOD_POST_AUTH);
- if (rcode < 0) return rcode;
-
- rcode = unlang_compile_subsection(server_cs, "send", "Protocol-Error", MOD_POST_AUTH);
- if (rcode < 0) return rcode;
-
- /*
- * It's OK to not have an Access-Challenge section.
- */
- rcode = unlang_compile_subsection(server_cs, "send", "Access-Challenge", MOD_POST_AUTH);
- if (rcode < 0) return rcode;
-
while ((subcs = cf_section_find_next(server_cs, subcs, "authenticate", NULL))) {
char const *name2;
}
-static int mod_instantiate(UNUSED void *instance, CONF_SECTION *listen_cs)
-{
- int rcode;
- CONF_SECTION *server_cs;
-
- rad_assert(listen_cs);
-
- server_cs = cf_item_to_section(cf_parent(listen_cs));
- rad_assert(strcmp(cf_section_name1(server_cs), "server") == 0);
-
- rcode = unlang_compile_subsection(server_cs, "recv", "CoA-Request", MOD_RECV_COA);
- if (rcode < 0) return rcode;
- if (rcode == 1) {
- rcode = unlang_compile_subsection(server_cs, "send", "CoA-ACK", MOD_SEND_COA);
- if (rcode < 0) return rcode;
-
- rcode = unlang_compile_subsection(server_cs, "send", "CoA-NAK", MOD_SEND_COA);
- if (rcode < 0) return rcode;
- }
-
- rcode = unlang_compile_subsection(server_cs, "recv", "Disconnect-Request", MOD_RECV_COA);
- if (rcode < 0) return rcode;
- if (rcode == 1) {
- rcode = unlang_compile_subsection(server_cs, "send", "Disconnect-ACK", MOD_SEND_COA);
- if (rcode < 0) return rcode;
-
- rcode = unlang_compile_subsection(server_cs, "send", "Disconnect-NAK", MOD_SEND_COA);
- if (rcode < 0) return rcode;
- }
-
- rcode = unlang_compile_subsection(server_cs, "send", "Do-Not-Respond", MOD_POST_AUTH);
- if (rcode < 0) return rcode;
-
- rcode = unlang_compile_subsection(server_cs, "send", "Protocol-Error", MOD_POST_AUTH);
- if (rcode < 0) return rcode;
-
- return 0;
-}
-
extern fr_app_process_t proto_radius_coa;
fr_app_process_t proto_radius_coa = {
.magic = RLM_MODULE_INIT,
.name = "radius_coa",
- .instantiate = mod_instantiate,
.process = mod_process,
};
}
-/*
- * Ensure that the "recv foo" etc. sections are compiled.
- */
-static int mod_instantiate(UNUSED void *instance, CONF_SECTION *listen_cs)
-{
- int rcode;
- CONF_SECTION *server_cs;
-
- rad_assert(listen_cs);
-
- server_cs = cf_item_to_section(cf_parent(listen_cs));
- rad_assert(strcmp(cf_section_name1(server_cs), "server") == 0);
-
- rcode = unlang_compile_subsection(server_cs, "recv", "Status-Server", MOD_AUTHORIZE);
- if (rcode < 0) return rcode;
- if (rcode == 0) {
- cf_log_err(server_cs, "Failed finding 'recv Status-Server { ... }' section of virtual server %s",
- cf_section_name2(server_cs));
- return -1;
- }
-
- rcode = unlang_compile_subsection(server_cs, "send", "Access-Accept", MOD_POST_AUTH);
- if (rcode < 0) return rcode;
-
- rcode = unlang_compile_subsection(server_cs, "send", "Access-Reject", MOD_POST_AUTH);
- if (rcode < 0) return rcode;
-
- rcode = unlang_compile_subsection(server_cs, "send", "Protocol-Error", MOD_POST_AUTH);
- if (rcode < 0) return rcode;
-
- rcode = unlang_compile_subsection(server_cs, "send", "Do-Not-Respond", MOD_POST_AUTH);
- if (rcode < 0) return rcode;
-
- return 0;
-}
-
extern fr_app_process_t proto_radius_status;
fr_app_process_t proto_radius_status = {
.magic = RLM_MODULE_INIT,
.name = "radius_status",
- .instantiate = mod_instantiate,
.process = mod_process,
};