Statistics
| Branch: | Revision:

iof-bird-daemon / nest / cmds.c @ fbde6c39

History | View | Annotate | Download (1.15 KB)

1 4b87e256 Martin Mares
/*
2
 *        BIRD Internet Routing Daemon -- CLI Commands Which Don't Fit Anywhere Else
3
 *
4
 *        (c) 2000 Martin Mares <mj@ucw.cz>
5
 *
6
 *        Can be freely distributed and used under the terms of the GNU GPL.
7
 */
8
9
#include "nest/bird.h"
10
#include "nest/cli.h"
11
#include "conf/conf.h"
12
#include "nest/cmds.h"
13
#include "lib/string.h"
14
15
void
16
cmd_show_status(void)
17
{
18 43270902 Martin Mares
  byte tim[TM_DATETIME_BUFFER_SIZE];
19
20
  cli_msg(-1000, "BIRD " BIRD_VERSION);
21
  tm_format_datetime(tim, now);
22
  cli_msg(-1011, "Current server time is %s", tim);
23
  tm_format_datetime(tim, boot_time);
24
  cli_msg(-1011, "Last reboot on %s", tim);
25
  tm_format_datetime(tim, config->load_time);
26
  cli_msg(-1011, "Last reconfiguration on %s", tim);
27
  if (shutting_down)
28
    cli_msg(13, "Shutdown in progress");
29
  else if (old_config)
30
    cli_msg(13, "Reconfiguration in progress");
31
  else
32
    cli_msg(13, "Daemon is up and running");
33 4b87e256 Martin Mares
}
34
35
void
36
cmd_show_symbols(struct symbol *sym)
37
{
38
  int pos = 0;
39
40
  if (sym)
41
    cli_msg(1010, "%s\t%s", sym->name, cf_symbol_class_name(sym));
42
  else
43
    {
44
      while (sym = cf_walk_symbols(config, sym, &pos))
45
        cli_msg(-1010, "%s\t%s", sym->name, cf_symbol_class_name(sym));
46
      cli_msg(0, "");
47
    }
48
}