#ifndef __QSCAN_H__ #define __QSCAN_H__ 1 #ifndef __GNUC__ # ifdef __attribute__ # undef __attribute__ # endif # define __attribute__(a) #endif #include #ifdef STDC_HEADERS # include # include # include #else # if HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #else # if HAVE_STRINGS_H # include # endif #endif #include #include #include #ifdef HAVE_UNISTD_H # include #endif #ifdef TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #include #include #include #ifdef HAVE_SYS_RESOURCE_H # include #endif #ifdef HAVE_SYS_PARAM_H # include #endif #include #ifdef HAVE_DIRENT_H # include #endif #ifdef HAVE_SYS_NDIR_H # include #endif #ifdef HAVE_NDIR_H # include #endif #ifdef HAVE_ALLOCA # ifdef HAVE_ALLOCA_H # include # endif # define ALLOCA(X) alloca(X) # define ALLOCA_FREE(X) do { } while (0) #else # define ALLOCA(X) malloc(X) # define ALLOCA_FREE(X) free(X) #endif #include "mysnprintf.h" #ifndef errno extern int errno; #endif #ifndef O_NOFOLLOW # define O_NOFOLLOW 0 #endif #ifndef O_DIRECTORY # define O_DIRECTORY 0 #endif #ifndef MAP_FILE # define MAP_FILE 0 #endif #if !defined(O_NDELAY) && defined(O_NONBLOCK) # define O_NDELAY O_NONBLOCK #endif #ifndef FNDELAY # define FNDELAY O_NDELAY #endif #ifdef STAT_MACROS_BROKEN # undef S_ISBLK # undef S_ISCHR # undef S_ISDIR # undef S_ISFIFO # undef S_ISLNK # undef S_ISMPB # undef S_ISMPC # undef S_ISNWK # undef S_ISREG # undef S_ISSOCK #endif /* STAT_MACROS_BROKEN. */ #ifndef S_IFMT # define S_IFMT 0170000 #endif #if !defined(S_ISBLK) && defined(S_IFBLK) # define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) #endif #if !defined(S_ISCHR) && defined(S_IFCHR) # define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) #endif #if !defined(S_ISDIR) && defined(S_IFDIR) # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif #if !defined(S_ISREG) && defined(S_IFREG) # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif #if !defined(S_ISFIFO) && defined(S_IFIFO) # define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) #endif #if !defined(S_ISLNK) && defined(S_IFLNK) # define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) #endif #if !defined(S_ISSOCK) && defined(S_IFSOCK) # define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) #endif #if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */ # define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) # define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) #endif #if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */ # define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) #endif #ifndef S_IEXEC # define S_IEXEC S_IXUSR #endif #ifndef S_IXUSR # define S_IXUSR S_IEXEC #endif #ifndef S_IXGRP # define S_IXGRP (S_IEXEC >> 3) #endif #ifndef S_IXOTH # define S_IXOTH (S_IEXEC >> 6) #endif #ifndef S_IXUGO # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) #endif #ifndef MAXPATHLEN # ifdef PATH_MAX # define MAXPATHLEN PATH_MAX # else # define MAXPATHLEN 65536U Warning: neither PATH_MAX nor MAXPAHLEN were found. Remove these lines if you really want to compile the server, but the server may be insecure if a wrong value is set here. # endif #endif #define QSCAN_TIMEOUT 3000 #define RIPMIME_DESTDIR_BASE "/var/qmail/qscan" #define RIPMIME_ARGS "-i", "-", "-d" #define SWEEP_ARGS "--disable-summary", "--stdout" #define SWEEP_VIRUS_PREFIX " FOUND" #define SWEEP_TIMEOUT 250 #define SWEEP_NICE 15 #define MSG_BUFSIZE 8192 #define ENVELOPE_BUFSIZE 4096 #define AV_LINE_MAX 4096 #ifndef SCAN_CONCURRENCY # define SCAN_CONCURRENCY 10 #endif #define SCAN_MAX_RETRIES 30 #define SCAN_DELAY_BETWEEN_RETRIES 2 #endif