Statistics
| Branch: | Revision:

iof-bird-daemon / nest / cmds.c @ 11361a10

History | View | Annotate | Download (1.2 KB)

1
/*
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
  byte tim[TM_DATETIME_BUFFER_SIZE];
19

    
20
  cli_msg(-1000, "BIRD " BIRD_VERSION);
21
  tm_format_datetime(tim, now);
22
  cli_msg(-1011, "Router ID is %R", config->router_id);
23
  cli_msg(-1011, "Current server time is %s", tim);
24
  tm_format_datetime(tim, boot_time);
25
  cli_msg(-1011, "Last reboot on %s", tim);
26
  tm_format_datetime(tim, config->load_time);
27
  cli_msg(-1011, "Last reconfiguration on %s", tim);
28
  if (shutting_down)
29
    cli_msg(13, "Shutdown in progress");
30
  else if (old_config)
31
    cli_msg(13, "Reconfiguration in progress");
32
  else
33
    cli_msg(13, "Daemon is up and running");
34
}
35

    
36
void
37
cmd_show_symbols(struct symbol *sym)
38
{
39
  int pos = 0;
40

    
41
  if (sym)
42
    cli_msg(1010, "%s\t%s", sym->name, cf_symbol_class_name(sym));
43
  else
44
    {
45
      while (sym = cf_walk_symbols(config, sym, &pos))
46
        cli_msg(-1010, "%s\t%s", sym->name, cf_symbol_class_name(sym));
47
      cli_msg(0, "");
48
    }
49
}