~ubuntu-branches/ubuntu/trusty/batmand/trusty

« back to all changes in this revision

Viewing changes to bitarray.h

  • Committer: Bazaar Package Importer
  • Author(s): Holger Levsen
  • Date: 2007-11-26 09:10:49 UTC
  • Revision ID: james.westby@ubuntu.com-20071126091049-9fqg546f2c4ct759
Tags: upstream-0.2
ImportĀ upstreamĀ versionĀ 0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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.
 
7
 *
 
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.
 
12
 *
 
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
 
16
 * 02110-1301, USA
 
17
 *
 
18
 */
 
19
 
 
20
 
 
21
 
 
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"
 
25
 
 
26
 
 
27
 
 
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 );
 
35