From: Arran Cudbard-Bell Date: Sun, 1 Nov 2020 00:03:31 +0000 (-0500) Subject: s/vp_map_t/map_t/g X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bdc41df5770d11e7e13c9d4ded1f2eb54d537670;p=thirdparty%2Ffreeradius-server.git s/vp_map_t/map_t/g --- diff --git a/src/bin/unit_test_map.c b/src/bin/unit_test_map.c index ab93dfed8ff..78f654afe11 100644 --- a/src/bin/unit_test_map.c +++ b/src/bin/unit_test_map.c @@ -75,7 +75,7 @@ static int process_file(char const *filename) int rcode; char const *name1, *name2; CONF_SECTION *cs; - vp_map_t *head, *map; + map_t *head, *map; char buffer[8192]; main_config_t *config; diff --git a/src/bin/unit_test_module.c b/src/bin/unit_test_module.c index 006adb07ca5..b40526876c3 100644 --- a/src/bin/unit_test_module.c +++ b/src/bin/unit_test_module.c @@ -444,7 +444,7 @@ static bool do_xlats(char const *filename, FILE *fp) * Verify the result of the map. */ static int map_proc_verify(CONF_SECTION *cs, UNUSED void *mod_inst, UNUSED void *proc_inst, - tmpl_t const *src, UNUSED vp_map_t const *maps) + tmpl_t const *src, UNUSED map_t const *maps) { if (!src) { cf_log_err(cs, "Missing source"); @@ -456,7 +456,7 @@ static int map_proc_verify(CONF_SECTION *cs, UNUSED void *mod_inst, UNUSED void } static rlm_rcode_t mod_map_proc(UNUSED void *mod_inst, UNUSED void *proc_inst, UNUSED request_t *request, - UNUSED fr_value_box_t **src, UNUSED vp_map_t const *maps) + UNUSED fr_value_box_t **src, UNUSED map_t const *maps) { return RLM_MODULE_FAIL; } diff --git a/src/lib/ldap/base.h b/src/lib/ldap/base.h index c01215665bd..f0454e1a6ad 100644 --- a/src/lib/ldap/base.h +++ b/src/lib/ldap/base.h @@ -317,7 +317,7 @@ typedef struct { * Used to store the array of attributes we'll be querying for. */ typedef struct { - vp_map_t const *maps; //!< Head of list of maps we expanded the RHS of. + map_t const *maps; //!< Head of list of maps we expanded the RHS of. char const *attrs[LDAP_MAX_ATTRMAP + LDAP_MAP_RESERVED + 1]; //!< Reserve some space for access attributes //!< and NULL termination. TALLOC_CTX *ctx; //!< Context to allocate new attributes in. @@ -469,11 +469,11 @@ char const *fr_ldap_edir_errstr(int code); * map.c - Attribute mapping code. */ int fr_ldap_map_getvalue(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, - vp_map_t const *map, void *uctx); + map_t const *map, void *uctx); -int fr_ldap_map_verify(vp_map_t *map, void *instance); +int fr_ldap_map_verify(map_t *map, void *instance); -int fr_ldap_map_expand(fr_ldap_map_exp_t *expanded, request_t *request, vp_map_t const *maps); +int fr_ldap_map_expand(fr_ldap_map_exp_t *expanded, request_t *request, map_t const *maps); int fr_ldap_map_do(request_t *request, fr_ldap_connection_t *conn, char const *valuepair_attr, fr_ldap_map_exp_t const *expanded, LDAPMessage *entry); diff --git a/src/lib/ldap/map.c b/src/lib/ldap/map.c index 7d77aef168e..b14549867c3 100644 --- a/src/lib/ldap/map.c +++ b/src/lib/ldap/map.c @@ -36,7 +36,7 @@ USES_APPLE_DEPRECATED_API * * @see map_to_vp */ -int fr_ldap_map_getvalue(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, vp_map_t const *map, void *uctx) +int fr_ldap_map_getvalue(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, map_t const *map, void *uctx) { fr_ldap_result_t *self = uctx; fr_pair_t *head = NULL, *vp; @@ -59,7 +59,7 @@ int fr_ldap_map_getvalue(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, v */ case TMPL_TYPE_LIST: for (i = 0; i < self->count; i++) { - vp_map_t *attr = NULL; + map_t *attr = NULL; char *attr_str; tmpl_rules_t lhs_rules = { @@ -180,7 +180,7 @@ int fr_ldap_map_getvalue(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, v return 0; } -int fr_ldap_map_verify(vp_map_t *map, UNUSED void *instance) +int fr_ldap_map_verify(map_t *map, UNUSED void *instance) { /* * Destinations where we can put the fr_pair_ts we @@ -250,9 +250,9 @@ int fr_ldap_map_verify(vp_map_t *map, UNUSED void *instance) * - 0 on success. * - -1 on failure. */ -int fr_ldap_map_expand(fr_ldap_map_exp_t *expanded, request_t *request, vp_map_t const *maps) +int fr_ldap_map_expand(fr_ldap_map_exp_t *expanded, request_t *request, map_t const *maps) { - vp_map_t const *map; + map_t const *map; unsigned int total = 0; TALLOC_CTX *ctx = NULL; @@ -304,7 +304,7 @@ int fr_ldap_map_expand(fr_ldap_map_exp_t *expanded, request_t *request, vp_map_t int fr_ldap_map_do(request_t *request, fr_ldap_connection_t *conn, char const *valuepair_attr, fr_ldap_map_exp_t const *expanded, LDAPMessage *entry) { - vp_map_t const *map; + map_t const *map; unsigned int total = 0; int applied = 0; /* How many maps have been applied to the current request */ @@ -362,7 +362,7 @@ int fr_ldap_map_do(request_t *request, fr_ldap_connection_t *conn, count = ldap_count_values_len(values); for (i = 0; i < count; i++) { - vp_map_t *attr; + map_t *attr; char *value; tmpl_rules_t parse_rules = { diff --git a/src/lib/redis/base.h b/src/lib/redis/base.h index c484c188cd7..5e0286d4a78 100644 --- a/src/lib/redis/base.h +++ b/src/lib/redis/base.h @@ -143,10 +143,10 @@ void fr_redis_reply_print(fr_log_lvl_t lvl, redisReply *reply, request_t *requ int fr_redis_reply_to_value_box(TALLOC_CTX *ctx, fr_value_box_t *out, redisReply *reply, fr_type_t dst_type, fr_dict_attr_t const *dst_enumv); -int fr_redis_reply_to_map(TALLOC_CTX *ctx, vp_map_t **out, +int fr_redis_reply_to_map(TALLOC_CTX *ctx, map_t **out, request_t *request, redisReply *key, redisReply *op, redisReply *value); -int fr_redis_tuple_from_map(TALLOC_CTX *pool, char const *out[], size_t out_len[], vp_map_t *map); +int fr_redis_tuple_from_map(TALLOC_CTX *pool, char const *out[], size_t out_len[], map_t *map); fr_redis_rcode_t fr_redis_get_version(char *out, size_t out_len, fr_redis_conn_t *conn); diff --git a/src/lib/redis/redis.c b/src/lib/redis/redis.c index 731478e1fb4..4d39565e8de 100644 --- a/src/lib/redis/redis.c +++ b/src/lib/redis/redis.c @@ -262,10 +262,10 @@ int fr_redis_reply_to_value_box(TALLOC_CTX *ctx, fr_value_box_t *out, redisReply * - 0 on success. * - -1 on failure. */ -int fr_redis_reply_to_map(TALLOC_CTX *ctx, vp_map_t **out, request_t *request, +int fr_redis_reply_to_map(TALLOC_CTX *ctx, map_t **out, request_t *request, redisReply *key, redisReply *op, redisReply *value) { - vp_map_t *map = NULL; + map_t *map = NULL; ssize_t slen; *out = NULL; @@ -288,7 +288,7 @@ int fr_redis_reply_to_map(TALLOC_CTX *ctx, vp_map_t **out, request_t *request, RDEBUG3("Got op : %s", op->str); RDEBUG3("Got value : %pV", fr_box_strvalue_len(value->str, value->len)); - MEM(map = talloc_zero(ctx, vp_map_t)); + MEM(map = talloc_zero(ctx, map_t)); slen = tmpl_afrom_attr_str(map, NULL, &map->lhs, key->str, &(tmpl_rules_t){ .dict_def = request->dict }); if (slen < 0) { REMARKER(key->str, -slen, "%s", fr_strerror()); @@ -351,7 +351,7 @@ int fr_redis_reply_to_map(TALLOC_CTX *ctx, vp_map_t **out, request_t *request, * 0 on success. * -1 on failure. */ -int fr_redis_tuple_from_map(TALLOC_CTX *pool, char const *out[], size_t out_len[], vp_map_t *map) +int fr_redis_tuple_from_map(TALLOC_CTX *pool, char const *out[], size_t out_len[], map_t *map) { char *new; diff --git a/src/lib/server/cond.h b/src/lib/server/cond.h index 1a70e3d87ad..90fcc7ab5a0 100644 --- a/src/lib/server/cond.h +++ b/src/lib/server/cond.h @@ -84,7 +84,7 @@ struct fr_cond_s { ///< is derived from. union { - vp_map_t *map; //!< Binary expression. + map_t *map; //!< Binary expression. tmpl_t *vpt; //!< Unary expression. fr_cond_t *child; //!< Nested condition. rlm_rcode_t rcode; //!< Rcode check. We handle this outside of diff --git a/src/lib/server/cond_eval.c b/src/lib/server/cond_eval.c index 88b07a57641..9f2a0c8fbcf 100644 --- a/src/lib/server/cond_eval.c +++ b/src/lib/server/cond_eval.c @@ -205,7 +205,7 @@ static int cond_do_regex(request_t *request, fr_cond_t const *c, fr_value_box_t const *lhs, fr_value_box_t const *rhs) { - vp_map_t const *map = c->data.map; + map_t const *map = c->data.map; ssize_t slen; uint32_t subcaptures; @@ -311,7 +311,7 @@ static void cond_print_operands(fr_value_box_t const *lhs, fr_value_box_t const */ static int cond_cmp_values(request_t *request, fr_cond_t const *c, fr_value_box_t const *lhs, fr_value_box_t const *rhs) { - vp_map_t const *map = c->data.map; + map_t const *map = c->data.map; int rcode; #ifdef WITH_EVAL_DEBUG @@ -415,7 +415,7 @@ done: */ static int cond_normalise_and_cmp(request_t *request, fr_cond_t const *c, fr_value_box_t const *lhs) { - vp_map_t const *map = c->data.map; + map_t const *map = c->data.map; int rcode; @@ -632,7 +632,7 @@ int cond_eval_map(request_t *request, UNUSED int depth, fr_cond_t const *c) { int rcode = 0; - vp_map_t const *map = c->data.map; + map_t const *map = c->data.map; EVAL_DEBUG(">>> MAP TYPES LHS: %s, RHS: %s", fr_table_str_by_value(tmpl_type_table, map->lhs->type, "???"), diff --git a/src/lib/server/cond_tokenize.c b/src/lib/server/cond_tokenize.c index 4558aa49bd3..01a1b6f266c 100644 --- a/src/lib/server/cond_tokenize.c +++ b/src/lib/server/cond_tokenize.c @@ -1453,7 +1453,7 @@ static ssize_t cond_tokenize(TALLOC_CTX *ctx, fr_cond_t **out, fr_sbuff_adv_past_whitespace(&our_in, SIZE_MAX); { - vp_map_t *map; + map_t *map; tmpl_t *rhs; /* @@ -1487,7 +1487,7 @@ static ssize_t cond_tokenize(TALLOC_CTX *ctx, fr_cond_t **out, goto error; } - MEM(c->data.map = map = talloc(c, vp_map_t)); + MEM(c->data.map = map = talloc(c, map_t)); /* * Grab the RHS @@ -1505,7 +1505,7 @@ static ssize_t cond_tokenize(TALLOC_CTX *ctx, fr_cond_t **out, */ if (cond_forbid_groups(rhs, &our_in, &m_rhs) < 0) goto error; - *map = (vp_map_t) { + *map = (map_t) { .ci = cf_section_to_item(cs), .lhs = lhs, .op = op, diff --git a/src/lib/server/map.c b/src/lib/server/map.c index a161c827e4b..fadd3ca3dfd 100644 --- a/src/lib/server/map.c +++ b/src/lib/server/map.c @@ -44,7 +44,7 @@ RCSID("$Id$") #include #ifdef DEBUG_MAP -static void map_dump(request_t *request, vp_map_t const *map) +static void map_dump(request_t *request, map_t const *map) { RDEBUG2(">>> MAP TYPES LHS: %s, RHS: %s", fr_table_str_by_value(tmpl_type_table, map->lhs->type, "???"), @@ -56,9 +56,9 @@ static void map_dump(request_t *request, vp_map_t const *map) } #endif -static inline vp_map_t *map_alloc(TALLOC_CTX *ctx) +static inline map_t *map_alloc(TALLOC_CTX *ctx) { - return talloc_zero(ctx, vp_map_t); + return talloc_zero(ctx, map_t); } /** re-parse a map where the lhs is an unknown attribute. @@ -68,7 +68,7 @@ static inline vp_map_t *map_alloc(TALLOC_CTX *ctx) * @param rhs_quote quotation type around rhs. * @param rhs string to re-parse. */ -bool map_cast_from_hex(vp_map_t *map, fr_token_t rhs_quote, char const *rhs) +bool map_cast_from_hex(map_t *map, fr_token_t rhs_quote, char const *rhs) { size_t len; uint8_t *ptr; @@ -171,7 +171,7 @@ bool map_cast_from_hex(vp_map_t *map, fr_token_t rhs_quote, char const *rhs) return true; } -/** Convert CONFIG_PAIR (which may contain refs) to vp_map_t. +/** Convert CONFIG_PAIR (which may contain refs) to map_t. * * Treats the left operand as an attribute reference * @verbatim..@endverbatim @@ -183,18 +183,18 @@ bool map_cast_from_hex(vp_map_t *map, fr_token_t rhs_quote, char const *rhs) * Return must be freed with talloc_free * * @param[in] ctx for talloc. - * @param[in] out Where to write the pointer to the new #vp_map_t. + * @param[in] out Where to write the pointer to the new #map_t. * @param[in] cp to convert to map. * @param[in] lhs_rules rules for parsing LHS attribute references. * @param[in] rhs_rules rules for parsing RHS attribute references. * @return - * - #vp_map_t if successful. + * - #map_t if successful. * - NULL on error. */ -int map_afrom_cp(TALLOC_CTX *ctx, vp_map_t **out, CONF_PAIR *cp, +int map_afrom_cp(TALLOC_CTX *ctx, map_t **out, CONF_PAIR *cp, tmpl_rules_t const *lhs_rules, tmpl_rules_t const *rhs_rules) { - vp_map_t *map; + map_t *map; char const *attr, *value, *marker_subject; ssize_t slen; fr_token_t type; @@ -203,7 +203,7 @@ int map_afrom_cp(TALLOC_CTX *ctx, vp_map_t **out, CONF_PAIR *cp, if (!cp) return -1; - MEM(map = talloc_zero(ctx, vp_map_t)); + MEM(map = talloc_zero(ctx, map_t)); map->op = cf_pair_operator(cp); map->ci = cf_pair_to_item(cp); @@ -319,7 +319,7 @@ error: * - 0 on success. * - -1 on failure. */ -int map_afrom_cs(TALLOC_CTX *ctx, vp_map_t **out, CONF_SECTION *cs, +int map_afrom_cs(TALLOC_CTX *ctx, map_t **out, CONF_SECTION *cs, tmpl_rules_t const *lhs_rules, tmpl_rules_t const *rhs_rules, map_validate_t validate, void *uctx, unsigned int max) @@ -330,7 +330,7 @@ int map_afrom_cs(TALLOC_CTX *ctx, vp_map_t **out, CONF_SECTION *cs, CONF_PAIR *cp; unsigned int total = 0; - vp_map_t **tail, *map; + map_t **tail, *map; TALLOC_CTX *parent; tmpl_rules_t our_lhs_rules = *lhs_rules; /* Mutable copy of the destination */ @@ -490,7 +490,7 @@ int map_afrom_cs(TALLOC_CTX *ctx, vp_map_t **out, CONF_SECTION *cs, } -/** Convert strings to #vp_map_t +/** Convert strings to #map_t * * Treatment of operands depends on quotation, barewords are treated * as attribute references, double quoted values are treated as @@ -509,18 +509,18 @@ int map_afrom_cs(TALLOC_CTX *ctx, vp_map_t **out, CONF_SECTION *cs, * @param[in] rhs_quote type of quoting aounrd the RHS string. * @param[in] rhs_rules rules that control parsing of the RHS string. * @return - * - #vp_map_t if successful. + * - #map_t if successful. * - NULL on error. */ -int map_afrom_fields(TALLOC_CTX *ctx, vp_map_t **out, +int map_afrom_fields(TALLOC_CTX *ctx, map_t **out, char const *lhs, fr_token_t lhs_quote, tmpl_rules_t const *lhs_rules, fr_token_t op, char const *rhs, fr_token_t rhs_quote, tmpl_rules_t const *rhs_rules) { ssize_t slen; - vp_map_t *map; + map_t *map; - map = talloc_zero(ctx, vp_map_t); + map = talloc_zero(ctx, map_t); slen = tmpl_afrom_substr(map, &map->lhs, &FR_SBUFF_IN(lhs, strlen(lhs)), lhs_quote, @@ -570,18 +570,18 @@ int map_afrom_fields(TALLOC_CTX *ctx, vp_map_t **out, * @param[in] steal_rhs_buffs Whether we attempt to save allocs by stealing the buffers * from the rhs #fr_value_box_t. * @return - * - #vp_map_t if successful. + * - #map_t if successful. * - NULL on error. */ -int map_afrom_value_box(TALLOC_CTX *ctx, vp_map_t **out, +int map_afrom_value_box(TALLOC_CTX *ctx, map_t **out, char const *lhs, fr_token_t lhs_quote, tmpl_rules_t const *lhs_rules, fr_token_t op, fr_value_box_t *rhs, bool steal_rhs_buffs) { ssize_t slen; - vp_map_t *map; + map_t *map; - map = talloc_zero(ctx, vp_map_t); + map = talloc_zero(ctx, map_t); slen = tmpl_afrom_substr(map, &map->lhs, &FR_SBUFF_IN(lhs, strlen(lhs)), @@ -607,7 +607,7 @@ int map_afrom_value_box(TALLOC_CTX *ctx, vp_map_t **out, /** Convert a value pair string to valuepair map * * Takes a valuepair string with list and request qualifiers and converts it into a - * #vp_map_t. + * #map_t. * * Attribute string is in the format (where @verbatim @endverbatim is a quotation char ['"]): @verbatim @@ -623,14 +623,14 @@ int map_afrom_value_box(TALLOC_CTX *ctx, vp_map_t **out, * - 0 on success. * - < 0 on error. */ -int map_afrom_attr_str(TALLOC_CTX *ctx, vp_map_t **out, char const *vp_str, +int map_afrom_attr_str(TALLOC_CTX *ctx, map_t **out, char const *vp_str, tmpl_rules_t const *lhs_rules, tmpl_rules_t const *rhs_rules) { char const *p = vp_str; fr_token_t quote; fr_pair_t_RAW raw; - vp_map_t *map = NULL; + map_t *map = NULL; quote = gettoken(&p, raw.l_opand, sizeof(raw.l_opand), false); switch (quote) { @@ -680,11 +680,11 @@ int map_afrom_attr_str(TALLOC_CTX *ctx, vp_map_t **out, char const *vp_str, * - 0 on success. * - -1 on failure. */ -int map_afrom_vp(TALLOC_CTX *ctx, vp_map_t **out, fr_pair_t *vp, tmpl_rules_t const *rules) +int map_afrom_vp(TALLOC_CTX *ctx, map_t **out, fr_pair_t *vp, tmpl_rules_t const *rules) { char buffer[256]; - vp_map_t *map; + map_t *map; map = map_alloc(ctx); if (!map) { @@ -731,10 +731,10 @@ int map_afrom_vp(TALLOC_CTX *ctx, vp_map_t **out, fr_pair_t *vp, tmpl_rules_t co return 0; } -static void map_sort_split(vp_map_t *source, vp_map_t **front, vp_map_t **back) +static void map_sort_split(map_t *source, map_t **front, map_t **back) { - vp_map_t *fast; - vp_map_t *slow; + map_t *fast; + map_t *slow; /* * Stopping condition - no more elements left to split @@ -766,9 +766,9 @@ static void map_sort_split(vp_map_t *source, vp_map_t **front, vp_map_t **back) slow->next = NULL; } -static vp_map_t *map_sort_merge(vp_map_t *a, vp_map_t *b, fr_cmp_t cmp) +static map_t *map_sort_merge(map_t *a, map_t *b, fr_cmp_t cmp) { - vp_map_t *result = NULL; + map_t *result = NULL; if (!a) return b; if (!b) return a; @@ -787,16 +787,16 @@ static vp_map_t *map_sort_merge(vp_map_t *a, vp_map_t *b, fr_cmp_t cmp) return result; } -/** Sort a linked list of #vp_map_t using merge sort +/** Sort a linked list of #map_t using merge sort * - * @param[in,out] maps List of #vp_map_t to sort. + * @param[in,out] maps List of #map_t to sort. * @param[in] cmp to sort with */ -void map_sort(vp_map_t **maps, fr_cmp_t cmp) +void map_sort(map_t **maps, fr_cmp_t cmp) { - vp_map_t *head = *maps; - vp_map_t *a; - vp_map_t *b; + map_t *head = *maps; + map_t *a; + map_t *b; /* * If there's 0-1 elements it must already be sorted. @@ -829,7 +829,7 @@ void map_sort(vp_map_t **maps, fr_cmp_t cmp) * - 0 on success. * - -1 on failure. */ -static int map_exec_to_vp(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, vp_map_t const *map) +static int map_exec_to_vp(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, map_t const *map) { int result; char *expanded = NULL; @@ -909,7 +909,7 @@ static int map_exec_to_vp(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, * - 0 on success. * - -1 on failure. */ -int map_to_vp(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, vp_map_t const *map, UNUSED void *uctx) +int map_to_vp(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, map_t const *map, UNUSED void *uctx) { int rcode = 0; fr_pair_t *vp = NULL, *found = NULL, *n; @@ -1136,9 +1136,9 @@ do {\ } \ } while (0) -/** Convert #vp_map_t to #fr_pair_t (s) and add them to a #request_t. +/** Convert #map_t to #fr_pair_t (s) and add them to a #request_t. * - * Takes a single #vp_map_t, resolves request and list identifiers + * Takes a single #map_t, resolves request and list identifiers * to pointers in the current request, then attempts to retrieve module * specific value(s) using callback, and adds the resulting values to the * correct request/list. @@ -1153,7 +1153,7 @@ do {\ * - -2 in the source attribute wasn't valid. * - 0 on success. */ -int map_to_request(request_t *request, vp_map_t const *map, radius_map_getvalue_t func, void *ctx) +int map_to_request(request_t *request, map_t const *map, radius_map_getvalue_t func, void *ctx) { int rcode = 0; int num; @@ -1164,7 +1164,7 @@ int map_to_request(request_t *request, vp_map_t const *map, radius_map_getvalue_ bool found = false; - vp_map_t exp_map; + map_t exp_map; tmpl_t *exp_lhs; request_ref_t request_ref; pair_list_t list_ref; @@ -1564,7 +1564,7 @@ finish: * - The number of bytes written to the out buffer. * - A number >= outlen if truncation has occurred. */ -ssize_t map_print(fr_sbuff_t *out, vp_map_t const *map) +ssize_t map_print(fr_sbuff_t *out, map_t const *map) { fr_sbuff_t our_out = FR_SBUFF_NO_ADVANCE(out); @@ -1610,7 +1610,7 @@ ssize_t map_print(fr_sbuff_t *out, vp_map_t const *map) /* * Debug print a map / VP */ -void map_debug_log(request_t *request, vp_map_t const *map, fr_pair_t const *vp) +void map_debug_log(request_t *request, map_t const *map, fr_pair_t const *vp) { char *rhs = NULL, *value = NULL; char buffer[256]; diff --git a/src/lib/server/map.h b/src/lib/server/map.h index 812e6e599fd..007eabbb7d3 100644 --- a/src/lib/server/map.h +++ b/src/lib/server/map.h @@ -30,7 +30,7 @@ RCSIDH(map_h, "$Id$") extern "C" { #endif -typedef struct vp_map_s vp_map_t; +typedef struct vp_map_s map_t; typedef struct vp_list_mod_s vp_list_mod_t; #ifdef __cplusplus @@ -77,17 +77,17 @@ struct vp_map_s { CONF_ITEM *ci; //!< Config item that the map was created from. Mainly used for //!< logging validation errors. - vp_map_t *child; //!< a child map. If it exists, `rhs` MUST be NULL - vp_map_t *next; //!< The next valuepair map. + map_t *child; //!< a child map. If it exists, `rhs` MUST be NULL + map_t *next; //!< The next valuepair map. }; /** A list modification * */ struct vp_list_mod_s { - vp_map_t const *map; //!< Original map describing the change to be made. + map_t const *map; //!< Original map describing the change to be made. - vp_map_t *mod; //!< New map containing the destination (LHS) and + map_t *mod; //!< New map containing the destination (LHS) and ///< values (RHS). vp_list_mod_t *next; }; @@ -101,53 +101,53 @@ struct vp_list_mod_s { } while (0) #endif -typedef int (*map_validate_t)(vp_map_t *map, void *ctx); +typedef int (*map_validate_t)(map_t *map, void *ctx); typedef int (*radius_map_getvalue_t)(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, - vp_map_t const *map, void *uctx); + map_t const *map, void *uctx); -int map_afrom_cp(TALLOC_CTX *ctx, vp_map_t **out, CONF_PAIR *cp, +int map_afrom_cp(TALLOC_CTX *ctx, map_t **out, CONF_PAIR *cp, tmpl_rules_t const *lhs_rules, tmpl_rules_t const *rhs_rules); -int map_afrom_cs(TALLOC_CTX *ctx, vp_map_t **out, CONF_SECTION *cs, +int map_afrom_cs(TALLOC_CTX *ctx, map_t **out, CONF_SECTION *cs, tmpl_rules_t const *lhs_rules, tmpl_rules_t const *rhs_rules, map_validate_t validate, void *uctx, unsigned int max) CC_HINT(nonnull(2, 3)); -int map_afrom_fields(TALLOC_CTX *ctx, vp_map_t **out, +int map_afrom_fields(TALLOC_CTX *ctx, map_t **out, char const *lhs, fr_token_t lhs_type, tmpl_rules_t const *lhs_rules, fr_token_t op, char const *rhs, fr_token_t rhs_type, tmpl_rules_t const *rhs_rules); -int map_afrom_value_box(TALLOC_CTX *ctx, vp_map_t **out, +int map_afrom_value_box(TALLOC_CTX *ctx, map_t **out, char const *lhs, fr_token_t lhs_type, tmpl_rules_t const *lhs_rules, fr_token_t op, fr_value_box_t *rhs, bool steal_rhs_buffs); -int map_afrom_attr_str(TALLOC_CTX *ctx, vp_map_t **out, char const *raw, +int map_afrom_attr_str(TALLOC_CTX *ctx, map_t **out, char const *raw, tmpl_rules_t const *lhs_rules, tmpl_rules_t const *rhs_rules); -int map_afrom_vp(TALLOC_CTX *ctx, vp_map_t **out, fr_pair_t *vp, +int map_afrom_vp(TALLOC_CTX *ctx, map_t **out, fr_pair_t *vp, tmpl_rules_t const *rules); -void map_sort(vp_map_t **maps, fr_cmp_t cmp); +void map_sort(map_t **maps, fr_cmp_t cmp); int map_to_vp(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, - vp_map_t const *map, void *uctx) CC_HINT(nonnull (2,3,4)); + map_t const *map, void *uctx) CC_HINT(nonnull (2,3,4)); int map_list_mod_apply(request_t *request, vp_list_mod_t const *vlm); int map_to_list_mod(TALLOC_CTX *ctx, vp_list_mod_t **out, - request_t *request, vp_map_t const *map, + request_t *request, map_t const *map, fr_value_box_t **lhs_result, fr_value_box_t **rhs_result); -int map_to_request(request_t *request, vp_map_t const *map, +int map_to_request(request_t *request, map_t const *map, radius_map_getvalue_t func, void *ctx); -ssize_t map_print(fr_sbuff_t *out, vp_map_t const *map); +ssize_t map_print(fr_sbuff_t *out, map_t const *map); -void map_debug_log(request_t *request, vp_map_t const *map, +void map_debug_log(request_t *request, map_t const *map, fr_pair_t const *vp) CC_HINT(nonnull(1, 2)); -bool map_cast_from_hex(vp_map_t *map, fr_token_t rhs_type, char const *rhs); +bool map_cast_from_hex(map_t *map, fr_token_t rhs_type, char const *rhs); #ifdef __cplusplus } #endif diff --git a/src/lib/server/map_async.c b/src/lib/server/map_async.c index cc2f7e10742..74d735ca7ed 100644 --- a/src/lib/server/map_async.c +++ b/src/lib/server/map_async.c @@ -47,9 +47,9 @@ static inline vp_list_mod_t *list_mod_alloc(TALLOC_CTX *ctx) return talloc_zero(ctx, vp_list_mod_t); } -static inline vp_map_t *map_alloc(TALLOC_CTX *ctx) +static inline map_t *map_alloc(TALLOC_CTX *ctx) { - return talloc_zero(ctx, vp_map_t); + return talloc_zero(ctx, map_t); } /** Allocate a 'generic' #vp_list_mod_t @@ -67,7 +67,7 @@ static inline vp_map_t *map_alloc(TALLOC_CTX *ctx) * - NULL on failure. */ static inline vp_list_mod_t *list_mod_generic_afrom_map(TALLOC_CTX *ctx, - vp_map_t const *original, vp_map_t const *mutated) + map_t const *original, map_t const *mutated) { vp_list_mod_t *n; @@ -106,7 +106,7 @@ static inline vp_list_mod_t *list_mod_generic_afrom_map(TALLOC_CTX *ctx, * - NULL on failure. */ static inline vp_list_mod_t *list_mod_delete_afrom_map(TALLOC_CTX *ctx, - vp_map_t const *original, vp_map_t const *mutated) + map_t const *original, map_t const *mutated) { vp_list_mod_t *n; @@ -144,7 +144,7 @@ static inline vp_list_mod_t *list_mod_delete_afrom_map(TALLOC_CTX *ctx, * - NULL on failure. */ static inline vp_list_mod_t *list_mod_empty_string_afrom_map(TALLOC_CTX *ctx, - vp_map_t const *original, vp_map_t const *mutated) + map_t const *original, map_t const *mutated) { vp_list_mod_t *n; fr_value_box_t empty_string = { @@ -196,7 +196,7 @@ static inline vp_list_mod_t *list_mod_empty_string_afrom_map(TALLOC_CTX *ctx, * - true if destination list is OK. * - false if destination list is invalid. */ -static inline fr_pair_t **map_check_src_or_dst(request_t *request, vp_map_t const *map, tmpl_t const *src_dst) +static inline fr_pair_t **map_check_src_or_dst(request_t *request, map_t const *map, tmpl_t const *src_dst) { request_t *context = request; fr_pair_t **list; @@ -246,12 +246,12 @@ static inline fr_pair_t **map_check_src_or_dst(request_t *request, vp_map_t cons * - -1 on failure. */ int map_to_list_mod(TALLOC_CTX *ctx, vp_list_mod_t **out, - request_t *request, vp_map_t const *original, + request_t *request, map_t const *original, fr_value_box_t **lhs_result, fr_value_box_t **rhs_result) { vp_list_mod_t *n = NULL; - vp_map_t map_tmp; - vp_map_t const *mutated = original; + map_t map_tmp; + map_t const *mutated = original; fr_cursor_t values; fr_value_box_t *head = NULL; @@ -383,7 +383,7 @@ int map_to_list_mod(TALLOC_CTX *ctx, vp_list_mod_t **out, * Iterate over all attributes in that list */ do { - vp_map_t *n_mod; + map_t *n_mod; n_mod = map_alloc(n); if (!n_mod) goto error; @@ -710,7 +710,7 @@ int map_to_list_mod(TALLOC_CTX *ctx, vp_list_mod_t **out, (void)fr_cursor_init(&from, &vp_head); while ((vp = fr_cursor_remove(&from))) { - vp_map_t *mod; + map_t *mod; tmpl_rules_t rules; memset(&rules, 0, sizeof(rules)); @@ -804,7 +804,7 @@ static inline fr_pair_t *map_list_mod_to_vp(TALLOC_CTX *ctx, tmpl_t const *attr, */ static fr_pair_t *map_list_mod_to_vps(TALLOC_CTX *ctx, vp_list_mod_t const *vlm) { - vp_map_t *mod; + map_t *mod; fr_pair_t *head = NULL; fr_cursor_t cursor; @@ -851,7 +851,7 @@ static fr_pair_t *map_list_mod_to_vps(TALLOC_CTX *ctx, vp_list_mod_t const *vlm) * @param[in] vb The value in the ephemeral map. */ static inline void map_list_mod_debug(request_t *request, - vp_map_t const *map, vp_map_t const *mod, fr_value_box_t const *vb) + map_t const *map, map_t const *mod, fr_value_box_t const *vb) { char *rhs = NULL; char const *quote = ""; @@ -931,7 +931,7 @@ int map_list_mod_apply(request_t *request, vp_list_mod_t const *vlm) { int rcode = 0; - vp_map_t const *map = vlm->map, *mod; + map_t const *map = vlm->map, *mod; fr_pair_t **vp_list, *found; request_t *context; TALLOC_CTX *parent; diff --git a/src/lib/server/map_proc.c b/src/lib/server/map_proc.c index bc81f4d00c1..66e378f4daf 100644 --- a/src/lib/server/map_proc.c +++ b/src/lib/server/map_proc.c @@ -167,7 +167,7 @@ int map_proc_register(void *mod_inst, char const *name, * - NULL on error. */ map_proc_inst_t *map_proc_instantiate(TALLOC_CTX *ctx, map_proc_t const *proc, - CONF_SECTION *cs, tmpl_t const *src, vp_map_t const *maps) + CONF_SECTION *cs, tmpl_t const *src, map_t const *maps) { map_proc_inst_t *inst; diff --git a/src/lib/server/map_proc.h b/src/lib/server/map_proc.h index e4345ced397..1bacc9696cb 100644 --- a/src/lib/server/map_proc.h +++ b/src/lib/server/map_proc.h @@ -59,7 +59,7 @@ extern "C" { * - #RLM_MODULE_FAIL - If an error occurred performing the mapping. */ typedef rlm_rcode_t (*map_proc_func_t)(void *mod_inst, void *proc_inst, request_t *request, - fr_value_box_t **result, vp_map_t const *maps); + fr_value_box_t **result, map_t const *maps); /** Allocate new instance data for a map processor * @@ -73,7 +73,7 @@ typedef rlm_rcode_t (*map_proc_func_t)(void *mod_inst, void *proc_inst, request_ * - -1 on failure. */ typedef int (*map_proc_instantiate_t)(CONF_SECTION *cs, void *mod_inst, void *proc_inst, - tmpl_t const *src, vp_map_t const *maps); + tmpl_t const *src, map_t const *maps); map_proc_t *map_proc_find(char const *name); @@ -83,7 +83,7 @@ int map_proc_register(void *mod_inst, char const *name, map_proc_instantiate_t instantiate, size_t inst_size); map_proc_inst_t *map_proc_instantiate(TALLOC_CTX *ctx, map_proc_t const *proc, - CONF_SECTION *cs, tmpl_t const *src, vp_map_t const *maps); + CONF_SECTION *cs, tmpl_t const *src, map_t const *maps); rlm_rcode_t map_proc(request_t *request, map_proc_inst_t const *inst, fr_value_box_t **src); diff --git a/src/lib/server/map_proc_priv.h b/src/lib/server/map_proc_priv.h index 198c2f3fc11..2049e3035a2 100644 --- a/src/lib/server/map_proc_priv.h +++ b/src/lib/server/map_proc_priv.h @@ -50,7 +50,7 @@ struct map_proc { struct map_proc_inst { map_proc_t const *proc; //!< Map processor. tmpl_t const *src; //!< Evaluated to provide source value for map processor. - vp_map_t const *maps; //!< Head of the map list. + map_t const *maps; //!< Head of the map list. void *data; //!< Instance data created by #map_proc_instantiate }; diff --git a/src/lib/server/modpriv.h b/src/lib/server/modpriv.h index 1ac8c43e869..4b1bef15091 100644 --- a/src/lib/server/modpriv.h +++ b/src/lib/server/modpriv.h @@ -35,7 +35,7 @@ extern "C" { #endif int module_sibling_section_find(CONF_SECTION **out, CONF_SECTION *module, char const *name); -int unlang_fixup_update(vp_map_t *map, void *ctx); +int unlang_fixup_update(map_t *map, void *ctx); #ifdef __cplusplus } diff --git a/src/lib/server/tmpl.h b/src/lib/server/tmpl.h index c905135428d..2429af048ec 100644 --- a/src/lib/server/tmpl.h +++ b/src/lib/server/tmpl.h @@ -403,7 +403,7 @@ typedef struct { * * Is used as both the RHS and LHS of a map (both update, and conditional types) * - * @section update_maps Use in update vp_map_t + * @section update_maps Use in update map_t * When used on the LHS it describes an attribute to create and should be one of these types: * - #TMPL_TYPE_ATTR * - #TMPL_TYPE_LIST @@ -418,11 +418,11 @@ typedef struct { * - #TMPL_TYPE_DATA * - #TMPL_TYPE_XLAT (pre-parsed xlat) * - * @section conditional_maps Use in conditional vp_map_t + * @section conditional_maps Use in conditional map_t * When used as part of a condition it may be any of the RHS side types, as well as: * - #TMPL_TYPE_REGEX (pre-parsed regex) * - * @see vp_map_t + * @see map_t */ struct tmpl_s { tmpl_type_t _CONST type; //!< What type of value tmpl refers to. diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 65eb08170e8..f1d476ea30d 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -196,7 +196,7 @@ static bool pass2_fixup_tmpl(TALLOC_CTX *ctx, CONF_ITEM const *ci, tmpl_t **vpt_ static bool pass2_fixup_map(fr_cond_t *c) { tmpl_t *vpt; - vp_map_t *map; + map_t *map; map = c->data.map; /* shorter */ @@ -540,7 +540,7 @@ static bool pass2_cond_callback(fr_cond_t *c, UNUSED void *uctx) } } -static bool pass2_fixup_update_map(vp_map_t *map, tmpl_rules_t const *rules, fr_dict_attr_t const *parent) +static bool pass2_fixup_update_map(map_t *map, tmpl_rules_t const *rules, fr_dict_attr_t const *parent) { if (tmpl_is_xlat_unresolved(map->lhs)) { fr_assert(tmpl_xlat(map->lhs) == NULL); @@ -632,7 +632,7 @@ static bool pass2_fixup_update_map(vp_map_t *map, tmpl_rules_t const *rules, fr_ static bool pass2_fixup_update(unlang_group_t *g, tmpl_rules_t const *rules) { unlang_map_t *gext = unlang_group_to_map(g); - vp_map_t *map; + map_t *map; for (map = gext->map; map != NULL; map = map->next) { if (!pass2_fixup_update_map(map, rules, NULL)) return false; @@ -665,7 +665,7 @@ static void unlang_dump(unlang_t *instruction, int depth) { unlang_t *c; unlang_group_t *g; - vp_map_t *map; + map_t *map; char buffer[1024]; for (c = instruction; c != NULL; c = c->next) { @@ -744,7 +744,7 @@ static void unlang_dump(unlang_t *instruction, int depth) * @param ctx data to pass to fixup function (currently unused). * @return 0 if valid else -1. */ -static int unlang_fixup_map(vp_map_t *map, UNUSED void *ctx) +static int unlang_fixup_map(map_t *map, UNUSED void *ctx) { CONF_PAIR *cp = cf_item_to_pair(map->ci); @@ -808,7 +808,7 @@ static int unlang_fixup_map(vp_map_t *map, UNUSED void *ctx) * - 0 if valid. * - -1 not valid. */ -int unlang_fixup_update(vp_map_t *map, UNUSED void *ctx) +int unlang_fixup_update(map_t *map, UNUSED void *ctx) { CONF_PAIR *cp = cf_item_to_pair(map->ci); @@ -1005,7 +1005,7 @@ int unlang_fixup_update(vp_map_t *map, UNUSED void *ctx) * - 0 if valid. * - -1 not valid. */ -static int unlang_fixup_filter(vp_map_t *map, UNUSED void *ctx) +static int unlang_fixup_filter(map_t *map, UNUSED void *ctx) { CONF_PAIR *cp = cf_item_to_pair(map->ci); @@ -1240,7 +1240,7 @@ static unlang_t *compile_map(unlang_t *parent, unlang_compile_t *unlang_ctx, CON ssize_t slen; char const *tmpl_str; - vp_map_t *head; + map_t *head; tmpl_t *vpt = NULL; map_proc_t *proc; @@ -1378,7 +1378,7 @@ static unlang_t *compile_update(unlang_t *parent, unlang_compile_t *unlang_ctx, unlang_t *c; char const *name2 = cf_section_name2(cs); - vp_map_t *head; + map_t *head; tmpl_rules_t parse_rules; @@ -1439,7 +1439,7 @@ static unlang_t *compile_filter(unlang_t *parent, unlang_compile_t *unlang_ctx, unlang_t *c; char const *name2 = cf_section_name2(cs); - vp_map_t *head; + map_t *head; tmpl_rules_t parse_rules; @@ -2492,7 +2492,7 @@ static unlang_t *compile_if(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF .len = sizeof(unlang_cond_t), .type_name = "unlang_cond_t", .pool_headers = 1 + 1 + (TMPL_POOL_DEF_HEADERS * 2), - .pool_len = sizeof(fr_cond_t) + sizeof(vp_map_t) + (TMPL_POOL_DEF_LEN * 2) + .pool_len = sizeof(fr_cond_t) + sizeof(map_t) + (TMPL_POOL_DEF_LEN * 2) }; return compile_if_subsection(parent, unlang_ctx, cs, &if_ext); @@ -2505,7 +2505,7 @@ static unlang_t *compile_elsif(unlang_t *parent, unlang_compile_t *unlang_ctx, C .len = sizeof(unlang_cond_t), .type_name = "unlang_cond_t", .pool_headers = 1 + 1 + (TMPL_POOL_DEF_HEADERS * 2), - .pool_len = sizeof(fr_cond_t) + sizeof(vp_map_t) + (TMPL_POOL_DEF_LEN * 2) + .pool_len = sizeof(fr_cond_t) + sizeof(map_t) + (TMPL_POOL_DEF_LEN * 2) }; return compile_if_subsection(parent, unlang_ctx, cs, &elsif_ext); diff --git a/src/lib/unlang/map.c b/src/lib/unlang/map.c index b2cfbb10f9f..e6615175677 100644 --- a/src/lib/unlang/map.c +++ b/src/lib/unlang/map.c @@ -127,7 +127,7 @@ static unlang_action_t list_mod_create(request_t *request, rlm_rcode_t *presult) unlang_stack_t *stack = request->stack; unlang_stack_frame_t *frame = &stack->frame[stack->depth]; unlang_frame_state_update_t *update_state = frame->state; - vp_map_t *map; + map_t *map; /* * Iterate over the maps producing a set of modifications to apply. @@ -262,7 +262,7 @@ static unlang_action_t unlang_update_state_init(request_t *request, rlm_rcode_t * Initialise the frame state */ MEM(frame->state = update_state = talloc_zero_pooled_object(stack, unlang_frame_state_update_t, - (sizeof(vp_map_t) + + (sizeof(map_t) + (sizeof(tmpl_t) * 2) + 128), g->num_children)); /* 128 is for string buffers */ diff --git a/src/lib/unlang/map_priv.h b/src/lib/unlang/map_priv.h index 1dc01d857ac..ca1d8570abf 100644 --- a/src/lib/unlang/map_priv.h +++ b/src/lib/unlang/map_priv.h @@ -31,7 +31,7 @@ extern "C" { typedef struct { unlang_group_t group; tmpl_t *vpt; - vp_map_t *map; //!< Head of the map list + map_t *map; //!< Head of the map list map_proc_inst_t *proc_inst; } unlang_map_t; diff --git a/src/lib/unlang/switch.c b/src/lib/unlang/switch.c index 31778a60f13..fddb4ad9ced 100644 --- a/src/lib/unlang/switch.c +++ b/src/lib/unlang/switch.c @@ -41,7 +41,7 @@ static unlang_action_t unlang_switch(request_t *request, UNUSED rlm_rcode_t *pre unlang_switch_t *switch_gext; fr_cond_t cond; - vp_map_t map; + map_t map; tmpl_t vpt; switch_g = unlang_generic_to_group(instruction); diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index 135da36788c..503f45f6ebc 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -1370,7 +1370,7 @@ static ssize_t xlat_func_map(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, request_t *request, char const *fmt) { - vp_map_t *map = NULL; + map_t *map = NULL; int ret; tmpl_rules_t attr_rules = { diff --git a/src/lib/util/pair_print.c b/src/lib/util/pair_print.c index 659cc28756a..664d8712677 100644 --- a/src/lib/util/pair_print.c +++ b/src/lib/util/pair_print.c @@ -167,3 +167,5 @@ void _fr_pair_list_log(fr_log_t const *log, fr_pair_t const *vp, char const *fil fr_log(log, L_DBG, file, line, "\t%pP", vp); } } + + diff --git a/src/modules/proto_ldap_sync/sync.h b/src/modules/proto_ldap_sync/sync.h index 534a22697c9..62350af5ba3 100644 --- a/src/modules/proto_ldap_sync/sync.h +++ b/src/modules/proto_ldap_sync/sync.h @@ -149,7 +149,7 @@ struct sync_config_s { /* * LDAP attribute to RADIUS map */ - vp_map_t *entry_map; //!< How to convert attributes in entries + map_t *entry_map; //!< How to convert attributes in entries //!< to FreeRADIUS attributes. /* diff --git a/src/modules/rlm_cache/drivers/rlm_cache_redis/rlm_cache_redis.c b/src/modules/rlm_cache/drivers/rlm_cache_redis/rlm_cache_redis.c index 7a1f014392a..61b68e435e2 100644 --- a/src/modules/rlm_cache/drivers/rlm_cache_redis/rlm_cache_redis.c +++ b/src/modules/rlm_cache/drivers/rlm_cache_redis/rlm_cache_redis.c @@ -138,7 +138,7 @@ static cache_status_t cache_entry_find(rlm_cache_entry_t **out, redisReply *reply = NULL; int s_ret; - vp_map_t *head = NULL, **last = &head; + map_t *head = NULL, **last = &head; #ifdef HAVE_TALLOC_ZERO_POOLED_OBJECT size_t pool_size = 0; #endif @@ -190,7 +190,7 @@ static cache_status_t cache_entry_find(rlm_cache_entry_t **out, * We can get a pretty good idea of the required size of the pool */ for (i = 0; i < reply->elements; i += 3) { - pool_size += sizeof(vp_map_t) + (sizeof(tmpl_t) * 2); + pool_size += sizeof(map_t) + (sizeof(tmpl_t) * 2); if (reply->element[i]->type == REDIS_REPLY_STRING) pool_size += reply->element[i]->len + 1; } @@ -221,7 +221,7 @@ static cache_status_t cache_entry_find(rlm_cache_entry_t **out, * Pull out the cache created date */ if (tmpl_da(head->lhs) == attr_cache_created) { - vp_map_t *map; + map_t *map; c->created = tmpl_value(head->rhs)->vb_date; @@ -234,7 +234,7 @@ static cache_status_t cache_entry_find(rlm_cache_entry_t **out, * Pull out the cache expires date */ if (tmpl_da(head->lhs) == attr_cache_expires) { - vp_map_t *map; + map_t *map; c->expires = tmpl_value(head->rhs)->vb_date; @@ -262,7 +262,7 @@ static cache_status_t cache_entry_insert(UNUSED rlm_cache_config_t const *config rlm_cache_redis_t *driver = instance; TALLOC_CTX *pool; - vp_map_t *map; + map_t *map; fr_redis_conn_t *conn; fr_redis_cluster_state_t state; @@ -283,14 +283,14 @@ static cache_status_t cache_entry_insert(UNUSED rlm_cache_config_t const *config int cnt; tmpl_t expires_value; - vp_map_t expires = { + map_t expires = { .op = T_OP_SET, .lhs = driver->expires_attr, .rhs = &expires_value, }; tmpl_t created_value; - vp_map_t created = { + map_t created = { .op = T_OP_SET, .lhs = driver->created_attr, .rhs = &created_value, diff --git a/src/modules/rlm_cache/rlm_cache.c b/src/modules/rlm_cache/rlm_cache.c index 2bbfe2710b4..d53d519ef95 100644 --- a/src/modules/rlm_cache/rlm_cache.c +++ b/src/modules/rlm_cache/rlm_cache.c @@ -156,7 +156,7 @@ static rlm_rcode_t cache_merge(rlm_cache_t const *inst, request_t *request, rlm_ static rlm_rcode_t cache_merge(rlm_cache_t const *inst, request_t *request, rlm_cache_entry_t *c) { fr_pair_t *vp; - vp_map_t *map; + map_t *map; int merged = 0; RDEBUG2("Merging cache entry into request"); @@ -293,8 +293,8 @@ static rlm_rcode_t cache_expire(rlm_cache_t const *inst, request_t *request, static rlm_rcode_t cache_insert(rlm_cache_t const *inst, request_t *request, rlm_cache_handle_t **handle, uint8_t const *key, size_t key_len, int ttl) { - vp_map_t const *map; - vp_map_t **last, *c_map; + map_t const *map; + map_t **last, *c_map; fr_pair_t *vp; bool merge = false; @@ -367,7 +367,7 @@ static rlm_rcode_t cache_insert(rlm_cache_t const *inst, request_t *request, rlm if (RDEBUG_ENABLED2) map_debug_log(request, map, vp); REXDENT(); - MEM(c_map = talloc_zero(c, vp_map_t)); + MEM(c_map = talloc_zero(c, map_t)); c_map->op = map->op; /* @@ -510,7 +510,7 @@ static rlm_rcode_t cache_set_ttl(rlm_cache_t const *inst, request_t *request, /** Verify that a map in the cache section makes sense * */ -static int cache_verify(vp_map_t *map, void *ctx) +static int cache_verify(map_t *map, void *ctx) { if (unlang_fixup_update(map, ctx) < 0) return -1; @@ -802,7 +802,7 @@ static ssize_t cache_xlat(TALLOC_CTX *ctx, char **out, UNUSED size_t freespace, ssize_t key_len; tmpl_t *target = NULL; - vp_map_t *map = NULL; + map_t *map = NULL; key_len = tmpl_expand((char const **)&key, (char *)buffer, sizeof(buffer), request, inst->config.key, NULL, NULL); diff --git a/src/modules/rlm_cache/rlm_cache.h b/src/modules/rlm_cache/rlm_cache.h index 87eeffb3c55..bd15d67c183 100644 --- a/src/modules/rlm_cache/rlm_cache.h +++ b/src/modules/rlm_cache/rlm_cache.h @@ -70,7 +70,7 @@ typedef struct { module_instance_t *driver_inst; //!< Driver's instance data. rlm_cache_driver_t const *driver; //!< Driver's exported interface. - vp_map_t *maps; //!< Attribute map applied to users. + map_t *maps; //!< Attribute map applied to users. //!< and profiles. CONF_SECTION *cs; } rlm_cache_t; @@ -82,7 +82,7 @@ typedef struct { fr_unix_time_t created; //!< When the entry was created. fr_unix_time_t expires; //!< When the entry expires. - vp_map_t *maps; //!< Head of the maps list. + map_t *maps; //!< Head of the maps list. } rlm_cache_entry_t; /** Allocate a new cache entry diff --git a/src/modules/rlm_cache/serialize.c b/src/modules/rlm_cache/serialize.c index 5acefb54eaf..bdc3983def3 100644 --- a/src/modules/rlm_cache/serialize.c +++ b/src/modules/rlm_cache/serialize.c @@ -42,7 +42,7 @@ int cache_serialize(TALLOC_CTX *ctx, char **out, rlm_cache_entry_t const *c) { TALLOC_CTX *value_pool = NULL; char attr[256]; /* Attr name buffer */ - vp_map_t *map; + map_t *map; char *to_store = NULL; @@ -102,7 +102,7 @@ finish: */ int cache_deserialize(rlm_cache_entry_t *c, fr_dict_t const *dict, char *in, ssize_t inlen) { - vp_map_t **last = &c->maps; + map_t **last = &c->maps; char *p, *q; if (inlen < 0) inlen = strlen(in); @@ -110,7 +110,7 @@ int cache_deserialize(rlm_cache_entry_t *c, fr_dict_t const *dict, char *in, ssi p = in; while (((size_t)(p - in)) < (size_t)inlen) { - vp_map_t *map = NULL; + map_t *map = NULL; tmpl_rules_t parse_rules = { .dict_def = dict, .prefix = TMPL_ATTR_REF_PREFIX_NO diff --git a/src/modules/rlm_client/rlm_client.c b/src/modules/rlm_client/rlm_client.c index c10a5cf5530..0bf76c731e6 100644 --- a/src/modules/rlm_client/rlm_client.c +++ b/src/modules/rlm_client/rlm_client.c @@ -40,7 +40,7 @@ typedef struct { } client_get_vp_ctx_t; static int _map_proc_client_get_vp(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, - vp_map_t const *map, void *uctx) + map_t const *map, void *uctx) { client_get_vp_ctx_t *client = uctx; fr_pair_t *head = NULL, *vp; @@ -115,10 +115,10 @@ static int _map_proc_client_get_vp(TALLOC_CTX *ctx, fr_pair_t **out, request_t * * - #RLM_MODULE_FAIL if an error occurred. */ static rlm_rcode_t map_proc_client(UNUSED void *mod_inst, UNUSED void *proc_inst, request_t *request, - fr_value_box_t **client_override, vp_map_t const *maps) + fr_value_box_t **client_override, map_t const *maps) { rlm_rcode_t rcode = RLM_MODULE_OK; - vp_map_t const *map; + map_t const *map; RADCLIENT *client; client_get_vp_ctx_t uctx; diff --git a/src/modules/rlm_couchbase/mod.c b/src/modules/rlm_couchbase/mod.c index d4a1b9576b2..13dc72644ca 100644 --- a/src/modules/rlm_couchbase/mod.c +++ b/src/modules/rlm_couchbase/mod.c @@ -468,7 +468,7 @@ int mod_json_object_to_map(TALLOC_CTX *ctx, fr_cursor_t *out, request_t *request */ { fr_value_box_t tmp = { .type = FR_TYPE_INVALID }; - vp_map_t *map; + map_t *map; if (fr_json_object_to_value_box(ctx, &tmp, value_obj, da, true) < 0) { bad_value: diff --git a/src/modules/rlm_couchbase/rlm_couchbase.c b/src/modules/rlm_couchbase/rlm_couchbase.c index a387fd7f788..815968ff0e2 100644 --- a/src/modules/rlm_couchbase/rlm_couchbase.c +++ b/src/modules/rlm_couchbase/rlm_couchbase.c @@ -149,7 +149,7 @@ static rlm_rcode_t mod_authorize(module_ctx_t const *mctx, request_t *request) { TALLOC_CTX *pool = talloc_pool(request, 1024); /* We need to do lots of allocs */ fr_cursor_t maps, vlms; - vp_map_t *map_head = NULL, *map; + map_t *map_head = NULL, *map; vp_list_mod_t *vlm_head = NULL, *vlm; fr_cursor_init(&maps, &map_head); diff --git a/src/modules/rlm_csv/rlm_csv.c b/src/modules/rlm_csv/rlm_csv.c index 8030dd6c94b..0b452a77b85 100644 --- a/src/modules/rlm_csv/rlm_csv.c +++ b/src/modules/rlm_csv/rlm_csv.c @@ -31,7 +31,7 @@ RCSID("$Id$") #include static rlm_rcode_t mod_map_proc(void *mod_inst, UNUSED void *proc_inst, request_t *request, - fr_value_box_t **key, vp_map_t const *maps); + fr_value_box_t **key, map_t const *maps); /* * Define a structure for our module configuration. @@ -64,7 +64,7 @@ typedef struct { tmpl_t *key; fr_type_t key_data_type; - vp_map_t *map; //!< if there is an "update" section in the configuration. + map_t *map; //!< if there is an "update" section in the configuration. } rlm_csv_t; typedef struct rlm_csv_entry_s rlm_csv_entry_t; @@ -393,7 +393,7 @@ static int fieldname2offset(rlm_csv_t const *inst, char const *field_name, int * /* * Verify one map entry. */ -static int csv_map_verify(vp_map_t *map, void *instance) +static int csv_map_verify(map_t *map, void *instance) { rlm_csv_t *inst = instance; int offset; @@ -489,9 +489,9 @@ static int csv_map_verify(vp_map_t *map, void *instance) * Verify the result of the map. */ static int csv_maps_verify(CONF_SECTION *cs, void *mod_inst, UNUSED void *proc_inst, - tmpl_t const *src, vp_map_t const *maps) + tmpl_t const *src, map_t const *maps) { - vp_map_t const *map; + map_t const *map; if (!src) { cf_log_err(cs, "Missing key expansion"); @@ -502,7 +502,7 @@ static int csv_maps_verify(CONF_SECTION *cs, void *mod_inst, UNUSED void *proc_i for (map = maps; map != NULL; map = map->next) { - vp_map_t *unconst_map; + map_t *unconst_map; memcpy(&unconst_map, &map, sizeof(map)); @@ -839,7 +839,7 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf) /* * Convert field X to a VP. */ -static int csv_map_getvalue(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, vp_map_t const *map, void *uctx) +static int csv_map_getvalue(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, map_t const *map, void *uctx) { char const *str = uctx; fr_pair_t *head = NULL, *vp; @@ -901,11 +901,11 @@ static int csv_map_getvalue(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request * - #RLM_MODULE_FAIL if an error occurred. */ static rlm_rcode_t mod_map_apply(rlm_csv_t const *inst, request_t *request, - fr_value_box_t const *key, vp_map_t const *maps) + fr_value_box_t const *key, map_t const *maps) { rlm_rcode_t rcode = RLM_MODULE_UPDATED; rlm_csv_entry_t *e; - vp_map_t const *map; + map_t const *map; e = find_entry(inst, key); if (!e) { @@ -982,7 +982,7 @@ finish: * - #RLM_MODULE_FAIL if an error occurred. */ static rlm_rcode_t mod_map_proc(void *mod_inst, UNUSED void *proc_inst, request_t *request, - fr_value_box_t **key, vp_map_t const *maps) + fr_value_box_t **key, map_t const *maps) { rlm_csv_t *inst = talloc_get_type_abort(mod_inst, rlm_csv_t); diff --git a/src/modules/rlm_json/rlm_json.c b/src/modules/rlm_json/rlm_json.c index 94f803add03..8dafbfe66d2 100644 --- a/src/modules/rlm_json/rlm_json.c +++ b/src/modules/rlm_json/rlm_json.c @@ -311,10 +311,10 @@ static xlat_action_t json_encode_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, request * - -1 on failure. */ static int mod_map_proc_instantiate(CONF_SECTION *cs, UNUSED void *mod_inst, void *proc_inst, - tmpl_t const *src, vp_map_t const *maps) + tmpl_t const *src, map_t const *maps) { rlm_json_jpath_cache_t *cache_inst = proc_inst; - vp_map_t const *map; + map_t const *map; ssize_t slen; rlm_json_jpath_cache_t *cache = cache_inst, **tail = &cache->next; @@ -396,7 +396,7 @@ static int mod_map_proc_instantiate(CONF_SECTION *cs, UNUSED void *mod_inst, voi * - -1 on failure. */ static int _json_map_proc_get_value(TALLOC_CTX *ctx, fr_pair_t **out, request_t *request, - vp_map_t const *map, void *uctx) + map_t const *map, void *uctx) { fr_pair_t *vp; fr_cursor_t cursor; @@ -444,13 +444,13 @@ static int _json_map_proc_get_value(TALLOC_CTX *ctx, fr_pair_t **out, request_t * - #RLM_MODULE_FAIL if a fault occurred. */ static rlm_rcode_t mod_map_proc(UNUSED void *mod_inst, void *proc_inst, request_t *request, - fr_value_box_t **json, vp_map_t const *maps) + fr_value_box_t **json, map_t const *maps) { rlm_rcode_t rcode = RLM_MODULE_UPDATED; struct json_tokener *tok; rlm_json_jpath_cache_t *cache = proc_inst; - vp_map_t const *map; + map_t const *map; rlm_json_jpath_to_eval_t to_eval; diff --git a/src/modules/rlm_ldap/rlm_ldap.c b/src/modules/rlm_ldap/rlm_ldap.c index 8970c475406..d94c87e638a 100644 --- a/src/modules/rlm_ldap/rlm_ldap.c +++ b/src/modules/rlm_ldap/rlm_ldap.c @@ -392,7 +392,7 @@ free_urldesc: * Verify the result of the map. */ static int ldap_map_verify(CONF_SECTION *cs, UNUSED void *mod_inst, UNUSED void *proc_inst, - tmpl_t const *src, UNUSED vp_map_t const *maps) + tmpl_t const *src, UNUSED map_t const *maps) { if (!src) { cf_log_err(cs, "Missing LDAP URI"); @@ -421,7 +421,7 @@ static int ldap_map_verify(CONF_SECTION *cs, UNUSED void *mod_inst, UNUSED void * - #RLM_MODULE_FAIL if an error occurred. */ static rlm_rcode_t mod_map_proc(void *mod_inst, UNUSED void *proc_inst, request_t *request, - fr_value_box_t **url, vp_map_t const *maps) + fr_value_box_t **url, map_t const *maps) { rlm_rcode_t rcode = RLM_MODULE_UPDATED; rlm_ldap_t *inst = talloc_get_type_abort(mod_inst, rlm_ldap_t); @@ -431,7 +431,7 @@ static rlm_rcode_t mod_map_proc(void *mod_inst, UNUSED void *proc_inst, request_ LDAPMessage *result = NULL; LDAPMessage *entry = NULL; - vp_map_t const *map; + map_t const *map; char const *url_str; fr_ldap_connection_t *conn; diff --git a/src/modules/rlm_ldap/rlm_ldap.h b/src/modules/rlm_ldap/rlm_ldap.h index 29a834af3a1..d754e437183 100644 --- a/src/modules/rlm_ldap/rlm_ldap.h +++ b/src/modules/rlm_ldap/rlm_ldap.h @@ -42,7 +42,7 @@ struct ldap_inst_s { /* * RADIUS attribute to LDAP attribute maps */ - vp_map_t *user_map; //!< Attribute map applied to users and profiles. + map_t *user_map; //!< Attribute map applied to users and profiles. /* * Options diff --git a/src/modules/rlm_radius/rlm_radius.c b/src/modules/rlm_radius/rlm_radius.c index 76be6938186..8489f2186db 100644 --- a/src/modules/rlm_radius/rlm_radius.c +++ b/src/modules/rlm_radius/rlm_radius.c @@ -326,7 +326,7 @@ static int status_check_update_parse(TALLOC_CTX *ctx, void *out, UNUSED void *pa int rcode; CONF_SECTION *cs; char const *name2; - vp_map_t *head = NULL; + map_t *head = NULL; fr_assert(cf_item_is_section(ci)); diff --git a/src/modules/rlm_radius/rlm_radius.h b/src/modules/rlm_radius/rlm_radius.h index 0f22ccaa7ad..f8fa1475c4f 100644 --- a/src/modules/rlm_radius/rlm_radius.h +++ b/src/modules/rlm_radius/rlm_radius.h @@ -69,7 +69,7 @@ struct rlm_radius_s { uint32_t proxy_state; //!< Unique ID (mostly) of this module. uint32_t *types; //!< array of allowed packet types uint32_t status_check; //!< code of status-check type - vp_map_t *status_check_map; //!< attributes for the status-server checks + map_t *status_check_map; //!< attributes for the status-server checks uint32_t num_answers_to_alive; //!< How many status check responses we need to ///< mark the connection as alive. diff --git a/src/modules/rlm_radius/rlm_radius_udp.c b/src/modules/rlm_radius/rlm_radius_udp.c index 1558b205330..c045c5fcfc5 100644 --- a/src/modules/rlm_radius/rlm_radius_udp.c +++ b/src/modules/rlm_radius/rlm_radius_udp.c @@ -338,7 +338,7 @@ static void CC_HINT(nonnull) status_check_alloc(fr_event_list_t *el, udp_handle_ udp_request_t *u; request_t *request; rlm_radius_udp_t const *inst = h->inst; - vp_map_t *map; + map_t *map; fr_assert(!h->status_u && !h->status_r && !h->status_request); diff --git a/src/modules/rlm_redis_ippool/rlm_redis_ippool.c b/src/modules/rlm_redis_ippool/rlm_redis_ippool.c index e4282ceba67..4c3eba5d9f2 100644 --- a/src/modules/rlm_redis_ippool/rlm_redis_ippool.c +++ b/src/modules/rlm_redis_ippool/rlm_redis_ippool.c @@ -662,7 +662,7 @@ static ippool_rcode_t redis_ippool_allocate(rlm_redis_ippool_t const *inst, requ */ if (reply->elements > 1) { tmpl_t ip_rhs; - vp_map_t ip_map = { + map_t ip_map = { .lhs = inst->allocated_address_attr, .op = T_OP_SET, .rhs = &ip_rhs @@ -725,7 +725,7 @@ static ippool_rcode_t redis_ippool_allocate(rlm_redis_ippool_t const *inst, requ case REDIS_REPLY_STRING: { tmpl_t range_rhs; - vp_map_t range_map = { + map_t range_map = { .lhs = inst->range_attr, .op = T_OP_SET, .rhs = &range_rhs @@ -757,7 +757,7 @@ static ippool_rcode_t redis_ippool_allocate(rlm_redis_ippool_t const *inst, requ */ if (inst->expiry_attr && (reply->elements > 3)) { tmpl_t expiry_rhs; - vp_map_t expiry_map = { + map_t expiry_map = { .lhs = inst->expiry_attr, .op = T_OP_SET, .rhs = &expiry_rhs @@ -799,7 +799,7 @@ static ippool_rcode_t redis_ippool_update(rlm_redis_ippool_t const *inst, reques ippool_rcode_t ret = IPPOOL_RCODE_SUCCESS; tmpl_t range_rhs; - vp_map_t range_map = { .lhs = inst->range_attr, .op = T_OP_SET, .rhs = &range_rhs }; + map_t range_map = { .lhs = inst->range_attr, .op = T_OP_SET, .rhs = &range_rhs }; tmpl_init_shallow(&range_rhs, TMPL_TYPE_DATA, T_DOUBLE_QUOTED_STRING, "", 0); @@ -902,7 +902,7 @@ static ippool_rcode_t redis_ippool_update(rlm_redis_ippool_t const *inst, reques */ if (inst->expiry_attr) { tmpl_t expiry_rhs; - vp_map_t expiry_map = { + map_t expiry_map = { .lhs = inst->expiry_attr, .op = T_OP_SET, .rhs = &expiry_rhs @@ -1161,7 +1161,7 @@ static rlm_rcode_t mod_action(rlm_redis_ippool_t const *inst, request_t *request .type = TMPL_TYPE_DATA, .quote = T_BARE_WORD, }; - vp_map_t ip_map = { + map_t ip_map = { .lhs = inst->allocated_address_attr, .op = T_OP_SET, .rhs = &ip_rhs diff --git a/src/modules/rlm_smtp/rlm_smtp.c b/src/modules/rlm_smtp/rlm_smtp.c index 9f3e84e67e5..e6c85936284 100644 --- a/src/modules/rlm_smtp/rlm_smtp.c +++ b/src/modules/rlm_smtp/rlm_smtp.c @@ -72,7 +72,7 @@ typedef struct { fr_curl_tls_t tls; //!< Used for handled all tls specific curl components char const *name; //!< Auth-Type value for this module instance. fr_dict_enum_t *auth_type; - vp_map_t *header_maps; //!< Attribute map used to process header elements + map_t *header_maps; //!< Attribute map used to process header elements CONF_SECTION *cs; bool set_date; } rlm_smtp_t; @@ -509,7 +509,7 @@ static int header_source(rlm_smtp_thread_t *t, fr_mail_ctx *uctx, UNUSED rlm_smt request_t *request = uctx->request; fr_sbuff_t conf_buffer; fr_sbuff_uctx_talloc_t conf_ctx; - vp_map_t *conf_map; + map_t *conf_map; char *expanded_rhs; @@ -958,7 +958,7 @@ static void mod_unload(void) /** Verify that a map in the header section makes sense * */ -static int smtp_verify(vp_map_t *map, void *ctx) +static int smtp_verify(map_t *map, void *ctx) { if (unlang_fixup_update(map, ctx) < 0) return -1; diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index ac6dd86879d..0cfb0b28554 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -276,7 +276,7 @@ finish: * - -1 on failure. */ static int _sql_map_proc_get_value(TALLOC_CTX *ctx, fr_pair_t **out, - request_t *request, vp_map_t const *map, void *uctx) + request_t *request, map_t const *map, void *uctx) { fr_pair_t *vp; char const *value = uctx; @@ -306,7 +306,7 @@ static int _sql_map_proc_get_value(TALLOC_CTX *ctx, fr_pair_t **out, * Verify the result of the map. */ static int sql_map_verify(CONF_SECTION *cs, UNUSED void *mod_inst, UNUSED void *proc_inst, - tmpl_t const *src, UNUSED vp_map_t const *maps) + tmpl_t const *src, UNUSED map_t const *maps) { if (!src) { cf_log_err(cs, "Missing SQL query"); @@ -330,7 +330,7 @@ static int sql_map_verify(CONF_SECTION *cs, UNUSED void *mod_inst, UNUSED void * * - #RLM_MODULE_FAIL if a fault occurred. */ static rlm_rcode_t mod_map_proc(void *mod_inst, UNUSED void *proc_inst, request_t *request, - fr_value_box_t **query, vp_map_t const *maps) + fr_value_box_t **query, map_t const *maps) { rlm_sql_t *inst = talloc_get_type_abort(mod_inst, rlm_sql_t); rlm_sql_handle_t *handle = NULL; @@ -340,7 +340,7 @@ static rlm_rcode_t mod_map_proc(void *mod_inst, UNUSED void *proc_inst, request_ rlm_rcode_t rcode = RLM_MODULE_UPDATED; sql_rcode_t ret; - vp_map_t const *map; + map_t const *map; rlm_sql_row_t row;