/daten/src/linux-2.4.27-rsbac-v1.2.3/rsbac/adf/daz/dazuko_xp.h File Reference

#include "dazukoio_xp.h"

Go to the source code of this file.

Data Structures

struct  event_properties
struct  file_properties
struct  dazuko_file_struct

Defines

#define VERSION   "2.0.2"
#define SET_ACCESS_MASK   0
#define ADD_INCLUDE_PATH   1
#define ADD_EXCLUDE_PATH   2
#define REGISTER   3
#define REMOVE_ALL_PATHS   4
#define UNREGISTER   5
#define GET_AN_ACCESS   6
#define RETURN_AN_ACCESS   7
#define DAZUKO_FREE   0
#define DAZUKO_READY   1
#define DAZUKO_WAITING   2
#define DAZUKO_WORKING   3
#define DAZUKO_DONE   4
#define DAZUKO_BROKEN   5
#define DPRINT(fmt)

Functions

int xp_init_mutex (struct xp_mutex *mutex)
int xp_down (struct xp_mutex *mutex)
int xp_up (struct xp_mutex *mutex)
int xp_destroy_mutex (struct xp_mutex *mutex)
int xp_init_rwlock (struct xp_rwlock *rwlock)
int xp_write_lock (struct xp_rwlock *rwlock)
int xp_write_unlock (struct xp_rwlock *rwlock)
int xp_read_lock (struct xp_rwlock *rlock)
int xp_read_unlock (struct xp_rwlock *rlock)
int xp_destroy_rwlock (struct xp_rwlock *rwlock)
int xp_init_queue (struct xp_queue *queue)
int xp_wait_until_condition (struct xp_queue *queue, int(*cfunction)(void *), void *cparam, int allow_interrupt)
int xp_notify (struct xp_queue *queue)
int xp_destroy_queue (struct xp_queue *queue)
void * xp_malloc (size_t size)
int xp_free (void *ptr)
int xp_copyin (const void *user_src, void *kernel_dest, size_t size)
int xp_copyout (const void *kernel_src, void *user_dest, size_t size)
int xp_verify_user_writable (const void *user_ptr, size_t size)
int xp_verify_user_readable (const void *user_ptr, size_t size)
int xp_is_absolute_path (const char *path)
int xp_atomic_set (struct xp_atomic *atomic, int value)
int xp_atomic_inc (struct xp_atomic *atomic)
int xp_atomic_dec (struct xp_atomic *atomic)
int xp_atomic_read (struct xp_atomic *atomic)
int xp_copy_file (struct xp_file *dest, struct xp_file *src)
int xp_compare_file (struct xp_file *file1, struct xp_file *file2)
int xp_sys_hook (void)
int xp_sys_unhook (void)
int xp_file_struct_check (struct dazuko_file_struct *dfs)
int xp_file_struct_check_cleanup (struct dazuko_file_struct *dfs)
int xp_id_compare (struct xp_daemon_id *id1, struct xp_daemon_id *id2)
int xp_id_free (struct xp_daemon_id *id)
xp_daemon_idxp_id_copy (struct xp_daemon_id *id)
int xp_print (const char *fmt,...)
int dazuko_vsnprintf (char *str, size_t size, const char *format, va_list ap)
int dazuko_snprintf (char *str, size_t size, const char *format,...)
int dazuko_is_our_daemon (struct xp_daemon_id *xp_id)
int dazuko_get_value (const char *key, const char *string, char **value)
int dazuko_unregister_daemon (struct xp_daemon_id *xp_id)
int dazuko_handle_user_request (struct dazuko_request *user_request, struct xp_daemon_id *xp_id)
int dazuko_handle_user_request_compat12 (void *ptr, int cmd, struct xp_daemon_id *xp_id)
int dazuko_get_filename_length (char *filename)
void dazuko_bzero (void *p, int len)
int dazuko_sys_check (unsigned long event, int daemon_is_allowed, struct xp_daemon_id *xp_id)
int dazuko_sys_pre (unsigned long event, struct dazuko_file_struct *kfs, struct event_properties *event_p)
int dazuko_sys_post (unsigned long event, struct dazuko_file_struct *kfs, struct xp_file *file, struct event_properties *event_p)
int dazuko_init (void)
int dazuko_exit (void)


