+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+
+ 18.0
+ BPQ32.EXE
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}
+ BPQWinAPP
+ 10.0
+
+
+
+ Application
+ v145
+ false
+
+
+ Application
+ v145
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>18.0.12106.202
+
+
+ c:\DevProgs\BPQ32VS2026\
+ C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(Configuration)\
+ false
+
+
+ C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(Configuration)\
+ C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(Configuration)\
+ true
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ Win32
+ .\Debug/BPQWinAPP.tlb
+
+
+
+ Disabled
+ C:\Users\johnw\OneDrive\Dev\Source\bpq32\Commonsource;C:\Users\johnw\OneDrive\Dev\Source\bpq32\CInclude;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDebug
+ .\Debug/BPQWinAPP.pch
+ $(IntDir)
+ $(IntDir)
+ $(IntDir)
+ Level3
+ true
+ ProgramDatabase
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0809
+
+
+ Win32bits\bpq32.lib;DbgHelp.lib;%(AdditionalDependencies)
+ c:\DevProgs\BPQ32VS2026\bpq32.exe
+ true
+ true
+ .\Debug/bpq32.pdb
+ true
+ Windows
+ 0
+ 0
+ MachineX86
+
+
+ true
+ .\Debug/BPQWinAPP.bsc
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ Win32
+ .\Release/BPQWinAPP.tlb
+
+
+
+ MinSpace
+ Default
+ C:\Users\johnw\OneDrive\Dev\Source\bpq32\Commonsource;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+ MultiThreaded
+ true
+ C:\msdev2005\Intermed\Release/BPQWinAPP.pch
+ $(IntDir)
+ $(IntDir)
+ $(IntDir)
+ Level3
+ true
+ EditAndContinue
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0809
+
+
+ Win32bits\bpq32.lib;DbgHelp.lib;%(AdditionalDependencies)
+ c:\DevProgs\bpq32\bpq32.exe
+ true
+ true
+ c:\DevProgs\bpq32\bpq32app.pdb
+ true
+ c:\DevProgs\bpq32\bpq32app.map
+ Windows
+ MachineX86
+
+
+ true
+ .\Release/BPQWinAPP.bsc
+
+
+
+
+ Disabled
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BUILDING.md b/BUILDING.md
new file mode 100644
index 0000000..4c6b206
--- /dev/null
+++ b/BUILDING.md
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+Building LinBPQ from source
+
+
+
+BPQ Home BPQ32 Home
+
+Building LinBPQ from source.
+
+
+I provide binaries for Linux on 32 and 64 bit ARM and Intel x86 processors but if you want to run on other Unix like operating systems you can build it from source. You will need to install some dependencies and download the source. The instructions below are for a Debian like system using apt as its package manager - you may need to alter the command for other systems.
+
+To download dependencies run:
+
+
sudo apt install build-essential git libminiupnpc-dev libconfig-dev libpcap-dev zlib1g-dev libcap2-bin libjansson-dev libpaho-mqtt-dev libbacktrace-dev
+
+
+Some distributions may not include libpaho-mqtt-dev and/or libbacktrace-dev. The former is used for the MQTT reporting interface. If you don't need that you can build without MQTT support. If you do you can build libpaho-mqtt-dev from source:
+
+sudo apt install cmake
+git clone https://github.com/eclipse/paho.mqtt.c.git
+cd paho.mqtt.c
+cmake -Bbuild -H. -DPAHO_ENABLE_TESTING=OFF -DPAHO_BUILD_STATIC=ON -DPAHO_WITH_SSL=OFF -DPAHO_HIGH_PERFORMANCE=ON -DCMAKE_INSTALL_PREFIX=../install
+cd build
+cmake --build . --target install
+
+You need to copy libpaho-mqtt3a.a to your lib directory.
+The commands below work on my ARM and Intel systems but you may need to change if your lib is in a different place.
+
+sudo cp src/libpaho-mqtt3a.a /usr/lib/arm-linux-gnueabihf
+or
+sudo cp src/libpaho-mqtt3a.a /usr/lib/i386-linux-gnu/
+
+If libbacktrace isn't available you can build it:
+
+git clone https://github.com/ianlancetaylor/libbacktrace.git
+cd libbacktrace
+mkdir build
+cd build
+../configure
+make
+sudo make install
+
+
+To download the LinBPQ source run:
+
+git clone https://github.com/g8bpq/linbpq.git
+cd linbpq
+
+To build with MQTT support enter:
+
+make
+
+
+To build without MQTT support enter:
+
+make nomqtt
+
+This should create linbpq in the current directory.
+
+
+
+
+John Wiseman G8BPQ
+April 2025
+Updated September 2026
+
+
+
\ No newline at end of file
diff --git a/Bpq32.c b/Bpq32.c
index d7370c1..5652e1f 100644
--- a/Bpq32.c
+++ b/Bpq32.c
@@ -1340,6 +1340,11 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// More fixes for timer problem introduced in v33 (38)
// Changes to INP3 poison reverse and alias reporting (39)
// L4 Connect Ack now sent via routing table (39)
+// Debug info is now written to a log file rather than syslog (Linux) or Debugview (Windows) (40)
+// Backtrace now includes source file info and is written to Debug log (40)
+// Add Telnet Server config option "noWebSocks" to disable use of Websocks for Terminal and Driver windows (41)
+// Log outpur from running disconnect script (41)
+// Prevent Rigcontrol scan from changing frequency when PTT is active (41)
#define CKernel
@@ -1723,7 +1728,7 @@ int VECTORLENGTH = sizeof (struct _BPQVECSTRUC);
int FirstEntry = 1;
BOOL CloseLast = TRUE; // If the user started BPQ32.exe, don't close it when other programs close
-BOOL Closing = FALSE; // Set if Close All called - prevents respawning bpq32.exe
+extern BOOL Closing = FALSE; // Set if Close All called - prevents respawning bpq32.exe
BOOL BPQ32_EXE; // Set if Process is running BPQ32.exe. Not initialised.
// Used to Kill surplus BPQ32.exe processes
@@ -1841,7 +1846,6 @@ void LoadToolHelperRoutines()
{
HINSTANCE ExtDriver=0;
int err;
- char msg[100];
ExtDriver=LoadLibrary("kernel32.dll");
@@ -2125,6 +2129,10 @@ VOID MonitorTimerThread(int x)
VOID WritetoTraceSupport(struct TNCINFO * TNC, char * Msg, int Len);
+VOID * _Q_REM_NP(VOID *PQ, char * File, int Line);
+
+#define Q_REM_NP(s) _Q_REM_NP(s, __FILE__, __LINE__)
+
void Semaphored100msCode()
{
// code that doesn't need to run every tick - run every 100 mS
@@ -2156,9 +2164,9 @@ void Semaphored100msCode()
while (WritetoConsoleQ)
{
- UINT * Buffer = Q_REM(&WritetoConsoleQ);
+ UINT * Buffer = Q_REM_NP(&WritetoConsoleQ);
WritetoConsoleSupport((char *)&Buffer[2]);
- RelBuff(Buffer);
+ free(Buffer);
}
@@ -2753,9 +2761,6 @@ Tell_Sessions()
BOOL APIENTRY DllMain(HANDLE hInst, DWORD ul_reason_being_called, LPVOID lpReserved)
{
- DWORD n;
- char buf[350];
-
int i;
unsigned int ProcessID;
@@ -3120,7 +3125,6 @@ SkipInit:
{
if (PIDArray[i] == ProcessID)
{
- char Log[80];
hWndArray[i] = 0;
DeleteMenu(trayMenu,TRAYBASEID+i,MF_BYCOMMAND);
}
@@ -3567,8 +3571,6 @@ HANDLE OpenConfigFile(char *fn)
UCHAR Value[MAX_PATH];
FILETIME LastWriteTime;
SYSTEMTIME Time;
- char Msg[256];
-
// If no directory, use current
if (BPQDirectory[0] == 0)
@@ -5546,24 +5548,23 @@ DllExport int APIENTRY WritetoConsole(char * buff)
DllExport VOID * APIENTRY GetBuff();
+int C_Q_ADD_NP(VOID *PQ, VOID *PBUFF);
+
int WritetoConsoleLocal(char * buff)
{
int len=strlen(buff);
UINT * buffptr;
- if (Semaphore.Flag == 0)
- return WritetoConsoleSupport(buff);
-
- buffptr = GetBuff();
+ buffptr = (UINT *)zalloc(512);
if (buffptr == 0) // No buffers, so send direct
- return WritetoConsoleSupport(buff);
+ return 0;
if (len > 300)
len = 300;
memcpy(&buffptr[2], buff, len + 1);
- C_Q_ADD(&WritetoConsoleQ, buffptr);
+ C_Q_ADD_NP(&WritetoConsoleQ, buffptr);
return 0;
}
@@ -6337,7 +6338,6 @@ DllExport BOOL APIENTRY SaveReg(char * KeyIn, HANDLE hFile)
{
if (len > 76)
{
- len += sprintf(&RegLine[len], "\\\r\n", RegLine);
strcat(RegLine, "\\\r\n");
WriteFile(hFile, RegLine, len, &written, NULL);
strcpy(RegLine, " ");
diff --git a/CBPQ32.sln b/CBPQ32.sln
index eabbb30..d9b2153 100644
--- a/CBPQ32.sln
+++ b/CBPQ32.sln
@@ -13,36 +13,65 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CBPQ32", "CBPQ32.vcproj", "
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPQChat", "BPQChat.vcproj", "{2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPQTerminal", "BPQTerminal.vcproj", "{04F2B9AD-4369-49EA-82EC-3C701C97C6D8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPQTermTCP", "BPQTermTCP.vcproj", "{99625C77-CABA-469A-A5A7-ECB4EE354225}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
+ Relase Static|Win32 = Relase Static|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Debug|Win32.ActiveCfg = Debug|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Debug|Win32.Build.0 = Debug|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Relase Static|Win32.Build.0 = Release|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Release|Win32.ActiveCfg = Release|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Release|Win32.Build.0 = Release|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Debug|Win32.ActiveCfg = Debug|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Debug|Win32.Build.0 = Debug|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Relase Static|Win32.Build.0 = Release|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Release|Win32.ActiveCfg = Release|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Release|Win32.Build.0 = Release|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B665}.Debug|Win32.ActiveCfg = Debug|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B665}.Debug|Win32.Build.0 = Debug|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B665}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B665}.Relase Static|Win32.Build.0 = Release|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B665}.Release|Win32.ActiveCfg = Release|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B665}.Release|Win32.Build.0 = Release|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B666}.Debug|Win32.ActiveCfg = Debug|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B666}.Debug|Win32.Build.0 = Debug|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B666}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B666}.Relase Static|Win32.Build.0 = Release|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B666}.Release|Win32.ActiveCfg = Release|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B666}.Release|Win32.Build.0 = Release|Win32
{8EFA1E59-8654-4A23-8102-AA77A074D57C}.Debug|Win32.ActiveCfg = Debug|Win32
{8EFA1E59-8654-4A23-8102-AA77A074D57C}.Debug|Win32.Build.0 = Debug|Win32
+ {8EFA1E59-8654-4A23-8102-AA77A074D57C}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {8EFA1E59-8654-4A23-8102-AA77A074D57C}.Relase Static|Win32.Build.0 = Release|Win32
{8EFA1E59-8654-4A23-8102-AA77A074D57C}.Release|Win32.ActiveCfg = Release|Win32
{8EFA1E59-8654-4A23-8102-AA77A074D57C}.Release|Win32.Build.0 = Release|Win32
{2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Debug|Win32.ActiveCfg = Debug|Win32
{2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Debug|Win32.Build.0 = Debug|Win32
+ {2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Relase Static|Win32.Build.0 = Release|Win32
{2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Release|Win32.ActiveCfg = Release|Win32
{2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Release|Win32.Build.0 = Release|Win32
+ {04F2B9AD-4369-49EA-82EC-3C701C97C6D8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {04F2B9AD-4369-49EA-82EC-3C701C97C6D8}.Debug|Win32.Build.0 = Debug|Win32
+ {04F2B9AD-4369-49EA-82EC-3C701C97C6D8}.Relase Static|Win32.ActiveCfg = Relase Static|Win32
+ {04F2B9AD-4369-49EA-82EC-3C701C97C6D8}.Relase Static|Win32.Build.0 = Relase Static|Win32
+ {04F2B9AD-4369-49EA-82EC-3C701C97C6D8}.Release|Win32.ActiveCfg = Release|Win32
+ {04F2B9AD-4369-49EA-82EC-3C701C97C6D8}.Release|Win32.Build.0 = Release|Win32
+ {99625C77-CABA-469A-A5A7-ECB4EE354225}.Debug|Win32.ActiveCfg = Debug|Win32
+ {99625C77-CABA-469A-A5A7-ECB4EE354225}.Debug|Win32.Build.0 = Debug|Win32
+ {99625C77-CABA-469A-A5A7-ECB4EE354225}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {99625C77-CABA-469A-A5A7-ECB4EE354225}.Relase Static|Win32.Build.0 = Release|Win32
+ {99625C77-CABA-469A-A5A7-ECB4EE354225}.Release|Win32.ActiveCfg = Release|Win32
+ {99625C77-CABA-469A-A5A7-ECB4EE354225}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/CBPQ32.vcproj b/CBPQ32.vcproj
index e211ac4..6a48af8 100644
--- a/CBPQ32.vcproj
+++ b/CBPQ32.vcproj
@@ -2,7 +2,7 @@
-
+
Debug
@@ -11,22 +11,24 @@
+ 18.0
+ BPQ32.DLL
{8EFA1E59-8654-4A23-8102-AA77A074D57C}
CBPQ32
Win32Proj
- 10.0.17763.0
+ 10.0
DynamicLibrary
- v141
+ v145
NotSet
false
DynamicLibrary
- v141
- MultiByte
+ v145
+ NotSet
@@ -40,16 +42,17 @@
- <_ProjectFileVersion>15.0.28127.55
+ <_ProjectFileVersion>18.0.12106.202
- $(SolutionDir)$(Configuration)\
- C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(Configuration)\
+ c:\DevProgs\BPQ32VS2026\
+ C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(Configuration)\
true
+ bpq32
- $(SolutionDir)$(Configuration)\
- C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(Configuration)\
+ Win32bits\
+ C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(Configuration)\
false
@@ -60,8 +63,8 @@
Disabled
- ..\CInclude;..\CommonSource;..\CKernel;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_WINDOWS;_USRDLL;BPQ32_EXPORTS;MDIKERNEL;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)
+ ..\BPQSource\Win32bits;..\BPQSource;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;_USRDLL;BPQ32_EXPORTS;MDIKERNEL;_USE_32BIT_TIME_T;BPQ32;NOMQTT;%(PreprocessorDefinitions)
true
EnableFastChecks
MultiThreadedDebug
@@ -74,11 +77,11 @@
/section:_BPQDATA,srw %(AdditionalOptions)
- WS2_32.Lib;winmm.lib;DbgHelp.lib;comctl32.lib;Iphlpapi.lib;setupapi.lib;..\lib\libconfig.lib;miniupnpc.lib;zlibstat.lib;%(AdditionalDependencies)
- c:\DevProgs\BPQ32\bpq32.dll
+ WS2_32.Lib;winmm.lib;DbgHelp.lib;comctl32.lib;Iphlpapi.lib;setupapi.lib;C:\OneDrive\Dev\Source\bpq32\libconfig\Release\libconfig.LIB;C:\Users\johnw\Downloads\upnpc-exe-win32-20220515\miniupnpc.lib;zlibstat.lib;%(AdditionalDependencies)
+ c:\DevProgs\BPQ32VS2026\bpq32.dll
false
LIBCMTD.lib;%(IgnoreSpecificDefaultLibraries)
- ..\CommonSource\bpq32.def
+ ..\BPQSource\bpq32.def
true
true
c:\DevProgs\BPQ32\bpqdev.map
@@ -89,7 +92,7 @@
false
0x42000000
- ..\lib\bpq32.lib
+ Win32bits\bpq32.lib
MachineX86
false
@@ -114,8 +117,8 @@
/D "MDIKERNEL" %(AdditionalOptions)
Disabled
false
- ..\CInclude;..\CommonSource;..\CKernel;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_WINDOWS;_USRDLL;BPQ32_EXPORTS;MDIKERNEL;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)
+ ..\BPQSource\Win32bits;..\BPQSource;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;_USRDLL;BPQ32_EXPORTS;MDIKERNEL;_USE_32BIT_TIME_T;NOMQTT;%(PreprocessorDefinitions)
MultiThreaded
All
@@ -125,9 +128,9 @@
/section:_BPQDATA,srw %(AdditionalOptions)
- WS2_32.Lib;winmm.lib;DbgHelp.lib;comctl32.lib;setupapi.lib;..\lib\libconfig.lib;miniupnpc.lib;zlibstat.lib;%(AdditionalDependencies)
- C:\DevProgs\BPQ32\bpq32.dll
- ..\CommonSource\bpq32.def
+ WS2_32.Lib;winmm.lib;comctl32.lib;setupapi.lib;Win32bits\libconfig.lib;miniupnpc.lib;zlibstat.lib;DbgHelp.lib;%(AdditionalDependencies)
+ c:\DevProgs\BPQ32\bpq32.dll
+ ..\BPQSource\bpq32.def
true
c:\DevProgs\BPQ32\bpq32.pdb
true
@@ -149,14 +152,17 @@
+
+
+
@@ -167,14 +173,23 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -189,8 +204,29 @@
+
+ CompileAsC
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -214,7 +250,7 @@
-
+
diff --git a/CBPQ322026.sln b/CBPQ322026.sln
new file mode 100644
index 0000000..ad64694
--- /dev/null
+++ b/CBPQ322026.sln
@@ -0,0 +1,84 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 18
+VisualStudioVersion = 18.10.12201.205 stable
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPQ32.EXE", "BPQWinAPP.vcxproj", "{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinmorControl", "WinmorControl.vcxproj", "{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPQMail", "BPQMail.vcxproj", "{3766AA10-C777-4ED8-A83D-F1452DE9B665}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LinBPQ", "MailNode.vcxproj", "{3766AA10-C777-4ED8-A83D-F1452DE9B666}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPQ32.DLL", "CBPQ32.vcxproj", "{8EFA1E59-8654-4A23-8102-AA77A074D57C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPQChat", "BPQChat.vcxproj", "{2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPQTerminal", "BPQTerminal.vcxproj", "{04F2B9AD-4369-49EA-82EC-3C701C97C6D8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPQTermTCP", "BPQTermTCP.vcxproj", "{99625C77-CABA-469A-A5A7-ECB4EE354225}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Relase Static|Win32 = Relase Static|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Debug|Win32.ActiveCfg = Debug|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Debug|Win32.Build.0 = Debug|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Relase Static|Win32.Build.0 = Release|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Release|Win32.ActiveCfg = Release|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Release|Win32.Build.0 = Release|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Debug|Win32.ActiveCfg = Debug|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Debug|Win32.Build.0 = Debug|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Relase Static|Win32.Build.0 = Release|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Release|Win32.ActiveCfg = Release|Win32
+ {005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Release|Win32.Build.0 = Release|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B665}.Debug|Win32.ActiveCfg = Debug|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B665}.Debug|Win32.Build.0 = Debug|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B665}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B665}.Relase Static|Win32.Build.0 = Release|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B665}.Release|Win32.ActiveCfg = Release|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B665}.Release|Win32.Build.0 = Release|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B666}.Debug|Win32.ActiveCfg = Debug|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B666}.Debug|Win32.Build.0 = Debug|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B666}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B666}.Relase Static|Win32.Build.0 = Release|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B666}.Release|Win32.ActiveCfg = Release|Win32
+ {3766AA10-C777-4ED8-A83D-F1452DE9B666}.Release|Win32.Build.0 = Release|Win32
+ {8EFA1E59-8654-4A23-8102-AA77A074D57C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8EFA1E59-8654-4A23-8102-AA77A074D57C}.Debug|Win32.Build.0 = Debug|Win32
+ {8EFA1E59-8654-4A23-8102-AA77A074D57C}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {8EFA1E59-8654-4A23-8102-AA77A074D57C}.Relase Static|Win32.Build.0 = Release|Win32
+ {8EFA1E59-8654-4A23-8102-AA77A074D57C}.Release|Win32.ActiveCfg = Release|Win32
+ {8EFA1E59-8654-4A23-8102-AA77A074D57C}.Release|Win32.Build.0 = Release|Win32
+ {2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Debug|Win32.Build.0 = Debug|Win32
+ {2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Relase Static|Win32.Build.0 = Release|Win32
+ {2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Release|Win32.ActiveCfg = Release|Win32
+ {2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Release|Win32.Build.0 = Release|Win32
+ {04F2B9AD-4369-49EA-82EC-3C701C97C6D8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {04F2B9AD-4369-49EA-82EC-3C701C97C6D8}.Debug|Win32.Build.0 = Debug|Win32
+ {04F2B9AD-4369-49EA-82EC-3C701C97C6D8}.Relase Static|Win32.ActiveCfg = Relase Static|Win32
+ {04F2B9AD-4369-49EA-82EC-3C701C97C6D8}.Relase Static|Win32.Build.0 = Relase Static|Win32
+ {04F2B9AD-4369-49EA-82EC-3C701C97C6D8}.Release|Win32.ActiveCfg = Release|Win32
+ {04F2B9AD-4369-49EA-82EC-3C701C97C6D8}.Release|Win32.Build.0 = Release|Win32
+ {99625C77-CABA-469A-A5A7-ECB4EE354225}.Debug|Win32.ActiveCfg = Debug|Win32
+ {99625C77-CABA-469A-A5A7-ECB4EE354225}.Debug|Win32.Build.0 = Debug|Win32
+ {99625C77-CABA-469A-A5A7-ECB4EE354225}.Relase Static|Win32.ActiveCfg = Release|Win32
+ {99625C77-CABA-469A-A5A7-ECB4EE354225}.Relase Static|Win32.Build.0 = Release|Win32
+ {99625C77-CABA-469A-A5A7-ECB4EE354225}.Release|Win32.ActiveCfg = Release|Win32
+ {99625C77-CABA-469A-A5A7-ECB4EE354225}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {FB815A29-A2DD-470A-B0AF-7188AA0F4C7F}
+ EndGlobalSection
+EndGlobal
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..9dcfb88
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 3.18)
+
+project(LinBPQ)
+
+# Our Project
+
+set(CMAKE_C_FLAGS "-DLINBPQ -g -fcommon -fasynchronous-unwind-tables")
+
+set(SOURCE_FILES
+pngwtran.c pngrtran.c pngset.c pngrio.c pngwio.c pngtrans.c pngrutil.c pngwutil.c
+ pngread.c pngwrite.c png.c pngerror.c pngget.c pngmem.c APRSIconData.c AISCommon.c
+ upnp.c APRSStdPages.c HSMODEM.c WinRPR.c KISSHF.c TNCEmulators.c bpqhdlc.c SerialPort.c
+ adif.c WebMail.c utf8Routines.c VARA.c LzFind.c Alloc.c LzmaDec.c LzmaEnc.c LzmaLib.c
+ Multicast.c ARDOP.c IPCode.c FLDigi.c linether.c CMSAuth.c APRSCode.c BPQtoAGW.c KAMPactor.c
+ AEAPactor.c HALDriver.c MULTIPSK.c BBSHTMLConfig.c ChatHTMLConfig.c BBSUtilities.c bpqaxip.c
+ BPQINP3.c BPQNRR.c cMain.c Cmd.c CommonCode.c HTMLCommonCode.c compatbits.c config.c datadefs.c
+ FBBRoutines.c HFCommon.c Housekeeping.c HTTPcode.c kiss.c L2Code.c L3Code.c L4Code.c lzhuf32.c
+ MailCommands.c MailDataDefs.c LinBPQ.c MailRouting.c MailTCP.c MBLRoutines.c md5.c Moncode.c
+ NNTPRoutines.c RigControl.c TelnetV6.c WINMOR.c TNCCode.c UZ7HODrv.c WPRoutines.c
+ SCSTrackeMulti.c SCSPactor.c SCSTracker.c HanksRT.c UIRoutines.c AGWAPI.c AGWMoncode.c
+ DRATS.c FreeDATA.c base64.c Events.c nodeapi.c mailapi.c mqtt.c RHP.c NETROMTCP.c)
+
+add_executable(${PROJECT_NAME} ${SOURCE_FILES})
+
diff --git a/Cmd.c b/Cmd.c
index b7faab9..a4d8c02 100644
--- a/Cmd.c
+++ b/Cmd.c
@@ -4326,6 +4326,45 @@ VOID NRRCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct C
return;
}
+VOID SendNRPing(struct DEST_LIST * DEST, TRANSPORTENTRY * Session);
+
+VOID NRPING(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct CMDX * UserCMD)
+{
+ // Send Paula's NCMP PING command = Netrom Ping
+
+ char * ptr, *Context;
+ struct DEST_LIST * Dest = DESTS;
+ int count = MAXDESTS;
+
+ ptr = strtok_s(CmdTail, " ", &Context);
+
+ if (ptr)
+ {
+ UCHAR AXCall[8];
+ int count;
+
+ ConvToAX25(ptr, AXCall);
+ strcat(ptr, " ");
+
+ for (count = 0; count < MAXDESTS; count++)
+ {
+ if (memcmp(Dest->DEST_ALIAS, ptr, 6) == 0 || CompareCalls(Dest->DEST_CALL, AXCall))
+ {
+ SendNRPing(Dest, Session);
+ memcpy(Bufferptr, OKMSG, 3);
+ Bufferptr += 3;
+ SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER));
+
+ return;
+ }
+ Dest++;
+ }
+ }
+ Bufferptr = Cmdprintf(Session, Bufferptr, "Not found\r");
+ SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER));
+ return;
+}
+
int CHECKINTERLOCK(struct PORTCONTROL * OURPORT)
{
// See if any Interlocked ports are Busy
@@ -4884,6 +4923,7 @@ struct CMDX COMMANDS[] =
"AXMHEARD ",3,AXMHEARD,0,
"TELSTATUS ",3,SHOWTELNET,0,
"NRR ",1,NRRCMD,0,
+ "NPING ",1,NRPING,0,
"PING ",2,PING,0,
"AGWSTATUS ",3,SHOWAGW,0,
"ARP ",3,SHOWARP,0,
diff --git a/CommonCode.c b/CommonCode.c
index 2708e79..3559135 100644
--- a/CommonCode.c
+++ b/CommonCode.c
@@ -3829,6 +3829,7 @@ int __sync_lock_test_and_set(int * ptr, int val)
#define GetSemaphore(Semaphore,ID) _GetSemaphore(Semaphore, ID, __FILE__, __LINE__)
+BOOL Closing;
void _GetSemaphore(struct SEM * Semaphore, int ID, char * File, int Line)
{
@@ -3843,7 +3844,7 @@ void _GetSemaphore(struct SEM * Semaphore, int ID, char * File, int Line)
loop1:
- while (Semaphore->Flag != 0)
+ while (Semaphore->Flag != 0 && Closing == 0)
{
Sleep(10);
}
@@ -3904,41 +3905,54 @@ USHORT WINAPI RtlCaptureStackBackTrace(
*/
#endif
-void printStack(void)
+void printStack()
{
-#ifdef WIN32
-#ifdef _DEBUG // So we can use on 98/2K
-
- unsigned int i;
- void * stack[ 100 ];
+#ifdef BPQ32
+ unsigned int i, n;
+ void * stack[ 100 ];
unsigned short frames;
- SYMBOL_INFO * symbol;
- HANDLE process;
- Debugprintf("Stack Backtrace");
+ DWORD dwDisplacement;
+ IMAGEHLP_LINE64 line;
+ char * fptr;
+ HANDLE process;
+
+
+ char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR)];
+ PSYMBOL_INFO symbol = (PSYMBOL_INFO)buffer;
+
+ symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
+ symbol->MaxNameLen = MAX_SYM_NAME;
+
+ Debugprintf("Stack Backtrace\r\n");
process = GetCurrentProcess();
+ SymSetOptions(SYMOPT_LOAD_LINES);
SymInitialize( process, NULL, TRUE );
- frames = RtlCaptureStackBackTrace( 0, 60, stack, NULL );
- symbol = ( SYMBOL_INFO * )calloc( sizeof( SYMBOL_INFO ) + 256 * sizeof( char ), 1 );
- symbol->MaxNameLen = 255;
- symbol->SizeOfStruct = sizeof( SYMBOL_INFO );
+ frames = RtlCaptureStackBackTrace(0, 60, stack, NULL );
for( i = 0; i < frames; i++ )
{
- SymFromAddr( process, ( DWORD64 )( stack[ i ] ), 0, symbol );
+ n = SymGetLineFromAddr64(process, (DWORD64)stack[i], &dwDisplacement, &line);
+ n = SymFromAddr( process, ( DWORD64 )( stack[ i ] ), 0, symbol );
- Debugprintf( "%i: %s - %p", frames - i - 1, symbol->Name, symbol->Address );
- }
+ if (line.FileName)
+ {
+ fptr = line.FileName + (int)strlen(line.FileName); // remove path
+ while (*fptr != '\\' && *fptr != '/')
+ fptr--;
- free(symbol);
+ fptr++;
-#endif
+ Debugprintf("%i: %s - %s Line %d Addr %p", frames - i - 1, symbol->Name, fptr, line.LineNumber, symbol->Address );
+ }
+ }
#endif
}
+
pthread_t ResolveUpdateThreadId = 0;
char NodeMapServer[80] = "update.g8bpq.net";
diff --git a/DragSize.cur b/DragSize.cur
new file mode 100644
index 0000000..a33158a
Binary files /dev/null and b/DragSize.cur differ
diff --git a/HTTPcode.c b/HTTPcode.c
index 4068a48..1a50fed 100644
--- a/HTTPcode.c
+++ b/HTTPcode.c
@@ -885,7 +885,7 @@ VOID HTTPTimer()
OutBuffer = &Msg[0];
}
- // If secure session enable an hidden controls
+ // If secure session enable any hidden controls
if (sock->WebSecure)
{
@@ -2026,7 +2026,7 @@ int InnerProcessHTTPMessage(struct ConnectionInfo * conn)
strcpy(URL, MsgPtr);
- WebSock = strstr(MsgPtr, "Upgrade: websocket");
+ WebSock = stristr(MsgPtr, "Upgrade: websocket");
encPtr = stristr(MsgPtr, "Accept-Encoding:");
@@ -2035,7 +2035,7 @@ int InnerProcessHTTPMessage(struct ConnectionInfo * conn)
else
Encoding[0] = 0;
- ptr = strstr(MsgPtr, "BPQSessionCookie=N");
+ ptr = stristr(MsgPtr, "BPQSessionCookie=N");
if (ptr)
{
@@ -2080,7 +2080,7 @@ int InnerProcessHTTPMessage(struct ConnectionInfo * conn)
// "Sec-WebSocket-Protocol: chat\r\n"
"\r\n";
- ptr = strstr(MsgPtr, "Sec-WebSocket-Key:");
+ ptr = stristr(MsgPtr, "Sec-WebSocket-Key:");
if (ptr)
{
@@ -3398,18 +3398,18 @@ doHeader:
" if (\"WebSocket\" in window)"
" {"
" // Let us open a web socket. Get address from URL\r\n"
-
+
" var proto = (window.location.protocol === 'https:') ? 'wss://' : 'ws://';\r\n"
" ws = new WebSocket(proto + window.location.host + '/RIGCTL');\r\n"
-
+
" ws.onopen = function() {\r\n"
-
+
" // Web Socket is connected\r\n"
" const div = document.getElementById('div');\r\n"
" div.innerHTML = 'Websock Connected'\r\n"
" };\r\n"
-
+
" ws.onmessage = function (evt)"
" {"
" var received_msg = evt.data;\r\n"
@@ -3442,7 +3442,7 @@ doHeader:
"Waiting for data...
\r\n"
"