clsync
Toggle main menu visibility
Loading...
Searching...
No Matches
ctx.h
Go to the documentation of this file.
1
/*
2
clsync - file tree sync utility based on inotify
3
4
Copyright (C) 2013 Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C
5
6
This program is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
21
#ifndef __CLSYNC_CTX_H
22
#define __CLSYNC_CTX_H
23
24
#include <regex.h>
25
#ifdef CAPABILITIES_SUPPORT
26
# include <sys/capability.h>
// __u32
27
#endif
28
29
#define MAX_BLOCKTHREADS (1<<4)
30
31
#define register_blockthread(thread) {\
32
critical_on (ctx_p->blockthread_count >= MAX_BLOCKTHREADS);\
33
ctx_p->blockthread[ctx_p->blockthread_count++] = pthread_self();\
34
debug(3, "register_blockthread(): ctx_p->blockthread_count -> %i", ctx_p->blockthread_count);\
35
}
36
37
#define OPTION_FLAGS (1<<10)
38
#define OPTION_LONGOPTONLY (1<<9)
39
#define OPTION_CONFIGONLY (1<<8)
40
#define NOTOPTION (3<<8)
41
enum
flags_enum
{
42
WATCHDIR
=
'W'
,
43
SYNCHANDLER
=
'S'
,
44
RULESFILE
=
'R'
,
45
DESTDIR
=
'D'
,
46
SOCKETPATH
=
's'
,
47
48
HELP
=
'h'
,
49
CONFIGFILE
=
'H'
,
50
CONFIGBLOCK
=
'K'
,
51
BACKGROUND
=
'b'
,
52
UID
=
'u'
,
53
GID
=
'g'
,
54
CAP_PRESERVE
=
'C'
,
55
THREADING
=
'p'
,
56
RETRIES
=
'r'
,
57
OUTPUT_METHOD
=
'Y'
,
58
EXCLUDEMOUNTPOINTS
=
'X'
,
59
PIDFILE
=
'z'
,
60
CLUSTERIFACE
=
'c'
,
61
CLUSTERMCASTIPADDR
=
'm'
,
62
CLUSTERMCASTIPPORT
=
'P'
,
63
CLUSTERTIMEOUT
=
'G'
,
64
CLUSTERNODENAME
=
'n'
,
65
CLUSTERHDLMIN
=
'o'
,
66
CLUSTERHDLMAX
=
'O'
,
67
DELAY
=
't'
,
68
BFILEDELAY
=
'T'
,
69
SYNCDELAY
=
'w'
,
70
BFILETHRESHOLD
=
'B'
,
71
DEBUG
=
'd'
,
72
QUIET
=
'q'
,
73
VERBOSE
=
'v'
,
74
OUTLISTSDIR
=
'L'
,
75
AUTORULESW
=
'A'
,
76
MODE
=
'M'
,
77
IGNOREEXITCODE
=
'x'
,
78
DONTUNLINK
=
'U'
,
79
INITFULL
=
'F'
,
80
SYNCTIMEOUT
=
'k'
,
81
LABEL
=
'l'
,
82
SHOW_VERSION
=
'V'
,
83
84
HAVERECURSIVESYNC
= 0 |
OPTION_LONGOPTONLY
,
85
RSYNCINCLIMIT
= 1 |
OPTION_LONGOPTONLY
,
86
RSYNCPREFERINCLUDE
= 2 |
OPTION_LONGOPTONLY
,
87
SYNCLISTSIMPLIFY
= 3 |
OPTION_LONGOPTONLY
,
88
ONEFILESYSTEM
= 4 |
OPTION_LONGOPTONLY
,
89
STATUSFILE
= 5 |
OPTION_LONGOPTONLY
,
90
SKIPINITSYNC
= 6 |
OPTION_LONGOPTONLY
,
91
ONLYINITSYNC
= 7 |
OPTION_LONGOPTONLY
,
92
EXITONNOEVENTS
= 8 |
OPTION_LONGOPTONLY
,
93
STANDBYFILE
= 9 |
OPTION_LONGOPTONLY
,
94
EXITHOOK
= 10 |
OPTION_LONGOPTONLY
,
95
CLUSTERSDLMAX
= 11 |
OPTION_LONGOPTONLY
,
96
PREEXITHOOK
= 12 |
OPTION_LONGOPTONLY
,
97
SOCKETAUTH
= 13 |
OPTION_LONGOPTONLY
,
98
SOCKETMOD
= 14 |
OPTION_LONGOPTONLY
,
99
SOCKETOWN
= 15 |
OPTION_LONGOPTONLY
,
100
MAXITERATIONS
= 16 |
OPTION_LONGOPTONLY
,
101
IGNOREFAILURES
= 17 |
OPTION_LONGOPTONLY
,
102
DUMPDIR
= 18 |
OPTION_LONGOPTONLY
,
103
CONFIGBLOCKINHERITS
= 19 |
OPTION_LONGOPTONLY
,
104
MONITOR
= 20 |
OPTION_LONGOPTONLY
,
105
SYNCHANDLERARGS0
= 21 |
OPTION_LONGOPTONLY
,
106
SYNCHANDLERARGS1
= 22 |
OPTION_LONGOPTONLY
,
107
CUSTOMSIGNALS
= 23 |
OPTION_LONGOPTONLY
,
108
CHROOT
= 24 |
OPTION_LONGOPTONLY
,
109
MOUNTPOINTS
= 25 |
OPTION_LONGOPTONLY
,
110
SPLITTING
= 26 |
OPTION_LONGOPTONLY
,
111
SYNCHANDLERUID
= 27 |
OPTION_LONGOPTONLY
,
112
SYNCHANDLERGID
= 28 |
OPTION_LONGOPTONLY
,
113
CAPS_INHERIT
= 29 |
OPTION_LONGOPTONLY
,
114
CHECK_EXECVP_ARGS
= 30 |
OPTION_LONGOPTONLY
,
115
PIVOT_ROOT
= 31 |
OPTION_LONGOPTONLY
,
116
DETACH_NETWORK
= 32 |
OPTION_LONGOPTONLY
,
117
DETACH_MISCELLANEA
= 33 |
OPTION_LONGOPTONLY
,
118
ADDPERMITTEDHOOKFILES
= 34 |
OPTION_LONGOPTONLY
,
119
SECCOMP_FILTER
= 35 |
OPTION_LONGOPTONLY
,
120
FORGET_PRIVTHREAD_INFO
= 36 |
OPTION_LONGOPTONLY
,
121
SECURESPLITTING
= 37 |
OPTION_LONGOPTONLY
,
122
FTS_EXPERIMENTAL_OPTIMIZATION
= 38 |
OPTION_LONGOPTONLY
,
123
FORBIDDEVICES
= 39 |
OPTION_LONGOPTONLY
,
124
CG_GROUPNAME
= 40 |
OPTION_LONGOPTONLY
,
125
PERMIT_MPROTECT
= 41 |
OPTION_LONGOPTONLY
,
126
SHM_MPROTECT
= 42 |
OPTION_LONGOPTONLY
,
127
MODSIGN
= 43 |
OPTION_LONGOPTONLY
,
128
CANCEL_SYSCALLS
= 44 |
OPTION_LONGOPTONLY
,
129
EXITONSYNCSKIP
= 45 |
OPTION_LONGOPTONLY
,
130
DETACH_IPC
= 46 |
OPTION_LONGOPTONLY
,
131
PRIVILEGEDUID
= 47 |
OPTION_LONGOPTONLY
,
132
PRIVILEGEDGID
= 48 |
OPTION_LONGOPTONLY
,
133
SOFTEXITSYNC
= 49 |
OPTION_LONGOPTONLY
,
134
};
135
typedef
enum
flags_enum
flags_t
;
136
137
enum
detachnetwork_way
{
138
DN_OFF
= 0,
139
DN_NONPRIVILEGED
,
140
DN_EVERYWHERE
,
141
};
142
typedef
enum
detachnetwork_way
detachnetwork_way_t
;
143
144
enum
pivotroot_way
{
145
PW_OFF
= 0,
146
PW_DIRECT
,
147
PW_AUTO
,
148
PW_AUTORO
,
149
};
150
typedef
enum
pivotroot_way
pivotroot_way_t
;
151
152
enum
capsinherit
{
153
CI_DONTTOUCH
= 0,
154
CI_PERMITTED
,
155
CI_CLSYNC
,
156
CI_EMPTY
,
157
};
158
typedef
enum
capsinherit
capsinherit_t
;
159
160
enum
mode_id
{
161
MODE_UNSET
= 0,
162
MODE_SIMPLE
,
163
MODE_DIRECT
,
164
MODE_SHELL
,
165
MODE_RSYNCSHELL
,
166
MODE_RSYNCDIRECT
,
167
MODE_RSYNCSO
,
168
MODE_SO
,
169
};
170
typedef
enum
mode_id
mode_id_t
;
171
172
enum
queue_id
{
173
QUEUE_NORMAL
,
174
QUEUE_BIGFILE
,
175
QUEUE_INSTANT
,
176
QUEUE_LOCKWAIT
,
177
178
QUEUE_MAX
,
179
QUEUE_AUTO
180
};
181
typedef
enum
queue_id
queue_id_t
;
182
183
enum
ruleactionsign_enum
{
184
RS_REJECT
= 0,
185
RS_PERMIT
= 1
186
};
187
typedef
enum
ruleactionsign_enum
ruleactionsign_t
;
188
189
enum
ruleaction_enum
{
190
RA_NONE
= 0x00,
191
RA_MONITOR
= 0x01,
192
RA_SYNC
= 0x02,
193
RA_WALK
= 0x04,
194
RA_ALL
= 0x0f,
195
};
196
typedef
enum
ruleaction_enum
ruleaction_t
;
197
198
// signals (man 7 signal)
199
enum
sigusr_enum
{
200
SIGUSR_THREAD_GC
= 10,
201
SIGUSR_INITSYNC
= 12,
202
SIGUSR_BLOPINT
= 16,
203
SIGUSR_DUMP
= 29,
204
};
205
206
struct
rule
{
207
int
num
;
208
regex_t
expr
;
209
mode_t
objtype
;
210
ruleaction_t
perm
;
211
ruleaction_t
mask
;
212
};
213
typedef
struct
rule
rule_t
;
214
215
struct
queueinfo
{
216
unsigned
int
collectdelay
;
217
time_t
stime
;
218
};
219
typedef
struct
queueinfo
queueinfo_t
;
220
221
struct
api_functs
{
222
api_funct_init
init
;
223
api_funct_sync
sync
;
224
api_funct_rsync
rsync
;
225
api_funct_deinit
deinit
;
226
};
227
typedef
struct
api_functs
api_functs_t
;
228
229
struct
notifyenginefuncts
{
230
int ( *
wait
) (
struct
ctx
*
ctx_p
,
struct
indexes
*indexes_p,
struct
timeval *tv_p );
231
int ( *
handle
) (
struct
ctx
*
ctx_p
,
struct
indexes
*indexes_p );
232
int ( *
add_watch_dir
) (
struct
ctx
*
ctx_p
,
struct
indexes
*indexes_p,
const
char
*
const
accpath );
233
};
234
235
enum
shflags
{
236
SHFL_NONE
= 0x00,
237
SHFL_RSYNC_ARGS
= 0x01,
238
SHFL_INCLUDE_LIST
= 0x02,
239
SHFL_INCLUDE_LIST_PATH
= 0x04,
240
SHFL_EXCLUDE_LIST_PATH
= 0x08,
241
};
242
typedef
enum
shflags
shflags_t
;
243
244
enum
shargsid
{
245
SHARGS_PRIMARY
= 0,
246
SHARGS_INITIAL
,
247
SHARGS_MAX
,
248
};
249
250
struct
synchandler_args
{
251
char
*
v
[
MAXARGUMENTS
];
252
int
c
;
253
char
isexpanded
[
MAXARGUMENTS
];
254
};
255
typedef
struct
synchandler_args
synchandler_args_t
;
256
257
#define STATE_STARTING(state_p) (state_p == NULL)
258
enum
state_enum
{
259
STATE_EXIT
= 0,
260
STATE_STARTING
,
261
STATE_RUNNING
,
262
STATE_SYNCHANDLER_ERR
,
263
STATE_REHASH
,
264
STATE_PREEXIT
,
265
STATE_LASTSYNC
,
266
STATE_TERM
,
267
STATE_THREAD_GC
,
268
STATE_INITSYNC
,
269
STATE_HOLDON
,
270
STATE_UNKNOWN
271
};
272
typedef
enum
state_enum
state_t
;
273
274
static
char
*
const
status_descr
[] = {
275
[
STATE_EXIT
] =
"exiting"
,
276
[
STATE_STARTING
] =
"starting"
,
277
[
STATE_RUNNING
] =
"running"
,
278
[
STATE_SYNCHANDLER_ERR
] =
"synchandler error"
,
279
[
STATE_REHASH
] =
"rehashing"
,
280
[
STATE_PREEXIT
] =
"preexit"
,
281
[
STATE_LASTSYNC
] =
"lastsync"
,
282
[
STATE_TERM
] =
"terminating"
,
283
[
STATE_THREAD_GC
] =
"thread gc"
,
284
[
STATE_INITSYNC
] =
"initsync"
,
285
[
STATE_HOLDON
] =
"hold on"
,
286
NULL
287
};
288
289
enum
stat_fields
{
290
STAT_FIELD_RESET
= 0x0000,
291
STAT_FIELD_DEV
= 0x0001,
292
STAT_FIELD_INO
= 0x0002,
293
STAT_FIELD_MODE
= 0x0004,
294
STAT_FIELD_NLINK
= 0x0008,
295
STAT_FIELD_UID
= 0x0010,
296
STAT_FIELD_GID
= 0x0020,
297
STAT_FIELD_RDEV
= 0x0040,
298
STAT_FIELD_SIZE
= 0x0080,
299
STAT_FIELD_BLKSIZE
= 0x0100,
300
STAT_FIELD_BLOCKS
= 0x0200,
301
STAT_FIELD_ATIME
= 0x0400,
302
STAT_FIELD_MTIME
= 0x0800,
303
STAT_FIELD_CTIME
= 0x1000,
304
305
STAT_FIELD_ALL
= 0x1ff7,
306
};
307
308
enum
syscall_bitmask
{
309
CSC_RESET
= 0x00,
310
CSC_MON_STAT
= 0x01,
311
};
312
313
#define CAP_PRESERVE_TRY (1<<16)
314
315
struct
ctx
{
316
#ifndef LIBCLSYNC
317
volatile
state_t
state
;
318
pid_t
pid
;
319
char
pid_str
[65];
320
size_t
pid_str_len
;
321
uid_t
uid
;
322
gid_t
gid
;
323
uid_t
privileged_uid
;
324
gid_t
privileged_gid
;
325
uid_t
synchandler_uid
;
326
gid_t
synchandler_gid
;
327
#ifdef CAPABILITIES_SUPPORT
328
__u32 caps;
329
#endif
330
pid_t
child_pid
[
MAXCHILDREN
];
// Used only for non-pthread mode
331
int
children
;
// Used only for non-pthread mode
332
uint32_t
iteration_num
;
333
rule_t
rules
[
MAXRULES
];
334
size_t
rules_count
;
335
dev_t
st_dev
;
336
#endif
337
char
*
flags_values_raw
[
OPTION_FLAGS
];
338
int
flags
[
OPTION_FLAGS
];
339
int
flags_set
[
OPTION_FLAGS
];
340
#ifndef LIBCLSYNC
341
char
*
config_path
;
342
const
char
*
config_block
;
343
char
*
customsignal
[
MAXSIGNALNUM
+ 1];
344
char
*
label
;
345
char
*
watchdir
;
346
char
*
pidfile
;
347
char
*
standbyfile
;
348
char
*
exithookfile
;
349
char
*
preexithookfile
;
350
char
*
destdir
;
351
char
*
destproto
;
352
char
*
watchdirwslash
;
353
char
*
destdirwslash
;
354
char
*
statusfile
;
355
char
*
socketpath
;
356
char
*
dump_path
;
357
#ifdef CGROUP_SUPPORT
358
char
*cg_groupname;
359
#endif
360
int
socket
;
361
mode_t
socketmod
;
362
uid_t
socketuid
;
363
gid_t
socketgid
;
364
#ifdef CLUSTER_SUPPORT
365
char
*cluster_iface;
366
char
*cluster_mcastipaddr;
367
char
*cluster_nodename;
368
uint32_t cluster_nodename_len;
369
uint16_t cluster_mcastipport;
370
uint16_t cluster_hash_dl_min;
371
uint16_t cluster_hash_dl_max;
372
uint16_t cluster_scan_dl_max;
373
unsigned
int
cluster_timeout;
374
#endif
375
size_t
watchdirlen
;
376
size_t
destdirlen
;
377
size_t
watchdirsize
;
378
size_t
destdirsize
;
379
size_t
watchdirwslashsize
;
380
size_t
destdirwslashsize
;
381
short
int
watchdir_dirlevel
;
382
char
*
handlerfpath
;
383
void
*
handler_handle
;
384
api_functs_t
handler_funct
;
385
char
*
rulfpath
;
386
size_t
rulfpathsize
;
387
char
*
listoutdir
;
388
struct
notifyenginefuncts
notifyenginefunct
;
389
int
retries
;
390
size_t
bfilethreshold
;
391
unsigned
int
syncdelay
;
392
queueinfo_t
_queues
[
QUEUE_MAX
];
// TODO: remove this from here
393
unsigned
int
rsyncinclimit
;
394
time_t
synctime
;
395
unsigned
int
synctimeout
;
396
sigset_t *
sigset
;
397
char
isignoredexitcode
[ ( 1 << 8 )];
398
pthread_t
blockthread
[
MAX_BLOCKTHREADS
];
399
size_t
blockthread_count
;
400
401
char
*
chroot_dir
;
402
403
#ifdef CAPABILITIES_SUPPORT
404
char
*permitted_hookfile[
MAXPERMITTEDHOOKFILES
+ 1];
405
int
permitted_hookfiles;
406
#endif
407
408
#ifdef UNSHARE_SUPPORT
409
# ifdef GETMNTENT_SUPPORT
410
char
*mountpoint[
MAXMOUNTPOINTS
+ 1];
411
int
mountpoints;
412
# endif
413
#endif
414
415
synchandler_args_t
synchandler_args
[
SHARGS_MAX
];
416
shflags_t
synchandler_argf
;
417
#endif
// ifndef LIBCLSYNC
418
void
*indexes_p;
419
void
*
fsmondata
;
420
};
421
typedef
struct
ctx
ctx_t
;
422
423
#endif
424
api_funct_init
int(* api_funct_init)(struct ctx *, struct indexes *)
Definition
clsync.h:51
api_funct_sync
int(* api_funct_sync)(int n, api_eventinfo_t *)
Definition
clsync.h:52
api_funct_rsync
int(* api_funct_rsync)(const char *inclist, const char *exclist)
Definition
clsync.h:53
api_funct_deinit
int(* api_funct_deinit)()
Definition
clsync.h:54
MAXARGUMENTS
#define MAXARGUMENTS
Definition
configuration.h:13
MAXSIGNALNUM
#define MAXSIGNALNUM
Definition
configuration.h:18
MAXMOUNTPOINTS
#define MAXMOUNTPOINTS
Definition
configuration.h:36
MAXRULES
#define MAXRULES
Definition
configuration.h:10
MAXCHILDREN
#define MAXCHILDREN
Definition
configuration.h:34
MAXPERMITTEDHOOKFILES
#define MAXPERMITTEDHOOKFILES
Definition
configuration.h:37
ruleactionsign_t
enum ruleactionsign_enum ruleactionsign_t
Definition
ctx.h:187
synchandler_args_t
struct synchandler_args synchandler_args_t
Definition
ctx.h:255
queue_id
queue_id
Definition
ctx.h:172
QUEUE_NORMAL
@ QUEUE_NORMAL
Definition
ctx.h:173
QUEUE_LOCKWAIT
@ QUEUE_LOCKWAIT
Definition
ctx.h:176
QUEUE_AUTO
@ QUEUE_AUTO
Definition
ctx.h:179
QUEUE_INSTANT
@ QUEUE_INSTANT
Definition
ctx.h:175
QUEUE_BIGFILE
@ QUEUE_BIGFILE
Definition
ctx.h:174
QUEUE_MAX
@ QUEUE_MAX
Definition
ctx.h:178
flags_enum
flags_enum
Definition
ctx.h:41
SOCKETAUTH
@ SOCKETAUTH
Definition
ctx.h:97
CLUSTERIFACE
@ CLUSTERIFACE
Definition
ctx.h:60
SYNCHANDLERARGS1
@ SYNCHANDLERARGS1
Definition
ctx.h:106
SECURESPLITTING
@ SECURESPLITTING
Definition
ctx.h:121
DEBUG
@ DEBUG
Definition
ctx.h:71
SYNCDELAY
@ SYNCDELAY
Definition
ctx.h:69
CLUSTERMCASTIPADDR
@ CLUSTERMCASTIPADDR
Definition
ctx.h:61
SYNCHANDLERUID
@ SYNCHANDLERUID
Definition
ctx.h:111
LABEL
@ LABEL
Definition
ctx.h:81
CLUSTERMCASTIPPORT
@ CLUSTERMCASTIPPORT
Definition
ctx.h:62
MOUNTPOINTS
@ MOUNTPOINTS
Definition
ctx.h:109
SOCKETOWN
@ SOCKETOWN
Definition
ctx.h:99
INITFULL
@ INITFULL
Definition
ctx.h:79
STANDBYFILE
@ STANDBYFILE
Definition
ctx.h:93
RSYNCPREFERINCLUDE
@ RSYNCPREFERINCLUDE
Definition
ctx.h:86
CLUSTERTIMEOUT
@ CLUSTERTIMEOUT
Definition
ctx.h:63
AUTORULESW
@ AUTORULESW
Definition
ctx.h:75
DELAY
@ DELAY
Definition
ctx.h:67
HAVERECURSIVESYNC
@ HAVERECURSIVESYNC
Definition
ctx.h:84
SYNCLISTSIMPLIFY
@ SYNCLISTSIMPLIFY
Definition
ctx.h:87
DONTUNLINK
@ DONTUNLINK
Definition
ctx.h:78
ONEFILESYSTEM
@ ONEFILESYSTEM
Definition
ctx.h:88
BFILEDELAY
@ BFILEDELAY
Definition
ctx.h:68
SYNCHANDLER
@ SYNCHANDLER
Definition
ctx.h:43
GID
@ GID
Definition
ctx.h:53
CLUSTERHDLMIN
@ CLUSTERHDLMIN
Definition
ctx.h:65
SOCKETPATH
@ SOCKETPATH
Definition
ctx.h:46
CANCEL_SYSCALLS
@ CANCEL_SYSCALLS
Definition
ctx.h:128
SYNCHANDLERARGS0
@ SYNCHANDLERARGS0
Definition
ctx.h:105
SYNCTIMEOUT
@ SYNCTIMEOUT
Definition
ctx.h:80
FORGET_PRIVTHREAD_INFO
@ FORGET_PRIVTHREAD_INFO
Definition
ctx.h:120
PERMIT_MPROTECT
@ PERMIT_MPROTECT
Definition
ctx.h:125
UID
@ UID
Definition
ctx.h:52
PRIVILEGEDUID
@ PRIVILEGEDUID
Definition
ctx.h:131
SOCKETMOD
@ SOCKETMOD
Definition
ctx.h:98
OUTPUT_METHOD
@ OUTPUT_METHOD
Definition
ctx.h:57
QUIET
@ QUIET
Definition
ctx.h:72
MAXITERATIONS
@ MAXITERATIONS
Definition
ctx.h:100
CUSTOMSIGNALS
@ CUSTOMSIGNALS
Definition
ctx.h:107
CLUSTERNODENAME
@ CLUSTERNODENAME
Definition
ctx.h:64
EXITONSYNCSKIP
@ EXITONSYNCSKIP
Definition
ctx.h:129
SKIPINITSYNC
@ SKIPINITSYNC
Definition
ctx.h:90
SECCOMP_FILTER
@ SECCOMP_FILTER
Definition
ctx.h:119
SHM_MPROTECT
@ SHM_MPROTECT
Definition
ctx.h:126
FORBIDDEVICES
@ FORBIDDEVICES
Definition
ctx.h:123
PRIVILEGEDGID
@ PRIVILEGEDGID
Definition
ctx.h:132
CONFIGBLOCK
@ CONFIGBLOCK
Definition
ctx.h:50
BFILETHRESHOLD
@ BFILETHRESHOLD
Definition
ctx.h:70
DETACH_NETWORK
@ DETACH_NETWORK
Definition
ctx.h:116
RETRIES
@ RETRIES
Definition
ctx.h:56
CHECK_EXECVP_ARGS
@ CHECK_EXECVP_ARGS
Definition
ctx.h:114
CG_GROUPNAME
@ CG_GROUPNAME
Definition
ctx.h:124
MODE
@ MODE
Definition
ctx.h:76
CLUSTERSDLMAX
@ CLUSTERSDLMAX
Definition
ctx.h:95
DETACH_MISCELLANEA
@ DETACH_MISCELLANEA
Definition
ctx.h:117
RULESFILE
@ RULESFILE
Definition
ctx.h:44
MONITOR
@ MONITOR
Definition
ctx.h:104
RSYNCINCLIMIT
@ RSYNCINCLIMIT
Definition
ctx.h:85
PIVOT_ROOT
@ PIVOT_ROOT
Definition
ctx.h:115
MODSIGN
@ MODSIGN
Definition
ctx.h:127
SHOW_VERSION
@ SHOW_VERSION
Definition
ctx.h:82
CLUSTERHDLMAX
@ CLUSTERHDLMAX
Definition
ctx.h:66
EXITHOOK
@ EXITHOOK
Definition
ctx.h:94
HELP
@ HELP
Definition
ctx.h:48
THREADING
@ THREADING
Definition
ctx.h:55
BACKGROUND
@ BACKGROUND
Definition
ctx.h:51
CAP_PRESERVE
@ CAP_PRESERVE
Definition
ctx.h:54
CAPS_INHERIT
@ CAPS_INHERIT
Definition
ctx.h:113
PIDFILE
@ PIDFILE
Definition
ctx.h:59
DESTDIR
@ DESTDIR
Definition
ctx.h:45
WATCHDIR
@ WATCHDIR
Definition
ctx.h:42
CHROOT
@ CHROOT
Definition
ctx.h:108
DETACH_IPC
@ DETACH_IPC
Definition
ctx.h:130
FTS_EXPERIMENTAL_OPTIMIZATION
@ FTS_EXPERIMENTAL_OPTIMIZATION
Definition
ctx.h:122
VERBOSE
@ VERBOSE
Definition
ctx.h:73
IGNOREFAILURES
@ IGNOREFAILURES
Definition
ctx.h:101
ONLYINITSYNC
@ ONLYINITSYNC
Definition
ctx.h:91
CONFIGBLOCKINHERITS
@ CONFIGBLOCKINHERITS
Definition
ctx.h:103
EXCLUDEMOUNTPOINTS
@ EXCLUDEMOUNTPOINTS
Definition
ctx.h:58
DUMPDIR
@ DUMPDIR
Definition
ctx.h:102
SYNCHANDLERGID
@ SYNCHANDLERGID
Definition
ctx.h:112
OUTLISTSDIR
@ OUTLISTSDIR
Definition
ctx.h:74
EXITONNOEVENTS
@ EXITONNOEVENTS
Definition
ctx.h:92
STATUSFILE
@ STATUSFILE
Definition
ctx.h:89
CONFIGFILE
@ CONFIGFILE
Definition
ctx.h:49
SPLITTING
@ SPLITTING
Definition
ctx.h:110
ADDPERMITTEDHOOKFILES
@ ADDPERMITTEDHOOKFILES
Definition
ctx.h:118
PREEXITHOOK
@ PREEXITHOOK
Definition
ctx.h:96
IGNOREEXITCODE
@ IGNOREEXITCODE
Definition
ctx.h:77
SOFTEXITSYNC
@ SOFTEXITSYNC
Definition
ctx.h:133
state_t
enum state_enum state_t
Definition
ctx.h:272
mode_id_t
enum mode_id mode_id_t
Definition
ctx.h:170
mode_id
mode_id
Definition
ctx.h:160
MODE_RSYNCSHELL
@ MODE_RSYNCSHELL
Definition
ctx.h:165
MODE_DIRECT
@ MODE_DIRECT
Definition
ctx.h:163
MODE_RSYNCSO
@ MODE_RSYNCSO
Definition
ctx.h:167
MODE_SIMPLE
@ MODE_SIMPLE
Definition
ctx.h:162
MODE_UNSET
@ MODE_UNSET
Definition
ctx.h:161
MODE_RSYNCDIRECT
@ MODE_RSYNCDIRECT
Definition
ctx.h:166
MODE_SO
@ MODE_SO
Definition
ctx.h:168
MODE_SHELL
@ MODE_SHELL
Definition
ctx.h:164
pivotroot_way_t
enum pivotroot_way pivotroot_way_t
Definition
ctx.h:150
detachnetwork_way_t
enum detachnetwork_way detachnetwork_way_t
Definition
ctx.h:142
flags_t
enum flags_enum flags_t
Definition
ctx.h:135
STATE_STARTING
#define STATE_STARTING(state_p)
Definition
ctx.h:257
shargsid
shargsid
Definition
ctx.h:244
SHARGS_PRIMARY
@ SHARGS_PRIMARY
Definition
ctx.h:245
SHARGS_INITIAL
@ SHARGS_INITIAL
Definition
ctx.h:246
SHARGS_MAX
@ SHARGS_MAX
Definition
ctx.h:247
ruleaction_t
enum ruleaction_enum ruleaction_t
Definition
ctx.h:196
status_descr
static char *const status_descr[]
Definition
ctx.h:274
syscall_bitmask
syscall_bitmask
Definition
ctx.h:308
CSC_MON_STAT
@ CSC_MON_STAT
Definition
ctx.h:310
CSC_RESET
@ CSC_RESET
Definition
ctx.h:309
shflags
shflags
Definition
ctx.h:235
SHFL_EXCLUDE_LIST_PATH
@ SHFL_EXCLUDE_LIST_PATH
Definition
ctx.h:240
SHFL_RSYNC_ARGS
@ SHFL_RSYNC_ARGS
Definition
ctx.h:237
SHFL_INCLUDE_LIST_PATH
@ SHFL_INCLUDE_LIST_PATH
Definition
ctx.h:239
SHFL_INCLUDE_LIST
@ SHFL_INCLUDE_LIST
Definition
ctx.h:238
SHFL_NONE
@ SHFL_NONE
Definition
ctx.h:236
capsinherit_t
enum capsinherit capsinherit_t
Definition
ctx.h:158
api_functs_t
struct api_functs api_functs_t
Definition
ctx.h:227
capsinherit
capsinherit
Definition
ctx.h:152
CI_CLSYNC
@ CI_CLSYNC
Definition
ctx.h:155
CI_DONTTOUCH
@ CI_DONTTOUCH
Definition
ctx.h:153
CI_EMPTY
@ CI_EMPTY
Definition
ctx.h:156
CI_PERMITTED
@ CI_PERMITTED
Definition
ctx.h:154
stat_fields
stat_fields
Definition
ctx.h:289
STAT_FIELD_RDEV
@ STAT_FIELD_RDEV
Definition
ctx.h:297
STAT_FIELD_ATIME
@ STAT_FIELD_ATIME
Definition
ctx.h:301
STAT_FIELD_INO
@ STAT_FIELD_INO
Definition
ctx.h:292
STAT_FIELD_CTIME
@ STAT_FIELD_CTIME
Definition
ctx.h:303
STAT_FIELD_BLOCKS
@ STAT_FIELD_BLOCKS
Definition
ctx.h:300
STAT_FIELD_NLINK
@ STAT_FIELD_NLINK
Definition
ctx.h:294
STAT_FIELD_RESET
@ STAT_FIELD_RESET
Definition
ctx.h:290
STAT_FIELD_SIZE
@ STAT_FIELD_SIZE
Definition
ctx.h:298
STAT_FIELD_MTIME
@ STAT_FIELD_MTIME
Definition
ctx.h:302
STAT_FIELD_GID
@ STAT_FIELD_GID
Definition
ctx.h:296
STAT_FIELD_UID
@ STAT_FIELD_UID
Definition
ctx.h:295
STAT_FIELD_MODE
@ STAT_FIELD_MODE
Definition
ctx.h:293
STAT_FIELD_DEV
@ STAT_FIELD_DEV
Definition
ctx.h:291
STAT_FIELD_BLKSIZE
@ STAT_FIELD_BLKSIZE
Definition
ctx.h:299
STAT_FIELD_ALL
@ STAT_FIELD_ALL
Definition
ctx.h:305
ruleaction_enum
ruleaction_enum
Definition
ctx.h:189
RA_MONITOR
@ RA_MONITOR
Definition
ctx.h:191
RA_SYNC
@ RA_SYNC
Definition
ctx.h:192
RA_NONE
@ RA_NONE
Definition
ctx.h:190
RA_ALL
@ RA_ALL
Definition
ctx.h:194
RA_WALK
@ RA_WALK
Definition
ctx.h:193
MAX_BLOCKTHREADS
#define MAX_BLOCKTHREADS
Definition
ctx.h:29
pivotroot_way
pivotroot_way
Definition
ctx.h:144
PW_AUTO
@ PW_AUTO
Definition
ctx.h:147
PW_OFF
@ PW_OFF
Definition
ctx.h:145
PW_AUTORO
@ PW_AUTORO
Definition
ctx.h:148
PW_DIRECT
@ PW_DIRECT
Definition
ctx.h:146
queue_id_t
enum queue_id queue_id_t
Definition
ctx.h:181
detachnetwork_way
detachnetwork_way
Definition
ctx.h:137
DN_NONPRIVILEGED
@ DN_NONPRIVILEGED
Definition
ctx.h:139
DN_EVERYWHERE
@ DN_EVERYWHERE
Definition
ctx.h:140
DN_OFF
@ DN_OFF
Definition
ctx.h:138
ctx_t
struct ctx ctx_t
Definition
ctx.h:421
rule_t
struct rule rule_t
Definition
ctx.h:213
shflags_t
enum shflags shflags_t
Definition
ctx.h:242
OPTION_FLAGS
#define OPTION_FLAGS
Definition
ctx.h:37
OPTION_LONGOPTONLY
#define OPTION_LONGOPTONLY
Definition
ctx.h:38
sigusr_enum
sigusr_enum
Definition
ctx.h:199
SIGUSR_BLOPINT
@ SIGUSR_BLOPINT
Definition
ctx.h:202
SIGUSR_INITSYNC
@ SIGUSR_INITSYNC
Definition
ctx.h:201
SIGUSR_THREAD_GC
@ SIGUSR_THREAD_GC
Definition
ctx.h:200
SIGUSR_DUMP
@ SIGUSR_DUMP
Definition
ctx.h:203
queueinfo_t
struct queueinfo queueinfo_t
Definition
ctx.h:219
state_enum
state_enum
Definition
ctx.h:258
STATE_EXIT
@ STATE_EXIT
Definition
ctx.h:259
STATE_TERM
@ STATE_TERM
Definition
ctx.h:266
STATE_UNKNOWN
@ STATE_UNKNOWN
Definition
ctx.h:270
STATE_SYNCHANDLER_ERR
@ STATE_SYNCHANDLER_ERR
Definition
ctx.h:262
STATE_HOLDON
@ STATE_HOLDON
Definition
ctx.h:269
STATE_REHASH
@ STATE_REHASH
Definition
ctx.h:263
STATE_THREAD_GC
@ STATE_THREAD_GC
Definition
ctx.h:267
STATE_INITSYNC
@ STATE_INITSYNC
Definition
ctx.h:268
STATE_PREEXIT
@ STATE_PREEXIT
Definition
ctx.h:264
STATE_RUNNING
@ STATE_RUNNING
Definition
ctx.h:261
STATE_LASTSYNC
@ STATE_LASTSYNC
Definition
ctx.h:265
ruleactionsign_enum
ruleactionsign_enum
Definition
ctx.h:183
RS_PERMIT
@ RS_PERMIT
Definition
ctx.h:185
RS_REJECT
@ RS_REJECT
Definition
ctx.h:184
ctx_p
ctx_t * ctx_p
Definition
mon_kqueue.c:85
api_functs
Definition
ctx.h:221
api_functs::sync
api_funct_sync sync
Definition
ctx.h:223
api_functs::init
api_funct_init init
Definition
ctx.h:222
api_functs::rsync
api_funct_rsync rsync
Definition
ctx.h:224
api_functs::deinit
api_funct_deinit deinit
Definition
ctx.h:225
ctx
Definition
ctx.h:315
ctx::listoutdir
char * listoutdir
Definition
ctx.h:387
ctx::destdirwslashsize
size_t destdirwslashsize
Definition
ctx.h:380
ctx::pid_str_len
size_t pid_str_len
Definition
ctx.h:320
ctx::flags_set
int flags_set[(1<< 10)]
Definition
ctx.h:339
ctx::statusfile
char * statusfile
Definition
ctx.h:354
ctx::syncdelay
unsigned int syncdelay
Definition
ctx.h:391
ctx::handlerfpath
char * handlerfpath
Definition
ctx.h:382
ctx::destdirsize
size_t destdirsize
Definition
ctx.h:378
ctx::flags_values_raw
char * flags_values_raw[(1<< 10)]
Definition
ctx.h:337
ctx::watchdirsize
size_t watchdirsize
Definition
ctx.h:377
ctx::rulfpathsize
size_t rulfpathsize
Definition
ctx.h:386
ctx::child_pid
pid_t child_pid[MAXCHILDREN]
Definition
ctx.h:330
ctx::socket
int socket
Definition
ctx.h:360
ctx::retries
int retries
Definition
ctx.h:389
ctx::preexithookfile
char * preexithookfile
Definition
ctx.h:349
ctx::fsmondata
void * fsmondata
Definition
ctx.h:419
ctx::children
int children
Definition
ctx.h:331
ctx::watchdirwslash
char * watchdirwslash
Definition
ctx.h:352
ctx::destdir
char * destdir
Definition
ctx.h:350
ctx::blockthread
pthread_t blockthread[(1<< 4)]
Definition
ctx.h:398
ctx::handler_handle
void * handler_handle
Definition
ctx.h:383
ctx::pidfile
char * pidfile
Definition
ctx.h:346
ctx::synchandler_argf
shflags_t synchandler_argf
Definition
ctx.h:416
ctx::watchdir_dirlevel
short int watchdir_dirlevel
Definition
ctx.h:381
ctx::bfilethreshold
size_t bfilethreshold
Definition
ctx.h:390
ctx::exithookfile
char * exithookfile
Definition
ctx.h:348
ctx::socketmod
mode_t socketmod
Definition
ctx.h:361
ctx::destdirwslash
char * destdirwslash
Definition
ctx.h:353
ctx::socketuid
uid_t socketuid
Definition
ctx.h:362
ctx::synchandler_gid
gid_t synchandler_gid
Definition
ctx.h:326
ctx::chroot_dir
char * chroot_dir
Definition
ctx.h:401
ctx::pid
pid_t pid
Definition
ctx.h:318
ctx::config_block
const char * config_block
Definition
ctx.h:342
ctx::socketpath
char * socketpath
Definition
ctx.h:355
ctx::label
char * label
Definition
ctx.h:344
ctx::watchdir
char * watchdir
Definition
ctx.h:345
ctx::handler_funct
api_functs_t handler_funct
Definition
ctx.h:384
ctx::uid
uid_t uid
Definition
ctx.h:321
ctx::config_path
char * config_path
Definition
ctx.h:341
ctx::st_dev
dev_t st_dev
Definition
ctx.h:335
ctx::synctimeout
unsigned int synctimeout
Definition
ctx.h:395
ctx::socketgid
gid_t socketgid
Definition
ctx.h:363
ctx::_queues
queueinfo_t _queues[QUEUE_MAX]
Definition
ctx.h:392
ctx::state
volatile state_t state
Definition
ctx.h:317
ctx::sigset
sigset_t * sigset
Definition
ctx.h:396
ctx::blockthread_count
size_t blockthread_count
Definition
ctx.h:399
ctx::pid_str
char pid_str[65]
Definition
ctx.h:319
ctx::watchdirwslashsize
size_t watchdirwslashsize
Definition
ctx.h:379
ctx::synchandler_uid
uid_t synchandler_uid
Definition
ctx.h:325
ctx::dump_path
char * dump_path
Definition
ctx.h:356
ctx::standbyfile
char * standbyfile
Definition
ctx.h:347
ctx::notifyenginefunct
struct notifyenginefuncts notifyenginefunct
Definition
ctx.h:388
ctx::flags
int flags[(1<< 10)]
Definition
ctx.h:338
ctx::synctime
time_t synctime
Definition
ctx.h:394
ctx::rules_count
size_t rules_count
Definition
ctx.h:334
ctx::rsyncinclimit
unsigned int rsyncinclimit
Definition
ctx.h:393
ctx::watchdirlen
size_t watchdirlen
Definition
ctx.h:375
ctx::privileged_gid
gid_t privileged_gid
Definition
ctx.h:324
ctx::iteration_num
uint32_t iteration_num
Definition
ctx.h:332
ctx::rulfpath
char * rulfpath
Definition
ctx.h:385
ctx::customsignal
char * customsignal[MAXSIGNALNUM+1]
Definition
ctx.h:343
ctx::destdirlen
size_t destdirlen
Definition
ctx.h:376
ctx::synchandler_args
synchandler_args_t synchandler_args[SHARGS_MAX]
Definition
ctx.h:415
ctx::rules
rule_t rules[MAXRULES]
Definition
ctx.h:333
ctx::destproto
char * destproto
Definition
ctx.h:351
ctx::privileged_uid
uid_t privileged_uid
Definition
ctx.h:323
ctx::gid
gid_t gid
Definition
ctx.h:322
ctx::isignoredexitcode
char isignoredexitcode[(1<< 8)]
Definition
ctx.h:397
indexes
Definition
indexes.h:34
notifyenginefuncts
Definition
ctx.h:229
notifyenginefuncts::add_watch_dir
int(* add_watch_dir)(struct ctx *ctx_p, struct indexes *indexes_p, const char *const accpath)
Definition
ctx.h:232
notifyenginefuncts::handle
int(* handle)(struct ctx *ctx_p, struct indexes *indexes_p)
Definition
ctx.h:231
notifyenginefuncts::wait
int(* wait)(struct ctx *ctx_p, struct indexes *indexes_p, struct timeval *tv_p)
Definition
ctx.h:230
queueinfo
Definition
ctx.h:215
queueinfo::collectdelay
unsigned int collectdelay
Definition
ctx.h:216
queueinfo::stime
time_t stime
Definition
ctx.h:217
rule
Definition
ctx.h:206
rule::perm
ruleaction_t perm
Definition
ctx.h:210
rule::objtype
mode_t objtype
Definition
ctx.h:209
rule::mask
ruleaction_t mask
Definition
ctx.h:211
rule::expr
regex_t expr
Definition
ctx.h:208
rule::num
int num
Definition
ctx.h:207
synchandler_args
Definition
ctx.h:250
synchandler_args::isexpanded
char isexpanded[MAXARGUMENTS]
Definition
ctx.h:253
synchandler_args::c
int c
Definition
ctx.h:252
synchandler_args::v
char * v[MAXARGUMENTS]
Definition
ctx.h:251
Generated on
for clsync by
1.17.0