#24 add DRats Config

pull/32/head
Geoffrey Merck 4 years ago
parent 0ddbe62b18
commit b5cef98c00

@ -240,6 +240,10 @@ bool CDStarGatewayApp::createThread()
delete restrictList; delete restrictList;
} }
// Drats
TDRats drats;
m_config->getDRats(drats);
// Setup the repeaters // Setup the repeaters
bool ddEnabled = false; bool ddEnabled = false;
bool atLeastOneRepeater = false; bool atLeastOneRepeater = false;
@ -261,7 +265,7 @@ bool CDStarGatewayApp::createThread()
rptrConfig.reflectorReconnect, rptrConfig.reflectorReconnect,
rptrConfig.frequency, rptrConfig.frequency,
#ifdef USE_DRATS #ifdef USE_DRATS
true, drats.enabled,
#endif #endif
rptrConfig.offset, rptrConfig.offset,
rptrConfig.range, rptrConfig.range,

@ -57,6 +57,9 @@ bool CDStarGatewayConfig::load()
#endif #endif
ret = loadDaemon(cfg) && ret; ret = loadDaemon(cfg) && ret;
ret = loadAccessControl(cfg) && ret; ret = loadAccessControl(cfg) && ret;
#ifdef USE_DRATS
ret = loadDRats(cfg) && ret;
#endif
} }
if(ret) { if(ret) {
@ -360,6 +363,15 @@ bool CDStarGatewayConfig::loadAccessControl(const CConfig & cfg)
return ret; return ret;
} }
#ifdef USE_DRATS
bool CDStarGatewayConfig::loadDRats(const CConfig & cfg)
{
bool ret = cfg.getValue("DRats", "enabled", m_drats.enabled, false);
return ret;
}
#endif
bool CDStarGatewayConfig::open(CConfig & cfg) bool CDStarGatewayConfig::open(CConfig & cfg)
{ {
try { try {
@ -466,3 +478,10 @@ void CDStarGatewayConfig::getAccessControl(TAccessControl & accessControl) const
{ {
accessControl = m_accessControl; accessControl = m_accessControl;
} }
#if USE_DRATS
void CDStarGatewayConfig::getDRats(TDRats & drats) const
{
drats = m_drats;
}
#endif

@ -115,6 +115,12 @@ typedef struct {
bool enabled; bool enabled;
} TDCS; } TDCS;
#ifdef USE_DRATS
typedef struct {
bool enabled;
} TDRats;
#endif
typedef struct { typedef struct {
bool enabled; bool enabled;
std::string url; std::string url;
@ -164,6 +170,9 @@ public:
#endif #endif
void getDaemon(TDaemon & gen) const; void getDaemon(TDaemon & gen) const;
void getAccessControl(TAccessControl & accessControl) const; void getAccessControl(TAccessControl & accessControl) const;
#ifdef USE_DRATS
void getDRats(TDRats & drats) const;
#endif
private: private:
bool open(CConfig & cfg); bool open(CConfig & cfg);
@ -183,6 +192,9 @@ private:
#endif #endif
bool loadDaemon(const CConfig & cfg); bool loadDaemon(const CConfig & cfg);
bool loadAccessControl(const CConfig & cfg); bool loadAccessControl(const CConfig & cfg);
#ifdef USE_DRATS
bool loadDRats(const CConfig & cfg);
#endif
std::string m_fileName; std::string m_fileName;
TGateway m_gateway; TGateway m_gateway;
@ -199,6 +211,9 @@ private:
#endif #endif
TDaemon m_daemon; TDaemon m_daemon;
TAccessControl m_accessControl; TAccessControl m_accessControl;
#ifdef USE_DRATS
TDRats m_drats;
#endif
std::vector<TRepeater *> m_repeaters; std::vector<TRepeater *> m_repeaters;
std::vector<TircDDB *> m_ircDDB; std::vector<TircDDB *> m_ircDDB;

@ -172,6 +172,9 @@ enabled=true # There is no reason to disable this
enabled=true enabled=true
hostfileUrl=http://xlxapi.rlx.lu/api.php?do=GetXLXDMRMaster hostfileUrl=http://xlxapi.rlx.lu/api.php?do=GetXLXDMRMaster
[DRats]
enabled=false # Defaults to false. The program need to be compiled with DRats support for DRats to be actually enabled
[Remote] [Remote]
enabled=false enabled=false
port=4242 port=4242

Loading…
Cancel
Save

Powered by TurnKey Linux.