F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
CRCChecker.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CRCChecker.hpp
3 // \author ortega
4 // \brief hpp file for a crc32 checker
5 //
6 // \copyright
7 // Copyright 2009-2020, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 // ======================================================================
11 
12 #ifndef CRC_CHECKER_HPP
13 #define CRC_CHECKER_HPP
14 
15 #include <FpConfig.hpp>
16 
17 namespace Utils {
18 
19  static const NATIVE_INT_TYPE CRC_FILE_READ_BLOCK = 2048;
20  static const U32 CRC_MAX_FILENAME_SIZE = 128; // TODO use a config variable
21 
22  typedef enum
23  {
35 
36  crc_stat_t create_checksum_file(const char* const filename);
37  crc_stat_t read_crc32_from_file(const char* const fname, U32 &checksum_from_file);
38  crc_stat_t verify_checksum(const char* const filename, U32 &expected, U32 &actual);
39 
40 }
41 
42 #endif
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:55
C++-compatible configuration header for fprime configuration.
crc_stat_t read_crc32_from_file(const char *const fname, U32 &checksum_from_file)
Definition: CRCChecker.cpp:117
crc_stat_t create_checksum_file(const char *const fname)
Definition: CRCChecker.cpp:22
static const U32 CRC_MAX_FILENAME_SIZE
Definition: CRCChecker.hpp:20
crc_stat_t verify_checksum(const char *const fname, U32 &expected, U32 &actual)
Definition: CRCChecker.cpp:146
@ FAILED_FILE_READ
Definition: CRCChecker.hpp:29
@ FAILED_FILE_CRC_WRITE
Definition: CRCChecker.hpp:32
@ PASSED_FILE_CRC_WRITE
Definition: CRCChecker.hpp:25
@ FAILED_FILE_CRC_CHECK
Definition: CRCChecker.hpp:33
@ FAILED_FILE_CRC_READ
Definition: CRCChecker.hpp:31
@ PASSED_FILE_CRC_CHECK
Definition: CRCChecker.hpp:24
@ FAILED_FILE_CRC_OPEN
Definition: CRCChecker.hpp:30
@ FAILED_FILE_SIZE_CAST
Definition: CRCChecker.hpp:27
@ FAILED_FILE_SIZE
Definition: CRCChecker.hpp:26
@ FAILED_FILE_OPEN
Definition: CRCChecker.hpp:28
static const NATIVE_INT_TYPE CRC_FILE_READ_BLOCK
Definition: CRCChecker.hpp:19