Define Documentation

#define ADD_EXCLUDE_PATH   2
 

Definition at line 45 of file dazuko_xp.h.

Referenced by dazuko_handle_request(), dazuko_set_option(), dazukoAddExcludePath_TS(), and dazukoAddExcludePath_TS_compat12().

#define ADD_INCLUDE_PATH   1
 

Definition at line 44 of file dazuko_xp.h.

Referenced by dazuko_handle_request(), dazuko_set_option(), dazukoAddIncludePath_TS(), and dazukoAddIncludePath_TS_compat12().

#define DAZUKO_BROKEN   5
 

Definition at line 58 of file dazuko_xp.h.

Referenced by dazuko_get_an_access(), and dazuko_state_error().

#define DAZUKO_DONE   4
 

Definition at line 57 of file dazuko_xp.h.

Referenced by dazuko_return_access(), and dazuko_run_daemon_on_slotlist().

#define DAZUKO_FREE   0
 

Definition at line 53 of file dazuko_xp.h.

Referenced by __dazuko_change_slot_state(), _dazuko_unregister_daemon(), dazuko_register_daemon(), and dazuko_run_daemon_on_slotlist().

#define DAZUKO_READY   1
 

Definition at line 54 of file dazuko_xp.h.

Referenced by __dazuko_change_slot_state(), dazuko_get_an_access(), and dazuko_get_and_hold_ready_slot().

#define DAZUKO_WAITING   2
 

Definition at line 55 of file dazuko_xp.h.

Referenced by dazuko_get_an_access(), dazuko_get_and_hold_ready_slot(), and dazuko_run_daemon_on_slotlist().

#define DAZUKO_WORKING   3
 

Definition at line 56 of file dazuko_xp.h.

Referenced by dazuko_get_an_access(), dazuko_handle_user_request_compat12(), dazuko_return_access(), and dazuko_run_daemon_on_slotlist().

#define DPRINT fmt   ) 
 

Definition at line 187 of file dazuko_xp.h.

Referenced by _dazuko_unregister_daemon(), dazuko_get_an_access(), dazuko_insert_path_fs(), dazuko_register_daemon(), dazuko_remove_all_hash(), dazuko_remove_all_paths(), dazuko_return_access(), dazuko_run_daemon_on_slotlist(), linux_dazuko_device_open(), linux_dazuko_device_read(), and linux_dazuko_device_release().

#define GET_AN_ACCESS   6
 

Definition at line 49 of file dazuko_xp.h.

Referenced by dazuko_handle_request(), and dazukoGetAccess_TS().

#define REGISTER   3
 

Definition at line 46 of file dazuko_xp.h.

Referenced by dazuko_handle_request(), dazuko_handle_user_request_compat12(), dazuko_set_option(), dazukoRegister_TS(), and dazukoRegister_TS_compat12().

#define REMOVE_ALL_PATHS   4
 

Definition at line 47 of file dazuko_xp.h.

Referenced by dazuko_handle_request(), dazuko_set_option(), dazukoRemoveAllPaths_TS(), and dazukoRemoveAllPaths_TS_compat12().

#define RETURN_AN_ACCESS   7
 

Definition at line 50 of file dazuko_xp.h.

Referenced by dazuko_handle_request(), and dazukoReturnAccess_TS().

#define SET_ACCESS_MASK   0
 

Definition at line 43 of file dazuko_xp.h.

Referenced by dazuko_handle_request(), dazuko_set_option(), dazukoSetAccessMask_TS(), and dazukoSetAccessMask_TS_compat12().

#define UNREGISTER   5
 

Definition at line 48 of file dazuko_xp.h.

Referenced by dazuko_handle_request(), dazuko_set_option(), and dazukoUnregister_TS().

#define VERSION   "2.0.2"
 

Definition at line 38 of file dazuko_xp.h.

