New upstream version 6.0.24.38

This commit is contained in:
Hibby 2024-06-09 21:48:39 +01:00
parent 933e6c5b86
commit 951f1d912a
26 changed files with 4891 additions and 219 deletions

View File

@ -2187,7 +2187,7 @@ static int APRSProcessLine(char * buf)
CrossPortMap[Port][0] = FALSE; // Cancel Default APRSIS CrossPortMap[Port][0] = FALSE; // Cancel Default APRSIS
if (Context == NULL || Context[0] == 0) if (Context == NULL || Context[0] == 0)
return FALSE; return TRUE;
ptr = strtok_s(NULL, ",\t\n\r", &Context); ptr = strtok_s(NULL, ",\t\n\r", &Context);

View File

@ -3279,31 +3279,40 @@ char * get_aprs()
"\n" "\n"
"var myTimeout;\n" "var myTimeout;\n"
"\n" "\n"
"var server1 = \"http://server1.g8bpq.net:7383\"\n"
"var server2 = \"http://server2.g8bpq.net:7383\"\n" //https://tile.openstreetmap.org/{zoom}/{x}/{y}.png
// "var server1 = \"http://server1.g8bpq.net:7383\"\n"
// "var server2 = \"http://server2.g8bpq.net:7383\"\n"
"var server1 = \"tile.openstreetmap.org\"\n"
"var server2 = \"tile.openstreetmap.org\"\n"
"\n" "\n"
"function getMap(p)\n" "function getMap(p)\n"
"{\n" "{\n"
" var gl = L.maplibreGL({style: server1 + '/styles/G8BPQ/style.json'});\n"
" gl.addTo(p);\n" " L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {attribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'}).addTo(p);\r\n"
" var maplibreMap = gl.getMaplibreMap();\n"
"\n" // " var gl = L.maplibreGL({style: server1 + '/styles/G8BPQ/style.json'});\n"
" // if load from first server fails, switch to backup\n" // " gl.addTo(p);\n"
"\n" // " var maplibreMap = gl.getMaplibreMap();\n"
" maplibreMap.on('error', e =>\n" // "\n"
" {\n" // " // if load from first server fails, switch to backup\n"
" console.log(e.error);\n" // "\n"
"\n" // " maplibreMap.on('error', e =>\n"
" if (e && e.error == 'Error: Failed to fetch')\n" // " {\n"
" {\n" // " console.log(e.error);\n"
" console.log('failed to load from ' + server1 + ', trying ' + server2);\n" // "\n"
" var gl2 = L.maplibreGL({style: server2 + '/styles/G8BPQ/style.json'});\n" // " if (e && e.error == 'Error: Failed to fetch')\n"
" p.removeLayer(gl)\n" // " {\n"
" gl2.addTo(p);\n" // " console.log('failed to load from ' + server1 + ', trying ' + server2);\n"
" }\n" // " var gl2 = L.maplibreGL({style: server2 + '/styles/G8BPQ/style.json'});\n"
" });\n" // " p.removeLayer(gl)\n"
"\n" // " gl2.addTo(p);\n"
" p.attributionControl.addAttribution('Map data from <a href=https://www.openstreetmap.org/copyright>OpenStreetMap</a><a href=https://github.com/maplibre/maplibre-gl-leaflet> using maplibre-gl</a> <a href=https://github.com/mapbox/mapbox-gl-styles>Styles based on Mapbox gl');\n" // " }\n"
// " });\n"
// "\n"
// " p.attributionControl.addAttribution('Map data from <a href=https://www.openstreetmap.org/copyright>OpenStreetMap</a><a href=https://github.com/maplibre/maplibre-gl-leaflet> using maplibre-gl</a> <a href=https://github.com/mapbox/mapbox-gl-styles>Styles based on Mapbox gl');\n"
" L.control.scale().addTo(p);\n" " L.control.scale().addTo(p);\n"
"}\n" "}\n"
"\n" "\n"

View File

