From 5a50a98980a3554b66cedda6992ece4063a0e85a Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Thu, 24 Jan 2019 22:34:33 +0100 Subject: 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. --- lib/birdlib.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/birdlib.h') 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 -- cgit v1.2.3