pm_types.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 types for privacy        */
00006 /*      model calls                   */
00007 /* Last modified: 06/Sep/2001         */
00008 /************************************ */
00009 
00010 #ifndef __RSBAC_PM_TYPES_H
00011 #define __RSBAC_PM_TYPES_H
00012 
00013 #include <linux/types.h>
00014 
00015 /* Basic types */
00016 
00017 typedef __u32 rsbac_pm_task_id_t;
00018 typedef __u32 rsbac_pm_task_set_id_t;
00019 typedef __u32 rsbac_pm_tp_id_t;       /* transformation procedure id */
00020 typedef __u32 rsbac_pm_tp_set_id_t;   /* transformation procedure set id */
00021 typedef __u32 rsbac_pm_ru_set_id_t;   /* responsible user set id */
00022 typedef __u32 rsbac_pm_purpose_id_t;
00023 typedef __s32 rsbac_pm_pp_set_id_t;   /* purpose set id */
00024 typedef rsbac_pid_t rsbac_pm_in_pp_set_id_t; /* input purpose set id */
00025 typedef rsbac_pm_in_pp_set_id_t rsbac_pm_out_pp_set_id_t;
00026                                             /* output purpose set id */
00027 typedef __u32 rsbac_pm_object_class_id_t;
00028 typedef __u32 rsbac_pm_tkt_id_t;      /* ticket id */
00029 typedef rsbac_time_t rsbac_pm_time_stamp_t; /* for ticket time stamps, same as */
00030                                       /* parameter for sys_time */
00031 typedef __u8 rsbac_pm_accesses_t;   /* for necessary accesses */
00032 #define RSBAC_PM_A_READ   1
00033 #define RSBAC_PM_A_WRITE  2
00034 #define RSBAC_PM_A_DELETE 4
00035 #define RSBAC_PM_A_CREATE 8
00036 #define RSBAC_PM_A_APPEND 16
00037 #define RSBAC_PM_A_ALL    31
00038 #define RSBAC_PM_A_WRITING (RSBAC_PM_A_WRITE | RSBAC_PM_A_DELETE \
00039                             | RSBAC_PM_A_CREATE | RSBAC_PM_A_APPEND)
00040 #define RSBAC_PM_A_WRITE_TO_FILE (RSBAC_PM_A_WRITE | RSBAC_PM_A_APPEND)
00041 
00042 #define RSBAC_PM_ROOT_TASK_SET_ID     (rsbac_pm_task_set_id_t) -1
00043 #define RSBAC_PM_IPC_OBJECT_CLASS_ID  (rsbac_pm_object_class_id_t) 60000
00044 #define RSBAC_PM_DEV_OBJECT_CLASS_ID  (rsbac_pm_object_class_id_t) 60001
00045 
00046 /* enum attributes */
00047 
00048 enum    rsbac_pm_list_t {PL_task,PL_class,PL_na,PL_cs,PL_tp,PL_pp,PL_tkt,PL_none};
00049 
00050 enum    rsbac_pm_all_list_t {PA_task,PA_class,PA_na,PA_cs,PA_tp,PA_pp,PA_tkt,
00051                              PA_task_set,PA_tp_set,PA_ru_set,PA_pp_set,
00052                              PA_in_pp_set,PA_out_pp_set,PA_none};
00053 
00054 enum    rsbac_pm_role_t {PR_user, PR_security_officer,
00055                          PR_data_protection_officer,
00056                          PR_tp_manager, PR_system_admin,
00057                          PR_none};
00058 typedef rsbac_enum_t rsbac_pm_role_int_t;
00059 
00060 enum    rsbac_pm_process_type_t {PP_none, PP_TP};
00061 typedef rsbac_enum_t rsbac_pm_process_type_int_t;
00062 
00063 enum    rsbac_pm_object_type_t {PO_none, PO_TP, PO_personal_data,
00064                                 PO_non_personal_data, PO_ipc, PO_dir};
00065 typedef rsbac_enum_t rsbac_pm_object_type_int_t;
00066 
00067 typedef rsbac_pm_process_type_int_t rsbac_pm_program_type_int_t;
00068 
00069 #ifdef __KERNEL__
00070 enum    rsbac_pm_set_t  {PS_TASK,PS_TP,PS_RU,PS_PP,PS_IN_PP,PS_OUT_PP,PS_NONE};
00071 
00072 /* unions */
00073 
00074 union rsbac_pm_set_id_t
00075   {
00076     rsbac_pm_task_set_id_t   task_set;
00077     rsbac_pm_tp_set_id_t     tp_set;
00078     rsbac_pm_ru_set_id_t     ru_set;
00079     rsbac_pm_pp_set_id_t     pp_set;
00080     rsbac_pm_in_pp_set_id_t  in_pp_set;
00081     rsbac_pm_out_pp_set_id_t out_pp_set;
00082   };
00083 
00084 union rsbac_pm_set_member_t
00085   {
00086     rsbac_pm_task_id_t      task;
00087     rsbac_pm_tp_id_t        tp;
00088     rsbac_uid_t             ru;
00089     rsbac_pm_purpose_id_t   pp;
00090   };
00091 
00092 struct  rsbac_pm_na_id_t
00093   {
00094       rsbac_pm_task_id_t                 task;
00095       rsbac_pm_object_class_id_t         object_class;
00096       rsbac_pm_tp_id_t                   tp;
00097   };
00098 
00099 struct  rsbac_pm_cs_id_t
00100   {
00101       rsbac_pm_purpose_id_t              purpose;
00102       struct rsbac_fs_file_t             file;
00103   };
00104 
00105 /*****************/
00106 /* api types     */
00107 /*****************/
00108 
00109 struct rsbac_pm_task_data_t
00110     {
00111       rsbac_pm_task_id_t                 id;
00112       rsbac_pm_purpose_id_t              purpose;
00113       rsbac_pm_tp_set_id_t               tp_set;
00114       rsbac_pm_ru_set_id_t               ru_set;
00115     };
00116 
00117 struct rsbac_pm_class_data_t
00118     {
00119       rsbac_pm_object_class_id_t            id;
00120       rsbac_pm_pp_set_id_t                  pp_set;
00121     };
00122 
00123 struct rsbac_pm_na_data_t
00124     {
00125       rsbac_pm_task_id_t                 task;
00126       rsbac_pm_object_class_id_t         object_class;
00127       rsbac_pm_tp_id_t                   tp;
00128       rsbac_pm_accesses_t                accesses;
00129     };
00130 
00131 struct rsbac_pm_cs_data_t
00132     {
00133       rsbac_pm_purpose_id_t              purpose;
00134       struct rsbac_fs_file_t             file;
00135     };
00136 
00137 struct rsbac_pm_tp_data_t
00138     {
00139       rsbac_pm_tp_id_t                   id;
00140     };
00141 
00142 struct rsbac_pm_pp_data_t
00143     {
00144       rsbac_pm_purpose_id_t              id;
00145       rsbac_pm_object_class_id_t         def_class;
00146     };
00147 #endif /* __KERNEL__ */
00148 
00149 struct rsbac_pm_purpose_list_item_t
00150     {
00151       rsbac_pm_purpose_id_t                 id;
00152       struct rsbac_pm_purpose_list_item_t * next;
00153     };
00154 
00155 /******* ticket ********/
00156 
00157 #include <rsbac/pm_ticket.h>
00158 
00159 #ifdef __KERNEL__
00160 /****************************************************************************/
00161 /* For all pm lists all manipulation is encapsulated by the function calls  */
00162 /* rsbac_pm_set_data, rsbac_pm_get_data and rsbac_pm_remove_target.   */
00163 
00164 /* For those, we declare some extra types to specify target and attribute.  */
00165 
00166 enum   rsbac_pm_target_t {PMT_TASK,
00167                           PMT_CLASS,
00168                           PMT_NA,
00169                           PMT_CS,
00170                           PMT_TP,
00171                           PMT_PP,
00172                           PMT_TKT,
00173                           PMT_NONE};
00174 typedef rsbac_enum_t rsbac_pm_target_int_t;
00175 
00176 union  rsbac_pm_target_id_t
00177        {
00178           rsbac_pm_task_id_t          task;
00179           rsbac_pm_object_class_id_t  object_class;
00180           struct rsbac_pm_na_id_t     na;
00181           struct rsbac_pm_cs_id_t     cs;
00182           rsbac_pm_tp_id_t            tp;
00183           rsbac_pm_purpose_id_t       pp;
00184           rsbac_pm_tkt_id_t           tkt;
00185           int                         dummy;
00186        };
00187 
00188 enum   rsbac_pm_data_t
00189        {                  PD_purpose,
00190                           PD_tp_set,
00191                           PD_ru_set,
00192                           PD_pp_set,
00193                           PD_task,
00194                           PD_class,
00195                           PD_tp,
00196                           PD_accesses,
00197                           PD_file,
00198                           PD_issuer,
00199                           PD_function_type,
00200                           PD_function_param,
00201                           PD_valid_until,
00202                           PD_def_class,
00203                           PD_none
00204        };
00205 typedef rsbac_enum_t rsbac_pm_data_int_t;
00206 
00207 union  rsbac_pm_data_value_t
00208        {
00209           rsbac_pm_purpose_id_t         purpose;
00210           rsbac_pm_tp_set_id_t          tp_set;
00211           rsbac_pm_ru_set_id_t          ru_set;
00212           rsbac_pm_pp_set_id_t          pp_set;
00213           rsbac_pm_task_id_t            task;
00214           rsbac_pm_object_class_id_t    object_class;
00215           rsbac_pm_tp_id_t              tp;
00216           rsbac_pm_accesses_t           accesses;
00217           struct rsbac_fs_file_t        file;
00218           rsbac_uid_t                   issuer;
00219           enum   rsbac_pm_tkt_function_type_t   function_type;
00220           union  rsbac_pm_tkt_internal_function_param_t  function_param;
00221           rsbac_pm_time_stamp_t         valid_until;
00222           rsbac_pm_object_class_id_t    def_class;
00223           int                           dummy;
00224        };
00225 
00226 
00227 union  rsbac_pm_all_data_value_t
00228        {
00229           struct rsbac_pm_task_data_t   task;
00230           struct rsbac_pm_class_data_t  object_class;
00231           struct rsbac_pm_na_data_t     na;
00232           struct rsbac_pm_cs_data_t     cs;
00233           struct rsbac_pm_tp_data_t     tp;
00234           struct rsbac_pm_pp_data_t     pp;
00235           struct rsbac_pm_tkt_data_t    tkt;
00236           int                           dummy;
00237        };
00238 #endif
00239 
00240 #endif

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