]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove components (MOD_AUTHORIZE, MOD_AUTHENTICATE, etc..) from the server
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 17 May 2024 00:21:32 +0000 (18:21 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 17 May 2024 00:21:32 +0000 (18:21 -0600)
We rely entirely on named methods now.

This breaks policy lookups, where the policy name is <policy>.<component>.  This needs to be fixed, by looking up <policy>[.<name1>][.<name2>].

34 files changed:
src/lib/server/base.h
src/lib/server/components.h [deleted file]
src/lib/server/module.h
src/lib/server/module_rlm.c
src/lib/server/module_rlm.h
src/lib/server/process.h
src/lib/server/virtual_servers.c
src/lib/server/virtual_servers.h
src/lib/unlang/all.mk
src/lib/unlang/compile.c
src/lib/unlang/compile.h
src/lib/unlang/mod_action.c [new file with mode: 0644]
src/lib/unlang/mod_action.h [new file with mode: 0644]
src/lib/unlang/module.c
src/lib/unlang/unlang_priv.h
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_rest/rlm_rest.c
src/process/arp/base.c
src/process/bfd/base.c
src/process/dhcpv4/base.c
src/process/dhcpv6/base.c
src/process/dns/base.c
src/process/eap_aka/base.c
src/process/eap_aka_prime/base.c
src/process/eap_sim/base.c
src/process/ldap_sync/base.c
src/process/radius/base.c
src/process/tacacs/base.c
src/process/test/base.c
src/process/tls/base.c
src/process/ttls/base.c
src/process/vmps/base.c
src/tests/eapol_test/config/servers.conf
src/tests/keywords/with_dots

index 67f709a11122045754005bb19304c93a9410ee08..6cd1034285d60ef8e8324f3a2c3dcd8e41f41a8d 100644 (file)
@@ -32,7 +32,6 @@ RCSIDH(base_h, "$Id$")
 #include <freeradius-devel/server/cf_util.h>
 #include <freeradius-devel/server/client.h>
 #include <freeradius-devel/server/command.h>
-#include <freeradius-devel/server/components.h>
 #include <freeradius-devel/server/connection.h>
 #include <freeradius-devel/server/dependency.h>
 #include <freeradius-devel/server/dl_module.h>
diff --git a/src/lib/server/components.h b/src/lib/server/components.h
deleted file mode 100644 (file)
index 913728c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#pragma once
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-/**
- * $Id$
- *
- * @file lib/server/components.h
- * @brief Module components.
- *
- * @copyright 2018 The FreeRADIUS server project
- */
-RCSIDH(components_h, "$Id$")
-
-/** The different section components of the server
- *
- * Used as indexes in the methods array in the module_t struct.
- */
-typedef enum rlm_components {
-       MOD_AUTHENTICATE = 0,                   //!< 0 methods index for authenticate section.
-       MOD_AUTHORIZE,                          //!< 1 methods index for authorize section.
-       MOD_PREACCT,                            //!< 2 methods index for preacct section.
-       MOD_ACCOUNTING,                         //!< 3 methods index for accounting section.
-       MOD_POST_AUTH,                          //!< 7 methods index for postauth section.
-       MOD_COUNT                               //!< 10 how many components there are.
-} rlm_components_t;
index 880de8b5a98dff693f78108900ff608121ab0333..ee38e12df114b09e7872d9d8a9ab80222acfe550 100644 (file)
@@ -36,6 +36,7 @@ extern "C" {
 #include <freeradius-devel/unlang/action.h>
 #include <freeradius-devel/unlang/compile.h>
 #include <freeradius-devel/unlang/call_env.h>
+#include <freeradius-devel/unlang/mod_action.h>
 #include <freeradius-devel/util/event.h>
 
 typedef struct module_s                                module_t;
@@ -124,7 +125,6 @@ typedef int (*module_thread_detach_t)(module_thread_inst_ctx_t const *mctx);
 }
 #endif
 
-#include <freeradius-devel/server/components.h>
 #include <freeradius-devel/server/dl_module.h>
 #include <freeradius-devel/server/exfile.h>
 #include <freeradius-devel/server/pool.h>
@@ -267,7 +267,7 @@ struct module_instance_s {
        rlm_rcode_t                     code;           //!< Code module will return when 'force' has
                                                        //!< has been set to true.
 
-       unlang_actions_t                actions;        //!< default actions and retries.
+       unlang_mod_actions_t            actions;        //!< default actions and retries.
        /** @} */
 
        /** @name Allow module instance data to be resolved by name or data, and to get back to the module list
index 663922f81b629c45d3052d51d494d53d5aa0cedc..d8642ae41b6432180836f1e6a7fae366bf9a57d0 100644 (file)
@@ -64,14 +64,6 @@ static int8_t module_rlm_virtual_name_cmp(void const *one, void const *two)
        return CMP(ret, 0);
 }
 
-char const *section_type_value[MOD_COUNT] = {
-       "authenticate",
-       "authorize",
-       "preacct",
-       "accounting",
-       "post-auth"
-};
-
 /** Global module list for all backend modules
  *
  */
@@ -562,7 +554,7 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
                 *      then any module method would match, which is
                 *      bad.
                 */
-               for (j = 0; allowed_list[j].name != NULL; j++) {
+               for (j = 0; allowed_list[j].name1 != NULL; j++) {
                        int k;
                        virtual_server_method_t const *allowed = &allowed_list[j];
 
@@ -571,7 +563,7 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
 
                                fr_assert(methods->name1 != CF_IDENT_ANY); /* should have been caught above */
 
-                               if (strcasecmp(methods->name1, allowed->name) != 0) continue;
+                               if (strcasecmp(methods->name1, allowed->name1) != 0) continue;
 
                                /*
                                 *      The module matches "recv *",
index 2df0749ef3d10c8e465fba58be71df1925584149..256a1a50302e96cd334e5c4e417958081fb42784 100644 (file)
@@ -31,8 +31,6 @@ extern "C" {
 
 #include <freeradius-devel/server/module.h>
 
-extern char const *section_type_value[MOD_COUNT];
-
 typedef struct {
        module_t                        common;                 //!< Common fields presented by all modules.
        module_method_name_t const      *method_names;          //!< named methods
index a664d6c0e6dca721a0fe95f0461fb5cd07e926df..22311f3b8794e6b12759e86579bf31ec8eff8ed4 100644 (file)
@@ -467,21 +467,21 @@ static inline unlang_action_t new_client(rlm_rcode_t *p_result, module_ctx_t con
 
 #define DYNAMIC_CLIENT_SECTIONS \
        { \
-               .name = "new", \
+               .name1 = "new", \
                .name2 = "client", \
-               .component = MOD_AUTHORIZE, \
+               .actions = &mod_actions_authorize, \
                .offset = PROCESS_CONF_OFFSET(new_client), \
        }, \
        { \
-               .name = "add", \
+               .name1 = "add", \
                .name2 = "client", \
-               .component = MOD_AUTHORIZE, \
+               .actions = &mod_actions_authorize, \
                .offset = PROCESS_CONF_OFFSET(add_client), \
        }, \
        { \
-               .name = "deny", \
+               .name1 = "deny", \
                .name2 = "client", \
-               .component = MOD_AUTHORIZE, \
+               .actions = &mod_actions_authorize, \
                .offset = PROCESS_CONF_OFFSET(deny_client), \
        }
 
index 595f2a92cf2e8ed34259451a73a67963b36e6b58..9fa6aac38b70d8351b6d777b6a11cf8e51629245 100644 (file)
@@ -307,12 +307,12 @@ int add_compile_list(CONF_SECTION *cs, virtual_server_compile_t const *compile_l
 
        if (!compile_list) return 0;
 
-       for (i = 0; list[i].name != NULL; i++) {
-               if (list[i].name == CF_IDENT_ANY) continue;
+       for (i = 0; list[i].name1 != NULL; i++) {
+               if (list[i].name1 == CF_IDENT_ANY) continue;
 
                if (virtual_server_section_register(&list[i]) < 0) {
                        cf_log_err(cs, "Failed registering processing section name %s for %s",
-                                  list[i].name, name);
+                                  list[i].name1, name);
                        return -1;
                }
        }
@@ -911,7 +911,7 @@ int virtual_server_compile_sections(CONF_SECTION *server, virtual_server_compile
                                return -1;
                        }
 
-                       rcode = unlang_compile(subcs, list[i].component, rules, &instruction);
+                       rcode = unlang_compile(subcs, list[i].actions, rules, &instruction);
                        if (rcode < 0) return -1;
 
                        /*
@@ -956,7 +956,7 @@ int virtual_server_compile_sections(CONF_SECTION *server, virtual_server_compile
                        bad = cf_section_find_next(server, subcs, list[i].name1, name2);
                        if (bad) goto forbidden;
 
-                       rcode = unlang_compile(subcs, list[i].component, rules, NULL);
+                       rcode = unlang_compile(subcs, list[i].actions, rules, NULL);
                        if (rcode < 0) return -1;
 
                        /*
@@ -1017,15 +1017,15 @@ int virtual_server_section_register(virtual_server_compile_t const *entry)
        if (entry->methods) {
                int i;
 
-               for (i = 0; entry->methods[i].name != NULL; i++) {
-                       if (entry->methods[i].name == CF_IDENT_ANY) {
+               for (i = 0; entry->methods[i].name1 != NULL; i++) {
+                       if (entry->methods[i].name1 == CF_IDENT_ANY) {
                                ERROR("Processing sections cannot allow \"*\"");
                                return -1;
                        }
 
                        if (entry->methods[i].name2 == CF_IDENT_ANY) {
                                ERROR("Processing sections cannot allow \"%s *\"",
-                                       entry->methods[i].name);
+                                       entry->methods[i].name1);
                                return -1;
                        }
                }
index 911dd2cb612ee7461336ab333b46c51c33e3d94c..f0ef70fd99dce538a70c02eb86f472410b4a8d55 100644 (file)
@@ -24,6 +24,7 @@
  * @copyright 2019 The FreeRADIUS server project
  */
 
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -31,12 +32,12 @@ extern "C" {
 #include <freeradius-devel/io/schedule.h>
 #include <freeradius-devel/server/cf_parse.h>
 #include <freeradius-devel/unlang/module.h>
+#include <freeradius-devel/unlang/mod_action.h>
 #include <freeradius-devel/util/dict.h>
 
 extern const conf_parser_t virtual_servers_config[];
 extern const conf_parser_t virtual_servers_on_read_config[];
 
-
 /** @name Debug functions
  * @{
  */
@@ -94,24 +95,25 @@ bool                listen_record(fr_listen_t *li) CC_HINT(nonnull);
  *
  */
 typedef struct {
-       char const              *name;          //!< module method name1 which is allowed in this section
-       char const              *name2;         //!< module method name2 which is allowed in this section
+       char const                      *name1;         //!< module method name1 which is allowed in this section
+       char const                      *name2;         //!< module method name2 which is allowed in this section
 } virtual_server_method_t;
 
 /** Processing sections which are allowed in this virtual server.
  *
  */
 typedef struct {
-       char const              *name1;         //!< Name of the processing section, such as "recv" or "send"
-       char const              *name2;         //!< Second name, such as "Access-Request"
-       size_t                  offset;         //!< where the CONF_SECTION pointer is written
-       bool                    dont_cache;     //!< If true, the CONF_SECTION pointer won't be written
-                                               ///< and the offset will be ignored.
-       size_t                  instruction;    //!< where the instruction pointer is written
-       virtual_server_method_t const *methods; //!< list of module methods which are allowed in this section
+       char const                      *name1;         //!< Name of the processing section, such as "recv" or "send"
+       char const                      *name2;         //!< Second name, such as "Access-Request"
+       size_t                          offset;         //!< where the CONF_SECTION pointer is written
+       bool                            dont_cache;     //!< If true, the CONF_SECTION pointer won't be written
+                                                       ///< and the offset will be ignored.
+       size_t                          instruction;    //!< where the instruction pointer is written
+       unlang_mod_actions_t const      *actions;       //!< Default actions for this section.
+       virtual_server_method_t const   *methods;       //!< list of module methods which are allowed in this section
 } virtual_server_compile_t;
 
-#define COMPILE_TERMINATOR { .name = NULL, .name2 = NULL }
+#define COMPILE_TERMINATOR { .name1 = NULL, .name2 = NULL }
 
 int            virtual_server_section_register(virtual_server_compile_t const *entry) CC_HINT(nonnull);
 
index 2ad383d62c593a4f0ec5d789e34a8348017458bf..5a2e1406fec03b6f8590bebf89f4ad140996ecef 100644 (file)
@@ -18,6 +18,7 @@ SOURCES       :=      base.c \
                limit.c \
                load_balance.c \
                map.c \
+               mod_action.c \
                module.c \
                parallel.c \
                return.c \
index 6b0ab525ab754e7530019f3c77df22f006e6b3cc..e07bedc3122a7fa46b553faa85e0ddabc731df9f 100644 (file)
@@ -32,6 +32,7 @@ RCSID("$Id$")
 #include <freeradius-devel/util/time.h>
 #include <freeradius-devel/util/dict.h>
 
+#include "catch_priv.h"
 #include "call_priv.h"
 #include "caller_priv.h"
 #include "condition_priv.h"
@@ -47,7 +48,7 @@ RCSID("$Id$")
 #include "limit_priv.h"
 #include "transaction_priv.h"
 #include "try_priv.h"
-#include "catch_priv.h"
+#include "mod_action.h"
 
 #define UNLANG_IGNORE ((unlang_t *) -1)
 
@@ -83,22 +84,11 @@ fr_table_num_sorted_t const mod_rcode_table[] = {
 };
 size_t mod_rcode_table_len = NUM_ELEMENTS(mod_rcode_table);
 
-
-/* Some short names for debugging output */
-static char const * const comp2str[] = {
-       "authenticate",
-       "authorize",
-       "preacct",
-       "accounting",
-       "post-auth"
-};
-
 typedef struct {
-       rlm_components_t        component;
-       char const              *section_name1;
-       char const              *section_name2;
-       unlang_actions_t        actions;
-       tmpl_rules_t const      *rules;
+       char const                      *section_name1;
+       char const                      *section_name2;
+       unlang_mod_actions_t            actions;
+       tmpl_rules_t const              *rules;
 } unlang_compile_t;
 
 /*
@@ -106,17 +96,12 @@ typedef struct {
  *     name and number, but we use the CURRENT actions.
  */
 static inline CC_HINT(always_inline)
-void compile_copy_context(unlang_compile_t *dst, unlang_compile_t const *src, rlm_components_t component)
+void compile_copy_context(unlang_compile_t *dst, unlang_compile_t const *src)
 {
        int i;
 
        *dst = *src;
 
-       /*
-        *      Over-ride the component.
-        */
-       dst->component = component;
-
        /*
         *      Ensure that none of the actions are RETRY.
         */
@@ -126,93 +111,13 @@ void compile_copy_context(unlang_compile_t *dst, unlang_compile_t const *src, rl
        memset(&dst->actions.retry, 0, sizeof(dst->actions.retry)); \
 }
 
-#define UPDATE_CTX2 compile_copy_context(&unlang_ctx2, unlang_ctx, component)
+#define UPDATE_CTX2 compile_copy_context(&unlang_ctx2, unlang_ctx)
 
 
 static unlang_t *compile_empty(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs, unlang_ext_t const *ext);
 
 static char const unlang_spaces[] = "                                                                                                                                                                                                                                                                ";
 
-
-static const unlang_actions_t default_actions[MOD_COUNT] =
-{
-       /* authenticate */
-       {
-               .actions = {
-                       MOD_ACTION_RETURN,      /* reject   */
-                       MOD_ACTION_RETURN,      /* fail     */
-                       4,                      /* ok       */
-                       MOD_ACTION_RETURN,      /* handled  */
-                       MOD_ACTION_RETURN,      /* invalid  */
-                       MOD_ACTION_RETURN,      /* disallow */
-                       1,                      /* notfound */
-                       2,                      /* noop     */
-                       3                       /* updated  */
-               },
-               .retry = RETRY_INIT,
-       },
-       /* authorize */
-       {
-               .actions = {
-                       MOD_ACTION_RETURN,      /* reject   */
-                       MOD_ACTION_RETURN,      /* fail     */
-                       3,                      /* ok       */
-                       MOD_ACTION_RETURN,      /* handled  */
-                       MOD_ACTION_RETURN,      /* invalid  */
-                       MOD_ACTION_RETURN,      /* disallow */
-                       1,                      /* notfound */
-                       2,                      /* noop     */
-                       4                       /* updated  */
-               },
-               .retry = RETRY_INIT,
-       },
-       /* preacct */
-       {
-               .actions = {
-                       MOD_ACTION_RETURN,      /* reject   */
-                       MOD_ACTION_RETURN,      /* fail     */
-                       2,                      /* ok       */
-                       MOD_ACTION_RETURN,      /* handled  */
-                       MOD_ACTION_RETURN,      /* invalid  */
-                       MOD_ACTION_RETURN,      /* disallow */
-                       MOD_ACTION_RETURN,      /* notfound */
-                       1,                      /* noop     */
-                       3                       /* updated  */
-               },
-               .retry = RETRY_INIT,
-       },
-       /* accounting */
-       {
-               .actions = {
-                       MOD_ACTION_RETURN,      /* reject   */
-                       MOD_ACTION_RETURN,      /* fail     */
-                       2,                      /* ok       */
-                       MOD_ACTION_RETURN,      /* handled  */
-                       MOD_ACTION_RETURN,      /* invalid  */
-                       MOD_ACTION_RETURN,      /* disallow */
-                       MOD_ACTION_RETURN,      /* notfound */
-                       1,                      /* noop     */
-                       3                       /* updated  */
-               },
-               .retry = RETRY_INIT,
-       },
-       /* post-auth */
-       {
-               .actions = {
-                       MOD_ACTION_RETURN,      /* reject   */
-                       MOD_ACTION_RETURN,      /* fail     */
-                       3,                      /* ok       */
-                       MOD_ACTION_RETURN,      /* handled  */
-                       MOD_ACTION_RETURN,      /* invalid  */
-                       MOD_ACTION_RETURN,      /* disallow */
-                       1,                      /* notfound */
-                       2,                      /* noop     */
-                       4                       /* updated  */
-               },
-               .retry = RETRY_INIT,
-       }
-};
-
 static inline CC_HINT(always_inline) int unlang_attr_rules_verify(tmpl_attr_rules_t const *rules)
 {
        if (!fr_cond_assert_msg(rules->dict_def, "No protocol dictionary set")) return -1;
@@ -1831,7 +1736,7 @@ invalid_type:
 /*
  *     Compile action && rcode for later use.
  */
-static int compile_action_pair(unlang_actions_t *actions, CONF_PAIR *cp)
+static int compile_action_pair(unlang_mod_actions_t *actions, CONF_PAIR *cp)
 {
        int action;
        char const *attr, *value;
@@ -1889,7 +1794,7 @@ static int compile_action_pair(unlang_actions_t *actions, CONF_PAIR *cp)
        return 1;
 }
 
-static bool compile_retry_section(unlang_actions_t *actions, CONF_ITEM *ci)
+static bool compile_retry_section(unlang_mod_actions_t *actions, CONF_ITEM *ci)
 {
        CONF_ITEM *csi;
        CONF_SECTION *cs;
@@ -1967,7 +1872,7 @@ static bool compile_retry_section(unlang_actions_t *actions, CONF_ITEM *ci)
        return true;
 }
 
-bool unlang_compile_actions(unlang_actions_t *actions, CONF_SECTION *action_cs, bool module_retry)
+bool unlang_compile_actions(unlang_mod_actions_t *actions, CONF_SECTION *action_cs, bool module_retry)
 {
        int i;
        bool disallow_retry_action = false;
@@ -2180,7 +2085,7 @@ static unlang_t *compile_children(unlang_group_t *g, unlang_compile_t *unlang_ct
         *      Create our own compilation context which can be edited
         *      by a variable definition.
         */
-       compile_copy_context(&unlang_ctx2, unlang_ctx_in, unlang_ctx_in->component);
+       compile_copy_context(&unlang_ctx2, unlang_ctx_in);
        unlang_ctx = &unlang_ctx2;
        t_rules = *unlang_ctx_in->rules;
 
@@ -2580,7 +2485,7 @@ static unlang_t *compile_transaction(unlang_t *parent, unlang_compile_t *unlang_
        /*
         *      Any failure is return, not continue.
         */
-       compile_copy_context(&unlang_ctx2, unlang_ctx, unlang_ctx->component);
+       compile_copy_context(&unlang_ctx2, unlang_ctx);
 
        unlang_ctx2.actions.actions[RLM_MODULE_REJECT] = MOD_ACTION_RETURN;
        unlang_ctx2.actions.actions[RLM_MODULE_FAIL] = MOD_ACTION_RETURN;
@@ -4127,7 +4032,7 @@ get_packet_type:
         *      just to ensure that retry is handled correctly.
         *      i.e. reset.
         */
-       compile_copy_context(&unlang_ctx2, unlang_ctx, unlang_ctx->component);
+       compile_copy_context(&unlang_ctx2, unlang_ctx);
 
        /*
         *      Then over-write the new compilation context.
@@ -4135,7 +4040,6 @@ get_packet_type:
        unlang_ctx2.section_name1 = "subrequest";
        unlang_ctx2.section_name2 = name2;
        unlang_ctx2.rules = &t_rules;
-       unlang_ctx2.component = unlang_ctx->component;
 
        /*
         *      Compile the subsection with a *different* default dictionary.
@@ -4337,7 +4241,7 @@ static unlang_t *compile_caller(unlang_t *parent, unlang_compile_t *unlang_ctx,
 }
 
 static unlang_t *compile_function(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_ITEM *ci,
-                                 CONF_SECTION *subcs, rlm_components_t component,
+                                 CONF_SECTION *subcs,
                                  bool policy)
 {
        unlang_compile_t                unlang_ctx2;
@@ -4417,8 +4321,6 @@ static unlang_t *compile_function(unlang_t *parent, unlang_compile_t *unlang_ctx
  * we wish to use, instead of the input component.
  *
  * @param[in] ci               Configuration item to check
- * @param[out] pcomponent      Where to write the method we found, if any.
- *                             If no method is specified will be set to MOD_COUNT.
  * @param[in] real_name                Complete name string e.g. foo.authorize.
  * @param[in] virtual_name     Virtual module name e.g. foo.
  * @param[in] method_name      Method override (may be NULL) or the method
@@ -4426,36 +4328,18 @@ static unlang_t *compile_function(unlang_t *parent, unlang_compile_t *unlang_ctx
  * @param[out] policy          whether or not this thing was a policy
  * @return the CONF_SECTION specifying the virtual module.
  */
-static CONF_SECTION *virtual_module_find_cs(CONF_ITEM *ci, rlm_components_t *pcomponent,
-                                           char const *real_name, char const *virtual_name, char const *method_name,
+static CONF_SECTION *virtual_module_find_cs(CONF_ITEM *ci,
+                                           UNUSED char const *real_name, char const *virtual_name, char const *method_name,
                                            bool *policy)
 {
        CONF_SECTION *cs, *subcs, *conf_root;
        CONF_ITEM *loop;
-       rlm_components_t method = *pcomponent;
+#if 0
        char buffer[256];
-
+#endif
        *policy = false;
        conf_root = cf_root(ci);
 
-       /*
-        *      Turn the method name into a method enum.
-        */
-       if (method_name) {
-               rlm_components_t i;
-
-               for (i = MOD_AUTHENTICATE; i < MOD_COUNT; i++) {
-                       if (strcmp(comp2str[i], method_name) == 0) break;
-               }
-
-               if (i != MOD_COUNT) {
-                       method = i;
-               } else {
-                       method_name = NULL;
-                       virtual_name = real_name;
-               }
-       }
-
        /*
         *      Look for "foo" as a virtual server.  If we find it,
         *      AND there's no method name, we've found the right
@@ -4466,10 +4350,7 @@ static CONF_SECTION *virtual_module_find_cs(CONF_ITEM *ci, rlm_components_t *pco
         *      Return it to the caller, with the updated method.
         */
        subcs = module_rlm_by_name_virtual(virtual_name);
-       if (subcs) {
-               *pcomponent = method;
-               goto check_for_loop;
-       }
+       if (subcs) goto check_for_loop;
 
        /*
         *      Look for it in "policy".
@@ -4490,7 +4371,6 @@ static CONF_SECTION *virtual_module_find_cs(CONF_ITEM *ci, rlm_components_t *pco
                subcs = cf_section_find(cs, virtual_name, NULL);
                if (!subcs) return NULL;
 
-               *pcomponent = method;
                goto check_for_loop;
        }
 
@@ -4498,9 +4378,15 @@ static CONF_SECTION *virtual_module_find_cs(CONF_ITEM *ci, rlm_components_t *pco
         *      "foo" means "look for foo.component" first, to allow
         *      method overrides.  If that's not found, just look for
         *      a policy "foo".
+        *
+        *      FIXME - This has been broken since we switched to named
+        *      module sections. We should take the name1/name2 from the
+        *      unlang ctx and use that to form the name we search for.
         */
+#if 0
        snprintf(buffer, sizeof(buffer), "%s.%s", virtual_name, comp2str[method]);
-       subcs = cf_section_find(cs, buffer, NULL);
+#endif
+       subcs = cf_section_find(cs, virtual_name, NULL);
        if (!subcs) subcs = cf_section_find(cs, virtual_name, NULL);
        if (!subcs) return NULL;
 
@@ -4652,7 +4538,6 @@ static unlang_t *compile_item(unlang_t *parent, unlang_compile_t *unlang_ctx, CO
        module_instance_t       *inst;
        CONF_SECTION            *cs, *subcs, *modules;
        char const              *realname;
-       rlm_components_t        component = unlang_ctx->component;
        unlang_compile_t        unlang_ctx2;
        module_method_t         method;
        bool                    policy;
@@ -4786,14 +4671,14 @@ check_for_module:
         */
        p = strrchr(name, '.');
        if (!p) {
-               subcs = virtual_module_find_cs(ci, &component, name, name, NULL, &policy);
+               subcs = virtual_module_find_cs(ci, name, name, NULL, &policy);
        } else {
                char buffer[256];
 
                strlcpy(buffer, name, sizeof(buffer));
                buffer[p - name] = '\0';
 
-               subcs = virtual_module_find_cs(ci, &component, name,
+               subcs = virtual_module_find_cs(ci, name,
                                               buffer, buffer + (p - name) + 1, &policy);
        }
 
@@ -4804,7 +4689,7 @@ check_for_module:
         *      i.e. it refers to a a subsection in "policy".
         */
        if (subcs) {
-               c = compile_function(parent, unlang_ctx, ci, subcs, component, policy);
+               c = compile_function(parent, unlang_ctx, ci, subcs, policy);
                goto allocate_number;
        }
 
@@ -4863,7 +4748,7 @@ fail:
        return NULL;
 }
 
-int unlang_compile(CONF_SECTION *cs, rlm_components_t component, tmpl_rules_t const *rules, void **instruction)
+int unlang_compile(CONF_SECTION *cs, unlang_mod_actions_t const * actions, tmpl_rules_t const *rules, void **instruction)
 {
        unlang_t                        *c;
        tmpl_rules_t                    my_rules;
@@ -4902,10 +4787,9 @@ int unlang_compile(CONF_SECTION *cs, rlm_components_t component, tmpl_rules_t co
 
        c = compile_section(NULL,
                            &(unlang_compile_t){
-                               .component = component,
                                .section_name1 = cf_section_name1(cs),
                                .section_name2 = cf_section_name2(cs),
-                               .actions = default_actions[component],
+                               .actions = *actions,
                                .rules = rules
                            },
                            cs, &group_ext);
index 9dd417cb3eb82f1bab4b82ba19ba045565252a9c..289b71e5b01ccb6138f2542def48825126c9b1a0 100644 (file)
@@ -29,22 +29,17 @@ extern "C" {
 #endif
 
 #include <freeradius-devel/server/cf_util.h>
-#include <freeradius-devel/server/components.h>
 #include <freeradius-devel/server/tmpl.h>
 #include <freeradius-devel/util/retry.h>
-
-typedef struct {
-       int                     actions[RLM_MODULE_NUMCODES];
-       fr_retry_config_t       retry;
-} unlang_actions_t;
+#include <freeradius-devel/unlang/mod_action.h>
 
 void           unlang_compile_init(TALLOC_CTX *ctx);
 
-int            unlang_compile(CONF_SECTION *cs, rlm_components_t component, tmpl_rules_t const *rules, void **instruction);
+int            unlang_compile(CONF_SECTION *cs, unlang_mod_actions_t const *actions, tmpl_rules_t const *rules, void **instruction);
 
 bool           unlang_compile_is_keyword(const char *name);
 
-bool           unlang_compile_actions(unlang_actions_t *actions, CONF_SECTION *parent, bool module_retry);
+bool           unlang_compile_actions(unlang_mod_actions_t *actions, CONF_SECTION *parent, bool module_retry);
 
 #ifdef __cplusplus
 }
diff --git a/src/lib/unlang/mod_action.c b/src/lib/unlang/mod_action.c
new file mode 100644 (file)
index 0000000..8317b5c
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/**
+ * $Id$
+ *
+ * @file unlang/action.c
+ * @brief Default action sets for virtual server actions.
+ *
+ * @copyright 2024 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
+ */
+RCSID("$Id$")
+
+#include <freeradius-devel/unlang/mod_action.h>
+
+unlang_mod_actions_t const mod_actions_authenticate = {
+       .actions = {
+               [RLM_MODULE_REJECT]     = MOD_ACTION_RETURN,
+               [RLM_MODULE_FAIL]       = MOD_ACTION_RETURN,
+               [RLM_MODULE_OK]         = 4,
+               [RLM_MODULE_HANDLED]    = MOD_ACTION_RETURN,
+               [RLM_MODULE_INVALID]    = MOD_ACTION_RETURN,
+               [RLM_MODULE_DISALLOW]   = MOD_ACTION_RETURN,
+               [RLM_MODULE_NOTFOUND]   = 1,
+               [RLM_MODULE_NOOP]       = 2,
+               [RLM_MODULE_UPDATED]    = 3
+       },
+       .retry = RETRY_INIT
+};
+
+unlang_mod_actions_t const mod_actions_authorize = {
+       .actions = {
+               [RLM_MODULE_REJECT]     = MOD_ACTION_RETURN,
+               [RLM_MODULE_FAIL]       = MOD_ACTION_RETURN,
+               [RLM_MODULE_OK]         = 3,
+               [RLM_MODULE_HANDLED]    = MOD_ACTION_RETURN,
+               [RLM_MODULE_INVALID]    = MOD_ACTION_RETURN,
+               [RLM_MODULE_DISALLOW]   = MOD_ACTION_RETURN,
+               [RLM_MODULE_NOTFOUND]   = 1,
+               [RLM_MODULE_NOOP]       = 2,
+               [RLM_MODULE_UPDATED]    = 4
+       },
+       .retry = RETRY_INIT,
+};
+
+unlang_mod_actions_t const mod_actions_preacct = {
+       .actions = {
+               [RLM_MODULE_REJECT]     = MOD_ACTION_RETURN,
+               [RLM_MODULE_FAIL]       = MOD_ACTION_RETURN,
+               [RLM_MODULE_OK]         = 2,
+               [RLM_MODULE_HANDLED]    = MOD_ACTION_RETURN,
+               [RLM_MODULE_INVALID]    = MOD_ACTION_RETURN,
+               [RLM_MODULE_DISALLOW]   = MOD_ACTION_RETURN,
+               [RLM_MODULE_NOTFOUND]   = MOD_ACTION_RETURN,
+               [RLM_MODULE_NOOP]       = 1,
+               [RLM_MODULE_UPDATED]    = 3
+       },
+       .retry = RETRY_INIT,
+};
+
+unlang_mod_actions_t const mod_actions_accounting = {
+       .actions = {
+               [RLM_MODULE_REJECT]     = MOD_ACTION_RETURN,
+               [RLM_MODULE_FAIL]       = MOD_ACTION_RETURN,
+               [RLM_MODULE_OK]         = 2,
+               [RLM_MODULE_HANDLED]    = MOD_ACTION_RETURN,
+               [RLM_MODULE_INVALID]    = MOD_ACTION_RETURN,
+               [RLM_MODULE_DISALLOW]   = MOD_ACTION_RETURN,
+               [RLM_MODULE_NOTFOUND]   = MOD_ACTION_RETURN,
+               [RLM_MODULE_NOOP]       = 1,
+               [RLM_MODULE_UPDATED]    = 3
+       },
+};
+
+unlang_mod_actions_t const mod_actions_postauth = {
+       .actions = {
+               [RLM_MODULE_REJECT]     = MOD_ACTION_RETURN,
+               [RLM_MODULE_FAIL]       = MOD_ACTION_RETURN,
+               [RLM_MODULE_OK]         = 3,
+               [RLM_MODULE_HANDLED]    = MOD_ACTION_RETURN,
+               [RLM_MODULE_INVALID]    = MOD_ACTION_RETURN,
+               [RLM_MODULE_DISALLOW]   = MOD_ACTION_RETURN,
+               [RLM_MODULE_NOTFOUND]   = 1,
+               [RLM_MODULE_NOOP]       = 2,
+               [RLM_MODULE_UPDATED]    = 4
+       },
+       .retry = RETRY_INIT
+};
diff --git a/src/lib/unlang/mod_action.h b/src/lib/unlang/mod_action.h
new file mode 100644 (file)
index 0000000..769ad28
--- /dev/null
@@ -0,0 +1,67 @@
+#pragma once
+/*
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software Foundation,
+ *  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * $Id$
+ *
+ * @file unlang/mod_action.h
+ * @brief Unlang module actions
+ *
+ * @copyright 2024 The FreeRADIUS server project
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <freeradius-devel/server/rcode.h>
+#include <freeradius-devel/util/retry.h>
+
+/* Actions may be a positive integer (the highest one returned in the group
+ * will be returned), or the keyword "return", represented here by
+ * MOD_ACTION_RETURN, to cause an immediate return.
+ * There's also the keyword "reject", represented here by MOD_ACTION_REJECT
+ * to cause an immediate reject. */
+typedef enum {
+       MOD_ACTION_RETURN = -1,
+       MOD_ACTION_REJECT = -2,
+       MOD_ACTION_RETRY = -3,
+       /*
+        *      If ubsan or the compiled complains
+        *      about the missing enum values we'll
+        *      need to add them here.
+        *
+        *      Defining MOD_PRIORITY_MAX ensures the
+        *      enum will always be large enough.
+        */
+       MOD_PRIORITY_MAX = 64
+} unlang_mod_action_t;
+
+typedef struct {
+       unlang_mod_action_t     actions[RLM_MODULE_NUMCODES];
+       fr_retry_config_t       retry;
+} unlang_mod_actions_t;
+
+extern unlang_mod_actions_t const mod_actions_authenticate;
+extern unlang_mod_actions_t const mod_actions_authorize;
+extern unlang_mod_actions_t const mod_actions_preacct;
+extern unlang_mod_actions_t const mod_actions_accounting;
+extern unlang_mod_actions_t const mod_actions_postauth;
+
+#ifdef __cplusplus
+}
+#endif
index 38efed2eb170fb0e7cc264396c88b38c1ff5e107..58063ec4fbc92af8b248a942225950662f7a67e8 100644 (file)
@@ -32,7 +32,6 @@ RCSID("$Id$")
 #include <freeradius-devel/unlang/call_env.h>
 
 #include "module_priv.h"
-#include "subrequest_priv.h"
 
 #include "tmpl.h"
 
@@ -46,7 +45,7 @@ typedef struct {
        unlang_module_fd_event_t        fd_read;        //!< Function to call when FD is readable.
        unlang_module_fd_event_t        fd_write;       //!< Function to call when FD is writable.
        unlang_module_fd_event_t        fd_error;       //!< Function to call when FD has errored.
-       module_instance_t               *mi;    //!< Module instance to pass to callbacks.
+       module_instance_t               *mi;            //!< Module instance to pass to callbacks.
                                                        ///< Use mi->data to get instance data.
        void                            *thread;        //!< Thread specific module instance.
        void                            *env_data;      //!< Per call environment data.
index 96e2988aba29389960b1d0c4e52e463bd03bae06..ae9087c7078df7b73cb2646b1eaa86d8b48f0921 100644 (file)
 extern "C" {
 #endif
 
-/* Actions may be a positive integer (the highest one returned in the group
- * will be returned), or the keyword "return", represented here by
- * MOD_ACTION_RETURN, to cause an immediate return.
- * There's also the keyword "reject", represented here by MOD_ACTION_REJECT
- * to cause an immediate reject. */
-#define MOD_ACTION_RETURN  (-1)
-#define MOD_ACTION_REJECT  (-2)
-#define MOD_ACTION_RETRY   (-3)
-#define MOD_PRIORITY_MAX   (64)
-
 /** Types of unlang_t nodes
  *
  * Here are our basic types: unlang_t, unlang_group_t, and unlang_module_t. For an
@@ -128,7 +118,7 @@ struct unlang_s {
        bool                    closed;         //!< whether or not this section is closed to new statements
        CONF_ITEM               *ci;            //!< used to generate this item
        unsigned int            number;         //!< unique node number
-       unlang_actions_t        actions;        //!< Priorities, etc. for the various return codes.
+       unlang_mod_actions_t    actions;        //!< Priorities, etc. for the various return codes.
 };
 
 /** Describes how to allocate an #unlang_group_t with additional memory keyword specific data
index 89810a37506a1cc6182090125de599da0aef22c1..bbc651bfd035280e3d1bb544cc39ea3560a48708 100644 (file)
@@ -2196,20 +2196,17 @@ static int mod_detach(module_detach_ctx_t const *mctx)
  * @param[in] mctx rlm_ldap configuration.
  * @param[in] parent of the config section.
  * @param[out] config to write the sub section parameters to.
- * @param[in] comp The section name were parsing the config for.
  * @return
  *     - 0 on success.
  *     - < 0 on failure.
  */
 static int parse_sub_section(module_inst_ctx_t const *mctx,
                             CONF_SECTION *parent, ldap_acct_section_t **config,
-                            rlm_components_t comp)
+                            char const *name)
 {
        rlm_ldap_t      *inst = talloc_get_type_abort(mctx->mi->data, rlm_ldap_t);
        CONF_SECTION    *cs;
 
-       char const *name = section_type_value[comp];
-
        cs = cf_section_find(parent, name, NULL);
        if (!cs) {
                DEBUG2("rlm_ldap (%s) - Couldn't find configuration for %s, will return NOOP for calls "
@@ -2426,8 +2423,8 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
        /*
         *      If the configuration parameters can't be parsed, then fail.
         */
-       if ((parse_sub_section(mctx, conf, &inst->accounting, MOD_ACCOUNTING) < 0) ||
-           (parse_sub_section(mctx, conf, &inst->postauth, MOD_POST_AUTH) < 0)) {
+       if ((parse_sub_section(mctx, conf, &inst->accounting, "accounting") < 0) ||
+           (parse_sub_section(mctx, conf, &inst->postauth, "post-auth") < 0)) {
                cf_log_err(conf, "Failed parsing configuration");
 
                goto error;
index 179507b851a8521152197ebfaa04a542864e4136..ad75530006d7afae3479fa33798cdf8fee81d77a 100644 (file)
@@ -1334,13 +1334,13 @@ static int instantiate(module_inst_ctx_t const *mctx)
        if (
                (parse_sub_section(inst, conf, xlat_config, &inst->xlat, "xlat") < 0) ||
                (parse_sub_section(inst, conf, section_config, &inst->authorize,
-                                  section_type_value[MOD_AUTHORIZE]) < 0) ||
+                                  "authorize") < 0) ||
                (parse_sub_section(inst, conf, section_config, &inst->authenticate,
-                                  section_type_value[MOD_AUTHENTICATE]) < 0) ||
+                                  "authenticate") < 0) ||
                (parse_sub_section(inst, conf, section_config, &inst->accounting,
-                                  section_type_value[MOD_ACCOUNTING]) < 0) ||
+                                  "accounting") < 0) ||
                (parse_sub_section(inst, conf, section_config, &inst->post_auth,
-                                  section_type_value[MOD_POST_AUTH]) < 0))
+                                  "post-auth") < 0))
        {
                return -1;
        }
index 32df7d7255d1886cb23b49c307346e6b55c1b11e..758ed62e3cad963651b12f05cef29c10211c53ee 100644 (file)
@@ -206,38 +206,38 @@ static const virtual_server_compile_t compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Request",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(request),
        },
        {
                .name1 = "send",
                .name2 = "Reply",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(reply),
        },
        {                       /* we can listen for others ARP replies, too */
                .name1 = "recv",
                .name2 = "Reply",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_reply),
        },
        {
                .name1 = "recv",
                .name2 = "Reverse-Request",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(reverse_request),
        },
 
        {
                .name1 = "send",
                .name2 = "Reverse-Reply",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(reverse_reply),
        },
        {
                .name1 = "send",
                .name2 = "Do-Not-Respond",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
 
index 50101113b983149a22da94d7e319466de2de3d63..eb1b463eb94d68ade38533582bce1bc16c5e014e 100644 (file)
@@ -272,15 +272,15 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
  */
 #define SEND_RECV(_x, _y) \
        { \
-               .name = "recv", \
+               .name1 = "recv", \
                .name2 = _x, \
-               .component = MOD_POST_AUTH, \
+               .actions = &mod_actions_postauth, \
                .offset = PROCESS_CONF_OFFSET(recv_ ## _y), \
        }, \
        { \
-               .name = "send", \
+               .name1 = "send", \
                .name2 = _x, \
-               .component = MOD_POST_AUTH, \
+               .actions = &mod_actions_postauth, \
                .offset = PROCESS_CONF_OFFSET(send_ ## _y), \
        }
 
index eecf42e0429da71cbcf28b7eb012135face27bb4..f2cdd091011f0f7b4304e979f04328d3a3d54326 100644 (file)
@@ -421,11 +421,11 @@ static const virtual_server_compile_t compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Discover",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
 
                .methods = (const virtual_server_method_t[]) {
                        {
-                               .name = "ippool",
+                               .name1 = "ippool",
                                .name2 = "allocate",
                        },
                        COMPILE_TERMINATOR
@@ -435,17 +435,17 @@ static const virtual_server_compile_t compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Offer",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(offer),
        },
        {
                .name1 = "recv",
                .name2 = "Request",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
 
                .methods = (const virtual_server_method_t[]) {
                        {
-                               .name = "ippool",
+                               .name1 = "ippool",
                                .name2 = "extend",
                        },
                        COMPILE_TERMINATOR
@@ -456,23 +456,23 @@ static const virtual_server_compile_t compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Ack",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(ack),
        },
        {
                .name1 = "send",
                .name2 = "NAK",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(nak),
        },
        {
                .name1 = "recv",
                .name2 = "Decline",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
 
                .methods = (const virtual_server_method_t[]) {
                        {
-                               .name = "ippool",
+                               .name1 = "ippool",
                                .name2 = "mark",
                        },
                        COMPILE_TERMINATOR
@@ -483,11 +483,11 @@ static const virtual_server_compile_t compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Release",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
 
                .methods = (const virtual_server_method_t[]) {
                        {
-                               .name = "ippool",
+                               .name1 = "ippool",
                                .name2 = "release",
                        },
                        COMPILE_TERMINATOR
@@ -497,39 +497,39 @@ static const virtual_server_compile_t compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Inform",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(inform),
        },
 
        {
                .name1 = "recv",
                .name2 = "Lease-Query",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(lease_query),
        },
        {
                .name1 = "send",
                .name2 = "Lease-Unassigned",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(lease_unassigned),
        },
        {
                .name1 = "send",
                .name2 = "Lease-Unknown",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(lease_unknown),
        },
        {
                .name1 = "send",
                .name2 = "Lease-Active",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(lease_active),
        },
 
        {
                .name1 = "send",
                .name2 = "Do-Not-Respond",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
 
index 1479513c79ec81051693888a5e58b27686d563e0..d457766e69db7faaa5087fb9d32e9d2f5037f933 100644 (file)
@@ -196,86 +196,86 @@ static const virtual_server_compile_t compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Solicit",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_solicit)
        },
        {
                .name1 = "recv",
                .name2 = "Request",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_request)
        },
        {
                .name1 = "recv",
                .name2 = "Confirm",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_confirm)
        },
        {
                .name1 = "recv",
                .name2 = "Renew",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_renew)
        },
        {
                .name1 = "recv",
                .name2 = "Rebind",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_rebind)
        },
        {
                .name1 = "recv",
                .name2 = "Release",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_release)
        },
        {
                .name1 = "recv",
                .name2 = "Decline",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_decline)
        },
        {
                .name1 = "recv",
                .name2 = "Reconfigure",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_reconfigure)
        },
        {
                .name1 = "recv",
                .name2 = "Information-Request",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_information_request)
        },
        {
                .name1 = "recv",
                .name2 = "Relay-Forward",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_relay_forward)
        },
 
        {
                .name1 = "send",
                .name2 = "Advertise",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(send_advertise)
        },
        {
                .name1 = "send",
                .name2 = "Reply",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(send_reply)
        },
        {
                .name1 = "send",
                .name2 = "Relay-Reply",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(send_relay_reply)
        },
        {
                .name1 = "send",
                .name2 = "Do-Not-Respond",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond)
        },
 
index 3857f46c2bfbb75f223d2e30b915d07a3f3b179d..2ea52b6f3e95e7e3437a200c78e4310b1b50dff6 100644 (file)
@@ -22,7 +22,6 @@
  * @copyright 2024 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
  * @copyright 2020 Network RADIUS SAS (legal@networkradius.com)
  */
-#include "lib/server/components.h"
 #include "lib/server/rcode.h"
 #include <freeradius-devel/server/protocol.h>
 #include <freeradius-devel/server/pair.h>
@@ -133,75 +132,75 @@ static const virtual_server_compile_t compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Query",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(query),
        },
        {
                .name1 = "send",
                .name2 = "Query-Response",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(query_response),
        },
        {
                .name1 = "recv",
                .name2 = "Inverse-Query",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(inverse_query),
        },
        {
                .name1 = "send",
                .name2 = "Inverse-Query-Response",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(inverse_query_response),
        },
        {
                .name1 = "recv",
                .name2 = "Status",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(status),
        },
        {
                .name1 = "send",
                .name2 = "Status-Response",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(status_response),
        },
        {
                .name1 = "recv",
                .name2 = "Update",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(update),
        },
        {
                .name1 = "send",
                .name2 = "Update-Response",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(update_response),
        },
        {
                .name1 = "recv",
                .name2 = "Stateful-Operation",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(stateful_operation),
        },
        {
                .name1 = "send",
                .name2 = "Stateful-Operation-Response",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(stateful_operation_response),
        },
        {
                .name1 = "send",
                .name2 = "Do-Not-Respond",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
 
 #define ERROR_SECTION(_name, _number) \
        { \
-               .name = "error", \
+               .name1 = "error", \
                .name2 = _name, \
-               .component = MOD_POST_AUTH, \
+               .actions = &mod_actions_postauth, \
                .offset = PROCESS_CONF_OFFSET(rcode[_number]), \
        }
 
index 28df461ed0e1f00c4522880a907f1e126016c0e3..d3422644f6cef45fe0e6fa06a0200b17ea2ca39d 100644 (file)
@@ -56,13 +56,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Identity-Response",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_identity_response)
        },
        {
                .name1 = "send",
                .name2 = "Identity-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_identity_request)
        },
 
@@ -74,13 +74,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "send",
                .name2 = "AKA-Identity-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_aka_identity_request)
        },
        {
                .name1 = "recv",
                .name2 = "AKA-Identity-Response",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_identity_response)
        },
 
@@ -90,13 +90,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Challenge-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_aka_challenge_request)
        },
        {
                .name1 = "recv",
                .name2 = "Challenge-Response",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_challenge_response)
        },
 
