From 432709027680d7791b325b2c2116c658eba21c8d Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 12 Mar 2000 22:44:54 +0000 Subject: Made `show status' show uptime and time of last reconfiguration. --- conf/conf.c | 5 +++++ conf/conf.h | 3 +++ 2 files changed, 8 insertions(+) (limited to 'conf') diff --git a/conf/conf.c b/conf/conf.c index 21413e5..a4e0363 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -18,6 +18,7 @@ #include "lib/resource.h" #include "lib/string.h" #include "lib/event.h" +#include "lib/timer.h" #include "conf/conf.h" #include "filter/filter.h" @@ -26,6 +27,7 @@ static jmp_buf conf_jmpbuf; 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) @@ -37,6 +39,9 @@ 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; } diff --git a/conf/conf.h b/conf/conf.h index 78ab04a..5abca7d 100644 --- a/conf/conf.h +++ b/conf/conf.h @@ -10,6 +10,7 @@ #define _BIRD_CONF_H_ #include "lib/resource.h" +#include "lib/timer.h" /* Configuration structure */ @@ -29,6 +30,7 @@ struct config { 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. */ @@ -38,6 +40,7 @@ extern struct config *old_config; /* Old configuration when reconfiguration is i 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 *); -- cgit v1.2.3