Skip to content

Commit

Permalink
Rename CONF_PARSER to conf_parser_t to match call_env_parser_t
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Nov 17, 2023
1 parent afe53a0 commit c8bc582
Show file tree
Hide file tree
Showing 147 changed files with 480 additions and 484 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SortIncludes: false
# Indents braced list initialisers correctly, with a space
# after the opening brace, and before the closing brace.
#
# static CONF_PARSER group_config[] = {
# static conf_parser_t group_config[] = {
# { FR_CONF_OFFSET("filter", FR_TYPE_STRING, rlm_ldap_t, groupobj_filter) }
# };
#
Expand Down
Empty file modified doc/schemas/ldap/openldap/schema2ldif.sh
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion src/bin/radwho.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static struct radutmp_config_t {
char const *radutmp_fn;
} radutmpconfig;

static const CONF_PARSER module_config[] = {
static const conf_parser_t module_config[] = {
{ FR_CONF_POINTER("filename", FR_TYPE_FILE_INPUT, &radutmpconfig.radutmp_fn), .dflt = RADUTMP },
CONF_PARSER_TERMINATOR
};
Expand Down
6 changes: 3 additions & 3 deletions src/lib/curl/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static fr_table_num_sorted_t const fr_curl_sslcode_table[] = {
};
static size_t fr_curl_sslcode_table_len = NUM_ELEMENTS(fr_curl_sslcode_table);

CONF_PARSER fr_curl_tls_config[] = {
conf_parser_t fr_curl_tls_config[] = {
{ FR_CONF_OFFSET("ca_file", FR_TYPE_FILE_INPUT, fr_curl_tls_t, ca_file) },
{ FR_CONF_OFFSET("ca_issuer_file", FR_TYPE_FILE_INPUT, fr_curl_tls_t, ca_issuer_file) },
{ FR_CONF_OFFSET("ca_path", FR_TYPE_FILE_INPUT, fr_curl_tls_t, ca_path) },
Expand All @@ -72,14 +72,14 @@ CONF_PARSER fr_curl_tls_config[] = {
CONF_PARSER_TERMINATOR
};

static CONF_PARSER reuse_curl_conn_config[] = {
static conf_parser_t reuse_curl_conn_config[] = {
{ FR_CONF_OFFSET("min", FR_TYPE_UINT32, fr_slab_config_t, min_elements), .dflt = "10" },
{ FR_CONF_OFFSET("max", FR_TYPE_UINT32, fr_slab_config_t, max_elements), .dflt = "100" },
{ FR_CONF_OFFSET("cleanup_interval", FR_TYPE_TIME_DELTA, fr_slab_config_t, interval), .dflt = "30s" },
CONF_PARSER_TERMINATOR
};

CONF_PARSER fr_curl_conn_config[] = {
conf_parser_t fr_curl_conn_config[] = {
{ FR_CONF_OFFSET("reuse", FR_TYPE_SUBSECTION, fr_curl_conn_config_t, reuse), .subcs = (void const *) reuse_curl_conn_config },
{ FR_CONF_OFFSET("connect_timeout", FR_TYPE_TIME_DELTA, fr_curl_conn_config_t, connect_timeout), .dflt = "3.0" },
CONF_PARSER_TERMINATOR
Expand Down
4 changes: 2 additions & 2 deletions src/lib/curl/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ typedef struct {
fr_time_delta_t connect_timeout;
} fr_curl_conn_config_t;

extern CONF_PARSER fr_curl_tls_config[];
extern CONF_PARSER fr_curl_conn_config[];
extern conf_parser_t fr_curl_tls_config[];
extern conf_parser_t fr_curl_conn_config[];
extern global_lib_autoinst_t fr_curl_autoinst;

int fr_curl_io_request_enqueue(fr_curl_handle_t *mhandle,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/json/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ typedef struct {
*
*/
struct fr_json_format_s {
char const *output_mode_str; //!< For CONF_PARSER only.
char const *output_mode_str; //!< For conf_parser_t only.

json_mode_type_t output_mode; //!< Determine the format of JSON document
//!< to generate.
Expand All @@ -230,7 +230,7 @@ struct fr_json_format_s {

typedef struct fr_json_format_s fr_json_format_t;

extern CONF_PARSER const fr_json_format_config[];
extern conf_parser_t const fr_json_format_config[];


/* jpath .c */
Expand Down
6 changes: 3 additions & 3 deletions src/lib/json/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ static fr_json_format_t const default_json_format = {
.output_mode = JSON_MODE_OBJECT
};

static CONF_PARSER const json_format_attr_config[] = {
static conf_parser_t const json_format_attr_config[] = {
{ FR_CONF_OFFSET("prefix", FR_TYPE_STRING, fr_json_format_attr_t, prefix) },
CONF_PARSER_TERMINATOR
};

static CONF_PARSER const json_format_value_config[] = {
static conf_parser_t const json_format_value_config[] = {
{ FR_CONF_OFFSET("single_value_as_array", FR_TYPE_BOOL, fr_json_format_value_t, value_is_always_array), .dflt = "no" },
{ FR_CONF_OFFSET("enum_as_integer", FR_TYPE_BOOL, fr_json_format_value_t, enum_as_int), .dflt = "no" },
{ FR_CONF_OFFSET("always_string", FR_TYPE_BOOL, fr_json_format_value_t, always_string), .dflt = "no" },
CONF_PARSER_TERMINATOR
};

CONF_PARSER const fr_json_format_config[] = {
conf_parser_t const fr_json_format_config[] = {
{ FR_CONF_OFFSET("output_mode", FR_TYPE_STRING, fr_json_format_t, output_mode_str), .dflt = "object" },
{ FR_CONF_OFFSET("attribute", FR_TYPE_SUBSECTION, fr_json_format_t, attr),
.subcs = (void const *) json_format_attr_config },
Expand Down
42 changes: 21 additions & 21 deletions src/lib/kafka/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ fr_kafka_topic_conf_t *kafka_topic_conf_from_cs(CONF_SECTION *cs)
* - -1 on failure.
*/
static int kafka_config_dflt_single(CONF_PAIR **out, UNUSED void *parent, CONF_SECTION *cs, char const *value,
fr_token_t quote, CONF_PARSER const *rule)
fr_token_t quote, conf_parser_t const *rule)
{
char tmp[sizeof("18446744073709551615b")];
fr_kafka_conf_ctx_t const *kctx = rule->uctx;
Expand Down Expand Up @@ -201,7 +201,7 @@ static int kafka_config_dflt_single(CONF_PAIR **out, UNUSED void *parent, CONF_S
* - 0 on success.
* - -1 on failure.
*/
static int kafka_config_dflt(CONF_PAIR **out, void *parent, CONF_SECTION *cs, fr_token_t quote, CONF_PARSER const *rule)
static int kafka_config_dflt(CONF_PAIR **out, void *parent, CONF_SECTION *cs, fr_token_t quote, conf_parser_t const *rule)
{
char buff[1024];
size_t buff_len = sizeof(buff);
Expand Down Expand Up @@ -283,7 +283,7 @@ static int kafka_config_dflt(CONF_PAIR **out, void *parent, CONF_SECTION *cs, fr
* - 0 on success.
* - -1 on failure.
*/
static int kafka_topic_config_dflt(CONF_PAIR **out, void *parent, CONF_SECTION *cs, fr_token_t quote, CONF_PARSER const *rule)
static int kafka_topic_config_dflt(CONF_PAIR **out, void *parent, CONF_SECTION *cs, fr_token_t quote, conf_parser_t const *rule)
{
char buff[1024];
size_t buff_len = sizeof(buff);
Expand Down Expand Up @@ -321,7 +321,7 @@ static int kafka_topic_config_dflt(CONF_PAIR **out, void *parent, CONF_SECTION *
return 0;
}

static int kafka_config_parse_single(char const **out, CONF_PAIR *cp, CONF_PARSER const *rule)
static int kafka_config_parse_single(char const **out, CONF_PAIR *cp, conf_parser_t const *rule)
{
fr_value_box_t vb = FR_VALUE_BOX_INITIALISER_NULL(vb);
fr_kafka_conf_ctx_t const *kctx = rule->uctx;
Expand Down Expand Up @@ -421,7 +421,7 @@ static int kafka_config_parse_single(char const **out, CONF_PAIR *cp, CONF_PARSE
* - -1 on failure
*/
static int kafka_config_parse(TALLOC_CTX *ctx, UNUSED void *out, UNUSED void *base,
CONF_ITEM *ci, CONF_PARSER const *rule)
CONF_ITEM *ci, conf_parser_t const *rule)
{
fr_kafka_conf_ctx_t const *kctx = rule->uctx;
CONF_ITEM *parent = cf_parent(ci);
Expand Down Expand Up @@ -493,7 +493,7 @@ static int kafka_config_parse(TALLOC_CTX *ctx, UNUSED void *out, UNUSED void *ba
* - -1 on failure
*/
static int kafka_topic_config_parse(UNUSED TALLOC_CTX *ctx, UNUSED void *out, UNUSED void *base,
CONF_ITEM *ci, CONF_PARSER const *rule)
CONF_ITEM *ci, conf_parser_t const *rule)
{
fr_kafka_conf_ctx_t const *kctx = rule->uctx;
CONF_ITEM *parent = cf_parent(ci);
Expand Down Expand Up @@ -523,7 +523,7 @@ static int kafka_topic_config_parse(UNUSED TALLOC_CTX *ctx, UNUSED void *out, UN
*
*/
static int kafka_topic_new(UNUSED TALLOC_CTX *ctx, UNUSED void *out, UNUSED void *base,
CONF_ITEM *ci, CONF_PARSER const *rule)
CONF_ITEM *ci, conf_parser_t const *rule)
{
fr_kafka_conf_ctx_t const *kctx = rule->uctx;
CONF_ITEM *parent = cf_parent(ci);
Expand All @@ -538,7 +538,7 @@ static int kafka_topic_new(UNUSED TALLOC_CTX *ctx, UNUSED void *out, UNUSED void
}
#endif

static CONF_PARSER const kafka_sasl_oauth_config[] = {
static conf_parser_t const kafka_sasl_oauth_config[] = {
{ FR_CONF_FUNC("oauthbearer_conf", FR_TYPE_STRING, kafka_config_parse, kafka_config_dflt),
.uctx = &(fr_kafka_conf_ctx_t){ .property = "sasl.oauthbearer.config", .empty_default = true }},

Expand All @@ -548,7 +548,7 @@ static CONF_PARSER const kafka_sasl_oauth_config[] = {
CONF_PARSER_TERMINATOR
};

static CONF_PARSER const kafka_sasl_kerberos_config[] = {
static conf_parser_t const kafka_sasl_kerberos_config[] = {
/*
* Service principal
*/
Expand Down Expand Up @@ -582,7 +582,7 @@ static CONF_PARSER const kafka_sasl_kerberos_config[] = {
CONF_PARSER_TERMINATOR
};

static CONF_PARSER const kafka_sasl_config[] = {
static conf_parser_t const kafka_sasl_config[] = {
/*
* SASL mechanism
*/
Expand Down Expand Up @@ -616,7 +616,7 @@ static fr_table_ptr_sorted_t kafka_check_cert_cn_table[] = {
};
static size_t kafka_check_cert_cn_table_len = NUM_ELEMENTS(kafka_check_cert_cn_table);

static CONF_PARSER const kafka_tls_config[] = {
static conf_parser_t const kafka_tls_config[] = {
/*
* Cipher suite list in OpenSSL's format
*/
Expand Down Expand Up @@ -675,7 +675,7 @@ static CONF_PARSER const kafka_tls_config[] = {
CONF_PARSER_TERMINATOR
};

static CONF_PARSER const kafka_connection_config[] = {
static conf_parser_t const kafka_connection_config[] = {
/*
* Socket timeout
*/
Expand Down Expand Up @@ -752,7 +752,7 @@ static CONF_PARSER const kafka_connection_config[] = {
CONF_PARSER_TERMINATOR
};

static CONF_PARSER const kafka_version_config[] = {
static conf_parser_t const kafka_version_config[] = {
/*
* Request the API version from connected brokers
*/
Expand Down Expand Up @@ -780,7 +780,7 @@ static CONF_PARSER const kafka_version_config[] = {
CONF_PARSER_TERMINATOR
};

static CONF_PARSER const kafka_metadata_config[] = {
static conf_parser_t const kafka_metadata_config[] = {
/*
* Interval between attempts to refresh metadata from brokers
*/
Expand Down Expand Up @@ -845,7 +845,7 @@ static CONF_PARSER const kafka_metadata_config[] = {
{ FR_CONF_SUBSECTION_GLOBAL("tls", 0, kafka_tls_config) }, \
{ FR_CONF_SUBSECTION_GLOBAL("sasl", 0, kafka_sasl_config) }

static CONF_PARSER const kafka_consumer_group_config[] = {
static conf_parser_t const kafka_consumer_group_config[] = {
/*
* Group consumer is a member of
*/
Expand Down Expand Up @@ -886,7 +886,7 @@ static CONF_PARSER const kafka_consumer_group_config[] = {
CONF_PARSER_TERMINATOR
};

static CONF_PARSER const kafka_base_consumer_topic_config[] = {
static conf_parser_t const kafka_base_consumer_topic_config[] = {
/*
* How many messages we process at a time
*
Expand Down Expand Up @@ -915,13 +915,13 @@ static CONF_PARSER const kafka_base_consumer_topic_config[] = {
* }
*
*/
static CONF_PARSER const kafka_base_consumer_topics_config[] = {
static conf_parser_t const kafka_base_consumer_topics_config[] = {
{ FR_CONF_SUBSECTION_GLOBAL(CF_IDENT_ANY, FR_TYPE_MULTI, kafka_base_consumer_topic_config) },

CONF_PARSER_TERMINATOR
};

CONF_PARSER const kafka_base_consumer_config[] = {
conf_parser_t const kafka_base_consumer_config[] = {
BASE_CONFIG,
{ FR_CONF_SUBSECTION_GLOBAL("group", 0, kafka_consumer_group_config) },

Expand Down Expand Up @@ -1026,7 +1026,7 @@ CONF_PARSER const kafka_base_consumer_config[] = {
CONF_PARSER_TERMINATOR
};

static CONF_PARSER const kafka_base_producer_topic_config[] = {
static conf_parser_t const kafka_base_producer_topic_config[] = {
/*
* This field indicates the number of acknowledgements the leader
* broker must receive from ISR brokers before responding to the request.
Expand Down Expand Up @@ -1077,13 +1077,13 @@ static CONF_PARSER const kafka_base_producer_topic_config[] = {
* }
*
*/
static CONF_PARSER const kafka_base_producer_topics_config[] = {
static conf_parser_t const kafka_base_producer_topics_config[] = {
{ FR_CONF_SUBSECTION_GLOBAL(CF_IDENT_ANY, 0, kafka_base_producer_topic_config) },

CONF_PARSER_TERMINATOR
};

CONF_PARSER const kafka_base_producer_config[] = {
conf_parser_t const kafka_base_producer_config[] = {
BASE_CONFIG,

/*
Expand Down
4 changes: 2 additions & 2 deletions src/lib/kafka/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ DIAG_ON(documentation-deprecated-sync)
extern "C" {
#endif

extern CONF_PARSER const kafka_base_consumer_config[];
extern CONF_PARSER const kafka_base_producer_config[];
extern conf_parser_t const kafka_base_consumer_config[];
extern conf_parser_t const kafka_base_producer_config[];

#ifdef __cplusplus
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/ldap/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static fr_libldap_global_config_t libldap_global_config = {
.tls_random_file = ""
};

static CONF_PARSER const ldap_global_config[] = {
static conf_parser_t const ldap_global_config[] = {
{ FR_CONF_OFFSET("random_file", FR_TYPE_FILE_EXISTS, fr_libldap_global_config_t, tls_random_file) },
{ FR_CONF_OFFSET("ldap_debug", FR_TYPE_UINT32, fr_libldap_global_config_t, ldap_debug), .dflt = "0x0000" },
CONF_PARSER_TERMINATOR
Expand Down Expand Up @@ -133,7 +133,7 @@ static void libldap_free(void)
*/
global_lib_autoinst_t fr_libldap_global_config = {
.name = "ldap",
.config = (const CONF_PARSER *)ldap_global_config,
.config = (const conf_parser_t *)ldap_global_config,
.inst = &libldap_global_config,
.init = libldap_init,
.free = libldap_free
Expand Down
7 changes: 3 additions & 4 deletions src/lib/ldap/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RCSID("$Id$")
#include <freeradius-devel/ldap/base.h>
#include <freeradius-devel/ldap/conf.h>

CONF_PARSER const fr_ldap_sasl_mech_static[] = {
conf_parser_t const fr_ldap_sasl_mech_static[] = {
{ FR_CONF_OFFSET("mech", FR_TYPE_STRING | FR_TYPE_NOT_EMPTY, fr_ldap_sasl_t, mech) },
{ FR_CONF_OFFSET("proxy", FR_TYPE_STRING, fr_ldap_sasl_t, proxy) },
{ FR_CONF_OFFSET("realm", FR_TYPE_STRING, fr_ldap_sasl_t, realm) },
Expand All @@ -37,7 +37,7 @@ CONF_PARSER const fr_ldap_sasl_mech_static[] = {
/*
* TLS Configuration
*/
CONF_PARSER const fr_ldap_tls_config[] = {
conf_parser_t const fr_ldap_tls_config[] = {
/*
* Deprecated attributes
*/
Expand Down Expand Up @@ -66,7 +66,7 @@ CONF_PARSER const fr_ldap_tls_config[] = {
*
* Note that these overlap a bit with the connection pool code!
*/
CONF_PARSER const fr_ldap_option_config[] = {
conf_parser_t const fr_ldap_option_config[] = {
/*
* Pool config items
*/
Expand Down Expand Up @@ -110,4 +110,3 @@ CONF_PARSER const fr_ldap_option_config[] = {

CONF_PARSER_TERMINATOR
};

6 changes: 3 additions & 3 deletions src/lib/ldap/conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

#include <freeradius-devel/ldap/base.h>

extern CONF_PARSER const fr_ldap_sasl_mech_static[];
extern CONF_PARSER const fr_ldap_tls_config[];
extern CONF_PARSER const fr_ldap_option_config[];
extern conf_parser_t const fr_ldap_sasl_mech_static[];
extern conf_parser_t const fr_ldap_tls_config[];
extern conf_parser_t const fr_ldap_option_config[];

/*
* Macro for including common LDAP configuration items
Expand Down
4 changes: 2 additions & 2 deletions src/lib/server/cf_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,7 @@ static int add_pair(CONF_SECTION *parent, char const *attr, char const *value,
char *buff, char const *filename, int lineno)
{
CONF_DATA const *cd;
CONF_PARSER *rule;
conf_parser_t *rule;
CONF_PAIR *cp;
bool pass2 = false;

Expand Down Expand Up @@ -2031,7 +2031,7 @@ static int add_pair(CONF_SECTION *parent, char const *attr, char const *value,
cf_lineno_set(cp, lineno);
cp->pass2 = pass2;

cd = cf_data_find(CF_TO_ITEM(parent), CONF_PARSER, attr);
cd = cf_data_find(CF_TO_ITEM(parent), conf_parser_t, attr);
if (!cd) return 0;

rule = cf_data_value(cd);
Expand Down
Loading

2 comments on commit c8bc582

@alandekok
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's been CONF_PARSER since 2000! See ea444b4

Oh upper-case names, I will miss you.

@arr2036
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was time. RIP VALUE_PAIR, RADIUS_PACKET, DICT_VALUE and DICT_VENDOR.

Please sign in to comment.