#include <linux/types.h>
#include <linux/sched.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <linux/file.h>
#include <linux/vmalloc.h>
#include <linux/init.h>
#include <rsbac/types.h>
#include <rsbac/pm_types.h>
#include <rsbac/pm_data_structures.h>
#include <rsbac/getname.h>
#include <rsbac/pm_getname.h>
#include <rsbac/error.h>
#include <rsbac/helpers.h>
#include <rsbac/fs.h>
#include <rsbac/adf.h>
#include <rsbac/adf_main.h>
#include <rsbac/debug.h>
#include <rsbac/proc_fs.h>
#include <rsbac/rkmem.h>
#include <rsbac/lists.h>
#include <linux/string.h>
Go to the source code of this file.
Functions | |
int | sys_write (u_int, char *, u_int) |
static void __init | registration_error (int err, char *listname) |
int __init | rsbac_init_pm (void) |
int | rsbac_stats_pm (void) |
int | rsbac_pm_add_to_set (rsbac_list_ta_number_t ta_number, enum rsbac_pm_set_t set, union rsbac_pm_set_id_t id, union rsbac_pm_set_member_t member) |
int | rsbac_pm_remove_from_set (rsbac_list_ta_number_t ta_number, enum rsbac_pm_set_t set, union rsbac_pm_set_id_t id, union rsbac_pm_set_member_t member) |
int | rsbac_pm_clear_set (rsbac_list_ta_number_t ta_number, enum rsbac_pm_set_t set, union rsbac_pm_set_id_t id) |
rsbac_boolean_t | rsbac_pm_set_member (rsbac_list_ta_number_t ta_number, enum rsbac_pm_set_t set, union rsbac_pm_set_id_t id, union rsbac_pm_set_member_t member) |
rsbac_boolean_t | rsbac_pm_pp_subset (rsbac_pm_pp_set_id_t pp_set, rsbac_pm_in_pp_set_id_t in_pp_set) |
rsbac_boolean_t | rsbac_pm_pp_superset (rsbac_pm_pp_set_id_t pp_set, rsbac_pm_out_pp_set_id_t out_pp_set) |
rsbac_boolean_t | rsbac_pm_pp_only (rsbac_pm_purpose_id_t purpose, rsbac_pm_out_pp_set_id_t out_pp_set) |
int | rsbac_pm_pp_intersec (rsbac_pm_pp_set_id_t pp_set, rsbac_pm_in_pp_set_id_t in_pp_set) |
int | rsbac_pm_pp_union (rsbac_pm_pp_set_id_t pp_set, rsbac_pm_out_pp_set_id_t out_pp_set) |
int | rsbac_pm_create_set (rsbac_list_ta_number_t ta_number, enum rsbac_pm_set_t set, union rsbac_pm_set_id_t id) |
rsbac_boolean_t | rsbac_pm_set_exist (rsbac_list_ta_number_t ta_number, enum rsbac_pm_set_t set, union rsbac_pm_set_id_t id) |
int | rsbac_pm_remove_set (rsbac_list_ta_number_t ta_number, enum rsbac_pm_set_t set, union rsbac_pm_set_id_t id) |
int | rsbac_pm_get_data (rsbac_list_ta_number_t ta_number, enum rsbac_pm_target_t target, union rsbac_pm_target_id_t tid, enum rsbac_pm_data_t data, union rsbac_pm_data_value_t *value) |
int | rsbac_pm_get_all_data (rsbac_list_ta_number_t ta_number, enum rsbac_pm_target_t target, union rsbac_pm_target_id_t tid, union rsbac_pm_all_data_value_t *value) |
rsbac_boolean_t | rsbac_pm_exists (rsbac_list_ta_number_t ta_number, enum rsbac_pm_target_t target, union rsbac_pm_target_id_t tid) |
int | rsbac_pm_set_data (rsbac_list_ta_number_t ta_number, enum rsbac_pm_target_t target, union rsbac_pm_target_id_t tid, enum rsbac_pm_data_t data, union rsbac_pm_data_value_t value) |
int | rsbac_pm_add_target (rsbac_list_ta_number_t ta_number, enum rsbac_pm_target_t target, union rsbac_pm_all_data_value_t data) |
int | rsbac_pm_remove_target (rsbac_list_ta_number_t ta_number, enum rsbac_pm_target_t target, union rsbac_pm_target_id_t tid) |
Variables | |
static rsbac_list_handle_t | task_set_handle = NULL |
static rsbac_list_handle_t | tp_set_handle = NULL |
static rsbac_list_handle_t | ru_set_handle = NULL |
static rsbac_list_handle_t | pp_set_handle = NULL |
static rsbac_list_handle_t | in_pp_set_handle = NULL |
static rsbac_list_handle_t | out_pp_set_handle = NULL |
static rsbac_list_handle_t | task_handle = NULL |
static rsbac_list_handle_t | class_handle = NULL |
static rsbac_list_handle_t | na_handle = NULL |
static rsbac_list_handle_t | cs_handle = NULL |
static rsbac_list_handle_t | tp_handle = NULL |
static rsbac_list_handle_t | pp_handle = NULL |
static rsbac_list_handle_t | tkt_handle = NULL |
static void __init registration_error | ( | int | err, | |
char * | listname | |||
) | [static] |
Definition at line 1076 of file pm_data_structures.c.
References get_error_name(), rsbac_kfree(), rsbac_kmalloc(), RSBAC_MAXNAMELEN, and rsbac_printk().
01078 { 01079 if (err) { 01080 char *tmp = rsbac_kmalloc(RSBAC_MAXNAMELEN); 01081 01082 if (tmp) { 01083 rsbac_printk(KERN_WARNING "rsbac_init_pm(): Registering PM %s list failed with error %s\n", 01084 listname, get_error_name(tmp, err)); 01085 rsbac_kfree(tmp); 01086 } 01087 } 01088 }
int __init rsbac_init_pm | ( | void | ) |
Definition at line 1101 of file pm_data_structures.c.
References class_handle, cs_handle, rsbac_list_lol_info_t::data_size, rsbac_list_info_t::data_size, rsbac_list_lol_info_t::desc_size, rsbac_list_info_t::desc_size, in_pp_set_handle, rsbac_list_lol_info_t::key, rsbac_list_info_t::key, rsbac_list_lol_info_t::max_age, rsbac_list_info_t::max_age, na_handle, NULL, out_pp_set_handle, PA_class, PA_cs, PA_in_pp_set, PA_na, PA_out_pp_set, PA_pp, PA_pp_set, PA_ru_set, PA_task, PA_task_set, PA_tkt, PA_tp, PA_tp_set, pp_handle, pp_set_handle, proc_rsbac_root_p, registration_error(), RSBAC_EREINIT, rsbac_is_initialized(), RSBAC_LIST_BACKUP, rsbac_list_lol_register(), RSBAC_LIST_PERSIST, rsbac_list_register(), RSBAC_LIST_VERSION, RSBAC_PM_CLASS_LIST_NAME, RSBAC_PM_CLASS_LIST_PROC_NAME, RSBAC_PM_CLASS_LIST_VERSION, RSBAC_PM_CS_LIST_NAME, RSBAC_PM_CS_LIST_PROC_NAME, RSBAC_PM_CS_LIST_VERSION, RSBAC_PM_IN_PP_SET_LIST_NAME, RSBAC_PM_IN_PP_SET_LIST_PROC_NAME, RSBAC_PM_LIST_KEY, RSBAC_PM_NA_LIST_NAME, RSBAC_PM_NA_LIST_PROC_NAME, RSBAC_PM_NA_LIST_VERSION, RSBAC_PM_NO_VERSION, RSBAC_PM_OUT_PP_SET_LIST_NAME, RSBAC_PM_OUT_PP_SET_LIST_PROC_NAME, RSBAC_PM_PP_LIST_NAME, RSBAC_PM_PP_LIST_PROC_NAME, RSBAC_PM_PP_LIST_VERSION, RSBAC_PM_PP_SET_LIST_NAME, RSBAC_PM_PP_SET_LIST_PROC_NAME, RSBAC_PM_PP_SET_LIST_VERSION, RSBAC_PM_PROC_DIR_NAME, RSBAC_PM_PROC_STATS_NAME, RSBAC_PM_RU_SET_LIST_NAME, RSBAC_PM_RU_SET_LIST_PROC_NAME, RSBAC_PM_RU_SET_LIST_VERSION, RSBAC_PM_TASK_LIST_NAME, RSBAC_PM_TASK_LIST_PROC_NAME, RSBAC_PM_TASK_LIST_VERSION, RSBAC_PM_TASK_SET_LIST_NAME, RSBAC_PM_TASK_SET_LIST_PROC_NAME, RSBAC_PM_TASK_SET_LIST_VERSION, RSBAC_PM_TKT_LIST_NAME, RSBAC_PM_TKT_LIST_PROC_NAME, RSBAC_PM_TKT_LIST_VERSION, RSBAC_PM_TP_LIST_NAME, RSBAC_PM_TP_LIST_PROC_NAME, RSBAC_PM_TP_LIST_VERSION, RSBAC_PM_TP_SET_LIST_NAME, RSBAC_PM_TP_SET_LIST_PROC_NAME, RSBAC_PM_TP_SET_LIST_VERSION, rsbac_pr_debug, rsbac_printk(), ru_set_handle, rsbac_list_lol_info_t::subdata_size, rsbac_list_lol_info_t::subdesc_size, task_handle, task_set_handle, tkt_handle, tp_handle, tp_set_handle, rsbac_list_lol_info_t::version, and rsbac_list_info_t::version.
Referenced by rsbac_do_init().
01103 { 01104 int err = 0; 01105 struct proc_dir_entry *tmp_entry_p; 01106 struct proc_dir_entry *pm_entry_p; 01107 struct rsbac_list_lol_info_t lol_info; 01108 struct rsbac_list_info_t list_info; 01109 01110 if (rsbac_is_initialized()) { 01111 rsbac_printk(KERN_WARNING "rsbac_init_pm(): RSBAC already initialized\n"); 01112 return (-RSBAC_EREINIT); 01113 } 01114 01115 rsbac_printk(KERN_INFO "rsbac_init_pm(): Initializing RSBAC: PM subsystem\n"); 01116 01117 /* Helper lists */ 01118 lol_info.version = RSBAC_PM_TASK_SET_LIST_VERSION; 01119 lol_info.key = RSBAC_PM_LIST_KEY; 01120 lol_info.desc_size = sizeof(rsbac_pm_task_set_id_t); 01121 lol_info.data_size = 0; 01122 lol_info.subdesc_size = sizeof(rsbac_pm_task_id_t); 01123 lol_info.subdata_size = 0; 01124 lol_info.max_age = 0; 01125 err = rsbac_list_lol_register(RSBAC_LIST_VERSION, 01126 &task_set_handle, 01127 &lol_info, 01128 RSBAC_LIST_PERSIST | 01129 RSBAC_LIST_BACKUP, 01130 NULL, 01131 NULL, NULL, NULL, 01132 NULL, NULL, 01133 RSBAC_PM_TASK_SET_LIST_NAME, 01134 RSBAC_AUTO_DEV); 01135 if (err) { 01136 registration_error(err, "task set"); 01137 return err; 01138 } 01139 01140 lol_info.version = RSBAC_PM_TP_SET_LIST_VERSION; 01141 lol_info.key = RSBAC_PM_LIST_KEY; 01142 lol_info.desc_size = sizeof(rsbac_pm_tp_set_id_t); 01143 lol_info.data_size = 0; 01144 lol_info.subdesc_size = sizeof(rsbac_pm_tp_id_t); 01145 lol_info.subdata_size = 0; 01146 lol_info.max_age = 0; 01147 err = rsbac_list_lol_register(RSBAC_LIST_VERSION, 01148 &tp_set_handle, 01149 &lol_info, 01150 RSBAC_LIST_PERSIST | 01151 RSBAC_LIST_BACKUP, 01152 NULL, 01153 NULL, NULL, NULL, 01154 NULL, NULL, 01155 RSBAC_PM_TP_SET_LIST_NAME, 01156 RSBAC_AUTO_DEV); 01157 if (err) { 01158 registration_error(err, "tp set"); 01159 return err; 01160 } 01161 01162 lol_info.version = RSBAC_PM_RU_SET_LIST_VERSION; 01163 lol_info.key = RSBAC_PM_LIST_KEY; 01164 lol_info.desc_size = sizeof(rsbac_pm_ru_set_id_t); 01165 lol_info.data_size = 0; 01166 lol_info.subdesc_size = sizeof(rsbac_uid_t); 01167 lol_info.subdata_size = 0; 01168 lol_info.max_age = 0; 01169 err = rsbac_list_lol_register(RSBAC_LIST_VERSION, 01170 &ru_set_handle, 01171 &lol_info, 01172 RSBAC_LIST_PERSIST | 01173 RSBAC_LIST_BACKUP, 01174 NULL, 01175 NULL, NULL, NULL, 01176 NULL, NULL, 01177 RSBAC_PM_RU_SET_LIST_NAME, 01178 RSBAC_AUTO_DEV); 01179 if (err) { 01180 registration_error(err, "ru set"); 01181 return err; 01182 } 01183 01184 lol_info.version = RSBAC_PM_PP_SET_LIST_VERSION; 01185 lol_info.key = RSBAC_PM_LIST_KEY; 01186 lol_info.desc_size = sizeof(rsbac_pm_pp_set_id_t); 01187 lol_info.data_size = 0; 01188 lol_info.subdesc_size = sizeof(rsbac_pm_purpose_id_t); 01189 lol_info.subdata_size = 0; 01190 lol_info.max_age = 0; 01191 err = rsbac_list_lol_register(RSBAC_LIST_VERSION, 01192 &pp_set_handle, 01193 &lol_info, 01194 RSBAC_LIST_PERSIST | 01195 RSBAC_LIST_BACKUP, 01196 NULL, 01197 NULL, NULL, NULL, 01198 NULL, NULL, 01199 RSBAC_PM_PP_SET_LIST_NAME, 01200 RSBAC_AUTO_DEV); 01201 if (err) { 01202 registration_error(err, "pp set"); 01203 return err; 01204 } 01205 01206 lol_info.version = RSBAC_PM_NO_VERSION; 01207 lol_info.key = RSBAC_PM_LIST_KEY; 01208 lol_info.desc_size = sizeof(rsbac_pm_in_pp_set_id_t); 01209 lol_info.data_size = 0; 01210 lol_info.subdesc_size = sizeof(rsbac_pm_purpose_id_t); 01211 lol_info.subdata_size = 0; 01212 lol_info.max_age = 0; 01213 err = rsbac_list_lol_register(RSBAC_LIST_VERSION, 01214 &in_pp_set_handle, 01215 &lol_info, 01216 0, 01217 NULL, 01218 NULL, 01219 NULL, 01220 NULL, 01221 NULL, 01222 NULL, 01223 RSBAC_PM_IN_PP_SET_LIST_NAME, 01224 RSBAC_AUTO_DEV); 01225 if (err) { 01226 registration_error(err, "in_pp set"); 01227 return err; 01228 } 01229 01230 lol_info.version = RSBAC_PM_NO_VERSION; 01231 lol_info.key = RSBAC_PM_LIST_KEY; 01232 lol_info.desc_size = sizeof(rsbac_pm_out_pp_set_id_t); 01233 lol_info.data_size = 0; 01234 lol_info.subdesc_size = sizeof(rsbac_pm_purpose_id_t); 01235 lol_info.subdata_size = 0; 01236 lol_info.max_age = 0; 01237 err = rsbac_list_lol_register(RSBAC_LIST_VERSION, 01238 &out_pp_set_handle, 01239 &lol_info, 01240 0, 01241 NULL, 01242 NULL, 01243 NULL, 01244 NULL, 01245 NULL, 01246 NULL, 01247 RSBAC_PM_OUT_PP_SET_LIST_NAME, 01248 RSBAC_AUTO_DEV); 01249 if (err) { 01250 registration_error(err, "out_pp set"); 01251 return err; 01252 } 01253 01254 /* Main lists */ 01255 list_info.version = RSBAC_PM_TASK_LIST_VERSION; 01256 list_info.key = RSBAC_PM_LIST_KEY; 01257 list_info.desc_size = sizeof(rsbac_pm_task_id_t); 01258 list_info.data_size = sizeof(struct rsbac_pm_task_data_t); 01259 list_info.max_age = 0; 01260 err = rsbac_list_register(RSBAC_LIST_VERSION, 01261 &task_handle, 01262 &list_info, 01263 RSBAC_LIST_PERSIST | RSBAC_LIST_BACKUP, 01264 NULL, 01265 NULL, 01266 NULL, 01267 RSBAC_PM_TASK_LIST_NAME, RSBAC_AUTO_DEV); 01268 if (err) { 01269 registration_error(err, "task"); 01270 return err; 01271 } 01272 01273 list_info.version = RSBAC_PM_CLASS_LIST_VERSION; 01274 list_info.key = RSBAC_PM_LIST_KEY; 01275 list_info.desc_size = sizeof(rsbac_pm_object_class_id_t); 01276 list_info.data_size = sizeof(struct rsbac_pm_class_data_t); 01277 list_info.max_age = 0; 01278 err = rsbac_list_register(RSBAC_LIST_VERSION, 01279 &class_handle, 01280 &list_info, 01281 RSBAC_LIST_PERSIST | RSBAC_LIST_BACKUP, 01282 NULL, 01283 NULL, 01284 NULL, 01285 RSBAC_PM_CLASS_LIST_NAME, 01286 RSBAC_AUTO_DEV); 01287 if (err) { 01288 registration_error(err, "class"); 01289 return err; 01290 } 01291 01292 list_info.version = RSBAC_PM_NA_LIST_VERSION; 01293 list_info.key = RSBAC_PM_LIST_KEY; 01294 list_info.desc_size = sizeof(struct rsbac_pm_na_id_t); 01295 list_info.data_size = sizeof(struct rsbac_pm_na_data_t); 01296 list_info.max_age = 0; 01297 err = rsbac_list_register(RSBAC_LIST_VERSION, 01298 &na_handle, 01299 &list_info, 01300 RSBAC_LIST_PERSIST | RSBAC_LIST_BACKUP, 01301 NULL, 01302 NULL, 01303 NULL, 01304 RSBAC_PM_NA_LIST_NAME, RSBAC_AUTO_DEV); 01305 if (err) { 01306 registration_error(err, "na"); 01307 return err; 01308 } 01309 01310 list_info.version = RSBAC_PM_CS_LIST_VERSION; 01311 list_info.key = RSBAC_PM_LIST_KEY; 01312 list_info.desc_size = sizeof(struct rsbac_pm_cs_id_t); 01313 list_info.data_size = sizeof(struct rsbac_pm_cs_data_t); 01314 list_info.max_age = 0; 01315 err = rsbac_list_register(RSBAC_LIST_VERSION, 01316 &cs_handle, 01317 &list_info, 01318 RSBAC_LIST_PERSIST | RSBAC_LIST_BACKUP, 01319 NULL, 01320 NULL, 01321 NULL, 01322 RSBAC_PM_CS_LIST_NAME, RSBAC_AUTO_DEV); 01323 if (err) { 01324 registration_error(err, "cs"); 01325 return err; 01326 } 01327 01328 list_info.version = RSBAC_PM_TP_LIST_VERSION; 01329 list_info.key = RSBAC_PM_LIST_KEY; 01330 list_info.desc_size = sizeof(rsbac_pm_tp_id_t); 01331 list_info.data_size = sizeof(struct rsbac_pm_tp_data_t); 01332 list_info.max_age = 0; 01333 err = rsbac_list_register(RSBAC_LIST_VERSION, 01334 &tp_handle, 01335 &list_info, 01336 RSBAC_LIST_PERSIST | RSBAC_LIST_BACKUP, 01337 NULL, 01338 NULL, 01339 NULL, 01340 RSBAC_PM_TP_LIST_NAME, RSBAC_AUTO_DEV); 01341 if (err) { 01342 registration_error(err, "tp"); 01343 return err; 01344 } 01345 01346 list_info.version = RSBAC_PM_PP_LIST_VERSION; 01347 list_info.key = RSBAC_PM_LIST_KEY; 01348 list_info.desc_size = sizeof(rsbac_pm_purpose_id_t); 01349 list_info.data_size = sizeof(struct rsbac_pm_pp_data_t); 01350 list_info.max_age = 0; 01351 err = rsbac_list_register(RSBAC_LIST_VERSION, 01352 &pp_handle, 01353 &list_info, 01354 RSBAC_LIST_PERSIST | RSBAC_LIST_BACKUP, 01355 NULL, 01356 NULL, 01357 NULL, 01358 RSBAC_PM_PP_LIST_NAME, RSBAC_AUTO_DEV); 01359 if (err) { 01360 registration_error(err, "pp"); 01361 return err; 01362 } 01363 01364 list_info.version = RSBAC_PM_TKT_LIST_VERSION; 01365 list_info.key = RSBAC_PM_LIST_KEY; 01366 list_info.desc_size = sizeof(rsbac_pm_tkt_id_t); 01367 list_info.data_size = sizeof(struct rsbac_pm_tkt_data_t); 01368 list_info.max_age = 0; 01369 err = rsbac_list_register(RSBAC_LIST_VERSION, 01370 &tkt_handle, 01371 &list_info, 01372 RSBAC_LIST_PERSIST | RSBAC_LIST_BACKUP, 01373 NULL, 01374 NULL, 01375 NULL, 01376 RSBAC_PM_TKT_LIST_NAME, RSBAC_AUTO_DEV); 01377 if (err) { 01378 registration_error(err, "tkt"); 01379 return err; 01380 } 01381 #if defined(CONFIG_RSBAC_PROC) 01382 tmp_entry_p = create_proc_entry(RSBAC_PM_PROC_STATS_NAME, 01383 S_IFREG | S_IRUGO, 01384 proc_rsbac_root_p); 01385 if (tmp_entry_p) { 01386 tmp_entry_p->get_info = stats_pm_proc_info; 01387 } 01388 01389 pm_entry_p = create_proc_entry(RSBAC_PM_PROC_DIR_NAME, 01390 S_IFDIR | S_IRUGO | S_IXUGO, 01391 proc_rsbac_root_p); 01392 if (pm_entry_p) { 01393 tmp_entry_p = 01394 create_proc_entry(RSBAC_PM_TASK_SET_LIST_PROC_NAME, 01395 S_IFREG | S_IRUGO, pm_entry_p); 01396 if (tmp_entry_p) { 01397 tmp_entry_p->read_proc = pm_list_proc_read; 01398 tmp_entry_p->data = (void *) PA_task_set; 01399 } 01400 tmp_entry_p = 01401 create_proc_entry(RSBAC_PM_TP_SET_LIST_PROC_NAME, 01402 S_IFREG | S_IRUGO, pm_entry_p); 01403 if (tmp_entry_p) { 01404 tmp_entry_p->read_proc = pm_list_proc_read; 01405 tmp_entry_p->data = (void *) PA_tp_set; 01406 } 01407 tmp_entry_p = 01408 create_proc_entry(RSBAC_PM_RU_SET_LIST_PROC_NAME, 01409 S_IFREG | S_IRUGO, pm_entry_p); 01410 if (tmp_entry_p) { 01411 tmp_entry_p->read_proc = pm_list_proc_read; 01412 tmp_entry_p->data = (void *) PA_ru_set; 01413 } 01414 tmp_entry_p = 01415 create_proc_entry(RSBAC_PM_PP_SET_LIST_PROC_NAME, 01416 S_IFREG | S_IRUGO, pm_entry_p); 01417 if (tmp_entry_p) { 01418 tmp_entry_p->read_proc = pm_list_proc_read; 01419 tmp_entry_p->data = (void *) PA_pp_set; 01420 } 01421 tmp_entry_p = 01422 create_proc_entry(RSBAC_PM_IN_PP_SET_LIST_PROC_NAME, 01423 S_IFREG | S_IRUGO, pm_entry_p); 01424 if (tmp_entry_p) { 01425 tmp_entry_p->read_proc = pm_list_proc_read; 01426 tmp_entry_p->data = (void *) PA_in_pp_set; 01427 } 01428 tmp_entry_p = 01429 create_proc_entry(RSBAC_PM_OUT_PP_SET_LIST_PROC_NAME, 01430 S_IFREG | S_IRUGO, pm_entry_p); 01431 if (tmp_entry_p) { 01432 tmp_entry_p->read_proc = pm_list_proc_read; 01433 tmp_entry_p->data = (void *) PA_out_pp_set; 01434 } 01435 01436 tmp_entry_p = 01437 create_proc_entry(RSBAC_PM_TASK_LIST_PROC_NAME, 01438 S_IFREG | S_IRUGO, pm_entry_p); 01439 if (tmp_entry_p) { 01440 tmp_entry_p->read_proc = pm_list_proc_read; 01441 tmp_entry_p->data = (void *) PA_task; 01442 } 01443 tmp_entry_p = 01444 create_proc_entry(RSBAC_PM_CLASS_LIST_PROC_NAME, 01445 S_IFREG | S_IRUGO, pm_entry_p); 01446 if (tmp_entry_p) { 01447 tmp_entry_p->read_proc = pm_list_proc_read; 01448 tmp_entry_p->data = (void *) PA_class; 01449 } 01450 tmp_entry_p = create_proc_entry(RSBAC_PM_NA_LIST_PROC_NAME, 01451 S_IFREG | S_IRUGO, 01452 pm_entry_p); 01453 if (tmp_entry_p) { 01454 tmp_entry_p->read_proc = pm_list_proc_read; 01455 tmp_entry_p->data = (void *) PA_na; 01456 } 01457 tmp_entry_p = create_proc_entry(RSBAC_PM_CS_LIST_PROC_NAME, 01458 S_IFREG | S_IRUGO, 01459 pm_entry_p); 01460 if (tmp_entry_p) { 01461 tmp_entry_p->read_proc = pm_list_proc_read; 01462 tmp_entry_p->data = (void *) PA_cs; 01463 } 01464 tmp_entry_p = create_proc_entry(RSBAC_PM_TP_LIST_PROC_NAME, 01465 S_IFREG | S_IRUGO, 01466 pm_entry_p); 01467 if (tmp_entry_p) { 01468 tmp_entry_p->read_proc = pm_list_proc_read; 01469 tmp_entry_p->data = (void *) PA_tp; 01470 } 01471 tmp_entry_p = create_proc_entry(RSBAC_PM_PP_LIST_PROC_NAME, 01472 S_IFREG | S_IRUGO, 01473 pm_entry_p); 01474 if (tmp_entry_p) { 01475 tmp_entry_p->read_proc = pm_list_proc_read; 01476 tmp_entry_p->data = (void *) PA_pp; 01477 } 01478 tmp_entry_p = 01479 create_proc_entry(RSBAC_PM_TKT_LIST_PROC_NAME, 01480 S_IFREG | S_IRUGO, pm_entry_p); 01481 if (tmp_entry_p) { 01482 tmp_entry_p->read_proc = pm_list_proc_read; 01483 tmp_entry_p->data = (void *) PA_tkt; 01484 } 01485 } 01486 #endif 01487 rsbac_pr_debug(ds_pm, "Ready.\n"); 01488 return (err); 01489 };
int rsbac_pm_add_target | ( | rsbac_list_ta_number_t | ta_number, | |
enum rsbac_pm_target_t | target, | |||
union rsbac_pm_all_data_value_t | data | |||
) |
Definition at line 2684 of file pm_data_structures.c.
References class_handle, cs_handle, na_handle, pp_handle, RSBAC_EINVALIDTARGET, rsbac_ta_list_add_ttl(), task_handle, tkt_handle, and tp_handle.
Referenced by rsbac_pm().
02687 { 02688 switch (target) { 02689 case PMT_TASK: 02690 /* 02691 rsbac_pr_debug(ds_pm, "Adding task item\n"); 02692 */ 02693 return rsbac_ta_list_add_ttl(ta_number, task_handle, 0, 02694 &data.task.id, &data.task); 02695 02696 case PMT_CLASS: 02697 /* 02698 rsbac_pr_debug(ds_pm, "Adding class item\n"); 02699 */ 02700 return rsbac_ta_list_add_ttl(ta_number, class_handle, 0, 02701 &data.object_class.id, 02702 &data.object_class); 02703 02704 case PMT_NA: 02705 { 02706 struct rsbac_pm_na_id_t na_id; 02707 02708 /* 02709 rsbac_pr_debug(ds_pm, "Adding na item\n"); 02710 */ 02711 na_id.task = data.na.task; 02712 na_id.object_class = data.na.object_class; 02713 na_id.tp = data.na.tp; 02714 return rsbac_ta_list_add_ttl(ta_number, na_handle, 02715 0, &na_id, &data.na); 02716 } 02717 02718 case PMT_CS: 02719 { 02720 struct rsbac_pm_cs_id_t cs_id; 02721 02722 /* 02723 rsbac_pr_debug(ds_pm, "Adding cs item\n"); 02724 */ 02725 cs_id.purpose = data.cs.purpose; 02726 cs_id.file = data.cs.file; 02727 return rsbac_ta_list_add_ttl(ta_number, cs_handle, 02728 0, &cs_id, &data.cs); 02729 } 02730 02731 case PMT_TP: 02732 /* 02733 rsbac_pr_debug(ds_pm, "Adding tp item\n"); 02734 */ 02735 return rsbac_ta_list_add_ttl(ta_number, tp_handle, 0, 02736 &data.tp.id, &data.tp); 02737 02738 case PMT_PP: 02739 /* 02740 rsbac_pr_debug(ds_pm, "Adding pp item\n"); 02741 */ 02742 return rsbac_ta_list_add_ttl(ta_number, pp_handle, 0, 02743 &data.pp.id, &data.pp); 02744 02745 case PMT_TKT: 02746 /* 02747 rsbac_pr_debug(ds_pm, "Adding tkt item\n"); 02748 */ 02749 return rsbac_ta_list_add_ttl(ta_number, tkt_handle, 0, 02750 &data.tkt.id, &data.tkt); 02751 02752 /* switch target: no valid target */ 02753 default: 02754 return (-RSBAC_EINVALIDTARGET); 02755 } 02756 } /* end of rsbac_pm_add_target() */
int rsbac_pm_add_to_set | ( | rsbac_list_ta_number_t | ta_number, | |
enum rsbac_pm_set_t | set, | |||
union rsbac_pm_set_id_t | id, | |||
union rsbac_pm_set_member_t | member | |||
) |
Definition at line 1614 of file pm_data_structures.c.
References in_pp_set_handle, NULL, out_pp_set_handle, pp_set_handle, RSBAC_EINVALIDTARGET, rsbac_ta_list_lol_subadd_ttl(), ru_set_handle, task_set_handle, and tp_set_handle.
Referenced by adjust_in_out_pp_ipc(), and rsbac_pm().
01618 { 01619 switch (set) { 01620 case PS_TASK: 01621 return (rsbac_ta_list_lol_subadd_ttl 01622 (ta_number, task_set_handle, 0, &id.task_set, 01623 &member.task, NULL)); 01624 case PS_TP: 01625 return (rsbac_ta_list_lol_subadd_ttl 01626 (ta_number, tp_set_handle, 0, &id.tp_set, 01627 &member.tp, NULL)); 01628 case PS_RU: 01629 return (rsbac_ta_list_lol_subadd_ttl 01630 (ta_number, ru_set_handle, 0, &id.ru_set, 01631 &member.ru, NULL)); 01632 case PS_PP: 01633 return (rsbac_ta_list_lol_subadd_ttl 01634 (ta_number, pp_set_handle, 0, &id.pp_set, 01635 &member.pp, NULL)); 01636 case PS_IN_PP: 01637 return (rsbac_ta_list_lol_subadd_ttl 01638 (ta_number, in_pp_set_handle, 0, &id.in_pp_set, 01639 &member.pp, NULL)); 01640 case PS_OUT_PP: 01641 return (rsbac_ta_list_lol_subadd_ttl 01642 (ta_number, out_pp_set_handle, 0, &id.out_pp_set, 01643 &member.pp, NULL)); 01644 default: 01645 return (-RSBAC_EINVALIDTARGET); 01646 } 01647 }
int rsbac_pm_clear_set | ( | rsbac_list_ta_number_t | ta_number, | |
enum rsbac_pm_set_t | set, | |||
union rsbac_pm_set_id_t | id | |||
) |
Definition at line 1694 of file pm_data_structures.c.
References in_pp_set_handle, out_pp_set_handle, pp_set_handle, RSBAC_EINVALIDTARGET, rsbac_ta_list_lol_subremove_all(), ru_set_handle, task_set_handle, and tp_set_handle.
Referenced by adjust_in_out_pp_ipc(), and rsbac_pm().
01696 { 01697 switch (set) { 01698 case PS_TASK: 01699 return (rsbac_ta_list_lol_subremove_all 01700 (ta_number, task_set_handle, &id.task_set)); 01701 case PS_TP: 01702 return (rsbac_ta_list_lol_subremove_all 01703 (ta_number, tp_set_handle, &id.tp_set)); 01704 case PS_RU: 01705 return (rsbac_ta_list_lol_subremove_all 01706 (ta_number, ru_set_handle, &id.ru_set)); 01707 case PS_PP: 01708 return (rsbac_ta_list_lol_subremove_all 01709 (ta_number, pp_set_handle, &id.pp_set)); 01710 case PS_IN_PP: 01711 return (rsbac_ta_list_lol_subremove_all 01712 (ta_number, in_pp_set_handle, &id.in_pp_set)); 01713 case PS_OUT_PP: 01714 return (rsbac_ta_list_lol_subremove_all 01715 (ta_number, out_pp_set_handle, &id.out_pp_set)); 01716 default: 01717 return (-RSBAC_EINVALIDTARGET); 01718 } 01719 }
int rsbac_pm_create_set | ( | rsbac_list_ta_number_t | ta_number, | |
enum rsbac_pm_set_t | set, | |||
union rsbac_pm_set_id_t | id | |||
) |
Definition at line 1950 of file pm_data_structures.c.
References in_pp_set_handle, NULL, out_pp_set_handle, pp_set_handle, RSBAC_EEXISTS, RSBAC_EINVALIDTARGET, rsbac_ta_list_lol_add_ttl(), rsbac_ta_list_lol_exist(), ru_set_handle, task_set_handle, and tp_set_handle.
Referenced by adjust_in_out_pp_ipc(), and rsbac_pm().
01953 { 01954 switch (set) { 01955 case PS_TASK: 01956 /* 01957 rsbac_pr_debug(ds_pm, "Creating task set\n"); 01958 */ 01959 if (rsbac_ta_list_lol_exist 01960 (ta_number, task_set_handle, &id.task_set)) 01961 return -RSBAC_EEXISTS; 01962 return rsbac_ta_list_lol_add_ttl(ta_number, 01963 task_set_handle, 0, 01964 &id.task_set, NULL); 01965 case PS_TP: 01966 /* 01967 rsbac_pr_debug(ds_pm, "Creating tp set\n"); 01968 */ 01969 if (rsbac_ta_list_lol_exist 01970 (ta_number, tp_set_handle, &id.tp_set)) 01971 return -RSBAC_EEXISTS; 01972 return rsbac_ta_list_lol_add_ttl(ta_number, tp_set_handle, 01973 0, &id.tp_set, NULL); 01974 case PS_RU: 01975 /* 01976 rsbac_pr_debug(ds_pm, "Creating ru set\n"); 01977 */ 01978 if (rsbac_ta_list_lol_exist 01979 (ta_number, ru_set_handle, &id.ru_set)) 01980 return -RSBAC_EEXISTS; 01981 return rsbac_ta_list_lol_add_ttl(ta_number, ru_set_handle, 01982 0, &id.ru_set, NULL); 01983 case PS_PP: 01984 /* 01985 rsbac_pr_debug(ds_pm, "Creating pp set\n"); 01986 */ 01987 if (rsbac_ta_list_lol_exist 01988 (ta_number, pp_set_handle, &id.pp_set)) 01989 return -RSBAC_EEXISTS; 01990 return rsbac_ta_list_lol_add_ttl(ta_number, pp_set_handle, 01991 0, &id.pp_set, NULL); 01992 case PS_IN_PP: 01993 /* 01994 rsbac_pr_debug(ds_pm, "Creating in_pp set\n"); 01995 */ 01996 if (rsbac_ta_list_lol_exist 01997 (ta_number, in_pp_set_handle, &id.in_pp_set)) 01998 return -RSBAC_EEXISTS; 01999 return rsbac_ta_list_lol_add_ttl(ta_number, 02000 in_pp_set_handle, 0, 02001 &id.in_pp_set, NULL); 02002 case PS_OUT_PP: 02003 /* 02004 rsbac_pr_debug(ds_pm, "Creating out_pp set\n"); 02005 */ 02006 if (rsbac_ta_list_lol_exist 02007 (ta_number, out_pp_set_handle, &id.out_pp_set)) 02008 return -RSBAC_EEXISTS; 02009 return rsbac_ta_list_lol_add_ttl(ta_number, 02010 out_pp_set_handle, 0, 02011 &id.out_pp_set, NULL); 02012 02013 default: 02014 return (-RSBAC_EINVALIDTARGET); 02015 } 02016 }
rsbac_boolean_t rsbac_pm_exists | ( | rsbac_list_ta_number_t | ta_number, | |
enum rsbac_pm_target_t | target, | |||
union rsbac_pm_target_id_t | tid | |||
) |
Definition at line 2396 of file pm_data_structures.c.
References class_handle, cs_handle, FALSE, na_handle, NULL, pp_handle, pp_set_handle, RSBAC_PM_DEV_OBJECT_CLASS_ID, RSBAC_PM_IPC_OBJECT_CLASS_ID, rsbac_printk(), rsbac_ta_list_exist(), rsbac_ta_list_get_data_ttl(), rsbac_ta_list_lol_exist(), rsbac_ta_list_lol_remove(), rsbac_ta_list_remove(), task_handle, tkt_handle, tp_handle, and TRUE.
Referenced by na_and_pp_or_cs(), rsbac_pm(), and rsbac_pm_create_file().
02399 { 02400 switch (target) { 02401 case PMT_TASK: 02402 return rsbac_ta_list_exist(ta_number, task_handle, 02403 &tid.task); 02404 02405 case PMT_CLASS: 02406 /* IPC and DEV classes always exist */ 02407 if ((tid.object_class == RSBAC_PM_IPC_OBJECT_CLASS_ID) 02408 || (tid.object_class == RSBAC_PM_DEV_OBJECT_CLASS_ID)) 02409 return (TRUE); 02410 return rsbac_ta_list_exist(ta_number, class_handle, 02411 &tid.object_class); 02412 02413 case PMT_NA: 02414 return rsbac_ta_list_exist(ta_number, na_handle, &tid.na); 02415 02416 case PMT_CS: 02417 return rsbac_ta_list_exist(ta_number, cs_handle, &tid.cs); 02418 02419 case PMT_TP: 02420 return rsbac_ta_list_exist(ta_number, tp_handle, &tid.tp); 02421 02422 case PMT_PP: 02423 return rsbac_ta_list_exist(ta_number, pp_handle, &tid.pp); 02424 02425 case PMT_TKT: 02426 { 02427 struct rsbac_pm_tkt_data_t all_data; 02428 02429 if (rsbac_ta_list_get_data_ttl 02430 (ta_number, tkt_handle, NULL, &tid.tkt, 02431 &all_data)) 02432 return FALSE; 02433 02434 /* ticket too old? -> remove it and return FALSE */ 02435 { 02436 if (all_data.valid_until < 02437 RSBAC_CURRENT_TIME) { 02438 rsbac_pm_pp_set_id_t pp_set = 02439 -tid.tkt; 02440 02441 if (rsbac_ta_list_lol_exist 02442 (ta_number, pp_set_handle, 02443 &pp_set)) 02444 rsbac_ta_list_lol_remove 02445 (ta_number, 02446 pp_set_handle, 02447 &pp_set); 02448 rsbac_ta_list_remove(ta_number, 02449 tkt_handle, 02450 &tid.tkt); 02451 return (FALSE); 02452 } else 02453 return TRUE; 02454 } 02455 } 02456 /* switch target: no valid target */ 02457 default: 02458 rsbac_printk(KERN_WARNING "rsbac_pm_exists(): Invalid target!\n"); 02459 return FALSE; 02460 } 02461 } /* end of rsbac_pm_exists() */
int rsbac_pm_get_all_data | ( | rsbac_list_ta_number_t | ta_number, | |
enum rsbac_pm_target_t | target, | |||
union rsbac_pm_target_id_t | tid, | |||
union rsbac_pm_all_data_value_t * | value | |||
) |
Definition at line 2324 of file pm_data_structures.c.
References class_handle, cs_handle, na_handle, NULL, pp_handle, RSBAC_EINVALIDTARGET, RSBAC_EINVALIDVALUE, rsbac_ta_list_get_data_ttl(), task_handle, tkt_handle, and tp_handle.
Referenced by rsbac_pm().
02328 { 02329 if (!value) 02330 return (-RSBAC_EINVALIDVALUE); 02331 switch (target) { 02332 case PMT_TASK: 02333 /* 02334 rsbac_pr_debug(ds_pm, "Getting task data\n"); 02335 */ 02336 return rsbac_ta_list_get_data_ttl(ta_number, task_handle, 02337 NULL, &tid.task, 02338 &value->task); 02339 02340 case PMT_CLASS: 02341 /* 02342 rsbac_pr_debug(ds_pm, "Getting class data\n"); 02343 */ 02344 return rsbac_ta_list_get_data_ttl(ta_number, class_handle, 02345 NULL, &tid.object_class, 02346 &value->object_class); 02347 02348 case PMT_NA: 02349 /* 02350 rsbac_pr_debug(ds_pm, "Getting na data\n"); 02351 */ 02352 return rsbac_ta_list_get_data_ttl(ta_number, na_handle, 02353 NULL, &tid.na, 02354 &value->na); 02355 02356 case PMT_CS: 02357 /* 02358 rsbac_pr_debug(ds_pm, "Getting cs data\n"); 02359 */ 02360 return rsbac_ta_list_get_data_ttl(ta_number, cs_handle, 02361 NULL, &tid.cs, 02362 &value->cs); 02363 02364 case PMT_TP: 02365 /* 02366 rsbac_pr_debug(ds_pm, "Getting tp data\n"); 02367 */ 02368 return rsbac_ta_list_get_data_ttl(ta_number, tp_handle, 02369 NULL, &tid.tp, 02370 &value->tp); 02371 02372 case PMT_PP: 02373 /* 02374 rsbac_pr_debug(ds_pm, "Getting pp data\n"); 02375 */ 02376 return rsbac_ta_list_get_data_ttl(ta_number, pp_handle, 02377 NULL, &tid.pp, 02378 &value->pp); 02379 02380 case PMT_TKT: 02381 /* 02382 rsbac_pr_debug(ds_pm, "Getting tkt data\n"); 02383 */ 02384 return rsbac_ta_list_get_data_ttl(ta_number, tkt_handle, 02385 NULL, &tid.tkt, 02386 &value->tkt); 02387 02388 /* switch target: no valid target */ 02389 default: 02390 return (-RSBAC_EINVALIDTARGET); 02391 } 02392 } /* end of rsbac_pm_get_all_data() */
int rsbac_pm_get_data | ( | rsbac_list_ta_number_t | ta_number, | |
enum rsbac_pm_target_t | target, | |||
union rsbac_pm_target_id_t | tid, | |||
enum rsbac_pm_data_t | data, | |||
union rsbac_pm_data_value_t * | value | |||
) |
Definition at line 2100 of file pm_data_structures.c.
References class_handle, cs_handle, na_handle, NULL, pp_handle, RSBAC_EINVALIDATTR, RSBAC_EINVALIDTARGET, RSBAC_EINVALIDVALUE, rsbac_ta_list_get_data_ttl(), task_handle, tkt_handle, and tp_handle.
Referenced by adjust_in_out_pp(), na_and_pp_ipc(), na_and_pp_or_cs(), na_dev(), na_ipc(), rsbac_adf_request_pm(), rsbac_adf_set_attr_pm(), rsbac_pm(), and rsbac_pm_create_file().
02105 { 02106 int err = 0; 02107 02108 if (!value) 02109 return (-RSBAC_EINVALIDVALUE); 02110 02111 switch (target) { 02112 case PMT_TASK: 02113 { 02114 struct rsbac_pm_task_data_t all_data; 02115 02116 /* 02117 rsbac_pr_debug(ds_pm, "Getting task data\n"); 02118 */ 02119 err = 02120 rsbac_ta_list_get_data_ttl(ta_number, 02121 task_handle, NULL, 02122 &tid.task, 02123 &all_data); 02124 if (err) 02125 return err; 02126 02127 switch (data) { 02128 case PD_purpose: 02129 value->purpose = all_data.purpose; 02130 break; 02131 case PD_tp_set: 02132 value->tp_set = all_data.tp_set; 02133 break; 02134 case PD_ru_set: 02135 value->ru_set = all_data.ru_set; 02136 break; 02137 default: 02138 return -RSBAC_EINVALIDATTR; 02139 } 02140 return 0; 02141 } 02142 02143 case PMT_CLASS: 02144 { 02145 struct rsbac_pm_class_data_t all_data; 02146 02147 /* 02148 rsbac_pr_debug(ds_pm, "Getting class data\n"); 02149 */ 02150 err = 02151 rsbac_ta_list_get_data_ttl(ta_number, 02152 class_handle, NULL, 02153 &tid.object_class, 02154 &all_data); 02155 if (err) 02156 return err; 02157 02158 switch (data) { 02159 case PD_pp_set: 02160 value->pp_set = all_data.pp_set; 02161 break; 02162 default: 02163 return -RSBAC_EINVALIDATTR; 02164 } 02165 return 0; 02166 } 02167 02168 case PMT_NA: 02169 { 02170 struct rsbac_pm_na_data_t all_data; 02171 02172 /* 02173 rsbac_pr_debug(ds_pm, "Getting na data\n"); 02174 */ 02175 err = 02176 rsbac_ta_list_get_data_ttl(ta_number, 02177 na_handle, NULL, 02178 &tid.na, &all_data); 02179 if (err) 02180 return err; 02181 02182 switch (data) { 02183 case PD_task: 02184 value->task = all_data.task; 02185 break; 02186 case PD_class: 02187 value->object_class = 02188 all_data.object_class; 02189 break; 02190 case PD_tp: 02191 value->tp = all_data.tp; 02192 break; 02193 case PD_accesses: 02194 value->accesses = all_data.accesses; 02195 break; 02196 default: 02197 return -RSBAC_EINVALIDATTR; 02198 } 02199 return 0; 02200 } 02201 02202 case PMT_CS: 02203 { 02204 struct rsbac_pm_cs_data_t all_data; 02205 02206 /* 02207 rsbac_pr_debug(ds_pm, "Getting cs data\n"); 02208 */ 02209 err = 02210 rsbac_ta_list_get_data_ttl(ta_number, 02211 cs_handle, NULL, 02212 &tid.cs, &all_data); 02213 if (err) 02214 return err; 02215 02216 switch (data) { 02217 case PD_purpose: 02218 value->purpose = all_data.purpose; 02219 break; 02220 case PD_file: 02221 value->file = all_data.file; 02222 break; 02223 default: 02224 return -RSBAC_EINVALIDATTR; 02225 } 02226 return 0; 02227 } 02228 02229 case PMT_TP: 02230 { 02231 struct rsbac_pm_tp_data_t all_data; 02232 02233 /* 02234 rsbac_pr_debug(ds_pm, "Getting tp data\n"); 02235 */ 02236 err = 02237 rsbac_ta_list_get_data_ttl(ta_number, 02238 tp_handle, NULL, 02239 &tid.tp, &all_data); 02240 if (err) 02241 return err; 02242 02243 switch (data) { 02244 case PD_tp: 02245 value->tp = all_data.id; 02246 break; 02247 default: 02248 return -RSBAC_EINVALIDATTR; 02249 } 02250 return 0; 02251 } 02252 02253 case PMT_PP: 02254 { 02255 struct rsbac_pm_pp_data_t all_data; 02256 02257 /* 02258 rsbac_pr_debug(ds_pm, "Getting pp data\n"); 02259 */ 02260 err = 02261 rsbac_ta_list_get_data_ttl(ta_number, 02262 pp_handle, NULL, 02263 &tid.pp, &all_data); 02264 if (err) 02265 return err; 02266 02267 switch (data) { 02268 case PD_purpose: 02269 value->purpose = all_data.id; 02270 break; 02271 case PD_def_class: 02272 value->def_class = all_data.def_class; 02273 break; 02274 default: 02275 return -RSBAC_EINVALIDATTR; 02276 } 02277 return 0; 02278 } 02279 02280 case PMT_TKT: 02281 { 02282 struct rsbac_pm_tkt_data_t all_data; 02283 02284 /* 02285 rsbac_pr_debug(ds_pm, "Getting tkt data\n"); 02286 */ 02287 err = 02288 rsbac_ta_list_get_data_ttl(ta_number, 02289 tkt_handle, NULL, 02290 &tid.tkt, 02291 &all_data); 02292 if (err) 02293 return err; 02294 02295 switch (data) { 02296 case PD_issuer: 02297 value->issuer = all_data.issuer; 02298 break; 02299 case PD_function_type: 02300 value->function_type = 02301 all_data.function_type; 02302 break; 02303 case PD_function_param: 02304 value->function_param = 02305 all_data.function_param; 02306 break; 02307 case PD_valid_until: 02308 value->valid_until = all_data.valid_until; 02309 break; 02310 default: 02311 return -RSBAC_EINVALIDATTR; 02312 } 02313 return 0; 02314 } 02315 02316 /* switch target: no valid target */ 02317 default: 02318 return (-RSBAC_EINVALIDTARGET); 02319 } 02320 }; /* end of rsbac_pm_get_data() */
int rsbac_pm_pp_intersec | ( | rsbac_pm_pp_set_id_t | pp_set, | |
rsbac_pm_in_pp_set_id_t | in_pp_set | |||
) |
Definition at line 1860 of file pm_data_structures.c.
References in_pp_set_handle, NULL, pp_set_handle, RSBAC_EINVALIDVALUE, rsbac_list_lol_add(), rsbac_list_lol_exist(), rsbac_list_lol_get_all_subdesc(), rsbac_list_lol_subadd(), rsbac_list_lol_subexist(), rsbac_list_lol_subremove(), and rsbac_vfree.
Referenced by adjust_in_out_pp().
01862 { 01863 rsbac_pm_purpose_id_t *pp_array; 01864 long count; 01865 u_long i; 01866 01867 if (!rsbac_list_lol_exist(pp_set_handle, &pp_set)) 01868 return -RSBAC_EINVALIDVALUE; 01869 01870 if (!rsbac_list_lol_exist(in_pp_set_handle, &in_pp_set)) { /* in_pp_set not found -> try to create and fill with pp_set */ 01871 if ((count = 01872 rsbac_list_lol_add(in_pp_set_handle, &in_pp_set, 01873 NULL))) 01874 return count; 01875 /* creation successful -> copy list */ 01876 /* get all pp_set members */ 01877 count = 01878 rsbac_list_lol_get_all_subdesc(pp_set_handle, &pp_set, 01879 (void **) &pp_array); 01880 if (count <= 0) 01881 return count; 01882 for (i = 0; i < count; i++) { 01883 rsbac_list_lol_subadd(in_pp_set_handle, &in_pp_set, 01884 &pp_array[i], NULL); 01885 } 01886 rsbac_vfree(pp_array); 01887 } else { /* in_pp_set exists -> remove all members not in pp_set */ 01888 /* get all in_pp_set members */ 01889 count = 01890 rsbac_list_lol_get_all_subdesc(in_pp_set_handle, 01891 &in_pp_set, 01892 (void **) &pp_array); 01893 if (count <= 0) 01894 return count; 01895 for (i = 0; i < count; i++) { 01896 if (!rsbac_list_lol_subexist 01897 (pp_set_handle, &pp_set, &pp_array[i])) 01898 rsbac_list_lol_subremove(in_pp_set_handle, 01899 &in_pp_set, 01900 &pp_array[i]); 01901 } 01902 rsbac_vfree(pp_array); 01903 } 01904 return 0; 01905 }
rsbac_boolean_t rsbac_pm_pp_only | ( | rsbac_pm_purpose_id_t | purpose, | |
rsbac_pm_out_pp_set_id_t | out_pp_set | |||
) |
Definition at line 1836 of file pm_data_structures.c.
References FALSE, out_pp_set_handle, rsbac_list_lol_subcount(), rsbac_list_lol_subexist(), and TRUE.
Referenced by na_and_pp_ipc().
01838 { 01839 long count; 01840 01841 if (!out_pp_set) 01842 return (TRUE); 01843 01844 /* get number of pp_set members */ 01845 count = rsbac_list_lol_subcount(out_pp_set_handle, &out_pp_set); 01846 if (count <= 0) 01847 return TRUE; 01848 if (count == 1) 01849 return rsbac_list_lol_subexist(out_pp_set_handle, 01850 &out_pp_set, &purpose); 01851 else 01852 return FALSE; 01853 }
rsbac_boolean_t rsbac_pm_pp_subset | ( | rsbac_pm_pp_set_id_t | pp_set, | |
rsbac_pm_in_pp_set_id_t | in_pp_set | |||
) |
Definition at line 1762 of file pm_data_structures.c.
References FALSE, in_pp_set_handle, pp_set_handle, rsbac_list_lol_exist(), rsbac_list_lol_get_all_subdesc(), rsbac_list_lol_subexist(), rsbac_vfree, and TRUE.
Referenced by na_and_pp_or_cs().
01764 { 01765 rsbac_pm_purpose_id_t *pp_array; 01766 long count; 01767 u_long i; 01768 rsbac_boolean_t result = TRUE; 01769 01770 if (!pp_set || !in_pp_set) 01771 return (FALSE); 01772 01773 /* get all pp_set members */ 01774 count = 01775 rsbac_list_lol_get_all_subdesc(pp_set_handle, &pp_set, 01776 (void **) &pp_array); 01777 if (count < 0) 01778 return FALSE; 01779 if (!count) 01780 return TRUE; 01781 if (!rsbac_list_lol_exist(in_pp_set_handle, &in_pp_set)) { 01782 rsbac_vfree(pp_array); 01783 return TRUE; 01784 } 01785 /* check all members in in_pp_set */ 01786 for (i = 0; i < count; i++) { 01787 if (!rsbac_list_lol_subexist 01788 (in_pp_set_handle, &in_pp_set, &pp_array[i])) { 01789 result = FALSE; 01790 break; 01791 } 01792 } 01793 rsbac_vfree(pp_array); 01794 return result; 01795 }
rsbac_boolean_t rsbac_pm_pp_superset | ( | rsbac_pm_pp_set_id_t | pp_set, | |
rsbac_pm_out_pp_set_id_t | out_pp_set | |||
) |
Definition at line 1800 of file pm_data_structures.c.
References FALSE, out_pp_set_handle, pp_set_handle, rsbac_list_lol_exist(), rsbac_list_lol_get_all_subdesc(), rsbac_list_lol_subexist(), rsbac_vfree, and TRUE.
Referenced by na_and_pp_or_cs().
01802 { 01803 rsbac_pm_purpose_id_t *pp_array; 01804 long count; 01805 u_long i; 01806 rsbac_boolean_t result = TRUE; 01807 01808 if (!pp_set) 01809 return (FALSE); 01810 if (!out_pp_set) 01811 return (TRUE); 01812 if (!rsbac_list_lol_exist(pp_set_handle, &pp_set)) 01813 return FALSE; 01814 01815 /* get all pp_set members */ 01816 count = 01817 rsbac_list_lol_get_all_subdesc(out_pp_set_handle, &out_pp_set, 01818 (void **) &pp_array); 01819 if (count <= 0) 01820 return TRUE; 01821 /* check all members in in_pp_set */ 01822 for (i = 0; i < count; i++) { 01823 if (!rsbac_list_lol_subexist 01824 (pp_set_handle, &pp_set, &pp_array[i])) { 01825 result = FALSE; 01826 break; 01827 } 01828 } 01829 rsbac_vfree(pp_array); 01830 return result; 01831 }
int rsbac_pm_pp_union | ( | rsbac_pm_pp_set_id_t | pp_set, | |
rsbac_pm_out_pp_set_id_t | out_pp_set | |||
) |
Definition at line 1912 of file pm_data_structures.c.
References NULL, out_pp_set_handle, pp_set_handle, RSBAC_EINVALIDVALUE, rsbac_list_lol_add(), rsbac_list_lol_exist(), rsbac_list_lol_get_all_subdesc(), rsbac_list_lol_subadd(), and rsbac_vfree.
Referenced by adjust_in_out_pp().
01914 { 01915 rsbac_pm_purpose_id_t *pp_array; 01916 long count; 01917 u_long i; 01918 01919 /* check, whether set-id pp_set exists */ 01920 if (!rsbac_list_lol_exist(pp_set_handle, &pp_set)) 01921 return -RSBAC_EINVALIDVALUE; 01922 01923 if (!rsbac_list_lol_exist(out_pp_set_handle, &out_pp_set)) { /* out_pp_set not found -> try to create */ 01924 count = 01925 rsbac_list_lol_add(out_pp_set_handle, &out_pp_set, 01926 NULL); 01927 if (count) 01928 return count; 01929 } 01930 /* out_pp_set exists -> add all members in pp_set */ 01931 /* get all pp_set members */ 01932 count = 01933 rsbac_list_lol_get_all_subdesc(pp_set_handle, &pp_set, 01934 (void **) &pp_array); 01935 if (count <= 0) 01936 return count; 01937 for (i = 0; i < count; i++) { 01938 rsbac_list_lol_subadd(out_pp_set_handle, &out_pp_set, 01939 &pp_array[i], NULL); 01940 } 01941 rsbac_vfree(pp_array); 01942 return 0; 01943 }
int rsbac_pm_remove_from_set | ( | rsbac_list_ta_number_t | ta_number, | |
enum rsbac_pm_set_t | set, | |||
union rsbac_pm_set_id_t | id, | |||
union rsbac_pm_set_member_t | member | |||
) |
Definition at line 1654 of file pm_data_structures.c.
References in_pp_set_handle, out_pp_set_handle, pp_set_handle, RSBAC_EINVALIDTARGET, rsbac_ta_list_lol_subremove(), ru_set_handle, task_set_handle, and tp_set_handle.
Referenced by rsbac_pm().
01658 { 01659 switch (set) { 01660 case PS_TASK: 01661 return (rsbac_ta_list_lol_subremove 01662 (ta_number, task_set_handle, &id.task_set, 01663 &member.task)); 01664 case PS_TP: 01665 return (rsbac_ta_list_lol_subremove 01666 (ta_number, tp_set_handle, &id.tp_set, 01667 &member.tp)); 01668 case PS_RU: 01669 return (rsbac_ta_list_lol_subremove 01670 (ta_number, ru_set_handle, &id.ru_set, 01671 &member.ru)); 01672 case PS_PP: 01673 return (rsbac_ta_list_lol_subremove 01674 (ta_number, pp_set_handle, &id.pp_set, 01675 &member.pp)); 01676 case PS_IN_PP: 01677 return (rsbac_ta_list_lol_subremove 01678 (ta_number, in_pp_set_handle, &id.in_pp_set, 01679 &member.pp)); 01680 case PS_OUT_PP: 01681 return (rsbac_ta_list_lol_subremove 01682 (ta_number, out_pp_set_handle, &id.out_pp_set, 01683 &member.pp)); 01684 default: 01685 return (-RSBAC_EINVALIDTARGET); 01686 } 01687 }
int rsbac_pm_remove_set | ( | rsbac_list_ta_number_t | ta_number, | |
enum rsbac_pm_set_t | set, | |||
union rsbac_pm_set_id_t | id | |||
) |
Definition at line 2057 of file pm_data_structures.c.
References in_pp_set_handle, out_pp_set_handle, pp_set_handle, RSBAC_EINVALIDTARGET, rsbac_ta_list_lol_remove(), ru_set_handle, task_set_handle, and tp_set_handle.
Referenced by rsbac_adf_request_pm(), and rsbac_pm().
02060 { 02061 switch (set) { 02062 case PS_TASK: 02063 return rsbac_ta_list_lol_remove(ta_number, task_set_handle, 02064 &id.task_set); 02065 case PS_TP: 02066 return rsbac_ta_list_lol_remove(ta_number, tp_set_handle, 02067 &id.tp_set); 02068 case PS_RU: 02069 return rsbac_ta_list_lol_remove(ta_number, ru_set_handle, 02070 &id.ru_set); 02071 case PS_PP: 02072 return rsbac_ta_list_lol_remove(ta_number, pp_set_handle, 02073 &id.pp_set); 02074 case PS_IN_PP: 02075 return rsbac_ta_list_lol_remove(ta_number, 02076 in_pp_set_handle, 02077 &id.in_pp_set); 02078 case PS_OUT_PP: 02079 return rsbac_ta_list_lol_remove(ta_number, 02080 out_pp_set_handle, 02081 &id.out_pp_set); 02082 02083 default: 02084 return -RSBAC_EINVALIDTARGET; 02085 } 02086 }
int rsbac_pm_remove_target | ( | rsbac_list_ta_number_t | ta_number, | |
enum rsbac_pm_target_t | target, | |||
union rsbac_pm_target_id_t | tid | |||
) |
Definition at line 2760 of file pm_data_structures.c.
References class_handle, cs_handle, na_handle, pp_handle, pp_set_handle, RSBAC_EINVALIDTARGET, rsbac_ta_list_lol_exist(), rsbac_ta_list_lol_remove(), rsbac_ta_list_remove(), task_handle, tkt_handle, and tp_handle.
Referenced by rsbac_pm().
02763 { 02764 switch (target) { 02765 case PMT_TASK: 02766 /* 02767 rsbac_pr_debug(ds_pm, "Removing task data\n"); 02768 */ 02769 return rsbac_ta_list_remove(ta_number, task_handle, 02770 &tid.task); 02771 02772 case PMT_CLASS: 02773 /* 02774 rsbac_pr_debug(ds_pm, "Removing class data\n"); 02775 */ 02776 return rsbac_ta_list_remove(ta_number, class_handle, 02777 &tid.object_class); 02778 02779 case PMT_NA: 02780 /* 02781 rsbac_pr_debug(ds_pm, "Removing tp data\n"); 02782 */ 02783 return rsbac_ta_list_remove(ta_number, na_handle, &tid.na); 02784 02785 case PMT_CS: 02786 /* 02787 rsbac_pr_debug(ds_pm, "Removing cs data\n"); 02788 */ 02789 return rsbac_ta_list_remove(ta_number, cs_handle, &tid.cs); 02790 02791 case PMT_TP: 02792 /* 02793 rsbac_pr_debug(ds_pm, "Removing tp data\n"); 02794 */ 02795 return rsbac_ta_list_remove(ta_number, tp_handle, &tid.tp); 02796 02797 case PMT_PP: 02798 /* 02799 rsbac_pr_debug(ds_pm, "Removing pp data\n"); 02800 */ 02801 return rsbac_ta_list_remove(ta_number, pp_handle, &tid.pp); 02802 02803 case PMT_TKT: 02804 { 02805 rsbac_pm_pp_set_id_t pp_set = -tid.tkt; 02806 02807 /* 02808 rsbac_pr_debug(ds_pm, "Removing tkt data\n"); 02809 */ 02810 if (rsbac_ta_list_lol_exist 02811 (ta_number, pp_set_handle, &pp_set)) 02812 rsbac_ta_list_lol_remove(ta_number, 02813 pp_set_handle, 02814 &pp_set); 02815 return rsbac_ta_list_remove(ta_number, tkt_handle, 02816 &tid.tkt); 02817 } 02818 02819 default: 02820 return (-RSBAC_EINVALIDTARGET); 02821 } 02822 }; /* end of rsbac_remove_target() */
int rsbac_pm_set_data | ( | rsbac_list_ta_number_t | ta_number, | |
enum rsbac_pm_target_t | target, | |||
union rsbac_pm_target_id_t | tid, | |||
enum rsbac_pm_data_t | data, | |||
union rsbac_pm_data_value_t | value | |||
) |
Definition at line 2465 of file pm_data_structures.c.
References class_handle, cs_handle, na_handle, NULL, pp_handle, RSBAC_EINVALIDATTR, RSBAC_EINVALIDTARGET, rsbac_ta_list_add_ttl(), rsbac_ta_list_get_data_ttl(), task_handle, and tkt_handle.
Referenced by rsbac_pm().
02470 { 02471 switch (target) { 02472 case PMT_TASK: 02473 { 02474 struct rsbac_pm_task_data_t all_data; 02475 int err; 02476 02477 /* 02478 rsbac_pr_debug(ds_pm, "Setting task data\n"); 02479 */ 02480 err = 02481 rsbac_ta_list_get_data_ttl(ta_number, 02482 task_handle, NULL, 02483 &tid.task, 02484 &all_data); 02485 if (err) 02486 return err; 02487 02488 switch (data) { 02489 case PD_purpose: 02490 all_data.purpose = value.purpose; 02491 break; 02492 case PD_tp_set: 02493 all_data.tp_set = value.tp_set; 02494 break; 02495 case PD_ru_set: 02496 all_data.ru_set = value.ru_set; 02497 break; 02498 default: 02499 return -RSBAC_EINVALIDATTR; 02500 } 02501 err = 02502 rsbac_ta_list_add_ttl(ta_number, task_handle, 02503 0, &tid.task, &all_data); 02504 return err; 02505 } 02506 02507 case PMT_CLASS: 02508 { 02509 struct rsbac_pm_class_data_t all_data; 02510 int err; 02511 02512 /* 02513 rsbac_pr_debug(ds_pm, "Setting class data\n"); 02514 */ 02515 err = 02516 rsbac_ta_list_get_data_ttl(ta_number, 02517 class_handle, NULL, 02518 &tid.object_class, 02519 &all_data); 02520 if (err) 02521 return err; 02522 02523 switch (data) { 02524 case PD_pp_set: 02525 all_data.pp_set = value.pp_set; 02526 break; 02527 default: 02528 return -RSBAC_EINVALIDATTR; 02529 } 02530 err = 02531 rsbac_ta_list_add_ttl(ta_number, class_handle, 02532 0, &tid.object_class, 02533 &all_data); 02534 return err; 02535 } 02536 02537 case PMT_NA: 02538 { 02539 struct rsbac_pm_na_data_t all_data; 02540 int err; 02541 02542 /* 02543 rsbac_pr_debug(ds_pm, "Setting na data\n"); 02544 */ 02545 err = 02546 rsbac_ta_list_get_data_ttl(ta_number, 02547 na_handle, NULL, 02548 &tid.na, &all_data); 02549 if (err) 02550 return err; 02551 02552 switch (data) { 02553 case PD_task: 02554 all_data.task = value.task; 02555 break; 02556 case PD_class: 02557 all_data.object_class = value.object_class; 02558 break; 02559 case PD_tp: 02560 all_data.tp = value.tp; 02561 break; 02562 case PD_accesses: 02563 all_data.accesses = value.accesses; 02564 break; 02565 default: 02566 return -RSBAC_EINVALIDATTR; 02567 } 02568 err = 02569 rsbac_ta_list_add_ttl(ta_number, na_handle, 0, 02570 &tid.na, &all_data); 02571 return err; 02572 } 02573 02574 case PMT_CS: 02575 { 02576 struct rsbac_pm_cs_data_t all_data; 02577 int err; 02578 02579 /* 02580 rsbac_pr_debug(ds_pm, "Setting cs data\n"); 02581 */ 02582 err = 02583 rsbac_ta_list_get_data_ttl(ta_number, 02584 cs_handle, NULL, 02585 &tid.cs, &all_data); 02586 if (err) 02587 return err; 02588 02589 switch (data) { 02590 case PD_purpose: 02591 all_data.purpose = value.purpose; 02592 break; 02593 case PD_file: 02594 all_data.file = value.file; 02595 break; 02596 default: 02597 return -RSBAC_EINVALIDATTR; 02598 } 02599 err = 02600 rsbac_ta_list_add_ttl(ta_number, cs_handle, 0, 02601 &tid.cs, &all_data); 02602 return err; 02603 } 02604 02605 case PMT_TP: 02606 return -RSBAC_EINVALIDATTR; 02607 02608 case PMT_PP: 02609 { 02610 struct rsbac_pm_pp_data_t all_data; 02611 int err; 02612 02613 /* 02614 rsbac_pr_debug(ds_pm, "Setting pp data\n"); 02615 */ 02616 err = 02617 rsbac_ta_list_get_data_ttl(ta_number, 02618 pp_handle, NULL, 02619 &tid.pp, &all_data); 02620 if (err) 02621 return err; 02622 02623 switch (data) { 02624 case PD_def_class: 02625 all_data.def_class = value.def_class; 02626 break; 02627 default: 02628 return -RSBAC_EINVALIDATTR; 02629 } 02630 err = 02631 rsbac_ta_list_add_ttl(ta_number, pp_handle, 0, 02632 &tid.pp, &all_data); 02633 return err; 02634 } 02635 02636 case PMT_TKT: 02637 { 02638 struct rsbac_pm_tkt_data_t all_data; 02639 int err; 02640 02641 /* 02642 rsbac_pr_debug(ds_pm, "Setting tkt data\n"); 02643 */ 02644 err = 02645 rsbac_ta_list_get_data_ttl(ta_number, 02646 tkt_handle, NULL, 02647 &tid.tkt, 02648 &all_data); 02649 if (err) 02650 return err; 02651 02652 switch (data) { 02653 case PD_issuer: 02654 all_data.issuer = value.issuer; 02655 break; 02656 case PD_function_type: 02657 all_data.function_type = 02658 value.function_type; 02659 break; 02660 case PD_function_param: 02661 all_data.function_param = 02662 value.function_param; 02663 break; 02664 case PD_valid_until: 02665 all_data.valid_until = value.valid_until; 02666 break; 02667 default: 02668 return -RSBAC_EINVALIDATTR; 02669 } 02670 err = 02671 rsbac_ta_list_add_ttl(ta_number, tkt_handle, 0, 02672 &tid.tkt, &all_data); 02673 return err; 02674 } 02675 02676 /* switch target: no valid target */ 02677 default: 02678 return (-RSBAC_EINVALIDTARGET); 02679 } 02680 } /* end of rsbac_pm_set_data() */
rsbac_boolean_t rsbac_pm_set_exist | ( | rsbac_list_ta_number_t | ta_number, | |
enum rsbac_pm_set_t | set, | |||
union rsbac_pm_set_id_t | id | |||
) |
Definition at line 2021 of file pm_data_structures.c.
References FALSE, in_pp_set_handle, out_pp_set_handle, pp_set_handle, rsbac_ta_list_lol_exist(), ru_set_handle, task_set_handle, and tp_set_handle.
Referenced by adjust_in_out_pp_ipc().
02024 { 02025 switch (set) { 02026 case PS_TASK: 02027 return rsbac_ta_list_lol_exist(ta_number, task_set_handle, 02028 &id.task_set); 02029 case PS_TP: 02030 return rsbac_ta_list_lol_exist(ta_number, tp_set_handle, 02031 &id.tp_set); 02032 case PS_RU: 02033 return rsbac_ta_list_lol_exist(ta_number, ru_set_handle, 02034 &id.ru_set); 02035 case PS_PP: 02036 return rsbac_ta_list_lol_exist(ta_number, pp_set_handle, 02037 &id.pp_set); 02038 case PS_IN_PP: 02039 return rsbac_ta_list_lol_exist(ta_number, in_pp_set_handle, 02040 &id.in_pp_set); 02041 case PS_OUT_PP: 02042 return rsbac_ta_list_lol_exist(ta_number, 02043 out_pp_set_handle, 02044 &id.out_pp_set); 02045 02046 default: 02047 return FALSE; 02048 } 02049 }
rsbac_boolean_t rsbac_pm_set_member | ( | rsbac_list_ta_number_t | ta_number, | |
enum rsbac_pm_set_t | set, | |||
union rsbac_pm_set_id_t | id, | |||
union rsbac_pm_set_member_t | member | |||
) |
Definition at line 1724 of file pm_data_structures.c.
References FALSE, in_pp_set_handle, out_pp_set_handle, pp_set_handle, rsbac_ta_list_lol_subexist(), ru_set_handle, task_set_handle, and tp_set_handle.
Referenced by na_and_pp_ipc(), na_and_pp_or_cs(), rsbac_adf_request_pm(), rsbac_pm(), rsbac_pm_change_current_task(), and rsbac_pm_create_file().
01728 { 01729 switch (set) { 01730 case PS_TASK: 01731 return (rsbac_ta_list_lol_subexist 01732 (ta_number, task_set_handle, &id.task_set, 01733 &member.task)); 01734 case PS_TP: 01735 return (rsbac_ta_list_lol_subexist 01736 (ta_number, tp_set_handle, &id.tp_set, 01737 &member.tp)); 01738 case PS_RU: 01739 return (rsbac_ta_list_lol_subexist 01740 (ta_number, ru_set_handle, &id.ru_set, 01741 &member.ru)); 01742 case PS_PP: 01743 return (rsbac_ta_list_lol_subexist 01744 (ta_number, pp_set_handle, &id.pp_set, 01745 &member.pp)); 01746 case PS_IN_PP: 01747 return (rsbac_ta_list_lol_subexist 01748 (ta_number, in_pp_set_handle, &id.in_pp_set, 01749 &member.pp)); 01750 case PS_OUT_PP: 01751 return (rsbac_ta_list_lol_subexist 01752 (ta_number, out_pp_set_handle, &id.out_pp_set, 01753 &member.pp)); 01754 default: 01755 return (FALSE); 01756 } 01757 }
int rsbac_stats_pm | ( | void | ) |
Definition at line 1494 of file pm_data_structures.c.
References class_handle, cs_handle, in_pp_set_handle, na_handle, out_pp_set_handle, pp_handle, pp_set_handle, RSBAC_ENOTINITIALIZED, rsbac_is_initialized(), rsbac_list_count(), rsbac_list_lol_all_subcount(), rsbac_list_lol_count(), rsbac_printk(), ru_set_handle, task_handle, task_set_handle, tkt_handle, tp_handle, and tp_set_handle.
Referenced by rsbac_stats(), and sys_rsbac_stats_pm().
01495 { 01496 u_long tmp_count; 01497 u_long tmp_member_count; 01498 u_long all_set_count = 0; 01499 u_long all_member_count = 0; 01500 u_long all_count = 0; 01501 01502 if (!rsbac_is_initialized()) { 01503 rsbac_printk(KERN_WARNING "rsbac_stats_pm(): RSBAC not initialized\n"); 01504 return (-RSBAC_ENOTINITIALIZED); 01505 } 01506 01507 /****************/ 01508 /* Helper lists */ 01509 /****************/ 01510 01511 tmp_count = rsbac_list_lol_count(task_set_handle); 01512 tmp_member_count = rsbac_list_lol_all_subcount(task_set_handle); 01513 rsbac_printk(KERN_INFO "rsbac_stats_pm(): %lu task-set-items, sum of %lu members\n", 01514 tmp_count, tmp_member_count); 01515 all_set_count += tmp_count; 01516 all_member_count += tmp_member_count; 01517 01518 tmp_count = rsbac_list_lol_count(tp_set_handle); 01519 tmp_member_count = rsbac_list_lol_all_subcount(tp_set_handle); 01520 rsbac_printk(KERN_INFO "rsbac_stats_pm(): %lu tp set items, sum of %lu members\n", 01521 tmp_count, tmp_member_count); 01522 all_set_count += tmp_count; 01523 all_member_count += tmp_member_count; 01524 01525 tmp_count = rsbac_list_lol_count(ru_set_handle); 01526 tmp_member_count = rsbac_list_lol_all_subcount(ru_set_handle); 01527 rsbac_printk(KERN_INFO "rsbac_stats_pm(): %lu ru set items, sum of %lu members\n", 01528 tmp_count, tmp_member_count); 01529 all_set_count += tmp_count; 01530 all_member_count += tmp_member_count; 01531 01532 tmp_count = rsbac_list_lol_count(pp_set_handle); 01533 tmp_member_count = rsbac_list_lol_all_subcount(pp_set_handle); 01534 rsbac_printk(KERN_INFO "rsbac_stats_pm(): %lu pp set items, sum of %lu members\n", 01535 tmp_count, tmp_member_count); 01536 all_set_count += tmp_count; 01537 all_member_count += tmp_member_count; 01538 01539 tmp_count = rsbac_list_lol_count(in_pp_set_handle); 01540 tmp_member_count = rsbac_list_lol_all_subcount(in_pp_set_handle); 01541 rsbac_printk(KERN_INFO "rsbac_stats_pm(): %lu input purpose set items, sum of %lu members\n", 01542 tmp_count, tmp_member_count); 01543 all_set_count += tmp_count; 01544 all_member_count += tmp_member_count; 01545 01546 tmp_count = rsbac_list_lol_count(out_pp_set_handle); 01547 tmp_member_count = rsbac_list_lol_all_subcount(out_pp_set_handle); 01548 rsbac_printk(KERN_INFO "rsbac_stats_pm(): %lu output purpose set items, sum of %lu members\n", 01549 tmp_count, tmp_member_count); 01550 all_set_count += tmp_count; 01551 all_member_count += tmp_member_count; 01552 01553 rsbac_printk(KERN_INFO "rsbac_stats_pm(): Total of %lu registered rsbac-pm-set-items, %lu members\n", 01554 all_set_count, all_member_count); 01555 01556 /**************/ 01557 /* Main lists */ 01558 /**************/ 01559 tmp_count = rsbac_list_count(task_handle); 01560 rsbac_printk(KERN_INFO "rsbac_stats_pm(): %lu task items\n", 01561 tmp_count); 01562 all_count += tmp_count; 01563 01564 tmp_count = rsbac_list_count(class_handle); 01565 rsbac_printk(KERN_INFO "rsbac_stats_pm(): %lu class items\n", 01566 tmp_count); 01567 all_count += tmp_count; 01568 01569 tmp_count = rsbac_list_count(na_handle); 01570 rsbac_printk(KERN_INFO "rsbac_stats_pm(): %lu na items\n", 01571 tmp_count); 01572 all_count += tmp_count; 01573 01574 tmp_count = rsbac_list_count(cs_handle); 01575 rsbac_printk(KERN_INFO "rsbac_stats_pm(): %lu cs items\n", 01576 tmp_count); 01577 all_count += tmp_count; 01578 01579 tmp_count = rsbac_list_count(tp_handle); 01580 rsbac_printk(KERN_INFO "rsbac_stats_pm(): %lu tp items\n", 01581 tmp_count); 01582 all_count += tmp_count; 01583 01584 tmp_count = rsbac_list_count(pp_handle); 01585 rsbac_printk(KERN_INFO "rsbac_stats_pm(): %lu pp items\n", 01586 tmp_count); 01587 all_count += tmp_count; 01588 01589 tmp_count = rsbac_list_count(tkt_handle); 01590 rsbac_printk(KERN_INFO "rsbac_stats_pm(): %lu tkt items\n", 01591 tmp_count); 01592 all_count += tmp_count; 01593 01594 rsbac_printk(KERN_INFO "rsbac_stats_pm(): Total of %lu registered rsbac-pm-items\n", 01595 all_count); 01596 return 0; 01597 }
int sys_write | ( | u_int | , | |
char * | , | |||
u_int | ||||
) |
rsbac_list_handle_t class_handle = NULL [static] |
Definition at line 46 of file pm_data_structures.c.
Referenced by rsbac_init_pm(), rsbac_pm_add_target(), rsbac_pm_exists(), rsbac_pm_get_all_data(), rsbac_pm_get_data(), rsbac_pm_remove_target(), rsbac_pm_set_data(), and rsbac_stats_pm().
rsbac_list_handle_t cs_handle = NULL [static] |
Definition at line 48 of file pm_data_structures.c.
Referenced by rsbac_init_pm(), rsbac_pm_add_target(), rsbac_pm_exists(), rsbac_pm_get_all_data(), rsbac_pm_get_data(), rsbac_pm_remove_target(), rsbac_pm_set_data(), and rsbac_stats_pm().
rsbac_list_handle_t in_pp_set_handle = NULL [static] |
Definition at line 42 of file pm_data_structures.c.
Referenced by rsbac_init_pm(), rsbac_pm_add_to_set(), rsbac_pm_clear_set(), rsbac_pm_create_set(), rsbac_pm_pp_intersec(), rsbac_pm_pp_subset(), rsbac_pm_remove_from_set(), rsbac_pm_remove_set(), rsbac_pm_set_exist(), rsbac_pm_set_member(), and rsbac_stats_pm().
rsbac_list_handle_t na_handle = NULL [static] |
Definition at line 47 of file pm_data_structures.c.
Referenced by rsbac_init_pm(), rsbac_pm_add_target(), rsbac_pm_exists(), rsbac_pm_get_all_data(), rsbac_pm_get_data(), rsbac_pm_remove_target(), rsbac_pm_set_data(), and rsbac_stats_pm().
rsbac_list_handle_t out_pp_set_handle = NULL [static] |
Definition at line 43 of file pm_data_structures.c.
Referenced by rsbac_init_pm(), rsbac_pm_add_to_set(), rsbac_pm_clear_set(), rsbac_pm_create_set(), rsbac_pm_pp_only(), rsbac_pm_pp_superset(), rsbac_pm_pp_union(), rsbac_pm_remove_from_set(), rsbac_pm_remove_set(), rsbac_pm_set_exist(), rsbac_pm_set_member(), and rsbac_stats_pm().
rsbac_list_handle_t pp_handle = NULL [static] |
Definition at line 50 of file pm_data_structures.c.
Referenced by rsbac_init_pm(), rsbac_pm_add_target(), rsbac_pm_exists(), rsbac_pm_get_all_data(), rsbac_pm_get_data(), rsbac_pm_remove_target(), rsbac_pm_set_data(), and rsbac_stats_pm().
rsbac_list_handle_t pp_set_handle = NULL [static] |
Definition at line 41 of file pm_data_structures.c.
Referenced by rsbac_init_pm(), rsbac_pm_add_to_set(), rsbac_pm_clear_set(), rsbac_pm_create_set(), rsbac_pm_exists(), rsbac_pm_pp_intersec(), rsbac_pm_pp_subset(), rsbac_pm_pp_superset(), rsbac_pm_pp_union(), rsbac_pm_remove_from_set(), rsbac_pm_remove_set(), rsbac_pm_remove_target(), rsbac_pm_set_exist(), rsbac_pm_set_member(), and rsbac_stats_pm().
rsbac_list_handle_t ru_set_handle = NULL [static] |
Definition at line 40 of file pm_data_structures.c.
Referenced by rsbac_init_pm(), rsbac_pm_add_to_set(), rsbac_pm_clear_set(), rsbac_pm_create_set(), rsbac_pm_remove_from_set(), rsbac_pm_remove_set(), rsbac_pm_set_exist(), rsbac_pm_set_member(), and rsbac_stats_pm().
rsbac_list_handle_t task_handle = NULL [static] |
Definition at line 45 of file pm_data_structures.c.
Referenced by rsbac_init_pm(), rsbac_pm_add_target(), rsbac_pm_exists(), rsbac_pm_get_all_data(), rsbac_pm_get_data(), rsbac_pm_remove_target(), rsbac_pm_set_data(), and rsbac_stats_pm().
rsbac_list_handle_t task_set_handle = NULL [static] |
Definition at line 38 of file pm_data_structures.c.
Referenced by rsbac_init_pm(), rsbac_pm_add_to_set(), rsbac_pm_clear_set(), rsbac_pm_create_set(), rsbac_pm_remove_from_set(), rsbac_pm_remove_set(), rsbac_pm_set_exist(), rsbac_pm_set_member(), and rsbac_stats_pm().
rsbac_list_handle_t tkt_handle = NULL [static] |
Definition at line 51 of file pm_data_structures.c.
Referenced by rsbac_init_pm(), rsbac_pm_add_target(), rsbac_pm_exists(), rsbac_pm_get_all_data(), rsbac_pm_get_data(), rsbac_pm_remove_target(), rsbac_pm_set_data(), and rsbac_stats_pm().
rsbac_list_handle_t tp_handle = NULL [static] |
Definition at line 49 of file pm_data_structures.c.
Referenced by rsbac_init_pm(), rsbac_pm_add_target(), rsbac_pm_exists(), rsbac_pm_get_all_data(), rsbac_pm_get_data(), rsbac_pm_remove_target(), and rsbac_stats_pm().
rsbac_list_handle_t tp_set_handle = NULL [static] |
Definition at line 39 of file pm_data_structures.c.
Referenced by rsbac_init_pm(), rsbac_pm_add_to_set(), rsbac_pm_clear_set(), rsbac_pm_create_set(), rsbac_pm_remove_from_set(), rsbac_pm_remove_set(), rsbac_pm_set_exist(), rsbac_pm_set_member(), and rsbac_stats_pm().