File: register_list.c

package info (click to toggle)
setools 3.3.7-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 9,840 kB
  • sloc: ansic: 82,247; tcl: 13,145; cpp: 4,885; makefile: 1,603; yacc: 779; lex: 296; python: 57; sh: 50
file content (102 lines) | stat: -rw-r--r-- 3,660 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/**
 * @file
 * Keeps track of the all known sechecker modules.
 *
 *  @author Jeremy A. Mowery jmowery@tresys.com
 *  @author Jason Tang jtang@tresys.com
 *
 *  Copyright (C) 2005-2007 Tresys Technology, LLC
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include "register_list.h"

static size_t sechk_register_num_modules = 0;
static size_t sechk_register_num_profiles = 0;

/* NULL terminated array of module names and register functions */
static sechk_module_name_reg_t sechk_module_register_list[] = {
	{"attribs_wo_rules", &attribs_wo_rules_register},
	{"attribs_wo_types", &attribs_wo_types_register},
	{"domain_and_file", &domain_and_file_register},
	{"domains_wo_roles", &domains_wo_roles_register},
	{"find_assoc_types", &find_assoc_types_register},
	{"find_domains", &find_domains_register},
	{"find_file_types", &find_file_types_register},
	{"find_net_domains", &find_net_domains_register},
	{"find_node_types", &find_node_types_register},
	{"find_netif_types", &find_netif_types_register},
	{"find_port_types", &find_port_types_register},
	{"imp_range_trans", &imp_range_trans_register},
	{"inc_dom_trans", &inc_dom_trans_register},
	{"inc_mount", &inc_mount_register},
	{"inc_net_access", &inc_net_access_register},
	{"roles_wo_allow", &roles_wo_allow_register},
	{"roles_wo_types", &roles_wo_types_register},
	{"roles_wo_users", &roles_wo_users_register},
	/* Deprecated *
	 * {"roles_exp_nothing",   &roles_exp_nothing_register},
	 */
	{"spurious_audit", &spurious_audit_register},
	{"types_wo_allow", &types_wo_allow_register},
	{"unreachable_doms", &unreachable_doms_register},
	{"users_wo_roles", &users_wo_roles_register},
	/* TODO: add additional register addresses here in alphabetical order */

	{NULL, NULL}
};

/* NULL terminated array of profiles (name, file, description) */
static sechk_profile_name_reg_t sechk_profile_register_list[] = {
	{"analysis", "analysis-checks.sechecker", "common analysis checks"},
	{"development", "devel-checks.sechecker", "common development checks"},
	{"all", "all-checks.sechecker", "all available checks"},
	{"all-no-mls", "all-checks-no-mls.sechecker", "all available checks not requiring MLS"},
	/* TODO: add more profiles */

	{NULL, NULL, NULL}
};

size_t sechk_register_list_get_num_profiles()
{
	size_t i;
	if (sechk_register_num_profiles != 0)
		return sechk_register_num_profiles;
	for (i = 0; sechk_profile_register_list[i].name != NULL; i++) ;

	sechk_register_num_profiles = i;
	return sechk_register_num_profiles;
}

const sechk_profile_name_reg_t *sechk_register_list_get_profiles()
{
	return sechk_profile_register_list;
}

size_t sechk_register_list_get_num_modules()
{
	size_t i;
	if (sechk_register_num_modules != 0)
		return sechk_register_num_modules;
	for (i = 0; sechk_module_register_list[i].name != NULL; i++) ;

	sechk_register_num_modules = i;
	return sechk_register_num_modules;
}

const sechk_module_name_reg_t *sechk_register_list_get_modules()
{
	return sechk_module_register_list;
}