@@ -106,13 +106,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Reauthentication-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_reauthentication_request)
        },
        {
                .name1 = "recv",
                .name2 = "Reauthentication-Response",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_reauthentication_response)
        },
 
@@ -122,19 +122,19 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Client-Error",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_client_error)
        },
        {
                .name1 = "recv",
                .name2 = "Authentication-Reject",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_authentication_reject)
        },
        {
                .name1 = "recv",
                .name2 = "Synchronization-Failure",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_synchronization_failure)
        },
 
@@ -144,13 +144,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Failure-Notification",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_failure_notification)
        },
        {
                .name1 = "recv",
                .name2 = "Failure-Notification-ACK",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_failure_notification_ack)
        },
 
@@ -160,13 +160,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Success-Notification",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_success_notification)
        },
        {
                .name1 = "recv",
                .name2 = "Success-Notification-ACK",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_success_notification_ack)
        },
 
@@ -176,13 +176,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "send",
                .name2 = "EAP-Success",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_eap_success)
        },
        {
                .name1 = "send",
                .name2 = "EAP-Failure",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_eap_failure)
        },
 
@@ -192,19 +192,19 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "store",
                .name2 = "session",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.store_session)
        },
        {
                .name1 = "load",
                .name2 = "session",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.load_session)
        },
        {
                .name1 = "clear",
                .name2 = "session",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.clear_session)
        },
 
