dazuko_xp.h File Reference

#include "dazukoio_xp.h"

Go to the source code of this file.

Defines

#define VERSION   "2.0.5"
#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 DAZUKO_NONE   0
#define DAZUKO_REGULAR   1
#define DAZUKO_DIRECTORY   2
#define DAZUKO_LINK   3
#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_fill_file_struct (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 xp_file *file, 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(), and dazuko_set_option().

#define ADD_INCLUDE_PATH   1
 

Definition at line 44 of file dazuko_xp.h.

Referenced by dazuko_handle_request(), and dazuko_set_option().

#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_DIRECTORY   2
 

Definition at line 63 of file dazuko_xp.h.

#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_LINK   3
 

Definition at line 64 of file dazuko_xp.h.

#define DAZUKO_NONE   0
 

Definition at line 61 of file dazuko_xp.h.

#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_REGULAR   1
 

Definition at line 62 of file dazuko_xp.h.

#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 202 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().

#define REGISTER   3
 

Definition at line 46 of file dazuko_xp.h.

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

#define REMOVE_ALL_PATHS   4
 

Definition at line 47 of file dazuko_xp.h.

Referenced by dazuko_handle_request(), and dazuko_set_option().

#define RETURN_AN_ACCESS   7
 

Definition at line 50 of file dazuko_xp.h.

Referenced by dazuko_handle_request().

#define SET_ACCESS_MASK   0
 

Definition at line 43 of file dazuko_xp.h.

Referenced by dazuko_handle_request(), and dazuko_set_option().

#define UNREGISTER   5
 

Definition at line 48 of file dazuko_xp.h.

Referenced by dazuko_handle_request(), and dazuko_set_option().

#define VERSION   "2.0.5"
 

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 273 of file dazuko_xp.c.

Referenced by dazuko_clear_replybuffer(), dazuko_init(), dazuko_is_selected(), dazuko_register_daemon(), 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 2837 of file dazuko_xp.c.

References 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(), slot_list_container::mutex, NULL, NUM_SLOTS, slot_list_container::slot_list, and VERSION.

int dazuko_get_filename_length char *  filename  )  [inline]
 

Definition at line 2499 of file dazuko_xp.c.

Referenced by xp_fill_file_struct().

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

Definition at line 1141 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 1653 of file dazuko_xp.c.

References dazuko_request::buffer, dazuko_request::buffer_size, call_xp_copyin(), call_xp_copyout(), call_xp_free(), call_xp_malloc(), dazuko_handle_request(), NULL, dazuko_request::reply_buffer, dazuko_request::reply_buffer_size, dazuko_request::reply_buffer_size_used, dazuko_request::type, XP_ERROR_FAULT, and XP_ERROR_PERMISSION.

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 1776 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, access_compat12::deny, slot::event, access_compat12::event, slot::event_p, access_compat12::filename, slot::filename, slot::filenamelength, event_properties::flags, IOCTL_GET_AN_ACCESS, IOCTL_RETURN_ACCESS, IOCTL_SET_OPTION, event_properties::mode, slot::mutex, NULL, access_compat12::o_flags, access_compat12::o_mode, event_properties::pid, access_compat12::pid, REGISTER, event_properties::uid, access_compat12::uid, 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 2807 of file dazuko_xp.c.

References 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(), and VERSION.

Referenced by rsbac_init_daz().

int dazuko_is_our_daemon struct xp_daemon_id xp_id  )  [inline]
 

Definition at line 2218 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 261 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 2563 of file dazuko_xp.c.

References access_mask, 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 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 2726 of file dazuko_xp.c.

References 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(), hash::dirty, hash::name, hash::namelen, NULL, SCAN_ON_CLOSE, SCAN_ON_CLOSE_MODIFIED, and SCAN_ON_OPEN.

Referenced by rsbac_adf_set_attr_daz().

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

Definition at line 2608 of file dazuko_xp.c.

References call_xp_compare_file(), call_xp_malloc(), call_xp_print, call_xp_read_lock(), call_xp_read_unlock(), DAZUKO_ON_CLOSE, DAZUKO_ON_CLOSE_MODIFIED, DAZUKO_ON_OPEN, dazuko_run_daemon(), dazuko_should_scan(), dazuko_file_struct::extra_data, hash::file, dazuko_file_struct::filename, dazuko_file_struct::filename_length, hash::name, hash::namelen, hash::next, NULL, SCAN_ON_OPEN, dazuko_file_struct::should_scan, XP_ERROR_INTERRUPT, and XP_ERROR_PERMISSION.

