mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 16:20:08 +00:00
commit
b4bdcf45d5
@ -70,14 +70,14 @@ struct thread_master *master;
|
|||||||
static bool watch_only = false;
|
static bool watch_only = false;
|
||||||
const char *pathspace;
|
const char *pathspace;
|
||||||
|
|
||||||
typedef enum {
|
enum restart_phase {
|
||||||
PHASE_NONE = 0,
|
PHASE_NONE = 0,
|
||||||
PHASE_INIT,
|
PHASE_INIT,
|
||||||
PHASE_STOPS_PENDING,
|
PHASE_STOPS_PENDING,
|
||||||
PHASE_WAITING_DOWN,
|
PHASE_WAITING_DOWN,
|
||||||
PHASE_ZEBRA_RESTART_PENDING,
|
PHASE_ZEBRA_RESTART_PENDING,
|
||||||
PHASE_WAITING_ZEBRA_UP
|
PHASE_WAITING_ZEBRA_UP
|
||||||
} restart_phase_t;
|
};
|
||||||
|
|
||||||
static const char *const phase_str[] = {
|
static const char *const phase_str[] = {
|
||||||
"Idle",
|
"Idle",
|
||||||
@ -103,7 +103,7 @@ struct restart_info {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static struct global_state {
|
static struct global_state {
|
||||||
restart_phase_t phase;
|
enum restart_phase phase;
|
||||||
struct thread *t_phase_hanging;
|
struct thread *t_phase_hanging;
|
||||||
struct thread *t_startup_timeout;
|
struct thread *t_startup_timeout;
|
||||||
const char *vtydir;
|
const char *vtydir;
|
||||||
@ -136,13 +136,13 @@ static struct global_state {
|
|||||||
.stop_command = DEFAULT_STOP_CMD,
|
.stop_command = DEFAULT_STOP_CMD,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum {
|
enum daemon_state {
|
||||||
DAEMON_INIT,
|
DAEMON_INIT,
|
||||||
DAEMON_DOWN,
|
DAEMON_DOWN,
|
||||||
DAEMON_CONNECTING,
|
DAEMON_CONNECTING,
|
||||||
DAEMON_UP,
|
DAEMON_UP,
|
||||||
DAEMON_UNRESPONSIVE
|
DAEMON_UNRESPONSIVE
|
||||||
} daemon_state_t;
|
};
|
||||||
|
|
||||||
#define IS_UP(DMN) \
|
#define IS_UP(DMN) \
|
||||||
(((DMN)->state == DAEMON_UP) || ((DMN)->state == DAEMON_UNRESPONSIVE))
|
(((DMN)->state == DAEMON_UP) || ((DMN)->state == DAEMON_UNRESPONSIVE))
|
||||||
@ -153,7 +153,7 @@ static const char *const state_str[] = {
|
|||||||
|
|
||||||
struct daemon {
|
struct daemon {
|
||||||
const char *name;
|
const char *name;
|
||||||
daemon_state_t state;
|
enum daemon_state state;
|
||||||
int fd;
|
int fd;
|
||||||
struct timeval echo_sent;
|
struct timeval echo_sent;
|
||||||
unsigned int connect_tries;
|
unsigned int connect_tries;
|
||||||
@ -848,7 +848,7 @@ static void phase_hanging(struct thread *t_hanging)
|
|||||||
gs.phase = PHASE_NONE;
|
gs.phase = PHASE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_phase(restart_phase_t new_phase)
|
static void set_phase(enum restart_phase new_phase)
|
||||||
{
|
{
|
||||||
gs.phase = new_phase;
|
gs.phase = new_phase;
|
||||||
thread_cancel(&gs.t_phase_hanging);
|
thread_cancel(&gs.t_phase_hanging);
|
||||||
|
Loading…
Reference in New Issue
Block a user