#include "log.h" #include "language.h" #include #include "medusa.h" typedef struct { unsigned long dev; unsigned long ino; } inod_t; struct med_s { struct m_proc_inf proc; /* proces which caused it */ struct m_inode_inf *inode; /* only informational */ struct m_proc_inf *target; /* only informational */ char *data; /* data from request */ __u32 action; /* action (napr. fsact ...) */ __u32 info1; /* from medusa packet from kernel */ __u32 info2; /* from medusa packet from kernel */ __u32 trace_arg[5]; /* trace arguments from kernel */ int answer; /* here set the answer for kernel */ int apply_mode; /* 0=only this process */ char *redirect; /* here set the redirection */ }; #define APPLY_CURRENT 0 #define APPLY_PARENT 1 #define APPLY_FOR_PARENT 2 #define APPLY_FOR_LOGIN 3 #define MIACT_RECURSIVE MIACT_VALID #define MIACT_IGET 0 typedef struct fentry_s { struct fentry_s *next; __u16 act; udata *program; int proglen; } fentry_t; typedef struct fpattern_s { struct fpattern_s *next; fentry_t *ent; /* only one can't be chained !!! */ char *path; regex_t reg; } fpattern_t; typedef struct files_s { struct files_s *parent; struct files_s *child; struct files_s *next; char *name; fentry_t *ent; fpattern_t *patterns; inod_t inode; } files_t; struct c_module { struct c_module *next; int (*func) (struct medusa_packet *, char *, struct medusa_packet *, char **); }; int add_module(int (*func) (struct medusa_packet *, char *, struct medusa_packet *, char **)); char *med_cmd(struct medusa_packet *msg, char *data); int modules_preinit(char *config); int modules_postinit(void); int apply(int mode, struct med_s *orig, udata * prog); /* maskmatch.c */ int maskmatch(char *filename, char *mask);