|
clsync
|
#include "common.h"#include <pwd.h>#include <grp.h>#include <glib.h>#include "error.h"#include "stringex.h"#include "sync.h"#include "malloc.h"#include "cluster.h"#include "fileutils.h"#include "socket.h"#include "syscalls.h"#include "rules.h"#include "posix-hacks.h"
Go to the source code of this file.
Macros | |
| #define | PEF_NONE 0 |
| #define | PEF_UNEXPECTED_END 1 |
| #define | PEF_UNSET_VARIABLE 2 |
| #define | PEF_LAZY_SUBSTITUTION 4 |
| #define | UGID_PRESERVE (1<<16) |
Enumerations | |
| enum | xstatfield { X_STAT_FIELD_RESET = 0 , X_STAT_FIELD_DEV , X_STAT_FIELD_INO , X_STAT_FIELD_MODE , X_STAT_FIELD_NLINK , X_STAT_FIELD_UID , X_STAT_FIELD_GID , X_STAT_FIELD_RDEV , X_STAT_FIELD_SIZE , X_STAT_FIELD_BLKSIZE , X_STAT_FIELD_BLOCKS , X_STAT_FIELD_ATIME , X_STAT_FIELD_MTIME , X_STAT_FIELD_CTIME , X_STAT_FIELD_ALL } |
| enum | x_csc_bm { X_CSC_RESET = 0 , X_CSC_MON_STAT } |
Functions | |
| int | syntax () |
| pid_t | waitpid_timed (pid_t child_pid, int *status_p, long sec, long nsec) |
| int | parent_isalive () |
| void | child_sigchld () |
| int | sethandler_sigchld (void(*handler)()) |
| void * | watchforparent (void *parent_pid_p) |
| pid_t | fork_helper () |
| int | version () |
| int | clsyncapi_getapiversion () |
| Returns currect API version. | |
| const char * | parameter_get (const char *variable_name, void *_ctx_p) |
| Gets raw (string) an option value by an option name. | |
| const char * | parameter_get_name_by_id (const uint16_t param_id) |
| Gets the name of the parameter by it's id. | |
| const char * | parameter_get_wmacro (const char *variable_name, void *_ctx_p) |
| Gets raw (string) an option value by an option name and updates ctx_p->synchandler_argf. | |
| char * | parameter_expand (ctx_t *ctx_p, char *arg, int exceptionflags, int *macro_count_p, int *expand_count_p, const char *(*parameter_get)(const char *variable_name, void *arg), void *parameter_get_arg) |
| Expands option values, e. g. "/var/log/clsync-%label%.pid" -> "/var/log/clsync-clone.pid". | |
| const char * | parametersource_get_name (paramsource_t paramsource) |
| Gets the name of the parameter source by it's id. | |
| static int | synchandler_arg (char *arg, size_t arg_len, void *_ctx_p, enum shargsid shargsid) |
| static int | synchandler_arg0 (char *arg, size_t arg_len, void *_ctx_p) |
| static int | synchandler_arg1 (char *arg, size_t arg_len, void *_ctx_p) |
| static long | xstrtol (const char *str, int *err) |
| static long | xstrtol_trim (char *str, int *err) |
| static __extension__ int | parse_customsignals (ctx_t *ctx_p, char *arg) |
| static __extension__ int | parse_parameter (ctx_t *ctx_p, uint16_t param_id, char *arg, paramsource_t paramsource) |
| int | arguments_parse (int argc, char *argv[], struct ctx *ctx_p) |
| void | gkf_parse (ctx_t *ctx_p, GKeyFile *gkf, paramsource_t paramsource) |
| int | configs_parse (ctx_t *ctx_p, paramsource_t paramsource) |
| int | ctx_check (ctx_t *ctx_p) |
| int | config_block_parse (ctx_t *ctx_p, const char *const config_block_name) |
| int | ctx_set (ctx_t *ctx_p, const char *const parameter_name, const char *const parameter_value) |
| void | ctx_cleanup (ctx_t *ctx_p) |
| int | becomedaemon () |
| int | main_cleanup (ctx_t *ctx_p) |
| int | main_rehash (ctx_t *ctx_p) |
| int | main_status_update (ctx_t *ctx_p) |
| int | main (int _argc, char *_argv[]) |
Variables | |
| static const struct option | long_options [] |
| uint32_t | xstatfield_to_statfield [] |
| static char *const | stat_fields [] |
| uint32_t | xcsc_to_csc [] |
| static char *const | syscalls_bitmask [] |
| static char *const | socketauth [] |
| static char *const | notify_engines [] |
| static char *const | output_methods [] |
| static char *const | modes [] |
| int | ncpus |
| pid_t | parent_pid = 0 |
| pthread_t | pthread_watchforparent |
| FILE * | main_statusfile_f |
| int | argc |
| char ** | argv |
| enum xstatfield |
| int arguments_parse | ( | int | argc, |
| char * | argv[], | ||
| struct ctx * | ctx_p ) |
| int becomedaemon | ( | ) |
| void child_sigchld | ( | ) |
| int clsyncapi_getapiversion | ( | ) |
| int config_block_parse | ( | ctx_t * | ctx_p, |
| const char *const | config_block_name ) |
| int configs_parse | ( | ctx_t * | ctx_p, |
| paramsource_t | paramsource ) |
| int ctx_check | ( | ctx_t * | ctx_p | ) |
| void ctx_cleanup | ( | ctx_t * | ctx_p | ) |
| int ctx_set | ( | ctx_t * | ctx_p, |
| const char *const | parameter_name, | ||
| const char *const | parameter_value ) |
| pid_t fork_helper | ( | ) |
| void gkf_parse | ( | ctx_t * | ctx_p, |
| GKeyFile * | gkf, | ||
| paramsource_t | paramsource ) |
| int main | ( | int | _argc, |
| char * | _argv[] ) |
| int main_cleanup | ( | ctx_t * | ctx_p | ) |
| int main_rehash | ( | ctx_t * | ctx_p | ) |
| int main_status_update | ( | ctx_t * | ctx_p | ) |
| char * parameter_expand | ( | ctx_t * | ctx_p, |
| char * | arg, | ||
| int | exceptionflags, | ||
| int * | macro_count_p, | ||
| int * | expand_count_p, | ||
| const char *(* | parameter_get )(const char *variable_name, void *arg), | ||
| void * | parameter_get_arg ) |
Expands option values, e. g. "/var/log/clsync-%label%.pid" -> "/var/log/clsync-clone.pid".
| [in] | ctx_p | Context |
| [in] | arg | An allocated string with unexpanded value. Will be free'd |
| [in] | exceptionflags | A bit field of allowed exceptions during parameter expansion:
|
| [out] | macro_count_p | A pointer to count of found macro-s |
| [out] | expand_count_p | A pointer to count of expanded macro-s |
| [in] | parameter_get | A function to resolve macro-s |
| [in] | parameter_get_arg | An argument to the function |
| char | * Pointer to newly allocated string, if successful |
| NULL | On error |
Definition at line 693 of file main.c.


| const char * parameter_get | ( | const char * | variable_name, |
| void * | _ctx_p ) |
| const char * parameter_get_name_by_id | ( | const uint16_t | param_id | ) |
| const char * parameter_get_wmacro | ( | const char * | variable_name, |
| void * | _ctx_p ) |
Gets raw (string) an option value by an option name and updates ctx_p->synchandler_argf.
| [in] | _ctx_p | Context |
| [in] | variable_name | The name of the option |
| char | * Pointer to newly allocated string, if successful |
| NULL | On error |
Definition at line 634 of file main.c.


| const char * parametersource_get_name | ( | paramsource_t | paramsource | ) |
|
inlinestatic |
|
static |
| int sethandler_sigchld | ( | void(* | handler )() | ) |
|
inlinestatic |
|
static |
|
static |
| pid_t waitpid_timed | ( | pid_t | child_pid, |
| int * | status_p, | ||
| long | sec, | ||
| long | nsec ) |
| void * watchforparent | ( | void * | parent_pid_p | ) |
|
inlinestatic |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| uint32_t xcsc_to_csc[] |
| uint32_t xstatfield_to_statfield[] |