2017-01-21 12:46:45 +01:00
|
|
|
#pragma once
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
class jconf
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static jconf* inst()
|
|
|
|
{
|
|
|
|
if (oInst == nullptr) oInst = new jconf;
|
|
|
|
return oInst;
|
|
|
|
};
|
|
|
|
|
|
|
|
bool parse_config(const char* sFilename);
|
|
|
|
|
|
|
|
struct thd_cfg {
|
|
|
|
size_t index;
|
|
|
|
size_t intensity;
|
|
|
|
size_t w_size;
|
|
|
|
long long cpu_aff;
|
|
|
|
};
|
|
|
|
|
|
|
|
size_t GetThreadCount();
|
|
|
|
bool GetThreadConfig(size_t id, thd_cfg &cfg);
|
|
|
|
|
|
|
|
size_t GetPlatformIdx();
|
|
|
|
|
2017-02-22 23:49:55 +01:00
|
|
|
bool GetTlsSetting();
|
|
|
|
bool TlsSecureAlgos();
|
|
|
|
const char* GetTlsFingerprint();
|
|
|
|
|
2017-01-21 12:46:45 +01:00
|
|
|
const char* GetPoolAddress();
|
|
|
|
const char* GetPoolPwd();
|
|
|
|
const char* GetWalletAddress();
|
|
|
|
|
|
|
|
uint64_t GetVerboseLevel();
|
|
|
|
uint64_t GetAutohashTime();
|
|
|
|
|
2017-02-22 23:49:55 +01:00
|
|
|
const char* GetOutputFile();
|
|
|
|
|
2017-01-21 12:46:45 +01:00
|
|
|
uint64_t GetCallTimeout();
|
|
|
|
uint64_t GetNetRetry();
|
2017-02-22 23:49:55 +01:00
|
|
|
uint64_t GetGiveUpLimit();
|
2017-01-21 12:46:45 +01:00
|
|
|
|
|
|
|
uint16_t GetHttpdPort();
|
|
|
|
|
|
|
|
bool PreferIpv4();
|
|
|
|
|
|
|
|
inline bool HaveHardwareAes() { return bHaveAes; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
jconf();
|
|
|
|
static jconf* oInst;
|
|
|
|
|
|
|
|
bool check_cpu_features();
|
|
|
|
struct opaque_private;
|
|
|
|
opaque_private* prv;
|
|
|
|
|
|
|
|
bool bHaveAes;
|
|
|
|
};
|