/linux-2.6.21.1-rsbac-1.3.4/include/rsbac/debug.h

Go to the documentation of this file.
00001 /******************************* */
00002 /* Rule Set Based Access Control */
00003 /* Author and (c) 1999-2007:     */
00004 /*   Amon Ott <ao@rsbac.org>     */
00005 /* debug definitions             */
00006 /* Last modified: 11/Apr/2007    */
00007 /******************************* */
00008 
00009 #ifndef __RSBAC_DEBUG_H
00010 #define __RSBAC_DEBUG_H
00011 
00012 #include <linux/init.h>
00013 //#include <rsbac/types.h>
00014 
00015 #define set_rsbac_softmode 1
00016 #define set_rsbac_softmode_once 2
00017 #define set_rsbac_softmode_never 4
00018 #define set_rsbac_freeze 8
00019 #define set_rsbac_um_no_excl 16
00020 #define set_rsbac_auth_learn 32
00021 #define set_rsbac_acl_learn_fd 64
00022 #define set_rsbac_cap_log_missing 128
00023 #define set_rsbac_jail_log_missing 256
00024 #define set_rsbac_dac_disable 512
00025 #define set_rsbac_no_delay_init 1024
00026 #define set_rsbac_no_defaults 2048
00027 #define set_rsbac_nosyslog 4096
00028 #define set_rsbac_cap_process_hiding 8192
00029 
00030 extern unsigned long int rsbac_flags;
00031 extern void rsbac_flags_set(unsigned long int);
00032 
00033 extern int rsbac_debug_no_write;
00034 
00035 #ifdef CONFIG_RSBAC_DEBUG
00036 extern int rsbac_debug_ds;
00037 extern int rsbac_debug_write;
00038 extern int rsbac_debug_stack;
00039 extern int rsbac_debug_lists;
00040 extern int rsbac_debug_aef;
00041 #endif
00042 
00043 extern int rsbac_debug_adf_default;
00044 extern rsbac_log_entry_t  rsbac_log_levels[R_NONE+1];
00045 
00046 #define RSBAC_LOG_LEVELS_NAME "log_levels"
00047 #define RSBAC_LOG_LEVEL_LIST_NAME "ll"
00048 #define RSBAC_LOG_LEVEL_VERSION 4
00049 #define RSBAC_LOG_LEVEL_OLD_VERSION 3
00050 #define RSBAC_LOG_LEVEL_OLD_OLD_VERSION 2
00051 #define RSBAC_LOG_LEVEL_KEY 13123231
00052 
00053 
00054 extern int rsbac_no_defaults;
00055 
00056 #ifdef CONFIG_RSBAC_INIT_DELAY
00057 extern void rsbac_init_debug(void);
00058 #else
00059 extern void rsbac_init_debug(void) __init;
00060 #endif
00061 
00062 extern rsbac_boolean_t rsbac_parse_koptions(char *);
00063 
00064 #define RSBAC_WAKEUP_KEY 'w'
00065 #define RSBAC_WAKEUP_UKEY 'W'
00066 
00067 #ifdef CONFIG_RSBAC_SOFTMODE
00068 #define RSBAC_SOFTMODE_KEY 'x'
00069 #define RSBAC_SOFTMODE_UKEY 'X'
00070 extern int rsbac_softmode;
00071 extern int rsbac_softmode_prohibit;
00072 static inline int rsbac_in_softmode(void)
00073   {
00074     return rsbac_softmode;
00075   }
00076 #ifdef CONFIG_RSBAC_SOFTMODE_IND
00077 extern int  rsbac_ind_softmode[SW_NONE];
00078 #endif
00079 #endif
00080 
00081 #if defined(CONFIG_RSBAC_FREEZE)
00082 extern int rsbac_freeze;
00083 #endif
00084 
00085 #ifdef CONFIG_RSBAC_FD_CACHE
00086 extern rsbac_time_t rsbac_fd_cache_ttl;
00087 extern u_int rsbac_fd_cache_disable;
00088 #endif
00089 
00090 #if defined(CONFIG_RSBAC_AUTO_WRITE) && (CONFIG_RSBAC_AUTO_WRITE > 0)
00091 extern rsbac_time_t rsbac_list_check_interval;
00092 #endif
00093 
00094 #if defined(CONFIG_RSBAC_CAP_PROC_HIDE)
00095 extern int rsbac_cap_process_hiding;
00096 #endif
00097 #ifdef CONFIG_RSBAC_CAP_LOG_MISSING
00098 extern int rsbac_cap_log_missing;
00099 #endif
00100 #ifdef CONFIG_RSBAC_JAIL_LOG_MISSING
00101 extern int rsbac_jail_log_missing;
00102 #endif
00103 
00104 #ifdef CONFIG_RSBAC_ALLOW_DAC_DISABLE_FULL
00105 extern int rsbac_dac_disable;
00106 extern int rsbac_dac_is_disabled(void);
00107 #endif
00108 
00109 #ifdef CONFIG_RSBAC_RMSG_NOSYSLOG
00110 extern int rsbac_nosyslog;
00111 #endif
00112 
00113 #ifdef CONFIG_RSBAC_INIT_DELAY
00114 extern int rsbac_no_delay_init;
00115 extern kdev_t rsbac_delayed_root;
00116 extern char rsbac_delayed_root_str[];
00117 #endif
00118 
00119 /* rsbac_printk(): You must always prepend the loglevel. As sequence numbers
00120  * are per rsbac_printk() message, it is strongly recommended to output single
00121  * full lines only.
00122  * Example:
00123  * rsbac_printk(KERN_DEBUG "Test value: %u\n", testval);
00124  */
00125 extern int rsbac_printk(const char *, ...);
00126 
00127 #ifdef CONFIG_RSBAC_DEBUG
00128 #define rsbac_pr_debug(type, fmt, arg...) \
00129         do { if (rsbac_debug_##type) \
00130                 rsbac_printk(KERN_DEBUG "%s(): " fmt, __FUNCTION__, ##arg); \
00131         } while (0)
00132 #else
00133 #define rsbac_pr_debug(type, fmt, arg...) do { } while (0)
00134 #endif
00135 
00136 #define rsbac_pr_get_error(attr) \
00137         do { rsbac_ds_get_error (__FUNCTION__, attr); \
00138         } while (0)
00139 #define rsbac_pr_set_error(attr) \
00140         do { rsbac_ds_set_error (__FUNCTION__, attr); \
00141         } while (0)
00142 
00143 #define rsbac_rc_pr_get_error(item) \
00144         do { rsbac_rc_ds_get_error (__FUNCTION__, item); \
00145         } while (0)
00146 #define rsbac_rc_pr_set_error(item) \
00147         do { rsbac_rc_ds_set_error (__FUNCTION__, item); \
00148         } while (0)
00149 
00150 #define RSBAC_LOG_MAXLINE 2040
00151 
00152 #if defined(CONFIG_RSBAC_RMSG)
00153 extern int rsbac_log(int, char *, int);
00154 
00155 #define RSBAC_LOG_MAXREADBUF (rsbac_min(8192,RSBAC_MAX_KMALLOC))
00156 
00157 struct rsbac_log_list_item_t {
00158         struct rsbac_log_list_item_t *next;
00159         u16 size;
00160         char buffer[0];
00161 };
00162 
00163 struct rsbac_log_list_head_t {
00164         struct rsbac_log_list_item_t *head;
00165         struct rsbac_log_list_item_t *tail;
00166         u_int count;
00167         u_long lost;
00168 };
00169 #if defined(CONFIG_RSBAC_LOG_REMOTE)
00170 extern rsbac_pid_t rsbaclogd_pid;
00171 #endif
00172 #endif
00173 
00174 #ifdef CONFIG_RSBAC_NET
00175 extern int rsbac_debug_ds_net;
00176 extern int rsbac_debug_aef_net;
00177 extern int rsbac_debug_adf_net;
00178 #endif
00179 
00180 extern void wakeup_rsbacd(u_long dummy);
00181 
00182 /* switch log level for request */
00183 void  rsbac_adf_log_switch(rsbac_adf_request_int_t request,
00184                            enum rsbac_target_t target,
00185                            rsbac_enum_t value);
00186 
00187 int rsbac_get_adf_log(rsbac_adf_request_int_t request,
00188                       enum rsbac_target_t target,
00189                       u_int * value_p);
00190 
00191 #ifdef CONFIG_RSBAC_DEBUG
00192 #if defined(CONFIG_RSBAC_AUTO_WRITE) && (CONFIG_RSBAC_AUTO_WRITE > 0)
00193 extern int rsbac_debug_auto;
00194 #endif /* CONFIG_RSBAC_AUTO_WRITE > 0 */
00195 
00196 #if defined(CONFIG_RSBAC_MAC)
00197 extern int rsbac_debug_ds_mac;
00198 extern int rsbac_debug_aef_mac;
00199 extern int rsbac_debug_adf_mac;
00200 #endif
00201 
00202 #if defined(CONFIG_RSBAC_PM) || defined(CONFIG_RSBAC_PM_MAINT)
00203 extern int rsbac_debug_ds_pm;
00204 extern int rsbac_debug_aef_pm;
00205 extern int rsbac_debug_adf_pm;
00206 #endif
00207 
00208 #if defined(CONFIG_RSBAC_DAZ) || defined(CONFIG_RSBAC_DAZ_MAINT)
00209 extern int rsbac_debug_adf_daz;
00210 #endif
00211 
00212 #if defined(CONFIG_RSBAC_RC) || defined(CONFIG_RSBAC_RC_MAINT)
00213 extern int rsbac_debug_ds_rc;
00214 extern int rsbac_debug_aef_rc;
00215 extern int rsbac_debug_adf_rc;
00216 #endif
00217 
00218 #if defined(CONFIG_RSBAC_AUTH) || defined(CONFIG_RSBAC_AUTH_MAINT)
00219 extern int rsbac_debug_ds_auth;
00220 extern int rsbac_debug_aef_auth;
00221 extern int rsbac_debug_adf_auth;
00222 #endif
00223 
00224 #if defined(CONFIG_RSBAC_REG) || defined(CONFIG_RSBAC_REG_MAINT)
00225 extern int rsbac_debug_reg;
00226 #endif
00227 
00228 #if defined(CONFIG_RSBAC_ACL) || defined(CONFIG_RSBAC_ACL_MAINT)
00229 extern int rsbac_debug_ds_acl;
00230 extern int rsbac_debug_aef_acl;
00231 extern int rsbac_debug_adf_acl;
00232 #endif
00233 
00234 #if defined(CONFIG_RSBAC_JAIL)
00235 extern int rsbac_debug_aef_jail;
00236 extern int rsbac_debug_adf_jail;
00237 #endif
00238 
00239 #if defined(CONFIG_RSBAC_PAX)
00240 extern int rsbac_debug_adf_pax;
00241 #endif
00242 
00243 #if defined(CONFIG_RSBAC_UM)
00244 extern int rsbac_debug_ds_um;
00245 extern int rsbac_debug_aef_um;
00246 extern int rsbac_debug_adf_um;
00247 #endif
00248 
00249 #endif /* DEBUG */
00250 
00251 #if defined(CONFIG_RSBAC_UM_EXCL)
00252 extern int rsbac_um_no_excl;
00253 #endif
00254 
00255 #if defined(CONFIG_RSBAC_AUTH) || defined(CONFIG_RSBAC_AUTH_MAINT)
00256 extern int rsbac_auth_enable_login;
00257 #if defined(CONFIG_RSBAC_AUTH_LEARN)
00258 extern int rsbac_auth_learn;
00259 #endif
00260 #endif
00261 
00262 #if defined(CONFIG_RSBAC_ACL_LEARN)
00263 extern int rsbac_acl_learn_fd;
00264 #endif
00265 
00266 #endif

Generated on Wed May 16 11:53:27 2007 for RSBAC by  doxygen 1.5.1