dazuko_rsbac.h

Go to the documentation of this file.
00001 /* Dazuko RSBAC. Allow RSBAC Linux file access control for 3rd-party applications.
00002    Copyright (c) 2004 H+BEDV Datentechnik GmbH
00003    Written by John Ogness <jogness@antivir.de>
00004 
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public License
00007    as published by the Free Software Foundation; either version 2
00008    of the License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 */
00019 
00020 #ifndef DAZUKO_RSBAC_H
00021 #define DAZUKO_RSBAC_H
00022 
00023 #if CONFIG_MODVERSIONS==1
00024 #define MODVERSIONS
00025 #include <linux/modversions.h>
00026 #endif
00027 
00028 #include <linux/kernel.h>
00029 #include <linux/version.h>
00030 
00031 #ifdef MODULE
00032 #include <linux/module.h>
00033 #endif
00034 
00035 #ifndef KERNEL_VERSION
00036 #define KERNEL_VERSION(a,b,c) ((a)*65536+(b)*256+(c))
00037 #endif
00038 
00039 #include <linux/slab.h>
00040 #include <asm/atomic.h>
00041 
00042 #ifdef CONFIG_SMP
00043 #ifndef __SMP__
00044 #define __SMP__
00045 #endif
00046 #endif
00047 
00048 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
00049 #ifdef __SMP__
00050 #include <asm/smplock.h>
00051 #endif
00052 #else
00053 #include <asm/semaphore.h>
00054 #endif
00055 
00056 
00057 #define DEVICE_NAME             "dazuko"
00058 
00059 #define XP_ERROR_PERMISSION     -EPERM;
00060 #define XP_ERROR_INTERRUPT      -EINTR;
00061 #define XP_ERROR_BUSY           -EBUSY;
00062 #define XP_ERROR_FAULT          -EFAULT;
00063 #define XP_ERROR_INVALID        -EINVAL;
00064 
00065 
00066 struct xp_daemon_id
00067 {
00068         int             pid;
00069         struct file     *file;
00070 };
00071 
00072 struct xp_file
00073 {
00074         char    c;
00075 };
00076 
00077 struct xp_mutex
00078 {
00079         struct semaphore        mutex;
00080 };
00081 
00082 struct xp_atomic
00083 {
00084         atomic_t        atomic;
00085 };
00086 
00087 struct xp_file_struct
00088 {
00089         int                     full_filename_length;   /* length of filename */
00090         char                    *full_filename;         /* kernelspace filename with full path */
00091         int                     free_full_filename;     /* flag to clean up full_filename */
00092         struct dentry           *dentry;                /* used to get inode */
00093 };
00094 
00095 struct xp_queue
00096 {
00097 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
00098         wait_queue_head_t queue;
00099 #else
00100         struct wait_queue *queue;
00101 #endif
00102 };
00103 
00104 struct xp_rwlock
00105 {
00106         rwlock_t        rwlock;
00107 };
00108 
00109 #endif

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