2017-02-12 22:30:00 +01:00
|
|
|
/*
|
|
|
|
|
* methods.c: Method implementations for nwipe.
|
|
|
|
|
*
|
|
|
|
|
* Copyright Darik Horn <dajhorn-dban@vanadac.com>.
|
|
|
|
|
*
|
|
|
|
|
* Modifications to original dwipe Copyright Andy Beverley <andy@andybev.com>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify it under
|
|
|
|
|
* the terms of the GNU General Public License as published by the Free Software
|
|
|
|
|
* Foundation, version 2.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
|
* details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
|
* this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef METHOD_H_
|
|
|
|
|
#define METHOD_H_
|
|
|
|
|
|
|
|
|
|
/* The argument list for nwipe methods. */
|
|
|
|
|
#define NWIPE_METHOD_SIGNATURE nwipe_context_t* c
|
|
|
|
|
|
|
|
|
|
typedef enum nwipe_verify_t_
|
|
|
|
|
{
|
|
|
|
|
NWIPE_VERIFY_NONE = 0, /* Do not read anything back from the device. */
|
|
|
|
|
NWIPE_VERIFY_LAST, /* Check the last pass. */
|
|
|
|
|
NWIPE_VERIFY_ALL, /* Check all passes. */
|
|
|
|
|
} nwipe_verify_t;
|
|
|
|
|
|
|
|
|
|
/* The typedef of the function that will do the wipe. */
|
|
|
|
|
typedef int(*nwipe_method_t)( void *ptr );
|
|
|
|
|
|
|
|
|
|
typedef struct /* nwipe_pattern_t */
|
|
|
|
|
{
|
|
|
|
|
int length; /* Length of the pattern in bytes, -1 means random. */
|
|
|
|
|
char* s; /* The actual bytes of the pattern. */
|
|
|
|
|
} nwipe_pattern_t;
|
|
|
|
|
|
|
|
|
|
const char* nwipe_method_label( void* method );
|
|
|
|
|
int nwipe_runmethod( NWIPE_METHOD_SIGNATURE, nwipe_pattern_t* patterns );
|
|
|
|
|
|
|
|
|
|
void *nwipe_dod522022m( void *ptr );
|
|
|
|
|
void *nwipe_dodshort( void *ptr );
|
|
|
|
|
void *nwipe_gutmann( void *ptr );
|
|
|
|
|
void *nwipe_ops2( void *ptr );
|
2019-12-28 21:39:28 +00:00
|
|
|
void *nwipe_is5enh( void *ptr );
|
2017-02-12 22:30:00 +01:00
|
|
|
void *nwipe_random( void *ptr );
|
|
|
|
|
void *nwipe_zero( void *ptr );
|
2019-11-13 10:59:44 -06:00
|
|
|
void *nwipe_verify( void *ptr );
|
2017-02-12 22:30:00 +01:00
|
|
|
|
2020-01-05 03:28:28 +00:00
|
|
|
void calculate_round_size( nwipe_context_t* );
|
|
|
|
|
|
2017-02-12 22:30:00 +01:00
|
|
|
#endif /* METHOD_H_ */
|
|
|
|
|
|
|
|
|
|
/* eof */
|