@@ -214,19 +214,19 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "store",
                .name2 = "pseudonym",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.store_pseudonym)
        },
        {
                .name1 = "load",
                .name2 = "pseudonym",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.load_pseudonym)
        },
        {
                .name1 = "clear",
                .name2 = "pseudonym",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.clear_pseudonym)
        },
 
index 1da26715eaa10d13eca5d771f902a6e35145871e..949fcfc987d33863354f51efdd6a40b806b4e183 100644 (file)
@@ -57,13 +57,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Identity-Response",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_identity_response)
        },
        {
                .name1 = "send",
                .name2 = "Identity-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_identity_request)
        },
 
@@ -75,13 +75,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "send",
                .name2 = "AKA-Identity-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_aka_identity_request)
        },
        {
                .name1 = "recv",
                .name2 = "AKA-Identity-Response",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_identity_response)
        },
 
@@ -91,13 +91,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Challenge-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_aka_challenge_request)
        },
        {
                .name1 = "recv",
                .name2 = "Challenge-Response",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_challenge_response)
        },
 
@@ -107,13 +107,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Reauthentication-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_reauthentication_request)
        },
        {
                .name1 = "recv",
                .name2 = "Reauthentication-Response",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_reauthentication_response)
        },
 
@@ -123,19 +123,19 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Client-Error",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_client_error)
        },
        {
                .name1 = "recv",
                .name2 = "Authentication-Reject",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_authentication_reject)
        },
        {
                .name1 = "recv",
                .name2 = "Synchronization-Failure",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_synchronization_failure)
        },
 
