00001 /* DazukoXP Interface. Interace with Dazuko for file access control. 00002 Written by John Ogness <jogness@antivir.de> 00003 00004 Copyright (c) 2002, 2003, 2004 H+BEDV Datentechnik GmbH 00005 All rights reserved. 00006 00007 Redistribution and use in source and binary forms, with or without 00008 modification, are permitted provided that the following conditions 00009 are met: 00010 00011 1. Redistributions of source code must retain the above copyright notice, 00012 this list of conditions and the following disclaimer. 00013 00014 2. Redistributions in binary form must reproduce the above copyright notice, 00015 this list of conditions and the following disclaimer in the documentation 00016 and/or other materials provided with the distribution. 00017 00018 3. Neither the name of Dazuko nor the names of its contributors may be used 00019 to endorse or promote products derived from this software without specific 00020 prior written permission. 00021 00022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00023 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00024 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00025 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00026 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00027 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00028 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00029 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00030 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00031 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00032 POSSIBILITY OF SUCH DAMAGE. 00033 */ 00034 00035 #ifndef DAZUKOIO_XP_H 00036 #define DAZUKOIO_XP_H 00037 00038 /* various requests */ 00039 #define SET_ACCESS_MASK 0 00040 #define ADD_INCLUDE_PATH 1 00041 #define ADD_EXCLUDE_PATH 2 00042 #define REGISTER 3 00043 #define REMOVE_ALL_PATHS 4 00044 #define UNREGISTER 5 00045 #define GET_AN_ACCESS 6 00046 #define RETURN_AN_ACCESS 7 00047 00048 /* this is just a large number to "guarentee" 00049 to contain the full filename */ 00050 #define DAZUKO_FILENAME_MAX_LENGTH 6144 00051 00052 /* this is the hard-limit file length restriction from 00053 the 1.x series */ 00054 #define DAZUKO_FILENAME_MAX_LENGTH_COMPAT12 4095 00055 00056 struct dazuko_request 00057 { 00058 char type[2]; 00059 int buffer_size; 00060 char *buffer; 00061 int reply_buffer_size; 00062 char *reply_buffer; 00063 int reply_buffer_size_used; 00064 }; 00065 00066 struct dazuko_id 00067 { 00068 int device; 00069 int dev_major; 00070 int id; 00071 int write_mode; 00072 }; 00073 00074 /* compat12 ioctls */ 00075 00076 #define IOCTL_SET_OPTION 0 00077 #define IOCTL_GET_AN_ACCESS 1 00078 #define IOCTL_RETURN_ACCESS 2 00079 00080 /* compat12 structures */ 00081 00082 struct access_compat12 00083 { 00084 int deny; /* set to deny file access */ 00085 int event; /* ON_OPEN, etc */ 00086 int o_flags; /* access flags */ 00087 int o_mode; /* access mode */ 00088 int uid; /* user id */ 00089 int pid; /* user process id */ 00090 char filename[DAZUKO_FILENAME_MAX_LENGTH_COMPAT12]; /* accessed file */ 00091 }; 00092 00093 struct option_compat12 00094 { 00095 int command; 00096 int buffer_length; 00097 char buffer[DAZUKO_FILENAME_MAX_LENGTH_COMPAT12]; 00098 }; 00099 00100 #endif