diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2022-04-24 15:46:33 +0200 | 
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2022-04-24 15:46:33 +0200 | 
| commit | 0e8d473b328276239fca4142a83d145e3b0c3285 (patch) | |
| tree | 485c2955849f2882016fe162fb03156bb9bfadf2 /lib/prefix.h | |
| parent | c27892b24d21762f3cd4276fa2cca75c958f9b15 (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.h | 5 | 
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.   *  | 
