rc.h

Go to the documentation of this file.
00001 /******************************* */
00002 /* Rule Set Based Access Control */
00003 /* Author and (c) 1999-2005:     */
00004 /*   Amon Ott <ao@rsbac.org>     */
00005 /* API: Data structures          */
00006 /* and functions for Access      */
00007 /* Control Information / RC      */
00008 /* Last modified: 09/Feb/2005    */
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 int rsbac_init_rc(void);
00030 #else
00031 int rsbac_init_rc(void) __init;
00032 #endif
00033 
00034 /* Find the boot role */
00035 #ifdef CONFIG_RSBAC_INIT_DELAY
00036 int rsbac_rc_get_boot_role(rsbac_rc_role_id_t * role_p);
00037 #else
00038 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 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 int rsbac_rc_copy_role(
00055   rsbac_list_ta_number_t ta_number,
00056   rsbac_rc_role_id_t from_role,
00057   rsbac_rc_role_id_t to_role);
00058 
00059 int rsbac_rc_copy_type(
00060        rsbac_list_ta_number_t ta_number,
00061   enum rsbac_rc_target_t      target,
00062        rsbac_rc_type_id_t     from_type,
00063        rsbac_rc_type_id_t     to_type);
00064 
00065 /* Getting item values */
00066 int rsbac_rc_get_item(
00067         rsbac_list_ta_number_t ta_number,
00068   enum  rsbac_rc_target_t       target,
00069   union rsbac_rc_target_id_t    tid,
00070   union rsbac_rc_target_id_t    subtid,
00071   enum  rsbac_rc_item_t         item,
00072   union rsbac_rc_item_value_t * value_p,
00073         rsbac_time_t          * ttl_p);
00074 
00075 /* Setting item values */
00076 int rsbac_rc_set_item(
00077         rsbac_list_ta_number_t ta_number,
00078   enum  rsbac_rc_target_t       target,
00079   union rsbac_rc_target_id_t    tid,
00080   union rsbac_rc_target_id_t    subtid,
00081   enum  rsbac_rc_item_t         item,
00082   union rsbac_rc_item_value_t   value,
00083         rsbac_time_t            ttl);
00084 
00085 /* Checking role's compatibility */
00086 rsbac_boolean_t rsbac_rc_check_comp(rsbac_rc_role_id_t              role,
00087                                    union rsbac_rc_target_id_t      subtid,
00088                                    enum  rsbac_rc_item_t           item,
00089                                    enum  rsbac_rc_special_rights_t right);
00090 
00091 /* Checking whether role exists */
00092 rsbac_boolean_t rsbac_rc_role_exists(
00093   rsbac_list_ta_number_t ta_number,
00094   rsbac_rc_role_id_t role);
00095 
00096 rsbac_boolean_t rsbac_rc_type_exists(
00097        rsbac_list_ta_number_t ta_number,
00098   enum rsbac_target_t     target,
00099        rsbac_rc_type_id_t type);
00100 
00101 /* Get list of defined items. Returns number or negative error.
00102  * Allocates array via vmalloc, if number > 0 - vfree after use! */
00103 int rsbac_rc_get_list(
00104         rsbac_list_ta_number_t ta_number,
00105   enum  rsbac_rc_target_t       target,
00106   union rsbac_rc_target_id_t    tid,
00107   enum  rsbac_rc_item_t         item,
00108         __u32  ** array_pp,
00109         rsbac_time_t ** ttl_array_pp);
00110 
00111 #endif

Generated on Fri Jun 17 09:45:18 2005 for RSBAC by  doxygen 1.4.2