libosmocore  0.6.3
Osmocom core library
crc64gen.h
Go to the documentation of this file.
1 /*
2  * crc64gen.h
3  *
4  * Copyright (C) 2011 Sylvain Munaut <tnt@246tNt.com>
5  *
6  * All Rights Reserved
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #ifndef __OSMO_CRC64GEN_H__
24 #define __OSMO_CRC64GEN_H__
25 
35 #include <stdint.h>
36 #include <osmocom/core/bits.h>
37 
38 
41  int bits;
42  uint64_t poly;
43  uint64_t init;
44  uint64_t remainder;
45 };
46 
47 uint64_t osmo_crc64gen_compute_bits(const struct osmo_crc64gen_code *code,
48  const ubit_t *in, int len);
49 int osmo_crc64gen_check_bits(const struct osmo_crc64gen_code *code,
50  const ubit_t *in, int len, const ubit_t *crc_bits);
51 void osmo_crc64gen_set_bits(const struct osmo_crc64gen_code *code,
52  const ubit_t *in, int len, ubit_t *crc_bits);
53 
54 
57 #endif /* __OSMO_CRC64GEN_H__ */
58 
59 /* vim: set syntax=c: */