#if HAVE_CONFIG_H
#include "clamav-config.h"
#endif
#ifdef CLAMUKO
#ifndef DAZUKO_XP_H
#define DAZUKO_XP_H
#define VERSION "2.0.4-pre3"
#include "dazukoio_xp.h"
#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
struct event_properties
{
int thrown;
int flags;
char set_flags;
int mode;
char set_mode;
int uid;
char set_uid;
int pid;
char set_pid;
};
struct file_properties
{
unsigned long size;
char set_size;
int uid;
char set_uid;
int gid;
char set_gid;
int mode;
char set_mode;
int device_type;
char set_device_type;
int type;
char set_type;
};
struct dazuko_file_listnode
{
char *filename;
int filename_length;
struct dazuko_file_listnode *next;
};
struct dazuko_file_struct
{
int should_scan;
char *filename;
int filename_length;
struct dazuko_file_listnode *aliases;
struct file_properties file_p;
struct xp_file_struct *extra_data;
};
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);
struct xp_daemon_id* xp_id_copy(struct xp_daemon_id *id);
int xp_print(const char *fmt, ...);
#ifdef DEBUG
#define DPRINT(fmt) xp_print fmt
#else
#define DPRINT(fmt)
#endif
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);
#endif
#endif