summaryrefslogtreecommitdiffstats
path: root/isisd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-04-22 20:46:53 +0200
committerDonald Sharp <sharpd@nvidia.com>2021-04-22 21:17:20 +0200
commit61cd5761a38b20a0e0ae44071f46bc36fbdbe611 (patch)
treedf44f6df9c8ce636ab99abc35e6298d53c653dbb /isisd
parentMerge pull request #8536 from idryzhov/bfd-enabled (diff)
downloadfrr-61cd5761a38b20a0e0ae44071f46bc36fbdbe611.tar.xz
frr-61cd5761a38b20a0e0ae44071f46bc36fbdbe611.zip
isisd: use an enum for circuit states
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'isisd')
-rw-r--r--isisd/isis_circuit.h3
-rw-r--r--isisd/isis_csm.c5
-rw-r--r--isisd/isis_csm.h10
3 files changed, 9 insertions, 9 deletions
diff --git a/isisd/isis_circuit.h b/isisd/isis_circuit.h
index cbe4040b6..d4c7baea1 100644
--- a/isisd/isis_circuit.h
+++ b/isisd/isis_circuit.h
@@ -31,6 +31,7 @@
#include "isis_constants.h"
#include "isis_common.h"
+#include "isis_csm.h"
DECLARE_HOOK(isis_if_new_hook, (struct interface *ifp), (ifp));
@@ -77,7 +78,7 @@ struct isis_circuit_arg {
};
struct isis_circuit {
- int state;
+ enum isis_circuit_state state;
uint8_t circuit_id; /* l1/l2 bcast CircuitID */
time_t last_uptime;
struct isis *isis;
diff --git a/isisd/isis_csm.c b/isisd/isis_csm.c
index 736d8d63f..6214a6b8c 100644
--- a/isisd/isis_csm.c
+++ b/isisd/isis_csm.c
@@ -63,7 +63,7 @@ static const char *const csm_eventstr[] = {
struct isis_circuit *
isis_csm_state_change(int event, struct isis_circuit *circuit, void *arg)
{
- int old_state;
+ enum isis_circuit_state old_state;
struct isis *isis = NULL;
struct isis_area *area = NULL;
@@ -197,9 +197,6 @@ isis_csm_state_change(int event, struct isis_circuit *circuit, void *arg)
break;
}
break;
-
- default:
- zlog_warn("Invalid circuit state %d", old_state);
}
if (IS_DEBUG_EVENTS)
diff --git a/isisd/isis_csm.h b/isisd/isis_csm.h
index 53a5f9d5d..9da06fb1a 100644
--- a/isisd/isis_csm.h
+++ b/isisd/isis_csm.h
@@ -27,10 +27,12 @@
/*
* Circuit states
*/
-#define C_STATE_NA 0
-#define C_STATE_INIT 1 /* Connected to interface */
-#define C_STATE_CONF 2 /* Configured for ISIS */
-#define C_STATE_UP 3 /* CONN | CONF */
+enum isis_circuit_state {
+ C_STATE_NA,
+ C_STATE_INIT, /* Connected to interface */
+ C_STATE_CONF, /* Configured for ISIS */
+ C_STATE_UP, /* CONN | CONF */
+};
/*
* Circuit events