/*1* Copyright (C) 2006-2011 B.A.T.M.A.N. contributors:2*3* Simon Wunderlich, Marek Lindner4*5* This program is free software; you can redistribute it and/or6* modify it under the terms of version 2 of the GNU General Public7* License as published by the Free Software Foundation.8*9* This program is distributed in the hope that it will be useful, but10* WITHOUT ANY WARRANTY; without even the implied warranty of11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU12* General Public License for more details.13*14* You should have received a copy of the GNU General Public License15* along with this program; if not, write to the Free Software16* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA17* 02110-1301, USA18*19*/2021#ifndef _NET_BATMAN_ADV_BITARRAY_H_22#define _NET_BATMAN_ADV_BITARRAY_H_2324#define WORD_BIT_SIZE (sizeof(unsigned long) * 8)2526/* returns true if the corresponding bit in the given seq_bits indicates true27* and curr_seqno is within range of last_seqno */28uint8_t get_bit_status(unsigned long *seq_bits, uint32_t last_seqno,29uint32_t curr_seqno);3031/* turn corresponding bit on, so we can remember that we got the packet */32void bit_mark(unsigned long *seq_bits, int32_t n);333435/* receive and process one packet, returns 1 if received seq_num is considered36* new, 0 if old */37char bit_get_packet(void *priv, unsigned long *seq_bits,38int32_t seq_num_diff, int8_t set_mark);3940/* count the hamming weight, how many good packets did we receive? */41int bit_packet_count(unsigned long *seq_bits);4243#endif /* _NET_BATMAN_ADV_BITARRAY_H_ */444546