mirror of
https://github.com/g4klx/ircDDBGateway.git
synced 2026-01-06 08:19:59 +01:00
Merge branch 'master' into openwrt
This commit is contained in:
commit
2954b5e9a3
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2014 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010-2014,2018 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2011,2012,2013 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2011,2012,2013,2018 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
|
||||
|
|
@ -22,8 +22,7 @@
|
|||
|
||||
#include <wx/filename.h>
|
||||
|
||||
#if !defined(WIN32)
|
||||
// XXX Check these
|
||||
#if defined(__linux__)
|
||||
#include <net/if.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
|
@ -240,7 +239,7 @@ void CDDHandler::process(CDDData& data)
|
|||
}
|
||||
}
|
||||
|
||||
#if !defined(WIN32)
|
||||
#if defined(__linux__)
|
||||
unsigned int length = data.getEthernetFrame(m_buffer, BUFFER_LENGTH);
|
||||
|
||||
ssize_t len = ::write(m_fd, (char*)m_buffer, length);
|
||||
|
|
@ -255,7 +254,7 @@ CDDData* CDDHandler::read()
|
|||
if (m_maxRoutes == 0U)
|
||||
return NULL;
|
||||
|
||||
#if defined(WIN32)
|
||||
#if !defined(WIN32)
|
||||
return NULL;
|
||||
#else
|
||||
// Check that the read() won't block
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2013,2015 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010-2013,2015,2018 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
|
||||
|
|
@ -28,6 +28,8 @@
|
|||
wxString CXLXHostsFileDownloader::Download(const wxString & xlxHostsFileURL)
|
||||
{
|
||||
#ifdef XLX_USE_WGET
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ wxIMPLEMENT_APP(CIRCDDBGatewayApp);
|
|||
|
||||
const wxChar* NAME_PARAM = wxT("Gateway Name");
|
||||
const wxChar* NOLOGGING_SWITCH = wxT("nolog");
|
||||
const wxChar* DEBUG_SWITCH = wxT("debug");
|
||||
const wxChar* GUI_SWITCH = wxT("gui");
|
||||
const wxChar* LOGDIR_OPTION = wxT("logdir");
|
||||
const wxChar* CONFDIR_OPTION = wxT("confdir");
|
||||
|
|
@ -50,6 +51,7 @@ CIRCDDBGatewayApp::CIRCDDBGatewayApp() :
|
|||
wxApp(),
|
||||
m_name(),
|
||||
m_nolog(false),
|
||||
m_debug(false),
|
||||
m_gui(false),
|
||||
m_logDir(),
|
||||
m_confDir(),
|
||||
|
|
@ -89,6 +91,14 @@ bool CIRCDDBGatewayApp::OnInit()
|
|||
|
||||
wxLog* log = new CLogger(m_logDir, logBaseName);
|
||||
wxLog::SetActiveTarget(log);
|
||||
|
||||
if (m_debug) {
|
||||
wxLog::SetVerbose(true);
|
||||
wxLog::SetLogLevel(wxLOG_Debug);
|
||||
} else {
|
||||
wxLog::SetVerbose(false);
|
||||
wxLog::SetLogLevel(wxLOG_Message);
|
||||
}
|
||||
} else {
|
||||
new wxLogNull;
|
||||
}
|
||||
|
|
@ -174,6 +184,7 @@ int CIRCDDBGatewayApp::OnExit()
|
|||
void CIRCDDBGatewayApp::OnInitCmdLine(wxCmdLineParser& parser)
|
||||
{
|
||||
parser.AddSwitch(NOLOGGING_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddSwitch(DEBUG_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddSwitch(GUI_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddOption(LOGDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddOption(CONFDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
|
|
@ -188,6 +199,7 @@ bool CIRCDDBGatewayApp::OnCmdLineParsed(wxCmdLineParser& parser)
|
|||
return false;
|
||||
|
||||
m_nolog = parser.Found(NOLOGGING_SWITCH);
|
||||
m_debug = parser.Found(DEBUG_SWITCH);
|
||||
m_gui = parser.Found(GUI_SWITCH);
|
||||
|
||||
wxString logDir;
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public:
|
|||
private:
|
||||
wxString m_name;
|
||||
bool m_nolog;
|
||||
bool m_debug;
|
||||
bool m_gui;
|
||||
wxString m_logDir;
|
||||
wxString m_confDir;
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@
|
|||
|
||||
const wxChar* NAME_PARAM = wxT("Gateway Name");
|
||||
const wxChar* NOLOGGING_SWITCH = wxT("nolog");
|
||||
const wxChar* DEBUG_SWITCH = wxT("debug");
|
||||
const wxChar* LOGDIR_OPTION = wxT("logdir");
|
||||
const wxChar* CONFDIR_OPTION = wxT("confdir");
|
||||
const wxChar* DAEMON_SWITCH = wxT("daemon");
|
||||
const wxChar* DEBUG_SWITCH = wxT("debug");
|
||||
|
||||
const wxString LOG_BASE_NAME = wxT("ircDDBGateway");
|
||||
|
||||
|
|
@ -70,8 +70,8 @@ int main(int argc, char** argv)
|
|||
|
||||
wxCmdLineParser parser(argc, argv);
|
||||
parser.AddSwitch(NOLOGGING_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddSwitch(DAEMON_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddSwitch(DEBUG_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddSwitch(DAEMON_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddOption(LOGDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddOption(CONFDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddParam(NAME_PARAM, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
|
|
@ -83,8 +83,8 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
bool nolog = parser.Found(NOLOGGING_SWITCH);
|
||||
bool debug = parser.Found(DEBUG_SWITCH);
|
||||
bool daemon = parser.Found(DAEMON_SWITCH);
|
||||
bool debug = parser.Found(DEBUG_SWITCH);
|
||||
|
||||
wxString logDir;
|
||||
bool found = parser.Found(LOGDIR_OPTION, &logDir);
|
||||
|
|
@ -188,10 +188,11 @@ bool CIRCDDBGatewayAppD::init()
|
|||
|
||||
wxLog* log = new CLogger(m_logDir, logBaseName);
|
||||
wxLog::SetActiveTarget(log);
|
||||
if (m_debug){
|
||||
wxLog::SetVerbose();
|
||||
|
||||
if (m_debug) {
|
||||
wxLog::SetVerbose(true);
|
||||
wxLog::SetLogLevel(wxLOG_Debug);
|
||||
}else{
|
||||
} else {
|
||||
wxLog::SetVerbose(false);
|
||||
wxLog::SetLogLevel(wxLOG_Message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2013 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010-2013,2018 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
|
||||
|
|
|
|||
Loading…
Reference in a new issue