Revert "Tweaks for OpenWrt build"

This commit is contained in:
Jonathan Naylor 2019-12-13 08:36:39 +00:00 committed by GitHub
parent d34e8fe941
commit 77cb31fe2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 16 additions and 286 deletions

View file

@ -26,10 +26,8 @@
#include <net/if.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#if defined(__linux__)
#include <linux/if_tun.h>
#include <linux/sockios.h>
#endif
#include <netinet/in.h>
#endif

View file

@ -15,7 +15,6 @@
#define DStarDefines_H
#include <wx/wx.h>
#include "../GlobalDefines.h"
const unsigned int DSTAR_GMSK_SYMBOL_RATE = 4800U;
const float DSTAR_GMSK_BT = 0.5F;

View file

@ -20,7 +20,6 @@
#define Defs_H
#include <wx/wx.h>
#include "../GlobalDefines.h"
const wxString DEXTRA_HOSTS_FILE_NAME = wxT("DExtra_Hosts.txt");
const wxString DPLUS_HOSTS_FILE_NAME = wxT("DPlus_Hosts.txt");

View file

@ -18,12 +18,6 @@
#include "Logger.h"
#if defined(LOG_LOCALTIME) && LOG_LOCALTIME == 1
static const bool utc = false;
#else
static const bool utc = true;
#endif
CLogger::CLogger(const wxString& directory, const wxString& name) :
wxLog(),
m_name(name),
@ -38,12 +32,7 @@ m_day(0)
time_t timestamp;
::time(&timestamp);
struct tm* tm;
if (utc){
tm = ::gmtime(&timestamp);
}else{
tm = ::localtime(&timestamp);
}
struct tm* tm = ::gmtime(&timestamp);
wxString text;
text.Printf(wxT("%s-%04d-%02d-%02d"), m_name.c_str(), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday);
@ -85,12 +74,7 @@ void CLogger::DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogReco
default: letter = wxT("U"); break;
}
struct tm* tm;
if (utc){
tm = ::gmtime(&info.timestamp);
}else{
tm = ::localtime(&info.timestamp);
}
struct tm* tm = ::gmtime(&info.timestamp);
wxString message;
message.Printf(wxT("%s: %04d-%02d-%02d %02d:%02d:%02d: %s\n"), letter.c_str(), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, msg.c_str());
@ -107,12 +91,7 @@ void CLogger::writeLog(const wxChar* msg, time_t timestamp)
wxASSERT(m_file->IsOpened());
wxASSERT(msg != NULL);
struct tm* tm;
if (utc){
tm = ::gmtime(&timestamp);
}else{
tm = ::localtime(&timestamp);
}
struct tm* tm = ::gmtime(&timestamp);
int day = tm->tm_yday;
if (day != m_day) {
@ -133,4 +112,5 @@ void CLogger::writeLog(const wxChar* msg, time_t timestamp)
m_file->Write(wxString(msg));
m_file->Flush();
}
}

View file

@ -31,7 +31,6 @@ wxString CXLXHostsFileDownloader::Download(const wxString & xlxHostsFileURL)
wxLogMessage(_T("Downloading XLX reflector list from %s"), xlxHostsFileURL.c_str());
wxString xlxHostsFileName = wxFileName::CreateTempFileName(_T("XLX_Hosts_"));
wxLogMessage(_T("Downloading XLX host file..."));
wxString commandLine = _T("wget -q -O ") + xlxHostsFileName + _T(" ") + xlxHostsFileURL;
bool execResult = wxShell(commandLine);

View file

@ -1,30 +0,0 @@
#ifndef __GLOBAL_DEFS__
#define __GLOBAL_DEFS__
#if defined(__APPLE__) || defined(LINUX)
#define DATA_DIR "/opt/mmdvm/conf/dstar"
#define LOG_DIR "/opt/mmdvm/logs"
#define CONF_DIR "/opt/mmdvm/conf"
#define CONF_FILE "ircDDBGateway.ini"
#define PID_FILE "/tmp/ircDDBGateway.pid"
#define PID_FILE_T "/tmp/ircDDBGateway_%s.pid"
#elif defined(OPENWRT) && OPENWRT == 1
#define DATA_DIR "/etc/mmdvm/dstar"
#define LOG_DIR "/var/log/mmdvm"
#define CONF_DIR "/etc"
#define CONF_FILE "ircDDBGateway.ini"
#define PID_FILE "/tmp/ircDDBGateway.pid"
#define PID_FILE_T "/tmp/ircDDBGateway_%s.pid"
#else
#define DATA_DIR "/usr/share/ircddbgateway"
#define LOG_DIR "/tmp"
#define CONF_DIR "/etc"
#define CONF_FILE "ircddbgateway"
#define PID_FILE "/var/run/ircddbgateway.pid"
#define PID_FILE_T "/var/run/ircddbgateway_%s.pid"
#endif
#endif

