/* This file is part of NSsync Copyright (C) 2011 Sergey Poznyakoff NSsync is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. NSsync is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with NSsync. If not, see . */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include extern int lint_mode; extern int dry_run_mode; extern int preprocess_only; extern int debug_level; extern char *config_file; extern char *slave_status_file; extern char *pidfile; extern char *tempdir; extern char *compare_command; extern char *reload_command; extern unsigned changed_zones; extern char *sql_config_file; extern char *sql_config_group; extern char *database_name; extern char *sql_host; extern char *sql_socket; extern char *sql_user; extern char *sql_password; extern char *sql_cacert; extern int sql_port; extern char *named_conf_file; extern struct grecs_list *bind_include_path; extern char *zone_file_pattern; extern char *zone_conf_file; extern char *bind_working_dir; extern struct grecs_list *synclist; extern unsigned error_count; extern unsigned changed_zones; extern int debug_level; #define debug(n,s) \ do { \ if ((n) <= debug_level) \ debug_printf s; \ } while (0) #ifndef __PRINTFLIKE # define __PRINTFLIKE(fmt,narg) __attribute__ ((__format__ (__printf__, fmt, narg))) #endif void config_init(void); void config_parse(void); void config_help(void); void verror(const char *fmt, va_list ap); void error(const char *fmt, ...) __PRINTFLIKE(1,2); void debug_printf(const char *fmt, ...) __PRINTFLIKE(1,2); void sql_connect(void); void sql_disconnect(void); int sql_do_query(const char *query, int (*fun)(MYSQL_ROW, unsigned, void*), void *data); int sql_get_slave_status(char **pfile, char **poff); struct nssync { char *tag; char *zone_conf_file; char *zone_file_pattern; struct grecs_node *zone_tree; char *soa_query; char *rr_query; char *rev_rr_query; char *ns_query; char *file_name; char *temp_file_name; FILE *fp; }; void format_zones(struct nssync *); void source_named_conf(void); char *bindcf_lookup(struct nssync *sp, const char *zone); void flush_zone_list(struct nssync *sp); int compare(const char *oldfile, const char *newfile); int move_file(const char *file, const char *dst_file);