Don't double print version when invoked with --version
[fio.git] / verify.h
1 #ifndef FIO_VERIFY_H
2 #define FIO_VERIFY_H
3
4 #include <stdint.h>
5
6 #define FIO_HDR_MAGIC   0xf00baaef
7
8 enum {
9         VERIFY_NONE = 0,                /* no verification */
10         VERIFY_MD5,                     /* md5 sum data blocks */
11         VERIFY_CRC64,                   /* crc64 sum data blocks */
12         VERIFY_CRC32,                   /* crc32 sum data blocks */
13         VERIFY_CRC32C,                  /* crc32c sum data blocks */
14         VERIFY_CRC32C_INTEL,            /* crc32c sum data blocks with hw */
15         VERIFY_CRC16,                   /* crc16 sum data blocks */
16         VERIFY_CRC7,                    /* crc7 sum data blocks */
17         VERIFY_SHA256,                  /* sha256 sum data blocks */
18         VERIFY_SHA512,                  /* sha512 sum data blocks */
19         VERIFY_META,                    /* block_num, timestamp etc. */
20         VERIFY_SHA1,                    /* sha1 sum data blocks */
21         VERIFY_NULL,                    /* pretend to verify */
22 };
23
24 /*
25  * A header structure associated with each checksummed data block. It is
26  * followed by a checksum specific header that contains the verification
27  * data.
28  */
29 struct verify_header {
30         unsigned int fio_magic;
31         unsigned int len;
32         unsigned int verify_type;
33         unsigned long rand_seed;
34 };
35
36 struct vhdr_md5 {
37         uint32_t md5_digest[4];
38 };
39 struct vhdr_sha512 {
40         uint8_t sha512[128];
41 };
42 struct vhdr_sha256 {
43         uint8_t sha256[64];
44 };
45 struct vhdr_sha1 {
46         uint32_t sha1[5];
47 };
48 struct vhdr_crc64 {
49         uint64_t crc64;
50 };
51 struct vhdr_crc32 {
52         uint32_t crc32;
53 };
54 struct vhdr_crc16 {
55         uint16_t crc16;
56 };
57 struct vhdr_crc7 {
58         uint8_t crc7;
59 };
60 struct vhdr_meta {
61         uint64_t offset;
62         unsigned char thread;
63         unsigned short numberio;
64         unsigned long time_sec;
65         unsigned long time_usec;
66 };
67
68 /*
69  * Verify helpers
70  */
71 extern void populate_verify_io_u(struct thread_data *, struct io_u *);
72 extern int __must_check get_next_verify(struct thread_data *td, struct io_u *);
73 extern int __must_check verify_io_u(struct thread_data *, struct io_u *);
74 extern int verify_io_u_async(struct thread_data *, struct io_u *);
75 extern void fill_pattern(struct thread_data *td, void *p, unsigned int len, struct io_u *io_u, unsigned long seed, int use_seed);
76
77 /*
78  * Async verify offload
79  */
80 extern int verify_async_init(struct thread_data *);
81 extern void verify_async_exit(struct thread_data *);
82
83 #endif