1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox HDD container test utility - I/O data generator.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2011-2022 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef VBOX_INCLUDED_SRC_testcase_VDIoRnd_h
|
---|
19 | #define VBOX_INCLUDED_SRC_testcase_VDIoRnd_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /** Pointer to the I/O random number generator. */
|
---|
25 | typedef struct VDIORND *PVDIORND;
|
---|
26 | /** Pointer to a I/O random number generator pointer. */
|
---|
27 | typedef PVDIORND *PPVDIORND;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * Creates a I/O RNG.
|
---|
31 | *
|
---|
32 | * @returns VBox status code.
|
---|
33 | *
|
---|
34 | * @param ppIoRnd Where to store the handle on success.
|
---|
35 | * @param cbPattern Size of the test pattern to create.
|
---|
36 | * @param uSeed Seed for the RNG.
|
---|
37 | */
|
---|
38 | int VDIoRndCreate(PPVDIORND ppIoRnd, size_t cbPattern, uint64_t uSeed);
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * Destroys the I/O RNG.
|
---|
42 | *
|
---|
43 | * @param pIoRnd I/O RNG handle.
|
---|
44 | */
|
---|
45 | void VDIoRndDestroy(PVDIORND pIoRnd);
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * Returns a pointer filled with random data of the given size.
|
---|
49 | *
|
---|
50 | * @returns VBox status code.
|
---|
51 | *
|
---|
52 | * @param pIoRnd I/O RNG handle.
|
---|
53 | * @param ppv Where to store the pointer on success.
|
---|
54 | * @param cb Size of the buffer.
|
---|
55 | */
|
---|
56 | int VDIoRndGetBuffer(PVDIORND pIoRnd, void **ppv, size_t cb);
|
---|
57 |
|
---|
58 | uint32_t VDIoRndGetU32Ex(PVDIORND pIoRnd, uint32_t uMin, uint32_t uMax);
|
---|
59 | #endif /* !VBOX_INCLUDED_SRC_testcase_VDIoRnd_h */
|
---|