diff options
Diffstat (limited to 'lib/prefix.h')
-rw-r--r-- | lib/prefix.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/prefix.h b/lib/prefix.h index a7598b7e..1ccd4dd6 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with GNU Zebra; see the file COPYING. If not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. + * 02111-1307, USA. */ #ifndef _ZEBRA_PREFIX_H @@ -25,6 +25,10 @@ #include "sockunion.h" +#ifndef Inline +#define Inline static inline +#endif + /* * A struct prefix contains an address family, a prefix length, and an * address. This can represent either a 'network prefix' as defined @@ -39,14 +43,14 @@ struct prefix { u_char family; u_char prefixlen; - union + union { u_char prefix; struct in_addr prefix4; #ifdef HAVE_IPV6 struct in6_addr prefix6; #endif /* HAVE_IPV6 */ - struct + struct { struct in_addr id; struct in_addr adv_router; @@ -171,6 +175,12 @@ extern void apply_mask_ipv4 (struct prefix_ipv4 *); #define PREFIX_COPY_IPV4(DST, SRC) \ *((struct prefix_ipv4 *)(DST)) = *((const struct prefix_ipv4 *)(SRC)); +Inline void +prefix_copy_ipv4(struct prefix* dst, struct prefix* src) +{ + *dst = *src ; +} ; + extern int prefix_ipv4_any (const struct prefix_ipv4 *); extern void apply_classful_mask_ipv4 (struct prefix_ipv4 *); @@ -193,7 +203,13 @@ extern int str2prefix_ipv6 (const char *, struct prefix_ipv6 *); extern void apply_mask_ipv6 (struct prefix_ipv6 *); #define PREFIX_COPY_IPV6(DST, SRC) \ - *((struct prefix_ipv6 *)(DST)) = *((const struct prefix_ipv6 *)(SRC)); + *((struct prefix_ipv6 *)(DST)) = *((const struct prefix_ipv6 *)(SRC)); + +Inline void +prefix_copy_ipv6(struct prefix* dst, struct prefix* src) +{ + *dst = *src ; +} ; extern int ip6_masklen (struct in6_addr); extern void masklen2ip6 (int, struct in6_addr *); |