completed logger usage and changed shred task to non-static

This commit is contained in:
2020-09-08 13:01:09 +02:00
parent 730b1205f7
commit 938f267813
5 changed files with 80 additions and 44 deletions

View File

@ -8,7 +8,7 @@
#ifndef REHDD_H_
#define REHDD_H_
#define DRYRUN
//#define DRYRUN
#define WORSE_HOURS 19200 //mark drive if at this limit or beyond
#define WORSE_POWERUP 10000 //mark drive if at this limit or beyond
@ -20,10 +20,15 @@
// Logger Settings
#define LOG_PATH "./reHDD.log"
#define DESCRIPTION "reHDD - Copyright Hendrik Schutter 2020"
#define DEVICE_ID "generic"
#define SOFTWARE_VERSION "alpha"
#define HARDWARE_VERSION "generic"
#define DESCRIPTION "reHDD - Copyright Hendrik Schutter 2020"
#define DEVICE_ID "generic"
#define SOFTWARE_VERSION "alpha"
#define HARDWARE_VERSION "generic"
#define LOG_LEVEL_HIGH //log everything, like drive scann thread
#ifndef LOG_LEVEL_HIGH
#define LOG_LEVEL_LOW //log only user actions and tasks
#endif
#include <iostream>
#include <string>

View File

@ -76,16 +76,22 @@ class Shred
protected:
public:
static void shredDrive(Drive* drive, int* ipSignalFd);
Shred();
~Shred();
void shredDrive(Drive* drive, int* ipSignalFd);
private:
Shred(void);
static inline double calcProgress();
static inline void tfnge_init_iv(struct tfnge_stream *tfe, const void *key, const void *iv);
static inline void tfnge_init(struct tfnge_stream *tfe, const void *key);
static inline void tfng_encrypt_rawblk(TFNG_UNIT_TYPE *O, const TFNG_UNIT_TYPE *I, const TFNG_UNIT_TYPE *K);
static inline void tfnge_emit(void *dst, size_t szdst, struct tfnge_stream *tfe);
unsigned long blockcount = 0UL;
long blockcount_max;
double d32Percent;
inline double calcProgress();
inline void tfnge_init_iv(struct tfnge_stream *tfe, const void *key, const void *iv);
inline void tfnge_init(struct tfnge_stream *tfe, const void *key);
inline void tfng_encrypt_rawblk(TFNG_UNIT_TYPE *O, const TFNG_UNIT_TYPE *I, const TFNG_UNIT_TYPE *K);
inline void tfnge_emit(void *dst, size_t szdst, struct tfnge_stream *tfe);
};