View file

@ -1,70 +0,0 @@
export CXX ?= $(shell wx-config --cxx)
export CFLAGS ?= -O2 -Wall $(shell wx-config --cxxflags) -DLOG_LOCALTIME=1 -DLINUX=1
export GUILIBS ?= $(shell wx-config --libs adv,core,base)
export LIBS ?= $(shell wx-config --libs base)
export LDFLAGS ?=
all: ircDDBGateway/ircddbgatewayd
ircDDBGateway/ircddbgatewayd: Common/Common.a ircDDB/IRCDDB.a
$(MAKE) -C ircDDBGateway
ircDDBGatewayConfig/ircddbgatewayconfig: GUICommon/GUICommon.a Common/Common.a
$(MAKE) -C ircDDBGatewayConfig
APRSTransmit/aprstransmitd: Common/Common.a
$(MAKE) -C APRSTransmit
RemoteControl/remotecontrold: Common/Common.a
$(MAKE) -C RemoteControl
StarNetServer/starnetserverd: Common/Common.a ircDDB/IRCDDB.a
$(MAKE) -C StarNetServer
TextTransmit/texttransmitd: Common/Common.a
$(MAKE) -C TextTransmit
TimerControl/timercontrold: Common/Common.a GUICommon/GUICommon.a
$(MAKE) -C TimerControl
TimeServer/timeserverd: Common/Common.a GUICommon/GUICommon.a
$(MAKE) -C TimeServer
VoiceTransmit/voicetransmitd: Common/Common.a
$(MAKE) -C VoiceTransmit
GUICommon/GUICommon.a:
$(MAKE) -C GUICommon
Common/Common.a:
$(MAKE) -C Common
ircDDB/IRCDDB.a:
$(MAKE) -C ircDDB
install: all
$(MAKE) -C Data install
$(MAKE) -C APRSTransmit install
$(MAKE) -C ircDDBGateway install
$(MAKE) -C RemoteControl install
$(MAKE) -C StarNetServer install
$(MAKE) -C TextTransmit install
$(MAKE) -C TimerControl install
$(MAKE) -C TimeServer install
$(MAKE) -C VoiceTransmit install
$(MAKE) -C ircDDBGatewayConfig install
clean:
$(MAKE) -C Common clean
$(MAKE) -C ircDDB clean
$(MAKE) -C GUICommon clean
$(MAKE) -C APRSTransmit clean
$(MAKE) -C ircDDBGateway clean
$(MAKE) -C RemoteControl clean
$(MAKE) -C StarNetServer clean
$(MAKE) -C TextTransmit clean
$(MAKE) -C TimerControl clean
$(MAKE) -C TimeServer clean
$(MAKE) -C VoiceTransmit clean
$(MAKE) -C ircDDBGatewayConfig clean

View file

@ -1,70 +0,0 @@
# export CXX ?= $(shell wx-config --cxx)
# export CFLAGS ?= -O2 -Wall $(shell wx-config --cxxflags)
# export GUILIBS ?= $(shell wx-config --libs adv,core,base)
# export LIBS ?= $(shell wx-config --libs base)
# export LDFLAGS ?=
all: ircDDBGateway/ircddbgatewayd
ircDDBGateway/ircddbgatewayd: Common/Common.a ircDDB/IRCDDB.a
$(MAKE) -C ircDDBGateway
ircDDBGatewayConfig/ircddbgatewayconfig: GUICommon/GUICommon.a Common/Common.a
$(MAKE) -C ircDDBGatewayConfig
APRSTransmit/aprstransmitd: Common/Common.a
$(MAKE) -C APRSTransmit
RemoteControl/remotecontrold: Common/Common.a
$(MAKE) -C RemoteControl
StarNetServer/starnetserverd: Common/Common.a ircDDB/IRCDDB.a
$(MAKE) -C StarNetServer
TextTransmit/texttransmitd: Common/Common.a
$(MAKE) -C TextTransmit
TimerControl/timercontrold: Common/Common.a GUICommon/GUICommon.a
$(MAKE) -C TimerControl
TimeServer/timeserverd: Common/Common.a GUICommon/GUICommon.a
$(MAKE) -C TimeServer
VoiceTransmit/voicetransmitd: Common/Common.a
$(MAKE) -C VoiceTransmit
GUICommon/GUICommon.a:
$(MAKE) -C GUICommon
Common/Common.a:
$(MAKE) -C Common
ircDDB/IRCDDB.a:
$(MAKE) -C ircDDB
install: all
$(MAKE) -C Data install
$(MAKE) -C APRSTransmit install
$(MAKE) -C ircDDBGateway install
$(MAKE) -C RemoteControl install
$(MAKE) -C StarNetServer install
$(MAKE) -C TextTransmit install
$(MAKE) -C TimerControl install
$(MAKE) -C TimeServer install
$(MAKE) -C VoiceTransmit install
$(MAKE) -C ircDDBGatewayConfig install
clean:
$(MAKE) -C Common clean
$(MAKE) -C ircDDB clean
$(MAKE) -C GUICommon clean
$(MAKE) -C APRSTransmit clean
$(MAKE) -C ircDDBGateway clean
$(MAKE) -C RemoteControl clean
$(MAKE) -C StarNetServer clean
$(MAKE) -C TextTransmit clean
$(MAKE) -C TimerControl clean
$(MAKE) -C TimeServer clean
$(MAKE) -C VoiceTransmit clean
$(MAKE) -C ircDDBGatewayConfig clean

