From 70945cb645402a4bb1d3dc46a07928caeb954c1f Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 26 Jun 2014 11:58:57 +0200 Subject: Temporary integrated OSPF commit. --- lib/birdlib.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/birdlib.h') diff --git a/lib/birdlib.h b/lib/birdlib.h index 04fb7fed..c49c5b99 100644 --- a/lib/birdlib.h +++ b/lib/birdlib.h @@ -33,6 +33,12 @@ #define ABS(a) ((a)>=0 ? (a) : -(a)) #define ARRAY_SIZE(a) (sizeof(a)/sizeof(*(a))) +#define BIT32_VAL(p) (((u32) 1) << ((p) % 32)) +#define BIT32_TEST(b,p) ((b)[(p)/32] & BIT32_VAL(p)) +#define BIT32_SET(b,p) ((b)[(p)/32] |= BIT32_VAL(p)) +#define BIT32_CLR(b,p) ((b)[(p)/32] &= ~BIT32_VAL(p)) +#define BIT32_ZERO(b,l) memset((b), 0, (l)/8) + #ifndef NULL #define NULL ((void *) 0) #endif -- cgit v1.2.3