diff options
author | Paul Jakma <paul@quagga.net> | 2011-04-08 12:44:43 +0100 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2012-01-06 16:18:18 +0000 |
commit | f63f06da2e7be6b17c72dd6110aae179f42f3700 (patch) | |
tree | a36b625a9ea06d0720a240276ed1b8af33193ed7 /lib/prefix.h | |
parent | 651e70d7f419ee7af75113f80e688c0100e9cff5 (diff) |
general: remove inline qualifiers and move in-header functions to objects
* (general) Move functions in headers into files, to be compiled into
shared object files. Remove inline qualifier from functions. Let the
compiler do the work.
Diffstat (limited to 'lib/prefix.h')
-rw-r--r-- | lib/prefix.h | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/lib/prefix.h b/lib/prefix.h index dab4202e..7f0d3607 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -128,26 +128,14 @@ struct prefix_rd /* Prefix's family member. */ #define PREFIX_FAMILY(p) ((p)->family) -/* Check bit of the prefix. */ -static inline unsigned int -prefix_bit (const u_char *prefix, const u_char prefixlen) -{ - unsigned int offset = prefixlen / 8; - unsigned int shift = 7 - (prefixlen % 8); - - return (prefix[offset] >> shift) & 1; -} - -static inline unsigned int -prefix6_bit (const struct in6_addr *prefix, const u_char prefixlen) -{ - return prefix_bit((const u_char *) &prefix->s6_addr, prefixlen); -} - /* Prototypes. */ extern int afi2family (afi_t); extern afi_t family2afi (int); +/* Check bit of the prefix. */ +extern unsigned int prefix_bit (const u_char *prefix, const u_char prefixlen); +extern unsigned int prefix6_bit (const struct in6_addr *prefix, const u_char prefixlen); + extern struct prefix *prefix_new (void); extern void prefix_free (struct prefix *); extern const char *prefix_family_str (const struct prefix *); |