aboutsummaryrefslogtreecommitdiff
path: root/src/nssync.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-05-18 22:49:09 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-05-19 00:43:17 +0300
commit3bf6241deeaebd9b5dc16a26b214559d3d45838b (patch)
tree48c3c455aa1b42241bc6276db12d4c2d50f37e0a /src/nssync.h
parent22fc942b1a19b93ee15dc79fc9d0b6d1d74f62e6 (diff)
downloadnssync-3bf6241deeaebd9b5dc16a26b214559d3d45838b.tar.gz
nssync-3bf6241deeaebd9b5dc16a26b214559d3d45838b.tar.bz2
Create individual zone files.
* src/Makefile.am (EXTRA_DIST): Add cmdline.opt. * src/bindcf.c (bind_zonefile_dir) (zone_file_pattern): New variables. (source_named_conf): More checks. (bindcf_lookup): Rewrite. (flush_zone_list): New function. * cmdline.opt: New option: --force. * src/config.c (sync_kw)<path>: Remove keyword. All uses changed. <zone-conf>: New keyword. (nssync_kw) <slave-status-file> <zonefile-dir,zonefile-pattern> <reload-command>: New keyword. * src/nssync.c (copy_file): Increase changed_zones. Return immediately if in dry-run mode. (compare): Change signature. (synchronize): Rewrite. (check_slave_status): New function. (main): Check slave status. Update all changed zones. Reload bind, if needed. * src/nssync.h (slave_status_file) (reload_command, changed_zones): New externs (sql_get_slave_status): New proto. (nssync) <kwpath>: Remove. <zone_conf_file,zone_tree>: New members. (bindcf_lookup): Change signature. (flush_zone_list, compare): New protos. * src/output.c: Change logic to produce a single file per zone. * src/sqlop.c (sql_get_slave_status): New function. * configure.ac: Switch from foreign to gnu. * AUTHORS: New file. * COPYING: New file. * NEWS: New file. * README: New file.
Diffstat (limited to 'src/nssync.h')
-rw-r--r--src/nssync.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/nssync.h b/src/nssync.h
index 3541250..bb15d82 100644
--- a/src/nssync.h
+++ b/src/nssync.h
@@ -32,8 +32,12 @@ extern int dry_run_mode;
extern int preprocess_only;
extern int debug_level;
extern char *config_file;
+extern char *slave_status_file;
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;
@@ -47,9 +51,14 @@ extern int sql_port;
extern char *named_conf_file;
extern struct grecs_list *bind_include_path;
+extern char *bind_zonefile_dir;
+extern char *zone_file_pattern;
extern struct grecs_list *synclist;
+extern unsigned error_count;
+extern unsigned changed_zones;
+
extern int debug_level;
#define debug(n,s) \
@@ -74,16 +83,19 @@ 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 *kwpath;
+ char *zone_conf_file;
+ struct grecs_node *zone_tree;
+
char *soa_query;
char *rr_query;
char *rev_rr_query;
char *ns_query;
- const char *file_name;
+ char *file_name;
char *temp_file_name;
FILE *fp;
};
@@ -91,7 +103,9 @@ struct nssync {
void format_zones(struct nssync *);
void source_named_conf(void);
-const char *bindcf_lookup(struct nssync *sp);
+char *bindcf_lookup(struct nssync *sp, const char *zone);
+void flush_zone_list(struct nssync *sp);
+int compare(const char *oldfile, const char *newfile);

Return to:

Send suggestions and report system problems to the System administrator.