summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2020-01-03 17:48:36 -0500
committerQuentin Young <qlyoung@cumulusnetworks.com>2020-01-22 14:12:15 -0500
commitd35e556c84d775989ba606457da6093c74b1bd3f (patch)
treead1cf9bbf3b97dc2bfd710648b7469bdbe49f062
parent8015874dcd3fcdf46029ba73c01cac4ce712ca46 (diff)
lib: add macro to check if value is valid afi
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
-rw-r--r--lib/zebra.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/zebra.h b/lib/zebra.h
index 00d422cdd1..b2f0202c53 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -360,6 +360,8 @@ typedef enum {
AFI_MAX = 4
} afi_t;
+#define IS_VALID_AFI(a) ((a) > AFI_UNSPEC && (a) < AFI_MAX)
+
/* Subsequent Address Family Identifier. */
typedef enum {
SAFI_UNSPEC = 0,