Example #1
0
int find_config_tree_int(struct cmd_context *cmd, int id, struct profile *profile)
{
	cfg_def_item_t *item = cfg_def_get_item_p(id);
	const char *path;
	int profile_applied = 0;
	int i;

	if (profile && !cmd->profile_params->global_profile)
		profile_applied = override_config_tree_from_profile(cmd, profile);

	path = cfg_def_get_path(item);

	if (item->type != CFG_TYPE_INT)
		log_error(INTERNAL_ERROR "%s cfg tree element not declared as integer.", path);

	i = dm_config_tree_find_int(cmd->cft, path, cfg_def_get_default_value(item, CFG_TYPE_INT));

	if (profile_applied)
		remove_config_tree_by_source(cmd, CONFIG_PROFILE);

	return i;
}
Example #2
0
int find_config_tree_int(struct cmd_context *cmd, const char *path,
			 int fail)
{
	return dm_config_tree_find_int(cmd->cft, path, fail);
}