diff options
| author | Dave Hibberd <hibby@debian.org> | 2025-11-09 22:34:20 +0000 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2025-11-09 22:34:20 +0000 |
| commit | 367ab8fb01191ec54c91810b1896c41fdf7de911 (patch) | |
| tree | 8f9ac2b818ebb923b47fce00b28eb127556d96fb /ARDOP.c | |
| parent | 7c796758d1b65d4d7585c90ba71b1fb339a4d283 (diff) | |
New upstream version 6.0.25.9+repack
Diffstat (limited to 'ARDOP.c')
| -rw-r--r-- | ARDOP.c | 172 |
1 files changed, 90 insertions, 82 deletions
@@ -62,6 +62,12 @@ int (WINAPI FAR *EnumProcessesPtr)(); #include "tncinfo.h"
+void hookL4SessionAttempt(struct STREAMINFO * , char * remotecall, char * ourcall);
+void hookL4SessionAccepted(struct STREAMINFO * , char * remotecall, char * ourcall);
+void hookL4SessionDeleted(struct TNCINFO * TNC, void * STREAM);
+
+
+
#define WSA_ACCEPT WM_USER + 1
#define WSA_DATA WM_USER + 2
#define WSA_CONNECT WM_USER + 3
@@ -460,114 +466,114 @@ static int ProcessLine(char * buf, int Port) else
return FALSE; // Must start with ADDR
- TNC->InitScript = malloc(1000);
- TNC->InitScript[0] = 0;
+ TNC->InitScript = malloc(1000);
+ TNC->InitScript[0] = 0;
- ptr = strtok(NULL, " \t\n\r");
+ ptr = strtok(NULL, " \t\n\r");
- if (ptr)
+ if (ptr)
+ {
+ if (_stricmp(ptr, "PTT") == 0)
{
- if (_stricmp(ptr, "PTT") == 0)
+ ptr = strtok(NULL, " \t\n\r");
+
+ if (ptr)
{
+ DecodePTTString(TNC, ptr);
ptr = strtok(NULL, " \t\n\r");
-
- if (ptr)
- {
- DecodePTTString(TNC, ptr);
- ptr = strtok(NULL, " \t\n\r");
- }
}
}
-
- if (ptr)
+ }
+
+ if (ptr)
+ {
+ if (_memicmp(ptr, "PATH", 4) == 0)
{
- if (_memicmp(ptr, "PATH", 4) == 0)
- {
- p_cmd = strtok(NULL, "\n\r");
- if (p_cmd) TNC->ProgramPath = _strdup(p_cmd);
- }
+ p_cmd = strtok(NULL, "\n\r");
+ if (p_cmd) TNC->ProgramPath = _strdup(p_cmd);
}
+ }
- TNC->MaxConReq = 10; // Default
- TNC->OldMode = FALSE; // Default
+ TNC->MaxConReq = 10; // Default
+ TNC->OldMode = FALSE; // Default
- // Read Initialisation lines
+ // Read Initialisation lines
- while(TRUE)
- {
- if (GetLine(buf) == 0)
- return TRUE;
+ while(TRUE)
+ {
+ if (GetLine(buf) == 0)
+ return TRUE;
- strcpy(errbuf, buf);
+ strcpy(errbuf, buf);
- if (memcmp(buf, "****", 4) == 0)
- return TRUE;
+ if (memcmp(buf, "****", 4) == 0)
+ return TRUE;
- ptr = strchr(buf, ';');
- if (ptr)
- {
- *ptr++ = 13;
- *ptr = 0;
- }
-
- if ((_memicmp(buf, "CAPTURE", 7) == 0) || (_memicmp(buf, "PLAYBACK", 8) == 0))
- {} // Ignore
- else
-/*
+ ptr = strchr(buf, ';');
+ if (ptr)
+ {
+ *ptr++ = 13;
+ *ptr = 0;
+ }
+
+ if ((_memicmp(buf, "CAPTURE", 7) == 0) || (_memicmp(buf, "PLAYBACK", 8) == 0))
+ {} // Ignore
+ else
+ /*
if (_memicmp(buf, "PATH", 4) == 0)
{
- char * Context;
- p_cmd = strtok_s(&buf[5], "\n\r", &Context);
- if (p_cmd) TNC->ProgramPath = _strdup(p_cmd);
+ char * Context;
+ p_cmd = strtok_s(&buf[5], "\n\r", &Context);
+ if (p_cmd) TNC->ProgramPath = _strdup(p_cmd);
}
else
-*/
+ */
if (_memicmp(buf, "PACKETCHANNELS", 14) == 0) // Packet Channels
TNC->PacketChannels = atoi(&buf[14]);
else
- if (_memicmp(buf, "MAXCONREQ", 9) == 0) // Hold Time for Busy Detect
- TNC->MaxConReq = atoi(&buf[9]);
+ if (_memicmp(buf, "MAXCONREQ", 9) == 0) // Hold Time for Busy Detect
+ TNC->MaxConReq = atoi(&buf[9]);
- else
- if (_memicmp(buf, "STARTINROBUST", 13) == 0)
- TNC->StartInRobust = TRUE;
-
- else
- if (_memicmp(buf, "ROBUST", 6) == 0)
- {
- if (_memicmp(&buf[7], "TRUE", 4) == 0)
- TNC->Robust = TRUE;
-
- strcat (TNC->InitScript, buf);
- }
- else
- if (_memicmp(buf, "LOGDIR ", 7) == 0)
- TNC->LogPath = _strdup(&buf[7]);
- else
- if (_memicmp(buf, "ENABLEPACKET", 12) == 0)
- {
- if (TNC->PacketChannels == 0)
- TNC->PacketChannels = 5;
- // AddVirtualKISSPort(TNC, Port, buf);
- }
+ else
+ if (_memicmp(buf, "STARTINROBUST", 13) == 0)
+ TNC->StartInRobust = TRUE;
-// else if (_memicmp(buf, "PAC ", 4) == 0 && _memicmp(buf, "PAC MODE", 8) != 0)
-// {
- // PAC MODE goes to TNC, others are parsed locally
-//
-// ConfigVirtualKISSPort(TNC, buf);
-// }
- else if (standardParams(TNC, buf) == FALSE)
- strcat(TNC->InitScript, buf);
- }
+ else
+ if (_memicmp(buf, "ROBUST", 6) == 0)
+ {
+ if (_memicmp(&buf[7], "TRUE", 4) == 0)
+ TNC->Robust = TRUE;
+
+ strcat (TNC->InitScript, buf);
+ }
+ else
+ if (_memicmp(buf, "LOGDIR ", 7) == 0)
+ TNC->LogPath = _strdup(&buf[7]);
+ else
+ if (_memicmp(buf, "ENABLEPACKET", 12) == 0)
+ {
+ if (TNC->PacketChannels == 0)
+ TNC->PacketChannels = 5;
+ // AddVirtualKISSPort(TNC, Port, buf);
+ }
+
+ // else if (_memicmp(buf, "PAC ", 4) == 0 && _memicmp(buf, "PAC MODE", 8) != 0)
+ // {
+ // PAC MODE goes to TNC, others are parsed locally
+ //
+ // ConfigVirtualKISSPort(TNC, buf);
+ // }
+ else if (standardParams(TNC, buf) == FALSE)
+ strcat(TNC->InitScript, buf);
+ }
return (TRUE);
}
-void ARDOPThread(struct TNCINFO * TNC);
+void ARDOPThread(VOID * Param);
VOID ARDOPProcessDataSocketData(int port);
int ConnecttoARDOP(struct TNCINFO * TNC);
static VOID ARDOPProcessReceivedData(struct TNCINFO * TNC);
@@ -1035,8 +1041,10 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff) {
TNC->Busy--;
if (TNC->Busy == 0)
+ {
MySetWindowText(TNC->xIDC_CHANSTATE, "Clear");
strcpy(TNC->WEB_CHANSTATE, "Clear");
+ }
}
}
@@ -2312,12 +2320,13 @@ int ConnecttoARDOP(struct TNCINFO * TNC) return 0;
}
-VOID ARDOPThread(struct TNCINFO * TNC)
+VOID ARDOPThread(VOID * Param)
{
// Opens sockets and looks for data on control and data sockets.
// Socket may be TCP/IP or Serial
+ struct TNCINFO * TNC = (struct TNCINFO *) Param;
char Msg[255];
int err, i, ret;
u_long param=1;
@@ -5758,8 +5767,7 @@ VOID ARDOPSCSPoll(struct TNCINFO * TNC) // Probably only for Teensy with ESP01. Runs SCS Emulator over a TCP Link
-
-VOID SerialConnecttoTCPThread(struct TNCINFO * TNC);
+VOID SerialConnecttoTCPThread(VOID * Param);
int SerialConnecttoTCP(struct TNCINFO * TNC)
{
@@ -5767,9 +5775,9 @@ int SerialConnecttoTCP(struct TNCINFO * TNC) return 0;
}
-
-VOID SerialConnecttoTCPThread(struct TNCINFO * TNC)
+VOID SerialConnecttoTCPThread(VOID * Param)
{
+ struct TNCINFO * TNC = (struct TNCINFO *) Param;
char Msg[255];
int i;
u_long param = 1;
|