@ -225,7 +225,7 @@ extern BOOL EventsEnabled;
extern BPQVECSTRUC BPQHOSTVECTOR[BPQHOSTSTREAMS + 5]; extern BPQVECSTRUC BPQHOSTVECTOR[BPQHOSTSTREAMS + 5];
/* --- TAJ PG Server--- */ /* --- G7TAJ PG Server--- */
void run_pg( CIRCUIT * conn, struct UserInfo * user ); void run_pg( CIRCUIT * conn, struct UserInfo * user );
void startrun_pgThread( RUNPGARGS_PTR Args ); void startrun_pgThread( RUNPGARGS_PTR Args );
@ -234,7 +234,7 @@ char * SERVERLIST[256][3];
int NUM_SERVERS = 0; int NUM_SERVERS = 0;
/*------- TAJ END ----------*/ /*------- G7TAJ END ----------*/
#ifdef LINBPQ #ifdef LINBPQ
@ -1038,20 +1038,6 @@ Next:
} }
SortBBSChain(); SortBBSChain();
/*------- TAJ PG SERVER ----------*/
#ifndef WIN32
printf("Number of PG Servers = %d\n", NUM_SERVERS );
for ( int i=0; i< NUM_SERVERS; i++ ) {
printf("Server #%d\t%s\tExec->%s\tDESC->%s\n", i, SERVERLIST[i][0], SERVERLIST[i][1], SERVERLIST[i][2]);
}
#endif
/*------- TAJ END ----------*/
} }
VOID CopyUserDatabase() VOID CopyUserDatabase()
@ -8241,6 +8227,7 @@ InBand:
else else
Delay = 1000; Delay = 1000;
conn->BBSFlags &= ~RunningConnectScript; // so it doesn't get reentered conn->BBSFlags &= ~RunningConnectScript; // so it doesn't get reentered
Disconnect(conn->BPQStream); Disconnect(conn->BPQStream);
@ -8385,6 +8372,14 @@ InBand:
goto LoopBack; goto LoopBack;
} }
if (_memicmp(Cmd, "IDLETIME ", 9) == 0)
{
int idle = atoi(&Cmd[9]);
ChangeSessionIdletime(conn->BPQStream, idle);
goto LoopBack;
}
if (_memicmp(Cmd, "RADIO AUTH", 10) == 0) if (_memicmp(Cmd, "RADIO AUTH", 10) == 0)
{ {
// Generate a Password to enable RADIO commands on a remote node // Generate a Password to enable RADIO commands on a remote node
@ -9185,12 +9180,14 @@ VOID FWDTimerProc()
struct BBSForwardingInfo * ForwardingInfo ; struct BBSForwardingInfo * ForwardingInfo ;
time_t NOW = time(NULL); time_t NOW = time(NULL);
// Entered every 2 seconds
for (user = BBSChain; user; user = user->BBSNext) for (user = BBSChain; user; user = user->BBSNext)
{ {
// See if any messages are queued for this BBS // See if any messages are queued for this BBS
ForwardingInfo = user->ForwardingInfo; ForwardingInfo = user->ForwardingInfo;
ForwardingInfo->FwdTimer+=10; ForwardingInfo->FwdTimer += 2;
if (ForwardingInfo->FwdTimer >= ForwardingInfo->FwdInterval) if (ForwardingInfo->FwdTimer >= ForwardingInfo->FwdInterval)
{ {
@ -10852,15 +10849,15 @@ int Disconnected (int Stream)
conn->InputBufferLen = 0; conn->InputBufferLen = 0;
} }
/* ---- TAJ PG SERVER ---- */ /* ---- G7TAJ PG SERVER ---- */
if (conn->UserPointer && conn->UserPointer->Temp && conn->UserPointer->Temp->RUNPGPARAMS) if (conn->UserPointer && conn->UserPointer->Temp && conn->UserPointer->Temp->RUNPGPARAMS)
{ {
printf("Freeing RUNPGPARAMS\n"); Debugprintf("Freeing RUNPGPARAMS");
free(conn->UserPointer->Temp->RUNPGPARAMS); free(conn->UserPointer->Temp->RUNPGPARAMS);
conn->UserPointer->Temp->RUNPGPARAMS = NULL; conn->UserPointer->Temp->RUNPGPARAMS = NULL;
} }
/*------- TAJ END --------- */ /*------- G7TAJ END --------- */
if (conn->InputMode == 'B') if (conn->InputMode == 'B')
{ {
@ -10977,7 +10974,7 @@ int DoReceivedData(int Stream)
} }
/* ---------- TAJ START - PG server --------- */ /* ---------- G7TAJ START - PG server --------- */
if (conn->InputMode == 'P') // Inside PG Server if (conn->InputMode == 'P') // Inside PG Server
{ {
@ -10985,7 +10982,7 @@ int DoReceivedData(int Stream)
run_pg(conn, user); run_pg(conn, user);
return 0; return 0;
} }
/* ---------- TAJ END --------- */ /* ---------- G7TAJ END --------- */
if (conn->InputMode == 'B') if (conn->InputMode == 'B')
{ {
@ -11736,7 +11733,7 @@ extern UCHAR * infile;
BOOL CheckforMIME(SocketConn * sockptr, char * Msg, char ** Body, int * MsgLen); BOOL CheckforMIME(SocketConn * sockptr, char * Msg, char ** Body, int * MsgLen);
/* ---TAJ PG Server --- */ /* ---G7TAJ PG Server --- */
#ifndef WIN32 #ifndef WIN32
#define verbose 1 #define verbose 1
@ -11762,16 +11759,17 @@ void run_pgTimeoutThread( pid_t process )
fflush(stdout); fflush(stdout);
Sleep(5000); Sleep(5000);
// if still running PID (?) then kill. // if still running PID (?) then kill.
if ( getpgid(process) >= 0 ) { if ( getpgid(process) >= 0 )
printf("watchdog thread: Still running, so killing %d ... ", process); {
// if ( kill( process, SIGTERM ) == 0 ) { Debugprintf("watchdog thread: Still running, so killing %d ... ", process);
if ( kill( -process, SIGKILL ) == 0 ) { if ( kill( -process, SIGKILL ) == 0 )
printf("Killed\n"); Debugprintf("Killed PG watchdog Process %d", process);
} else { else
printf("Failed\n"); Debugprintf("Failed to kill PG watchdog Process %d", process);
} }
}
printf("watchdog thread: PID=%d Exit\n", process);
Debugprintf("watchdog thread: PID=%d Exit", process);
fflush(stdout); fflush(stdout);
//return; //return;
} }
@ -11802,7 +11800,7 @@ POPENRET my_popen(char *program, char *type, CIRCUIT *conn)
if (*type == 'r') { if (*type == 'r') {
if (pdes[1] != 1) { if (pdes[1] != 1) {
dup2(pdes[1], 1); dup2(pdes[1], 1);
dup2(pdes[1], 2); /* stderr, too! */ dup2(pdes[1], 2);
(void)close(pdes[1]); (void)close(pdes[1]);
} }
(void)close(pdes[0]); (void)close(pdes[0]);
@ -11819,9 +11817,8 @@ POPENRET my_popen(char *program, char *type, CIRCUIT *conn)
_exit(1); _exit(1);
} }
/* parent; assume fdopen can't fail... */ /* parent */
printf("PID=%d\n", pid );
_beginthread((void (*)(void *))run_pgTimeoutThread, 0, (VOID *) pid ); _beginthread((void (*)(void *))run_pgTimeoutThread, 0, (VOID *) pid );
if (*type == 'r') { if (*type == 'r') {
@ -11833,17 +11830,13 @@ POPENRET my_popen(char *program, char *type, CIRCUIT *conn)
} }
char buffer[128]; char buffer[128];
while (fgets(buffer, sizeof(buffer), iop) != NULL) { while (fgets(buffer, sizeof(buffer), iop) != NULL)
{
BBSputs(conn, buffer); BBSputs(conn, buffer);
// printf("%s", buffer);
// sleep(200);
buffer[0] = '\0'; buffer[0] = '\0';
} }
// BBSputs(conn,"\n");
PRET.fp = iop; PRET.fp = iop;
PRET.pid= pid; PRET.pid= pid;
// (void)close(pdes[0]);
// (void)close(pdes[1]);
return(PRET); return(PRET);
} }
@ -11869,8 +11862,6 @@ my_pclose( POPENRET pret )
sigprocmask(SIG_SETMASK, &omask, NULL); sigprocmask(SIG_SETMASK, &omask, NULL);
if (pid == -1 || !WIFEXITED(stat_loc)) if (pid == -1 || !WIFEXITED(stat_loc))
return -1; return -1;
// return WEXITSTATUS(stat_loc);
printf( "return = %d\n", WEXITSTATUS(stat_loc));
return stat_loc; return stat_loc;
} }
@ -11889,9 +11880,8 @@ int run_server (char **cmd, int nb_cmd, int mode, char *log, char *pgdir, char *
char arg[256]; char arg[256];
if (mode) if (mode)
// sprintf (file, " </dev/null >%s", log); // sprintf (file, " >>%s", log);
// sprintf (file, " >>%s", log); // sprintf (file, " | tee -a %s", log);
// sprintf (file, " | tee -a %s", log);
sprintf(file, "" ); sprintf(file, "" );
else else
sprintf (file, " </dev/null"); sprintf (file, " </dev/null");
@ -11933,24 +11923,17 @@ int run_server (char **cmd, int nb_cmd, int mode, char *log, char *pgdir, char *
PRET = my_popen (buf, "r", conn); PRET = my_popen (buf, "r", conn);
if (PRET.fp == NULL) if (PRET.fp == NULL)
printf ("Failed to run command\n" ); Debugprintf ("Failed to run PG command %s\n", cmd[i] );
// else {
/* start timeout thread to kill process if it runs for more than 5 sec (make configurable?)*/
// _beginthread((void (*)(void *))run_pgTimeoutThread, 0, (VOID *) PRET.pid );
// }
//ret = (int)PRET.pid;
//wait(&ret);
ret = my_pclose( PRET ); ret = my_pclose( PRET );
ret = ret >> 8; ret = ret >> 8;
if (verbose) { if (verbose) {
printf ("Debug: command = {%s}\n", buf); Debugprintf ("Debug: command = {%s}\n", buf);
printf ("Debug: exit code = %d\n", ret); Debugprintf ("Debug: exit code = %d\n", ret);
} }
/* fail-safe bypass if filter executable isn't found (exit code 127) (was ret ==127)*/ /* fail-safe bypass if executable isn't found (exit code 127) (was ret ==127)*/
if (ret > 5) // should never be more than 5 if (ret > 5) // should never be more than 5
ret = 0; ret = 0;
} }
@ -11962,7 +11945,6 @@ void run_pg( CIRCUIT * conn, struct UserInfo * user )
{ {
if (!user->Temp->RUNPGPARAMS) { if (!user->Temp->RUNPGPARAMS) {
// printf("Allocating new RUNPGPARAMS\n");
user->Temp->RUNPGPARAMS = (RUNPGARGS_PTR) zalloc(sizeof(RUNPGARGS)); user->Temp->RUNPGPARAMS = (RUNPGARGS_PTR) zalloc(sizeof(RUNPGARGS));
} }
@ -11972,7 +11954,7 @@ void run_pg( CIRCUIT * conn, struct UserInfo * user )
user->Temp->RUNPGPARAMS->Len = conn->InputLen; user->Temp->RUNPGPARAMS->Len = conn->InputLen;
if ( conn == 0 || user == 0 ) { if ( conn == 0 || user == 0 ) {
printf("run_pg null err\n"); Debugprintf("run_pg null err");
return; return;
} }
@ -11990,7 +11972,7 @@ void startrun_pgThread( RUNPGARGS_PTR Args ) {
char cmd[20]; char cmd[20];
sprintf( cmd, "./%s", SERVERLIST[user->Temp->PG_SERVER][1] ); sprintf( cmd, "./%s", SERVERLIST[user->Temp->PG_SERVER][1] );
char *ptr = cmd; char *ptr = cmd;
char pg_dir[] = "/home/pi/linbpq/linbpq/downloads/new/linbpq/pg/"; char pg_dir[MAX_PATH];
char log_file[50] = "pg.log"; char log_file[50] = "pg.log";
char call[6]; char call[6];
char data[80]; char data[80];
@ -12000,8 +11982,23 @@ void startrun_pgThread( RUNPGARGS_PTR Args ) {
char *data_ptr = data; char *data_ptr = data;
size_t bufsize = 80; size_t bufsize = 80;
strcpy(pg_dir, BaseDir);
strcat(pg_dir, "/PG/");
sprintf(line, "%s%s", pg_dir, SERVERLIST[user->Temp->PG_SERVER][1]);
// check file exists and is executable
if (access(line, F_OK) == -1 || access(line, X_OK) == -1) {
Debugprintf("%s FileNotFound || Not EXE", line);
BBSputs(conn, "Error running PG Server\r");
conn->InputMode=0;
SendPrompt(conn, user);
return;
}
strcpy( call, conn->UserPointer->Call); strcpy( call, conn->UserPointer->Call);
// sprintf( log_file, "%s-%d.log", call, conn); // sprintf( log_file, "%s-%d.log", call, conn);
index = user->Temp->PG_INDEX; index = user->Temp->PG_INDEX;
line[0] = '\0'; line[0] = '\0';
@ -12031,18 +12028,18 @@ void startrun_pgThread( RUNPGARGS_PTR Args ) {
conn->InputMode=0; conn->InputMode=0;
Disconnect(conn->BPQStream); Disconnect(conn->BPQStream);
break; break;
case 3: printf("data->BBS & end\n"); case 3: Debugprintf("data->BBS & end");
break; break;
case 4: printf("data->BBS and inc %d\n", index++); case 4: Debugprintf("data->BBS and inc %d", index++);
break; break;
case 5: printf("call no inc %d\n", ret); case 5: Debugprintf("call no inc %d", ret);
break; break;
} }
user->Temp->PG_INDEX=index; user->Temp->PG_INDEX=index;
} }
/*---- TAJ END ----- */ /*---- G7TAJ END ----- */
#else #else
@ -12075,7 +12072,7 @@ void run_pg( CIRCUIT * conn, struct UserInfo * user )
int index = 0; int index = 0;
int ret = 0; int ret = 0;
// if first entay allocate RUNPGPARAMS // if first entry allocate RUNPGPARAMS
if (!user->Temp->RUNPGPARAMS) if (!user->Temp->RUNPGPARAMS)
{ {
user->Temp->RUNPGPARAMS = (RUNPGARGS_PTR) zalloc(sizeof(RUNPGARGS)); user->Temp->RUNPGPARAMS = (RUNPGARGS_PTR) zalloc(sizeof(RUNPGARGS));
@ -13063,7 +13060,7 @@ VOID ProcessLine(CIRCUIT * conn, struct UserInfo * user, char* Buffer, int len)
return; return;
} }
/*---- TAJ PG Server ----- */ /*---- G7TAJ PG Server ----- */
if (_stricmp(Cmd, "PG") == 0) if (_stricmp(Cmd, "PG") == 0)
@ -13106,11 +13103,13 @@ VOID ProcessLine(CIRCUIT * conn, struct UserInfo * user, char* Buffer, int len)
return; return;
} }
} }
BBSputs(conn, "No server found\r");
SendPrompt(conn, user);
return;
}
} }
} /*---- G7TAJ END ---- */
/*---- TAJ END ---- */
if (conn->Flags == 0) if (conn->Flags == 0)
{ {
@ -15750,6 +15749,7 @@ VOID GetPGConfig()
char buf[256],errbuf[256]; char buf[256],errbuf[256];
char * p_prog, * p_name, * p_desc; char * p_prog, * p_name, * p_desc;
int n = 0; int n = 0;
int i = 0;
strcpy(FN, BaseDir); strcpy(FN, BaseDir);
@ -15761,6 +15761,9 @@ VOID GetPGConfig()
while(fgets(buf, 255, file) != NULL) while(fgets(buf, 255, file) != NULL)
{ {
if ( buf[0] == '#')
continue;
strcpy(errbuf,buf); // save in case of error strcpy(errbuf,buf); // save in case of error
p_prog = strtok(buf, ",\n\r"); p_prog = strtok(buf, ",\n\r");
@ -15784,6 +15787,15 @@ VOID GetPGConfig()
NUM_SERVERS = n; NUM_SERVERS = n;
fclose(file); fclose(file);
/*------- G7TAJ PG SERVER ----------*/
Debugprintf("Number of PG Servers = %d", NUM_SERVERS );
for (i=0; i< NUM_SERVERS; i++ )
{
Debugprintf("Server #%d,%s,%s,%s", i, SERVERLIST[i][0], SERVERLIST[i][1], SERVERLIST[i][2]);
}
/*------- G7TAJ END ----------*/
} }
void SendMessageReadEvent(char * call, struct MsgInfo * Msg) void SendMessageReadEvent(char * call, struct MsgInfo * Msg)

View 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="NOTTSDESKTOP"
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="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -1131,6 +1131,8 @@
// Add Send P to multiple BBS's when routing on HR (30) // Add Send P to multiple BBS's when routing on HR (30)
// Fix Traffic stats for T messages received via B2 forwarding (31) // Fix Traffic stats for T messages received via B2 forwarding (31)
// Fix possible failure to update last listed count when user disconnects without using B command // Fix possible failure to update last listed count when user disconnects without using B command
// Add short random delay (<30 secs) when forward new Messages immediately is enabled (35)
// Fix Connect Script IDLETIME (38)
#include "bpqmail.h" #include "bpqmail.h"
#include "winstdint.h" #include "winstdint.h"
@ -2160,7 +2162,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
CheckTimer(); CheckTimer();
TCPTimer(); TCPTimer();
BBSSlowTimer(); BBSSlowTimer();
FWDTimerProc();
if (MaintClock < NOW) if (MaintClock < NOW)
{ {
while (MaintClock < NOW) // in case large time step while (MaintClock < NOW) // in case large time step
@ -2182,6 +2183,14 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
} }
My__except_Routine("Slow Timer"); My__except_Routine("Slow Timer");
} }
if (wParam == 3) // Forward (2 Secs)
{
__try
{
FWDTimerProc();
}
My__except_Routine("Fwd Timer");
}
else else
__try __try
{ {
@ -3310,6 +3319,7 @@ BOOL Initialise()
SetTimer(hWnd,1,10000,NULL); // Slow Timer (10 Secs) SetTimer(hWnd,1,10000,NULL); // Slow Timer (10 Secs)
SetTimer(hWnd,2,100,NULL); // Send to Node and TCP Poll (100 ms) SetTimer(hWnd,2,100,NULL); // Send to Node and TCP Poll (100 ms)
SetTimer(hWnd,3,2000,NULL); // Forward Check (2 secs)
// Calulate time to run Housekeeping // Calulate time to run Housekeeping
{ {

View 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="NOTTSDESKTOP"
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="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -1213,6 +1213,12 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Improve validation of Web Beacon Config (33) // Improve validation of Web Beacon Config (33)
// Support SNMP via host ip stack as well as IPGateway (34) // Support SNMP via host ip stack as well as IPGateway (34)
// Switch APRS Map to OSM tile servers (36)
// Fix potential buffer overflow in Telnet login (36)
// Allow longer serial device names (37)
// Fix ICF8101 Mode setting (37)
#define CKernel #define CKernel
#include "Versions.h" #include "Versions.h"

View File

@ -37,7 +37,7 @@
Name="Release|Win32" Name="Release|Win32"
> >
<DebugSettings <DebugSettings
Command="" Command="C:\Devprogs\BPQ32\bpq32.exe"
WorkingDirectory="" WorkingDirectory=""
CommandArguments="" CommandArguments=""
Attach="false" Attach="false"

View File

@ -2184,7 +2184,7 @@ int OpenCOMMPort(struct TNCINFO * conn, char * Port, int Speed, BOOL Quiet)
HANDLE OpenCOMPort(char * pPort, int speed, BOOL SetDTR, BOOL SetRTS, BOOL Quiet, int Stopbits) HANDLE OpenCOMPort(char * pPort, int speed, BOOL SetDTR, BOOL SetRTS, BOOL Quiet, int Stopbits)
{ {
char szPort[80]; char szPort[256];
BOOL fRetVal ; BOOL fRetVal ;
COMMTIMEOUTS CommTimeOuts ; COMMTIMEOUTS CommTimeOuts ;
int Err; int Err;
@ -2576,8 +2576,9 @@ BOOL WriteCOMBlock(HANDLE fd, char * Block, int BytesToWrite)
int ToSend = BytesToWrite; int ToSend = BytesToWrite;
int Sent = 0, ret; int Sent = 0, ret;
int loops = 100;
while (ToSend) while (ToSend && loops-- > 0)
{ {
ret = write(fd, &Block[Sent], ToSend); ret = write(fd, &Block[Sent], ToSend);
@ -2596,6 +2597,12 @@ BOOL WriteCOMBlock(HANDLE fd, char * Block, int BytesToWrite)
Sent += ret; Sent += ret;
ToSend -= ret; ToSend -= ret;
} }
// if (ToSend)
// {
// // Send timed out. Close and reopen device
//
// }
return TRUE; return TRUE;
} }

View File

@ -639,8 +639,8 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
if (buffptr == 0) return (0); // No buffers, so ignore if (buffptr == 0) return (0); // No buffers, so ignore
buffptr->Len = 36; buffptr->Len = 21;
memcpy(&buffptr->Data[0], "No Connection to TNC\r", 36); memcpy(&buffptr->Data[0], "No Connection to TNC\r", 21);
C_Q_ADD(&TNC->Streams[Stream].PACTORtoBPQ_Q, buffptr); C_Q_ADD(&TNC->Streams[Stream].PACTORtoBPQ_Q, buffptr);

View File

@ -2220,7 +2220,10 @@ BOOL CheckIPChecksum(PIPMSG IPptr)
checksum = cksum((unsigned short *)IPptr, 20); checksum = cksum((unsigned short *)IPptr, 20);
if (checksum == 0xffff) return TRUE; else return FALSE; if (checksum == 0xffff)
return TRUE;
else
return FALSE;
} }
BOOL Check_Checksum(VOID * ptr1, int Len) BOOL Check_Checksum(VOID * ptr1, int Len)
@ -2229,7 +2232,10 @@ BOOL Check_Checksum(VOID * ptr1, int Len)
checksum = cksum((unsigned short *)ptr1, Len); checksum = cksum((unsigned short *)ptr1, Len);
if (checksum == 0xffff) return TRUE; else return FALSE; if (checksum == 0xffff)
return TRUE;
else
return FALSE;
} }
USHORT Generate_CHECKSUM(VOID * ptr1, int Len) USHORT Generate_CHECKSUM(VOID * ptr1, int Len)

View File

@ -174,7 +174,7 @@ VOID L2Routine(struct PORTCONTROL * PORT, PMESSAGE Buffer)
if (c == ' ') // Blank Call if (c == ' ') // Blank Call
{ {
Debugprintf("BPQ32 Blank Call Port &%", PORT->PORTNUMBER); Debugprintf("BPQ32 Blank Call Port %d", PORT->PORTNUMBER);
ReleaseBuffer(Buffer); ReleaseBuffer(Buffer);
return; return;
} }
@ -1775,7 +1775,7 @@ VOID L2_PROCESS(struct _LINKTABLE * LINK, struct PORTCONTROL * PORT, MESSAGE * B
switch (CTL & 0x0f) switch (CTL & 0x0f)
{ {
// is there any harm in accepoting SREJ even if we don't // is there any harm in accepting SREJ even if we don't
// otherwise support 2.2? // otherwise support 2.2?
case REJ: case REJ:
@ -3004,6 +3004,8 @@ VOID ACKMSG(struct _LINKTABLE * LINK)
Debugprintf("Missing frame to ack Seq %d Calls %s %s", LINK->LINKOWS, Call1, Call2); Debugprintf("Missing frame to ack Seq %d Calls %s %s", LINK->LINKOWS, Call1, Call2);
} }
LINK->IFrameRetryCounter = 0;
LINK->LINKOWS++; // INCREMENT OLD WINDOW START LINK->LINKOWS++; // INCREMENT OLD WINDOW START
LINK->LINKOWS &= 7; // MODULO 8 LINK->LINKOWS &= 7; // MODULO 8
@ -3018,6 +3020,18 @@ VOID ACKMSG(struct _LINKTABLE * LINK)
{ {
// NOT ALL I-FRAMES HAVE BEEN ACK'ED - RESTART TIMER // NOT ALL I-FRAMES HAVE BEEN ACK'ED - RESTART TIMER
// Need to kill link if we are getting repeated RR(F) after timeout
// (Indicating other station is seeing our RR(P) but not the resent I frame)
if (LINK->IFrameRetryCounter++ > LINK->LINKPORT->PORTN2)
{
Debugprintf("Too many repeats of same I frame - closing connection");
LINK->L2TIMER = 1; // USE TIMER TO SEND DISC
LINK->L2STATE = 4; // DISCONNECTING
return;
}
LINK->L2TIMER = LINK->L2TIME; LINK->L2TIMER = LINK->L2TIME;
return; return;
} }
@ -3033,7 +3047,7 @@ VOID ACKMSG(struct _LINKTABLE * LINK)
// IF DISCONNECT REQUEST OUTSTANDING, AND NO FRAMES ON TX QUEUE, SEND DISC // IF DISCONNECT REQUEST OUTSTANDING, AND NO FRAMES ON TX QUEUE, SEND DISC
if (LINK->L2FLAGS & DISCPENDING && LINK->TX_Q == 0) if ((LINK->L2FLAGS & DISCPENDING) && LINK->TX_Q == 0)
{ {
LINK->L2FLAGS &= ~DISCPENDING; LINK->L2FLAGS &= ~DISCPENDING;

View File

@ -75,6 +75,7 @@ int upnpClose();
void SaveAIS(); void SaveAIS();
void initAIS(); void initAIS();
void DRATSPoll(); void DRATSPoll();
VOID GetPGConfig();
extern uint64_t timeLoadedMS; extern uint64_t timeLoadedMS;
@ -1138,6 +1139,7 @@ int main(int argc, char * argv[])
GetBIDDatabase(); GetBIDDatabase();
GetBadWordFile(); GetBadWordFile();
GetHTMLForms(); GetHTMLForms();
GetPGConfig();
// Make sure there is a user record for the BBS, with BBS bit set. // Make sure there is a user record for the BBS, with BBS bit set.
@ -1557,13 +1559,15 @@ int main(int argc, char * argv[])
{ {
PollStreams(); PollStreams();
if ((Slowtimer % 20) == 0)
FWDTimerProc();
if (Slowtimer > 100) // 10 secs if (Slowtimer > 100) // 10 secs
{ {
time_t NOW = time(NULL); time_t NOW = time(NULL);
struct tm * tm; struct tm * tm;
TCPTimer(); TCPTimer();
FWDTimerProc();
BBSSlowTimer(); BBSSlowTimer();
if (MaintClock < NOW) if (MaintClock < NOW)

View File

@ -351,7 +351,7 @@ VOID DoSetIdleTime(CIRCUIT * conn, struct UserInfo * user, char * Arg1, char * C
return; return;
} }
nodeprintf(conn, "Idle Tine set to %d\r", IdleTime); nodeprintf(conn, "Idle Time set to %d\r", IdleTime);
SendPrompt(conn, user); SendPrompt(conn, user);
return; return;
} }

View File

@ -10,7 +10,7 @@
> >
<DebugSettings <DebugSettings
Command="$(TargetPath)" Command="$(TargetPath)"
WorkingDirectory="" WorkingDirectory="c:\linbpq"
CommandArguments="" CommandArguments=""
Attach="false" Attach="false"
DebuggerType="3" DebuggerType="3"
@ -22,7 +22,7 @@
SQLDebugging="" SQLDebugging=""
Environment="" Environment=""
EnvironmentMerge="true" EnvironmentMerge="true"
DebuggerFlavor="" DebuggerFlavor="0"
MPIRunCommand="" MPIRunCommand=""
MPIRunArguments="" MPIRunArguments=""
MPIRunWorkingDirectory="" MPIRunWorkingDirectory=""

View File

@ -817,14 +817,14 @@ VOID CheckAndSend(struct MsgInfo * Msg, CIRCUIT * conn, struct UserInfo * bbs)
{ {
struct BBSForwardingInfo * ForwardingInfo = bbs->ForwardingInfo; struct BBSForwardingInfo * ForwardingInfo = bbs->ForwardingInfo;
if (ForwardToMe || _stricmp(bbs->Call, BBSName) != 0) // Dont forward to ourself - already here! (unless ForwardToMe set) if (ForwardToMe || _stricmp(bbs->Call, BBSName) != 0) // Don't forward to ourself - already here! (unless ForwardToMe set)
{ {
if ((conn == NULL) || (!(conn->BBSFlags & BBS) || (_stricmp(conn->UserPointer->Call, bbs->Call) != 0))) // Dont send back if ((conn == NULL) || (!(conn->BBSFlags & BBS) || (_stricmp(conn->UserPointer->Call, bbs->Call) != 0))) // Dont send back
{ {
set_fwd_bit(Msg->fbbs, bbs->BBSNumber); set_fwd_bit(Msg->fbbs, bbs->BBSNumber);
ForwardingInfo->MsgCount++; ForwardingInfo->MsgCount++;
if (ForwardingInfo->SendNew) if (ForwardingInfo->SendNew)
ForwardingInfo->FwdTimer = ForwardingInfo->FwdInterval; ForwardingInfo->FwdTimer = ForwardingInfo->FwdInterval - (2 + (rand() % 30)); //Short delay to prevent all starting at once
} }
} }
else else

View File

@ -1543,11 +1543,19 @@ int Rig_CommandEx(struct RIGPORTINFO * PORT, struct RIGINFO * RIG, TRANSPORTENTR
*(CmdPtr++) = 0x1A; *(CmdPtr++) = 0x1A;
*(CmdPtr++) = 0x36; // Set mode command *(CmdPtr++) = 0x36; // Set mode command
*(CmdPtr++) = 0; *(CmdPtr++) = 0;
if (ModeNo > 10) if (ModeNo > 19)
*(CmdPtr++) = ModeNo + 12;
else if (ModeNo > 9)
*(CmdPtr++) = ModeNo + 6; *(CmdPtr++) = ModeNo + 6;
else else
*(CmdPtr++) = ModeNo; *(CmdPtr++) = ModeNo;
*(CmdPtr++) = 0xFD; *(CmdPtr++) = 0xFD;
// Mode = (Msg[7] >> 4);
// Mode *= 10;
// Mode += Msg[7] & 0xf;
} }
} }
else else
@ -3980,6 +3988,8 @@ SetFinished:
strcpy(RIG->ModeString, Modes[Mode]); strcpy(RIG->ModeString, Modes[Mode]);
SetWindowText(RIG->hMODE, RIG->WEB_MODE); SetWindowText(RIG->hMODE, RIG->WEB_MODE);
return; return;
} }
} }
@ -6995,7 +7005,10 @@ CheckScan:
*(CmdPtr++) = 0x1A; *(CmdPtr++) = 0x1A;
*(CmdPtr++) = 0x36; // Set mode command *(CmdPtr++) = 0x36; // Set mode command
*(CmdPtr++) = 0; *(CmdPtr++) = 0;
if (ModeNo > 10)
if (ModeNo > 19)
*(CmdPtr++) = ModeNo + 12;
else if (ModeNo > 9)
*(CmdPtr++) = ModeNo + 6; *(CmdPtr++) = ModeNo + 6;
else else
*(CmdPtr++) = ModeNo; *(CmdPtr++) = ModeNo;
@ -7480,7 +7493,11 @@ VOID PTTCATThread(struct RIGINFO *RIG)
if (Handle[HIndex] == (HANDLE) -1) if (Handle[HIndex] == (HANDLE) -1)
{ {
int Err = GetLastError(); int Err = GetLastError();
Consoleprintf("PTTMUX port BPQCOM%s Open failed code %d - trying real com port", RIG->PTTCATPort[PIndex], Err); char errmsg[256] = "";
// Only report if both BPQCOM and Real COM fail
sprintf(errmsg, "PTTMUX port BPQCOM%s Open failed code %d - trying real com port", RIG->PTTCATPort[PIndex], Err);
// See if real com port // See if real com port
@ -7494,8 +7511,12 @@ VOID PTTCATThread(struct RIGINFO *RIG)
if (Handle[HIndex] == (HANDLE) -1) if (Handle[HIndex] == (HANDLE) -1)
{ {
int Err = GetLastError(); int Err = GetLastError();
if (errmsg[0])
{
Consoleprintf("%s", errmsg);
Consoleprintf("PTTMUX port COM%s Open failed code %d", RIG->PTTCATPort[PIndex], Err); Consoleprintf("PTTMUX port COM%s Open failed code %d", RIG->PTTCATPort[PIndex], Err);
} }
}
else else
{ {
rc = SetCommMask(Handle[HIndex], EV_CTS | EV_DSR); // Request notifications rc = SetCommMask(Handle[HIndex], EV_CTS | EV_DSR); // Request notifications

4322
SCSPactor.c.bak Normal file

File diff suppressed because it is too large Load Diff

View File

@ -3882,8 +3882,8 @@ MsgLoop:
if (strlen(MsgPtr) > 64) if (strlen(MsgPtr) > 64)
{ {
Debugprintf("Telnet Bad User Name %s", MsgPtr);
MsgPtr[64] = 0; MsgPtr[64] = 0;
Debugprintf("Telnet Bad User Name %s", MsgPtr);
} }
sprintf(logmsg,"%d %s User=%s\n", sockptr->Number, Addr, MsgPtr); sprintf(logmsg,"%d %s User=%s\n", sockptr->Number, Addr, MsgPtr);
@ -3958,8 +3958,8 @@ MsgLoop:
if (strlen(MsgPtr) > 64) if (strlen(MsgPtr) > 64)
{ {
Debugprintf("Telnet Bad Password %s", MsgPtr);
MsgPtr[64] = 0; MsgPtr[64] = 0;
Debugprintf("Telnet Bad Password %s", MsgPtr);
} }
@ -4757,8 +4757,8 @@ MsgLoop:
if (strlen(MsgPtr) > 64) if (strlen(MsgPtr) > 64)
{ {
Debugprintf("Telnet Bad User Name %s", MsgPtr);
MsgPtr[64] = 0; MsgPtr[64] = 0;
Debugprintf("Telnet Bad User Name %s", MsgPtr);
} }
sprintf(logmsg,"%d %s User=%s\n", sockptr->Number, Addr, MsgPtr); sprintf(logmsg,"%d %s User=%s\n", sockptr->Number, Addr, MsgPtr);
@ -4841,8 +4841,8 @@ MsgLoop:
if (strlen(MsgPtr) > 64) if (strlen(MsgPtr) > 64)
{ {
Debugprintf("Telnet Bad Password %s", MsgPtr);
MsgPtr[64] = 0; MsgPtr[64] = 0;
Debugprintf("Telnet Bad Password %s", MsgPtr);
} }
sprintf(logmsg,"%d %s Password=%s\n", sockptr->Number, Addr, MsgPtr); sprintf(logmsg,"%d %s Password=%s\n", sockptr->Number, Addr, MsgPtr);

View File

@ -10,8 +10,8 @@
#endif #endif
#define KVers 6,0,24,34 #define KVers 6,0,24,38
#define KVerstring "6.0.24.34\0" #define KVerstring "6.0.24.38\0"
#ifdef CKernel #ifdef CKernel

View 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="NOTTSDESKTOP"
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="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View 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="NOTTSDESKTOP"
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="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -903,6 +903,8 @@ typedef struct _LINKTABLE
VOID * L2FRAG_Q; // DEFRAGMENTATION QUEUE VOID * L2FRAG_Q; // DEFRAGMENTATION QUEUE
int IFrameRetryCounter; // Number of times an I frame in repeated without a frame being acked
} LINKTABLE; } LINKTABLE;
#pragma pack(1) #pragma pack(1)

View File

@ -1,6 +1,5 @@
/* /*
Copyright 2001-2022 John Wiseman G8BPQ Copyright 2001-2022 John Wiseman G8BPQ
This file is part of LinBPQ/BPQ32. This file is part of LinBPQ/BPQ32.
LinBPQ/BPQ32 is free software: you can redistribute it and/or modify LinBPQ/BPQ32 is free software: you can redistribute it and/or modify

View File

@ -214,8 +214,8 @@ struct RIGPORTINFO
{ {
int PortType; // ICOM, Yaesu, Etc int PortType; // ICOM, Yaesu, Etc
int YaesuVariant; // Yaesu seems to have lots of incompatible subtypes int YaesuVariant; // Yaesu seems to have lots of incompatible subtypes
char IOBASE[80]; char IOBASE[256];
char PTTIOBASE[80]; // Port for Hardware PTT - may be same as control port. char PTTIOBASE[256]; // Port for Hardware PTT - may be same as control port.
int SPEED; int SPEED;
char * HIDDevice; char * HIDDevice;
struct RIGINFO Rigs[10]; // Rigs off a port struct RIGINFO Rigs[10]; // Rigs off a port