From: Alan T. DeKok Date: Thu, 9 Feb 2023 21:30:21 +0000 (-0500) Subject: use "namespace" instead of "parent". X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff6b515a9f8bfa878fa8dfc8545ad56ebf7f4b99;p=thirdparty%2Ffreeradius-server.git use "namespace" instead of "parent". There are too many things called "parent" already --- diff --git a/src/bin/unit_test_attribute.c b/src/bin/unit_test_attribute.c index 73df9e9dab0..8f2e5fe564d 100644 --- a/src/bin/unit_test_attribute.c +++ b/src/bin/unit_test_attribute.c @@ -2587,7 +2587,7 @@ static ssize_t command_tmpl_rule_attr_parent(UNUSED TALLOC_CTX *ctx, tmpl_rules_ fr_slen_t slen; slen = fr_dict_attr_by_oid_substr(&err, - &rules->attr.parent, + &rules->attr.namespace, rules->attr.dict_def ? fr_dict_root(rules->attr.dict_def) : fr_dict_root(fr_dict_internal()), value, NULL); diff --git a/src/lib/server/map.c b/src/lib/server/map.c index bc9afcf5db3..cf8bb9157a5 100644 --- a/src/lib/server/map.c +++ b/src/lib/server/map.c @@ -470,7 +470,7 @@ ssize_t map_afrom_substr(TALLOC_CTX *ctx, map_t **out, map_t **parent_p, fr_sbuf */ if (is_child) { fr_assert(tmpl_is_attr(parent->lhs)); - our_lhs_rules.attr.parent = tmpl_attr_tail_da(parent->lhs); + our_lhs_rules.attr.namespace = tmpl_attr_tail_da(parent->lhs); slen = tmpl_afrom_attr_substr(map, NULL, &map->lhs, &our_in, &map_parse_rules_bareword_quoted, &our_lhs_rules); @@ -854,22 +854,22 @@ do_children: * inner section. */ our_lhs_rules.attr.prefix = TMPL_ATTR_REF_PREFIX_NO; - our_lhs_rules.attr.parent = tmpl_attr_tail_da(map->lhs); + our_lhs_rules.attr.namespace = tmpl_attr_tail_da(map->lhs); /* * Groups MAY change dictionaries. If so, then swap the dictionary and the parent. */ - if (our_lhs_rules.attr.parent->type == FR_TYPE_GROUP) { + if (our_lhs_rules.attr.namespace->type == FR_TYPE_GROUP) { fr_dict_attr_t const *ref; fr_dict_t const *dict, *internal; - ref = fr_dict_attr_ref(our_lhs_rules.attr.parent); + ref = fr_dict_attr_ref(our_lhs_rules.attr.namespace); dict = fr_dict_by_da(ref); internal = fr_dict_internal(); if ((dict != internal) && (dict != our_lhs_rules.attr.dict_def)) { our_lhs_rules.attr.dict_def = dict; - our_lhs_rules.attr.parent = ref; + our_lhs_rules.attr.namespace = ref; } } diff --git a/src/lib/server/tmpl.h b/src/lib/server/tmpl.h index 776ba7f738c..9567e86515c 100644 --- a/src/lib/server/tmpl.h +++ b/src/lib/server/tmpl.h @@ -271,7 +271,7 @@ struct tmpl_attr_rules_s { fr_dict_t const *dict_def; //!< Default dictionary to use ///< with unqualified attribute references. - fr_dict_attr_t const *parent; //!< Point in dictionary tree to resume parsing + fr_dict_attr_t const *namespace; //!< Point in dictionary tree to resume parsing ///< from. If this is provided then dict_def ///< request_def and list_def will be ignored ///< and the presence of any of those qualifiers diff --git a/src/lib/server/tmpl_tokenize.c b/src/lib/server/tmpl_tokenize.c index bbab57890f3..5dbdbed2311 100644 --- a/src/lib/server/tmpl_tokenize.c +++ b/src/lib/server/tmpl_tokenize.c @@ -572,7 +572,7 @@ static fr_slen_t tmpl_request_ref_list_from_substr(TALLOC_CTX *ctx, tmpl_attr_er goto default_ref; } - if (at_rules->parent || at_rules->disallow_qualifiers) { + if (at_rules->namespace || at_rules->disallow_qualifiers) { fr_strerror_const("It is not permitted to specify a request reference here"); if (err) *err = TMPL_ATTR_ERROR_INVALID_LIST_QUALIFIER; @@ -2040,7 +2040,7 @@ ssize_t tmpl_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t *err, */ ret = tmpl_attr_afrom_attr_substr(vpt, err, vpt, - at_rules->parent, at_rules->parent, + at_rules->namespace, at_rules->namespace, &our_name, p_rules, at_rules, 0); if (ret < 0) goto error; @@ -5353,7 +5353,7 @@ void tmpl_rules_child_init(TALLOC_CTX *ctx, tmpl_rules_t *out, tmpl_rules_t cons */ if (da->type != FR_TYPE_GROUP) { out->attr.dict_def = fr_dict_by_da(da); - out->attr.parent = da; + out->attr.namespace = da; return; } @@ -5366,7 +5366,7 @@ void tmpl_rules_child_init(TALLOC_CTX *ctx, tmpl_rules_t *out, tmpl_rules_t cons */ if ((dict != internal) && (dict != out->attr.dict_def)) { out->attr.dict_def = dict; - out->attr.parent = ref; + out->attr.namespace = ref; } /* diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index f673cb35538..2cde92a2285 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -2005,7 +2005,7 @@ static unlang_t *compile_variable(unlang_t *parent, unlang_compile_t *unlang_ctx t_rules->parent = unlang_ctx->rules; t_rules->attr.dict_def = var->dict; - t_rules->attr.parent = NULL; + t_rules->attr.namespace = NULL; unlang_ctx->rules = t_rules; } @@ -4099,7 +4099,7 @@ static unlang_t *compile_subrequest(unlang_t *parent, unlang_compile_t *unlang_c fr_dict_t const *dict; fr_dict_attr_t const *da = NULL; - fr_dict_enum_value_t const *type_enum = NULL; + fr_dict_enum_value_t const *type_enum = NULL; char const *packet_name = NULL; char *p, *namespace = NULL;