@@ -145,13 +145,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Failure-Notification",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_failure_notification)
        },
        {
                .name1 = "recv",
                .name2 = "Failure-Notification-ACK",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_failure_notification_ack)
        },
 
@@ -161,13 +161,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Success-Notification",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_success_notification)
        },
        {
                .name1 = "recv",
                .name2 = "Success-Notification-ACK",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_success_notification_ack)
        },
 
@@ -177,13 +177,13 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "send",
                .name2 = "EAP-Success",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_eap_success)
        },
        {
                .name1 = "send",
                .name2 = "EAP-Failure",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_eap_failure)
        },
 
@@ -193,19 +193,19 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "store",
                .name2 = "session",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.store_session)
        },
        {
                .name1 = "load",
                .name2 = "session",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.load_session)
        },
        {
                .name1 = "clear",
                .name2 = "session",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.clear_session)
        },
 
@@ -215,19 +215,19 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "store",
                .name2 = "pseudonym",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.store_pseudonym)
        },
        {
                .name1 = "load",
                .name2 = "pseudonym",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.load_pseudonym)
        },
        {
                .name1 = "clear",
                .name2 = "pseudonym",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.clear_pseudonym)
        },
 
index f4f231da141080bcbea0bf86dff6e9c93c1f5eaa..5f2083d0792253c9803c764a4d1fe09e6dd35776 100644 (file)
@@ -56,13 +56,13 @@ static virtual_server_compile_t compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Identity-Response",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_identity_response)
        },
        {
                .name1 = "send",
                .name2 = "Identity-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_identity_request)
        },
 