Referenced by dazuko_exit(), and dazuko_init().


Function Documentation

void dazuko_bzero void *  p,
int  len
[inline]
 

Definition at line 272 of file dazuko_xp.c.

Referenced by dazuko_clear_replybuffer(), dazuko_init(), dazuko_register_daemon(), dazuko_rsbac_process(), dazuko_run_daemon_on_slotlist(), linux_dazuko_device_read(), rsbac_adf_request_daz(), and rsbac_adf_set_attr_daz().

int dazuko_exit void   )  [inline]
 

Definition at line 2744 of file dazuko_xp.c.

References active, call_xp_atomic_read(), call_xp_destroy_mutex(), call_xp_destroy_queue(), call_xp_destroy_rwlock(), call_xp_free(), call_xp_print, call_xp_sys_unhook, dazuko_remove_all_hash(), dazuko_remove_all_paths(), lock_hash, lock_lists, slot_list_container::mutex, mutex_unique_count, NULL, NUM_SLOT_LISTS, NUM_SLOTS, slot_list_container::slot_list, slot_lists, VERSION, wait_daemon_waiting_for_free, wait_daemon_waiting_for_work, wait_kernel_waiting_for_free_slot, and wait_kernel_waiting_while_daemon_works.

Referenced by linux_dazuko_exit().

int dazuko_get_filename_length char *  filename  )  [inline]
 

Definition at line 2453 of file dazuko_xp.c.

Referenced by xp_file_struct_check().

int dazuko_get_value const char *  key,
const char *  string,
char **  value
 

Definition at line 1140 of file dazuko_xp.c.

References call_xp_malloc(), dazuko_strlen(), dazuko_strstr(), and NULL.

Referenced by dazuko_handle_request(), and linux_dazuko_device_write().

int dazuko_handle_user_request struct dazuko_request user_request,
struct xp_daemon_id xp_id
 

Definition at line 1652 of file dazuko_xp.c.

References call_xp_copyin(), call_xp_copyout(), call_xp_free(), call_xp_malloc(), dazuko_handle_request(), NULL, and XP_ERROR_FAULT.

Referenced by linux_dazuko_device_write().

int dazuko_handle_user_request_compat12 void *  ptr,
int  cmd,
struct xp_daemon_id xp_id
 

Definition at line 1775 of file dazuko_xp.c.

References call_xp_copyin(), call_xp_copyout(), call_xp_free(), call_xp_id_copy(), call_xp_id_free(), call_xp_malloc(), call_xp_print, call_xp_up(), call_xp_verify_user_readable(), call_xp_verify_user_writable(), DAZUKO_FILENAME_MAX_LENGTH_COMPAT12, dazuko_get_an_access(), dazuko_register_daemon(), dazuko_return_access(), dazuko_set_option(), dazuko_state_error(), DAZUKO_WORKING, IOCTL_GET_AN_ACCESS, IOCTL_RETURN_ACCESS, IOCTL_SET_OPTION, NULL, REGISTER, daemon_id::unique, XP_ERROR_FAULT, XP_ERROR_INTERRUPT, XP_ERROR_INVALID, and daemon_id::xp_id.

Referenced by linux_dazuko_device_ioctl().

int dazuko_init void   )  [inline]
 

Definition at line 2714 of file dazuko_xp.c.

References active, call_xp_atomic_set(), call_xp_init_mutex(), call_xp_init_queue(), call_xp_init_rwlock(), call_xp_print, call_xp_sys_hook, dazuko_bzero(), lock_hash, lock_lists, mutex_unique_count, NUM_SLOT_LISTS, slot_lists, VERSION, wait_daemon_waiting_for_free, wait_daemon_waiting_for_work, wait_kernel_waiting_for_free_slot, and wait_kernel_waiting_while_daemon_works.

Referenced by linux_dazuko_init(), and rsbac_init_daz().

int dazuko_is_our_daemon struct xp_daemon_id xp_id  )  [inline]
 

Definition at line 2216 of file dazuko_xp.c.

