39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync/** @file
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync *
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * VBox HDD container test utility - I/O data generator.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync */
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync/*
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * Copyright (C) 2011 Oracle Corporation
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync *
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * available from http://www.virtualbox.org. This file is free software;
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * you can redistribute it and/or modify it under the terms of the GNU
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * General Public License (GPL) as published by the Free Software
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync */
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync#ifndef _VDIoRnd_h__
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync#define _VDIoRnd_h__
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync/** Pointer to the I/O random number generator. */
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsynctypedef struct VDIORND *PVDIORND;
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync/** Pointer to a I/O random number generator pointer. */
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsynctypedef PVDIORND *PPVDIORND;
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync/**
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * Creates a I/O RNG.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync *
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * @returns VBox status code.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync *
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * @param ppIoRnd Where to store the handle on success.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * @param cbPattern Size of the test pattern to create.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * @param uSeed Seed for the RNG.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync */
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsyncint VDIoRndCreate(PPVDIORND ppIoRnd, size_t cbPattern, uint64_t uSeed);
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync/**
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * Destroys the I/O RNG.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync *
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * @param pIoRnd I/O RNG handle.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync */
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsyncvoid VDIoRndDestroy(PVDIORND pIoRnd);
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync/**
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * Returns a pointer filled with random data of the given size.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync *
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * @returns VBox status code.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync *
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * @param pIoRnd I/O RNG handle.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * @param ppv Where to store the pointer on success.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync * @param cb Size of the buffer.
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync */
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsyncint VDIoRndGetBuffer(PVDIORND pIoRnd, void **ppv, size_t cb);
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsyncuint32_t VDIoRndGetU32Ex(PVDIORND pIoRnd, uint32_t uMin, uint32_t uMax);
39cac49f62afd27b0ffdbb779c7c64211939030cvboxsync#endif /* _VDIoRnd_h__ */