#include "lib/resource.h"
#include "lib/string.h"
#include "lib/event.h"
+#include "lib/timer.h"
#include "conf/conf.h"
#include "filter/filter.h"
struct config *config, *new_config, *old_config, *future_config;
static event *config_event;
int shutting_down;
+bird_clock_t boot_time;
struct config *
config_alloc(byte *name)
c->pool = p;
cfg_mem = c->mem = l;
c->file_name = cfg_strdup(name);
+ c->load_time = now;
+ if (!boot_time)
+ boot_time = now;
return c;
}
#define _BIRD_CONF_H_
#include "lib/resource.h"
+#include "lib/timer.h"
/* Configuration structure */
struct symbol **sym_fallback; /* Lexer: fallback symbol hash table */
int obstacle_count; /* Number of items blocking freeing of this config */
int shutdown; /* This is a pseudo-config for daemon shutdown */
+ bird_clock_t load_time; /* When we've got this configuration */
};
/* Please don't use these variables in protocols. Use proto_config->global instead. */
extern struct config *future_config; /* New config held here if recon requested during recon */
extern int shutting_down;
+extern bird_clock_t boot_time;
struct config *config_alloc(byte *name);
int config_parse(struct config *);
void
cmd_show_status(void)
{
- cli_msg(1000, "BIRD " BIRD_VERSION);
- /* FIXME: Should include uptime, shutdown flag et cetera */
+ byte tim[TM_DATETIME_BUFFER_SIZE];
+
+ cli_msg(-1000, "BIRD " BIRD_VERSION);
+ tm_format_datetime(tim, now);
+ cli_msg(-1011, "Current server time is %s", tim);
+ tm_format_datetime(tim, boot_time);
+ cli_msg(-1011, "Last reboot on %s", tim);
+ tm_format_datetime(tim, config->load_time);
+ cli_msg(-1011, "Last reconfiguration on %s", tim);
+ if (shutting_down)
+ cli_msg(13, "Shutdown in progress");
+ else if (old_config)
+ cli_msg(13, "Reconfiguration in progress");
+ else
+ cli_msg(13, "Daemon is up and running");
}
void