From: Donald Sharp Date: Sat, 28 Oct 2017 21:40:13 +0000 (-0400) Subject: eigrpd: Create a function to return a string of prefix state X-Git-Tag: frr-4.0-dev~177^2~7 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=5cc74ec1b87f0ebf7e0c38c4da9fe5d9b3966ff9;p=matthieu%2Ffrr.git eigrpd: Create a function to return a string of prefix state Signed-off-by: Donald Sharp --- diff --git a/eigrpd/eigrp_fsm.c b/eigrpd/eigrp_fsm.c index 29357c2b24..86914316b8 100644 --- a/eigrpd/eigrp_fsm.c +++ b/eigrpd/eigrp_fsm.c @@ -170,6 +170,24 @@ struct { }, }; +static const char *prefix_state2str(enum eigrp_fsm_states state) +{ + switch (state) { + case EIGRP_FSM_STATE_PASSIVE: + return "Passive"; + case EIGRP_FSM_STATE_ACTIVE_0: + return "Active oij0"; + case EIGRP_FSM_STATE_ACTIVE_1: + return "Active oij1"; + case EIGRP_FSM_STATE_ACTIVE_2: + return "Active oij2"; + case EIGRP_FSM_STATE_ACTIVE_3: + return "Active oij3"; + } + + return "Unknown"; +} + /* * Main function in which are make decisions which event occurred. * msg - argument of type struct eigrp_fsm_action_message contain @@ -331,9 +349,9 @@ static int eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg) int eigrp_fsm_event(struct eigrp_fsm_action_message *msg) { int event = eigrp_get_fsm_event(msg); - zlog_info("EIGRP AS: %d State: %d Event: %d Network: %s", - msg->eigrp->AS, msg->prefix->state, event, - eigrp_topology_ip_string(msg->prefix)); + zlog_info("EIGRP AS: %d State: %s Event: %d Network: %s", + msg->eigrp->AS, prefix_state2str(msg->prefix->state), + event, eigrp_topology_ip_string(msg->prefix)); (*(NSM[msg->prefix->state][event].func))(msg); return 1;