commit
3d9f23e3b4
@ -0,0 +1,281 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 by Geoffrey Merck F4FXL / KC3FRA
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
|
#include "Utils.h"
|
||||||
|
#include "Config.h"
|
||||||
|
#include "Log.h"
|
||||||
|
|
||||||
|
CConfig::CConfig(const std::string filename) :
|
||||||
|
m_filename(filename)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CConfig::~CConfig()
|
||||||
|
{
|
||||||
|
for(auto it = m_sections.begin(); it != m_sections.end(); it++) {
|
||||||
|
delete it->second;
|
||||||
|
}
|
||||||
|
m_sections.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CConfig::load()
|
||||||
|
{
|
||||||
|
std::ifstream file;
|
||||||
|
file.open(m_filename, std::ios::in);
|
||||||
|
if(!file.is_open()) {
|
||||||
|
CLog::logError("Failed to open configuration file %s", m_filename);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
CConfigSection * currentSection = nullptr;
|
||||||
|
while(!file.eof()) {
|
||||||
|
std::string line;
|
||||||
|
std::getline(file, line);
|
||||||
|
stripComment(line);
|
||||||
|
|
||||||
|
if(isConfigSection(line)) {
|
||||||
|
auto it = m_sections.find(line);
|
||||||
|
currentSection = it != m_sections.end() ? it->second : nullptr;
|
||||||
|
|
||||||
|
if(currentSection == nullptr) {
|
||||||
|
currentSection = new CConfigSection(line);
|
||||||
|
m_sections[currentSection->getName()] = currentSection;
|
||||||
|
}
|
||||||
|
} else if(isConfigValue(line) && currentSection != nullptr) {
|
||||||
|
TConfigValue * configValue = readKeyAndValue(line);
|
||||||
|
if(configValue != nullptr) {
|
||||||
|
currentSection->getValues()[configValue->m_key] = configValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
file.close();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CConfig::stripComment(std::string& s) const
|
||||||
|
{
|
||||||
|
boost::trim(s);
|
||||||
|
|
||||||
|
if(s.length() > 0 && s[0] == '#') {
|
||||||
|
//we have a lien consisting only of comment, truncate it and leave
|
||||||
|
s.resize(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
char * sdup = strdup(s.c_str());
|
||||||
|
char * uncommentedPart = strtok(sdup, "#");
|
||||||
|
|
||||||
|
s = std::string(uncommentedPart != nullptr ? uncommentedPart : "");
|
||||||
|
|
||||||
|
boost::trim(s);
|
||||||
|
|
||||||
|
free(sdup);// could we use delete sdup here?
|
||||||
|
}
|
||||||
|
|
||||||
|
TConfigValue * CConfig::readKeyAndValue(const std::string s) const
|
||||||
|
{
|
||||||
|
TConfigValue* res = nullptr;
|
||||||
|
|
||||||
|
char * sdup = strdup(boost::trim_copy(s).c_str());
|
||||||
|
|
||||||
|
char * keyPtr = strtok(sdup, "=");
|
||||||
|
std::string key(keyPtr != nullptr ? keyPtr : "");
|
||||||
|
|
||||||
|
boost::trim(key);
|
||||||
|
|
||||||
|
if(!key.empty()) {
|
||||||
|
char * valuePtr = strtok(nullptr, "=");
|
||||||
|
std::string value(valuePtr != nullptr? valuePtr : "");
|
||||||
|
|
||||||
|
res = new TConfigValue;
|
||||||
|
res->m_key = key;
|
||||||
|
res->m_value = boost::trim_copy(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
free(sdup);// could we use delete sdup here?
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CConfig::getValue(const std::string §ion, const std::string& key, bool &value, bool defaultValue) const
|
||||||
|
{
|
||||||
|
std::string valueTemp;
|
||||||
|
std::string dafaultValueStr = defaultValue ? "true" : "false";
|
||||||
|
bool ret = getValue(section, key, valueTemp, dafaultValueStr, {"true", "1", "false", "0"});
|
||||||
|
if(ret) {
|
||||||
|
if(isSameNoCase(valueTemp, std::string("true")) || valueTemp == "1")
|
||||||
|
value = true;
|
||||||
|
else if(isSameNoCase(valueTemp, std::string("false")) || valueTemp == "0")
|
||||||
|
value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CConfig::getValue(const std::string §ion, const std::string& key, int &value, int min, int max, int defaultValue) const
|
||||||
|
{
|
||||||
|
TConfigValue * val = lookupValue(section, key);
|
||||||
|
if(val == nullptr || val->m_value.empty()) {
|
||||||
|
value = defaultValue;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isDecimalInteger(val->m_value)){
|
||||||
|
CLog::logError("Configuration error: %s.%s is not a valid number (%s)", section.c_str(), key.c_str(), val->m_value.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int tmpValue = std::strtol(val->m_value.c_str(), nullptr, 10);
|
||||||
|
|
||||||
|
if(tmpValue < min || tmpValue > max) {
|
||||||
|
CLog::logError("Configuration error: %s.%s is out of range must be between %d and %d, actual %d", section.c_str(), key.c_str(), min, max, tmpValue);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = tmpValue;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CConfig::getValue(const std::string §ion, const std::string& key, double &value, double min, double max, double defaultValue) const
|
||||||
|
{
|
||||||
|
TConfigValue * val = lookupValue(section, key);
|
||||||
|
if(val == nullptr || val->m_value.empty()) {
|
||||||
|
value = defaultValue;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isFloatingPoint(val->m_value)){
|
||||||
|
CLog::logError("Configuration error: %s.%s is not a valid floating point number (%s)", section.c_str(), key.c_str(), val->m_value.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
double tmpValue = std::strtold(val->m_value.c_str(), nullptr);
|
||||||
|
|
||||||
|
if(tmpValue < min || tmpValue > max) {
|
||||||
|
CLog::logError("Configuration error: %s.%s is out of range must be between %f and %f, actual %f", section.c_str(), key.c_str(), min, max, tmpValue);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = tmpValue;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CConfig::getValue(const std::string §ion, const std::string& key, unsigned int &value, unsigned int min, unsigned int max, int defaultValue) const
|
||||||
|
{
|
||||||
|
TConfigValue * val = lookupValue(section, key);
|
||||||
|
if(val == nullptr || val->m_value.empty()) {
|
||||||
|
value = defaultValue;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isDecimalInteger(val->m_value)){
|
||||||
|
CLog::logError("Configuration error: %s.%s is not a valid number (%s)", section.c_str(), key.c_str(), val->m_value.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int tmpValue = std::strtol(val->m_value.c_str(), nullptr, 10);
|
||||||
|
|
||||||
|
if(tmpValue < min || tmpValue > max) {
|
||||||
|
CLog::logError("Configuration error: %s.%s is out of range must be between %u and %u, actual %u", section.c_str(), key.c_str(), min, max, tmpValue);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = tmpValue;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CConfig::getValue(const std::string §ion, const std::string& key, std::string &value, unsigned int minLen, unsigned int maxLen, const std::string defaultValue) const
|
||||||
|
{
|
||||||
|
TConfigValue * val = lookupValue(section, key);
|
||||||
|
std::string valueTemp = val != nullptr ? val->m_value : defaultValue;
|
||||||
|
|
||||||
|
if(valueTemp.empty() && minLen == 0U)
|
||||||
|
valueTemp = defaultValue;
|
||||||
|
|
||||||
|
if(valueTemp.length() < minLen || valueTemp.length() > maxLen) {
|
||||||
|
CLog::logError("Configuration error: %s.%s has an invalid length, length must be between %u and %u, actual %u", section.c_str(), key.c_str(), minLen, maxLen, valueTemp.length());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = valueTemp;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CConfig::getValue(const std::string §ion, const std::string& key, unsigned char &value, unsigned char min, unsigned char max,unsigned char defaultValue) const
|
||||||
|
{
|
||||||
|
unsigned int tempValue;
|
||||||
|
bool ret = getValue(section, key, tempValue, (unsigned int)min, (unsigned int)max, (unsigned int) defaultValue);
|
||||||
|
if(ret) {
|
||||||
|
value = (unsigned char)tempValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CConfig::getValue(const std::string §ion, const std::string& key, std::string &value, const std::string defaultValue, const std::vector<std::string>& allowedValues) const
|
||||||
|
{
|
||||||
|
std::string valueTemp;
|
||||||
|
if(getValue(section, key, valueTemp, 0U, 2048, defaultValue)) {
|
||||||
|
for(auto s : allowedValues) {
|
||||||
|
if(isSameNoCase(s, valueTemp)) {
|
||||||
|
value = CUtils::ToLower(valueTemp);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build error message
|
||||||
|
std::stringstream allowedValuesStreamStr;
|
||||||
|
for(auto s : allowedValues) {
|
||||||
|
allowedValuesStreamStr << s << ", ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// We want nice looking error message, so get rid of trailing ", "
|
||||||
|
std::string allowedValuesStr = allowedValuesStreamStr.str();
|
||||||
|
allowedValuesStr.resize(allowedValuesStr.length() - 2);
|
||||||
|
|
||||||
|
CLog::logError("Configuration error: %s.%s has an invalid value, valid values are: %s. Actual: %s", section.c_str(), key.c_str(), allowedValuesStr.c_str(), valueTemp.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
TConfigValue * CConfig::lookupValue(const std::string& sectionName, const std::string& key) const
|
||||||
|
{
|
||||||
|
TConfigValue * res = nullptr;
|
||||||
|
std::string sectionNameTemp = sectionName;
|
||||||
|
|
||||||
|
// Make sure we have brackets around section names
|
||||||
|
if(sectionNameTemp[0] != '[') sectionNameTemp = "[" + sectionNameTemp;
|
||||||
|
if(sectionNameTemp[sectionNameTemp.length() - 1] != ']') sectionNameTemp.push_back(']');
|
||||||
|
|
||||||
|
auto itSection = m_sections.find(sectionNameTemp);
|
||||||
|
|
||||||
|
if(itSection != m_sections.end()) {
|
||||||
|
auto itValue = itSection->second->getValues().find(key);
|
||||||
|
if(itValue != itSection->second->getValues().end()) {
|
||||||
|
res = itValue->second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 by Geoffrey Merck F4FXL / KC3FRA
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <utility>
|
||||||
|
#include <cctype>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cassert>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#define isConfigSection(s)(!s.empty() && s[0] == '[' && s[s.length() - 1] == ']')
|
||||||
|
#define isConfigValue(s)(s.find('=') != std::string::npos && s.find('#') > s.find('='))
|
||||||
|
#define isSameNoCase(a,b)(strcasecmp(a.c_str(), b.c_str()) == 0)
|
||||||
|
#define isDecimalInteger(s)(!s.empty() && (s[0] == '-' || std::isdigit(s[0])) && std::find_if(s.begin(), s.end(), [](unsigned char c) { return !(std::isdigit(c) || c == '-'); }) == s.end())
|
||||||
|
#define isFloatingPoint(s)(!s.empty() && (s[0] == '-' || std::isdigit(s[0])) && std::find_if(s.begin(), s.end(), [](unsigned char c) { return !(std::isdigit(c) || c == '-' || c == '.'); }) == s.end())
|
||||||
|
|
||||||
|
// https://www.programmingnotes.org/6504/c-how-to-make-map-unordered-map-keys-case-insensitive-using-c/
|
||||||
|
struct case_insensitive_unordered_map {
|
||||||
|
struct comp {
|
||||||
|
bool operator() (const std::string& lhs, const std::string& rhs) const {
|
||||||
|
// On non Windows OS, use the function "strcasecmp" in #include <strings.h>
|
||||||
|
return strcasecmp(lhs.c_str(), rhs.c_str()) == 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
struct hash {
|
||||||
|
std::size_t operator() (std::string str) const {
|
||||||
|
for (std::size_t index = 0; index < str.size(); ++index) {
|
||||||
|
auto ch = static_cast<unsigned char>(str[index]);
|
||||||
|
str[index] = static_cast<unsigned char>(std::tolower(ch));
|
||||||
|
}
|
||||||
|
return std::hash<std::string>{}(str);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
std::string m_key;
|
||||||
|
std::string m_value;
|
||||||
|
} TConfigValue;
|
||||||
|
|
||||||
|
typedef std::unordered_map<std::string, TConfigValue *, case_insensitive_unordered_map::hash, case_insensitive_unordered_map::comp> CConfigValuesMap;
|
||||||
|
|
||||||
|
class CConfigSection {
|
||||||
|
public:
|
||||||
|
CConfigSection(const std::string name) :
|
||||||
|
m_name(name)
|
||||||
|
{
|
||||||
|
assert(!name.empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
~CConfigSection()
|
||||||
|
{
|
||||||
|
for(auto it = m_values.begin();it != m_values.end();it++) {
|
||||||
|
delete it->second;
|
||||||
|
}
|
||||||
|
m_values.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getName() const
|
||||||
|
{
|
||||||
|
return m_name;
|
||||||
|
}
|
||||||
|
CConfigValuesMap & getValues()
|
||||||
|
{
|
||||||
|
return m_values;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
std::string m_name;
|
||||||
|
CConfigValuesMap m_values;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef std::unordered_map<std::string, CConfigSection *, case_insensitive_unordered_map::hash, case_insensitive_unordered_map::comp> CConfigSectionsMap;
|
||||||
|
|
||||||
|
class CConfig
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CConfig(const std::string filename);
|
||||||
|
~CConfig();
|
||||||
|
|
||||||
|
bool load();
|
||||||
|
bool getValue(const std::string §ion, const std::string& key, bool &value, bool defaultValue) const;
|
||||||
|
bool getValue(const std::string §ion, const std::string& key, int &value, int min, int max, int defaultValue) const;
|
||||||
|
bool getValue(const std::string §ion, const std::string& key, double &value, double min, double max, double defaultValue) const;
|
||||||
|
bool getValue(const std::string §ion, const std::string& key, unsigned int &value, unsigned int min, unsigned int max,int defaultValue) const;
|
||||||
|
bool getValue(const std::string §ion, const std::string& key, unsigned char &value, unsigned char min, unsigned char max,unsigned char defaultValue) const;
|
||||||
|
bool getValue(const std::string §ion, const std::string& key, std::string &value, unsigned int minLen, unsigned int maxLen, const std::string defaultValue) const;
|
||||||
|
bool getValue(const std::string §ion, const std::string& key, std::string &value, const std::string defaultValue, const std::vector<std::string>& allowedValues) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void stripComment(std::string& s) const;
|
||||||
|
TConfigValue * readKeyAndValue(const std::string s) const;
|
||||||
|
TConfigValue * lookupValue(const std::string& section, const std::string& key) const;
|
||||||
|
|
||||||
|
std::string m_filename;
|
||||||
|
CConfigSectionsMap m_sections;
|
||||||
|
};
|
||||||
@ -1,100 +1,169 @@
|
|||||||
gateway = {
|
# The configuration format is quite straight forward. It is organised in sections and key/value pairs.
|
||||||
type= # repeater, hotspot, dongle. Defaults to repeater
|
# The order of the sections or key/values pairs inside the sections does not matter nor does casing.
|
||||||
callsign = "N0CALL"
|
# Boolean values can be set using true, false, 1 or 0
|
||||||
address = "" # this is the computer interface for the outgoing connection. Usually leave it blank and it will use whatever is avaiable.
|
# Floating point values must use . (point) as decimal separator
|
||||||
icomAddress="172.16.0.20"
|
|
||||||
icomPort=20000
|
[Gateway]
|
||||||
hbAddress="127.0.0.1" #address to use for connectin with homebrew repeaters (MMDVMHost, DStarRepeater)
|
type= # repeater, hotspot, dongle. Defaults to repeater
|
||||||
hbPort=20010
|
callsign=
|
||||||
latitude=""
|
address=0.0.0.0 # this is the computer interface for the outgoing connection. Usually leave it blank and it will use whatever is avaiable.
|
||||||
longitude=""
|
icomAddress=172.16.0.20
|
||||||
description1=""
|
icomPort=20000
|
||||||
description2=""
|
hbAddress= #address to use for connecting to the homebrew repeaters (MMDVMHost, DStarRepeater), defaults to 127.0.0.1
|
||||||
url=""
|
hbPort=20010
|
||||||
language= # "english_uk", "deutsch", "dansk", "francais", "italiano", "polski", "english_us", "espanol", "svenska", "nederlands_nl", "nederlands_be", "norsk", "portugues"
|
latitude=0.0
|
||||||
}
|
longitude=0.0
|
||||||
|
description1=
|
||||||
# NOTHING usually needs to be specified in the ircddb section
|
description2=
|
||||||
# If nothing is specified, defaults to openquad
|
url=
|
||||||
ircddb = ( #ircddb networks in paretheses
|
language= # valid values: english_uk, deutsch, dansk, francais, italiano, polski, english_us, espanol, svenska, nederlands_nl, nederlands_be, norsk, portugues
|
||||||
# {
|
|
||||||
# hostname = "ipv4.openquad.net"
|
#up to 4 ircddb networks can be specified
|
||||||
# username = "CHNGME" # The ircDDB username default to the value defined for server.callsign.
|
[ircddb_1]
|
||||||
# password = ""
|
enabled=true
|
||||||
# },
|
hostname=ircv4.openquad.net
|
||||||
# {
|
username= # The ircDDB username default to the value defined for gateway callsign.
|
||||||
# hostname = "xx.ircddb.net"
|
password=
|
||||||
# username = "CHNGME" # The ircDDB username default to the value defined for server.callsign.
|
|
||||||
# password = ""
|
[ircddb_2]
|
||||||
# }
|
enabled=false
|
||||||
)
|
hostname=
|
||||||
|
username= # The ircDDB username defaults to the value defined for gateway callsign.
|
||||||
repeaters = ( # The modules list is contained in parentheses
|
password=
|
||||||
|
|
||||||
{ # Up to 15 different modules can be specified, each in curly brackets
|
[ircddb_3]
|
||||||
band = "B" # Each module has to have a band letter
|
hostname=false
|
||||||
callsign = "" # Has to be less than 8 characters, if empty gateway call will be used
|
username=CHNGME # The ircDDB username defaults to the value defined for gateway callsign.
|
||||||
address = "" # address where the repeater can be found, if left empty defaults to 127.0.0.1
|
password=
|
||||||
port=20011
|
|
||||||
type="hb" # hb or icom
|
[ircddb_4]
|
||||||
reflector=""
|
hostname=false
|
||||||
reflectorAtStartup=true
|
username=CHNGME # The ircDDB username defaults to the value defined for gateway callsign.
|
||||||
reflectorReconnect= # never, fixed, 5, 10, 15, 20, 25, 30, 60, 90, 120, 180
|
password=
|
||||||
frequency=434.00000
|
|
||||||
offset=9.00000
|
# up to 4 repeaters can be added
|
||||||
rangeKm=0.1
|
[Repeater_1]
|
||||||
latitude=""
|
enabled=true
|
||||||
longitude=""
|
band=B # Each module has to have a band letter
|
||||||
agl=""
|
callsign= # Has to be less than 8 characters, if empty gateway call will be used
|
||||||
description1=""
|
address= # address where the repeater can be found, if left empty defaults to 127.0.0.1
|
||||||
description2=""
|
port=20011
|
||||||
url=""
|
type=hb # valid values: hb or icom
|
||||||
band1=""
|
reflector=
|
||||||
band2=""
|
reflectorAtStartup= # if reflector is set, this defaults to true
|
||||||
band3=""
|
reflectorReconnect=30 # valid values: never, fixed, 5, 10, 15, 20, 25, 30, 60, 90, 120, 180
|
||||||
# }, # be sure there is a comma between repeaters
|
frequency=434.0
|
||||||
# { # Up to 15 different modules can be specified, each in curly brackets
|
offset=-1.6
|
||||||
# band = "C" # Each module has to have a band letter
|
rangeKm=20
|
||||||
# callsign = "N0CALL" # Has to be less than 8 characters
|
latitude=0.0
|
||||||
# port=20012
|
longitude=0.0
|
||||||
# }
|
agl=
|
||||||
}
|
description1=
|
||||||
) # close paren to close out the module defines
|
description2=
|
||||||
|
url=
|
||||||
aprs = {
|
band1=
|
||||||
enabled=true
|
band2=
|
||||||
hostname="rotate.aprs2.net" # Defaults to rotate.aprs2.net
|
band3=
|
||||||
port=14580 # Defaults to 14580, there is no reason to change this
|
|
||||||
password="1234"
|
[Repeater_2]
|
||||||
}
|
enabled=false
|
||||||
|
band= # Each module has to have a band letter
|
||||||
paths = {
|
callsign= # Has to be less than 8 characters, if empty gateway call will be used
|
||||||
log="/var/log/dstargateway/"
|
address= # address where the repeater can be found, if left empty defaults to 127.0.0.1
|
||||||
data="/usr/local/share/dstargateway/" #Path where the data (hostfiles, audio files etc) can be found
|
port=20012
|
||||||
}
|
type=hb # hb or icom
|
||||||
|
reflector=
|
||||||
dextra = {
|
reflectorAtStartup=true
|
||||||
enabled=true # There is no reason to disable this
|
reflectorReconnect=30 # never, fixed, 5, 10, 15, 20, 25, 30, 60, 90, 120, 180
|
||||||
maxDongles=5
|
frequency=434.0
|
||||||
}
|
offset=-1.6
|
||||||
|
rangeKm=20
|
||||||
dplus = {
|
latitude=0.0
|
||||||
enabled=true # There is no reason to disable this
|
longitude=0.0
|
||||||
maxDongles=5
|
agl=
|
||||||
login="" # defaults to gateway callsign
|
description1=
|
||||||
}
|
description2=
|
||||||
|
url=
|
||||||
dcs = {
|
band1=
|
||||||
enabled=true # There is no reason to disable this
|
band2=
|
||||||
}
|
band3=
|
||||||
|
|
||||||
xlx = {
|
[Repeater_3]
|
||||||
enabled=true
|
enabled=false
|
||||||
hostfileUrl="http://xlxapi.rlx.lu/api.php?do=GetXLXDMRMaster"
|
band= # Each module has to have a band letter
|
||||||
}
|
callsign= # Has to be less than 8 characters, if empty gateway call will be used
|
||||||
|
address= # address where the repeater can be found, if left empty defaults to 127.0.0.1
|
||||||
remote = {
|
port=20013
|
||||||
enabled=false
|
type=hb # hb or icom
|
||||||
port=4242
|
reflector=DCS208 C
|
||||||
password="CHANGE_ME" # If password is left blank, remote will be disabled regardless of the enabled field
|
reflectorAtStartup=true
|
||||||
}
|
reflectorReconnect=30 # never, fixed, 5, 10, 15, 20, 25, 30, 60, 90, 120, 180
|
||||||
|
frequency=434.0
|
||||||
|
offset=-1.6
|
||||||
|
rangeKm=20
|
||||||
|
latitude=0.0
|
||||||
|
longitude=0.0
|
||||||
|
agl=
|
||||||
|
description1=
|
||||||
|
description2=
|
||||||
|
url=
|
||||||
|
band1=
|
||||||
|
band2=
|
||||||
|
band3=
|
||||||
|
|
||||||
|
[Repeater_4]
|
||||||
|
enabled=false
|
||||||
|
band= # Each module has to have a band letter
|
||||||
|
callsign= # Has to be less than 8 characters, if empty gateway call will be used
|
||||||
|
address= # address where the repeater can be found, if left empty defaults to 127.0.0.1
|
||||||
|
port=20014
|
||||||
|
type=hb # hb or icom
|
||||||
|
reflector=DCS208 C
|
||||||
|
reflectorAtStartup=true
|
||||||
|
reflectorReconnect=30 # never, fixed, 5, 10, 15, 20, 25, 30, 60, 90, 120, 180
|
||||||
|
frequency=434.0
|
||||||
|
offset=-1.6
|
||||||
|
rangeKm=20
|
||||||
|
latitude=0.0
|
||||||
|
longitude=0.0
|
||||||
|
agl=
|
||||||
|
description1=
|
||||||
|
description2=
|
||||||
|
url=
|
||||||
|
band1=
|
||||||
|
band2=
|
||||||
|
band3=
|
||||||
|
|
||||||
|
[APRS]
|
||||||
|
enabled=true
|
||||||
|
hostname=rotate.aprs2.net # Defaults to rotate.aprs2.net
|
||||||
|
port=14580 # Defaults to 14580, there is no reason to change this
|
||||||
|
password=12345
|
||||||
|
|
||||||
|
[Log]
|
||||||
|
path=/var/log/dstargateway/
|
||||||
|
|
||||||
|
[Paths]
|
||||||
|
data=/usr/local/share/dstargateway.d/ #Path where the data (hostfiles, audio files etc) can be found
|
||||||
|
|
||||||
|
[DExtra]
|
||||||
|
enabled=true # There is no reason to disable this
|
||||||
|
maxDongles=5
|
||||||
|
|
||||||
|
[DPlus]
|
||||||
|
enabled=true # There is no reason to disable this
|
||||||
|
maxDongles=5
|
||||||
|
login=F4FXL # defaults to gateway callsign
|
||||||
|
|
||||||
|
[DCS]
|
||||||
|
enabled=true # There is no reason to disable this
|
||||||
|
|
||||||
|
[XLX]
|
||||||
|
enabled=true
|
||||||
|
hostfileUrl=http://xlxapi.rlx.lu/api.php?do=GetXLXDMRMaster
|
||||||
|
|
||||||
|
[Remote]
|
||||||
|
enabled=false
|
||||||
|
port=4242
|
||||||
|
password=CHANGE_ME # If password is left blank, remote will be disabled regardless of the enabled field
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in new issue