References call_xp_id_copy(), call_xp_id_free(), dazuko_find_slot(), NULL, daemon_id::unique, and daemon_id::xp_id.

Referenced by dazuko_sys_check().

int dazuko_snprintf char *  str,
size_t  size,
const char *  format,
  ...
 

Definition at line 260 of file dazuko_xp.c.

References dazuko_vsnprintf().

Referenced by dazuko_add_esc_to_replybuffer(), and linux_dazuko_device_read().

int dazuko_sys_check unsigned long  event,
int  daemon_is_allowed,
struct xp_daemon_id xp_id
[inline]
 

Definition at line 2519 of file dazuko_xp.c.

References access_mask, active, call_xp_atomic_read(), dazuko_is_our_daemon(), DAZUKO_ON_CLOSE, DAZUKO_ON_OPEN, SCAN_ON_CLOSE, SCAN_ON_CLOSE_MODIFIED, and SCAN_ON_OPEN.

Referenced by dazuko_rsbac_process(), rsbac_adf_request_daz(), and rsbac_adf_set_attr_daz().

int dazuko_sys_post unsigned long  event,
struct dazuko_file_struct kfs,
struct xp_file file,
struct event_properties event_p
[inline]
 

Definition at line 2634 of file dazuko_xp.c.

References active, call_xp_atomic_read(), call_xp_free(), dazuko_add_hash(), dazuko_get_hash(), dazuko_mark_hash_dirty(), DAZUKO_ON_CLOSE, DAZUKO_ON_CLOSE_MODIFIED, DAZUKO_ON_OPEN, dazuko_run_daemon(), dazuko_should_scan(), dazuko_file_struct::file_p, dazuko_file_struct::filename, dazuko_file_struct::filename_length, NULL, SCAN_ON_CLOSE, SCAN_ON_CLOSE_MODIFIED, and SCAN_ON_OPEN.

Referenced by dazuko_rsbac_process(), and rsbac_adf_set_attr_daz().

int dazuko_sys_pre unsigned long  event,
struct dazuko_file_struct kfs,
struct event_properties event_p
[inline]
 

Definition at line 2564 of file dazuko_xp.c.

References DAZUKO_ON_CLOSE, DAZUKO_ON_CLOSE_MODIFIED, DAZUKO_ON_OPEN, dazuko_run_daemon(), dazuko_should_scan(), dazuko_file_struct::file_p, dazuko_file_struct::filename, dazuko_file_struct::filename_length, NULL, SCAN_ON_OPEN, XP_ERROR_INTERRUPT, and XP_ERROR_PERMISSION.

Referenced by dazuko_rsbac_process(), and rsbac_adf_request_daz().

int dazuko_unregister_daemon struct xp_daemon_id xp_id  ) 
 

Definition at line 704 of file dazuko_xp.c.

References _dazuko_unregister_daemon(), call_xp_id_copy(), call_xp_id_free(), NULL, daemon_id::unique, and daemon_id::xp_id.

Referenced by linux_dazuko_device_release().

int dazuko_vsnprintf char *  str,
size_t  size,
const char *  format,
va_list  ap
 

Definition at line 148 of file dazuko_xp.c.

References DAZUKO_VSNPRINTF_PRINTSTRING, and NULL.

Referenced by dazuko_snprintf(), and xp_print().

int xp_atomic_dec struct xp_atomic atomic  )  [inline]
 

Definition at line 302 of file daz_main.c.

References active, and xp_atomic::atomic.

Referenced by call_xp_atomic_dec().

int xp_atomic_inc struct xp_atomic atomic  )  [inline]
 

Definition at line 289 of file daz_main.c.

References active, and xp_atomic::atomic.

Referenced by call_xp_atomic_inc().

int xp_atomic_read struct xp_atomic atomic  )  [inline]
 

Definition at line 315 of file daz_main.c.

References xp_atomic::atomic.

Referenced by call_xp_atomic_read().

int xp_atomic_set struct xp_atomic atomic,
int  value
[inline]
 

Definition at line 283 of file daz_main.c.

References xp_atomic::atomic.

Referenced by call_xp_atomic_set().

