libosmocore
0.9.3
Osmocom core library
Main Page
Modules
Data Structures
Files
File List
Globals
crc32gen.h
Go to the documentation of this file.
1
/*
2
* crc32gen.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
#pragma once
24
34
#include <stdint.h>
35
#include <
osmocom/core/bits.h
>
36
37
39
struct
osmo_crc32gen_code
{
40
int
bits
;
41
uint32_t
poly
;
42
uint32_t
init
;
43
uint32_t
remainder
;
44
};
45
46
uint32_t
osmo_crc32gen_compute_bits
(
const
struct
osmo_crc32gen_code
*code,
47
const
ubit_t
*in,
int
len);
48
int
osmo_crc32gen_check_bits
(
const
struct
osmo_crc32gen_code
*code,
49
const
ubit_t
*in,
int
len,
const
ubit_t
*crc_bits);
50
void
osmo_crc32gen_set_bits
(
const
struct
osmo_crc32gen_code
*code,
51
const
ubit_t
*in,
int
len,
ubit_t
*crc_bits);
52
53
56
/* vim: set syntax=c: */
include
osmocom
core
crc32gen.h
Generated on Fri Nov 11 2016 15:57:07 for libosmocore by
1.8.1.2