2017-04-20 21:51:30 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2015,2016,2017 by Jonathan Naylor G4KLX
|
|
|
|
|
*
|
|
|
|
|
* 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; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#if !defined(CONF_H)
|
|
|
|
|
#define CONF_H
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2017-05-14 19:14:09 +02:00
|
|
|
struct CTGRewriteStruct {
|
2017-05-03 18:48:55 +02:00
|
|
|
unsigned int m_fromSlot;
|
|
|
|
|
unsigned int m_fromTG;
|
|
|
|
|
unsigned int m_toSlot;
|
|
|
|
|
unsigned int m_toTG;
|
2017-05-15 22:16:52 +02:00
|
|
|
unsigned int m_range;
|
2017-05-03 18:48:55 +02:00
|
|
|
};
|
|
|
|
|
|
2017-05-14 19:14:09 +02:00
|
|
|
struct CPCRewriteStruct {
|
|
|
|
|
unsigned int m_fromSlot;
|
|
|
|
|
unsigned int m_fromId;
|
|
|
|
|
unsigned int m_toSlot;
|
|
|
|
|
unsigned int m_toId;
|
|
|
|
|
unsigned int m_range;
|
|
|
|
|
};
|
|
|
|
|
|
2017-05-15 22:16:52 +02:00
|
|
|
struct CTypeRewriteStruct {
|
|
|
|
|
unsigned int m_fromSlot;
|
2017-05-24 18:46:07 +02:00
|
|
|
unsigned int m_fromTG;
|
2017-05-15 22:16:52 +02:00
|
|
|
unsigned int m_toSlot;
|
2017-05-24 18:46:07 +02:00
|
|
|
unsigned int m_toId;
|
2017-05-15 22:16:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct CSrcRewriteStruct {
|
|
|
|
|
unsigned int m_fromSlot;
|
|
|
|
|
unsigned int m_fromId;
|
|
|
|
|
unsigned int m_toSlot;
|
|
|
|
|
unsigned int m_toTG;
|
2017-05-16 19:42:37 +02:00
|
|
|
unsigned int m_range;
|
2017-05-15 22:16:52 +02:00
|
|
|
};
|
|
|
|
|
|
2017-04-20 21:51:30 +02:00
|
|
|
class CConf
|
|
|
|
|
{
|
|
|
|
|
public:
|
2017-04-23 21:17:25 +02:00
|
|
|
CConf(const std::string& file);
|
|
|
|
|
~CConf();
|
2017-04-20 21:51:30 +02:00
|
|
|
|
2017-04-23 21:17:25 +02:00
|
|
|
bool read();
|
2017-04-20 21:51:30 +02:00
|
|
|
|
2017-04-23 21:17:25 +02:00
|
|
|
// The General section
|
|
|
|
|
bool getDaemon() const;
|
2017-04-20 21:51:30 +02:00
|
|
|
unsigned int getTimeout() const;
|
2017-04-23 21:17:25 +02:00
|
|
|
std::string getRptAddress() const;
|
|
|
|
|
unsigned int getRptPort() const;
|
|
|
|
|
std::string getLocalAddress() const;
|
|
|
|
|
unsigned int getLocalPort() const;
|
|
|
|
|
bool getDebug() const;
|
2017-04-20 21:51:30 +02:00
|
|
|
|
2017-04-23 21:17:25 +02:00
|
|
|
// The Log section
|
|
|
|
|
unsigned int getLogDisplayLevel() const;
|
|
|
|
|
unsigned int getLogFileLevel() const;
|
|
|
|
|
std::string getLogFilePath() const;
|
|
|
|
|
std::string getLogFileRoot() const;
|
2017-04-20 21:51:30 +02:00
|
|
|
|
2017-05-01 15:46:43 +02:00
|
|
|
// The Voice section
|
|
|
|
|
bool getVoiceEnabled() const;
|
|
|
|
|
std::string getVoiceLanguage() const;
|
2017-05-01 21:05:41 +02:00
|
|
|
std::string getVoiceDirectory() const;
|
2017-05-01 15:46:43 +02:00
|
|
|
|
2017-05-03 18:48:55 +02:00
|
|
|
// The DMR Network 1 section
|
|
|
|
|
bool getDMRNetwork1Enabled() const;
|
2017-05-06 10:57:17 +02:00
|
|
|
unsigned int getDMRNetwork1Id() const;
|
2017-05-03 18:48:55 +02:00
|
|
|
std::string getDMRNetwork1Address() const;
|
|
|
|
|
unsigned int getDMRNetwork1Port() const;
|
|
|
|
|
unsigned int getDMRNetwork1Local() const;
|
|
|
|
|
std::string getDMRNetwork1Password() const;
|
2017-05-24 18:42:48 +02:00
|
|
|
std::string getDMRNetwork1Options() const;
|
2017-05-03 18:48:55 +02:00
|
|
|
bool getDMRNetwork1Debug() const;
|
2017-05-15 22:16:52 +02:00
|
|
|
std::vector<CTGRewriteStruct> getDMRNetwork1TGRewrites() const;
|
|
|
|
|
std::vector<CPCRewriteStruct> getDMRNetwork1PCRewrites() const;
|
|
|
|
|
std::vector<CTypeRewriteStruct> getDMRNetwork1TypeRewrites() const;
|
|
|
|
|
std::vector<CSrcRewriteStruct> getDMRNetwork1SrcRewrites() const;
|
2017-05-27 17:50:34 +02:00
|
|
|
std::vector<unsigned int> getDMRNetwork1PassAllPC() const;
|
|
|
|
|
std::vector<unsigned int> getDMRNetwork1PassAllTG() const;
|
2017-05-03 18:48:55 +02:00
|
|
|
|
|
|
|
|
// The DMR Network 2 section
|
|
|
|
|
bool getDMRNetwork2Enabled() const;
|
2017-05-06 10:57:17 +02:00
|
|
|
unsigned int getDMRNetwork2Id() const;
|
2017-05-03 18:48:55 +02:00
|
|
|
std::string getDMRNetwork2Address() const;
|
|
|
|
|
unsigned int getDMRNetwork2Port() const;
|
|
|
|
|
unsigned int getDMRNetwork2Local() const;
|
|
|
|
|
std::string getDMRNetwork2Password() const;
|
2017-05-24 18:42:48 +02:00
|
|
|
std::string getDMRNetwork2Options() const;
|
2017-05-03 18:48:55 +02:00
|
|
|
bool getDMRNetwork2Debug() const;
|
2017-05-15 22:16:52 +02:00
|
|
|
std::vector<CTGRewriteStruct> getDMRNetwork2TGRewrites() const;
|
|
|
|
|
std::vector<CPCRewriteStruct> getDMRNetwork2PCRewrites() const;
|
|
|
|
|
std::vector<CTypeRewriteStruct> getDMRNetwork2TypeRewrites() const;
|
|
|
|
|
std::vector<CSrcRewriteStruct> getDMRNetwork2SrcRewrites() const;
|
2017-05-27 17:50:34 +02:00
|
|
|
std::vector<unsigned int> getDMRNetwork2PassAllPC() const;
|
|
|
|
|
std::vector<unsigned int> getDMRNetwork2PassAllTG() const;
|
2017-04-20 21:51:30 +02:00
|
|
|
|
2017-05-26 14:26:39 +02:00
|
|
|
// The XLX Network 1 section
|
|
|
|
|
bool getXLXNetwork1Enabled() const;
|
|
|
|
|
unsigned int getXLXNetwork1Id() const;
|
|
|
|
|
std::string getXLXNetwork1Address() const;
|
|
|
|
|
unsigned int getXLXNetwork1Port() const;
|
|
|
|
|
unsigned int getXLXNetwork1Local() const;
|
|
|
|
|
std::string getXLXNetwork1Password() const;
|
|
|
|
|
unsigned int getXLXNetwork1Slot() const;
|
|
|
|
|
unsigned int getXLXNetwork1TG() const;
|
|
|
|
|
unsigned int getXLXNetwork1Base() const;
|
2017-05-30 14:42:30 +02:00
|
|
|
unsigned int getXLXNetwork1Startup() const;
|
2017-05-26 14:26:39 +02:00
|
|
|
std::string getXLXNetwork1Options() const;
|
|
|
|
|
bool getXLXNetwork1Debug() const;
|
|
|
|
|
|
|
|
|
|
// The XLX Network 2 section
|
|
|
|
|
bool getXLXNetwork2Enabled() const;
|
|
|
|
|
unsigned int getXLXNetwork2Id() const;
|
|
|
|
|
std::string getXLXNetwork2Address() const;
|
|
|
|
|
unsigned int getXLXNetwork2Port() const;
|
|
|
|
|
unsigned int getXLXNetwork2Local() const;
|
|
|
|
|
std::string getXLXNetwork2Password() const;
|
|
|
|
|
unsigned int getXLXNetwork2Slot() const;
|
|
|
|
|
unsigned int getXLXNetwork2TG() const;
|
|
|
|
|
unsigned int getXLXNetwork2Base() const;
|
2017-05-30 14:42:30 +02:00
|
|
|
unsigned int getXLXNetwork2Startup() const;
|
2017-05-26 14:26:39 +02:00
|
|
|
std::string getXLXNetwork2Options() const;
|
|
|
|
|
bool getXLXNetwork2Debug() const;
|
2017-04-20 21:51:30 +02:00
|
|
|
|
|
|
|
|
private:
|
2017-04-23 21:17:25 +02:00
|
|
|
std::string m_file;
|
|
|
|
|
bool m_daemon;
|
|
|
|
|
std::string m_rptAddress;
|
|
|
|
|
unsigned int m_rptPort;
|
|
|
|
|
std::string m_localAddress;
|
|
|
|
|
unsigned int m_localPort;
|
2017-04-20 21:51:30 +02:00
|
|
|
unsigned int m_timeout;
|
2017-04-23 21:17:25 +02:00
|
|
|
bool m_debug;
|
2017-04-20 21:51:30 +02:00
|
|
|
|
2017-05-01 15:46:43 +02:00
|
|
|
bool m_voiceEnabled;
|
|
|
|
|
std::string m_voiceLanguage;
|
2017-05-01 21:05:41 +02:00
|
|
|
std::string m_voiceDirectory;
|
2017-05-01 15:46:43 +02:00
|
|
|
|
2017-04-23 21:17:25 +02:00
|
|
|
unsigned int m_logDisplayLevel;
|
|
|
|
|
unsigned int m_logFileLevel;
|
|
|
|
|
std::string m_logFilePath;
|
|
|
|
|
std::string m_logFileRoot;
|
2017-04-20 21:51:30 +02:00
|
|
|
|
2017-05-03 18:48:55 +02:00
|
|
|
bool m_dmrNetwork1Enabled;
|
2017-05-06 10:57:17 +02:00
|
|
|
unsigned int m_dmrNetwork1Id;
|
2017-05-03 18:48:55 +02:00
|
|
|
std::string m_dmrNetwork1Address;
|
|
|
|
|
unsigned int m_dmrNetwork1Port;
|
|
|
|
|
unsigned int m_dmrNetwork1Local;
|
|
|
|
|
std::string m_dmrNetwork1Password;
|
2017-05-24 18:42:48 +02:00
|
|
|
std::string m_dmrNetwork1Options;
|
2017-05-03 18:48:55 +02:00
|
|
|
bool m_dmrNetwork1Debug;
|
2017-05-15 22:16:52 +02:00
|
|
|
std::vector<CTGRewriteStruct> m_dmrNetwork1TGRewrites;
|
|
|
|
|
std::vector<CPCRewriteStruct> m_dmrNetwork1PCRewrites;
|
|
|
|
|
std::vector<CTypeRewriteStruct> m_dmrNetwork1TypeRewrites;
|
|
|
|
|
std::vector<CSrcRewriteStruct> m_dmrNetwork1SrcRewrites;
|
2017-05-27 17:50:34 +02:00
|
|
|
std::vector<unsigned int> m_dmrNetwork1PassAllPC;
|
|
|
|
|
std::vector<unsigned int> m_dmrNetwork1PassAllTG;
|
2017-05-03 18:48:55 +02:00
|
|
|
|
|
|
|
|
bool m_dmrNetwork2Enabled;
|
2017-05-06 10:57:17 +02:00
|
|
|
unsigned int m_dmrNetwork2Id;
|
2017-05-03 18:48:55 +02:00
|
|
|
std::string m_dmrNetwork2Address;
|
|
|
|
|
unsigned int m_dmrNetwork2Port;
|
|
|
|
|
unsigned int m_dmrNetwork2Local;
|
|
|
|
|
std::string m_dmrNetwork2Password;
|
2017-05-24 18:42:48 +02:00
|
|
|
std::string m_dmrNetwork2Options;
|
2017-05-03 18:48:55 +02:00
|
|
|
bool m_dmrNetwork2Debug;
|
2017-05-15 22:16:52 +02:00
|
|
|
std::vector<CTGRewriteStruct> m_dmrNetwork2TGRewrites;
|
|
|
|
|
std::vector<CPCRewriteStruct> m_dmrNetwork2PCRewrites;
|
|
|
|
|
std::vector<CTypeRewriteStruct> m_dmrNetwork2TypeRewrites;
|
|
|
|
|
std::vector<CSrcRewriteStruct> m_dmrNetwork2SrcRewrites;
|
2017-05-27 17:50:34 +02:00
|
|
|
std::vector<unsigned int> m_dmrNetwork2PassAllPC;
|
|
|
|
|
std::vector<unsigned int> m_dmrNetwork2PassAllTG;
|
2017-04-20 21:51:30 +02:00
|
|
|
|
2017-05-26 14:26:39 +02:00
|
|
|
bool m_xlxNetwork1Enabled;
|
|
|
|
|
unsigned int m_xlxNetwork1Id;
|
|
|
|
|
std::string m_xlxNetwork1Address;
|
|
|
|
|
unsigned int m_xlxNetwork1Port;
|
|
|
|
|
unsigned int m_xlxNetwork1Local;
|
|
|
|
|
std::string m_xlxNetwork1Password;
|
|
|
|
|
unsigned int m_xlxNetwork1Slot;
|
|
|
|
|
unsigned int m_xlxNetwork1TG;
|
|
|
|
|
unsigned int m_xlxNetwork1Base;
|
2017-05-30 14:42:30 +02:00
|
|
|
unsigned int m_xlxNetwork1Startup;
|
2017-05-26 14:26:39 +02:00
|
|
|
std::string m_xlxNetwork1Options;
|
|
|
|
|
bool m_xlxNetwork1Debug;
|
|
|
|
|
|
|
|
|
|
bool m_xlxNetwork2Enabled;
|
|
|
|
|
unsigned int m_xlxNetwork2Id;
|
|
|
|
|
std::string m_xlxNetwork2Address;
|
|
|
|
|
unsigned int m_xlxNetwork2Port;
|
|
|
|
|
unsigned int m_xlxNetwork2Local;
|
|
|
|
|
std::string m_xlxNetwork2Password;
|
|
|
|
|
unsigned int m_xlxNetwork2Slot;
|
|
|
|
|
unsigned int m_xlxNetwork2TG;
|
|
|
|
|
unsigned int m_xlxNetwork2Base;
|
2017-05-30 14:42:30 +02:00
|
|
|
unsigned int m_xlxNetwork2Startup;
|
2017-05-26 14:26:39 +02:00
|
|
|
std::string m_xlxNetwork2Options;
|
|
|
|
|
bool m_xlxNetwork2Debug;
|
2017-04-20 21:51:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|