6.0.23.27
This commit is contained in:
parent
f4bc43f75d
commit
6c6848bdcb
146
APRSCode.c
146
APRSCode.c
|
@ -99,12 +99,16 @@ BOOL ProcessConfig();
|
||||||
int ProcessAISMessage(char * msg, int len);
|
int ProcessAISMessage(char * msg, int len);
|
||||||
int read_png(unsigned char *bytes);
|
int read_png(unsigned char *bytes);
|
||||||
VOID sendandcheck(SOCKET sock, const char * Buffer, int Len);
|
VOID sendandcheck(SOCKET sock, const char * Buffer, int Len);
|
||||||
|
void SaveAPRSMessage(struct APRSMESSAGE * ptr);
|
||||||
|
void ClearSavedMessages();
|
||||||
|
void GetSavedAPRSMessages();
|
||||||
|
|
||||||
extern int SemHeldByAPI;
|
extern int SemHeldByAPI;
|
||||||
extern int APRSMONDECODE();
|
extern int APRSMONDECODE();
|
||||||
extern struct ConsoleInfo MonWindow;
|
extern struct ConsoleInfo MonWindow;
|
||||||
extern char VersionString[];
|
extern char VersionString[];
|
||||||
|
|
||||||
|
BOOL SaveAPRSMsgs = 0;
|
||||||
|
|
||||||
BOOL LogAPRSIS = FALSE;
|
BOOL LogAPRSIS = FALSE;
|
||||||
|
|
||||||
|
@ -958,6 +962,11 @@ Dll BOOL APIENTRY Init_APRS()
|
||||||
|
|
||||||
read_png((unsigned char *)IconData);
|
read_png((unsigned char *)IconData);
|
||||||
|
|
||||||
|
// Reload saved messages
|
||||||
|
|
||||||
|
if (SaveAPRSMsgs)
|
||||||
|
GetSavedAPRSMessages();
|
||||||
|
|
||||||
// If a Run parameter was supplied, run the program
|
// If a Run parameter was supplied, run the program
|
||||||
|
|
||||||
if (RunProgram[0] == 0)
|
if (RunProgram[0] == 0)
|
||||||
|
@ -970,7 +979,7 @@ Dll BOOL APIENTRY Init_APRS()
|
||||||
|
|
||||||
signal(SIGCHLD, SIG_IGN); // Silently (and portably) reap children.
|
signal(SIGCHLD, SIG_IGN); // Silently (and portably) reap children.
|
||||||
|
|
||||||
// Fork and Exec ARDOP
|
// Fork and Exec program
|
||||||
|
|
||||||
printf("Trying to start %s\n", RunProgram);
|
printf("Trying to start %s\n", RunProgram);
|
||||||
|
|
||||||
|
@ -1095,6 +1104,8 @@ Dll VOID APIENTRY Poll_APRS()
|
||||||
SMEM->Messages = NULL;
|
SMEM->Messages = NULL;
|
||||||
SMEM->ClearRX = 0;
|
SMEM->ClearRX = 0;
|
||||||
SMEM->NeedRefresh = TRUE;
|
SMEM->NeedRefresh = TRUE;
|
||||||
|
|
||||||
|
ClearSavedMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SMEM->ClearTX)
|
if (SMEM->ClearTX)
|
||||||
|
@ -7674,6 +7685,9 @@ int ProcessMessage(char * Payload, struct STATIONRECORD * Station)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SaveAPRSMsgs)
|
||||||
|
SaveAPRSMessage(Message);
|
||||||
|
|
||||||
ptr = SMEM->Messages;
|
ptr = SMEM->Messages;
|
||||||
|
|
||||||
if (ptr == NULL)
|
if (ptr == NULL)
|
||||||
|
@ -7690,6 +7704,7 @@ int ProcessMessage(char * Payload, struct STATIONRECORD * Station)
|
||||||
}
|
}
|
||||||
ptr->Next = Message;
|
ptr->Next = Message;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ourMessage;
|
return ourMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8763,3 +8778,132 @@ unsigned char * PngEncode (png_byte *pDiData, int iWidth, int iHeight, struct ic
|
||||||
return Icon->pngimage;
|
return Icon->pngimage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SaveAPRSMessage(struct APRSMESSAGE * ptr)
|
||||||
|
{
|
||||||
|
// Save messages in case of a restart
|
||||||
|
|
||||||
|
char FN[250];
|
||||||
|
FILE *file;
|
||||||
|
|
||||||
|
// Set up filename
|
||||||
|
|
||||||
|
if (BPQDirectory[0] == 0)
|
||||||
|
{
|
||||||
|
strcpy(FN,"APRSMsgs.dat");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy(FN,BPQDirectory);
|
||||||
|
strcat(FN,"/");
|
||||||
|
strcat(FN,"APRSMsgs.dat");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((file = fopen(FN, "a")) == NULL)
|
||||||
|
return ;
|
||||||
|
|
||||||
|
fprintf(file, "%d %s,%s,%s,%s,%s\n", time(NULL), ptr->FromCall, ptr->ToCall, ptr->Seq, ptr->Time, ptr->Text);
|
||||||
|
|
||||||
|
fclose(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClearSavedMessages()
|
||||||
|
{
|
||||||
|
char FN[250];
|
||||||
|
FILE *file;
|
||||||
|
|
||||||
|
// Set up filename
|
||||||
|
|
||||||
|
if (BPQDirectory[0] == 0)
|
||||||
|
{
|
||||||
|
strcpy(FN,"APRSMsgs.dat");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy(FN,BPQDirectory);
|
||||||
|
strcat(FN,"/");
|
||||||
|
strcat(FN,"APRSMsgs.dat");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((file = fopen(FN, "w")) == NULL)
|
||||||
|
return ;
|
||||||
|
|
||||||
|
fclose(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GetSavedAPRSMessages()
|
||||||
|
{
|
||||||
|
// Get Saved messages
|
||||||
|
|
||||||
|
// 1668768157 SERVER ,GM8BPQ-2 ,D7Yx,10:42,filter m/200 active
|
||||||
|
|
||||||
|
char FN[250];
|
||||||
|
FILE *file;
|
||||||
|
struct APRSMESSAGE * Message;
|
||||||
|
struct APRSMESSAGE * ptr;
|
||||||
|
char Line[256];
|
||||||
|
char * Stamp = 0;
|
||||||
|
char * From = 0;
|
||||||
|
char * To = 0;
|
||||||
|
char * Seq = 0;
|
||||||
|
char * Time = 0;
|
||||||
|
char * Text = 0;
|
||||||
|
|
||||||
|
// Set up filename
|
||||||
|
|
||||||
|
if (BPQDirectory[0] == 0)
|
||||||
|
{
|
||||||
|
strcpy(FN,"APRSMsgs.dat");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy(FN,BPQDirectory);
|
||||||
|
strcat(FN,"/");
|
||||||
|
strcat(FN,"APRSMsgs.dat");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((file = fopen(FN, "r")) == NULL)
|
||||||
|
return ;
|
||||||
|
|
||||||
|
while (fgets(Line, 512, file))
|
||||||
|
{
|
||||||
|
Stamp = Line;
|
||||||
|
From = strlop(Stamp, ' ');
|
||||||
|
To = strlop(From, ',');
|
||||||
|
Seq = strlop(To, ',');
|
||||||
|
Time = strlop(Seq, ',');
|
||||||
|
Text = strlop(Time, ',');
|
||||||
|
|
||||||
|
if (Stamp && From && To && Seq && Time && Text)
|
||||||
|
{
|
||||||
|
Message = APRSGetMessageBuffer();
|
||||||
|
|
||||||
|
if (Message == NULL)
|
||||||
|
break;
|
||||||
|
|
||||||
|
memset(Message, 0, sizeof(struct APRSMESSAGE));
|
||||||
|
|
||||||
|
strcpy(Message->FromCall, From);
|
||||||
|
strcpy(Message->ToCall, To);
|
||||||
|
strcpy(Message->Seq, Seq);
|
||||||
|
strcpy(Message->Time, Time);
|
||||||
|
strcpy(Message->Text, Text);
|
||||||
|
|
||||||
|
ptr = SMEM->Messages;
|
||||||
|
|
||||||
|
if (ptr == NULL)
|
||||||
|
{
|
||||||
|
SMEM->Messages = Message;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while(ptr->Next)
|
||||||
|
{
|
||||||
|
ptr = ptr->Next;
|
||||||
|
}
|
||||||
|
ptr->Next = Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fclose(file);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioUserFile
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
ShowAllFiles="false"
|
||||||
|
>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
>
|
||||||
|
<DebugSettings
|
||||||
|
Command="$(TargetPath)"
|
||||||
|
WorkingDirectory=""
|
||||||
|
CommandArguments=""
|
||||||
|
Attach="false"
|
||||||
|
DebuggerType="3"
|
||||||
|
Remote="1"
|
||||||
|
RemoteMachine="SKIGACER"
|
||||||
|
RemoteCommand=""
|
||||||
|
HttpUrl=""
|
||||||
|
PDBPath=""
|
||||||
|
SQLDebugging=""
|
||||||
|
Environment=""
|
||||||
|
EnvironmentMerge="true"
|
||||||
|
DebuggerFlavor=""
|
||||||
|
MPIRunCommand=""
|
||||||
|
MPIRunArguments=""
|
||||||
|
MPIRunWorkingDirectory=""
|
||||||
|
ApplicationCommand=""
|
||||||
|
ApplicationArguments=""
|
||||||
|
ShimCommand=""
|
||||||
|
MPIAcceptMode=""
|
||||||
|
MPIAcceptFilter=""
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Release|Win32"
|
||||||
|
>
|
||||||
|
<DebugSettings
|
||||||
|
Command="$(TargetPath)"
|
||||||
|
WorkingDirectory=""
|
||||||
|
CommandArguments=""
|
||||||
|
Attach="false"
|
||||||
|
DebuggerType="3"
|
||||||
|
Remote="1"
|
||||||
|
RemoteMachine="SKIGACER"
|
||||||
|
RemoteCommand=""
|
||||||
|
HttpUrl=""
|
||||||
|
PDBPath=""
|
||||||
|
SQLDebugging=""
|
||||||
|
Environment=""
|
||||||
|
EnvironmentMerge="true"
|
||||||
|
DebuggerFlavor=""
|
||||||
|
MPIRunCommand=""
|
||||||
|
MPIRunArguments=""
|
||||||
|
MPIRunWorkingDirectory=""
|
||||||
|
ApplicationCommand=""
|
||||||
|
ApplicationArguments=""
|
||||||
|
ShimCommand=""
|
||||||
|
MPIAcceptMode=""
|
||||||
|
MPIAcceptFilter=""
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
</VisualStudioUserFile>
|
|
@ -1117,6 +1117,7 @@ typedef int (WINAPI FAR *FARPROCZ)();
|
||||||
FARPROCX pDllBPQTRACE;
|
FARPROCX pDllBPQTRACE;
|
||||||
FARPROCZ pGetLOC;
|
FARPROCZ pGetLOC;
|
||||||
FARPROCX pRefreshWebMailIndex;
|
FARPROCX pRefreshWebMailIndex;
|
||||||
|
FARPROCX pRunEventProgram;
|
||||||
|
|
||||||
BOOL WINE = FALSE;
|
BOOL WINE = FALSE;
|
||||||
|
|
||||||
|
@ -1881,6 +1882,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||||
pDllBPQTRACE = GetProcAddress(ExtDriver,"_DllBPQTRACE@8");
|
pDllBPQTRACE = GetProcAddress(ExtDriver,"_DllBPQTRACE@8");
|
||||||
pGetLOC = GetProcAddress(ExtDriver,"_GetLOC@0");
|
pGetLOC = GetProcAddress(ExtDriver,"_GetLOC@0");
|
||||||
pRefreshWebMailIndex = GetProcAddress(ExtDriver,"_RefreshWebMailIndex@0");
|
pRefreshWebMailIndex = GetProcAddress(ExtDriver,"_RefreshWebMailIndex@0");
|
||||||
|
pRunEventProgram = GetProcAddress(ExtDriver,"_RunEventProgram@8");
|
||||||
|
|
||||||
if (pGetLOC)
|
if (pGetLOC)
|
||||||
{
|
{
|
||||||
|
|
4
Bpq32.c
4
Bpq32.c
|
@ -1120,6 +1120,8 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
||||||
// Add Web Sockets auto-refresh option for Webmail index page (25)
|
// Add Web Sockets auto-refresh option for Webmail index page (25)
|
||||||
// Fix FREEDATA driver for compatibility with FreeData TNC version 0.6.4-alpha.3 (25)
|
// Fix FREEDATA driver for compatibility with FreeData TNC version 0.6.4-alpha.3 (25)
|
||||||
// Add SmartID for bridged frames - Send ID only if packets sent recently (26)
|
// Add SmartID for bridged frames - Send ID only if packets sent recently (26)
|
||||||
|
// Add option to save and restore received APRS messages (27)
|
||||||
|
// Add mechanism to run a user program on certain events (27)
|
||||||
|
|
||||||
|
|
||||||
#define CKernel
|
#define CKernel
|
||||||
|
@ -1500,6 +1502,8 @@ int PerlReinit = 0;
|
||||||
UINT_PTR TimerHandle = 0;
|
UINT_PTR TimerHandle = 0;
|
||||||
UINT_PTR SessHandle = 0;
|
UINT_PTR SessHandle = 0;
|
||||||
|
|
||||||
|
BOOL EventsEnabled = 0;
|
||||||
|
|
||||||
unsigned int TimerInst = 0xffffffff;
|
unsigned int TimerInst = 0xffffffff;
|
||||||
|
|
||||||
HANDLE hInstance = 0;
|
HANDLE hInstance = 0;
|
||||||
|
|
|
@ -350,6 +350,10 @@
|
||||||
RelativePath=".\DRATS.c"
|
RelativePath=".\DRATS.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\Events.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\CommonSource\FLDigi.c"
|
RelativePath="..\CommonSource\FLDigi.c"
|
||||||
>
|
>
|
||||||
|
|
|
@ -41,6 +41,7 @@ extern int RunningConnectScript;
|
||||||
INT_PTR CALLBACK InfoDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
|
INT_PTR CALLBACK InfoDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
int GetMultiLineDialog(HWND hDialog, int DLGItem);
|
int GetMultiLineDialog(HWND hDialog, int DLGItem);
|
||||||
BOOL ProcessChatConnectScript(ChatCIRCUIT * conn, char * Buffer, int len);
|
BOOL ProcessChatConnectScript(ChatCIRCUIT * conn, char * Buffer, int len);
|
||||||
|
VOID WriteMiniDump();
|
||||||
|
|
||||||
int Connected(int Stream)
|
int Connected(int Stream)
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,109 @@
|
||||||
|
/*
|
||||||
|
Copyright 2001-2022 John Wiseman G8BPQ
|
||||||
|
|
||||||
|
This file is part of LinBPQ/BPQ32.
|
||||||
|
|
||||||
|
LinBPQ/BPQ32 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 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
LinBPQ/BPQ32 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 LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||||
|
|
||||||
|
#define _CRT_SECURE_NO_DEPRECATE
|
||||||
|
|
||||||
|
#include "compatbits.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
VOID __cdecl Debugprintf(const char * format, ...);
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
|
||||||
|
#define APIENTRY
|
||||||
|
#define DllExport
|
||||||
|
#define VOID void
|
||||||
|
|
||||||
|
#else
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern BOOL EventsEnabled;
|
||||||
|
|
||||||
|
// Runs use specified routine on certain event
|
||||||
|
#ifndef WIN32
|
||||||
|
|
||||||
|
void RunEventProgram(char * Program, char * Param)
|
||||||
|
{
|
||||||
|
char * arg_list[] = {Program, NULL, NULL};
|
||||||
|
pid_t child_pid;
|
||||||
|
|
||||||
|
if (EventsEnabled == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
signal(SIGCHLD, SIG_IGN); // Silently (and portably) reap children.
|
||||||
|
|
||||||
|
if (Param && Param[0])
|
||||||
|
arg_list[1] = Param;
|
||||||
|
|
||||||
|
// Fork and Exec Specified program
|
||||||
|
|
||||||
|
// Duplicate this process.
|
||||||
|
|
||||||
|
child_pid = fork ();
|
||||||
|
|
||||||
|
if (child_pid == -1)
|
||||||
|
{
|
||||||
|
printf ("Event fork() Failed\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (child_pid == 0)
|
||||||
|
{
|
||||||
|
execvp (arg_list[0], arg_list);
|
||||||
|
|
||||||
|
// The execvp function returns only if an error occurs.
|
||||||
|
|
||||||
|
printf ("Failed to run %s\n", arg_list[0]);
|
||||||
|
exit(0); // Kill the new process
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
DllExport int APIENTRY RunEventProgram(char * Program, char * Param)
|
||||||
|
{
|
||||||
|
int n = 0;
|
||||||
|
char cmdLine[256];
|
||||||
|
|
||||||
|
STARTUPINFO SInfo; // pointer to STARTUPINFO
|
||||||
|
PROCESS_INFORMATION PInfo; // pointer to PROCESS_INFORMATION
|
||||||
|
|
||||||
|
if (EventsEnabled == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
|
SInfo.cb=sizeof(SInfo);
|
||||||
|
SInfo.lpReserved=NULL;
|
||||||
|
SInfo.lpDesktop=NULL;
|
||||||
|
SInfo.lpTitle=NULL;
|
||||||
|
SInfo.dwFlags=0;
|
||||||
|
SInfo.cbReserved2=0;
|
||||||
|
SInfo.lpReserved2=NULL;
|
||||||
|
|
||||||
|
sprintf(cmdLine, "%s %s", Program, Param);
|
||||||
|
|
||||||
|
if (!CreateProcess(NULL, cmdLine, NULL, NULL, FALSE,0 ,NULL ,NULL, &SInfo, &PInfo))
|
||||||
|
Debugprintf("Failed to Start %s Error %d ", Program, GetLastError());
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
63
FreeDATA.c
63
FreeDATA.c
|
@ -38,6 +38,8 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
||||||
|
|
||||||
#define SD_BOTH 0x02
|
#define SD_BOTH 0x02
|
||||||
|
|
||||||
|
#define FREEDATABUFLEN 16384 // TCP buffer size
|
||||||
|
|
||||||
int KillTNC(struct TNCINFO * TNC);
|
int KillTNC(struct TNCINFO * TNC);
|
||||||
int RestartTNC(struct TNCINFO * TNC);
|
int RestartTNC(struct TNCINFO * TNC);
|
||||||
|
|
||||||
|
@ -254,7 +256,7 @@ static int ProcessLine(char * buf, int Port)
|
||||||
TNC->FreeDataInfo->TuningRange = atoi(&buf[12]);
|
TNC->FreeDataInfo->TuningRange = atoi(&buf[12]);
|
||||||
|
|
||||||
else if (_memicmp(buf, "LimitBandWidth", 14) == 0)
|
else if (_memicmp(buf, "LimitBandWidth", 14) == 0)
|
||||||
TNC->FreeDataInfo->LimitBandWidth = atoi(&buf[14]);
|
TNC->FreeDataInfo->LimitBandWidth = atoi(&buf[15]);
|
||||||
|
|
||||||
else if (_memicmp(buf, "HAMLIBPORT", 10) == 0)
|
else if (_memicmp(buf, "HAMLIBPORT", 10) == 0)
|
||||||
TNC->FreeDataInfo->hamlibPort = atoi(&buf[11]);
|
TNC->FreeDataInfo->hamlibPort = atoi(&buf[11]);
|
||||||
|
@ -928,14 +930,28 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
|
||||||
|
|
||||||
return ((TNC->TNCCONNECTED != 0) << 8 | TNC->Streams[Stream].Disconnecting << 15); // OK
|
return ((TNC->TNCCONNECTED != 0) << 8 | TNC->Streams[Stream].Disconnecting << 15); // OK
|
||||||
|
|
||||||
|
|
||||||
case 4: // reinit7
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case 5: // Close
|
case 5: // Close
|
||||||
|
|
||||||
StopTNC(TNC);
|
StopTNC(TNC);
|
||||||
|
|
||||||
|
// Drop through
|
||||||
|
|
||||||
|
case 4: // reinit7
|
||||||
|
|
||||||
|
if (TNC->TCPDataSock)
|
||||||
|
{
|
||||||
|
shutdown(TNC->TCPDataSock, SD_BOTH);
|
||||||
|
Sleep(100);
|
||||||
|
closesocket(TNC->TCPDataSock);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TNC->TCPSock)
|
||||||
|
{
|
||||||
|
shutdown(TNC->TCPSock, SD_BOTH);
|
||||||
|
Sleep(100);
|
||||||
|
closesocket(TNC->TCPSock);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case 6: // Scan Stop Interface
|
case 6: // Scan Stop Interface
|
||||||
|
@ -1320,7 +1336,7 @@ VOID * FreeDataExtInit(EXTPORTDATA * PortEntry)
|
||||||
TNC->Hardware = H_FREEDATA;
|
TNC->Hardware = H_FREEDATA;
|
||||||
|
|
||||||
TNC->ARDOPDataBuffer = malloc(MAXRXSIZE);
|
TNC->ARDOPDataBuffer = malloc(MAXRXSIZE);
|
||||||
TNC->ARDOPBuffer = malloc(8192);
|
TNC->ARDOPBuffer = malloc(FREEDATABUFLEN);
|
||||||
|
|
||||||
TNC->PortRecord = PortEntry;
|
TNC->PortRecord = PortEntry;
|
||||||
|
|
||||||
|
@ -3566,9 +3582,9 @@ void FreeDataProcessDaemonMsg(struct TNCINFO * TNC)
|
||||||
if (TNC->InputLen > 8000) // Shouldnt have packets longer than this
|
if (TNC->InputLen > 8000) // Shouldnt have packets longer than this
|
||||||
TNC->InputLen=0;
|
TNC->InputLen=0;
|
||||||
|
|
||||||
InputLen=recv(TNC->TCPSock, &TNC->ARDOPBuffer[TNC->InputLen], 8191 - TNC->InputLen, 0);
|
InputLen=recv(TNC->TCPSock, &TNC->ARDOPBuffer[TNC->InputLen], FREEDATABUFLEN - 1 - TNC->InputLen, 0);
|
||||||
|
|
||||||
if (InputLen == 8191)
|
if (InputLen == FREEDATABUFLEN - 1)
|
||||||
c = 0;
|
c = 0;
|
||||||
|
|
||||||
|
|
||||||
|
@ -3970,14 +3986,11 @@ TNCRunning:
|
||||||
if (TNC->TNCCONNECTED)
|
if (TNC->TNCCONNECTED)
|
||||||
FD_SET(TNC->TCPDataSock,&readfs);
|
FD_SET(TNC->TCPDataSock,&readfs);
|
||||||
|
|
||||||
// FD_ZERO(&writefs);
|
|
||||||
|
|
||||||
// if (TNC->BPQtoWINMOR_Q) FD_SET(TNC->TCPSock,&writefs); // Need notification of busy clearing
|
|
||||||
|
|
||||||
if (TNC->TNCCONNECTING || TNC->TNCCONNECTED) FD_SET(TNC->TCPDataSock,&errorfs);
|
if (TNC->TNCCONNECTING || TNC->TNCCONNECTED) FD_SET(TNC->TCPDataSock,&errorfs);
|
||||||
|
|
||||||
timeout.tv_sec = 90;
|
timeout.tv_sec = 300;
|
||||||
timeout.tv_usec = 0; // We should get messages more frequently that this
|
timeout.tv_usec = 0;
|
||||||
|
|
||||||
ret = select((int)TNC->TCPSock + 1, &readfs, NULL, &errorfs, &timeout);
|
ret = select((int)TNC->TCPSock + 1, &readfs, NULL, &errorfs, &timeout);
|
||||||
|
|
||||||
|
@ -3986,7 +3999,20 @@ TNCRunning:
|
||||||
Debugprintf("FreeData Select failed %d ", WSAGetLastError());
|
Debugprintf("FreeData Select failed %d ", WSAGetLastError());
|
||||||
goto Lost;
|
goto Lost;
|
||||||
}
|
}
|
||||||
if (ret > 0)
|
|
||||||
|
// If nothing doing send get rx_buffer as link validation poll
|
||||||
|
|
||||||
|
if (ret == 0)
|
||||||
|
{
|
||||||
|
char GetData[] = "{\"type\" : \"get\", \"command\": \"rx_buffer\"}\n";
|
||||||
|
int Len;
|
||||||
|
|
||||||
|
Len = send(TNC->TCPDataSock, GetData, strlen(GetData), 0);
|
||||||
|
|
||||||
|
if (Len != strlen(GetData))
|
||||||
|
goto closeThread;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// See what happened
|
// See what happened
|
||||||
|
|
||||||
|
@ -4007,7 +4033,7 @@ TNCRunning:
|
||||||
if (FD_ISSET(TNC->TCPDataSock, &errorfs))
|
if (FD_ISSET(TNC->TCPDataSock, &errorfs))
|
||||||
{
|
{
|
||||||
Lost:
|
Lost:
|
||||||
sprintf(Msg, "FreeData Daemon Connection lost for Port %d\r\n", TNC->Port);
|
sprintf(Msg, "FreeData TNC Connection lost for Port %d\r\n", TNC->Port);
|
||||||
WritetoConsole(Msg);
|
WritetoConsole(Msg);
|
||||||
|
|
||||||
sprintf(TNC->WEB_COMMSSTATE, "Connection to Daemon lost");
|
sprintf(TNC->WEB_COMMSSTATE, "Connection to Daemon lost");
|
||||||
|
@ -4048,11 +4074,10 @@ Lost:
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closeThread:
|
||||||
|
|
||||||
if (TNC->TCPDataSock)
|
if (TNC->TCPDataSock)
|
||||||
{
|
{
|
||||||
shutdown(TNC->TCPDataSock, SD_BOTH);
|
shutdown(TNC->TCPDataSock, SD_BOTH);
|
||||||
|
|
16
HanksRT.c
16
HanksRT.c
|
@ -36,6 +36,9 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
||||||
|
|
||||||
iconv_t link_toUTF8 = NULL;
|
iconv_t link_toUTF8 = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
BOOL RunEventProgram(char * Program, char * Param);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BOOL ProcessChatConnectScript(ChatCIRCUIT * conn, char * Buffer, int len);
|
BOOL ProcessChatConnectScript(ChatCIRCUIT * conn, char * Buffer, int len);
|
||||||
|
@ -48,6 +51,7 @@ void ChatWriteLogLine(ChatCIRCUIT * conn, int Flag, char * Msg, int MsgLen, int
|
||||||
extern struct SEM ChatSemaphore;
|
extern struct SEM ChatSemaphore;
|
||||||
UCHAR * APIENTRY GetLogDirectory();
|
UCHAR * APIENTRY GetLogDirectory();
|
||||||
char * APIENTRY GetBPQDirectory();
|
char * APIENTRY GetBPQDirectory();
|
||||||
|
VOID WriteMiniDump();
|
||||||
|
|
||||||
extern SOCKADDR_IN Chatreportdest;
|
extern SOCKADDR_IN Chatreportdest;
|
||||||
|
|
||||||
|
@ -114,6 +118,9 @@ time_t RunningConnectScript = 0;
|
||||||
//#define free(p)
|
//#define free(p)
|
||||||
|
|
||||||
|
|
||||||
|
typedef int (WINAPI FAR *FARPROCX)();
|
||||||
|
extern FARPROCX pRunEventProgram;
|
||||||
|
|
||||||
int ChatIsUTF8(unsigned char *ptr, int len)
|
int ChatIsUTF8(unsigned char *ptr, int len)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
@ -1935,6 +1942,7 @@ void text_tellu_Joined(USER * user)
|
||||||
struct tm * tm;
|
struct tm * tm;
|
||||||
char Stamp[20];
|
char Stamp[20];
|
||||||
time_t T;
|
time_t T;
|
||||||
|
char prog[256] = "";
|
||||||
|
|
||||||
T = time(NULL);
|
T = time(NULL);
|
||||||
tm = gmtime(&T);
|
tm = gmtime(&T);
|
||||||
|
@ -1973,6 +1981,14 @@ void text_tellu_Joined(USER * user)
|
||||||
nputc(circuit, 7);
|
nputc(circuit, 7);
|
||||||
|
|
||||||
nputc(circuit, 13);
|
nputc(circuit, 13);
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
if (pRunEventProgram)
|
||||||
|
pRunEventProgram("ChatNewUser.exe", user->call);
|
||||||
|
#else
|
||||||
|
sprintf(prog, "%s/%s", BPQDirectory, "ChatNewUser");
|
||||||
|
RunEventProgram(prog, user->call);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Tell one link circuit about a local user change of topic.
|
// Tell one link circuit about a local user change of topic.
|
||||||
|
|
2
LinBPQ.c
2
LinBPQ.c
|
@ -506,6 +506,8 @@ extern int ISPort;
|
||||||
|
|
||||||
extern char ChatConfigName[250];
|
extern char ChatConfigName[250];
|
||||||
|
|
||||||
|
BOOL EventsEnabled = 0;
|
||||||
|
|
||||||
UCHAR * GetBPQDirectory()
|
UCHAR * GetBPQDirectory()
|
||||||
{
|
{
|
||||||
return BPQDirectory;
|
return BPQDirectory;
|
||||||
|
|
|
@ -320,6 +320,10 @@
|
||||||
RelativePath=".\DRATS.c"
|
RelativePath=".\DRATS.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\Events.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\CommonSource\FBBRoutines.c"
|
RelativePath="..\CommonSource\FBBRoutines.c"
|
||||||
>
|
>
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define KVers 6,0,23,26
|
#define KVers 6,0,23,27
|
||||||
#define KVerstring "6.0.23.26\0"
|
#define KVerstring "6.0.23.27\0"
|
||||||
|
|
||||||
#ifdef CKernel
|
#ifdef CKernel
|
||||||
|
|
||||||
|
|
13
bpqchat.c
13
bpqchat.c
|
@ -61,7 +61,8 @@
|
||||||
// Version 6.0.24.1 ??
|
// Version 6.0.24.1 ??
|
||||||
|
|
||||||
// Restore CMD_TO_APPL flag to Applflags (13)
|
// Restore CMD_TO_APPL flag to Applflags (13)
|
||||||
// Check for and remove names set to *RTL (
|
// Check for and remove names set to *RTL
|
||||||
|
// Add option to run user program when chat user connects (27)
|
||||||
|
|
||||||
|
|
||||||
#include "BPQChat.h"
|
#include "BPQChat.h"
|
||||||
|
@ -214,6 +215,7 @@ VOID SaveStringValue(config_setting_t * group, char * name, char * value);
|
||||||
VOID SaveIntValue(config_setting_t * group, char * name, int value);
|
VOID SaveIntValue(config_setting_t * group, char * name, int value);
|
||||||
VOID SaveChatConfig(HWND hDlg);
|
VOID SaveChatConfig(HWND hDlg);
|
||||||
BOOL CreateChatPipeThread();
|
BOOL CreateChatPipeThread();
|
||||||
|
VOID WriteMiniDump();
|
||||||
|
|
||||||
struct _EXCEPTION_POINTERS exinfox;
|
struct _EXCEPTION_POINTERS exinfox;
|
||||||
|
|
||||||
|
@ -224,6 +226,9 @@ DWORD Stack[16];
|
||||||
|
|
||||||
BOOL Restarting = FALSE;
|
BOOL Restarting = FALSE;
|
||||||
|
|
||||||
|
typedef int (WINAPI FAR *FARPROCX)();
|
||||||
|
FARPROCX pRunEventProgram;
|
||||||
|
|
||||||
int Dump_Process_State(struct _EXCEPTION_POINTERS * exinfo, char * Msg)
|
int Dump_Process_State(struct _EXCEPTION_POINTERS * exinfo, char * Msg)
|
||||||
{
|
{
|
||||||
unsigned int SPPtr;
|
unsigned int SPPtr;
|
||||||
|
@ -1282,6 +1287,7 @@ BOOL Initialise()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
ChatCIRCUIT * conn;
|
ChatCIRCUIT * conn;
|
||||||
|
HMODULE ExtDriver = LoadLibrary("bpq32.dll");
|
||||||
|
|
||||||
// Register message for posting by BPQDLL
|
// Register message for posting by BPQDLL
|
||||||
|
|
||||||
|
@ -1388,6 +1394,11 @@ Retry:
|
||||||
|
|
||||||
CreateChatPipeThread();
|
CreateChatPipeThread();
|
||||||
|
|
||||||
|
|
||||||
|
if (ExtDriver)
|
||||||
|
pRunEventProgram = GetProcAddress(ExtDriver,"_RunEventProgram@8");
|
||||||
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
cMain.c
4
cMain.c
|
@ -137,6 +137,8 @@ BOOL LogAllConnects = FALSE;
|
||||||
BOOL AUTOSAVEMH = TRUE;
|
BOOL AUTOSAVEMH = TRUE;
|
||||||
extern BOOL ADIFLogEnabled;
|
extern BOOL ADIFLogEnabled;
|
||||||
extern UCHAR LogDirectory[260];
|
extern UCHAR LogDirectory[260];
|
||||||
|
extern BOOL EventsEnabled;
|
||||||
|
extern BOOL SaveAPRSMsgs;
|
||||||
|
|
||||||
//TNCTABLE DD 0
|
//TNCTABLE DD 0
|
||||||
//NUMBEROFSTREAMS DD 0
|
//NUMBEROFSTREAMS DD 0
|
||||||
|
@ -759,6 +761,8 @@ BOOL Start()
|
||||||
LogAllConnects = cfg->C_LogAllConnects;
|
LogAllConnects = cfg->C_LogAllConnects;
|
||||||
AUTOSAVEMH = cfg->C_SaveMH;
|
AUTOSAVEMH = cfg->C_SaveMH;
|
||||||
ADIFLogEnabled = cfg->C_ADIF;
|
ADIFLogEnabled = cfg->C_ADIF;
|
||||||
|
EventsEnabled = cfg->C_EVENTS;
|
||||||
|
SaveAPRSMsgs = cfg->C_SaveAPRSMsgs;
|
||||||
|
|
||||||
// Get pointers to PASSWORD and APPL1 commands
|
// Get pointers to PASSWORD and APPL1 commands
|
||||||
|
|
||||||
|
|
10
config.c
10
config.c
|
@ -299,7 +299,7 @@ static char *keywords[] =
|
||||||
"APPL1QUAL", "APPL2QUAL", "APPL3QUAL", "APPL4QUAL",
|
"APPL1QUAL", "APPL2QUAL", "APPL3QUAL", "APPL4QUAL",
|
||||||
"APPL5QUAL", "APPL6QUAL", "APPL7QUAL", "APPL8QUAL",
|
"APPL5QUAL", "APPL6QUAL", "APPL7QUAL", "APPL8QUAL",
|
||||||
"BTEXT:", "NETROMCALL", "C_IS_CHAT", "MAXRTT", "MAXHOPS", // IPGATEWAY= no longer allowed
|
"BTEXT:", "NETROMCALL", "C_IS_CHAT", "MAXRTT", "MAXHOPS", // IPGATEWAY= no longer allowed
|
||||||
"LogL4Connects", "LogAllConnects", "SAVEMH", "ENABLEADIFLOG"
|
"LogL4Connects", "LogAllConnects", "SAVEMH", "ENABLEADIFLOG", "ENABLEEVENTS", "SAVEAPRSMSGS"
|
||||||
}; /* parameter keywords */
|
}; /* parameter keywords */
|
||||||
|
|
||||||
static void * offset[] =
|
static void * offset[] =
|
||||||
|
@ -319,7 +319,7 @@ static void * offset[] =
|
||||||
&xxcfg.C_APPL[0].ApplQual, &xxcfg.C_APPL[1].ApplQual, &xxcfg.C_APPL[2].ApplQual, &xxcfg.C_APPL[3].ApplQual,
|
&xxcfg.C_APPL[0].ApplQual, &xxcfg.C_APPL[1].ApplQual, &xxcfg.C_APPL[2].ApplQual, &xxcfg.C_APPL[3].ApplQual,
|
||||||
&xxcfg.C_APPL[4].ApplQual, &xxcfg.C_APPL[5].ApplQual, &xxcfg.C_APPL[6].ApplQual, &xxcfg.C_APPL[7].ApplQual,
|
&xxcfg.C_APPL[4].ApplQual, &xxcfg.C_APPL[5].ApplQual, &xxcfg.C_APPL[6].ApplQual, &xxcfg.C_APPL[7].ApplQual,
|
||||||
&xxcfg.C_BTEXT, &xxcfg.C_NETROMCALL, &xxcfg.C_C, &xxcfg.C_MAXRTT, &xxcfg.C_MAXHOPS, // IPGATEWAY= no longer allowed
|
&xxcfg.C_BTEXT, &xxcfg.C_NETROMCALL, &xxcfg.C_C, &xxcfg.C_MAXRTT, &xxcfg.C_MAXHOPS, // IPGATEWAY= no longer allowed
|
||||||
&xxcfg.C_LogL4Connects, &xxcfg.C_LogAllConnects, &xxcfg.C_SaveMH, &xxcfg.C_ADIF}; /* offset for corresponding data in config file */
|
&xxcfg.C_LogL4Connects, &xxcfg.C_LogAllConnects, &xxcfg.C_SaveMH, &xxcfg.C_ADIF, &xxcfg.C_EVENTS, &xxcfg.C_SaveAPRSMsgs}; /* offset for corresponding data in config file */
|
||||||
|
|
||||||
static int routine[] =
|
static int routine[] =
|
||||||
{
|
{
|
||||||
|
@ -338,7 +338,7 @@ static int routine[] =
|
||||||
14, 14, 14, 14,
|
14, 14, 14, 14,
|
||||||
14, 14 ,14, 14,
|
14, 14 ,14, 14,
|
||||||
15, 0, 2, 9, 9,
|
15, 0, 2, 9, 9,
|
||||||
2, 2, 2, 2} ; // Routine to process param
|
2, 2, 2, 2, 2, 2} ; // Routine to process param
|
||||||
|
|
||||||
int PARAMLIM = sizeof(routine)/sizeof(int);
|
int PARAMLIM = sizeof(routine)/sizeof(int);
|
||||||
//int NUMBEROFKEYWORDS = sizeof(routine)/sizeof(int);
|
//int NUMBEROFKEYWORDS = sizeof(routine)/sizeof(int);
|
||||||
|
@ -407,7 +407,7 @@ static int routeindex = 0;
|
||||||
/* Global variables */
|
/* Global variables */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
int paramok[100]; /* PARAMETER OK FLAG */
|
int paramok[100] = {0}; /* PARAMETER OK FLAG */
|
||||||
|
|
||||||
FILE *fp1; /* TEXT INPUT FILE */
|
FILE *fp1; /* TEXT INPUT FILE */
|
||||||
|
|
||||||
|
@ -587,6 +587,8 @@ BOOL ProcessConfig()
|
||||||
paramok[75]=1; // LogAllConnects optional
|
paramok[75]=1; // LogAllConnects optional
|
||||||
paramok[76]=1; // SAVEMH optional
|
paramok[76]=1; // SAVEMH optional
|
||||||
paramok[77]=1; // ENABLEADIFLOG optional
|
paramok[77]=1; // ENABLEADIFLOG optional
|
||||||
|
paramok[78]=1; // EnableEvents optional
|
||||||
|
paramok[79]=1; // SaveAPRSMsgs optional
|
||||||
|
|
||||||
for (i=0; i < PARAMLIM; i++)
|
for (i=0; i < PARAMLIM; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -142,8 +142,9 @@ struct CONFIGTABLE
|
||||||
UCHAR C_BTEXT[120]; // 121
|
UCHAR C_BTEXT[120]; // 121
|
||||||
char C_VERSTRING[10]; // 241 Version String from Config File
|
char C_VERSTRING[10]; // 241 Version String from Config File
|
||||||
UCHAR C_ADIF;
|
UCHAR C_ADIF;
|
||||||
UCHAR C_LogAllConnects;
|
UCHAR C_EVENTS;
|
||||||
UCHAR Spare3[2]; // 252 - 4
|
UCHAR C_LogAllConnects;
|
||||||
|
UCHAR C_SaveAPRSMsgs;
|
||||||
UCHAR C_VERSION; // CONFIG PROG VERSION
|
UCHAR C_VERSION; // CONFIG PROG VERSION
|
||||||
// Reuse C_APPLICATIONS - no longer used
|
// Reuse C_APPLICATIONS - no longer used
|
||||||
char C_NETROMCALL[10];
|
char C_NETROMCALL[10];
|
||||||
|
|
2
makefile
2
makefile
|
@ -13,7 +13,7 @@ OBJS = pngwtran.o pngrtran.o pngset.o pngrio.o pngwio.o pngtrans.o pngrutil.o pn
|
||||||
MailCommands.o MailDataDefs.o LinBPQ.o MailRouting.o MailTCP.o MBLRoutines.o md5.o Moncode.o \
|
MailCommands.o MailDataDefs.o LinBPQ.o MailRouting.o MailTCP.o MBLRoutines.o md5.o Moncode.o \
|
||||||
NNTPRoutines.o RigControl.o TelnetV6.o WINMOR.o TNCCode.o UZ7HODrv.o WPRoutines.o \
|
NNTPRoutines.o RigControl.o TelnetV6.o WINMOR.o TNCCode.o UZ7HODrv.o WPRoutines.o \
|
||||||
SCSTrackeMulti.o SCSPactor.o SCSTracker.o HanksRT.o UIRoutines.o AGWAPI.o AGWMoncode.o \
|
SCSTrackeMulti.o SCSPactor.o SCSTracker.o HanksRT.o UIRoutines.o AGWAPI.o AGWMoncode.o \
|
||||||
DRATS.o FreeDATA.o base64.o
|
DRATS.o FreeDATA.o base64.o Events.o
|
||||||
|
|
||||||
# Configuration:
|
# Configuration:
|
||||||
|
|
||||||
|
|
|
@ -377,6 +377,7 @@ char * WebMailPagetxt()
|
||||||
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"> \r\n"
|
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"> \r\n"
|
||||||
"<head> \r\n"
|
"<head> \r\n"
|
||||||
"<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"/> \r\n"
|
"<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"/> \r\n"
|
||||||
|
"<meta http-equiv=refresh content=300>"
|
||||||
"<style type=\"text/css\">\r\n"
|
"<style type=\"text/css\">\r\n"
|
||||||
"pre {margin-left: 4px;white-space: pre} \r\n"
|
"pre {margin-left: 4px;white-space: pre} \r\n"
|
||||||
"#main{width:700px;position:absolute;left:0px;border:2px solid;background-color: #ffffff;}\r\n"
|
"#main{width:700px;position:absolute;left:0px;border:2px solid;background-color: #ffffff;}\r\n"
|
||||||
|
|
Loading…
Reference in New Issue