summaryrefslogtreecommitdiff
path: root/lib/birdlib.h
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2015-02-21 11:39:45 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2015-02-21 11:39:45 +0100
commit7730553b7eeb33d21e5597f110334ca584ad532d (patch)
treec80bf6d48fc91bafd7f0aefc859a033d3b472c89 /lib/birdlib.h
parent0da562a7cb25ed2b8724248ad6f841b1831a09c3 (diff)
parentec2194fa7a20a2768ca0027b5f3c024f0a251866 (diff)
Merge remote-tracking branch 'origin/soft-int'
Diffstat (limited to 'lib/birdlib.h')
-rw-r--r--lib/birdlib.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/birdlib.h b/lib/birdlib.h
index c489c45f..84a6c1b4 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