00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __RSBAC_REG_H
00010 #define __RSBAC_REG_H
00011
00012 #include <rsbac/types.h>
00013 #include <rsbac/debug.h>
00014
00015 #define RSBAC_REG_VERSION 1
00016
00017
00018
00019
00020
00021 #define RSBAC_REG_NAME_LEN 30
00022
00023
00024 typedef \
00025 int rsbac_reg_request_func_t ( enum rsbac_adf_request_t,
00026 rsbac_pid_t,
00027 enum rsbac_target_t,
00028 union rsbac_target_id_t,
00029 enum rsbac_attribute_t,
00030 union rsbac_attribute_value_t,
00031 rsbac_uid_t);
00032
00033
00034 typedef \
00035 int rsbac_reg_set_attr_func_t ( enum rsbac_adf_request_t,
00036 rsbac_pid_t,
00037 enum rsbac_target_t,
00038 union rsbac_target_id_t,
00039 enum rsbac_target_t,
00040 union rsbac_target_id_t,
00041 enum rsbac_attribute_t,
00042 union rsbac_attribute_value_t,
00043 rsbac_uid_t);
00044
00045
00046 typedef rsbac_boolean_t rsbac_reg_need_overwrite_func_t(struct dentry * dentry_p);
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 typedef int rsbac_reg_write_func_t(rsbac_boolean_t need_lock);
00059
00060
00061 typedef int rsbac_reg_mount_func_t(kdev_t kdev);
00062
00063
00064 typedef int rsbac_reg_umount_func_t(kdev_t kdev);
00065
00066
00067
00068 typedef int rsbac_reg_syscall_func_t(void * data);
00069
00070
00071
00072
00073 typedef int rsbac_reg_check_func_t(int correct, int check_inode);
00074
00075
00076
00077 struct rsbac_reg_entry_t
00078 {
00079 rsbac_reg_handle_t handle;
00080 char name[RSBAC_REG_NAME_LEN+1];
00081 rsbac_reg_request_func_t * request_func;
00082 rsbac_reg_set_attr_func_t * set_attr_func;
00083 rsbac_reg_need_overwrite_func_t * need_overwrite_func;
00084 rsbac_reg_write_func_t * write_func;
00085 rsbac_reg_mount_func_t * mount_func;
00086 rsbac_reg_umount_func_t * umount_func;
00087 rsbac_reg_check_func_t * check_func;
00088 rsbac_boolean_t switch_on;
00089 };
00090
00091 struct rsbac_reg_syscall_entry_t
00092 {
00093 rsbac_reg_handle_t registration_handle;
00094 rsbac_reg_handle_t dispatcher_handle;
00095 char name[RSBAC_REG_NAME_LEN+1];
00096 rsbac_reg_syscall_func_t * syscall_func;
00097 };
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114 rsbac_reg_handle_t rsbac_reg_register( rsbac_version_t version,
00115 struct rsbac_reg_entry_t entry);
00116
00117
00118
00119
00120
00121
00122
00123 int rsbac_reg_switch (rsbac_reg_handle_t handle, rsbac_boolean_t value);
00124
00125
00126
00127
00128
00129
00130 int rsbac_reg_unregister(rsbac_reg_handle_t handle);
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142 rsbac_reg_handle_t rsbac_reg_register_syscall( rsbac_version_t version,
00143 struct rsbac_reg_syscall_entry_t entry);
00144
00145
00146
00147
00148
00149
00150 int rsbac_reg_unregister_syscall(rsbac_reg_handle_t handle);
00151
00152 #endif