View file

@ -1,70 +0,0 @@
export CXX ?= $(shell wx-config --cxx)
export CFLAGS ?= -O2 -Wall $(shell wx-config --cxxflags) -DLOG_LOCALTIME=1
export GUILIBS ?= $(shell wx-config --libs adv,core,base)
export LIBS ?= $(shell wx-config --libs base)
export LDFLAGS ?=
all: ircDDBGateway/ircddbgatewayd ircDDBGatewayConfig/ircddbgatewayconfig
ircDDBGateway/ircddbgatewayd: Common/Common.a ircDDB/IRCDDB.a
$(MAKE) -C ircDDBGateway
ircDDBGatewayConfig/ircddbgatewayconfig: GUICommon/GUICommon.a Common/Common.a
$(MAKE) -C ircDDBGatewayConfig
APRSTransmit/aprstransmitd: Common/Common.a
$(MAKE) -C APRSTransmit
RemoteControl/remotecontrold: Common/Common.a
$(MAKE) -C RemoteControl
StarNetServer/starnetserverd: Common/Common.a ircDDB/IRCDDB.a
$(MAKE) -C StarNetServer
TextTransmit/texttransmitd: Common/Common.a
$(MAKE) -C TextTransmit
TimerControl/timercontrold: Common/Common.a GUICommon/GUICommon.a
$(MAKE) -C TimerControl
TimeServer/timeserverd: Common/Common.a GUICommon/GUICommon.a
$(MAKE) -C TimeServer
VoiceTransmit/voicetransmitd: Common/Common.a
$(MAKE) -C VoiceTransmit
GUICommon/GUICommon.a:
$(MAKE) -C GUICommon
Common/Common.a:
$(MAKE) -C Common
ircDDB/IRCDDB.a:
$(MAKE) -C ircDDB
install: all
$(MAKE) -C Data install
$(MAKE) -C APRSTransmit install
$(MAKE) -C ircDDBGateway install
$(MAKE) -C RemoteControl install
$(MAKE) -C StarNetServer install
$(MAKE) -C TextTransmit install
$(MAKE) -C TimerControl install
$(MAKE) -C TimeServer install
$(MAKE) -C VoiceTransmit install
$(MAKE) -C ircDDBGatewayConfig install
clean:
$(MAKE) -C Common clean
$(MAKE) -C ircDDB clean
$(MAKE) -C GUICommon clean
$(MAKE) -C APRSTransmit clean
$(MAKE) -C ircDDBGateway clean
$(MAKE) -C RemoteControl clean
$(MAKE) -C StarNetServer clean
$(MAKE) -C TextTransmit clean
$(MAKE) -C TimerControl clean
$(MAKE) -C TimeServer clean
$(MAKE) -C VoiceTransmit clean
$(MAKE) -C ircDDBGatewayConfig clean

View file

@ -42,8 +42,6 @@
#include <signal.h>
#include <fcntl.h>
#include "../GlobalDefines.h"
const wxChar* NAME_PARAM = wxT("Gateway Name");
const wxChar* NOLOGGING_SWITCH = wxT("nolog");
const wxChar* DEBUG_SWITCH = wxT("debug");
@ -124,9 +122,9 @@ int main(int argc, char** argv)
wxString pidFileName;
if (!name.IsEmpty())
pidFileName.Printf(wxT(PID_FILE_T), name.c_str());
pidFileName.Printf(wxT("/var/run/opendv/ircddbgateway_%s.pid"), name.c_str());
else
pidFileName = wxT(PID_FILE);
pidFileName = wxT("/var/run/opendv/ircddbgateway.pid");
pidFileName.Replace(wxT(" "), wxT("_"));
char fileName[128U];
@ -200,7 +198,6 @@ bool CIRCDDBGatewayAppD::init()
new wxLogNull;
}
#if !defined(OPENWRT) || OPENWRT != 1
wxString appName;
if (!m_name.IsEmpty())
appName = APPLICATION_NAME + wxT(" ") + m_name;
@ -214,7 +211,6 @@ bool CIRCDDBGatewayAppD::init()
wxLogError(wxT("Another copy of the ircDDB Gateway is running, exiting"));
return false;
}
#endif
wxLogInfo(wxT("Starting ") + APPLICATION_NAME + wxT(" daemon - ") + VERSION);