int xp_compare_file struct xp_file file1,
struct xp_file file2
[inline]
 

Definition at line 328 of file daz_main.c.

Referenced by call_xp_compare_file().

int xp_copy_file struct xp_file dest,
struct xp_file src
[inline]
 

Definition at line 323 of file daz_main.c.

Referenced by call_xp_copy_file().

int xp_copyin const void *  user_src,
void *  kernel_dest,
size_t  size
[inline]
 

Definition at line 252 of file daz_main.c.

Referenced by call_xp_copyin(), and linux_dazuko_device_write().

int xp_copyout const void *  kernel_src,
void *  user_dest,
size_t  size
[inline]
 

Definition at line 257 of file daz_main.c.

Referenced by call_xp_copyout(), and linux_dazuko_device_read().

int xp_destroy_mutex struct xp_mutex mutex  )  [inline]
 

Definition at line 159 of file daz_main.c.

Referenced by call_xp_destroy_mutex().

int xp_destroy_queue struct xp_queue queue  )  [inline]
 

Definition at line 233 of file daz_main.c.

Referenced by call_xp_destroy_queue().

int xp_destroy_rwlock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 197 of file daz_main.c.

Referenced by call_xp_destroy_rwlock().

int xp_down struct xp_mutex mutex  )  [inline]
 

Definition at line 147 of file daz_main.c.

References xp_mutex::mutex.

Referenced by call_xp_down().

int xp_file_struct_check struct dazuko_file_struct dfs  )  [inline]
 

Definition at line 333 of file daz_main.c.

References dazuko_get_filename_length(), xp_file_struct::dentry, file_properties::device_type, dazuko_file_struct::extra_data, dazuko_file_struct::file_p, dazuko_file_struct::filename, dazuko_file_struct::filename_length, xp_file_struct::free_full_filename, xp_file_struct::full_filename, xp_file_struct::full_filename_length, file_properties::gid, file_properties::mode, NULL, rsbac_get_full_path(), rsbac_get_full_path_length(), file_properties::set_device_type, file_properties::set_gid, file_properties::set_mode, file_properties::set_size, file_properties::set_uid, file_properties::size, file_properties::uid, and xp_malloc().

Referenced by call_xp_file_struct_check().

int xp_file_struct_check_cleanup struct dazuko_file_struct dfs  ) 
 

Definition at line 393 of file daz_main.c.

Referenced by call_xp_file_struct_check_cleanup(), and dazuko_file_struct_cleanup().

int xp_free void *  ptr  )  [inline]
 

Definition at line 246 of file daz_main.c.

Referenced by call_xp_free(), dazuko_file_struct_cleanup(), dazuko_rsbac_process(), linux_dazuko_device_write(), rsbac_adf_request_daz(), rsbac_adf_set_attr_daz(), xp_id_free(), and xp_print().

int xp_id_compare struct xp_daemon_id id1,
struct xp_daemon_id id2
 

Definition at line 426 of file daz_main.c.

References xp_daemon_id::file, NULL, and xp_daemon_id::pid.

Referenced by call_xp_id_compare().

struct xp_daemon_id* xp_id_copy struct xp_daemon_id id  ) 
 

Definition at line 449 of file daz_main.c.

References NULL, and xp_malloc().

Referenced by call_xp_id_copy().

int xp_id_free struct xp_daemon_id id  ) 
 

Definition at line 442 of file daz_main.c.

References xp_free().

Referenced by call_xp_id_free().

int xp_init_mutex struct xp_mutex mutex  )  [inline]
 

Definition at line 136 of file daz_main.c.

References xp_mutex::mutex.

Referenced by call_xp_init_mutex().

int xp_init_queue struct xp_queue queue  )  [inline]
 

Definition at line 205 of file daz_main.c.

References NULL, and xp_queue::queue.

Referenced by call_xp_init_queue().

int xp_init_rwlock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 167 of file daz_main.c.

References xp_rwlock::rwlock.

Referenced by call_xp_init_rwlock().

int xp_is_absolute_path const char *  path  )  [inline]
 

