csp_crc32.h
Go to the documentation of this file.
1 /*
2 Cubesat Space Protocol - A small network-layer protocol designed for Cubesats
3 Copyright (C) 2012 GomSpace ApS (http://www.gomspace.com)
4 Copyright (C) 2012 AAUSAT3 Project (http://aausat3.space.aau.dk)
5 
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10 
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15 
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
27 #ifndef _CSP_CRC32_H_
28 #define _CSP_CRC32_H_
29 
30 #include <csp/csp.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
39 void csp_crc32_gentab(void);
40 
47 int csp_crc32_append(csp_packet_t * packet, bool include_header);
48 
55 int csp_crc32_verify(csp_packet_t * packet, bool include_header);
56 
63 uint32_t csp_crc32_memory(const uint8_t * data, uint32_t length);
64 
65 #ifdef __cplusplus
66 } /* extern "C" */
67 #endif
68 
69 #endif /* _CSP_CRC32_H_ */
70 
71 /* @} */
int csp_crc32_verify(csp_packet_t *packet, bool include_header)
Verify CRC32 checksum on packet.
int csp_crc32_append(csp_packet_t *packet, bool include_header)
Append CRC32 checksum to packet.
uint32_t csp_crc32_memory(const uint8_t *data, uint32_t length)
Calculate checksum for a given memory area.
CSP PACKET STRUCTURE Note: This structure is constructed to fit with all interface frame types in ord...
Definition: csp_types.h:174
void csp_crc32_gentab(void)
Generate precomputed CRC32 table.