diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-01-24 22:34:33 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-01-24 22:45:27 +0100 |
commit | 5a50a98980a3554b66cedda6992ece4063a0e85a (patch) | |
tree | d8ff938c5b9712ca7788256aab3fff96f98ad7ac /lib/birdlib.h | |
parent | 3e60932a289e55e212dec1cbaf3bca44b2bbaeb8 (diff) |
OSPF: Opaque LSAs and Router Information LSA
Add support for OSPFv2 Opaque LSAs (RFC 5250) and for Router Information
LSA (RFC 7770). The second part is here mainly for testing opaque LSAs.
Diffstat (limited to 'lib/birdlib.h')
-rw-r--r-- | lib/birdlib.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/birdlib.h b/lib/birdlib.h index 428b3209..7cd78032 100644 --- a/lib/birdlib.h +++ b/lib/birdlib.h @@ -56,6 +56,13 @@ static inline int u64_cmp(u64 i1, u64 i2) #define BIT32_CLR(b,p) ((b)[(p)/32] &= ~BIT32_VAL(p)) #define BIT32_ZERO(b,l) memset((b), 0, (l)/8) +/* The same, but counting bits from MSB */ +#define BIT32R_VAL(p) ((((u32) 1) << 31) >> ((p) % 32)) +#define BIT32R_TEST(b,p) ((b)[(p)/32] & BIT32R_VAL(p)) +#define BIT32R_SET(b,p) ((b)[(p)/32] |= BIT32R_VAL(p)) +#define BIT32R_CLR(b,p) ((b)[(p)/32] &= ~BIT32R_VAL(p)) +#define BIT32R_ZERO(b,l) memset((b), 0, (l)/8) + #ifndef NULL #define NULL ((void *) 0) #endif |