2
* Copyright (C) 2006 B.A.T.M.A.N. contributors:
3
* Simon Wunderlich, Axel Neumann, Marek Lindner
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of version 2 of the GNU General Public
6
* License as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22
#define TYPE_OF_WORD unsigned long /* you should choose something big, if you don't want to waste cpu */
23
#define WORD_BIT_SIZE ( sizeof(TYPE_OF_WORD) * 8 )
24
#include "batman-specific.h"
28
void bit_init( TYPE_OF_WORD *seq_bits );
29
uint8_t get_bit_status( TYPE_OF_WORD *seq_bits, uint16_t last_seqno, uint16_t curr_seqno );
30
char *bit_print( TYPE_OF_WORD *seq_bits );
31
void bit_mark( TYPE_OF_WORD *seq_bits, int32_t n );
32
void bit_shift( TYPE_OF_WORD *seq_bits, int32_t n );
33
char bit_get_packet( TYPE_OF_WORD *seq_bits, int16_t seq_num_diff, int8_t set_mark );
34
int bit_packet_count( TYPE_OF_WORD *seq_bits );