#include "lib/resource.h"
#include "lib/string.h"
#include "lib/event.h"
-#include "sysdep/unix/timer.h"
+#include "lib/timer.h"
#include "conf/conf.h"
#include "filter/filter.h"
memcpy(ndup, name, nlen);
init_list(&c->tests);
+ init_list(&c->symbols);
c->mrtdump_file = -1; /* Hack, this should be sysdep-specific */
c->pool = p;
c->mem = l;
{
DBG("+++ deleting obstacle %d\n", c->obstacle_count);
c->obstacle_count--;
- if (!c->obstacle_count)
+ if (!c->obstacle_count && (c != config))
ev_schedule(config_event);
}
if (!old)
return 0;
- if (!ipa_equal(old->listen_bgp_addr, new->listen_bgp_addr) ||
- (old->listen_bgp_port != new->listen_bgp_port) ||
- (old->listen_bgp_flags != new->listen_bgp_flags))
- log(L_WARN "Reconfiguration of BGP listening socket not implemented, please restart BIRD.");
-
if (!new->router_id)
{
new->router_id = old->router_id;
if (old_config)
old_config->obstacle_count++;
+ DBG("filter_commit\n");
+ filter_commit(c, old_config);
DBG("sysdep_commit\n");
int force_restart = sysdep_commit(c, old_config);
DBG("global_commit\n");
undo_available = 1;
if (timeout)
- tm2_start(config_timer, timeout S);
+ tm_start(config_timer, timeout S);
else
- tm2_stop(config_timer);
+ tm_stop(config_timer);
if (configuring)
{
return CONF_PROGRESS;
}
+int
+config_status(void)
+{
+ if (shutting_down)
+ return CONF_SHUTDOWN;
+
+ if (configuring)
+ return future_cftype ? CONF_QUEUED : CONF_PROGRESS;
+
+ return CONF_DONE;
+}
+
+btime
+config_timer_status(void)
+{
+ return tm_active(config_timer) ? tm_remains(config_timer) : -1;
+}
+
extern void cmd_reconfig_undo_notify(void);
static void
* for switching to an empty configuration.
*/
void
-order_shutdown(void)
+order_shutdown(int gr)
{
struct config *c;
if (shutting_down)
return;
- log(L_INFO "Shutting down");
+ if (!gr)
+ log(L_INFO "Shutting down");
+ else
+ log(L_INFO "Shutting down for graceful restart");
+
c = lp_alloc(config->mem, sizeof(struct config));
memcpy(c, config, sizeof(struct config));
init_list(&c->protos);
init_list(&c->tables);
c->shutdown = 1;
+ c->gr_down = gr;
config_commit(c, RECONFIG_HARD, 0);
shutting_down = 1;
va_end(args);
new_config->err_msg = cfg_strdup(buf);
new_config->err_lino = ifs->lino;
+ new_config->err_chno = ifs->chno - ifs->toklen + 1;
new_config->err_file_name = ifs->file_name;
cf_lex_unwind();
longjmp(conf_jmpbuf, 1);