@@ -74,13 +74,13 @@ static virtual_server_compile_t compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Start-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_sim_start_request)
        },
        {
                .name1 = "recv",
                .name2 = "Start-Response",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_sim_start_response)
        },
 
@@ -90,13 +90,13 @@ static virtual_server_compile_t compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Challenge-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_sim_challenge_request)
        },
        {
                .name1 = "recv",
                .name2 = "Challenge-Response",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_sim_challenge_response)
        },
 
@@ -106,13 +106,13 @@ static virtual_server_compile_t compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Reauthentication-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_reauthentication_request)
        },
        {
                .name1 = "recv",
                .name2 = "Reauthentication-Response",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_reauthentication_response)
        },
 
@@ -122,7 +122,7 @@ static virtual_server_compile_t compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Client-Error",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_client_error)
        },
 
@@ -132,13 +132,13 @@ static virtual_server_compile_t compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Failure-Notification",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_failure_notification)
        },
        {
                .name1 = "recv",
                .name2 = "Failure-Notification-ACK",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_failure_notification_ack)
        },
 
@@ -148,13 +148,13 @@ static virtual_server_compile_t compile_list[] = {
        {
                .name1 = "send",
                .name2 = "Success-Notification",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_success_notification)
        },
        {
                .name1 = "recv",
                .name2 = "Success-Notification-ACK",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_success_notification_ack)
        },
 
