if (rpki_config.slurm != NULL && !valid_file_or_dir(rpki_config.slurm))
return pr_err("Invalid slurm location.");
+ /* FIXME (later) Remove when sync-strategy is fully deprecated */
+ if (!rpki_config.rsync.enabled)
+ config_set_sync_strategy(RSYNC_OFF);
+
return 0;
}
rpki_config.rrdp.enabled = value;
}
+void
+config_set_sync_strategy(enum rsync_strategy value)
+{
+ rpki_config.sync_strategy = value;
+}
+
+void
+config_set_rsync_strategy(enum rsync_strategy value)
+{
+ rpki_config.rsync.strategy = value;
+}
+
void
free_rpki_config(void)
{
void config_set_rsync_enabled(bool);
void config_set_rrdp_enabled(bool);
+/* FIXME (later) Remove when sync-strategy is fully deprecated */
+void config_set_sync_strategy(enum rsync_strategy);
+void config_set_rsync_strategy(enum rsync_strategy);
+
/* Needed public by the JSON module */
void *get_rpki_config_field(struct option_field const *);
struct option_field const *get_option_metadatas(void);
#include <stdlib.h>
#include <string.h>
+#include "config.h"
#include "log.h"
#include "config/str.h"
return pr_err("Unknown rsync synchronization strategy: '%s'",
str);
+ /* FIXME (later) Remove when sync-strategy is fully deprecated */
+ config_set_sync_strategy(DEREFERENCE(result));
+
return 0;
}
parse_argv_sync_strategy(struct option_field const *field, char const *str,
void *result)
{
+ int error;
+
pr_warn("'sync-strategy' will be deprecated.");
pr_warn("Use 'rsync.strategy' instead; or 'rsync.enabled=false' if you wish to use 'off' strategy.");
return 0;
}
- return parse_argv_rsync_strategy(field, str, result);
+ error = parse_argv_rsync_strategy(field, str, result);
+ if (!error)
+ config_set_rsync_strategy(DEREFERENCE(result));
+ return error;
}
static int