From c37e78510f2ac4d9bb4c44eddf33352eda72fd0f Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Wed, 3 Feb 2010 00:19:24 +0100 Subject: Makes date/time formats configurable. --- nest/cmds.c | 6 +++--- nest/proto.c | 10 +++++----- nest/rt-table.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'nest') diff --git a/nest/cmds.c b/nest/cmds.c index faed870..16fbba6 100644 --- a/nest/cmds.c +++ b/nest/cmds.c @@ -18,12 +18,12 @@ cmd_show_status(void) byte tim[TM_DATETIME_BUFFER_SIZE]; cli_msg(-1000, "BIRD " BIRD_VERSION); - tm_format_datetime(tim, now); + tm_format_datetime(tim, &config->tf_base, now); cli_msg(-1011, "Router ID is %R", config->router_id); cli_msg(-1011, "Current server time is %s", tim); - tm_format_datetime(tim, boot_time); + tm_format_datetime(tim, &config->tf_base, boot_time); cli_msg(-1011, "Last reboot on %s", tim); - tm_format_datetime(tim, config->load_time); + tm_format_datetime(tim, &config->tf_base, config->load_time); cli_msg(-1011, "Last reconfiguration on %s", tim); if (shutting_down) cli_msg(13, "Shutdown in progress"); diff --git a/nest/proto.c b/nest/proto.c index 9f0311f..297c05e 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -730,18 +730,18 @@ proto_state_name(struct proto *p) static void proto_do_show(struct proto *p, int verbose) { - byte buf[256], reltime[TM_RELTIME_BUFFER_SIZE]; + byte buf[256], tbuf[TM_DATETIME_BUFFER_SIZE]; buf[0] = 0; if (p->proto->get_status) p->proto->get_status(p, buf); - tm_format_reltime(reltime, p->last_state_change); - cli_msg(-1002, "%-8s %-8s %-8s %-5s %-5s %s", + tm_format_datetime(tbuf, &config->tf_proto, p->last_state_change); + cli_msg(-1002, "%-8s %-8s %-8s %-5s %-10s %s", p->name, p->proto->name, p->table->name, proto_state_name(p), - reltime, + tbuf, buf); if (verbose) { @@ -782,7 +782,7 @@ proto_show(struct symbol *s, int verbose) cli_msg(9002, "%s is not a protocol", s->name); return; } - cli_msg(-2002, "name proto table state since info"); + cli_msg(-2002, "name proto table state since info"); if (s) proto_do_show(((struct proto_config *)s->def)->proto, verbose); else diff --git a/nest/rt-table.c b/nest/rt-table.c index df2834a..ed7ecd5 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -1114,11 +1114,11 @@ static void rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tmpa) { byte via[STD_ADDRESS_P_LENGTH+32], from[STD_ADDRESS_P_LENGTH+6]; - byte tm[TM_RELTIME_BUFFER_SIZE], info[256]; + byte tm[TM_DATETIME_BUFFER_SIZE], info[256]; rta *a = e->attrs; rt_format_via(e, via); - tm_format_reltime(tm, e->lastmod); + tm_format_datetime(tm, &config->tf_route, e->lastmod); if (ipa_nonzero(a->from) && !ipa_equal(a->from, a->gw)) bsprintf(from, " from %I", a->from); else -- cgit v1.2.3