View file

@ -20,11 +20,10 @@
#define IRCDDBGatewayDefs_H
#include <wx/wx.h>
#include "../GlobalDefines.h"
const wxString APPLICATION_NAME = wxT("ircDDB Gateway");
const wxString CONFIG_FILE_NAME = wxT(CONF_FILE);
const wxString CONFIG_FILE_NAME = wxT("ircddbgateway");
const wxString STATUS1_FILE_NAME = wxT("status1.txt");
const wxString STATUS2_FILE_NAME = wxT("status2.txt");

View file

@ -693,19 +693,19 @@ void CIRCDDBGatewayThread::processIrcDDB()
case 0:
case 10:
if (m_lastStatus != IS_DISCONNECTED) {
wxLogMessage(wxT("Disconnected from ircDDB"));
wxLogInfo(wxT("Disconnected from ircDDB"));
m_lastStatus = IS_DISCONNECTED;
}
break;
case 7:
if (m_lastStatus != IS_CONNECTED) {
wxLogMessage(wxT("Connected to ircDDB"));
wxLogInfo(wxT("Connected to ircDDB"));
m_lastStatus = IS_CONNECTED;
}
break;
default:
if (m_lastStatus != IS_CONNECTING) {
wxLogMessage(wxT("Connecting to ircDDB"));
wxLogInfo(wxT("Connecting to ircDDB"));
m_lastStatus = IS_CONNECTING;
}
break;
@ -726,13 +726,13 @@ void CIRCDDBGatewayThread::processIrcDDB()
break;
if (!address.IsEmpty()) {
wxLogInfo(wxT("USER: %s %s %s %s"), user.c_str(), repeater.c_str(), gateway.c_str(), address.c_str());
wxLogMessage(wxT("USER: %s %s %s %s"), user.c_str(), repeater.c_str(), gateway.c_str(), address.c_str());
m_cache.updateUser(user, repeater, gateway, address, timestamp, DP_DEXTRA, false, false);
#if defined(ENABLE_NAT_TRAVERSAL)
m_natTraversal->traverseNatG2(address);
#endif
} else {
wxLogInfo(wxT("USER: %s NOT FOUND"), user.c_str());
wxLogMessage(wxT("USER: %s NOT FOUND"), user.c_str());
}
}
break;
@ -745,7 +745,7 @@ void CIRCDDBGatewayThread::processIrcDDB()
CRepeaterHandler::resolveRepeater(repeater, gateway, address, DP_DEXTRA);
if (!address.IsEmpty()) {
wxLogInfo(wxT("REPEATER: %s %s %s"), repeater.c_str(), gateway.c_str(), address.c_str());
wxLogMessage(wxT("REPEATER: %s %s %s"), repeater.c_str(), gateway.c_str(), address.c_str());
m_cache.updateRepeater(repeater, gateway, address, DP_DEXTRA, false, false);
#if defined(ENABLE_NAT_TRAVERSAL)
m_natTraversal->traverseNatG2(address);
@ -765,7 +765,7 @@ void CIRCDDBGatewayThread::processIrcDDB()
CDExtraHandler::gatewayUpdate(gateway, address);
CDPlusHandler::gatewayUpdate(gateway, address);
if (!address.IsEmpty()) {
wxLogInfo(wxT("GATEWAY: %s %s"), gateway.c_str(), address.c_str());
wxLogMessage(wxT("GATEWAY: %s %s"), gateway.c_str(), address.c_str());
m_cache.updateGateway(gateway, address, DP_DEXTRA, false, false);
#if defined(ENABLE_NAT_TRAVERSAL)
m_natTraversal->traverseNatG2(address);
@ -812,7 +812,7 @@ void CIRCDDBGatewayThread::processRepeater(IRepeaterProtocolHandler* handler)
if (!repeater.IsSameAs(user)) {
CRepeaterHandler* handler = CRepeaterHandler::findDVRepeater(repeater);
if (handler == NULL)
wxLogInfo(wxT("Heard received from unknown repeater, %s"), repeater.c_str());
wxLogMessage(wxT("Heard received from unknown repeater, %s"), repeater.c_str());
else
handler->processRepeater(*heard);