return 0;
}
-/** Try assigning <b>list</b> to <b>options</b>. You do this by duping
+/** Try assigning <b>list</b> to the global options. You do this by duping
* options, assigning list to the new one, then validating it. If it's
* ok, then through out the old one and stick with the new one. Else,
* revert to old and return failure. Return 0 on success, -1 on bad
* keys, -2 on bad values, -3 on bad transition.
*/
int
-config_trial_assign(or_options_t *options, struct config_line_t *list, int reset)
+config_trial_assign(struct config_line_t *list, int reset)
{
int r;
- or_options_t *trial_options = options_dup(options);
+ or_options_t *trial_options = options_dup(get_options());
if ((r=config_assign(trial_options, list, reset)) < 0) {
options_free(trial_options);
return -2;
}
- if (options_transition_allowed(options, trial_options) < 0) {
+ if (options_transition_allowed(get_options(), trial_options) < 0) {
options_free(trial_options);
return -3;
}
return 0;
}
- if ((r=config_trial_assign(get_options(), lines, 1)) < 0) {
+ if ((r=config_trial_assign(lines, 1)) < 0) {
log_fn(LOG_WARN,"Controller gave us config lines that didn't validate.");
if (r==-1) {
send_control_error(conn, ERR_UNRECOGNIZED_CONFIG_KEY,
int config_get_lines(char *string, struct config_line_t **result);
void config_free_lines(struct config_line_t *front);
-int config_trial_assign(or_options_t *options, struct config_line_t *list, int reset);
+int config_trial_assign(struct config_line_t *list, int reset);
int resolve_my_address(const char *address, uint32_t *addr);
void options_init(or_options_t *options);
int init_from_config(int argc, char **argv);