Beispiel #1
0
struct xccdf_benchmark *xccdf_benchmark_new(void)
{
	struct xccdf_item *bench = xccdf_item_new(XCCDF_BENCHMARK, NULL);
	bench->sub.benchmark.schema_version = NULL;
    // lists
	bench->sub.benchmark.rear_matter  = oscap_list_new();
	bench->sub.benchmark.front_matter = oscap_list_new();
	bench->sub.benchmark.notices = oscap_list_new();
	bench->sub.benchmark.models = oscap_list_new();
	bench->sub.benchmark.content = oscap_list_new();
	bench->sub.benchmark.values = oscap_list_new();
	bench->sub.benchmark.plain_texts = oscap_list_new();
	bench->sub.benchmark.cpe_list = NULL;
	bench->sub.benchmark.cpe_lang_model = NULL;
	bench->sub.benchmark.profiles = oscap_list_new();
	bench->sub.benchmark.results = oscap_list_new();
    // hash tables
	bench->sub.benchmark.items_dict = oscap_htable_new();
	bench->sub.benchmark.profiles_dict = oscap_htable_new();
	bench->sub.benchmark.results_dict = oscap_htable_new();
	bench->sub.benchmark.clusters_dict = oscap_htable_new();

	// add the implied default scoring model
	struct xccdf_model *default_model = xccdf_model_new();
	xccdf_model_set_system(default_model, "urn:xccdf:scoring:default");
	assume_ex(xccdf_benchmark_add_model(XBENCHMARK(bench), default_model), XBENCHMARK(bench));

	return XBENCHMARK(bench);
}
Beispiel #2
0
struct xccdf_item *xccdf_group_new_internal(struct xccdf_item *parent)
{
	struct xccdf_item *group = xccdf_item_new(XCCDF_GROUP, parent);
	group->sub.group.content = oscap_list_new();
	group->sub.group.requires = oscap_list_new();
	group->sub.group.conflicts = oscap_list_new();
	group->sub.group.values = oscap_list_new();
	return group;
}
Beispiel #3
0
struct xccdf_item *xccdf_rule_new_internal(struct xccdf_item *parent)
{
	struct xccdf_item *rule = xccdf_item_new(XCCDF_RULE, parent);
	rule->sub.rule.role = 0;
	rule->sub.rule.severity = 0;

	rule->sub.rule.idents = oscap_list_new();
	rule->sub.rule.checks = oscap_list_new();
	rule->sub.rule.requires = oscap_list_new();
	rule->sub.rule.conflicts = oscap_list_new();
	rule->sub.rule.profile_notes = oscap_list_new();
	rule->sub.rule.fixes = oscap_list_new();
	rule->sub.rule.fixtexts = oscap_list_new();

	return rule;
}