@@ -164,13 +164,13 @@ static virtual_server_compile_t compile_list[] = {
        {
                .name1 = "send",
                .name2 = "EAP-Success",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_eap_success)
        },
        {
                .name1 = "send",
                .name2 = "EAP-Failure",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_eap_failure)
        },
 
@@ -180,19 +180,19 @@ static virtual_server_compile_t compile_list[] = {
        {
                .name1 = "store",
                .name2 = "session",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.store_session)
        },
        {
                .name1 = "load",
                .name2 = "session",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.load_session)
        },
        {
                .name1 = "clear",
                .name2 = "session",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.clear_session)
        },
 
@@ -202,19 +202,19 @@ static virtual_server_compile_t compile_list[] = {
        {
                .name1 = "store",
                .name2 = "pseudonym",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.store_pseudonym)
        },
        {
                .name1 = "load",
                .name2 = "pseudonym",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.load_pseudonym)
        },
        {
                .name1 = "clear",
                .name2 = "pseudonym",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.clear_pseudonym)
        },
 
index f99f9c2065470bdfe1caed7e3a3d267f3a39dbe4..0ca25aa1757f45ee836e9088b1fc01daa97e9157 100644 (file)
@@ -197,37 +197,37 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "load",
                .name2 = "Cookie",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(load_cookie)
        },
        {
                .name1 = "store",
                .name2 = "Cookie",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(store_cookie)
        },
        {
                .name1 = "recv",
                .name2 = "Add",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(recv_add)
        },
        {
                .name1 = "recv",
                .name2 = "Present",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(recv_present)
        },
        {
                .name1 = "recv",
                .name2 = "Delete",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(recv_delete)
        },
        {
                .name1 = "recv",
                .name2 = "Modify",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(recv_modify)
        },
 
index ca55210d6c6befa9732ea146826a99c8cae5d157..cdea6986770d5170227f3e1f10383d8769c2136f 100644 (file)
@@ -1100,103 +1100,103 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Access-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(access_request),
        },
        {
                .name1 = "send",
                .name2 = "Access-Accept",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(access_accept),
        },
        {
                .name1 = "send",
                .name2 = "Access-Challenge",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(access_challenge),
        },
        {
                .name1 = "send",
                .name2 = "Access-Reject",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(access_reject),
        },
 
        {
                .name1 = "recv",
                .name2 = "Accounting-Request",
-               .component = MOD_PREACCT,
+               .actions = &mod_actions_preacct,
                .offset = PROCESS_CONF_OFFSET(accounting_request),
        },
        {
                .name1 = "send",
                .name2 = "Accounting-Response",
-               .component = MOD_ACCOUNTING,
+               .actions = &mod_actions_accounting,
                .offset = PROCESS_CONF_OFFSET(accounting_response),
        },
 
        {
                .name1 = "recv",
                .name2 = "Status-Server",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(status_server),
        },
        {
                .name1 = "recv",
                .name2 = "CoA-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(coa_request),
        },
        {
                .name1 = "send",
                .name2 = "CoA-ACK",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(coa_ack),
        },
        {
                .name1 = "send",.name2 = "CoA-NAK",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(coa_nak),
        },
        {
                .name1 = "recv",
                .name2 = "Disconnect-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(disconnect_request),
        },
        {
                .name1 = "send",
                .name2 = "Disconnect-ACK",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(disconnect_ack),
        },
        {
                .name1 = "send",
                .name2 = "Disconnect-NAK",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(disconnect_nak),
        },
        {
                .name1 = "send",
                .name2 = "Protocol-Error",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(protocol_error),
        },
        {
                .name1 = "send",
                .name2 = "Do-Not-Respond",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
        {
                .name1 = "authenticate",
                .name2 = CF_IDENT_ANY,
-               .component = MOD_AUTHENTICATE
+               .actions = &mod_actions_authenticate
        },
        {
                .name1 = "accounting",
                .name2 = CF_IDENT_ANY,
-               .component = MOD_AUTHENTICATE
+               .actions = &mod_actions_authenticate
        },
 
        DYNAMIC_CLIENT_SECTIONS,
index fa25b28cbbdc3afbdf1c8cd050b5d84c4b4a7fba..5992df75f798102aac849f588ec8b541e7f8310e 100644 (file)
@@ -1324,68 +1324,68 @@ static virtual_server_compile_t compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Authentication-Start",
-               .component = MOD_AUTHENTICATE,
+               .actions = &mod_actions_authenticate,
                .offset = PROCESS_CONF_OFFSET(auth_start),
        },
        {
                .name1 = "send",
                .name2 = "Authentication-Pass",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_pass),
        },
        {
                .name1 = "send",
                .name2 = "Authentication-Fail",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_fail),
        },
        {
                .name1 = "send",
                .name2 = "Authentication-GetData",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_getdata),
        },
        {
                .name1 = "send",
                .name2 = "Authentication-GetUser",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_getuser),
        },
        {
                .name1 = "send",
                .name2 = "Authentication-GetPass",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_getpass),
        },
        {
                .name1 = "send",
                .name2 = "Authentication-Restart",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_restart),
        },
        {
                .name1 = "send",
                .name2 = "Authentication-Error",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_error),
        },
        {
                .name1 = "recv",
                .name2 = "Authentication-Continue",
-               .component = MOD_AUTHENTICATE,
+               .actions = &mod_actions_authenticate,
                .offset = PROCESS_CONF_OFFSET(auth_cont),
        },
        {
                .name1 = "recv",
                .name2 = "Authentication-Continue-Abort",
-               .component = MOD_AUTHENTICATE,
+               .actions = &mod_actions_authenticate,
                .offset = PROCESS_CONF_OFFSET(auth_cont_abort),
        },
 
        {
                .name1 = "authenticate",
                .name2 = CF_IDENT_ANY,
-               .component = MOD_AUTHENTICATE,
+               .actions = &mod_actions_authenticate,
        },
 
        /* authorization */
@@ -1393,31 +1393,31 @@ static virtual_server_compile_t compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Authorization-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(autz_request),
        },
        {
                .name1 = "send",
                .name2 = "Authorization-Pass-Add",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(autz_pass_add),
        },
        {
                .name1 = "send",
                .name2 = "Authorization-Pass-Replace",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(autz_pass_replace),
        },
        {
                .name1 = "send",
                .name2 = "Authorization-Fail",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(autz_fail),
        },
        {
                .name1 = "send",
                .name2 = "Authorization-Error",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(autz_error),
        },
 
@@ -1426,32 +1426,32 @@ static virtual_server_compile_t compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Accounting-Request",
-               .component = MOD_ACCOUNTING,
+               .actions = &mod_actions_accounting,
                .offset = PROCESS_CONF_OFFSET(acct_request),
        },
        {
                .name1 = "send",
                .name2 = "Accounting-Success",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(acct_success),
        },
        {
                .name1 = "send",
                .name2 = "Accounting-Error",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(acct_error),
        },
 
        {
                .name1 = "accounting",
                .name2 = CF_IDENT_ANY,
-               .component = MOD_ACCOUNTING,
+               .actions = &mod_actions_accounting,
        },
 
        {
                .name1 = "send",
                .name2 = "Do-Not-Respond",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
 
index 08de97b3b46e43cd271b09957b775a5d5bd15edb..fc80193f053dd6de4af6da751bada6d652ce856c 100644 (file)
@@ -107,13 +107,13 @@ static const virtual_server_compile_t compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Request",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_request),
        },
        {
                .name1 = "send",
                .name2 = "Reply",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(send_reply),
        },
 
index d484ccdb054d3fb56e56a42fc741ebed7311e184..e71a8acf3aee51414dbc5c5d3ae219df8a35f56d 100644 (file)
@@ -154,25 +154,25 @@ static const virtual_server_compile_t compile_list[] = {
        {
                .name1 = "store",
                .name2 = "session",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(store_session)
        },
        {
                .name1 = "load",
                .name2 = "session",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(load_session)
        },
        {
                .name1 = "clear",
                .name2 = "session",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(clear_session)
        },
        {
                .name1 = "verify",
                .name2 = "certificate",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(verify_certificate)
        },
        COMPILE_TERMINATOR
index 7b1f79f2c65645894a3aeac97e1a3bdc4b35b732..b99733249ea971835989a54a2f109681542af3b2 100644 (file)
@@ -622,44 +622,44 @@ static virtual_server_compile_t const compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Access-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(access_request),
        },
        {
                .name1 = "send",
                .name2 = "Access-Accept",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(access_accept),
        },
        {
                .name1 = "send",
                .name2 = "Access-Challenge",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(access_challenge),
        },
        {
                .name1 = "send",
                .name2 = "Access-Reject",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(access_reject),
        },
 
        {
                .name1 = "send",
                .name2 = "Protocol-Error",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(protocol_error),
        },
        {
                .name1 = "send",
                .name2 = "Do-Not-Respond",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
        {
                .name1 = "authenticate",
                .name2 = CF_IDENT_ANY,
-               .component = MOD_AUTHENTICATE
+               .actions = &mod_actions_authenticate
        },
        COMPILE_TERMINATOR
 };
index 481df2cebf69cb7b862646c836f16c10fd9d26c2..9e767f130948174dc96b19c715fd5530df62305f 100644 (file)
@@ -230,31 +230,31 @@ static const virtual_server_compile_t compile_list[] = {
        {
                .name1 = "recv",
                .name2 = "Join-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(join_request),
        },
        {
                .name1 = "send",
                .name2 = "Join-Response",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(join_response),
        },
        {
                .name1 = "recv",
                .name2 = "Reconfirm-Request",
-               .component = MOD_AUTHORIZE,
+               .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(reconfirm_request),
        },
        {
                .name1 = "send",
                .name2 = "Reconfirm-Response",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(reconfirm_response),
        },
        {
                .name1 = "send",
                .name2 = "Do-Not-Respond",
-               .component = MOD_POST_AUTH,
+               .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
 
index 61838a5d134c2c524dbecaea94ce2dec2be2f5d9..74e48db78e009ea01d578223befe7af41d7451d5 100644 (file)
@@ -105,7 +105,7 @@ modules {
 }
 
 policy {
-       files.authorize {
+       files {
                split_username_nai
                if (&Stripped-User-Name == "bob") {
                        &control.Password.Cleartext := "bob"
index 0a15afe2542dcc63880b4bd8c2c45382eea63100..332cd2101f59c951486b2b1aaf87153fa9d65980 100644 (file)
@@ -4,6 +4,8 @@
 #  The main problem is that conf section references
 #  also have dots in them...
 #
-with.dots
+
+# FIXME - Doesn't currently work
+#with.dots
 
 success