From 7dd5289076160ee2844978bfd1640ca7aa34f4da Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 30 Oct 2008 20:44:25 +0100 Subject: groups: add attribute group API This new API allows you to set and get some logical set of attributes. This is not intended to replace the existing per-attribute get/set API but to provide more efficient way to get/set certain attributes. This change includes an example file (conntrack_grp_create.c) of the use of the attribute group API. See ATTR_GRP_* for more information on the existing groups. Signed-off-by: Pablo Neira Ayuso --- include/internal/bitops.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'include/internal/bitops.h') diff --git a/include/internal/bitops.h b/include/internal/bitops.h index b1bd848..0c1fde8 100644 --- a/include/internal/bitops.h +++ b/include/internal/bitops.h @@ -24,9 +24,40 @@ static inline void unset_bit_u16(int nr, u_int16_t *addr) addr[nr >> 4] &= ~(1UL << (nr & 15)); } +static inline void +set_bitmask_u32(u_int32_t *buf1, const u_int32_t *buf2, int len) +{ + int i; + + for (i=0; i> 5])) != 0; } +static inline int +test_bitmask_u32(const uint32_t *buf1, const uint32_t *buf2, int len) +{ + int i; + + for (i=0; i