6.0.25.12 hacky merge due t it not ffing.
This commit is contained in:
parent
85f200a46c
commit
8b0877f6cd
69
BPQINP3.c
69
BPQINP3.c
|
|
@ -35,8 +35,6 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
//#include "vmm.h"
|
//#include "vmm.h"
|
||||||
|
|
||||||
uint64_t INP3timeLoadedMS = 0;
|
|
||||||
|
|
||||||
extern int DEBUGINP3;
|
extern int DEBUGINP3;
|
||||||
|
|
||||||
VOID SendNegativeInfo();
|
VOID SendNegativeInfo();
|
||||||
|
|
@ -64,11 +62,16 @@ static VOID SendNetFrame(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame)
|
||||||
|
|
||||||
typedef struct _RTTMSG
|
typedef struct _RTTMSG
|
||||||
{
|
{
|
||||||
UCHAR ID[7];
|
UCHAR ID[6];
|
||||||
UCHAR TXTIME[11];
|
UCHAR Space1;
|
||||||
UCHAR SMOOTHEDRTT[11];
|
UCHAR TXTIME[10];
|
||||||
UCHAR LASTRTT[11];
|
UCHAR Space2;
|
||||||
UCHAR POINTER[11];
|
UCHAR SMOOTHEDRTT[10];
|
||||||
|
UCHAR Space3;
|
||||||
|
UCHAR LASTRTT[10];
|
||||||
|
UCHAR Space4;
|
||||||
|
UCHAR RTTID[10];
|
||||||
|
UCHAR Space5;
|
||||||
UCHAR ALIAS[7];
|
UCHAR ALIAS[7];
|
||||||
UCHAR VERSION[12];
|
UCHAR VERSION[12];
|
||||||
UCHAR SWVERSION[9];
|
UCHAR SWVERSION[9];
|
||||||
|
|
@ -110,6 +113,8 @@ extern int RTTInterval; // 4 Minutes
|
||||||
int RTTRetries = 2;
|
int RTTRetries = 2;
|
||||||
int RTTTimeout = 6; // 1 Min (Horizon is 1 min)
|
int RTTTimeout = 6; // 1 Min (Horizon is 1 min)
|
||||||
|
|
||||||
|
uint32_t RTTID = 1;
|
||||||
|
|
||||||
VOID InitialiseRTT()
|
VOID InitialiseRTT()
|
||||||
{
|
{
|
||||||
UCHAR temp[256] = "";
|
UCHAR temp[256] = "";
|
||||||
|
|
@ -161,6 +166,7 @@ VOID DeleteINP3Routes(struct ROUTE * Route)
|
||||||
Route->BCTimer = 0;
|
Route->BCTimer = 0;
|
||||||
Route->Status = 0;
|
Route->Status = 0;
|
||||||
Route->Timeout = 0;
|
Route->Timeout = 0;
|
||||||
|
Route->NeighbourSRTT = 0;
|
||||||
|
|
||||||
Dest--;
|
Dest--;
|
||||||
|
|
||||||
|
|
@ -340,8 +346,8 @@ VOID TellINP3LinkSetupFailed(struct ROUTE * Route)
|
||||||
|
|
||||||
VOID ProcessRTTReply(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff)
|
VOID ProcessRTTReply(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff)
|
||||||
{
|
{
|
||||||
int RTT;
|
uint32_t RTT;
|
||||||
unsigned int OrigTime;
|
uint32_t OrigTime;
|
||||||
|
|
||||||
char Normcall[10];
|
char Normcall[10];
|
||||||
|
|
||||||
|
|
@ -349,10 +355,10 @@ VOID ProcessRTTReply(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff)
|
||||||
|
|
||||||
Route->Timeout = 0; // Got Response
|
Route->Timeout = 0; // Got Response
|
||||||
|
|
||||||
sscanf(&Buff->L4DATA[6], "%d", &OrigTime);
|
sscanf(&Buff->L4DATA[6], "%u", &OrigTime);
|
||||||
RTT = (int)((GetTickCount() - INP3timeLoadedMS) / 10 - (OrigTime)); // We work internally in mS
|
RTT = GetTickCountINP3() - OrigTime; // We work internally in mS
|
||||||
|
|
||||||
if (RTT > 60000)
|
if (RTT > 60000 || RTT < 0)
|
||||||
return; // Ignore if more than 60 secs (why ??)
|
return; // Ignore if more than 60 secs (why ??)
|
||||||
|
|
||||||
Route->RTT = RTT;
|
Route->RTT = RTT;
|
||||||
|
|
@ -890,8 +896,8 @@ VOID UpdateRoute(struct DEST_LIST * Dest, struct INP3_DEST_ROUTE_ENTRY * ROUTEPT
|
||||||
|
|
||||||
VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len, int Port)
|
VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len, int Port)
|
||||||
{
|
{
|
||||||
int OtherRTT;
|
uint32_t OtherRTT;
|
||||||
int Dummy;
|
uint32_t Dummy;
|
||||||
char * ptr;
|
char * ptr;
|
||||||
struct _RTTMSG * RTTMsg = (struct _RTTMSG *)&Buff->L4DATA[0];
|
struct _RTTMSG * RTTMsg = (struct _RTTMSG *)&Buff->L4DATA[0];
|
||||||
char Normcall[10];
|
char Normcall[10];
|
||||||
|
|
@ -920,6 +926,14 @@ VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len
|
||||||
return; // We don't want to use INP3
|
return; // We don't want to use INP3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Basic Validation - look for spaces in the right place
|
||||||
|
|
||||||
|
if ((RTTMsg->Space1 | RTTMsg->Space2 | RTTMsg->Space3 | RTTMsg->Space4 | RTTMsg->Space5) != ' ')
|
||||||
|
{
|
||||||
|
Debugprintf("Corrupt INP3 RTT Message %s", &Buff->L4DATA[0]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// Extract other end's SRTT
|
// Extract other end's SRTT
|
||||||
|
|
||||||
// Get SWVERSION to see if other end is old (Buggy) BPQ
|
// Get SWVERSION to see if other end is old (Buggy) BPQ
|
||||||
|
|
@ -929,9 +943,11 @@ VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len
|
||||||
else
|
else
|
||||||
Route->OldBPQ = 0;
|
Route->OldBPQ = 0;
|
||||||
|
|
||||||
sscanf(&Buff->L4DATA[6], "%d %d", &Dummy, &OtherRTT);
|
sscanf(&Buff->L4DATA[6], "%u %u", &Dummy, &OtherRTT);
|
||||||
|
|
||||||
|
if (OtherRTT < 60000) // Don't save suspect values
|
||||||
Route->NeighbourSRTT = OtherRTT;
|
Route->NeighbourSRTT = OtherRTT;
|
||||||
|
}
|
||||||
|
|
||||||
// Look for $M and $H (MAXRTT MAXHOPS)
|
// Look for $M and $H (MAXRTT MAXHOPS)
|
||||||
|
|
||||||
|
|
@ -945,6 +961,8 @@ VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len
|
||||||
if (ptr)
|
if (ptr)
|
||||||
Route->RemoteMAXHOPS = atoi(ptr + 2);
|
Route->RemoteMAXHOPS = atoi(ptr + 2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Echo Back to sender
|
// Echo Back to sender
|
||||||
|
|
||||||
SendNetFrame(Route, Buff);
|
SendNetFrame(Route, Buff);
|
||||||
|
|
@ -965,7 +983,8 @@ VOID SendRTTMsg(struct ROUTE * Route)
|
||||||
char Stamp[50];
|
char Stamp[50];
|
||||||
char Normcall[10];
|
char Normcall[10];
|
||||||
unsigned char temp[256];
|
unsigned char temp[256];
|
||||||
uint64_t sendTime;
|
uint32_t sendTime;
|
||||||
|
int n;
|
||||||
|
|
||||||
Normcall[ConvFromAX25(Route->NEIGHBOUR_CALL, Normcall)] = 0;
|
Normcall[ConvFromAX25(Route->NEIGHBOUR_CALL, Normcall)] = 0;
|
||||||
|
|
||||||
|
|
@ -985,14 +1004,21 @@ VOID SendRTTMsg(struct ROUTE * Route)
|
||||||
Msg->L4TXNO = 0;
|
Msg->L4TXNO = 0;
|
||||||
Msg->L4FLAGS = L4INFO;
|
Msg->L4FLAGS = L4INFO;
|
||||||
|
|
||||||
// The timestamp can possibly exceed 10 digits. INP3 only works on differece between send and received, so base can be reset safely.
|
// Windows GetTickCount wraps every 54 days or so. INP3 doesn't care, so long as the edge
|
||||||
|
// case where timer wraps between sending msg and getting response is ignored
|
||||||
|
// For platform independence use GetTickCountINP3() and map as appropriate
|
||||||
|
|
||||||
sendTime = ((uint64_t)GetTickCount() - INP3timeLoadedMS) / 10; // 10mS units
|
sendTime = GetTickCountINP3(); // 10mS units
|
||||||
|
|
||||||
if (sendTime > 9999999999)
|
sprintf(Stamp, "%10u %10d %10d %10d ", sendTime, Route->SRTT, Route->RTT, RTTID++);
|
||||||
sendTime = INP3timeLoadedMS = 0;
|
|
||||||
|
|
||||||
sprintf(Stamp, "%10llu %10d %10d %10d ", sendTime, Route->SRTT, Route->RTT, 0);
|
n = strlen(Stamp);
|
||||||
|
|
||||||
|
if (n != 44)
|
||||||
|
{
|
||||||
|
Debugprintf("Trying to send corrupt RTT message %s", Stamp);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(RTTMsg.TXTIME, Stamp, 44);
|
memcpy(RTTMsg.TXTIME, Stamp, 44);
|
||||||
|
|
||||||
|
|
@ -1209,6 +1235,7 @@ int SendRIPTimer()
|
||||||
}
|
}
|
||||||
|
|
||||||
L2SETUPCROSSLINKEX(Route, 2); // Only try SABM twice
|
L2SETUPCROSSLINKEX(Route, 2); // Only try SABM twice
|
||||||
|
Route->NeighbourSRTT = 0; // just in case!
|
||||||
|
|
||||||
Route->LastConnectAttempt = REALTIMETICKS;
|
Route->LastConnectAttempt = REALTIMETICKS;
|
||||||
|
|
||||||
|
|
|
||||||
9
Bpq32.c
9
Bpq32.c
|
|
@ -1300,6 +1300,12 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
||||||
// Fix FRMR caused by sending SREJ when no frames outstanding (8)
|
// Fix FRMR caused by sending SREJ when no frames outstanding (8)
|
||||||
// Fix some issues with NetromX connects and Route Selection when running INP3 and NODES routing (9)
|
// Fix some issues with NetromX connects and Route Selection when running INP3 and NODES routing (9)
|
||||||
// Fix connecting to a netrom node with c p node command (10)
|
// Fix connecting to a netrom node with c p node command (10)
|
||||||
|
<<<<<<< Updated upstream
|
||||||
|
||||||| Stash base
|
||||||
|
=======
|
||||||
|
// Add validation of INP3 RTT messages and various INP3 fixes (12)
|
||||||
|
// Change NetromX connect syntax to Service@Node to fix passing commands to local applications (12)
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
|
|
||||||
#define CKernel
|
#define CKernel
|
||||||
|
|
@ -1540,7 +1546,6 @@ extern char ReportDest[7];
|
||||||
|
|
||||||
extern UCHAR ConfigDirectory[260];
|
extern UCHAR ConfigDirectory[260];
|
||||||
|
|
||||||
extern uint64_t INP3timeLoadedMS;
|
|
||||||
|
|
||||||
VOID __cdecl Debugprintf(const char * format, ...);
|
VOID __cdecl Debugprintf(const char * format, ...);
|
||||||
VOID __cdecl Consoleprintf(const char * format, ...);
|
VOID __cdecl Consoleprintf(const char * format, ...);
|
||||||
|
|
@ -2481,8 +2486,6 @@ FirstInit()
|
||||||
EnumProcessesPtr = (FARPROCX)GetProcAddress(ExtDriver,"EnumProcesses");
|
EnumProcessesPtr = (FARPROCX)GetProcAddress(ExtDriver,"EnumProcesses");
|
||||||
}
|
}
|
||||||
|
|
||||||
INP3timeLoadedMS = GetTickCount();
|
|
||||||
|
|
||||||
srand(time(NULL));
|
srand(time(NULL));
|
||||||
|
|
||||||
INITIALISEPORTS();
|
INITIALISEPORTS();
|
||||||
|
|
|
||||||
169
Cmd.c
169
Cmd.c
|
|
@ -838,13 +838,14 @@ BOOL cATTACHTOBBS(TRANSPORTENTRY * Session, UINT Mask, int Paclen, int * AnySess
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnecttoService(TRANSPORTENTRY * Session, char * Bufferptr, int ServiceIndex, char * Node, int Stay)
|
void ConnecttoService(TRANSPORTENTRY * Session, char * Bufferptr, int Service, char * Node, int Stay)
|
||||||
{
|
{
|
||||||
struct DEST_LIST * Dest = DESTS;
|
struct DEST_LIST * Dest = DESTS;
|
||||||
int n = MAXDESTS;
|
int n = MAXDESTS;
|
||||||
int gotDest = 0;
|
int gotDest = 0;
|
||||||
unsigned char axcall[7];
|
unsigned char axcall[7];
|
||||||
int Service = -1;
|
char cmdName[80];
|
||||||
|
int i;
|
||||||
|
|
||||||
// Make Sure Node is Known
|
// Make Sure Node is Known
|
||||||
|
|
||||||
|
|
@ -889,9 +890,20 @@ void ConnecttoService(TRANSPORTENTRY * Session, char * Bufferptr, int ServiceInd
|
||||||
|
|
||||||
Session->STAYFLAG = Stay;
|
Session->STAYFLAG = Stay;
|
||||||
|
|
||||||
Service = SERVICES[ServiceIndex].ServiceNo;
|
// Get command name if a named command
|
||||||
|
|
||||||
Bufferptr = Cmdprintf(Session, Bufferptr, "Connecting to Service %s on Node %s \r", SERVICES[ServiceIndex].ServiceName, Node);
|
sprintf(cmdName, "%d", Service); // default to number
|
||||||
|
|
||||||
|
for (i = 0; i < NUMBEROFSSERVICES; i++)
|
||||||
|
{
|
||||||
|
if (SERVICES[i].ServiceNo == Service)
|
||||||
|
{
|
||||||
|
strcpy(cmdName, SERVICES[i].ServiceName);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Bufferptr = Cmdprintf(Session, Bufferptr, "Connecting to Service %s on Node %s \r", cmdName, Node);
|
||||||
|
|
||||||
DoNetromConnect(Session, Bufferptr, Dest, 0, Service);
|
DoNetromConnect(Session, Bufferptr, Dest, 0, Service);
|
||||||
|
|
||||||
|
|
@ -930,7 +942,7 @@ int checkifService(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, s
|
||||||
{
|
{
|
||||||
if (strcmp(APPName, SERVICES[i].ServiceName) == 0)
|
if (strcmp(APPName, SERVICES[i].ServiceName) == 0)
|
||||||
{
|
{
|
||||||
ConnecttoService(Session, Bufferptr, i, ptr, Stay);
|
ConnecttoService(Session, Bufferptr, SERVICES[i].ServiceNo, ptr, Stay);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -948,7 +960,6 @@ VOID APPLCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct
|
||||||
char * ptr1, *ptr2;
|
char * ptr1, *ptr2;
|
||||||
int n = 12;
|
int n = 12;
|
||||||
BOOL Stay = FALSE;
|
BOOL Stay = FALSE;
|
||||||
char * ptr, *Context;
|
|
||||||
|
|
||||||
// Copy Appl and Null Terminate
|
// Copy Appl and Null Terminate
|
||||||
|
|
||||||
|
|
@ -967,14 +978,17 @@ VOID APPLCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = strtok_s(CmdTail, " ", &Context);
|
|
||||||
|
|
||||||
// ptr is first param. Context is rest of string;
|
if (CmdTail[0] == 'S')
|
||||||
|
Stay = TRUE;
|
||||||
|
|
||||||
if (ptr)
|
|
||||||
{
|
|
||||||
// could be Node for NETROMX connect or S flag
|
// could be Node for NETROMX connect or S flag
|
||||||
|
|
||||||
|
// We now use service@node, so can't get here
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (ptr)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (strlen(ptr) > 1)
|
if (strlen(ptr) > 1)
|
||||||
|
|
@ -984,6 +998,8 @@ VOID APPLCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct
|
||||||
|
|
||||||
// See if APPL is one of Paula's service
|
// See if APPL is one of Paula's service
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < NUMBEROFSSERVICES; i++)
|
for (i = 0; i < NUMBEROFSSERVICES; i++)
|
||||||
{
|
{
|
||||||
if (strcmp(APPName, SERVICES[i].ServiceName) == 0)
|
if (strcmp(APPName, SERVICES[i].ServiceName) == 0)
|
||||||
|
|
@ -1003,7 +1019,7 @@ VOID APPLCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct
|
||||||
else if (ptr[0] == 'S')
|
else if (ptr[0] == 'S')
|
||||||
Session->STAYFLAG = Stay;
|
Session->STAYFLAG = Stay;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
memcpy(Session->APPL, CMD->String, 12);
|
memcpy(Session->APPL, CMD->String, 12);
|
||||||
|
|
||||||
// SEE IF THERE IS AN ALIAS DEFINDED FOR THIS COMMAND
|
// SEE IF THERE IS AN ALIAS DEFINDED FOR THIS COMMAND
|
||||||
|
|
@ -2572,6 +2588,56 @@ VOID CMDC00(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct C
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// See if NETROMX connect c service@node
|
||||||
|
|
||||||
|
if (strchr(ptr, '@'))
|
||||||
|
{
|
||||||
|
// We now use service@node, unlike xr
|
||||||
|
|
||||||
|
char * Context1;
|
||||||
|
|
||||||
|
char * Cmd = strtok_s(ptr, "@", &Context1);
|
||||||
|
char * Node = strtok_s(NULL, " ", &Context1);
|
||||||
|
int i;
|
||||||
|
int Stay = 0;
|
||||||
|
|
||||||
|
if (Context1 && Context1[0] == 'S')
|
||||||
|
Session->STAYFLAG = Stay;
|
||||||
|
|
||||||
|
for (i = 0; i < NUMBEROFSSERVICES; i++)
|
||||||
|
{
|
||||||
|
if (strcmp(Cmd, SERVICES[i].ServiceName) == 0)
|
||||||
|
{
|
||||||
|
if (Node)
|
||||||
|
{
|
||||||
|
ConnecttoService(Session, Bufferptr, SERVICES[i].ServiceNo, Node, Stay);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// May be numeric service
|
||||||
|
|
||||||
|
for (i = 0; i < strlen(Cmd); i++)
|
||||||
|
{
|
||||||
|
if (!isdigit(Cmd[i]))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == strlen(Cmd))
|
||||||
|
{
|
||||||
|
if (Node)
|
||||||
|
{
|
||||||
|
ConnecttoService(Session, Bufferptr, atoi(Cmd), Node, Stay);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Bufferptr = Cmdprintf(Session, Bufferptr, "Invalid NetromX command\r");
|
||||||
|
SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Port = atoi(ptr);
|
Port = atoi(ptr);
|
||||||
|
|
||||||
if (Port)
|
if (Port)
|
||||||
|
|
@ -2671,7 +2737,12 @@ NoPort:
|
||||||
|
|
||||||
// SEE IF CALL TO ANY OF OUR HOST SESSIONS - UNLESS DIGIS SPECIFIED
|
// SEE IF CALL TO ANY OF OUR HOST SESSIONS - UNLESS DIGIS SPECIFIED
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
// if (axcalls[7] == 0 && axcalls[9])
|
// if (axcalls[7] == 0 && axcalls[9])
|
||||||
|
||||||| Stash base
|
||||||
|
if (axcalls[7] == 0 && axcalls[9] )
|
||||||
|
=======
|
||||||
|
>>>>>>> Stashed changes
|
||||||
if (axcalls[7] == 0)
|
if (axcalls[7] == 0)
|
||||||
{
|
{
|
||||||
// If this connect is as a result of a command alias, don't check appls or we will loop
|
// If this connect is as a result of a command alias, don't check appls or we will loop
|
||||||
|
|
@ -2723,6 +2794,7 @@ NoPort:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
// if no digis see if connect to known node.
|
// if no digis see if connect to known node.
|
||||||
|
|
||||||
// But now could have a single numeric param as a service number (Paula's Netromx)
|
// But now could have a single numeric param as a service number (Paula's Netromx)
|
||||||
|
|
@ -2750,6 +2822,32 @@ NoPort:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (axcalls[7] == 0 || haveService)
|
if (axcalls[7] == 0 || haveService)
|
||||||
|
||||||| Stash base
|
||||||
|
// if no digis see if connect to known node. But now could have a single numeric param as a service number (Paula's Netromx)
|
||||||
|
// cmdCopy is command tail (after call)
|
||||||
|
|
||||||
|
// Make sure field is numeric
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
while (cmdCopy[i] >= '0' && cmdCopy[i]<= '9')
|
||||||
|
i++;
|
||||||
|
|
||||||
|
if (cmdCopy[i] != ' ')
|
||||||
|
goto Downlink;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (i > 0) // Some digits
|
||||||
|
{
|
||||||
|
haveService = 1;
|
||||||
|
Service = atoi(cmdCopy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (axcalls[7] == 0 || haveService)
|
||||||
|
=======
|
||||||
|
if (axcalls[7] == 0)
|
||||||
|
>>>>>>> Stashed changes
|
||||||
{
|
{
|
||||||
// SEE IF CALL TO ANOTHER NODE
|
// SEE IF CALL TO ANOTHER NODE
|
||||||
|
|
||||||
|
|
@ -2792,9 +2890,6 @@ Downlink:
|
||||||
// L2 NEEDS PORT NUMBER
|
// L2 NEEDS PORT NUMBER
|
||||||
|
|
||||||
Bufferptr = Cmdprintf(Session, Bufferptr, "Downlink connect needs port number - C P CALLSIGN\r");
|
Bufferptr = Cmdprintf(Session, Bufferptr, "Downlink connect needs port number - C P CALLSIGN\r");
|
||||||
|
|
||||||
// Send Port List
|
|
||||||
|
|
||||||
SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER));
|
SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -5082,6 +5177,7 @@ VOID DoTheCommand(TRANSPORTENTRY * Session)
|
||||||
int n;
|
int n;
|
||||||
int i, Service = -1;
|
int i, Service = -1;
|
||||||
char * Cmd, *Node, *Context;
|
char * Cmd, *Node, *Context;
|
||||||
|
int Stay = 0;
|
||||||
|
|
||||||
ptr1 = &COMMANDBUFFER[0]; //
|
ptr1 = &COMMANDBUFFER[0]; //
|
||||||
|
|
||||||
|
|
@ -5176,28 +5272,47 @@ VOID DoTheCommand(TRANSPORTENTRY * Session)
|
||||||
|
|
||||||
// See if a NETROMX Service
|
// See if a NETROMX Service
|
||||||
|
|
||||||
Cmd = strtok_s(ptr1, " ", &Context);
|
// We now use service@node, unlike xr
|
||||||
|
|
||||||
|
if (strchr(ptr1, '@'))
|
||||||
|
{
|
||||||
|
Cmd = strtok_s(ptr1, "@", &Context);
|
||||||
Node = strtok_s(NULL, " ", &Context);
|
Node = strtok_s(NULL, " ", &Context);
|
||||||
|
|
||||||
|
if (Cmd && Node)
|
||||||
|
{
|
||||||
|
if (Context && Context[0] == 'S')
|
||||||
|
Session->STAYFLAG = Stay;
|
||||||
|
|
||||||
for (i = 0; i < NUMBEROFSSERVICES; i++)
|
for (i = 0; i < NUMBEROFSSERVICES; i++)
|
||||||
{
|
{
|
||||||
if (strcmp(Cmd, SERVICES[i].ServiceName) == 0)
|
if (strcmp(Cmd, SERVICES[i].ServiceName) == 0)
|
||||||
{
|
{
|
||||||
int Stay = 0;
|
ConnecttoService(Session, ReplyPointer, SERVICES[i].ServiceNo, Node, Stay);
|
||||||
|
|
||||||
if (Context && Context[0] == 'S')
|
|
||||||
Session->STAYFLAG = Stay;
|
|
||||||
|
|
||||||
if (Node)
|
|
||||||
{
|
|
||||||
ConnecttoService(Session, ReplyPointer, i, Node, Stay);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Connecting to service on local node - msy be possible sometime
|
// May be numeric service
|
||||||
|
|
||||||
|
for (i = 0; i < strlen(Cmd); i++)
|
||||||
|
{
|
||||||
|
if (!isdigit(Cmd[i]))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == strlen(Cmd))
|
||||||
|
{
|
||||||
|
ConnecttoService(Session, ReplyPointer, atoi(Cmd), Node, Stay);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReplyPointer = Cmdprintf(Session, ReplyPointer, "Invalid NetromX command\r");
|
||||||
|
SendCommandReply(Session, REPLYBUFFER, (int)(ReplyPointer - (char *)REPLYBUFFER));
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
Session->BADCOMMANDS++;
|
Session->BADCOMMANDS++;
|
||||||
|
|
||||||
if (Session->BADCOMMANDS > 6) // TOO MANY ERRORS
|
if (Session->BADCOMMANDS > 6) // TOO MANY ERRORS
|
||||||
|
|
@ -5214,11 +5329,11 @@ VOID DoTheCommand(TRANSPORTENTRY * Session)
|
||||||
ptr1 += CMDERRLEN;
|
ptr1 += CMDERRLEN;
|
||||||
|
|
||||||
SendCommandReply(Session, Buffer, (int)(ptr1 - (char *)Buffer));
|
SendCommandReply(Session, Buffer, (int)(ptr1 - (char *)Buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID StatsTimer()
|
VOID StatsTimer()
|
||||||
{
|
{
|
||||||
struct PORTCONTROL * PORT = PORTTABLE;
|
struct PORTCONTROL * PORT = PORTTABLE;
|
||||||
uint64_t sum, sum2;
|
uint64_t sum, sum2;
|
||||||
|
|
||||||
|
|
|
||||||
4
Events.c
4
Events.c
|
|
@ -944,9 +944,9 @@ void APIL2Trace(struct _MESSAGE * Message, char * Dirn)
|
||||||
// supervisory
|
// supervisory
|
||||||
|
|
||||||
if (PF[0])
|
if (PF[0])
|
||||||
udplen += snprintf(&UDPMsg[udplen], 2048 - udplen, ", \"pf\": \"%s\", \"rseq\": %d, \"tseq\": %d", PF, NR, NS);
|
udplen += snprintf(&UDPMsg[udplen], 2048 - udplen, ", \"pf\": \"%s\", \"rseq\": %d", PF, NR);
|
||||||
else
|
else
|
||||||
udplen += snprintf(&UDPMsg[udplen], 2048 - udplen, ", \"rseq\": %d, \"tseq\": %d", NR, NS);
|
udplen += snprintf(&UDPMsg[udplen], 2048 - udplen, ", \"rseq\": %d", NR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
27
L4Code.c
27
L4Code.c
|
|
@ -1929,19 +1929,34 @@ void L3SWAPADDRESSES(L3MESSAGEBUFFER * L3MSG)
|
||||||
|
|
||||||
void SendConNAK(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG)
|
void SendConNAK(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG)
|
||||||
{
|
{
|
||||||
|
struct TNCINFO * TNC;
|
||||||
|
|
||||||
L3MSG->L4FLAGS = L4CACK | L4BUSY; // REJECT
|
L3MSG->L4FLAGS = L4CACK | L4BUSY; // REJECT
|
||||||
L3MSG->L4DATA[0] = 0; // WINDOW
|
L3MSG->L4DATA[0] = 0; // WINDOW
|
||||||
|
|
||||||
L3SWAPADDRESSES(L3MSG);
|
L3SWAPADDRESSES(L3MSG);
|
||||||
L3MSG->L3TTL = L3LIVES;
|
L3MSG->L3TTL = L3LIVES;
|
||||||
|
|
||||||
|
TNC = LINK->LINKPORT->TNC;
|
||||||
|
|
||||||
|
if (LINK->NEIGHBOUR && LINK->NEIGHBOUR->TCPPort)
|
||||||
|
{
|
||||||
|
TCPNETROMSend(LINK->NEIGHBOUR, L3MSG);
|
||||||
|
ReleaseBuffer(L3MSG);
|
||||||
|
}
|
||||||
|
else if (TNC && TNC->NetRomMode)
|
||||||
|
SendVARANetromMsg(TNC, L3MSG);
|
||||||
|
else
|
||||||
C_Q_ADD(&LINK->TX_Q, L3MSG);
|
C_Q_ADD(&LINK->TX_Q, L3MSG);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID SendL4RESET(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG)
|
VOID SendL4RESET(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG)
|
||||||
{
|
{
|
||||||
// Paula's extension
|
// Paula's extension
|
||||||
|
|
||||||
|
struct TNCINFO * TNC;
|
||||||
|
|
||||||
L3MSG->L4RXNO = L3MSG->L4ID;
|
L3MSG->L4RXNO = L3MSG->L4ID;
|
||||||
L3MSG->L4TXNO = L3MSG->L4INDEX;
|
L3MSG->L4TXNO = L3MSG->L4INDEX;
|
||||||
|
|
||||||
|
|
@ -1951,7 +1966,19 @@ VOID SendL4RESET(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG)
|
||||||
L3MSG->L3TTL = L3LIVES;
|
L3MSG->L3TTL = L3LIVES;
|
||||||
|
|
||||||
L3MSG->LENGTH = (int)(&L3MSG->L4DATA[0] - (UCHAR *)L3MSG);
|
L3MSG->LENGTH = (int)(&L3MSG->L4DATA[0] - (UCHAR *)L3MSG);
|
||||||
|
|
||||||
|
TNC = LINK->LINKPORT->TNC;
|
||||||
|
|
||||||
|
if (LINK->NEIGHBOUR && LINK->NEIGHBOUR->TCPPort)
|
||||||
|
{
|
||||||
|
TCPNETROMSend(LINK->NEIGHBOUR, L3MSG);
|
||||||
|
ReleaseBuffer(L3MSG);
|
||||||
|
}
|
||||||
|
else if (TNC && TNC->NetRomMode)
|
||||||
|
SendVARANetromMsg(TNC, L3MSG);
|
||||||
|
else
|
||||||
C_Q_ADD(&LINK->TX_Q, L3MSG);
|
C_Q_ADD(&LINK->TX_Q, L3MSG);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
8
LinBPQ.c
8
LinBPQ.c
|
|
@ -86,8 +86,14 @@ void SendBBSDataToPktMap();
|
||||||
void CloseAllLinks();
|
void CloseAllLinks();
|
||||||
void hookNodeClosing(char * Reason);
|
void hookNodeClosing(char * Reason);
|
||||||
void NETROMTCPResolve();
|
void NETROMTCPResolve();
|
||||||
|
<<<<<<< Updated upstream
|
||||||
|
|
||||||
extern uint64_t INP3timeLoadedMS;
|
extern uint64_t INP3timeLoadedMS;
|
||||||
|
||||||| Stash base
|
||||||
|
|
||||||
|
extern uint64_t INP3timeLoadedMS;
|
||||||
|
=======
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
BOOL IncludesMail = FALSE;
|
BOOL IncludesMail = FALSE;
|
||||||
BOOL IncludesChat = FALSE;
|
BOOL IncludesChat = FALSE;
|
||||||
|
|
@ -861,8 +867,6 @@ int main(int argc, char * argv[])
|
||||||
if (!isatty(STDOUT_FILENO) || !isatty(STDIN_FILENO))
|
if (!isatty(STDOUT_FILENO) || !isatty(STDIN_FILENO))
|
||||||
Redirected = 1;
|
Redirected = 1;
|
||||||
|
|
||||||
INP3timeLoadedMS = GetTickCount();
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf("G8BPQ AX25 Packet Switch System Version %s %s\n", TextVerstring, Datestring);
|
printf("G8BPQ AX25 Packet Switch System Version %s %s\n", TextVerstring, Datestring);
|
||||||
|
|
|
||||||
1044
NETROMTCP.c
1044
NETROMTCP.c
File diff suppressed because it is too large
Load diff
|
|
@ -10,8 +10,16 @@
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
#define KVers 6,0,25,11
|
#define KVers 6,0,25,11
|
||||||
#define KVerstring "6.0.25.11\0"
|
#define KVerstring "6.0.25.11\0"
|
||||||
|
||||||| Stash base
|
||||||
|
#define KVers 6,0,25,8
|
||||||
|
#define KVerstring "6.0.25.8\0"
|
||||||
|
=======
|
||||||
|
#define KVers 6,0,25,12
|
||||||
|
#define KVerstring "6.0.25.12\0"
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
|
|
||||||
#ifdef CKernel
|
#ifdef CKernel
|
||||||
|
|
|
||||||
27
compatbits.c
27
compatbits.c
|
|
@ -25,6 +25,8 @@ Stuff to make compiling on WINDOWS and LINUX easier
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
typedef unsigned int uint32_t;
|
typedef unsigned int uint32_t;
|
||||||
|
|
||||||
#define pthread_t uint32_t
|
#define pthread_t uint32_t
|
||||||
|
|
@ -41,6 +43,7 @@ int pthread_equal(pthread_t T1, pthread_t T2)
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#define BOOL int
|
#define BOOL int
|
||||||
|
|
||||||
|
|
@ -188,3 +191,27 @@ void closesocket(int sock)
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
|
||||||
|
uint32_t GetTickCountINP3()
|
||||||
|
{
|
||||||
|
// Returns system uptime in 10 mS, lower 20 bits only
|
||||||
|
|
||||||
|
return (GetTickCount() / 10) & 0xfffff;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
|
||||||
|
uint64_t GetTickCount();
|
||||||
|
|
||||||
|
uint32_t GetTickCountINP3()
|
||||||
|
{
|
||||||
|
uint64_t Ticks = GetTickCount();
|
||||||
|
|
||||||
|
// Returns system uptime in 10 mS, lower 20 bits only
|
||||||
|
|
||||||
|
return (Ticks / 10) & 0xfffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ Stuff to make compiling on WINDOWS and LINUX easier
|
||||||
|
|
||||||
#define strtoll _strtoi64
|
#define strtoll _strtoi64
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
#else
|
#else
|
||||||
|
|
@ -219,7 +220,7 @@ typedef struct tagRECT
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
uint32_t GetTickCountINP3();
|
||||||
|
|
||||||
#ifdef LINBPQ
|
#ifdef LINBPQ
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue