]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add "parent" or "base" pointer to custom parsing functions
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 27 Jun 2018 00:54:22 +0000 (20:54 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 28 Jun 2018 00:47:28 +0000 (20:47 -0400)
This allows parsing functions to access fields in the structure for previously parsed values... and potentially adds ordering issues, so don't reorder the CONF_PARSER entries that have functions!

17 files changed:
src/include/cf_parse.h
src/lib/tls/conf.c
src/main/cf_parse.c
src/main/cf_util.c
src/main/mainconfig.c
src/main/virtual_servers.c
src/modules/proto_control/proto_control.c
src/modules/proto_detail/proto_detail.c
src/modules/proto_dhcpv4/proto_dhcpv4.c
src/modules/proto_radius/proto_radius.c
src/modules/proto_vmps/proto_vmps.c
src/modules/rlm_cipher/rlm_cipher.c
src/modules/rlm_eap/rlm_eap.c
src/modules/rlm_eap/types/rlm_eap_gtc/rlm_eap_gtc.c
src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c
src/modules/rlm_eap/types/rlm_eap_peap/rlm_eap_peap.c
src/modules/rlm_radius/rlm_radius.c

index 02149601d0d16fff1c7221ed0169bc022be495e5..4a12b98d0974d56ad68d5e4c7228fd3d0a3780c8 100644 (file)
@@ -355,13 +355,14 @@ typedef struct CONF_PARSER CONF_PARSER;
  *
  * @param[in] ctx      to allocate any data in.
  * @param[out] out     Where to write the result of parsing.
+ * @param[in] parent   The base address of the structure.
  * @param[in] ci       The #CONF_SECTION or #CONF_PAIR to parse.
  * @param[in] rule     Parse rules - How the #CONF_PAIR or #CONF_SECTION should be converted.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-typedef int (* cf_parse_t)(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
+typedef int (* cf_parse_t)(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
 
 /** Defines a #CONF_PAIR to C data type mapping
  *
@@ -452,8 +453,8 @@ struct CONF_PARSER {
 /*
  *     Type validation and conversion
  */
-int            cf_pair_parse_value(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule)
-               CC_HINT(nonnull(2, 3, 4));
+int            cf_pair_parse_value(TALLOC_CTX *ctx, void *out, void *base, CONF_ITEM *ci, CONF_PARSER const *rule)
+               CC_HINT(nonnull(2, 4, 5));
 int            cf_pair_parse(TALLOC_CTX *ctx, CONF_SECTION *cs, char const *name,
                              unsigned int type, void *data, char const *dflt, FR_TOKEN dflt_quote) CC_HINT(nonnull(2,3));
 int            cf_section_parse(TALLOC_CTX *ctx, void *base, CONF_SECTION *cs);
index 827ac6cfc3ba0d2e200a8f6061f23b16107c961b..c99b9014e79526f02f07036c3fa25cfa67bf2a1e 100644 (file)
@@ -61,9 +61,11 @@ static const FR_NAME_NUMBER chain_verify_mode_table[] = {
 #endif
 
 #if OPENSSL_VERSION_NUMBER >= 0x10002000L
-static int chain_verify_mode_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int chain_verify_mode_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                                  CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
 #endif
-static int certificate_format_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int certificate_format_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                                        CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
 
 static CONF_PARSER cache_config[] = {
        { FR_CONF_OFFSET("virtual_server", FR_TYPE_STRING, fr_tls_conf_t, session_cache_server) },
@@ -227,7 +229,8 @@ CONF_PARSER tls_client_config[] = {
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int chain_verify_mode_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int chain_verify_mode_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                                  CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        fr_tls_chain_verify_mode_t      type;
        char const                      *type_str;
@@ -255,7 +258,8 @@ static int chain_verify_mode_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int certificate_format_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int certificate_format_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                                        CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        int             type;
        char const      *type_str;
index ee297656145538f6fd36fa7de408c290106a8401..46a8b6e3dac262f148a0b6a61b2bcc82cd5f43e6 100644 (file)
@@ -109,13 +109,15 @@ static inline int CC_HINT(nonnull) fr_item_validate_ipaddr(CONF_SECTION *cs, cha
  *
  * @param[in] ctx      to allocate any dynamic buffers in.
  * @param[out] out     Where to write the parsed value.
+ * @param[in] base     address of the structure out points into.
+ *                     May be NULL in the case of manual parsing.
  * @param[in] ci       to parse.
  * @param[in] rule     to parse to.  May contain flags.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-int cf_pair_parse_value(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule)
+int cf_pair_parse_value(TALLOC_CTX *ctx, void *out, UNUSED void *base, CONF_ITEM *ci, CONF_PARSER const *rule)
 {
        int             rcode = 0;
        bool            attribute, required, secret, file_input, cant_be_empty, tmpl, file_exists;
@@ -504,6 +506,8 @@ static int cf_pair_default(CONF_PAIR **out, CONF_SECTION *cs, char const *name,
  *
  * @param[in] ctx      To allocate arrays and values in.
  * @param[out] out     Where to write the result.
+ * @param[in] base     address of the structure out points into.
+ *                     May be NULL in the case of manual parsing.
  * @param[in] cs       to search for matching #CONF_PAIR in.
  * @param[in] rule     to parse #CONF_PAIR with.
  * @return
@@ -512,7 +516,7 @@ static int cf_pair_default(CONF_PAIR **out, CONF_SECTION *cs, char const *name,
  *     - -1 on error.
  *     - -2 if deprecated.
  */
-static int CC_HINT(nonnull(3,4)) cf_pair_parse_internal(TALLOC_CTX *ctx, void *out,
+static int CC_HINT(nonnull(4,5)) cf_pair_parse_internal(TALLOC_CTX *ctx, void *out, void *base,
                                                        CONF_SECTION *cs, CONF_PARSER const *rule)
 {
        bool            multi, required, deprecated;
@@ -680,7 +684,7 @@ static int CC_HINT(nonnull(3,4)) cf_pair_parse_internal(TALLOC_CTX *ctx, void *o
                                func = cf_pair_parse_value;
                        }
 
-                       ret = func(value_ctx, entry, cf_pair_to_item(cp), rule);
+                       ret = func(value_ctx, entry, base, cf_pair_to_item(cp), rule);
                        if (ret < 0) {
                                talloc_free(array);
                                talloc_free(dflt_cp);
@@ -730,7 +734,7 @@ static int CC_HINT(nonnull(3,4)) cf_pair_parse_internal(TALLOC_CTX *ctx, void *o
                        func = rule->func;
                }
 
-               ret = func(ctx, out, cf_pair_to_item(cp), rule);
+               ret = func(ctx, out, base, cf_pair_to_item(cp), rule);
                if (ret < 0) {
                        talloc_free(dflt_cp);
                        return -1;
@@ -830,7 +834,7 @@ int cf_pair_parse(TALLOC_CTX *ctx, CONF_SECTION *cs, char const *name,
                .quote = dflt_quote
        };
 
-       return cf_pair_parse_internal(ctx, data, cs, &rule);
+       return cf_pair_parse_internal(ctx, data, NULL, cs, &rule);
 }
 
 /** Pre-allocate a config section structure to allow defaults to be set
@@ -957,16 +961,18 @@ static void cf_section_parse_warn(CONF_SECTION *cs)
  *     For now we have a horrible hack where only multi-subsections get an array of structures
  *     of the appropriate size.
  *
- * @param[in] ctx              to allocate any additional structures under.
- * @param[out] out             pointer to a struct/pointer to fill with data.
- * @param[in] cs               to parse.
- * @param[in] rule             to parse the subcs with.
+ * @param[in] ctx      to allocate any additional structures under.
+ * @param[out] out     pointer to a struct/pointer to fill with data.
+ * @param[in] base     address of the structure out points into.
+ *                     May be NULL in the case of manual parsing.
+ * @param[in] cs       to parse.
+ * @param[in] rule     to parse the subcs with.
  * @return
  *     - 0 on success.
  *     - -1 on general error.
  *     - -2 if a deprecated #CONF_ITEM was found.
  */
-static int cf_subsection_parse(TALLOC_CTX *ctx, void *out, CONF_SECTION *cs, CONF_PARSER const *rule)
+static int cf_subsection_parse(TALLOC_CTX *ctx, void *out, void *base, CONF_SECTION *cs, CONF_PARSER const *rule)
 {
        CONF_SECTION            *subcs = NULL;
        int                     count = 0, i = 0, ret;
@@ -996,7 +1002,7 @@ static int cf_subsection_parse(TALLOC_CTX *ctx, void *out, CONF_SECTION *cs, CON
                 *      if it wants to continue after doing its stuff.
                 */
                if (cf_section_rules_push(subcs, rules) < 0) return -1;
-               if (rule->func) return rule->func(ctx, out, cf_section_to_item(subcs), rule);
+               if (rule->func) return rule->func(ctx, out, base, cf_section_to_item(subcs), rule);
 
                /*
                 *      FIXME: We shouldn't allow nested structures like this.
@@ -1066,7 +1072,7 @@ static int cf_subsection_parse(TALLOC_CTX *ctx, void *out, CONF_SECTION *cs, CON
                        return -1;
                }
                if (rule->func) {
-                       ret = rule->func(ctx, buff, cf_section_to_item(subcs), rule);
+                       ret = rule->func(ctx, buff, base, cf_section_to_item(subcs), rule);
                        if (ret < 0) {
                                talloc_free(array);
                                return ret;
@@ -1135,7 +1141,7 @@ int cf_section_parse(TALLOC_CTX *ctx, void *base, CONF_SECTION *cs)
                 *      Handle subsections specially
                 */
                if (FR_BASE_TYPE(rule->type) == FR_TYPE_SUBSECTION) {
-                       ret = cf_subsection_parse(ctx, data, cs, rule);
+                       ret = cf_subsection_parse(ctx, data, base, cs, rule);
                        if (ret < 0) goto finish;
                        continue;
                } /* else it's a CONF_PAIR */
@@ -1161,7 +1167,7 @@ int cf_section_parse(TALLOC_CTX *ctx, void *base, CONF_SECTION *cs)
                /*
                 *      Parse the pair we found, or a default value.
                 */
-               ret = cf_pair_parse_internal(ctx, data, cs, rule);
+               ret = cf_pair_parse_internal(ctx, data, base, cs, rule);
                switch (ret) {
                case 1:         /* Used default (or not present) */
                        if (is_set) *is_set = false;
index 8660c75d87ecdf0077476879a9ac99bcda53daa9..9de500b74e3dd43267e1d75fdc85d9f0f1a11b4b 100644 (file)
@@ -762,7 +762,7 @@ CONF_SECTION *_cf_section_alloc(TALLOC_CTX *ctx, CONF_SECTION *parent,
                                            ((rule_p->type & FR_TYPE_ON_READ) != 0) &&
                                            (strcmp(rule_p->name, name1) == 0)) {
                                                (void) _cf_section_rule_push(cs, rule_p, cd->item.filename, cd->item.lineno);
-                                               (void) rule_p->func(ctx, NULL, cf_section_to_item(cs), rule_p);
+                                               (void) rule_p->func(ctx, NULL, NULL, cf_section_to_item(cs), rule_p);
                                                return cs;
                                        }
                                }
@@ -782,7 +782,7 @@ CONF_SECTION *_cf_section_alloc(TALLOC_CTX *ctx, CONF_SECTION *parent,
                            ((rule->type & FR_TYPE_ON_READ) != 0)) {
                                (void) cf_section_rules_push(cs, rule);
 
-                               (void) rule->func(ctx, NULL, cf_section_to_item(cs), rule);
+                               (void) rule->func(ctx, NULL, NULL, cf_section_to_item(cs), rule);
                        }
                }
        }
index ad85c7077c060a0ecefa7f4c21a160a80e4b300a..afe589d98b1935916d2b9aaebf340bbc1ad064fb 100644 (file)
@@ -63,18 +63,18 @@ fr_log_t            debug_log = { .fd = -1, .dst = L_DST_NULL };
  *
  **********************************************************************/
 
-static int reverse_lookups_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int hostname_lookups_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int reverse_lookups_parse(TALLOC_CTX *ctx, void *out, void *parent,CONF_ITEM *ci, CONF_PARSER const *rule);
+static int hostname_lookups_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
 
-static int num_networks_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int num_workers_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int num_networks_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int num_workers_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
 
-static int talloc_memory_limit_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int talloc_pool_size_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int talloc_memory_limit_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int talloc_pool_size_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
 
-static int max_request_time_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int max_request_time_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
 
-static int name_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int name_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
 
 /*
  *     Log destinations
@@ -237,34 +237,37 @@ static const CONF_PARSER switch_users_config[] = {
        CONF_PARSER_TERMINATOR
 };
 
-static int reverse_lookups_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule)
+static int reverse_lookups_parse(TALLOC_CTX *ctx, void *out, void *parent,
+                                CONF_ITEM *ci, CONF_PARSER const *rule)
 {
        int     ret;
 
-       if ((ret = cf_pair_parse_value(ctx, out, ci, rule)) < 0) return ret;
+       if ((ret = cf_pair_parse_value(ctx, out, parent, ci, rule)) < 0) return ret;
 
        memcpy(&fr_reverse_lookups, out, sizeof(fr_reverse_lookups));
 
        return 0;
 }
 
-static int hostname_lookups_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule)
+static int hostname_lookups_parse(TALLOC_CTX *ctx, void *out, void *parent,
+                                 CONF_ITEM *ci, CONF_PARSER const *rule)
 {
        int     ret;
 
-       if ((ret = cf_pair_parse_value(ctx, out, ci, rule)) < 0) return ret;
+       if ((ret = cf_pair_parse_value(ctx, out, parent, ci, rule)) < 0) return ret;
 
        memcpy(&fr_hostname_lookups, out, sizeof(fr_hostname_lookups));
 
        return 0;
 }
 
-static int talloc_memory_limit_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule)
+static int talloc_memory_limit_parse(TALLOC_CTX *ctx, void *out, void *parent,
+                                    CONF_ITEM *ci, CONF_PARSER const *rule)
 {
        int     ret;
        size_t  value;
 
-       if ((ret = cf_pair_parse_value(ctx, out, ci, rule)) < 0) return ret;
+       if ((ret = cf_pair_parse_value(ctx, out, parent, ci, rule)) < 0) return ret;
 
        memcpy(&value, out, sizeof(value));
 
@@ -281,12 +284,13 @@ static int talloc_memory_limit_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci,
        return 0;
 }
 
-static int talloc_pool_size_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule)
+static int talloc_pool_size_parse(TALLOC_CTX *ctx, void *out, void *parent,
+                                 CONF_ITEM *ci, CONF_PARSER const *rule)
 {
        int     ret;
        size_t  value;
 
-       if ((ret = cf_pair_parse_value(ctx, out, ci, rule)) < 0) return ret;
+       if ((ret = cf_pair_parse_value(ctx, out, parent, ci, rule)) < 0) return ret;
 
        memcpy(&value, out, sizeof(value));
 
@@ -298,12 +302,13 @@ static int talloc_pool_size_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CON
        return 0;
 }
 
-static int max_request_time_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule)
+static int max_request_time_parse(TALLOC_CTX *ctx, void *out, void *parent,
+                                 CONF_ITEM *ci, CONF_PARSER const *rule)
 {
        int             ret;
        uint32_t        value;
 
-       if ((ret = cf_pair_parse_value(ctx, out, ci, rule)) < 0) return ret;
+       if ((ret = cf_pair_parse_value(ctx, out, parent, ci, rule)) < 0) return ret;
 
        memcpy(&value, out, sizeof(value));
 
@@ -315,12 +320,13 @@ static int max_request_time_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CON
 }
 
 
-static int num_networks_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule)
+static int num_networks_parse(TALLOC_CTX *ctx, void *out, void *parent,
+                             CONF_ITEM *ci, CONF_PARSER const *rule)
 {
        int             ret;
        uint32_t        value;
 
-       if ((ret = cf_pair_parse_value(ctx, out, ci, rule)) < 0) return ret;
+       if ((ret = cf_pair_parse_value(ctx, out, parent, ci, rule)) < 0) return ret;
 
        memcpy(&value, out, sizeof(value));
 
@@ -331,12 +337,13 @@ static int num_networks_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PA
        return 0;
 }
 
-static int num_workers_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule)
+static int num_workers_parse(TALLOC_CTX *ctx, void *out, void *parent,
+                            CONF_ITEM *ci, CONF_PARSER const *rule)
 {
        int             ret;
        uint32_t        value;
 
-       if ((ret = cf_pair_parse_value(ctx, out, ci, rule)) < 0) return ret;
+       if ((ret = cf_pair_parse_value(ctx, out, parent, ci, rule)) < 0) return ret;
 
        memcpy(&value, out, sizeof(value));
 
@@ -351,11 +358,12 @@ static int num_workers_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PAR
 /** Configured server name takes precedence over default values
  *
  */
-static int name_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule)
+static int name_parse(TALLOC_CTX *ctx, void *out, void *parent,
+                     CONF_ITEM *ci, CONF_PARSER const *rule)
 {
        if (*((char **)out)) talloc_free(*((char **)out));      /* Free existing buffer */
 
-       return cf_pair_parse_value(ctx, out, ci, rule);         /* Set new value */
+       return cf_pair_parse_value(ctx, out, parent, ci, rule);         /* Set new value */
 }
 
 
index 167e71ae118720ee09f02c65cf74a5fabb1900ca..9f0aabec867fe1bb09b535420e685c451233d30c 100644 (file)
@@ -97,11 +97,11 @@ static fr_virtual_server_t **virtual_servers;
  */
 static CONF_SECTION *virtual_server_root;
 
-static int listen_on_read(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int server_on_read(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int listen_on_read(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int server_on_read(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
 
-static int listen_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int server_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int listen_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int server_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
 
 static const CONF_PARSER listen_on_read_config[] = {
        { FR_CONF_OFFSET("listen", FR_TYPE_SUBSECTION | FR_TYPE_MULTI | FR_TYPE_OK_MISSING | FR_TYPE_ON_READ,
@@ -153,13 +153,15 @@ const CONF_PARSER virtual_servers_config[] = {
  *
  * @param[in] ctx      to allocate data in.
  * @param[out] out     always NULL
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_SECTION containing the listen section.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int listen_on_read(UNUSED TALLOC_CTX *ctx, UNUSED void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int listen_on_read(UNUSED TALLOC_CTX *ctx, UNUSED void *out, UNUSED void *parent,
+                         CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        CONF_SECTION            *listen_cs = cf_item_to_section(ci);
        CONF_SECTION            *server_cs = cf_item_to_section(cf_parent(ci));
@@ -179,13 +181,15 @@ static int listen_on_read(UNUSED TALLOC_CTX *ctx, UNUSED void *out, CONF_ITEM *c
  *
  * @param[in] ctx      to allocate data in.
  * @param[out] out     Where to our listen configuration.  Is a #fr_virtual_server_t structure.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_SECTION containing the listen section.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int server_on_read(UNUSED TALLOC_CTX *ctx, UNUSED void *out, UNUSED CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int server_on_read(UNUSED TALLOC_CTX *ctx, UNUSED void *out, UNUSED void *parent,
+                         UNUSED CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
 
        /*
@@ -199,13 +203,14 @@ static int server_on_read(UNUSED TALLOC_CTX *ctx, UNUSED void *out, UNUSED CONF_
  *
  * @param[in] ctx      to allocate data in.
  * @param[out] out     Where to our listen configuration.  Is a #fr_virtual_listen_t structure.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_SECTION containing the listen section.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int listen_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int listen_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        fr_virtual_listen_t     *listen = talloc_get_type_abort(out, fr_virtual_listen_t); /* Pre-allocated for us */
        CONF_SECTION            *listen_cs = cf_item_to_section(ci);
@@ -226,13 +231,15 @@ static int listen_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_P
  *
  * @param[in] ctx      to allocate data in.
  * @param[out] out     Where to our listen configuration.  Is a #fr_virtual_server_t structure.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_SECTION containing the listen section.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int server_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int server_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                       CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        fr_virtual_server_t     *server = talloc_get_type_abort(out, fr_virtual_server_t);
        CONF_SECTION            *server_cs = cf_item_to_section(ci);
index bb3da1823a66fdb699a9cc59432280db3259e4e3..9cfa3d3b7040dd0f9260b5644b92ca47dc025e10 100644 (file)
@@ -30,8 +30,8 @@
 #include "proto_control.h"
 
 extern fr_app_t proto_control;
-static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int transport_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
 
 static CONF_PARSER const limit_config[] = {
        { FR_CONF_OFFSET("idle_timeout", FR_TYPE_TIMEVAL, proto_control_t, io.idle_timeout), .dflt = "30.0" } ,
@@ -85,13 +85,14 @@ fr_dict_attr_autoload_t proto_control_dict_attr[] = {
  *
  * @param[in] ctx      to allocate data in (instance of proto_control).
  * @param[out] out     Where to write a dl_instance_t containing the module handle and instance.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the type module.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
 //     char const              *type_str = cf_pair_value(cf_item_to_pair(ci));
        CONF_SECTION            *listen_cs = cf_item_to_section(cf_parent(ci));
@@ -127,7 +128,7 @@ static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PAR
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int transport_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const      *name = cf_pair_value(cf_item_to_pair(ci));
        dl_instance_t   *parent_inst;
index cc4e4dec651e3005d441ad7504f2ce71695ac074..1c6a8bd9a900fead8244d58457e3d50b24e4cae7 100644 (file)
@@ -31,8 +31,8 @@
 #include "proto_detail.h"
 
 extern fr_app_t proto_detail;
-static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int transport_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
 
 #if 0
 /*
@@ -114,13 +114,14 @@ fr_dict_attr_autoload_t proto_detail_dict_attr[] = {
  *
  * @param[in] ctx      to allocate data in (instance of proto_detail).
  * @param[out] out     Where to write a dl_instance_t containing the module handle and instance.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the type module.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const              *type_str = cf_pair_value(cf_item_to_pair(ci));
        CONF_SECTION            *listen_cs = cf_item_to_section(cf_parent(ci));
@@ -197,7 +198,8 @@ static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PAR
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int transport_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                          CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const      *name = cf_pair_value(cf_item_to_pair(ci));
        dl_instance_t   *parent_inst;
index 48f406973a90847a29c4d95eb755d4362f492b32..6c4f055b6e5a8a8a9979bc799ce43d36c7e735ad 100644 (file)
 #include "proto_dhcpv4.h"
 
 extern fr_app_t proto_dhcpv4;
-static int priority_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
-static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int transport_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int priority_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                         CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
 
 static const CONF_PARSER priority_config[] = {
        { FR_CONF_OFFSET("DHCP-Discover", FR_TYPE_UINT32, proto_dhcpv4_t, priorities[FR_DHCP_DISCOVER]),
@@ -107,7 +108,8 @@ fr_dict_attr_autoload_t proto_dhcpv4_dict_attr[] = {
        { NULL }
 };
 
-static int priority_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int priority_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                         CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        int32_t priority;
 
@@ -122,13 +124,15 @@ static int priority_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUS
  *
  * @param[in] ctx      to allocate data in (instance of proto_dhcpv4).
  * @param[out] out     Where to write a dl_instance_t containing the module handle and instance.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the type module.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                     CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        static char const *type_lib_table[] = {
                [FR_DHCP_DISCOVER]      = "base",
@@ -217,13 +221,15 @@ static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PAR
  *
  * @param[in] ctx      to allocate data in (instance of proto_dhcpv4).
  * @param[out] out     Where to write a dl_instance_t containing the module handle and instance.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the type module.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int transport_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                          CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const      *name = cf_pair_value(cf_item_to_pair(ci));
        dl_instance_t   *parent_inst;
index 14960fa6e6cad905309409b26dc28ed2c2d2df94..48f22d8bfe1b7185e8f306633523946159c5bcd7 100644 (file)
@@ -32,9 +32,9 @@
 
 extern fr_app_t proto_radius;
 
-static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int transport_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int priority_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int priority_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
 
 static CONF_PARSER const limit_config[] = {
        { FR_CONF_OFFSET("cleanup_delay", FR_TYPE_TIMEVAL, proto_radius_t, io.cleanup_delay), .dflt = "5.0" } ,
@@ -110,7 +110,7 @@ fr_dict_attr_autoload_t proto_radius_dict_attr[] = {
        { NULL }
 };
 
-static int priority_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int priority_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        int32_t priority;
 
@@ -134,7 +134,7 @@ static int priority_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUS
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        static char const *type_lib_table[] = {
                [FR_CODE_ACCESS_REQUEST]        = "auth",
@@ -250,7 +250,7 @@ static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PAR
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int transport_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const      *name = cf_pair_value(cf_item_to_pair(ci));
        dl_instance_t   *parent_inst;
index 44cc1b5b6f7af713bc5bb15e6607ec703ab3455b..7e05321a893945fb2d36f582ef103110a2827c6b 100644 (file)
 #include "proto_vmps.h"
 
 extern fr_app_t proto_vmps;
-static int priority_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
-static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int transport_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int priority_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                         CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                     CONF_ITEM *ci, CONF_PARSER const *rule);
+static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                          CONF_ITEM *ci, CONF_PARSER const *rule);
 
 static const CONF_PARSER priority_config[] = {
        { FR_CONF_OFFSET("VMPS-Join-Request", FR_TYPE_UINT32, proto_vmps_t, priorities[FR_VMPS_PACKET_TYPE_VALUE_VMPS_JOIN_REQUEST]),
@@ -91,7 +94,8 @@ fr_dict_attr_autoload_t proto_vmps_dict_attr[] = {
        { NULL }
 };
 
-static int priority_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int priority_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                         CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        int32_t priority;
 
@@ -106,13 +110,15 @@ static int priority_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUS
  *
  * @param[in] ctx      to allocate data in (instance of proto_vmps).
  * @param[out] out     Where to write a dl_instance_t containing the module handle and instance.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the type module.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                     CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const              *type_str = cf_pair_value(cf_item_to_pair(ci));
        CONF_SECTION            *listen_cs = cf_item_to_section(cf_parent(ci));
@@ -177,13 +183,15 @@ static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PAR
  *
  * @param[in] ctx      to allocate data in (instance of proto_vmps).
  * @param[out] out     Where to write a dl_instance_t containing the module handle and instance.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the type module.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int transport_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                          CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const      *name = cf_pair_value(cf_item_to_pair(ci));
        dl_instance_t   *parent_inst;
index 3579af444534c1f08b5266d38e6ab0d9ddc5c645..09f0cbd2ed392512184cec72cb4c935c14dc4a99 100644 (file)
@@ -38,12 +38,17 @@ RCSID("$Id$")
 #include <openssl/rsa.h>
 #include <openssl/x509.h>
 
-static int digest_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
-static int cipher_rsa_padding_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
-static int cipher_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
-
-static int cipher_rsa_private_key_file_load(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
-static int cipher_rsa_certificate_file_load(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int digest_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                            CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int cipher_rsa_padding_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                                        CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int cipher_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                            CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+
+static int cipher_rsa_private_key_file_load(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                                           CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int cipher_rsa_certificate_file_load(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                                           CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
 
 typedef enum {
        RLM_CIPHER_TYPE_INVALID = 0,
@@ -189,13 +194,15 @@ static const CONF_PARSER module_config[] = {
  *
  * @param[in] ctx      to allocate data in.
  * @param[out] out     EVP_MD representing the OpenSSL digest type.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the digest.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int digest_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int digest_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                            CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        EVP_MD const    *md;
        char const      *type_str;
@@ -216,14 +223,15 @@ static int digest_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, U
  *
  * @param[in] ctx      to allocate data in.
  * @param[out] out     Padding type.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the padding type..
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int cipher_rsa_padding_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci,
-                                        UNUSED CONF_PARSER const *rule)
+static int cipher_rsa_padding_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                                        CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        int             type;
        char const      *type_str;
@@ -244,13 +252,14 @@ static int cipher_rsa_padding_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF
  *
  * @param[in] ctx      to allocate data in.
  * @param[out] out     Cipher enumeration type.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the type module.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int cipher_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int cipher_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        cipher_type_t   type;
        char const      *type_str;
@@ -323,14 +332,15 @@ static int _evp_pkey_free(EVP_PKEY *pkey)
  *                     function anyway.
  * @param[out] out     Where to write the EVP_PKEY * representing the
  *                     certificate we just loaded.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       Config item containing the certificate path.
  * @param[in] rule     this callback was attached to.
  * @return
  *     - -1 on failure.
  *     - 0 on success.
  */
-static int cipher_rsa_private_key_file_load(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci,
-                                           UNUSED CONF_PARSER const *rule)
+static int cipher_rsa_private_key_file_load(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                                           CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        FILE            *fp;
        char const      *filename;
@@ -383,14 +393,15 @@ static int cipher_rsa_private_key_file_load(TALLOC_CTX *ctx, void *out, CONF_ITE
  *                     function anyway.
  * @param[out] out     Where to write the EVP_PKEY * representing the
  *                     certificate we just loaded.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       Config item containing the certificate path.
  * @param[in] rule     this callback was attached to.
  * @return
  *     - -1 on failure.
  *     - 0 on success.
  */
-static int cipher_rsa_certificate_file_load(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci,
-                                           UNUSED CONF_PARSER const *rule)
+static int cipher_rsa_certificate_file_load(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                                           CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        FILE            *fp;
        char const      *filename;
index 52542fd224d62753bcd5a87d188dc269ce93fda4..3bf054d7ef17d47affd61ff6462307877bcf9395 100644 (file)
@@ -45,8 +45,10 @@ typedef struct {
        rlm_rcode_t     rcode;                  //!< The result of the submodule.
 } eap_auth_rctx_t;
 
-static int submodule_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
-static int eap_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int submodule_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                          CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int eap_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                         CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
 
 static const CONF_PARSER module_config[] = {
        { FR_CONF_OFFSET("default_eap_type", FR_TYPE_VOID, rlm_eap_t, default_method),
@@ -106,13 +108,15 @@ static rlm_rcode_t mod_authorize(void *instance, UNUSED void *thread, REQUEST *r
  *
  * @param[in] ctx      to allocate data in (instance of rlm_eap_t).
  * @param[out] out     Where to write a dl_instance_t containing the module handle and instance.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the type module.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int submodule_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int submodule_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                          CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const                      *name = cf_pair_value(cf_item_to_pair(ci));
        CONF_SECTION                    *eap_cs = cf_item_to_section(cf_parent(ci));
@@ -217,13 +221,15 @@ static int submodule_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CON
  *
  * @param[in] ctx      unused.
  * @param[out] out     Where to write the #eap_type_t value we found.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the EAP method.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int eap_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int eap_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                         CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const      *default_method_name = cf_pair_value(cf_item_to_pair(ci));
        eap_type_t      method;
index 49e22d70d72c5e4ad7df13231b03598e5d356872..5c786de2ef65f59a39ffd829b6581ecd88b3fec9 100644 (file)
@@ -33,7 +33,8 @@ RCSID("$Id$")
 
 #include <freeradius-devel/rad_assert.h>
 
-static int auth_type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int auth_type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                          CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
 
 /*
  *     EAP-GTC is just ASCII data carried inside of the EAP session.
@@ -77,13 +78,15 @@ static rlm_rcode_t CC_HINT(nonnull) mod_process(void *instance, eap_session_t *e
  *
  * @param[in] ctx      to allocate data.
  * @param[out] out     Where to write the auth_type we created or resolved.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the auth_type.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int auth_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int auth_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                          CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const      *auth_type = cf_pair_value(cf_item_to_pair(ci));
 
index 67b9326b8c3453c1fa6c799c34af0a9688dafa56..6d7d4535c5bd5547b7f10a35a1a6888f8ee73aa0 100644 (file)
@@ -30,7 +30,8 @@ RCSID("$Id$")
 
 #include <freeradius-devel/rad_assert.h>
 
-static int auth_type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int auth_type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                          CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
 
 typedef struct {
        bool                    with_ntdomain_hack;
@@ -42,7 +43,7 @@ typedef struct {
 static CONF_PARSER submodule_config[] = {
        { FR_CONF_OFFSET("with_ntdomain_hack", FR_TYPE_BOOL, rlm_eap_mschapv2_t, with_ntdomain_hack), .dflt = "no" },
 
-       { FR_CONF_OFFSET("auth_type", FR_TYPE_VOID, rlm_eap_mschapv2_t, auth_type), .func = auth_type_parse,  .dflt = "mschap" },
+       { FR_CONF_OFFSET("auth_type", FR_TYPE_VOID, rlm_eap_mschapv2_t, auth_type), .func = auth_type_parse, .dflt = "mschap" },
        { FR_CONF_OFFSET("send_error", FR_TYPE_BOOL, rlm_eap_mschapv2_t, send_error), .dflt = "no" },
        { FR_CONF_OFFSET("identity", FR_TYPE_STRING, rlm_eap_mschapv2_t, identity) },
        CONF_PARSER_TERMINATOR
@@ -110,13 +111,15 @@ static void fix_mppe_keys(eap_session_t *eap_session, mschapv2_opaque_t *data)
  *
  * @param[in] ctx      to allocate data.
  * @param[out] out     Where to write the auth_type we created or resolved.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the auth_type.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int auth_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int auth_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                          CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const      *auth_type = cf_pair_value(cf_item_to_pair(ci));
 
index 15ea4d8d8cad1c21528b33a2600e58b992968965..3d82f1bc83dce190396c976b1767e73377d0efe2 100644 (file)
@@ -26,7 +26,8 @@ RCSID("$Id$")
 
 #include "eap_peap.h"
 
-static int auth_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
+static int auth_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                          CONF_ITEM *ci, UNUSED CONF_PARSER const *rule);
 
 typedef struct rlm_eap_peap_t {
        char const              *tls_conf_name;         //!< TLS configuration.
@@ -109,13 +110,15 @@ fr_dict_attr_autoload_t rlm_eap_peap_dict_attr[] = {
  *
  * @param[in] ctx      to allocate data.
  * @param[out] out     Where to write the auth_type we created or resolved.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the auth_type.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int auth_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int auth_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                          CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const      *auth_type = cf_pair_value(cf_item_to_pair(ci));
 
index cf6ffc6a95a166d690054e4d99d1bbea41f47aab..c5df0a2fb592a22b821db0ce3d0f0489ce46a239 100644 (file)
@@ -31,10 +31,10 @@ RCSID("$Id$")
 
 #include "rlm_radius.h"
 
-static int transport_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int status_check_type_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
-static int status_check_update_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int status_check_type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
+static int status_check_update_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, CONF_PARSER const *rule);
 
 static CONF_PARSER const status_checks_config[] = {
        { FR_CONF_OFFSET("type", FR_TYPE_VOID, rlm_radius_t, status_check),
@@ -174,14 +174,16 @@ fr_dict_attr_autoload_t rlm_radius_dict_attr[] = {
 /** Set which types of packets we can parse
  *
  * @param[in] ctx      to allocate data in (instance of rlm_radius).
- * @param[out] out     Where to write the parsed data
+ * @param[out] out     Where to write the parsed data.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the type module.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                     CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const              *type_str = cf_pair_value(cf_item_to_pair(ci));
        CONF_SECTION            *cs = cf_item_to_section(cf_parent(ci));
@@ -233,13 +235,15 @@ static int type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED C
  *
  * @param[in] ctx      to allocate data in (instance of proto_radius).
  * @param[out] out     Where to write a dl_instance_t containing the module handle and instance.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the type module.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int transport_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int transport_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                          CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const      *name = cf_pair_value(cf_item_to_pair(ci));
        dl_instance_t   *parent_inst;
@@ -264,14 +268,16 @@ static int transport_parse(TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CON
 /** Allow for Status-Server ping checks
  *
  * @param[in] ctx      to allocate data in (instance of proto_radius).
- * @param[out] out     Where to write our parsed data
+ * @param[out] out     Where to write our parsed data.
+ * @param[in] parent   Base structure address.
  * @param[in] ci       #CONF_PAIR specifying the name of the type module.
  * @param[in] rule     unused.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int status_check_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int status_check_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                                  CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        char const              *type_str = cf_pair_value(cf_item_to_pair(ci));
        CONF_SECTION            *cs = cf_item_to_section(cf_parent(ci));
@@ -327,7 +333,8 @@ static int status_check_type_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM
  *     - 0 on success.
  *     - -1 on failure.
  */
-static int status_check_update_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
+static int status_check_update_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+                                    CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
 {
        int                     rcode;
        CONF_SECTION            *cs;