/daten/src/linux-2.4.27-rsbac-v1.2.3/include/rsbac/rc.h

Go to the documentation of this file.
00001 /******************************* */ 00002 /* Rule Set Based Access Control */ 00003 /* Author and (c) 1999-2001: */ 00004 /* Amon Ott <ao@rsbac.org> */ 00005 /* API: Data structures */ 00006 /* and functions for Access */ 00007 /* Control Information / RC */ 00008 /* Last modified: 22/Nov/2001 */ 00009 /******************************* */ 00010 00011 #ifndef __RSBAC_RC_H 00012 #define __RSBAC_RC_H 00013 00014 #include <linux/init.h> 00015 #include <rsbac/rc_types.h> 00016 00017 /***************************************************/ 00018 /* General Prototypes */ 00019 /***************************************************/ 00020 00021 /* All functions return 0, if no error occurred, and a negative error code */ 00022 /* otherwise. The error codes are defined in rsbac_error.h. */ 00023 00024 /****************************************************************************/ 00025 /* Initialization, including ACI restoration for all mounted devices from */ 00026 /* disk. After this call, all ACI is kept in memory for performance reasons.*/ 00027 00028 #ifdef CONFIG_RSBAC_INIT_DELAY 00029 extern int rsbac_init_rc(void); 00030 #else 00031 extern int rsbac_init_rc(void) __init; 00032 #endif 00033 00034 /* Find the boot role */ 00035 #ifdef CONFIG_RSBAC_INIT_DELAY 00036 extern int rsbac_rc_get_boot_role(rsbac_rc_role_id_t * role_p); 00037 #else 00038 extern int rsbac_rc_get_boot_role(rsbac_rc_role_id_t * role_p) __init; 00039 #endif 00040 00041 /* Some information about the current status is also available */ 00042 00043 extern int rsbac_stats_rc(void); 00044 00045 /************************************************* */ 00046 /* Access functions */ 00047 /************************************************* */ 00048 00049 /* All these procedures handle the spinlocks to protect the targets during */ 00050 /* access. */ 00051 00052 /* All roles are always there, so instead of creation, we supply a copy for */ 00053 /* initialization. There is always the well-defined role general to copy */ 00054 extern int rsbac_rc_copy_role (rsbac_rc_role_id_t from_role, 00055 rsbac_rc_role_id_t to_role); 00056 00057 /* Getting item values */ 00058 extern int rsbac_rc_get_item (enum rsbac_rc_target_t target, 00059 union rsbac_rc_target_id_t tid, 00060 union rsbac_rc_target_id_t subtid, 00061 enum rsbac_rc_item_t item, 00062 union rsbac_rc_item_value_t * value_p, 00063 rsbac_time_t * ttl_p); 00064 00065 /* Setting item values */ 00066 extern int rsbac_rc_set_item (enum rsbac_rc_target_t target, 00067 union rsbac_rc_target_id_t tid, 00068 union rsbac_rc_target_id_t subtid, 00069 enum rsbac_rc_item_t item, 00070 union rsbac_rc_item_value_t value, 00071 rsbac_time_t ttl); 00072 00073 /* Checking role's compatibility */ 00074 extern boolean rsbac_rc_check_comp(rsbac_rc_role_id_t role, 00075 union rsbac_rc_target_id_t subtid, 00076 enum rsbac_rc_item_t item, 00077 enum rsbac_rc_special_rights_t right); 00078 00079 /* Get list of defined items. Returns number or negative error. 00080 * Allocates array via vmalloc, if number > 0 - vfree after use! */ 00081 int rsbac_rc_get_list(enum rsbac_rc_target_t target, 00082 union rsbac_rc_target_id_t tid, 00083 enum rsbac_rc_item_t item, 00084 __u32 ** array_pp, 00085 rsbac_time_t ** ttl_array_pp); 00086 00087 #endif

Generated on Tue Aug 31 10:05:22 2004 for RSBAC by doxygen 1.3.8