Definition at line 275 of file daz_main.c.

Referenced by call_xp_is_absolute_path().

void* xp_malloc size_t  size  )  [inline]
 

Definition at line 241 of file daz_main.c.

Referenced by call_xp_malloc(), dazuko_rsbac_process(), rsbac_adf_request_daz(), rsbac_adf_set_attr_daz(), xp_file_struct_check(), xp_id_copy(), and xp_print().

int xp_notify struct xp_queue queue  )  [inline]
 

Definition at line 227 of file daz_main.c.

References xp_queue::queue.

Referenced by call_xp_notify().

int xp_print const char *  fmt,
  ...
 

Definition at line 517 of file daz_main.c.

References dazuko_vsnprintf(), xp_free(), and xp_malloc().

Referenced by call_xp_atomic_dec(), call_xp_atomic_inc(), call_xp_atomic_read(), call_xp_atomic_set(), call_xp_compare_file(), call_xp_copy_file(), call_xp_copyin(), call_xp_copyout(), call_xp_destroy_mutex(), call_xp_destroy_queue(), call_xp_destroy_rwlock(), call_xp_down(), call_xp_file_struct_check(), call_xp_file_struct_check_cleanup(), call_xp_free(), call_xp_id_compare(), call_xp_id_copy(), call_xp_id_free(), call_xp_init_mutex(), call_xp_init_queue(), call_xp_init_rwlock(), call_xp_is_absolute_path(), call_xp_malloc(), call_xp_notify(), call_xp_read_lock(), call_xp_read_unlock(), call_xp_up(), call_xp_verify_user_readable(), call_xp_verify_user_writable(), call_xp_wait_until_condition(), call_xp_write_lock(), call_xp_write_unlock(), linux_dazuko_device_ioctl(), linux_dazuko_device_read(), linux_dazuko_device_write(), xp_sys_hook(), and xp_sys_unhook().

int xp_read_lock struct xp_rwlock rlock  )  [inline]
 

Definition at line 185 of file daz_main.c.

References xp_rwlock::rwlock.

Referenced by call_xp_read_lock().

int xp_read_unlock struct xp_rwlock rlock  )  [inline]
 

Definition at line 191 of file daz_main.c.

References xp_rwlock::rwlock.

Referenced by call_xp_read_unlock().

int xp_sys_hook void   )  [inline]
 

Definition at line 470 of file daz_main.c.

References dazuko_rsbac_post(), dazuko_rsbac_pre(), dev_major, DEVICE_NAME, fops, handle, NULL, RSBAC_EEXISTS, rsbac_reg_register(), RSBAC_REG_REGISTER_RETRIES, RSBAC_REG_VERSION, TRUE, and xp_print().

int xp_sys_unhook void   )  [inline]
 

Definition at line 494 of file daz_main.c.

References dev_major, DEVICE_NAME, handle, NULL, rsbac_reg_unregister(), and xp_print().

int xp_up struct xp_mutex mutex  )  [inline]
 

Definition at line 153 of file daz_main.c.

References xp_mutex::mutex.

Referenced by call_xp_up().

int xp_verify_user_readable const void *  user_ptr,
size_t  size
[inline]
 

Definition at line 267 of file daz_main.c.

Referenced by call_xp_verify_user_readable().

int xp_verify_user_writable const void *  user_ptr,
size_t  size
[inline]
 

Definition at line 262 of file daz_main.c.

Referenced by call_xp_verify_user_writable().

int xp_wait_until_condition struct xp_queue queue,
int(*  cfunction)(void *),
void *  cparam,
int  allow_interrupt
[inline]
 

Definition at line 211 of file daz_main.c.

References xp_queue::queue, wait_event, and wait_event_interruptible.

Referenced by call_xp_wait_until_condition().

int xp_write_lock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 173 of file daz_main.c.

References xp_rwlock::rwlock.

Referenced by call_xp_write_lock().

int xp_write_unlock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 179 of file daz_main.c.

References xp_rwlock::rwlock.

Referenced by call_xp_write_unlock().


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