summaryrefslogtreecommitdiff
path: root/eigrpd/eigrp_fsm.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-10-28 17:40:13 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-10-28 18:05:33 -0400
commit5cc74ec1b87f0ebf7e0c38c4da9fe5d9b3966ff9 (patch)
treece0e96b46f46a3e216ed860d541baaf05bc8d6c1 /eigrpd/eigrp_fsm.c
parente4715aed63b9b791f35baa8abeb473870bb62213 (diff)
eigrpd: Create a function to return a string of prefix state
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'eigrpd/eigrp_fsm.c')
-rw-r--r--eigrpd/eigrp_fsm.c24
1 files changed, 21 insertions, 3 deletions
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;