Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
labs
BIRD Internet Routing Daemon
Commits
43270902
Commit
43270902
authored
Mar 12, 2000
by
Martin Mareš
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made `show status' show uptime and time of last reconfiguration.
parent
7a88832e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
2 deletions
+25
-2
conf/conf.c
conf/conf.c
+5
-0
conf/conf.h
conf/conf.h
+3
-0
doc/reply_codes
doc/reply_codes
+2
-0
nest/cmds.c
nest/cmds.c
+15
-2
No files found.
conf/conf.c
View file @
43270902
...
...
@@ -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
;
}
...
...
conf/conf.h
View file @
43270902
...
...
@@ -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
*
);
...
...
doc/reply_codes
View file @
43270902
...
...
@@ -21,6 +21,7 @@ Reply codes of BIRD command-line interface
0010 Already enabled
0011 Enabled
0012 Restarted
0013 Status report
1000 BIRD version
1001 Interface list
...
...
@@ -33,6 +34,7 @@ Reply codes of BIRD command-line interface
1008 Route details
1009 Static route list
1010 Symbol list
1011 Uptime
8000 Reply too long
8001 Route not found
...
...
nest/cmds.c
View file @
43270902
...
...
@@ -15,8 +15,21 @@
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment