summaryrefslogtreecommitdiff
path: root/lib/prefix.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2022-04-24 15:46:33 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2022-04-24 15:46:33 +0200
commit0e8d473b328276239fca4142a83d145e3b0c3285 (patch)
tree485c2955849f2882016fe162fb03156bb9bfadf2 /lib/prefix.h
parentc27892b24d21762f3cd4276fa2cca75c958f9b15 (diff)
lib: prefix_afi() helper
Just quick shorthand to get an afi_t from a prefix. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/prefix.h')
-rw-r--r--lib/prefix.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/prefix.h b/lib/prefix.h
index 5e03a7b4f5..f1d6b2dc02 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -420,6 +420,11 @@ extern const char *family2str(int family);
extern const char *safi2str(safi_t safi);
extern const char *afi2str(afi_t afi);
+static inline afi_t prefix_afi(union prefixconstptr pu)
+{
+ return family2afi(pu.p->family);
+}
+
/*
* Check bit of the prefix.
*