summaryrefslogtreecommitdiff
path: root/cMain.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2025-10-10 23:37:31 +0100
committerDave Hibberd <hibby@debian.org>2025-10-10 23:37:31 +0100
commit96ac3e4a36e5a0a9d86c10442ed747a8a910b40c (patch)
tree17215eb22d64de32efda93c6d4bd6a02499cbefc /cMain.c
parent7c796758d1b65d4d7585c90ba71b1fb339a4d283 (diff)
New upstream version 6.0.25.06+repackupstream/6.0.25.06+repack
Diffstat (limited to 'cMain.c')
-rw-r--r--cMain.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/cMain.c b/cMain.c
index c722147..45f1384 100644
--- a/cMain.c
+++ b/cMain.c
@@ -54,6 +54,7 @@ void MQTTTimer();
void SaveMH();
VOID InformPartner(struct _LINKTABLE * LINK, int Reason);
VOID L2SENDCOMMAND(struct _LINKTABLE * LINK, int CMD);
+void WritePacketLogThread(void * param);
#include "configstructs.h"
@@ -61,6 +62,7 @@ VOID L2SENDCOMMAND(struct _LINKTABLE * LINK, int CMD);
extern struct CONFIGTABLE xxcfg;
extern BOOL needAIS;
extern int needADSB;
+extern int EnableOARCAPI;
struct PORTCONFIG * PortRec;
@@ -181,6 +183,7 @@ extern VOID * ENDPOOL;
extern void * APPL_Q; // Queue of frames for APRS Appl
extern BOOL APRSActive;
+extern int DEBUGINP3;
#define BPQHOSTSTREAMS 64
@@ -194,9 +197,12 @@ BPQVECSTRUC * TELNETMONVECPTR = &BPQHOSTVECTOR[BPQHOSTSTREAMS];
BPQVECSTRUC * AGWMONVECPTR = &BPQHOSTVECTOR[BPQHOSTSTREAMS + 1];
BPQVECSTRUC * APRSMONVECPTR = &BPQHOSTVECTOR[BPQHOSTSTREAMS + 2];
BPQVECSTRUC * IPHOSTVECTORPTR = &BPQHOSTVECTOR[BPQHOSTSTREAMS + 3];
+BPQVECSTRUC * FILEMONVECTOR = &BPQHOSTVECTOR[BPQHOSTSTREAMS + 4];
int BPQVECLENGTH = sizeof(BPQVECSTRUC);
+int MONTOFILEFLAG = 0;
+
int NODEORDER = 0;
UCHAR LINKEDFLAG = 0;
@@ -250,6 +256,8 @@ int CFLAG = 0; // C =HOST Command
VOID * IDMSG_Q = NULL; // ID/BEACONS WAITING TO BE SENT
int NODESINPROGRESS = 0;
+int NODESToOnePort = 0; // Set to port num to send NODES to only one port.
+
VOID * CURRENTNODE = NULL; // NEXT _NODE TO SEND
VOID * DESTHEADER = NULL; // HEAD OF SORTED NODES CHAIN
@@ -862,6 +870,11 @@ BOOL Start()
PREFERINP3ROUTES = cfg->C_PREFERINP3ROUTES;
+ if (cfg->C_DEBUGINP3)
+ DEBUGINP3 = 0;
+
+ EnableOARCAPI = cfg->C_OARCAPI;
+
if (cfg->C_OnlyVer2point0)
SUPPORT2point2 = 0;
@@ -992,6 +1005,7 @@ BOOL Start()
PORT->IgnoreUnlocked = PortRec->IGNOREUNLOCKED;
PORT->INP3ONLY = PortRec->INP3ONLY;
PORT->ALLOWINP3 = PortRec->AllowINP3;
+ PORT->ENABLEINP3 = PortRec->EnableINP3;
PORT->PORTWINDOW = (UCHAR)PortRec->MAXFRAME;
@@ -1564,6 +1578,10 @@ BOOL Start()
upnpInit();
+ // Start Monitor to file thread
+
+ _beginthread(WritePacketLogThread, 0, NULL);
+
lastSaveSecs = CurrentSecs = lastSlowSecs = time(NULL);
return 0;
@@ -2514,9 +2532,9 @@ ENDOFLIST:
{
// Stuck link debug check
- if (LINK->LASTFRAMESENT && (time(NULL) - LINK->LASTFRAMESENT) > 60) // No send for 60 secs
+ if (LINK->LINKWINDOW == 0 || LINK->LASTFRAMESENT == 0 || (time(NULL) - LINK->LASTFRAMESENT) > 60) // No send for 60 secs
{
- if (COUNT_AT_L2(LINK) > 16)
+ if (COUNT_AT_L2(LINK) > 16 || LINK->LINKWINDOW == 0)
{
// Dump Link State
@@ -2675,6 +2693,19 @@ int BPQTRACE(MESSAGE * Msg, BOOL TOAPRS)
L4++;
}
+ // And to the Monitor to File system.
+
+
+ if (MONTOFILEFLAG) // Trace Enabled?
+ {
+ Buffer = GetBuff();
+ if (Buffer)
+ {
+ memcpy(&Buffer->PORT, &Msg->PORT, BUFFLEN - sizeof(void *)); // Dont copy chain word
+ C_Q_ADD(&FILEMONVECTOR->HOSTTRACEQ, Buffer);
+ }
+ }
+
return TRUE;
}
;