Skip to content

Commit

Permalink
s/section_sub/subsection/
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Apr 12, 2017
1 parent f3db15a commit 18b51b0
Show file tree
Hide file tree
Showing 50 changed files with 168 additions and 168 deletions.
4 changes: 2 additions & 2 deletions src/include/conf_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ CONF_PAIR *cf_pair_find(CONF_SECTION const *, char const *name);
CONF_PAIR *cf_pair_find_next(CONF_SECTION const *, CONF_PAIR const *, char const *name);
CONF_SECTION *cf_section_find_name2(CONF_SECTION const *section,
char const *name1, char const *name2);
CONF_SECTION *cf_section_sub_find(CONF_SECTION const *, char const *name);
CONF_SECTION *cf_section_sub_find_name2(CONF_SECTION const *, char const *name1, char const *name2);
CONF_SECTION *cf_subsection_find(CONF_SECTION const *, char const *name);
CONF_SECTION *cf_subsection_find_name2(CONF_SECTION const *, char const *name1, char const *name2);
char const *cf_section_value_find(CONF_SECTION const *, char const *attr);
CONF_SECTION *cf_top_section(CONF_SECTION *cs);

Expand Down
2 changes: 1 addition & 1 deletion src/lib/ldap/libfreeradius-ldap.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ extern FR_NAME_NUMBER const fr_ldap_tls_require_cert[];
* @param[out] value to write berval values to.
* @param[in] berval to copy pointers/lengths from.
*/
inline void fr_ldap_berval_to_value(value_box_t *value, struct berval *berval)
static inline void fr_ldap_berval_to_value(value_box_t *value, struct berval *berval)
{
value->datum.ptr = berval->bv_val;
value->length = berval->bv_len;
Expand Down
16 changes: 8 additions & 8 deletions src/main/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ bool client_add(RADCLIENT_LIST *clients, RADCLIENT *client)
CONF_SECTION *cs;
CONF_SECTION *subcs;

cs = cf_section_sub_find_name2(main_config.config, "server", client->server);
cs = cf_subsection_find_name2(main_config.config, "server", client->server);
if (!cs) {
ERROR("Failed to find virtual server %s", client->server);
return false;
Expand All @@ -229,7 +229,7 @@ bool client_add(RADCLIENT_LIST *clients, RADCLIENT *client)
* If this server has no "listen" section, add the clients
* to the global client list.
*/
subcs = cf_section_sub_find(cs, "listen");
subcs = cf_subsection_find(cs, "listen");
if (!subcs) goto global_clients;

/*
Expand Down Expand Up @@ -734,7 +734,7 @@ bool client_add_dynamic(RADCLIENT_LIST *clients, RADCLIENT *master, RADCLIENT *c
c->server_cs = master->server_cs;

} else if (c->server) {
c->server_cs = cf_section_sub_find_name2(main_config.config, "server", c->server);
c->server_cs = cf_subsection_find_name2(main_config.config, "server", c->server);
if (!c->server_cs) {
ERROR("Failed to find virtual server %s", c->server);
goto error;
Expand Down Expand Up @@ -806,7 +806,7 @@ int client_map_section(CONF_SECTION *out, CONF_SECTION const *map, client_value_
/*
* Use pre-existing section or alloc a new one
*/
cc = cf_section_sub_find_name2(out, cf_section_name1(cs), cf_section_name2(cs));
cc = cf_subsection_find_name2(out, cf_section_name1(cs), cf_section_name2(cs));
if (!cc) {
cc = cf_section_alloc(out, cf_section_name1(cs), cf_section_name2(cs));
cf_section_add(out, cc);
Expand Down Expand Up @@ -906,7 +906,7 @@ RADCLIENT *client_afrom_cs(TALLOC_CTX *ctx, CONF_SECTION *cs, CONF_SECTION *serv
goto error;
}

c->server_cs = cf_section_sub_find_name2(main_config.config, "server", c->server);
c->server_cs = cf_subsection_find_name2(main_config.config, "server", c->server);
if (!c->server_cs) {
cf_log_err_cs(cs, "Failed to find virtual server %s", c->server);
goto error;
Expand Down Expand Up @@ -1033,7 +1033,7 @@ RADCLIENT *client_afrom_cs(TALLOC_CTX *ctx, CONF_SECTION *cs, CONF_SECTION *serv
goto error;
}

c->client_server_cs = cf_section_sub_find_name2(main_config.config, "server", c->client_server);
c->client_server_cs = cf_subsection_find_name2(main_config.config, "server", c->client_server);
if (!c->client_server_cs) {
cf_log_err_cs(cs, "Unknown virtual server '%s'", c->client_server);
goto error;
Expand Down Expand Up @@ -1099,7 +1099,7 @@ RADCLIENT *client_afrom_cs(TALLOC_CTX *ctx, CONF_SECTION *cs, CONF_SECTION *serv
* create a home server CONF_SECTION and then parse
* it into a home_server_t.
*/
} else if (with_coa || cf_section_sub_find(cs, "coa_server")) {
} else if (with_coa || cf_subsection_find(cs, "coa_server")) {
CONF_SECTION *server;
home_server_t *home;

Expand Down Expand Up @@ -1506,7 +1506,7 @@ RADCLIENT *client_read(char const *filename, CONF_SECTION *server_cs, bool check
return NULL;
}

cs = cf_section_sub_find(cs, "client");
cs = cf_subsection_find(cs, "client");
if (!cs) {
ERROR("No \"client\" section found in client file");
return NULL;
Expand Down
16 changes: 8 additions & 8 deletions src/main/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ static int command_hup(rad_listen_t *listener, int argc, char *argv[])
return CMD_OK;
}

cs = cf_section_sub_find(main_config.config, "modules");
cs = cf_subsection_find(main_config.config, "modules");
if (!cs) return CMD_FAIL;

instance = module_find(cs, argv[0]);
Expand Down Expand Up @@ -1009,7 +1009,7 @@ static int command_show_module_config(rad_listen_t *listener, int argc, char *ar
return CMD_FAIL;
}

cs = cf_section_sub_find(main_config.config, "modules");
cs = cf_subsection_find(main_config.config, "modules");
if (!cs) return CMD_FAIL;

instance = module_find(cs, argv[0]);
Expand Down Expand Up @@ -1046,7 +1046,7 @@ static int command_show_module_methods(rad_listen_t *listener, int argc, char *a
return CMD_FAIL;
}

cs = cf_section_sub_find(main_config.config, "modules");
cs = cf_subsection_find(main_config.config, "modules");
if (!cs) return CMD_FAIL;

instance = module_find(cs, argv[0]);
Expand All @@ -1073,7 +1073,7 @@ static int command_show_module_flags(rad_listen_t *listener, int argc, char *arg
return CMD_FAIL;
}

cs = cf_section_sub_find(main_config.config, "modules");
cs = cf_subsection_find(main_config.config, "modules");
if (!cs) return CMD_FAIL;

instance = module_find(cs, argv[0]);
Expand All @@ -1097,7 +1097,7 @@ static int command_show_module_status(rad_listen_t *listener, int argc, char *ar
return CMD_FAIL;
}

cs = cf_section_sub_find(main_config.config, "modules");
cs = cf_subsection_find(main_config.config, "modules");
if (!cs) return CMD_FAIL;

instance = module_find(cs, argv[0]);
Expand All @@ -1124,7 +1124,7 @@ static int command_show_modules(rad_listen_t *listener, UNUSED int argc, UNUSED
{
CONF_SECTION *cs, *subcs;

cs = cf_section_sub_find(main_config.config, "modules");
cs = cf_subsection_find(main_config.config, "modules");
if (!cs) return CMD_FAIL;

subcs = NULL;
Expand Down Expand Up @@ -2482,7 +2482,7 @@ static int command_set_module_config(rad_listen_t *listener, int argc, char *arg
return 0;
}

cs = cf_section_sub_find(main_config.config, "modules");
cs = cf_subsection_find(main_config.config, "modules");
if (!cs) return 0;

instance = module_find(cs, argv[0]);
Expand Down Expand Up @@ -2560,7 +2560,7 @@ static int command_set_module_status(rad_listen_t *listener, int argc, char *arg
return 0;
}

cs = cf_section_sub_find(main_config.config, "modules");
cs = cf_subsection_find(main_config.config, "modules");
if (!cs) return 0;

instance = module_find(cs, argv[0]);
Expand Down
22 changes: 11 additions & 11 deletions src/main/conf_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ int cf_file_changed(CONF_SECTION *cs, rb_walker_t callback)

cb.rcode = CF_FILE_NONE;
cb.callback = callback;
cb.modules = cf_section_sub_find(cs, "modules");
cb.modules = cf_subsection_find(cs, "modules");

(void) rbtree_walk(tree, RBTREE_IN_ORDER, file_callback, &cb);

Expand Down Expand Up @@ -1059,7 +1059,7 @@ CONF_ITEM *cf_reference_item(CONF_SECTION const *parentcs,

*r = '\0';
*q = '\0';
next = cf_section_sub_find_name2(cs, p, r + 1);
next = cf_subsection_find_name2(cs, p, r + 1);
*r = '[';
*q = ']';

Expand All @@ -1075,7 +1075,7 @@ CONF_ITEM *cf_reference_item(CONF_SECTION const *parentcs,

} else {
*q = '\0';
next = cf_section_sub_find(cs, p);
next = cf_subsection_find(cs, p);
*q = '.';
}

Expand All @@ -1098,7 +1098,7 @@ CONF_ITEM *cf_reference_item(CONF_SECTION const *parentcs,
return &(cp->item);
}

next = cf_section_sub_find(cs, p);
next = cf_subsection_find(cs, p);
if (next) return &(next->item);

/*
Expand Down Expand Up @@ -1464,7 +1464,7 @@ int cf_section_parse_pass2(CONF_SECTION *cs, void *base, CONF_PARSER const varia
* It's a section, recurse!
*/
if (type == PW_TYPE_SUBSECTION) {
CONF_SECTION *subcs = cf_section_sub_find(cs, name);
CONF_SECTION *subcs = cf_subsection_find(cs, name);

if (cf_section_parse_pass2(subcs, (uint8_t *)base + variables[i].offset,
(CONF_PARSER const *)variables[i].dflt) < 0) return -1;
Expand Down Expand Up @@ -2247,7 +2247,7 @@ static void cf_section_parse_init(CONF_SECTION *cs, void *base, CONF_PARSER cons

if (!variables[i].dflt) continue;

subcs = cf_section_sub_find(cs, variables[i].name);
subcs = cf_subsection_find(cs, variables[i].name);

/*
* Set the is_set field for the subsection.
Expand Down Expand Up @@ -2359,7 +2359,7 @@ int cf_section_parse(CONF_SECTION *cs, void *base, CONF_PARSER const *variables)
if (PW_BASE_TYPE(variables[i].type) == PW_TYPE_SUBSECTION) {
CONF_SECTION *subcs;

subcs = cf_section_sub_find(cs, variables[i].name);
for (subcs = cf_subsection_find(cs, variables[i].name);
/*
* Default in this case is overloaded to mean a pointer
* to the CONF_PARSER struct for the subsection.
Expand Down Expand Up @@ -2491,7 +2491,7 @@ static bool cf_template_merge(CONF_SECTION *cs, CONF_SECTION const *template)
subcs1 = cf_item_to_section(ci);
rad_assert(subcs1 != NULL);

subcs2 = cf_section_sub_find_name2(cs, subcs1->name1, subcs1->name2);
subcs2 = cf_subsection_find_name2(cs, subcs1->name1, subcs1->name2);
if (subcs2) {
/*
* sub-sections get merged.
Expand Down Expand Up @@ -2952,7 +2952,7 @@ static int cf_section_read(char const *filename, int *lineno, FILE *fp,

parentcs = cf_top_section(current);

templatecs = cf_section_sub_find(parentcs, "templates");
templatecs = cf_subsection_find(parentcs, "templates");
if (!templatecs) {
ERROR("%s[%d]: No \"templates\" section for reference \"%s\"", filename, *lineno, buff[2]);
goto error;
Expand Down Expand Up @@ -3788,7 +3788,7 @@ CONF_PAIR *cf_pair_find_next(CONF_SECTION const *cs,
* This finds ANY section having the same first name.
* The second name is ignored.
*/
CONF_SECTION *cf_section_sub_find(CONF_SECTION const *cs, char const *name)
CONF_SECTION *cf_subsection_find(CONF_SECTION const *cs, char const *name)
{
CONF_SECTION mycs;

Expand All @@ -3808,7 +3808,7 @@ CONF_SECTION *cf_section_sub_find(CONF_SECTION const *cs, char const *name)
/** Find a CONF_SECTION with both names.
*
*/
CONF_SECTION *cf_section_sub_find_name2(CONF_SECTION const *cs,
CONF_SECTION *cf_subsection_find_name2(CONF_SECTION const *cs,
char const *name1, char const *name2)
{
CONF_ITEM *ci;
Expand Down
16 changes: 8 additions & 8 deletions src/main/listen.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ int listen_bootstrap(CONF_SECTION *server, CONF_SECTION *cs, char const *server_
*
* If there's no "tls" section, that's fine, too.
*/
tls = cf_section_sub_find(cs, "tls");
tls = cf_subsection_find(cs, "tls");
#ifndef WITH_TCP
if (tls) {
cf_log_err_cs(cs, "TLS transport is not available in this executable");
Expand Down Expand Up @@ -1377,7 +1377,7 @@ int common_socket_parse(CONF_SECTION *cs, rad_listen_t *this)
}

# ifdef WITH_TLS
tls = cf_section_sub_find(cs, "tls");
tls = cf_subsection_find(cs, "tls");
if (tls) {
/*
* If unset, set to default.
Expand Down Expand Up @@ -1405,14 +1405,14 @@ int common_socket_parse(CONF_SECTION *cs, rad_listen_t *this)
/*
* Magical tuning methods!
*/
subcs = cf_section_sub_find(cs, "performance");
subcs = cf_subsection_find(cs, "performance");
if (subcs) {
rcode = cf_section_parse(subcs, this,
performance_config);
if (rcode < 0) return -1;
}

subcs = cf_section_sub_find(cs, "limit");
subcs = cf_subsection_find(cs, "limit");
if (subcs) {
rcode = cf_section_parse(subcs, sock,
limit_config);
Expand Down Expand Up @@ -1549,8 +1549,8 @@ int common_socket_parse(CONF_SECTION *cs, rad_listen_t *this)
/*
* Explicit list given: use it.
*/
clients_cs = cf_section_sub_find_name2(parent_cs, "clients", section_name);
if (!clients_cs) clients_cs = cf_section_sub_find(main_config.config, section_name);
clients_cs = cf_subsection_find_name2(parent_cs, "clients", section_name);
if (!clients_cs) clients_cs = cf_subsection_find(main_config.config, section_name);
if (!clients_cs) {
cf_log_err_cs(cs, "Failed to find clients %s {...}", section_name);
return -1;
Expand All @@ -1560,7 +1560,7 @@ int common_socket_parse(CONF_SECTION *cs, rad_listen_t *this)
/*
* Always cache the CONF_SECTION of the server.
*/
this->server_cs = cf_section_sub_find_name2(parent_cs, "server", this->server);
this->server_cs = cf_subsection_find_name2(parent_cs, "server", this->server);
if (!this->server_cs) {
cf_log_err_cs(cs, "Failed to find virtual server '%s'", this->server);
return -1;
Expand All @@ -1573,7 +1573,7 @@ int common_socket_parse(CONF_SECTION *cs, rad_listen_t *this)
* choose the global list of clients.
*/
if (!clients_cs) {
if (cf_section_sub_find(this->server_cs, "client") != NULL) {
if (cf_subsection_find(this->server_cs, "client") != NULL) {
clients_cs = this->server_cs;
} else {
clients_cs = parent_cs;
Expand Down
4 changes: 2 additions & 2 deletions src/main/mainconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ do {\
* to manually override the ones set by modules
* or the server.
*/
subcs = cf_section_sub_find(cs, "feature");
subcs = cf_subsection_find(cs, "feature");
if (!subcs) {
subcs = cf_section_alloc(cs, "feature", NULL);
if (!subcs) return -1;
Expand All @@ -779,7 +779,7 @@ do {\
* We check if it's defined first, this is for
* backwards compatibility.
*/
subcs = cf_section_sub_find(cs, "version");
subcs = cf_subsection_find(cs, "version");
if (!subcs) {
subcs = cf_section_alloc(cs, "version", NULL);
if (!subcs) return -1;
Expand Down
Loading

0 comments on commit 18b51b0

Please sign in to comment.