]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: prefix_afi() helper
authorDavid Lamparter <equinox@opensourcerouting.org>
Sun, 24 Apr 2022 13:46:33 +0000 (15:46 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Sun, 24 Apr 2022 13:46:33 +0000 (15:46 +0200)
Just quick shorthand to get an afi_t from a prefix.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/prefix.h

index 5e03a7b4f5c51a3b2b06d7fc6afe19b2d0a34c52..f1d6b2dc0271e7de2c7068abe82b94d17ae9ae29 100644 (file)
@@ -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.
  *