1 2 3 #ifndef BUFSIZ 4 #define BUFSIZ (1<<16) 5 #endif 6 7 // don't do to much rules, it will degrade performance 8 #define MAXRULES (1<<8) 9 10 // there's no need in more than 256 arguments while running action-script, IMHO :) 11 #define MAXARGUMENTS (1<<8) 12 13 // clsync should be used, if there's more than 5-10 nodes. So the limit in 255 is quite enough. :) 14 #define MAXNODES ((1<<8)-1) 15 16 // max user/group lengths 17 #define USER_LEN (1<<8) 18 #define GROUP_LEN USER_LEN 19 20 // control socket listen backlog (man 2 listen) 21 #define SOCKET_BACKLOG 2 22 23 // control socket connections limit in clsync 24 #define SOCKET_MAX_CLSYNC 8 25 26 // control socket connections limit in libclsync 27 #define SOCKET_MAX_LIBCLSYNC (1<<16) 28 29 // children count limit 30 #define MAXCHILDREN (1<<8) 31 32 #ifdef __CLSYNC_COMMON_H 33 # if INOTIFY_SUPPORT 34 # define DEFAULT_NOTIFYENGINE NE_INOTIFY 35 # elif KQUEUE_SUPPORT 36 # define DEFAULT_NOTIFYENGINE NE_KQUEUE 37 # else 38 # error No inotify/kqueue support, cannot compile working clsync 39 # endif 40 #endif 41 #define DEFAULT_RULES_PERM RA_ALL 42 #define DEFAULT_COLLECTDELAY 30 43 #define DEFAULT_SYNCDELAY (DEFAULT_COLLECTDELAY) 44 #define DEFAULT_BFILETHRESHOLD (128 * 1024 * 1024) 45 #define DEFAULT_BFILECOLLECTDELAY 1800 46 #define DEFAULT_LABEL "nolabel" 47 #define DEFAULT_RSYNCINCLUDELINESLIMIT 20000 48 #define DEFAULT_SYNCTIMEOUT (3600 * 24) 49 #define DEFAULT_CLUSTERTIMEOUT 1000 50 #define DEFAULT_CLUSTERIPADDR "227.108.115.121" 51 #define DEFAULT_CLUSTERIPPORT 40079 52 #define DEFAULT_CLUSTERHDLMIN 1 53 #define DEFAULT_CLUSTERHDLMAX 16 54 #define DEFAULT_CLUSTERSDLMAX 32 55 #define DEFAULT_CONFIG_BLOCK "default" 56 #define DEFAULT_RETRIES 1 57 #define DEFAULT_VERBOSE 3 58 #define DEFAULT_DUMPDIR "/tmp/clsync-dump-%label%" 59 60 #define FANOTIFY_FLAGS (FAN_CLOEXEC|FAN_UNLIMITED_QUEUE|FAN_UNLIMITED_MARKS) 61 #define FANOTIFY_EVFLAGS (O_LARGEFILE|O_RDONLY|O_CLOEXEC) 62 63 #define FANOTIFY_MARKMASK (FAN_OPEN|FAN_MODIFY|FAN_CLOSE|FAN_ONDIR|FAN_EVENT_ON_CHILD) 64 65 #define INOTIFY_FLAGS 0 66 //(FD_CLOEXEC) 67 68 #define INOTIFY_MARKMASK (IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_MOVED_FROM|IN_MOVED_TO|IN_MODIFY|IN_DONT_FOLLOW) 69 70 #define COUNTER_LIMIT (1<<10) 71 72 #define SLEEP_SECONDS 1 73 74 #define KILL_TIMEOUT 60 75 76 #define ALLOC_PORTION (1<<10) /* 1 KiX */ 77 #define CLUSTER_WINDOW_BUFSIZE_PORTION (1<<20) /* 1 MiB */ 78 #define CLUSTER_PACKET_MAXSIZE (1<<24) /* 16 MiB */ 79 80 #define CONFIG_PATHS { ".clsync.conf", "/etc/clsync/clsync.conf", NULL } /* "~/.clsync.conf" and "/etc/clsync/clsync.conf" */ 81 82 #define API_PREFIX "clsyncapi_" 83 84 #define DUMP_DIRMODE 0750 85 #define DUMP_FILEMODE 0644 86 87 // size of event chain size to be processes at a time 88 #define KQUEUE_EVENTLISTSIZE 256 89 90 #define AUDITPIPE_PATH "/dev/auditpipe" 91 #define AUDIT_CONTROL_PATH "/etc/security/audit_control" 92 #define AUDIT_CONTROL_INITSCRIPT "/etc/rc.d/auditd" 93 #define AUDIT_CONTROL_HEADER "#clsync\n" 94 #define AUDIT_CONTROL_CONTENT "\n\ 95 dir:/var/audit\n\ 96 flags:fc,fd,fw,fm,cl\n\ 97 minfree:0\n\ 98 naflags:fc,fd,fw,fm,cl\n\ 99 policy:cnt\n\ 100 filesz:1M\n\ 101 " 102 103 #define DTRACE_PATH "dtrace" 104 105 #define SYSLOG_BUFSIZ (1<<16) 106