Referenced by rsbac_adf_request_daz().

int dazuko_unregister_daemon struct xp_daemon_id xp_id  ) 
 

Definition at line 705 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 149 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 xp_atomic::atomic.

int xp_atomic_inc struct xp_atomic atomic  )  [inline]
 

Definition at line 289 of file daz_main.c.

References xp_atomic::atomic.

int xp_atomic_read struct xp_atomic atomic  )  [inline]
 

Definition at line 315 of file daz_main.c.

References xp_atomic::atomic.

int xp_atomic_set struct xp_atomic atomic,
int  value
[inline]
 

Definition at line 283 of file daz_main.c.

References xp_atomic::atomic.

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

Definition at line 328 of file daz_main.c.

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

Definition at line 323 of file daz_main.c.

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

Definition at line 252 of file daz_main.c.

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

Definition at line 257 of file daz_main.c.

int xp_destroy_mutex struct xp_mutex mutex  )  [inline]
 

Definition at line 159 of file daz_main.c.

int xp_destroy_queue struct xp_queue queue  )  [inline]
 

Definition at line 233 of file daz_main.c.

int xp_destroy_rwlock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 197 of file daz_main.c.

int xp_down struct xp_mutex mutex  )  [inline]
 

Definition at line 147 of file daz_main.c.

References xp_mutex::mutex.

int xp_fill_file_struct 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().

int xp_free void *  ptr  )  [inline]
 

Definition at line 246 of file daz_main.c.

int xp_id_compare struct xp_daemon_id id1,
struct xp_daemon_id id2
 

Definition at line 419 of file daz_main.c.

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

struct xp_daemon_id* xp_id_copy struct xp_daemon_id id  ) 
 

Definition at line 442 of file daz_main.c.

References xp_daemon_id::file, NULL, xp_daemon_id::pid, and xp_malloc().

int xp_id_free struct xp_daemon_id id  ) 
 

Definition at line 435 of file daz_main.c.

References xp_free().

int xp_init_mutex struct xp_mutex mutex  )  [inline]
 

Definition at line 136 of file daz_main.c.

References xp_mutex::mutex.

int xp_init_queue struct xp_queue queue  )  [inline]
 

Definition at line 205 of file daz_main.c.

References xp_queue::queue.

int xp_init_rwlock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 167 of file daz_main.c.

References xp_rwlock::rwlock.

int xp_is_absolute_path const char *  path  )  [inline]
 

Definition at line 275 of file daz_main.c.

void* xp_malloc size_t  size  )  [inline]
 

Definition at line 241 of file daz_main.c.

References rsbac_kmalloc().

int xp_notify struct xp_queue queue  )  [inline]
 

Definition at line 227 of file daz_main.c.

References xp_queue::queue.

int xp_print const char *  fmt,
  ...
 

Definition at line 522 of file daz_main.c.

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

int xp_read_lock struct xp_rwlock rlock  )  [inline]
 

Definition at line 185 of file daz_main.c.

References xp_rwlock::rwlock.

int xp_read_unlock struct xp_rwlock rlock  )  [inline]
 

Definition at line 191 of file daz_main.c.

References xp_rwlock::rwlock.

int xp_sys_hook void   )  [inline]
 

Definition at line 463 of file daz_main.c.

References dev_major, DEVICE_NAME, fops, NULL, and xp_print().

int xp_sys_unhook void   )  [inline]
 

Definition at line 493 of file daz_main.c.

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

int xp_up struct xp_mutex mutex  )  [inline]
 

Definition at line 153 of file daz_main.c.

References xp_mutex::mutex.

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

Definition at line 267 of file daz_main.c.

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

Definition at line 262 of file daz_main.c.

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

Definition at line 211 of file daz_main.c.

References xp_queue::queue.

int xp_write_lock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 173 of file daz_main.c.

References xp_rwlock::rwlock.

int xp_write_unlock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 179 of file daz_main.c.

References xp_rwlock::rwlock.


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