Compare commits
No commits in common. "hibbian/latest" and "upstream/6.0.25.8+repack" have entirely different histories.
hibbian/la
...
upstream/6
|
|
@ -3256,9 +3256,9 @@ static VOID ADSBConnect(void * unused)
|
|||
{
|
||||
err=WSAGetLastError();
|
||||
#ifdef LINBPQ
|
||||
// printf("Connect Failed for ADSB socket - error code = %d\n", err);
|
||||
printf("Connect Failed for ADSB socket - error code = %d\n", err);
|
||||
#else
|
||||
// Debugprintf("Connect Failed for ADSB socket - error code = %d", err);
|
||||
Debugprintf("Connect Failed for ADSB socket - error code = %d", err);
|
||||
#endif
|
||||
closesocket(TCPSock);
|
||||
ADSBConnected = FALSE;
|
||||
|
|
|
|||
108
APRSCode.c
108
APRSCode.c
|
|
@ -441,6 +441,112 @@ HANDLE hMapFile;
|
|||
|
||||
// Logging
|
||||
|
||||
static int LogAge = 14;
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
int DeleteAPRSLogFiles()
|
||||
{
|
||||
WIN32_FIND_DATA ffd;
|
||||
|
||||
char szDir[MAX_PATH];
|
||||
char File[MAX_PATH];
|
||||
HANDLE hFind = INVALID_HANDLE_VALUE;
|
||||
DWORD dwError=0;
|
||||
LARGE_INTEGER ft;
|
||||
time_t now = time(NULL);
|
||||
int Age;
|
||||
|
||||
// Prepare string for use with FindFile functions. First, copy the
|
||||
// string to a buffer, then append '\*' to the directory name.
|
||||
|
||||
strcpy(szDir, GetLogDirectory());
|
||||
strcat(szDir, "/logs/APRS*.log");
|
||||
|
||||
// Find the first file in the directory.
|
||||
|
||||
hFind = FindFirstFile(szDir, &ffd);
|
||||
|
||||
if (INVALID_HANDLE_VALUE == hFind)
|
||||
return dwError;
|
||||
|
||||
// Walk directory
|
||||
|
||||
do
|
||||
{
|
||||
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
{
|
||||
OutputDebugString(ffd.cFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
ft.HighPart = ffd.ftCreationTime.dwHighDateTime;
|
||||
ft.LowPart = ffd.ftCreationTime.dwLowDateTime;
|
||||
|
||||
ft.QuadPart -= 116444736000000000;
|
||||
ft.QuadPart /= 10000000;
|
||||
|
||||
Age = (int)((now - ft.LowPart) / 86400);
|
||||
|
||||
if (Age > LogAge)
|
||||
{
|
||||
sprintf(File, "%s/logs/%s%c", GetLogDirectory(), ffd.cFileName, 0);
|
||||
Debugprintf("Deleting %s", File);
|
||||
DeleteFile(File);
|
||||
}
|
||||
}
|
||||
}
|
||||
while (FindNextFile(hFind, &ffd) != 0);
|
||||
|
||||
FindClose(hFind);
|
||||
return dwError;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
int APRSFilter(const struct dirent * dir)
|
||||
{
|
||||
return (memcmp(dir->d_name, "APRS", 4) == 0 && strstr(dir->d_name, ".log"));
|
||||
}
|
||||
|
||||
int DeleteAPRSLogFiles()
|
||||
{
|
||||
struct dirent **namelist;
|
||||
int n;
|
||||
struct stat STAT;
|
||||
time_t now = time(NULL);
|
||||
int Age = 0, res;
|
||||
char FN[256];
|
||||
|
||||
n = scandir("logs", &namelist, APRSFilter, alphasort);
|
||||
|
||||
if (n < 0)
|
||||
perror("scandir");
|
||||
else
|
||||
{
|
||||
while(n--)
|
||||
{
|
||||
sprintf(FN, "logs/%s", namelist[n]->d_name);
|
||||
if (stat(FN, &STAT) == 0)
|
||||
{
|
||||
Age = (now - STAT.st_mtime) / 86400;
|
||||
|
||||
if (Age > LogAge)
|
||||
{
|
||||
Debugprintf("Deleting %s\n", FN);
|
||||
unlink(FN);
|
||||
}
|
||||
}
|
||||
free(namelist[n]);
|
||||
}
|
||||
free(namelist);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int APRSWriteLog(char * msg)
|
||||
{
|
||||
FILE *file;
|
||||
|
|
@ -540,6 +646,8 @@ Dll BOOL APIENTRY Init_APRS()
|
|||
MobileBeaconInterval = 0;
|
||||
BeaconInterval = 0;
|
||||
|
||||
DeleteAPRSLogFiles();
|
||||
|
||||
memset(MHTABLE, 0, sizeof(MHTABLE));
|
||||
|
||||
ConvToAX25(MYNODECALL, MYCALL);
|
||||
|
|
|
|||
16
ARDOP.c
16
ARDOP.c
|
|
@ -519,7 +519,7 @@ static int ProcessLine(char * buf, int Port)
|
|||
if ((_memicmp(buf, "CAPTURE", 7) == 0) || (_memicmp(buf, "PLAYBACK", 8) == 0))
|
||||
{} // Ignore
|
||||
else
|
||||
/*
|
||||
/*
|
||||
if (_memicmp(buf, "PATH", 4) == 0)
|
||||
{
|
||||
char * Context;
|
||||
|
|
@ -527,7 +527,7 @@ static int ProcessLine(char * buf, int Port)
|
|||
if (p_cmd) TNC->ProgramPath = _strdup(p_cmd);
|
||||
}
|
||||
else
|
||||
*/
|
||||
*/
|
||||
|
||||
if (_memicmp(buf, "PACKETCHANNELS", 14) == 0) // Packet Channels
|
||||
TNC->PacketChannels = atoi(&buf[14]);
|
||||
|
|
@ -558,12 +558,12 @@ static int ProcessLine(char * buf, int Port)
|
|||
// AddVirtualKISSPort(TNC, Port, buf);
|
||||
}
|
||||
|
||||
// else if (_memicmp(buf, "PAC ", 4) == 0 && _memicmp(buf, "PAC MODE", 8) != 0)
|
||||
// {
|
||||
// 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);
|
||||
// }
|
||||
//
|
||||
// ConfigVirtualKISSPort(TNC, buf);
|
||||
// }
|
||||
else if (standardParams(TNC, buf) == FALSE)
|
||||
strcat(TNC->InitScript, buf);
|
||||
}
|
||||
|
|
@ -1041,12 +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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (TNC->BusyDelay)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1456,7 +1456,7 @@ VOID SaveHousekeeping(struct HTTPConnectionInfo * Session, char * MsgPtr, char *
|
|||
GetParam(input, "MaxAge=", Temp);
|
||||
MaxAge = atoi(Temp);
|
||||
GetParam(input, "LogLife=", Temp);
|
||||
BBSLogAge = atoi(Temp);
|
||||
LogAge = atoi(Temp);
|
||||
GetParam(input, "UserLife=", Temp);
|
||||
UserLifetime= atoi(Temp);
|
||||
|
||||
|
|
@ -2666,7 +2666,7 @@ VOID SendHouseKeeping(char * Reply, int * ReplyLen, char * Key)
|
|||
|
||||
*ReplyLen = sprintf(Reply, HousekeepingTemplate,
|
||||
BBSName, Key, Key, Key, Key, Key, Key, Key, Key, Key,
|
||||
MaintTime, MaintInterval, MaxMsgno, BidLifetime, BBSLogAge, UserLifetime,
|
||||
MaintTime, MaintInterval, MaxMsgno, BidLifetime, LogAge, UserLifetime,
|
||||
(DeletetoRecycleBin) ? CHKD : UNC,
|
||||
(SendNonDeliveryMsgs) ? CHKD : UNC,
|
||||
(SuppressMaintEmail) ? CHKD : UNC,
|
||||
|
|
|
|||
|
|
@ -3701,7 +3701,7 @@ void DoKillCommand(CIRCUIT * conn, struct UserInfo * user, char * Cmd, char * Ar
|
|||
if (conn->sysop)
|
||||
{
|
||||
if (Arg1)
|
||||
if (KillMessagesFrom(conn, user, Arg1) == 0)
|
||||
if (KillMessagesFrom(conn, user, Arg1) == 0);
|
||||
BBSputs(conn, "No Messages found\r");
|
||||
|
||||
return;
|
||||
|
|
@ -6556,7 +6556,7 @@ nextline:
|
|||
{
|
||||
char APRS[128];
|
||||
char Call[16];
|
||||
int SSID = (user->flags >> 28) & 15; // on some platforms this is treated as signed ??
|
||||
int SSID = user->flags >> 28;
|
||||
|
||||
if (SSID)
|
||||
sprintf(Call, "%s-%d", Msg->to, SSID);
|
||||
|
|
@ -9939,8 +9939,8 @@ VOID SaveConfig(char * ConfigName)
|
|||
SaveIntValue(group, "MaxMsgno", MaxMsgno);
|
||||
SaveIntValue(group, "BidLifetime", BidLifetime);
|
||||
SaveIntValue(group, "MaxAge", MaxAge);
|
||||
SaveIntValue(group, "LogLifetime", BBSLogAge);
|
||||
SaveIntValue(group, "LogLifetime", BBSLogAge);
|
||||
SaveIntValue(group, "LogLifetime", LogAge);
|
||||
SaveIntValue(group, "LogLifetime", LogAge);
|
||||
SaveIntValue(group, "MaintInterval", MaintInterval);
|
||||
SaveIntValue(group, "UserLifetime", UserLifetime);
|
||||
SaveIntValue(group, "MaintTime", MaintTime);
|
||||
|
|
@ -10601,7 +10601,7 @@ BOOL GetConfig(char * ConfigName)
|
|||
LastHouseKeepingTime = GetIntValue(group, "LastHouseKeepingTime");
|
||||
LastTrafficTime = GetIntValue(group, "LastTrafficTime");
|
||||
MaxMsgno = GetIntValue(group, "MaxMsgno");
|
||||
BBSLogAge = GetIntValue(group, "LogLifetime");
|
||||
LogAge = GetIntValue(group, "LogLifetime");
|
||||
BidLifetime = GetIntValue(group, "BidLifetime");
|
||||
MaxAge = GetIntValue(group, "MaxAge");
|
||||
if (MaxAge == 0)
|
||||
|
|
@ -13395,7 +13395,7 @@ int DeleteRedundantMessages()
|
|||
{
|
||||
while(n--)
|
||||
{
|
||||
if (stat(namelist[n]->d_name, &STAT) == 0)
|
||||
if (stat(namelist[n]->d_name, &STAT) == 0);
|
||||
{
|
||||
Msgno = atoi(&namelist[n]->d_name[2]);
|
||||
|
||||
|
|
|
|||
566
BPQINP3.c
566
BPQINP3.c
|
|
@ -35,21 +35,14 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
|||
#include <fcntl.h>
|
||||
//#include "vmm.h"
|
||||
|
||||
uint64_t INP3timeLoadedMS = 0;
|
||||
|
||||
extern int DEBUGINP3;
|
||||
|
||||
int NegativePercent = 120; // if time is 10% worse send negative info
|
||||
int PositivePercent = 80; // if time is 20% better send positive info
|
||||
int NegativeDelay = 10; // Seconds between checks for negative info - should be quite shourt
|
||||
int PositiveDelay = 300;
|
||||
|
||||
time_t SENDRIFTIME = 0;
|
||||
int RIFInterval = 60;
|
||||
|
||||
VOID SendNegativeInfo();
|
||||
VOID SortRoutes(struct DEST_LIST * Dest);
|
||||
VOID SendRTTMsg(struct ROUTE * Route);
|
||||
VOID TCPNETROMSend(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame);
|
||||
void NETROMCloseTCP(struct ROUTE * Route);
|
||||
|
||||
static VOID SendNetFrame(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame)
|
||||
{
|
||||
|
|
@ -71,16 +64,11 @@ static VOID SendNetFrame(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame)
|
|||
|
||||
typedef struct _RTTMSG
|
||||
{
|
||||
UCHAR ID[6];
|
||||
UCHAR Space1;
|
||||
UCHAR TXTIME[10];
|
||||
UCHAR Space2;
|
||||
UCHAR SMOOTHEDRTT[10];
|
||||
UCHAR Space3;
|
||||
UCHAR LASTRTT[10];
|
||||
UCHAR Space4;
|
||||
UCHAR RTTID[10];
|
||||
UCHAR Space5;
|
||||
UCHAR ID[7];
|
||||
UCHAR TXTIME[11];
|
||||
UCHAR SMOOTHEDRTT[11];
|
||||
UCHAR LASTRTT[11];
|
||||
UCHAR POINTER[11];
|
||||
UCHAR ALIAS[7];
|
||||
UCHAR VERSION[12];
|
||||
UCHAR SWVERSION[9];
|
||||
|
|
@ -99,7 +87,7 @@ VOID UpdateNode(struct ROUTE * Route, UCHAR * axcall, UCHAR * alias, int hops,
|
|||
VOID UpdateRoute(struct DEST_LIST * Dest, struct INP3_DEST_ROUTE_ENTRY * ROUTEPTR, int hops, int rtt);
|
||||
VOID KillRoute(struct INP3_DEST_ROUTE_ENTRY * ROUTEPTR);
|
||||
VOID AddHere(struct INP3_DEST_ROUTE_ENTRY * ROUTEPTR,struct ROUTE * Route , int hops, int rtt);
|
||||
VOID SendRIFToNewNeighbour(struct ROUTE * Route);
|
||||
VOID SendRIPToNeighbour(struct ROUTE * Route);
|
||||
VOID DecayNETROMRoutes(struct ROUTE * Route);
|
||||
VOID DeleteINP3Routes(struct ROUTE * Route);
|
||||
BOOL L2SETUPCROSSLINKEX(PROUTE ROUTE, int Retries);
|
||||
|
|
@ -111,8 +99,7 @@ struct _RTTMSG RTTMsg = {""};
|
|||
//struct ROUTE DummyRoute = {"","",""};
|
||||
|
||||
int RIPTimerCount = 0; // 1 sec to 10 sec counter
|
||||
int PosTimerCount = 0;
|
||||
int NegTimerCount = 0;
|
||||
int PosTimerCount = 0; // 1 sec to 5 Mins counter
|
||||
|
||||
// Timer Runs every 10 Secs
|
||||
|
||||
|
|
@ -123,14 +110,10 @@ extern int RTTInterval; // 4 Minutes
|
|||
int RTTRetries = 2;
|
||||
int RTTTimeout = 6; // 1 Min (Horizon is 1 min)
|
||||
|
||||
uint32_t RTTID = 1;
|
||||
|
||||
VOID InitialiseRTT()
|
||||
{
|
||||
UCHAR temp[256] = "";
|
||||
|
||||
SENDRIFTIME = time(NULL);
|
||||
|
||||
memset(&RTTMsg, ' ', sizeof(struct _RTTMSG));
|
||||
memcpy(RTTMsg.ID, "L3RTT: ", 7);
|
||||
memcpy(RTTMsg.VERSION, "LEVEL3_V2.1 ", 12);
|
||||
|
|
@ -178,8 +161,7 @@ VOID DeleteINP3Routes(struct ROUTE * Route)
|
|||
Route->BCTimer = 0;
|
||||
Route->Status = 0;
|
||||
Route->Timeout = 0;
|
||||
Route->NeighbourSRTT = 0;
|
||||
Route->localport = 0;
|
||||
|
||||
Dest--;
|
||||
|
||||
// Delete any Dest entries via this Route
|
||||
|
|
@ -212,8 +194,7 @@ VOID DeleteINP3Routes(struct ROUTE * Route)
|
|||
{
|
||||
|
||||
// Only entry
|
||||
|
||||
Dest->INP3ROUTE[0].STT = 60000;
|
||||
Dest->INP3ROUTE[0].SRTT = 60000;
|
||||
Dest->INP3ROUTE[0].Hops = 255;
|
||||
|
||||
if (DEBUGINP3) Debugprintf("Was the only INP3 route");
|
||||
|
|
@ -224,7 +205,7 @@ VOID DeleteINP3Routes(struct ROUTE * Route)
|
|||
continue;
|
||||
}
|
||||
|
||||
Dest->INP3ROUTE[1].RouteLastTT[Dest->INP3ROUTE[1].ROUT_NEIGHBOUR->recNum] = Dest->INP3ROUTE[0].STT; // So next scan will check if rtt has increaced enough to need a RIF
|
||||
Dest->INP3ROUTE[1].LastRTT = Dest->INP3ROUTE[0].SRTT; // So next scan will check if rtt has increaced enough to need a RIF
|
||||
memcpy(&Dest->INP3ROUTE[0], &Dest->INP3ROUTE[1], sizeof(struct INP3_DEST_ROUTE_ENTRY));
|
||||
memcpy(&Dest->INP3ROUTE[1], &Dest->INP3ROUTE[2], sizeof(struct INP3_DEST_ROUTE_ENTRY));
|
||||
memset(&Dest->INP3ROUTE[2], 0, sizeof(struct INP3_DEST_ROUTE_ENTRY));
|
||||
|
|
@ -359,8 +340,8 @@ VOID TellINP3LinkSetupFailed(struct ROUTE * Route)
|
|||
|
||||
VOID ProcessRTTReply(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff)
|
||||
{
|
||||
uint32_t RTT;
|
||||
uint32_t OrigTime;
|
||||
int RTT;
|
||||
unsigned int OrigTime;
|
||||
|
||||
char Normcall[10];
|
||||
|
||||
|
|
@ -368,15 +349,12 @@ VOID ProcessRTTReply(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff)
|
|||
|
||||
Route->Timeout = 0; // Got Response
|
||||
|
||||
sscanf(&Buff->L4DATA[6], "%u", &OrigTime);
|
||||
RTT = GetTickCountINP3() - OrigTime; // We work internally in mS
|
||||
sscanf(&Buff->L4DATA[6], "%d", &OrigTime);
|
||||
RTT = (int)((GetTickCount() - INP3timeLoadedMS) / 10 - (OrigTime)); // We work internally in mS
|
||||
|
||||
if (RTT > 60000 || RTT < 0)
|
||||
if (RTT > 60000)
|
||||
return; // Ignore if more than 60 secs (why ??)
|
||||
|
||||
if (DEBUGINP3) Debugprintf("INP3 RTT reply from %s - SRTT was %d, Current RTT %d", Normcall, Route->SRTT, RTT);
|
||||
|
||||
|
||||
Route->RTT = RTT;
|
||||
|
||||
if (Route->SRTT == 0)
|
||||
|
|
@ -569,7 +547,6 @@ VOID UpdateNode(struct ROUTE * Route, UCHAR * axcall, UCHAR * alias, int hops,
|
|||
}
|
||||
|
||||
|
||||
// Adding New Node
|
||||
|
||||
memset(Dest, 0, sizeof(struct DEST_LIST));
|
||||
|
||||
|
|
@ -579,11 +556,8 @@ VOID UpdateNode(struct ROUTE * Route, UCHAR * axcall, UCHAR * alias, int hops,
|
|||
// Set up First Route
|
||||
|
||||
Dest->INP3ROUTE[0].Hops = hops;
|
||||
Dest->INP3ROUTE[0].STT = rtt;
|
||||
if (Dest->INP3ROUTE[0].RouteLastTT == 0)
|
||||
Dest->INP3ROUTE[0].RouteLastTT = (uint16_t *)zalloc(MAXNEIGHBOURS * sizeof(uint16_t));
|
||||
|
||||
Dest->INP3ROUTE[0].RouteLastTT[Route->recNum] = 0;
|
||||
Dest->INP3ROUTE[0].SRTT = rtt;
|
||||
Dest->INP3ROUTE[0].LastRTT = 0;
|
||||
|
||||
Dest->INP3FLAGS = NewNode;
|
||||
|
||||
|
|
@ -607,7 +581,7 @@ Found:
|
|||
// Update ALIAS
|
||||
|
||||
ConvFromAX25(Dest->DEST_CALL, call);
|
||||
if (DEBUGINP3) Debugprintf("INP3 Updating Node %s Hops %d TT %d", call, hops, rtt);
|
||||
if (DEBUGINP3) Debugprintf("INP3 Updating Node %s Hops %d RTT %d", call, hops, rtt);
|
||||
|
||||
if (alias[0] > ' ')
|
||||
memcpy(Dest->DEST_ALIAS, alias, 6);
|
||||
|
|
@ -618,7 +592,7 @@ Found:
|
|||
|
||||
if (ROUTEPTR->ROUT_NEIGHBOUR == Route)
|
||||
{
|
||||
if (DEBUGINP3) Debugprintf("INP3 Already have as route[0] - TT was %d updating to %d", ROUTEPTR->STT, rtt);
|
||||
if (DEBUGINP3) Debugprintf("INP3 Already have as route[0] - updating");
|
||||
UpdateRoute(Dest, ROUTEPTR, hops, rtt);
|
||||
return;
|
||||
}
|
||||
|
|
@ -627,7 +601,7 @@ Found:
|
|||
|
||||
if (ROUTEPTR->ROUT_NEIGHBOUR == Route)
|
||||
{
|
||||
if (DEBUGINP3) Debugprintf("INP3 Already have as route[1] - TT was %d updating to %d", ROUTEPTR->STT, rtt);
|
||||
if (DEBUGINP3) Debugprintf("INP3 Already have as route[1] - updating");
|
||||
UpdateRoute(Dest, ROUTEPTR, hops, rtt);
|
||||
return;
|
||||
}
|
||||
|
|
@ -636,7 +610,7 @@ Found:
|
|||
|
||||
if (ROUTEPTR->ROUT_NEIGHBOUR == Route)
|
||||
{
|
||||
if (DEBUGINP3) Debugprintf("INP3 Already have as route[2] - TT was %d updating to %d", ROUTEPTR->STT, rtt);
|
||||
if (DEBUGINP3) Debugprintf("INP3 Already have as route[2] - updating");
|
||||
UpdateRoute(Dest, ROUTEPTR, hops, rtt);
|
||||
return;
|
||||
}
|
||||
|
|
@ -666,7 +640,7 @@ Found:
|
|||
|
||||
// Note that wont replace any netrom routes with INP3 ones unless we add pseudo rtt values to netrom entries
|
||||
|
||||
if (Dest->INP3ROUTE[0].STT > rtt)
|
||||
if (Dest->INP3ROUTE[0].SRTT > rtt)
|
||||
{
|
||||
// We are better. Move others down and add on front
|
||||
|
||||
|
|
@ -678,7 +652,7 @@ Found:
|
|||
return;
|
||||
}
|
||||
|
||||
if (Dest->INP3ROUTE[1].STT > rtt)
|
||||
if (Dest->INP3ROUTE[1].SRTT > rtt)
|
||||
{
|
||||
// We are better. Move 2nd down and add
|
||||
|
||||
|
|
@ -688,7 +662,7 @@ Found:
|
|||
return;
|
||||
}
|
||||
|
||||
if (Dest->INP3ROUTE[2].STT > rtt)
|
||||
if (Dest->INP3ROUTE[2].SRTT > rtt)
|
||||
{
|
||||
// We are better. Add here
|
||||
|
||||
|
|
@ -708,17 +682,64 @@ Found:
|
|||
VOID AddHere(struct INP3_DEST_ROUTE_ENTRY * ROUTEPTR,struct ROUTE * Route , int hops, int rtt)
|
||||
{
|
||||
ROUTEPTR->Hops = hops;
|
||||
if (ROUTEPTR->RouteLastTT == 0)
|
||||
ROUTEPTR->RouteLastTT = (uint16_t *)zalloc(MAXNEIGHBOURS * sizeof(uint16_t));
|
||||
|
||||
ROUTEPTR->RouteLastTT[Route->recNum] = 0;
|
||||
ROUTEPTR->STT = rtt;
|
||||
ROUTEPTR->SRTT = rtt;
|
||||
ROUTEPTR->LastRTT = 0;
|
||||
ROUTEPTR->RTT = 0;
|
||||
ROUTEPTR->ROUT_NEIGHBOUR = Route;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* LEA EDI,DEST_CALL[EBX]
|
||||
MOV ECX,7
|
||||
REP MOVSB
|
||||
|
||||
MOV ECX,6 ; ADD ALIAS
|
||||
MOV ESI,OFFSET32 TEMPFIELD
|
||||
REP MOVSB
|
||||
|
||||
POP ESI
|
||||
;
|
||||
; GET _NEIGHBOURS FOR THIS DESTINATION
|
||||
;
|
||||
CALL CONVTOAX25
|
||||
JNZ SHORT BADROUTE
|
||||
;
|
||||
CALL GETVALUE
|
||||
MOV _SAVEPORT,AL ; SET PORT FOR _FINDNEIGHBOUR
|
||||
|
||||
CALL GETVALUE
|
||||
MOV _ROUTEQUAL,AL
|
||||
;
|
||||
MOV ESI,OFFSET32 AX25CALL
|
||||
|
||||
PUSH EBX ; SAVE DEST
|
||||
CALL _FINDNEIGHBOUR
|
||||
MOV EAX,EBX ; ROUTE TO AX
|
||||
POP EBX
|
||||
|
||||
JZ SHORT NOTBADROUTE
|
||||
|
||||
JMP SHORT BADROUTE
|
||||
|
||||
NOTBADROUTE:
|
||||
;
|
||||
; UPDATE ROUTE LIST FOR THIS DEST
|
||||
;
|
||||
MOV ROUT1_NEIGHBOUR[EBX],EAX
|
||||
MOV AL,_ROUTEQUAL
|
||||
MOV ROUT1_QUALITY[EBX],AL
|
||||
MOV ROUT1_OBSCOUNT[EBX],255 ; LOCKED
|
||||
;
|
||||
POP EDI
|
||||
POP EBX
|
||||
|
||||
INC _NUMBEROFNODES
|
||||
|
||||
JMP SENDOK
|
||||
*/
|
||||
|
||||
struct INP3_DEST_ROUTE_ENTRY Temp;
|
||||
|
||||
|
||||
|
|
@ -726,16 +747,13 @@ VOID SortRoutes(struct DEST_LIST * Dest)
|
|||
{
|
||||
char Call1[10], Call2[10], Call3[10];
|
||||
|
||||
// force route re-evaluation
|
||||
|
||||
Dest->DEST_ROUTE = 0;
|
||||
|
||||
// May now be out of order
|
||||
|
||||
if (Dest->INP3ROUTE[1].ROUT_NEIGHBOUR == 0)
|
||||
{
|
||||
Call1[ConvFromAX25(Dest->INP3ROUTE[0].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Call1)] = 0;
|
||||
if (DEBUGINP3) Debugprintf("INP3 1 route %d %s", Dest->INP3ROUTE[0].STT, Call1);
|
||||
if (DEBUGINP3) Debugprintf("INP3 1 route %d %s", Dest->INP3ROUTE[0].SRTT, Call1);
|
||||
return; // Only One, so cant be out of order
|
||||
}
|
||||
if (Dest->INP3ROUTE[2].ROUT_NEIGHBOUR == 0)
|
||||
|
|
@ -745,9 +763,9 @@ VOID SortRoutes(struct DEST_LIST * Dest)
|
|||
Call1[ConvFromAX25(Dest->INP3ROUTE[0].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Call1)] = 0;
|
||||
Call2[ConvFromAX25(Dest->INP3ROUTE[1].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Call2)] = 0;
|
||||
|
||||
if (DEBUGINP3) Debugprintf("INP3 2 routes %d %s %d %s", Dest->INP3ROUTE[0].STT, Call1, Dest->INP3ROUTE[1].STT, Call2);
|
||||
if (DEBUGINP3) Debugprintf("INP3 2 routes %d %s %d %s", Dest->INP3ROUTE[0].SRTT, Call1, Dest->INP3ROUTE[1].SRTT, Call2);
|
||||
|
||||
if (Dest->INP3ROUTE[0].STT <= Dest->INP3ROUTE[1].STT)
|
||||
if (Dest->INP3ROUTE[0].SRTT <= Dest->INP3ROUTE[1].SRTT)
|
||||
return;
|
||||
|
||||
// Swap one and two
|
||||
|
|
@ -759,7 +777,7 @@ VOID SortRoutes(struct DEST_LIST * Dest)
|
|||
Call1[ConvFromAX25(Dest->INP3ROUTE[0].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Call1)] = 0;
|
||||
Call2[ConvFromAX25(Dest->INP3ROUTE[1].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Call2)] = 0;
|
||||
|
||||
if (DEBUGINP3) Debugprintf("INP3 2 routes %d %s %d %s", Dest->INP3ROUTE[0].STT, Call1, Dest->INP3ROUTE[1].STT, Call2);
|
||||
if (DEBUGINP3) Debugprintf("INP3 2 routes %d %s %d %s", Dest->INP3ROUTE[0].SRTT, Call1, Dest->INP3ROUTE[1].SRTT, Call2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -770,16 +788,16 @@ VOID SortRoutes(struct DEST_LIST * Dest)
|
|||
Call2[ConvFromAX25(Dest->INP3ROUTE[1].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Call2)] = 0;
|
||||
Call3[ConvFromAX25(Dest->INP3ROUTE[2].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Call3)] = 0;
|
||||
|
||||
if (DEBUGINP3) Debugprintf("INP3 3 routes %d %s %d %s %d %s", Dest->INP3ROUTE[0].STT, Call1, Dest->INP3ROUTE[1].STT, Call2, Dest->INP3ROUTE[2].STT, Call3);
|
||||
if (DEBUGINP3) Debugprintf("INP3 3 routes %d %s %d %s %d %s", Dest->INP3ROUTE[0].SRTT, Call1, Dest->INP3ROUTE[1].SRTT, Call2, Dest->INP3ROUTE[2].SRTT, Call3);
|
||||
|
||||
// In order?
|
||||
|
||||
if (Dest->INP3ROUTE[0].STT <= Dest->INP3ROUTE[1].STT && Dest->INP3ROUTE[1].STT <= Dest->INP3ROUTE[2].STT)// In order?
|
||||
if (Dest->INP3ROUTE[0].SRTT <= Dest->INP3ROUTE[1].SRTT && Dest->INP3ROUTE[1].SRTT <= Dest->INP3ROUTE[2].SRTT)// In order?
|
||||
return;
|
||||
|
||||
// If second is better that first swap
|
||||
|
||||
if (Dest->INP3ROUTE[0].STT > Dest->INP3ROUTE[1].STT)
|
||||
if (Dest->INP3ROUTE[0].SRTT > Dest->INP3ROUTE[1].SRTT)
|
||||
{
|
||||
memcpy(&Temp, &Dest->INP3ROUTE[0], sizeof(struct INP3_DEST_ROUTE_ENTRY));
|
||||
memcpy(&Dest->INP3ROUTE[0], &Dest->INP3ROUTE[1], sizeof(struct INP3_DEST_ROUTE_ENTRY));
|
||||
|
|
@ -791,11 +809,11 @@ VOID SortRoutes(struct DEST_LIST * Dest)
|
|||
Call2[ConvFromAX25(Dest->INP3ROUTE[1].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Call2)] = 0;
|
||||
Call3[ConvFromAX25(Dest->INP3ROUTE[2].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Call3)] = 0;
|
||||
|
||||
if (DEBUGINP3) Debugprintf("INP3 3 routes %d %s %d %s %d %s", Dest->INP3ROUTE[0].STT, Call1, Dest->INP3ROUTE[1].STT, Call2, Dest->INP3ROUTE[2].STT, Call3);
|
||||
if (DEBUGINP3) Debugprintf("INP3 3 routes %d %s %d %s %d %s", Dest->INP3ROUTE[0].SRTT, Call1, Dest->INP3ROUTE[1].SRTT, Call2, Dest->INP3ROUTE[2].SRTT, Call3);
|
||||
|
||||
// if 3 is better than 2 swap them. As two is worse than one. three will then be worst
|
||||
|
||||
if (Dest->INP3ROUTE[1].STT > Dest->INP3ROUTE[2].STT)
|
||||
if (Dest->INP3ROUTE[1].SRTT > Dest->INP3ROUTE[2].SRTT)
|
||||
{
|
||||
memcpy(&Temp, &Dest->INP3ROUTE[1], sizeof(struct INP3_DEST_ROUTE_ENTRY));
|
||||
memcpy(&Dest->INP3ROUTE[1], &Dest->INP3ROUTE[2], sizeof(struct INP3_DEST_ROUTE_ENTRY));
|
||||
|
|
@ -807,12 +825,12 @@ VOID SortRoutes(struct DEST_LIST * Dest)
|
|||
Call2[ConvFromAX25(Dest->INP3ROUTE[1].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Call2)] = 0;
|
||||
Call3[ConvFromAX25(Dest->INP3ROUTE[2].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Call3)] = 0;
|
||||
|
||||
if (DEBUGINP3) Debugprintf("INP3 3 routes %d %s %d %s %d %s", Dest->INP3ROUTE[0].STT, Call1, Dest->INP3ROUTE[1].STT, Call2, Dest->INP3ROUTE[2].STT, Call3);
|
||||
if (DEBUGINP3) Debugprintf("INP3 3 routes %d %s %d %s %d %s", Dest->INP3ROUTE[0].SRTT, Call1, Dest->INP3ROUTE[1].SRTT, Call2, Dest->INP3ROUTE[2].SRTT, Call3);
|
||||
|
||||
// 3 is now slowest. 2 could still be better than 1
|
||||
|
||||
|
||||
if (Dest->INP3ROUTE[0].STT > Dest->INP3ROUTE[1].STT)
|
||||
if (Dest->INP3ROUTE[0].SRTT > Dest->INP3ROUTE[1].SRTT)
|
||||
{
|
||||
memcpy(&Temp, &Dest->INP3ROUTE[0], sizeof(struct INP3_DEST_ROUTE_ENTRY));
|
||||
memcpy(&Dest->INP3ROUTE[0], &Dest->INP3ROUTE[1], sizeof(struct INP3_DEST_ROUTE_ENTRY));
|
||||
|
|
@ -824,9 +842,9 @@ VOID SortRoutes(struct DEST_LIST * Dest)
|
|||
Call2[ConvFromAX25(Dest->INP3ROUTE[1].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Call2)] = 0;
|
||||
Call3[ConvFromAX25(Dest->INP3ROUTE[2].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Call3)] = 0;
|
||||
|
||||
if (DEBUGINP3) Debugprintf("INP3 3 routes %d %s %d %s %d %s", Dest->INP3ROUTE[0].STT, Call1, Dest->INP3ROUTE[1].STT, Call2, Dest->INP3ROUTE[2].STT, Call3);
|
||||
if (DEBUGINP3) Debugprintf("INP3 3 routes %d %s %d %s %d %s", Dest->INP3ROUTE[0].SRTT, Call1, Dest->INP3ROUTE[1].SRTT, Call2, Dest->INP3ROUTE[2].SRTT, Call3);
|
||||
|
||||
if (Dest->INP3ROUTE[0].STT <= Dest->INP3ROUTE[1].STT && Dest->INP3ROUTE[1].STT <= Dest->INP3ROUTE[2].STT)// In order?
|
||||
if (Dest->INP3ROUTE[0].SRTT <= Dest->INP3ROUTE[1].SRTT && Dest->INP3ROUTE[1].SRTT <= Dest->INP3ROUTE[2].SRTT)// In order?
|
||||
return;
|
||||
|
||||
// Something went wrong
|
||||
|
|
@ -844,7 +862,7 @@ VOID UpdateRoute(struct DEST_LIST * Dest, struct INP3_DEST_ROUTE_ENTRY * ROUTEPT
|
|||
// This is not a INP3 Route - Convert it
|
||||
|
||||
ROUTEPTR->Hops = hops;
|
||||
ROUTEPTR->STT = rtt;
|
||||
ROUTEPTR->SRTT = rtt;
|
||||
|
||||
SortRoutes(Dest);
|
||||
return;
|
||||
|
|
@ -852,7 +870,7 @@ VOID UpdateRoute(struct DEST_LIST * Dest, struct INP3_DEST_ROUTE_ENTRY * ROUTEPT
|
|||
|
||||
if (rtt == 60000)
|
||||
{
|
||||
ROUTEPTR->STT = rtt;
|
||||
ROUTEPTR->SRTT = rtt;
|
||||
ROUTEPTR->Hops = hops;
|
||||
|
||||
SortRoutes(Dest);
|
||||
|
|
@ -860,7 +878,7 @@ VOID UpdateRoute(struct DEST_LIST * Dest, struct INP3_DEST_ROUTE_ENTRY * ROUTEPT
|
|||
|
||||
}
|
||||
|
||||
ROUTEPTR->STT = rtt;
|
||||
ROUTEPTR->SRTT = rtt;
|
||||
ROUTEPTR->Hops = hops;
|
||||
|
||||
SortRoutes(Dest);
|
||||
|
|
@ -869,8 +887,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)
|
||||
{
|
||||
uint32_t OtherRTT;
|
||||
uint32_t Dummy;
|
||||
int OtherRTT;
|
||||
int Dummy;
|
||||
char * ptr;
|
||||
struct _RTTMSG * RTTMsg = (struct _RTTMSG *)&Buff->L4DATA[0];
|
||||
char Normcall[10];
|
||||
|
|
@ -889,16 +907,6 @@ VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len
|
|||
return;
|
||||
}
|
||||
|
||||
// Check TTL
|
||||
|
||||
if (Buff->L3TTL < 2)
|
||||
{
|
||||
ReleaseBuffer(Buff);
|
||||
return;
|
||||
}
|
||||
|
||||
Buff->L3TTL--;
|
||||
|
||||
if (Route->NEIGHBOUR_LINK->LINKPORT && (Route->NEIGHBOUR_LINK->LINKPORT->ALLOWINP3 || Route->NEIGHBOUR_LINK->LINKPORT->ENABLEINP3))
|
||||
Route->INP3Node = 1;
|
||||
|
||||
|
|
@ -909,14 +917,6 @@ VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len
|
|||
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
|
||||
|
||||
// Get SWVERSION to see if other end is old (Buggy) BPQ
|
||||
|
|
@ -926,15 +926,10 @@ VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len
|
|||
else
|
||||
Route->OldBPQ = 0;
|
||||
|
||||
sscanf(&Buff->L4DATA[6], "%u %u", &Dummy, &OtherRTT);
|
||||
sscanf(&Buff->L4DATA[6], "%d %d", &Dummy, &OtherRTT);
|
||||
|
||||
if (OtherRTT < 60000) // Don't save suspect values
|
||||
Route->NeighbourSRTT = OtherRTT;
|
||||
|
||||
if (DEBUGINP3) Debugprintf("INP3 RTT Msg from %s remote SRTT %u", Normcall, OtherRTT);
|
||||
|
||||
}
|
||||
|
||||
// Look for $M and $H (MAXRTT MAXHOPS)
|
||||
|
||||
ptr = strstr(RTTMsg->FLAGS, "$M");
|
||||
|
|
@ -947,8 +942,6 @@ VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len
|
|||
if (ptr)
|
||||
Route->RemoteMAXHOPS = atoi(ptr + 2);
|
||||
|
||||
|
||||
|
||||
// Echo Back to sender
|
||||
|
||||
SendNetFrame(Route, Buff);
|
||||
|
|
@ -969,8 +962,7 @@ VOID SendRTTMsg(struct ROUTE * Route)
|
|||
char Stamp[50];
|
||||
char Normcall[10];
|
||||
unsigned char temp[256];
|
||||
uint32_t sendTime;
|
||||
int n;
|
||||
uint64_t sendTime;
|
||||
|
||||
Normcall[ConvFromAX25(Route->NEIGHBOUR_CALL, Normcall)] = 0;
|
||||
|
||||
|
|
@ -990,21 +982,14 @@ VOID SendRTTMsg(struct ROUTE * Route)
|
|||
Msg->L4TXNO = 0;
|
||||
Msg->L4FLAGS = L4INFO;
|
||||
|
||||
// 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
|
||||
// The timestamp can possibly exceed 10 digits. INP3 only works on differece between send and received, so base can be reset safely.
|
||||
|
||||
sendTime = GetTickCountINP3(); // 10mS units
|
||||
sendTime = ((uint64_t)GetTickCount() - INP3timeLoadedMS) / 10; // 10mS units
|
||||
|
||||
sprintf(Stamp, "%10u %10d %10d %10d ", sendTime, Route->SRTT, Route->RTT, RTTID++);
|
||||
if (sendTime > 9999999999)
|
||||
sendTime = INP3timeLoadedMS = 0;
|
||||
|
||||
n = strlen(Stamp);
|
||||
|
||||
if (n != 44)
|
||||
{
|
||||
Debugprintf("Trying to send corrupt RTT message %s", Stamp);
|
||||
return;
|
||||
}
|
||||
sprintf(Stamp, "%10llu %10d %10d %10d ", sendTime, Route->SRTT, Route->RTT, 0);
|
||||
|
||||
memcpy(RTTMsg.TXTIME, Stamp, 44);
|
||||
|
||||
|
|
@ -1109,11 +1094,17 @@ VOID SendOurRIF(struct ROUTE * Route)
|
|||
int totLen = 1;
|
||||
int App;
|
||||
APPLCALLS * APPL;
|
||||
char Normcall[10];
|
||||
|
||||
Msg = GetBuff();
|
||||
if (Msg == 0)
|
||||
return;
|
||||
|
||||
|
||||
Normcall[ConvFromAX25(Route->NEIGHBOUR_LINK->LINKCALL, Normcall)] = 0;
|
||||
if (DEBUGINP3) Debugprintf("INP3 Sending Initial RIF to %s ", Normcall);
|
||||
|
||||
|
||||
Msg->L3SRCE[0] = 0xff;
|
||||
|
||||
// send a RIF for our Node and all our APPLCalls
|
||||
|
|
@ -1154,6 +1145,7 @@ int SendRIPTimer()
|
|||
int INP3Delay;
|
||||
char Normcall[10];
|
||||
|
||||
|
||||
for (count=0; count<MaxRoutes; count++)
|
||||
{
|
||||
if (Route->NEIGHBOUR_CALL[0] != 0)
|
||||
|
|
@ -1207,15 +1199,13 @@ int SendRIPTimer()
|
|||
|
||||
Route->ConnectionAttempts++;
|
||||
|
||||
if (Route->INP3Node && ((Route->TCPPort == 0 || strcmp(Route->TCPHost, "0.0.0.0") != 0)))
|
||||
if (Route->INP3Node)
|
||||
{
|
||||
Normcall[ConvFromAX25(Route->NEIGHBOUR_CALL, Normcall)] = 0;
|
||||
if (DEBUGINP3) Debugprintf("INP3 Activating link to %s", Normcall);
|
||||
}
|
||||
|
||||
L2SETUPCROSSLINKEX(Route, 2); // Only try SABM/XID twice
|
||||
Route->NeighbourSRTT = 0; // just in case!
|
||||
Route->BCTimer = 0;
|
||||
L2SETUPCROSSLINKEX(Route, 2); // Only try SABM twice
|
||||
|
||||
Route->LastConnectAttempt = REALTIMETICKS;
|
||||
|
||||
|
|
@ -1276,30 +1266,12 @@ int SendRIPTimer()
|
|||
char Call [11] = "";
|
||||
|
||||
ConvFromAX25(Route->NEIGHBOUR_CALL, Call);
|
||||
if (DEBUGINP3) Debugprintf("BPQ32 INP3 Neighbour %s Lost (No Response to RTT)", Call);
|
||||
|
||||
DecayNETROMRoutes(Route);
|
||||
DeleteINP3Routes(Route);
|
||||
if (DEBUGINP3) Debugprintf("BPQ32 INP3 Neighbour %s Lost", Call);
|
||||
|
||||
Route->Status = 0; // Down
|
||||
|
||||
// close the link
|
||||
|
||||
if (Route->TCPPort == 0) // NetromTCP doesn't have a real link
|
||||
{
|
||||
Route->NEIGHBOUR_LINK->KILLTIMER = 0;
|
||||
Route->NEIGHBOUR_LINK->L2TIMER = 1; // TO FORCE DISC
|
||||
Route->NEIGHBOUR_LINK->L2STATE = 4; // DISCONNECTING
|
||||
}
|
||||
else
|
||||
{
|
||||
// but we should reset the TCP connection
|
||||
|
||||
NETROMCloseTCP(Route);
|
||||
}
|
||||
}
|
||||
|
||||
Route->BCTimer = 5; // Wait a while before retrying
|
||||
Route->BCTimer=5; // Wait a while before retrying
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1352,101 +1324,39 @@ VOID SendRIF(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Msg)
|
|||
SendNetFrame(Route, Msg);
|
||||
}
|
||||
|
||||
VOID SendRIFToOtherNeighbours(UCHAR * axcall, UCHAR * alias, struct INP3_DEST_ROUTE_ENTRY * Entry, int Negative, int portNum)
|
||||
VOID SendRIPToOtherNeighbours(UCHAR * axcall, UCHAR * alias, struct INP3_DEST_ROUTE_ENTRY * Entry)
|
||||
{
|
||||
struct ROUTE * Routes = NEIGHBOURS;
|
||||
struct _L3MESSAGEBUFFER * Msg;
|
||||
int count, MaxRoutes = MAXNEIGHBOURS;
|
||||
char NodeCall[10];
|
||||
char destCall[10];
|
||||
char Normcall[10];
|
||||
int sendHops, sendTT;
|
||||
|
||||
int sendHops, sendTT, lastTT;
|
||||
Normcall[ConvFromAX25(axcall, Normcall)] = 0;
|
||||
|
||||
// if portNum is set sending a periodic refresh. Just sent to this port
|
||||
if (DEBUGINP3) Debugprintf("INP3 SendRIPToOtherNeighbours for %s", Normcall);
|
||||
|
||||
NodeCall[ConvFromAX25(axcall, NodeCall)] = 0;
|
||||
|
||||
for (count = 0; count < MaxRoutes; count++)
|
||||
for (count=0; count<MaxRoutes; count++)
|
||||
{
|
||||
if ((Entry->ROUT_NEIGHBOUR && Routes->INP3Node) &&
|
||||
if ((Routes->INP3Node) &&
|
||||
(Routes->Status) &&
|
||||
// (memcmp(Routes->NEIGHBOUR_CALL
|
||||
(Routes != Entry->ROUT_NEIGHBOUR)) // Dont send to originator of route
|
||||
{
|
||||
|
||||
// as the value sent will be different for each link, we need to check if change is enough here
|
||||
|
||||
sendHops = Entry->Hops + 1;
|
||||
sendTT = Entry->STT + Entry->ROUT_NEIGHBOUR->RTTIncrement;
|
||||
lastTT = Entry->RouteLastTT[Entry->ROUT_NEIGHBOUR->recNum];
|
||||
|
||||
if (!portNum)
|
||||
{
|
||||
if (Negative)
|
||||
{
|
||||
// only send if significantly worse
|
||||
|
||||
if (sendTT < (lastTT * NegativePercent) / 100)
|
||||
{
|
||||
Routes+=1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Send if significantly better
|
||||
|
||||
if (sendTT > (lastTT * PositivePercent) / 100)
|
||||
{
|
||||
Routes+=1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Don't send if Node is the Neighbour we are sending to
|
||||
|
||||
if (memcmp(Routes->NEIGHBOUR_CALL, axcall, 7) == 0)
|
||||
{
|
||||
if (DEBUGINP3) Debugprintf("INP3 SendRIFToOtherNeighbours Don't send %s to itself", NodeCall);
|
||||
Routes+=1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (portNum && Routes->NEIGHBOUR_PORT != portNum)
|
||||
{
|
||||
Routes+=1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (portNum)
|
||||
Routes->Status &= ~SentOurRIF;
|
||||
|
||||
Entry->RouteLastTT[Entry->ROUT_NEIGHBOUR->recNum] = sendTT;
|
||||
sendTT = Entry->SRTT + Entry->ROUT_NEIGHBOUR->RTTIncrement;
|
||||
|
||||
// send, but only if within their constraints
|
||||
|
||||
if ((Routes->RemoteMAXHOPS == 0 || Routes->RemoteMAXHOPS >= Entry->Hops) &&
|
||||
(Routes->RemoteMAXRTT == 0 || Routes->RemoteMAXRTT >= sendTT || sendTT == 60000))
|
||||
(Routes->RemoteMAXRTT == 0 || Routes->RemoteMAXRTT >= Entry->SRTT || Entry->SRTT == 60000))
|
||||
{
|
||||
if (DEBUGINP3)
|
||||
{
|
||||
if (portNum)
|
||||
Debugprintf("INP3 %s Timer Refresh Sending to port %d", NodeCall, portNum);
|
||||
else
|
||||
Debugprintf("INP3 %s Old TT %d New %d Sufficent change so sending ", NodeCall, lastTT, sendTT);
|
||||
}
|
||||
|
||||
Msg = Routes->Msg;
|
||||
|
||||
if (Msg == NULL)
|
||||
{
|
||||
if (DEBUGINP3)
|
||||
{
|
||||
destCall[ConvFromAX25(Entry->ROUT_NEIGHBOUR->NEIGHBOUR_CALL, destCall)] = 0;
|
||||
Debugprintf("INP3 Building RIF to send to %s", destCall);
|
||||
}
|
||||
Normcall[ConvFromAX25(Routes->NEIGHBOUR_CALL, Normcall)] = 0;
|
||||
if (DEBUGINP3) Debugprintf("INP3 Building RIF to send to %s", Normcall);
|
||||
Msg = Routes->Msg = CreateRIFHeader(Routes);
|
||||
}
|
||||
|
||||
|
|
@ -1459,7 +1369,6 @@ VOID SendRIFToOtherNeighbours(UCHAR * axcall, UCHAR * alias, struct INP3_DEST_RO
|
|||
Msg->LENGTH += BuildRIF(&Msg->L3SRCE[Msg->LENGTH],
|
||||
axcall, alias, sendHops, sendTT);
|
||||
|
||||
|
||||
if (Msg->LENGTH > 250 - 15)
|
||||
// if (Msg->LENGTH > Routes->NBOUR_PACLEN - 11)
|
||||
{
|
||||
|
|
@ -1469,13 +1378,11 @@ VOID SendRIFToOtherNeighbours(UCHAR * axcall, UCHAR * alias, struct INP3_DEST_RO
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Routes+=1;
|
||||
}
|
||||
}
|
||||
|
||||
VOID SendRIFToNewNeighbour(struct ROUTE * Route)
|
||||
VOID SendRIPToNeighbour(struct ROUTE * Route)
|
||||
{
|
||||
int i;
|
||||
struct DEST_LIST * Dest = DESTS;
|
||||
|
|
@ -1504,12 +1411,10 @@ VOID SendRIFToNewNeighbour(struct ROUTE * Route)
|
|||
// Best Route not via this neighbour - send, but only if within their constraints
|
||||
|
||||
sendHops = Entry->Hops + 1;
|
||||
|
||||
sendTT = Entry->STT + Entry->ROUT_NEIGHBOUR->RTTIncrement;
|
||||
Entry->RouteLastTT[Entry->ROUT_NEIGHBOUR->recNum] = sendTT;
|
||||
sendTT = Entry->SRTT + Entry->ROUT_NEIGHBOUR->RTTIncrement;
|
||||
|
||||
if ((Route->RemoteMAXHOPS == 0 || Route->RemoteMAXHOPS >= Entry->Hops) &&
|
||||
(Route->RemoteMAXRTT == 0 || Route->RemoteMAXRTT >= Entry->STT || Entry->STT == 60000))
|
||||
(Route->RemoteMAXRTT == 0 || Route->RemoteMAXRTT >= Entry->SRTT || Entry->SRTT == 60000))
|
||||
{
|
||||
Msg = Route->Msg;
|
||||
|
||||
|
|
@ -1552,7 +1457,7 @@ VOID FlushRIFs()
|
|||
{
|
||||
Routes->Status |= SentOurRIF;
|
||||
SendOurRIF(Routes);
|
||||
SendRIFToNewNeighbour(Routes);
|
||||
SendRIPToNeighbour(Routes);
|
||||
}
|
||||
|
||||
if (Routes->Msg)
|
||||
|
|
@ -1570,11 +1475,9 @@ VOID FlushRIFs()
|
|||
|
||||
VOID SendNegativeInfo()
|
||||
{
|
||||
int i;
|
||||
int i, Preload;
|
||||
struct DEST_LIST * Dest = DESTS;
|
||||
struct INP3_DEST_ROUTE_ENTRY * Entry;
|
||||
char call[11]="";
|
||||
|
||||
|
||||
Dest--;
|
||||
|
||||
|
|
@ -1592,16 +1495,22 @@ VOID SendNegativeInfo()
|
|||
|
||||
Entry = &Dest->INP3ROUTE[0];
|
||||
|
||||
if (Entry->ROUT_NEIGHBOUR == 0)
|
||||
continue;
|
||||
|
||||
|
||||
if (Entry->RouteLastTT[Entry->ROUT_NEIGHBOUR->recNum] == 0) // if zero haven't yet reported +ve info. Shouldn't really be reporting negative without positive but just in case
|
||||
SendRIFToOtherNeighbours(Dest->DEST_CALL, Dest->DEST_ALIAS, Entry, TRUE, FALSE);
|
||||
if (Entry->SRTT > Entry->LastRTT)
|
||||
{
|
||||
if (Entry->LastRTT) // if zero haven't yet reported +ve info
|
||||
{
|
||||
if (Entry->LastRTT == 1) // if 1, probably new, so send alias
|
||||
SendRIPToOtherNeighbours(Dest->DEST_CALL, Dest->DEST_ALIAS, Entry);
|
||||
else
|
||||
SendRIFToOtherNeighbours(Dest->DEST_CALL, 0, Entry, TRUE, FALSE);
|
||||
SendRIPToOtherNeighbours(Dest->DEST_CALL, 0, Entry);
|
||||
|
||||
if (Entry->STT >= 60000)
|
||||
Preload = Entry->SRTT /10;
|
||||
if (Entry->SRTT < 60000)
|
||||
Entry->LastRTT = Entry->SRTT + Preload; //10% Negative Preload
|
||||
}
|
||||
}
|
||||
|
||||
if (Entry->SRTT >= 60000)
|
||||
{
|
||||
// It is dead, and we have reported it if necessary, so remove if no NETROM Routes
|
||||
|
||||
|
|
@ -1640,17 +1549,22 @@ VOID SendPositiveInfo()
|
|||
{
|
||||
Dest++;
|
||||
|
||||
if (Dest->DEST_CALL[0] == 0) // unused entry
|
||||
continue;
|
||||
|
||||
Entry = &Dest->INP3ROUTE[0];
|
||||
SendRIFToOtherNeighbours(Dest->DEST_CALL, 0, Entry, FALSE, FALSE);
|
||||
|
||||
if (( (Entry->SRTT) && (Entry->LastRTT == 0) )|| // if zero haven't yet reported +ve info
|
||||
((((Entry->SRTT * 125) /100) < Entry->LastRTT) && // Better by 25%
|
||||
((Entry->LastRTT - Entry->SRTT) > 10))) // and 100ms
|
||||
{
|
||||
SendRIPToOtherNeighbours(Dest->DEST_CALL, 0, Entry);
|
||||
Dest->INP3ROUTE[0].LastRTT = (Dest->INP3ROUTE[0].SRTT * 11) / 10; //10% Negative Preload
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VOID SendNewInfo()
|
||||
{
|
||||
int i;
|
||||
unsigned int NewRTT;
|
||||
struct DEST_LIST * Dest = DESTS;
|
||||
struct INP3_DEST_ROUTE_ENTRY * Entry;
|
||||
|
||||
|
|
@ -1668,169 +1582,14 @@ VOID SendNewInfo()
|
|||
|
||||
Entry = &Dest->INP3ROUTE[0];
|
||||
|
||||
SendRIFToOtherNeighbours(Dest->DEST_CALL, Dest->DEST_ALIAS, Entry, FALSE, FALSE);
|
||||
SendRIPToOtherNeighbours(Dest->DEST_CALL, Dest->DEST_ALIAS, Entry);
|
||||
|
||||
NewRTT = (Entry->SRTT * 11) / 10;
|
||||
Entry->LastRTT = NewRTT; //10% Negative Preload
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Refresh RIF entries for each route. Shouldn't be necessary, but add for now
|
||||
|
||||
int routeCount = 0;
|
||||
struct ROUTE * Route = NULL;
|
||||
|
||||
VOID sendAlltoOneNeigbour(struct ROUTE * Route)
|
||||
{
|
||||
char Call[10];
|
||||
struct DEST_LIST * Dest = DESTS;
|
||||
struct INP3_DEST_ROUTE_ENTRY * Entry;
|
||||
|
||||
int i;
|
||||
struct _L3MESSAGEBUFFER * Msg;
|
||||
int sendHops, sendTT, lastTT;
|
||||
APPLCALLS * APPL;
|
||||
int App;
|
||||
|
||||
Call[ConvFromAX25(Route->NEIGHBOUR_CALL, Call)] = 0;
|
||||
|
||||
if (DEBUGINP3) Debugprintf("INP3 Manual send RIF to %s", Call);
|
||||
|
||||
// send a RIF for our Node and all our APPLCalls
|
||||
|
||||
Msg = Route->Msg;
|
||||
|
||||
if (Msg == NULL)
|
||||
Msg = Route->Msg = CreateRIFHeader(Route);
|
||||
|
||||
if (Msg == 0)
|
||||
return;
|
||||
|
||||
if (Route->OldBPQ)
|
||||
Msg->LENGTH += BuildRIF(&Msg->L3SRCE[Msg->LENGTH], MYCALL, MYALIASTEXT, 1, Route->RTTIncrement * 10);
|
||||
else
|
||||
Msg->LENGTH += BuildRIF(&Msg->L3SRCE[Msg->LENGTH], MYCALL, MYALIASTEXT, 1, Route->RTTIncrement);
|
||||
|
||||
for (App = 0; App < NumberofAppls; App++)
|
||||
{
|
||||
APPL=&APPLCALLTABLE[App];
|
||||
|
||||
if (APPL->APPLQUAL > 0)
|
||||
{
|
||||
if (Route->OldBPQ)
|
||||
Msg->LENGTH += BuildRIF(&Msg->L3SRCE[Msg->LENGTH], APPL->APPLCALL, APPL->APPLALIAS_TEXT, 1, Route->RTTIncrement * 10);
|
||||
else
|
||||
Msg->LENGTH += BuildRIF(&Msg->L3SRCE[Msg->LENGTH], APPL->APPLCALL, APPL->APPLALIAS_TEXT, 1, Route->RTTIncrement);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Send all dests that have this route as their best inp3 route
|
||||
|
||||
Dest--;
|
||||
|
||||
for (i=0; i < MAXDESTS; i++)
|
||||
{
|
||||
Dest++;
|
||||
|
||||
Entry = &Dest->INP3ROUTE[0];
|
||||
|
||||
if (Entry->ROUT_NEIGHBOUR == 0)
|
||||
continue;
|
||||
|
||||
if (Entry->ROUT_NEIGHBOUR && Route->INP3Node && Route->Status && Route != Entry->ROUT_NEIGHBOUR) // Dont send to originator of route
|
||||
{
|
||||
// as the value sent will be different for each link, we need to check if change is enough here
|
||||
|
||||
// Don't send if Node is the Neighbour we are sending to
|
||||
|
||||
if (memcmp(Route->NEIGHBOUR_CALL, Dest->DEST_CALL, 7) == 0)
|
||||
{
|
||||
if (DEBUGINP3) Debugprintf("INP3 Timer RIF Don't send %s to itself", Call);
|
||||
Route++;
|
||||
continue;
|
||||
}
|
||||
|
||||
sendHops = Entry->Hops + 1;
|
||||
sendTT = Entry->STT + Entry->ROUT_NEIGHBOUR->RTTIncrement;
|
||||
lastTT = Entry->RouteLastTT[Entry->ROUT_NEIGHBOUR->recNum];
|
||||
|
||||
Entry->RouteLastTT[Entry->ROUT_NEIGHBOUR->recNum] = sendTT;
|
||||
|
||||
// send, but only if within their constraints
|
||||
|
||||
if ((Route->RemoteMAXHOPS == 0 || Route->RemoteMAXHOPS >= Entry->Hops) && (Route->RemoteMAXRTT == 0 || Route->RemoteMAXRTT >= sendTT))
|
||||
{
|
||||
Msg = Route->Msg;
|
||||
|
||||
if (Msg == NULL)
|
||||
Msg = Route->Msg = CreateRIFHeader(Route);
|
||||
|
||||
if (Msg)
|
||||
{
|
||||
if (Route->OldBPQ)
|
||||
sendTT *= 10;
|
||||
|
||||
Msg->LENGTH += BuildRIF(&Msg->L3SRCE[Msg->LENGTH], Dest->DEST_CALL, Dest->DEST_ALIAS, sendHops, sendTT);
|
||||
|
||||
if (Msg->LENGTH > 250 - 15)
|
||||
{
|
||||
SendRIF(Route, Msg);
|
||||
Route->Msg = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Route->Msg)
|
||||
{
|
||||
SendRIF(Route, Route->Msg);
|
||||
Route->Msg = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
VOID SendAllInfo()
|
||||
{
|
||||
time_t Now = time(NULL);
|
||||
|
||||
if (routeCount == 0) // Not sending
|
||||
{
|
||||
if (RIFInterval == 0 || (Now - SENDRIFTIME) < RIFInterval) // Time for new send?
|
||||
return;
|
||||
|
||||
Route = NEIGHBOURS;
|
||||
}
|
||||
|
||||
// Build RIF
|
||||
|
||||
while (Route->INP3Node == 0)
|
||||
{
|
||||
Route++;
|
||||
routeCount++;
|
||||
|
||||
if (routeCount == MAXNEIGHBOURS)
|
||||
{
|
||||
//cycle finished
|
||||
|
||||
SENDRIFTIME = Now;
|
||||
routeCount = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
sendAlltoOneNeigbour(Route);
|
||||
|
||||
Route++;
|
||||
routeCount++;
|
||||
|
||||
if (routeCount == MAXNEIGHBOURS)
|
||||
{
|
||||
//cycle finished
|
||||
|
||||
SENDRIFTIME = Now;
|
||||
routeCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
VOID INP3TIMER()
|
||||
{
|
||||
|
|
@ -1853,27 +1612,20 @@ VOID INP3TIMER()
|
|||
|
||||
#endif
|
||||
|
||||
if (NegTimerCount == 0)
|
||||
{
|
||||
NegTimerCount = NegativeDelay;
|
||||
SendNegativeInfo();
|
||||
}
|
||||
else
|
||||
NegTimerCount--;
|
||||
SendNegativeInfo(); // Urgent
|
||||
|
||||
if (RIPTimerCount == 0)
|
||||
{
|
||||
RIPTimerCount = 10;
|
||||
SendNewInfo(); // Not quite so urgent
|
||||
SendRIPTimer();
|
||||
SendAllInfo(); // Timer Driven refresh
|
||||
}
|
||||
else
|
||||
RIPTimerCount--;
|
||||
|
||||
if (PosTimerCount == 0)
|
||||
{
|
||||
PosTimerCount = PositiveDelay;
|
||||
PosTimerCount = 300; // 5 mins
|
||||
SendPositiveInfo();
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -731,7 +731,7 @@ VOID WINAPI OnSelChanged(HWND hwndDlg)
|
|||
SetDlgItemInt(pHdr->hwndDisplay, IDC_MAXMSG, MaxMsgno, FALSE);
|
||||
SetDlgItemInt(pHdr->hwndDisplay, IDC_BIDLIFETIME, BidLifetime, FALSE);
|
||||
SetDlgItemInt(pHdr->hwndDisplay, IDC_USERLIFETIME, UserLifetime, FALSE);
|
||||
SetDlgItemInt(pHdr->hwndDisplay, IDC_LOGLIFETIME, BBSLogAge, FALSE);
|
||||
SetDlgItemInt(pHdr->hwndDisplay, IDC_LOGLIFETIME, LogAge, FALSE);
|
||||
SetDlgItemInt(pHdr->hwndDisplay, IDC_MAINTINTERVAL, MaintInterval, FALSE);
|
||||
sprintf(Time, "%04d", MaintTime);
|
||||
SetDlgItemText(pHdr->hwndDisplay, IDC_MAINTTIME, Time);
|
||||
|
|
@ -1979,7 +1979,7 @@ VOID SaveMAINTConfigFromDialog()
|
|||
if (MaxMsgno > 99000) MaxMsgno = 99000;
|
||||
|
||||
BidLifetime = GetDlgItemInt(hwndDisplay, IDC_BIDLIFETIME, &OK1, FALSE);
|
||||
BBSLogAge = GetDlgItemInt(hwndDisplay, IDC_LOGLIFETIME, &OK1, FALSE);
|
||||
LogAge = GetDlgItemInt(hwndDisplay, IDC_LOGLIFETIME, &OK1, FALSE);
|
||||
UserLifetime = GetDlgItemInt(hwndDisplay, IDC_USERLIFETIME, &OK1, FALSE);
|
||||
MaintInterval = GetDlgItemInt(hwndDisplay, IDC_MAINTINTERVAL, &OK1, FALSE);
|
||||
MaintTime = GetDlgItemInt(hwndDisplay, IDC_MAINTTIME, &OK1, FALSE);
|
||||
|
|
@ -2657,7 +2657,7 @@ BOOL GetConfigFromRegistry()
|
|||
|
||||
Vallen=4;
|
||||
RegQueryValueEx(hKey,"LogLifetime",0,
|
||||
(ULONG *)&Type,(UCHAR *)&BBSLogAge,(ULONG *)&Vallen);
|
||||
(ULONG *)&Type,(UCHAR *)&LogAge,(ULONG *)&Vallen);
|
||||
|
||||
Vallen=4;
|
||||
retCode += RegQueryValueEx(hKey,"BidLifetime",0,
|
||||
|
|
|
|||
115
Bpq32.c
115
Bpq32.c
|
|
@ -1292,23 +1292,12 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
|||
// Improvments to INP3 (4, 5)
|
||||
// Add Node API /api/tcpqueues (5)
|
||||
// Add sending link events to OARC API (disabled by default) (6)
|
||||
// Add option to write monitor output to a file (6)
|
||||
// Fix possible program error in Telnet_Connected (7)
|
||||
// Close links when program is closed down (7)
|
||||
// Fix possible problem with deleting routes when using both NODES and INP3 routing on same link (7)
|
||||
// Add Paula's Netromx (allows connects to different applications using Node call) (8)
|
||||
// Add Netrom over TCP (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 connecting to a netrom node with c p node command (10)
|
||||
// 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)
|
||||
// Add config file option to enable writing monitor data to a file at startup (13)
|
||||
// Add option to use V2.0 on a route (14)
|
||||
// Don't reset NS on RR R(F) following I(P) just on RR poll following timeout. Can get problems with delayed RR R(F) (reverted) (14)
|
||||
// Ignore packets that would cause an FRMR and respond to FRMR with DM (14)
|
||||
// Add option to send periodic INP3 RIF refresh (15)
|
||||
|
||||
|
||||
|
||||
#define CKernel
|
||||
|
|
@ -1417,7 +1406,6 @@ void initAIS();
|
|||
void initADSB();
|
||||
int CloseAllSessions();
|
||||
int CloseAllLinks();
|
||||
void NETROMTCPResolve();
|
||||
|
||||
extern BOOL ADIFLogEnabled;
|
||||
|
||||
|
|
@ -1425,8 +1413,6 @@ int CloseOnError = 0;
|
|||
|
||||
char UIClassName[]="UIMAINWINDOW"; // the main window class name
|
||||
|
||||
char ClosingClassName[]="CLOSING"; // the main window class name
|
||||
|
||||
HWND UIhWnd;
|
||||
|
||||
extern char AUTOSAVE;
|
||||
|
|
@ -1549,6 +1535,7 @@ extern char ReportDest[7];
|
|||
|
||||
extern UCHAR ConfigDirectory[260];
|
||||
|
||||
extern uint64_t INP3timeLoadedMS;
|
||||
|
||||
VOID __cdecl Debugprintf(const char * format, ...);
|
||||
VOID __cdecl Consoleprintf(const char * format, ...);
|
||||
|
|
@ -2229,8 +2216,6 @@ VOID TimerProcX()
|
|||
|
||||
Start();
|
||||
|
||||
NETROMTCPResolve();
|
||||
|
||||
INITIALISEPORTS(); // Restart Ports
|
||||
|
||||
SetApplPorts();
|
||||
|
|
@ -2413,7 +2398,7 @@ VOID TimerProcX()
|
|||
if (CloseAllSessions() == 0)
|
||||
{
|
||||
if (CloseAllLinks() == 0) // No sessions closed so close links now
|
||||
CloseAllTimer = 1; // No Links so close now
|
||||
CloseAllTimer = 0; // No Links so close now
|
||||
else
|
||||
CloseAllTimer = 39; // ~4 secs for links to close
|
||||
}
|
||||
|
|
@ -2489,6 +2474,8 @@ FirstInit()
|
|||
EnumProcessesPtr = (FARPROCX)GetProcAddress(ExtDriver,"EnumProcesses");
|
||||
}
|
||||
|
||||
INP3timeLoadedMS = GetTickCount();
|
||||
|
||||
srand(time(NULL));
|
||||
|
||||
INITIALISEPORTS();
|
||||
|
|
@ -2645,7 +2632,6 @@ Check_Timer()
|
|||
|
||||
WSAStartup(MAKEWORD(2, 0), &WsaData);
|
||||
|
||||
|
||||
// Load Psapi.dll if possible
|
||||
|
||||
ExtDriver = LoadLibrary("Psapi.dll");
|
||||
|
|
@ -2660,8 +2646,6 @@ Check_Timer()
|
|||
|
||||
Start();
|
||||
|
||||
NETROMTCPResolve();
|
||||
|
||||
INITIALISEPORTS();
|
||||
|
||||
OpenReportingSockets();
|
||||
|
|
@ -2829,12 +2813,6 @@ BOOL APIENTRY DllMain(HANDLE hInst, DWORD ul_reason_being_called, LPVOID lpReser
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (sizeof(struct NR_DEST_ROUTE_ENTRY) != sizeof(struct INP3_DEST_ROUTE_ENTRY))
|
||||
{
|
||||
MessageBox(NULL,"Route Entry mismatch - fix and rebuild", "BPQ32", MB_OK);
|
||||
return 0;
|
||||
}
|
||||
|
||||
GetSemaphore(&Semaphore, 4);
|
||||
|
||||
BPQHOSTVECPTR = &BPQHOSTVECTOR[0];
|
||||
|
|
@ -2991,8 +2969,6 @@ BOOL APIENTRY DllMain(HANDLE hInst, DWORD ul_reason_being_called, LPVOID lpReser
|
|||
}
|
||||
else
|
||||
{
|
||||
NETROMTCPResolve();
|
||||
|
||||
SetApplPorts();
|
||||
|
||||
GetUIConfig();
|
||||
|
|
@ -4238,6 +4214,7 @@ int APIENTRY Restart()
|
|||
CloseHandle(hProc);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -5990,96 +5967,14 @@ DllExport VOID APIENTRY CreateNewTrayIcon()
|
|||
|
||||
void hookNodeClosing(char * Reason);
|
||||
|
||||
BOOL CALLBACK ClosaAllProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
int wmId, wmEvent;
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
return (INT_PTR)TRUE;
|
||||
|
||||
case WM_CTLCOLORDLG:
|
||||
return (LONG)bgBrush;
|
||||
|
||||
case WM_CTLCOLORSTATIC:
|
||||
{
|
||||
HDC hdcStatic = (HDC)wParam;
|
||||
SetTextColor(hdcStatic, RGB(0, 0, 0));
|
||||
SetBkMode(hdcStatic, TRANSPARENT);
|
||||
|
||||
return (LONG)bgBrush;
|
||||
}
|
||||
|
||||
case WM_COMMAND:
|
||||
|
||||
return 0;
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
|
||||
wmId = LOWORD(wParam); // Remember, these are...
|
||||
wmEvent = HIWORD(wParam); // ...different for Win32!
|
||||
|
||||
switch (wmId)
|
||||
{
|
||||
case SC_RESTORE:
|
||||
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
|
||||
case SC_MINIMIZE:
|
||||
|
||||
if (MinimizetoTray)
|
||||
return ShowWindow(hWnd, SW_HIDE);
|
||||
else
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
}
|
||||
|
||||
case WM_CLOSE:
|
||||
return(DestroyWindow(hWnd));
|
||||
|
||||
default:
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
HWND hwndClosing = NULL; // Window handle of dialog box
|
||||
|
||||
|
||||
DllExport VOID APIENTRY CloseAllPrograms()
|
||||
{
|
||||
WNDCLASS wc;
|
||||
CLOSING = TRUE;
|
||||
|
||||
// Tell BG to shut when all links are gone or after 5 secs
|
||||
|
||||
CloseAllTimer = 50;
|
||||
|
||||
|
||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wc.lpfnWndProc = ClosaAllProc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = DLGWINDOWEXTRA;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hIcon = LoadIcon( hInstance, MAKEINTRESOURCE(BPQICON) );
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wc.hbrBackground = bgBrush;
|
||||
|
||||
wc.lpszMenuName = NULL;
|
||||
wc.lpszClassName = ClosingClassName;
|
||||
|
||||
RegisterClass(&wc);
|
||||
|
||||
hwndClosing = CreateDialog(hInstance, ClosingClassName, NULL, (DLGPROC)ClosaAllProc);
|
||||
ShowWindow(hwndClosing, SW_SHOW);
|
||||
}
|
||||
|
||||
VOID RealCloseAllPrograms()
|
||||
|
|
|
|||
214
Cmd.c
214
Cmd.c
|
|
@ -71,7 +71,6 @@ int CompareAlias(const void *a, const void *b);
|
|||
int CompareRoutes(const void * a, const void * b);
|
||||
void SendVARANetromNodes(struct TNCINFO * TNC, MESSAGE *Buffer);
|
||||
VOID DoNetromConnect(TRANSPORTENTRY * Session, char * Bufferptr, struct DEST_LIST * Dest, BOOL Spy, int Service);
|
||||
VOID sendAlltoOneNeigbour(struct ROUTE * Route);
|
||||
|
||||
extern VOID KISSTX(struct KISSINFO * KISS, PMESSAGE Buffer);
|
||||
|
||||
|
|
@ -85,7 +84,6 @@ UCHAR SAVEDAPPLFLAGS = 0;
|
|||
UCHAR ALIASINVOKED = 0;
|
||||
|
||||
extern int MONTOFILEFLAG;
|
||||
extern int RIFInterval;
|
||||
|
||||
VOID * CMDPTR = 0;
|
||||
|
||||
|
|
@ -132,8 +130,6 @@ int NOBUFFCOUNT = 0;
|
|||
int BUFFERWAITS = 0;
|
||||
int MAXDESTS = 0;
|
||||
int NUMBEROFNODES = 0;
|
||||
int L2CONNECTSOUT = 0;
|
||||
int L2CONNECTSIN = 0;
|
||||
int L4CONNECTSOUT = 0;
|
||||
int L4CONNECTSIN = 0;
|
||||
int L4FRAMESTX = 0;
|
||||
|
|
@ -359,36 +355,6 @@ VOID POLLNODES(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struc
|
|||
|
||||
SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER));
|
||||
}
|
||||
|
||||
VOID SENDRIF(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct CMDX * CMD)
|
||||
{
|
||||
struct ROUTE * Route;
|
||||
int Portnum = atoi(CmdTail);
|
||||
unsigned char axCall[7];
|
||||
|
||||
char * Call = strlop(CmdTail, ' ');
|
||||
|
||||
if (Call && Portnum)
|
||||
{
|
||||
ConvToAX25(Call, axCall);
|
||||
|
||||
if (FindNeighbour(axCall, Portnum, &Route))
|
||||
{
|
||||
sendAlltoOneNeigbour(Route);
|
||||
|
||||
strcpy(Bufferptr, OKMSG);
|
||||
Bufferptr += (int)strlen(OKMSG);
|
||||
|
||||
SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Bufferptr = Cmdprintf(Session, Bufferptr, "Route not found\r");
|
||||
SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER));
|
||||
return;
|
||||
}
|
||||
|
||||
VOID SENDNODES(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct CMDX * CMD)
|
||||
{
|
||||
int Portnum = atoi(CmdTail);
|
||||
|
|
@ -870,14 +836,13 @@ BOOL cATTACHTOBBS(TRANSPORTENTRY * Session, UINT Mask, int Paclen, int * AnySess
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void ConnecttoService(TRANSPORTENTRY * Session, char * Bufferptr, int Service, char * Node, int Stay)
|
||||
void ConnecttoService(TRANSPORTENTRY * Session, char * Bufferptr, int ServiceIndex, char * Node, int Stay)
|
||||
{
|
||||
struct DEST_LIST * Dest = DESTS;
|
||||
int n = MAXDESTS;
|
||||
int gotDest = 0;
|
||||
unsigned char axcall[7];
|
||||
char cmdName[80];
|
||||
int i;
|
||||
int Service = -1;
|
||||
|
||||
// Make Sure Node is Known
|
||||
|
||||
|
|
@ -922,20 +887,9 @@ void ConnecttoService(TRANSPORTENTRY * Session, char * Bufferptr, int Service, c
|
|||
|
||||
Session->STAYFLAG = Stay;
|
||||
|
||||
// Get command name if a named command
|
||||
Service = SERVICES[ServiceIndex].ServiceNo;
|
||||
|
||||
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);
|
||||
Bufferptr = Cmdprintf(Session, Bufferptr, "Connecting to Service %s on Node %s \r", SERVICES[ServiceIndex].ServiceName, Node);
|
||||
|
||||
DoNetromConnect(Session, Bufferptr, Dest, 0, Service);
|
||||
|
||||
|
|
@ -949,12 +903,8 @@ int checkifService(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, s
|
|||
BOOL Stay = FALSE;
|
||||
char * ptr, *Context;
|
||||
int i;
|
||||
char TailCopy[256];
|
||||
|
||||
strcpy(TailCopy, CmdTail);
|
||||
|
||||
|
||||
ptr = strtok_s(TailCopy, " ", &Context);
|
||||
ptr = strtok_s(CmdTail, " ", &Context);
|
||||
|
||||
// see if any param. if longer than two chars treat as remote node
|
||||
|
||||
|
|
@ -974,7 +924,7 @@ int checkifService(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, s
|
|||
{
|
||||
if (strcmp(APPName, SERVICES[i].ServiceName) == 0)
|
||||
{
|
||||
ConnecttoService(Session, Bufferptr, SERVICES[i].ServiceNo, ptr, Stay);
|
||||
ConnecttoService(Session, Bufferptr, i, ptr, Stay);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -992,6 +942,7 @@ VOID APPLCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct
|
|||
char * ptr1, *ptr2;
|
||||
int n = 12;
|
||||
BOOL Stay = FALSE;
|
||||
char * ptr, *Context;
|
||||
|
||||
// Copy Appl and Null Terminate
|
||||
|
||||
|
|
@ -1010,17 +961,14 @@ VOID APPLCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct
|
|||
return;
|
||||
}
|
||||
|
||||
ptr = strtok_s(CmdTail, " ", &Context);
|
||||
|
||||
if (CmdTail[0] == 'S')
|
||||
Stay = TRUE;
|
||||
// ptr is first param. Context is rest of string;
|
||||
|
||||
// could be Node for NETROMX connect or S flag
|
||||
|
||||
// We now use service@node, so can't get here
|
||||
|
||||
/*
|
||||
if (ptr)
|
||||
{
|
||||
// could be Node for NETROMX connect or S flag
|
||||
|
||||
int i;
|
||||
|
||||
if (strlen(ptr) > 1)
|
||||
|
|
@ -1030,8 +978,6 @@ VOID APPLCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct
|
|||
|
||||
// See if APPL is one of Paula's service
|
||||
|
||||
|
||||
|
||||
for (i = 0; i < NUMBEROFSSERVICES; i++)
|
||||
{
|
||||
if (strcmp(APPName, SERVICES[i].ServiceName) == 0)
|
||||
|
|
@ -1051,7 +997,7 @@ VOID APPLCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct
|
|||
else if (ptr[0] == 'S')
|
||||
Session->STAYFLAG = Stay;
|
||||
}
|
||||
*/
|
||||
|
||||
memcpy(Session->APPL, CMD->String, 12);
|
||||
|
||||
// SEE IF THERE IS AN ALIAS DEFINDED FOR THIS COMMAND
|
||||
|
|
@ -1942,13 +1888,9 @@ char * DisplayRoute(TRANSPORTENTRY * Session, char * Bufferptr, struct ROUTE *
|
|||
double srtt = Routes->SRTT/100.0;
|
||||
double nsrtt = Routes->NeighbourSRTT/100.0;
|
||||
|
||||
Bufferptr = Cmdprintf(Session, Bufferptr, " %4.2fs %4.2fs %X", srtt, nsrtt, Routes->Status);
|
||||
Bufferptr = Cmdprintf(Session, Bufferptr, " %4.2fs %4.2fs", srtt, nsrtt);
|
||||
}
|
||||
|
||||
if (Routes->TCPPort)
|
||||
Bufferptr = Cmdprintf(Session, Bufferptr, " %d", Routes->localport);
|
||||
|
||||
|
||||
Bufferptr = Cmdprintf(Session, Bufferptr, "\r");
|
||||
}
|
||||
else
|
||||
|
|
@ -2624,56 +2566,6 @@ VOID CMDC00(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct C
|
|||
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);
|
||||
|
||||
if (Port)
|
||||
|
|
@ -2773,7 +2665,7 @@ NoPort:
|
|||
|
||||
// SEE IF CALL TO ANY OF OUR HOST SESSIONS - UNLESS DIGIS SPECIFIED
|
||||
|
||||
if (axcalls[7] == 0)
|
||||
if (axcalls[7] == 0 && axcalls[9] )
|
||||
{
|
||||
// If this connect is as a result of a command alias, don't check appls or we will loop
|
||||
|
||||
|
|
@ -2824,7 +2716,28 @@ NoPort:
|
|||
}
|
||||
}
|
||||
|
||||
if (axcalls[7] == 0)
|
||||
// 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)
|
||||
{
|
||||
// SEE IF CALL TO ANOTHER NODE
|
||||
|
||||
|
|
@ -2867,6 +2780,9 @@ Downlink:
|
|||
// L2 NEEDS PORT NUMBER
|
||||
|
||||
Bufferptr = Cmdprintf(Session, Bufferptr, "Downlink connect needs port number - C P CALLSIGN\r");
|
||||
|
||||
// Send Port List
|
||||
|
||||
SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER));
|
||||
return;
|
||||
}
|
||||
|
|
@ -3342,7 +3258,7 @@ char * DoOneNode(TRANSPORTENTRY * Session, char * Bufferptr, struct DEST_LIST *
|
|||
|
||||
if (Neighbour)
|
||||
{
|
||||
double srtt = Route->STT/100.0;
|
||||
double srtt = Route->SRTT/100.0;
|
||||
|
||||
len = ConvFromAX25(Neighbour->NEIGHBOUR_CALL, Normcall);
|
||||
Normcall[len] = 0;
|
||||
|
|
@ -3362,7 +3278,7 @@ int DoViaEntry(struct DEST_LIST * Dest, int n, char * line, int cursor)
|
|||
char Portcall[10];
|
||||
int len;
|
||||
|
||||
if (Dest->NRROUTE[n].ROUT_NEIGHBOUR != 0)
|
||||
if (Dest->NRROUTE[n].ROUT_NEIGHBOUR != 0 && Dest->NRROUTE[n].ROUT_NEIGHBOUR->INP3Node == 0)
|
||||
{
|
||||
len=ConvFromAX25(Dest->NRROUTE[n].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Portcall);
|
||||
Portcall[len]=0;
|
||||
|
|
@ -3391,7 +3307,7 @@ int DoINP3ViaEntry(struct DEST_LIST * Dest, int n, char * line, int cursor)
|
|||
|
||||
if (Dest->INP3ROUTE[n].ROUT_NEIGHBOUR != 0)
|
||||
{
|
||||
srtt = Dest->INP3ROUTE[n].STT/100.0;
|
||||
srtt = Dest->INP3ROUTE[n].SRTT/100.0;
|
||||
|
||||
len=ConvFromAX25(Dest->INP3ROUTE[n].ROUT_NEIGHBOUR->NEIGHBOUR_CALL, Portcall);
|
||||
Portcall[len]=0;
|
||||
|
|
@ -4665,7 +4581,6 @@ struct CMDX COMMANDS[] =
|
|||
"RESTARTTNC ",10,&RESTARTTNC,0,
|
||||
"POLLNODES ",8, &POLLNODES,0,
|
||||
"SENDNODES ",8, &SENDNODES,0,
|
||||
"SENDRIF ",7, &SENDRIF,0,
|
||||
"EXTRESTART ",10, EXTPORTVAL, offsetof(EXTPORTDATA, EXTRESTART),
|
||||
"TXDELAY ",3, PORTVAL, offsetof(PORTCONTROLX, PORTTXDELAY),
|
||||
"MAXFRAME ",3, PORTVAL, offsetof(PORTCONTROLX, PORTWINDOW),
|
||||
|
|
@ -4723,7 +4638,6 @@ struct CMDX COMMANDS[] =
|
|||
"L4WINDOW ",6,SWITCHVAL,(size_t)&L4DEFAULTWINDOW,
|
||||
"BTINTERVAL ",5,SWITCHVAL,(size_t)&BTINTERVAL,
|
||||
"DEBUGINP3 ",8,SWITCHVAL,(size_t)&DEBUGINP3,
|
||||
"RIFINTERVAL ",11,SWITCHVALW,(size_t)&RIFInterval,
|
||||
"MAXHOPS ",7,SWITCHVAL,(size_t)&MaxHops,
|
||||
"PREFERINP3 ",10,SWITCHVAL,(size_t)&PREFERINP3ROUTES,
|
||||
"MAXRTT ",6,SWITCHVALW,(size_t)&MAXRTT,
|
||||
|
|
@ -5156,7 +5070,6 @@ VOID DoTheCommand(TRANSPORTENTRY * Session)
|
|||
int n;
|
||||
int i, Service = -1;
|
||||
char * Cmd, *Node, *Context;
|
||||
int Stay = 0;
|
||||
|
||||
ptr1 = &COMMANDBUFFER[0]; //
|
||||
|
||||
|
|
@ -5251,47 +5164,28 @@ VOID DoTheCommand(TRANSPORTENTRY * Session)
|
|||
|
||||
// See if a NETROMX Service
|
||||
|
||||
// We now use service@node, unlike xr
|
||||
|
||||
if (strchr(ptr1, '@'))
|
||||
{
|
||||
Cmd = strtok_s(ptr1, "@", &Context);
|
||||
Cmd = strtok_s(ptr1, " ", &Context);
|
||||
Node = strtok_s(NULL, " ", &Context);
|
||||
|
||||
if (Cmd && Node)
|
||||
{
|
||||
if (Context && Context[0] == 'S')
|
||||
Session->STAYFLAG = Stay;
|
||||
|
||||
for (i = 0; i < NUMBEROFSSERVICES; i++)
|
||||
{
|
||||
if (strcmp(Cmd, SERVICES[i].ServiceName) == 0)
|
||||
{
|
||||
ConnecttoService(Session, ReplyPointer, SERVICES[i].ServiceNo, Node, Stay);
|
||||
return;
|
||||
}
|
||||
}
|
||||
int Stay = 0;
|
||||
|
||||
// May be numeric service
|
||||
if (Context && Context[0] == 'S')
|
||||
Session->STAYFLAG = Stay;
|
||||
|
||||
for (i = 0; i < strlen(Cmd); i++)
|
||||
if (Node)
|
||||
{
|
||||
if (!isdigit(Cmd[i]))
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == strlen(Cmd))
|
||||
{
|
||||
ConnecttoService(Session, ReplyPointer, atoi(Cmd), Node, Stay);
|
||||
ConnecttoService(Session, ReplyPointer, i, Node, Stay);
|
||||
return;
|
||||
}
|
||||
|
||||
// Connecting to service on local node - msy be possible sometime
|
||||
}
|
||||
}
|
||||
|
||||
ReplyPointer = Cmdprintf(Session, ReplyPointer, "Invalid NetromX command\r");
|
||||
SendCommandReply(Session, REPLYBUFFER, (int)(ReplyPointer - (char *)REPLYBUFFER));
|
||||
return;
|
||||
|
||||
}
|
||||
Session->BADCOMMANDS++;
|
||||
|
||||
if (Session->BADCOMMANDS > 6) // TOO MANY ERRORS
|
||||
|
|
@ -5308,11 +5202,11 @@ VOID DoTheCommand(TRANSPORTENTRY * Session)
|
|||
ptr1 += CMDERRLEN;
|
||||
|
||||
SendCommandReply(Session, Buffer, (int)(ptr1 - (char *)Buffer));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
VOID StatsTimer()
|
||||
{
|
||||
VOID StatsTimer()
|
||||
{
|
||||
struct PORTCONTROL * PORT = PORTTABLE;
|
||||
uint64_t sum, sum2;
|
||||
|
||||
|
|
|
|||
18
CommonCode.c
18
CommonCode.c
|
|
@ -75,8 +75,6 @@ void printStack(void);
|
|||
char * FormatMH(PMHSTRUC MH, char Format);
|
||||
void WriteConnectLog(char * fromCall, char * toCall, UCHAR * Mode);
|
||||
void SendDataToPktMap();
|
||||
void NETROMTCPResolve();
|
||||
VOID FindLostBuffers();
|
||||
|
||||
extern BOOL LogAllConnects;
|
||||
extern BOOL M0LTEMap;
|
||||
|
|
@ -566,15 +564,6 @@ VOID * _GetBuff(char * File, int Line)
|
|||
Msg->Linkptr = NULL;
|
||||
Msg->Padding[0] = 0; // Used for modem status info
|
||||
}
|
||||
else if (QCOUNT != 0)
|
||||
{
|
||||
// Queue must be corrupt
|
||||
|
||||
Debugprintf("Fatal - Getbuff returned NULL and Q not empty - exit");
|
||||
FindLostBuffers();
|
||||
WriteMiniDump();
|
||||
Restart();
|
||||
}
|
||||
else
|
||||
Debugprintf("Warning - Getbuff returned NULL");
|
||||
|
||||
|
|
@ -3751,13 +3740,14 @@ VOID ResolveUpdateThread(void * Unused)
|
|||
}
|
||||
}
|
||||
|
||||
NETROMTCPResolve();
|
||||
|
||||
if (HostEnt1 && HostEnt2)
|
||||
{
|
||||
Sleep(1000 * 60 * 15);
|
||||
Sleep(1000 * 60 * 30);
|
||||
continue;
|
||||
}
|
||||
|
||||
Debugprintf("Resolve Failed for update.g8bpq.net or chatmap.g8bpq.net");
|
||||
Sleep(1000 * 60 * 5);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
1
DRATS.c
1
DRATS.c
|
|
@ -578,7 +578,6 @@ int doinflate(unsigned char * source, unsigned char * dest, int Len, int destlen
|
|||
strm.next_in = Z_NULL;
|
||||
|
||||
ret = inflateInit(&strm);
|
||||
|
||||
if (ret != Z_OK)
|
||||
return ret;
|
||||
|
||||
|
|
|
|||
267
Events.c
267
Events.c
|
|
@ -26,7 +26,6 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
|||
#include "asmstrucs.h"
|
||||
#include "tncinfo.h"
|
||||
#include "cheaders.h"
|
||||
#include "kiss.h"
|
||||
|
||||
VOID __cdecl Debugprintf(const char * format, ...);
|
||||
|
||||
|
|
@ -45,9 +44,7 @@ void MQTTReportSession(char * Msg);
|
|||
extern int MQTT;
|
||||
extern time_t TimeLoaded;
|
||||
|
||||
uint16_t UDPSeq = 1;
|
||||
int linkSeq = 1;
|
||||
int cctSeq = 1;
|
||||
int UDPSeq = 1;
|
||||
|
||||
extern SOCKET NodeAPISocket;
|
||||
extern SOCKADDR_IN UDPreportdest;
|
||||
|
|
@ -60,8 +57,6 @@ extern char LOC[7];
|
|||
extern char VersionString[50];
|
||||
extern double LatFromLOC;
|
||||
extern double LonFromLOC;
|
||||
extern int NUMBEROFNODES, MAXDESTS, L4CONNECTSOUT, L4CONNECTSIN, L4FRAMESTX, L4FRAMESRX, L4FRAMESRETRIED, OLDFRAMES;
|
||||
extern int L2CONNECTSOUT, L2CONNECTSIN;
|
||||
|
||||
void hookL2SessionClosed(struct _LINKTABLE * LINK, char * Reason, char * Direction);
|
||||
int ConvFromAX25(unsigned char * incall, unsigned char * outcall);
|
||||
|
|
@ -71,7 +66,6 @@ int decodeNETROMUIMsg(unsigned char * Msg, int iLen, char * Buffer, int BufferLe
|
|||
int decodeNETROMIFrame(unsigned char * Msg, int iLen, char * Buffer, int BufferLen);
|
||||
int decodeINP3RIF(unsigned char * Msg, int iLen, char * Buffer, int BufferLen);
|
||||
int decodeRecordRoute(L3MESSAGE * L3, int iLen, char * Buffer, int BufferLen);
|
||||
char * byte_base64_encode(char *str, int len);
|
||||
|
||||
// Runs use specified routine on certain event
|
||||
|
||||
|
|
@ -151,12 +145,9 @@ void hookL2SessionAccepted(int Port, char * remotecall, char * ourcall, struct _
|
|||
char UDPMsg[1024];
|
||||
int udplen;
|
||||
|
||||
L2CONNECTSIN++;
|
||||
LINK->apiSeq = linkSeq++;
|
||||
|
||||
LINK->lastStatusSentTime = LINK->ConnectTime = time(NULL);
|
||||
LINK->ConnectTime = time(NULL);
|
||||
LINK->bytesTXed = LINK->bytesRXed = LINK->framesResent = LINK->framesRXed = LINK->framesTXed = 0;
|
||||
LINK->LastStatusbytesTXed = LINK->LastStatusbytesRXed = 0;
|
||||
|
||||
strcpy(LINK->callingCall, remotecall);
|
||||
strcpy(LINK->receivingCall, ourcall);
|
||||
strcpy(LINK->Direction, "In");
|
||||
|
|
@ -165,8 +156,8 @@ void hookL2SessionAccepted(int Port, char * remotecall, char * ourcall, struct _
|
|||
{
|
||||
LINK->lastStatusSentTime = time(NULL);
|
||||
|
||||
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\", \"isRF\": %s}",
|
||||
NODECALLLOPPED, LINK->apiSeq, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall, (LINK->LINKPORT->isRF)?"true":"false");
|
||||
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\"}",
|
||||
NODECALLLOPPED, UDPSeq++, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall);
|
||||
|
||||
// Debugprintf(UDPMsg);
|
||||
|
||||
|
|
@ -226,9 +217,9 @@ void hookL2SessionDeleted(struct _LINKTABLE * LINK)
|
|||
|
||||
void hookL2SessionAttempt(int Port, char * ourcall, char * remotecall, struct _LINKTABLE * LINK)
|
||||
{
|
||||
LINK->lastStatusSentTime = LINK->ConnectTime = time(NULL);
|
||||
LINK->ConnectTime = time(NULL);
|
||||
LINK->bytesTXed = LINK->bytesRXed = LINK->framesResent = LINK->framesRXed = LINK->framesTXed = 0;
|
||||
LINK->LastStatusbytesTXed = LINK->LastStatusbytesRXed = 0;
|
||||
|
||||
strcpy(LINK->callingCall, ourcall);
|
||||
strcpy(LINK->receivingCall, remotecall);
|
||||
strcpy(LINK->Direction, "Out");
|
||||
|
|
@ -241,15 +232,12 @@ void hookL2SessionConnected(struct _LINKTABLE * LINK)
|
|||
char UDPMsg[1024];
|
||||
int udplen;
|
||||
|
||||
L2CONNECTSOUT++;
|
||||
LINK->apiSeq = linkSeq++;
|
||||
|
||||
if (NodeAPISocket)
|
||||
{
|
||||
LINK->lastStatusSentTime = time(NULL);
|
||||
|
||||
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\", \"isRF\": %s}",
|
||||
NODECALLLOPPED, LINK->apiSeq, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall, (LINK->LINKPORT->isRF)?"true":"false");
|
||||
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\"}",
|
||||
NODECALLLOPPED, UDPSeq++, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall);
|
||||
|
||||
// Debugprintf(UDPMsg);
|
||||
|
||||
|
|
@ -263,7 +251,6 @@ void hookL2SessionClosed(struct _LINKTABLE * LINK, char * Reason, char * Directi
|
|||
|
||||
char UDPMsg[1024];
|
||||
int udplen;
|
||||
time_t Now = time(NULL);
|
||||
|
||||
if (NodeAPISocket)
|
||||
{
|
||||
|
|
@ -272,18 +259,14 @@ void hookL2SessionClosed(struct _LINKTABLE * LINK, char * Reason, char * Directi
|
|||
|
||||
if (strcmp(Direction, "Out") == 0)
|
||||
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkDownEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\","
|
||||
"\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d, \"reason\": \"%s\","
|
||||
" \"time\": %d, \"upForSecs\": %d, \"frmsQdPeak\": %d, \"isRF\": %s}",
|
||||
NODECALLLOPPED, LINK->apiSeq, LINK->LINKPORT->PORTNUMBER, LINK->receivingCall, LINK->callingCall,
|
||||
LINK->bytesTXed , LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, COUNT_AT_L2(LINK), LINK->framesResent, Reason,
|
||||
(int)Now, (int)Now - LINK->ConnectTime, LINK->maxQueued, (LINK->LINKPORT->isRF)?"true":"false");
|
||||
"\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d, \"reason\": \"%s\"}",
|
||||
NODECALLLOPPED, UDPSeq++, LINK->LINKPORT->PORTNUMBER, LINK->receivingCall, LINK->callingCall,
|
||||
LINK->bytesTXed , LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, COUNT_AT_L2(LINK), LINK->framesResent, Reason);
|
||||
else
|
||||
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkDownEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\","
|
||||
"\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d, \"reason\": \"%s\","
|
||||
" \"time\": %d, \"upForSecs\": %d, \"frmsQdPeak\": %d, \"isRF\": %s}",
|
||||
NODECALLLOPPED, LINK->apiSeq, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall,
|
||||
LINK->bytesTXed , LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, COUNT_AT_L2(LINK), LINK->framesResent, Reason,
|
||||
(int)Now, (int)Now - LINK->ConnectTime, LINK->maxQueued, (LINK->LINKPORT->isRF)?"true":"false");
|
||||
"\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d, \"reason\": \"%s\"}",
|
||||
NODECALLLOPPED, UDPSeq++, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall,
|
||||
LINK->bytesTXed , LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, COUNT_AT_L2(LINK), LINK->framesResent, Reason);
|
||||
|
||||
// Debugprintf(UDPMsg);
|
||||
|
||||
|
|
@ -297,37 +280,24 @@ void hookL2SessionStatus(struct _LINKTABLE * LINK)
|
|||
|
||||
char UDPMsg[1024];
|
||||
int udplen;
|
||||
time_t Now = time(NULL);
|
||||
int bpsTx, bpsRx, interval;
|
||||
|
||||
if (NodeAPISocket)
|
||||
{
|
||||
interval = Now - (int)LINK->lastStatusSentTime;
|
||||
bpsTx = (LINK->bytesTXed - LINK->LastStatusbytesTXed) / interval;
|
||||
bpsRx = (LINK->bytesRXed - LINK->LastStatusbytesRXed) / interval;
|
||||
|
||||
LINK->lastStatusSentTime = Now;
|
||||
LINK->LastStatusbytesTXed = LINK->bytesTXed;
|
||||
LINK->LastStatusbytesRXed = LINK->bytesRXed;
|
||||
LINK->lastStatusSentTime = time(NULL);
|
||||
|
||||
if (strcmp(LINK->Direction, "Out") == 0)
|
||||
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkStatus\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\","
|
||||
"\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d,"
|
||||
"\"upForSecs\": %d, \"frmsQdPeak\": %d, \"bpsTxMean\": %d, \"bpsRxMean\": %d, \"frmQMax\": %d, \"l2rttMs\": %d, \"isRF\": %s}",
|
||||
NODECALLLOPPED, LINK->apiSeq, LINK->LINKPORT->PORTNUMBER, LINK->receivingCall, LINK->callingCall,
|
||||
LINK->bytesTXed, LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, 0, LINK->framesResent,
|
||||
(int)Now - LINK->ConnectTime, LINK->maxQueued, bpsTx, bpsRx, LINK->intervalMaxQueued, LINK->RTT, (LINK->LINKPORT->isRF)?"true":"false");
|
||||
"\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d}",
|
||||
NODECALLLOPPED, UDPSeq++, LINK->LINKPORT->PORTNUMBER, LINK->receivingCall, LINK->callingCall,
|
||||
LINK->bytesTXed , LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, 0, LINK->framesResent);
|
||||
else
|
||||
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkStatus\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\","
|
||||
"\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d,"
|
||||
"\"upForSecs\": %d, \"frmsQdPeak\": %d, \"bpsTxMean\": %d, \"bpsRxMean\": %d, \"frmQMax\": %d, \"l2rttMs\": %d, \"isRF\": %s}",
|
||||
NODECALLLOPPED, LINK->apiSeq, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall,
|
||||
LINK->bytesTXed, LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, 0, LINK->framesResent,
|
||||
(int)Now - LINK->ConnectTime, LINK->maxQueued, bpsTx, bpsRx, LINK->intervalMaxQueued, LINK->RTT, (LINK->LINKPORT->isRF)?"true":"false");
|
||||
|
||||
LINK->intervalMaxQueued = 0;
|
||||
"\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d}",
|
||||
NODECALLLOPPED, UDPSeq++, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall,
|
||||
LINK->bytesTXed , LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, COUNT_AT_L2(LINK), LINK->framesResent);
|
||||
|
||||
// Debugprintf(UDPMsg);
|
||||
|
||||
sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest));
|
||||
}
|
||||
}
|
||||
|
|
@ -442,9 +412,8 @@ void hookNodeClosing(char * Reason)
|
|||
|
||||
if (NodeAPISocket)
|
||||
{
|
||||
udplen = sprintf(UDPMsg, "{\"@type\": \"NodeDownEvent\", \"nodeCall\": \"%s\", \"nodeAlias\": \"%s\", \"reason\": \"%s\", \"uptimeSecs\": %d,"
|
||||
"\"linksIn\": %d, \"linksOut\": %d, \"cctsIn\": %d, \"cctsOut\": %d, \"l3Relayed\": %d}",
|
||||
NODECALLLOPPED, MYALIASLOPPED, Reason, time(NULL) - TimeLoaded, L2CONNECTSIN, L2CONNECTSOUT, L4CONNECTSIN, L4CONNECTSOUT, L3FRAMES);
|
||||
udplen = sprintf(UDPMsg, "{\"@type\": \"NodeDownEvent\", \"nodeCall\": \"%s\", \"nodeAlias\": \"%s\", \"reason\": \"%s\"}",
|
||||
NODECALLLOPPED, MYALIASLOPPED, Reason);
|
||||
|
||||
// Debugprintf(UDPMsg);
|
||||
|
||||
|
|
@ -469,10 +438,9 @@ void hookNodeRunning()
|
|||
{
|
||||
|
||||
udplen = sprintf(UDPMsg, "{\"@type\": \"NodeStatus\", \"nodeCall\": \"%s\", \"nodeAlias\": \"%s\", \"locator\": \"%s\","
|
||||
"\"latitude\": %f, \"longitude\": %f, \"software\": \"%s\", \"version\": \"%s\", \"uptimeSecs\": %d,"
|
||||
"\"linksIn\": %d, \"linksOut\": %d, \"cctsIn\": %d, \"cctsOut\": %d, \"l3Relayed\": %d}",
|
||||
NODECALLLOPPED, MYALIASLOPPED, LOC, LatFromLOC, LonFromLOC, Software, VersionString, time(NULL) - TimeLoaded,
|
||||
L2CONNECTSIN, L2CONNECTSOUT, L4CONNECTSIN, L4CONNECTSOUT, L3FRAMES);
|
||||
"\"latitude\": %f, \"longitude\": %f, \"software\": \"%s\", \"version\": \"%s\", \"uptimeSecs\": %d}",
|
||||
NODECALLLOPPED, MYALIASLOPPED, LOC, LatFromLOC, LonFromLOC, Software, VersionString, time(NULL) - TimeLoaded);
|
||||
|
||||
|
||||
// Debugprintf(UDPMsg);
|
||||
|
||||
|
|
@ -488,17 +456,11 @@ void IncomingL4ConnectionEvent(TRANSPORTENTRY * L4)
|
|||
char remotecall[64];
|
||||
char ourcall[64];
|
||||
char circuitinfo[32];
|
||||
int Service = L4->Service;
|
||||
|
||||
// CACK sent to CREQ
|
||||
|
||||
L4->apiSeq = cctSeq++;
|
||||
strcpy(L4->Direction, "incoming");
|
||||
|
||||
if (NodeAPISocket)
|
||||
{
|
||||
L4->lastStatusSentTime = time(NULL);
|
||||
|
||||
remotecall[ConvFromAX25(L4->L4TARGET.DEST->DEST_CALL, remotecall)] = 0;
|
||||
// remotecall[ConvFromAX25(L4->L4USER, remotecall)] = 0;
|
||||
ourcall[ConvFromAX25(L4->L4MYCALL, ourcall)] = 0;
|
||||
|
|
@ -509,15 +471,9 @@ void IncomingL4ConnectionEvent(TRANSPORTENTRY * L4)
|
|||
sprintf(circuitinfo, ":%02x%02x", L4->CIRCUITINDEX, L4->CIRCUITID);
|
||||
strcat(ourcall, circuitinfo);
|
||||
|
||||
if (Service == -1)
|
||||
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", "
|
||||
"\"remote\": \"%s\", \"local\": \"%s\"}",
|
||||
NODECALLLOPPED, L4->apiSeq, remotecall, ourcall);
|
||||
else
|
||||
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", "
|
||||
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\","
|
||||
"\"service\": %d, \"remote\": \"%s\", \"local\": \"%s\"}",
|
||||
NODECALLLOPPED, L4->apiSeq, Service, remotecall, ourcall);
|
||||
|
||||
NODECALLLOPPED, UDPSeq++, L4->Service, remotecall, ourcall);
|
||||
|
||||
// Debugprintf(UDPMsg);
|
||||
sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest));
|
||||
|
|
@ -532,18 +488,11 @@ void OutgoingL4ConnectionEvent(TRANSPORTENTRY * L4)
|
|||
char remotecall[64];
|
||||
char ourcall[64];
|
||||
char circuitinfo[32];
|
||||
int Service = L4->Service;
|
||||
|
||||
// CACK received
|
||||
|
||||
strcpy(L4->Direction, "outgoing");
|
||||
|
||||
L4->apiSeq = cctSeq++;
|
||||
|
||||
if (NodeAPISocket)
|
||||
{
|
||||
L4->lastStatusSentTime = time(NULL);
|
||||
|
||||
remotecall[ConvFromAX25(L4->L4TARGET.DEST->DEST_CALL, remotecall)] = 0;
|
||||
// remotecall[ConvFromAX25(L4->L4USER, remotecall)] = 0;
|
||||
ourcall[ConvFromAX25(L4->L4MYCALL, ourcall)] = 0;
|
||||
|
|
@ -554,14 +503,9 @@ void OutgoingL4ConnectionEvent(TRANSPORTENTRY * L4)
|
|||
sprintf(circuitinfo, ":%02x%02x", L4->CIRCUITID, L4->CIRCUITINDEX);
|
||||
strcat(ourcall, circuitinfo);
|
||||
|
||||
if (Service == -1)
|
||||
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", "
|
||||
"\"remote\": \"%s\", \"local\": \"%s\"}",
|
||||
NODECALLLOPPED, L4->apiSeq, remotecall, ourcall);
|
||||
else
|
||||
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", "
|
||||
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\","
|
||||
"\"service\": %d, \"remote\": \"%s\", \"local\": \"%s\"}",
|
||||
NODECALLLOPPED, L4->apiSeq, Service, remotecall, ourcall);
|
||||
NODECALLLOPPED, UDPSeq++, L4->Service, remotecall, ourcall);
|
||||
|
||||
// Debugprintf(UDPMsg);
|
||||
sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest));
|
||||
|
|
@ -619,7 +563,7 @@ void L4DisconnectEvent(TRANSPORTENTRY * L4, char * Direction, char * Reason)
|
|||
|
||||
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitDownEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"%s\","
|
||||
"\"service\": %d, \"remote\": \"%s\", \"local\": \"%s\", \"segsSent\": %d, \"segsRcvd\": %d, \"segsResent\": %d, \"segsQueued\": %d, \"reason\": \"%s\"}",
|
||||
NODECALLLOPPED, L4->apiSeq, Direction, 0, remotecall, ourcall,L4->segsSent, L4->segsRcvd, L4->segsResent, Count, Reason);
|
||||
NODECALLLOPPED, UDPSeq++, Direction, 0, remotecall, ourcall,L4->segsSent, L4->segsRcvd, L4->segsResent, Count, Reason);
|
||||
|
||||
// Debugprintf(UDPMsg);
|
||||
sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest));
|
||||
|
|
@ -635,16 +579,11 @@ void L4StatusSeport(TRANSPORTENTRY * L4)
|
|||
char nodecall[16];
|
||||
char circuitinfo[32];
|
||||
int Count;
|
||||
time_t Now = time(NULL);
|
||||
int Service = L4->Service;
|
||||
|
||||
|
||||
|
||||
// Regular Status reports
|
||||
// CACK received
|
||||
|
||||
if (NodeAPISocket)
|
||||
{
|
||||
L4->lastStatusSentTime = Now;
|
||||
nodecall[ConvFromAX25(L4->L4TARGET.DEST->DEST_CALL, nodecall)] = 0;
|
||||
remotecall[ConvFromAX25(L4->L4USER, remotecall)] = 0;
|
||||
ourcall[ConvFromAX25(L4->L4MYCALL, ourcall)] = 0;
|
||||
|
|
@ -661,14 +600,9 @@ void L4StatusSeport(TRANSPORTENTRY * L4)
|
|||
else
|
||||
Count = CountFramesQueuedOnSession(L4);
|
||||
|
||||
if (Service == -1)
|
||||
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitStatus\", \"node\": \"%s\", \"id\": %d, \"direction\": \"%s\","
|
||||
"\"upForSecs\": %d,\"remote\": \"%s\", \"local\": \"%s\", \"segsSent\": %d, \"segsRcvd\": %d, \"segsResent\": %d, \"segsQueued\": %d}",
|
||||
NODECALLLOPPED, L4->apiSeq, L4->Direction, Now - L4->ConnectTime, remotecall, ourcall,L4->segsSent, L4->segsRcvd, L4->segsResent, Count);
|
||||
else
|
||||
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitStatus\", \"node\": \"%s\", \"id\": %d, \"direction\": \"%s\","
|
||||
"\"upForSecs\": %d, \"service\": %d, \"remote\": \"%s\", \"local\": \"%s\", \"segsSent\": %d, \"segsRcvd\": %d, \"segsResent\": %d, \"segsQueued\": %d}",
|
||||
NODECALLLOPPED, L4->apiSeq, L4->Direction, Now - L4->ConnectTime, Service, remotecall, ourcall,L4->segsSent, L4->segsRcvd, L4->segsResent, Count);
|
||||
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitStatus\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\","
|
||||
"\"service\": %d, \"remote\": %s, \"local\": \"%s\", \"segsSent\": %d, \"segsRcvd\": %d, \"segsResent\": %d, \"segsQueued\": %d}",
|
||||
NODECALLLOPPED, UDPSeq++, 0, remotecall, ourcall,L4->segsSent, L4->segsRcvd, L4->segsResent, Count);
|
||||
|
||||
// Debugprintf(UDPMsg);
|
||||
sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest));
|
||||
|
|
@ -699,42 +633,7 @@ char * PIDtoText(int PID)
|
|||
return "?";
|
||||
}
|
||||
|
||||
void dumpDuffPacket(char * call, char * Buffer, int Len)
|
||||
{
|
||||
// log to syslog in base64
|
||||
|
||||
char * Base64;
|
||||
|
||||
Base64 = byte_base64_encode(Buffer, Len);
|
||||
|
||||
Debugprintf("Trace Error %s %s", call, Base64);
|
||||
free(Base64);
|
||||
}
|
||||
|
||||
int checkCall(char * call, unsigned char * Buffer, int Len)
|
||||
{
|
||||
char c;
|
||||
int i;
|
||||
|
||||
// Validate source and dest calls - if duff, dump packet
|
||||
|
||||
for (i = 0; i < strlen(call); i++)
|
||||
{
|
||||
c = call[i];
|
||||
|
||||
if (isalnum(c) || c == '-' || c == '@')
|
||||
continue;
|
||||
|
||||
dumpDuffPacket(call, Buffer, Len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void APIL2Trace(struct _MESSAGE * Message, char * Dirn)
|
||||
void APIL2Trace(struct _MESSAGE * Message, char Dirn)
|
||||
{
|
||||
char UDPMsg[2048];
|
||||
int udplen;
|
||||
|
|
@ -750,12 +649,6 @@ void APIL2Trace(struct _MESSAGE * Message, char * Dirn)
|
|||
int UFlag = 0;
|
||||
int NS;
|
||||
int NR;
|
||||
struct PORTCONTROL * PORT = GetPortTableEntryFromPortNum(Message->PORT);
|
||||
time_t Now = time(NULL);
|
||||
|
||||
|
||||
if (PORT == 0)
|
||||
return;
|
||||
|
||||
if ((Message->ORIGIN[6] & 1) == 0) // Digis
|
||||
return;
|
||||
|
|
@ -763,19 +656,12 @@ void APIL2Trace(struct _MESSAGE * Message, char * Dirn)
|
|||
destcall[ConvFromAX25(Message->DEST, destcall)] = 0;
|
||||
srcecall[ConvFromAX25(Message->ORIGIN, srcecall)] = 0;
|
||||
|
||||
// Validate source and dest calls - if duff, dump packet
|
||||
|
||||
if (!checkCall(destcall,(char *) Message, Message->LENGTH))
|
||||
return;
|
||||
|
||||
if (!checkCall(srcecall, (char *) Message, Message->LENGTH))
|
||||
return;
|
||||
|
||||
// see if any Digis
|
||||
// See if any Digis
|
||||
|
||||
if ((Message->ORIGIN[6] & 1) == 0) // Digis - ignore for now
|
||||
return;
|
||||
|
||||
|
||||
if ((Message->DEST[6] & 0x80) == 0 && (Message->ORIGIN[6] & 0x80) == 0)
|
||||
strcpy(CR, "V1");
|
||||
else if ((Message->DEST[6] & 0x80))
|
||||
|
|
@ -898,9 +784,9 @@ void APIL2Trace(struct _MESSAGE * Message, char * Dirn)
|
|||
// Common to all frame types
|
||||
|
||||
udplen = snprintf(UDPMsg, 2048,
|
||||
"{\"@type\": \"L2Trace\", \"serial\": %d, \"time\": %d, \"dirn\": \"%s\", \"isRF\": %s, \"reportFrom\": \"%s\", \"port\": \"%d\", \"srce\": \"%s\", \"dest\": \"%s\", \"ctrl\": %d,"
|
||||
"\"l2Type\": \"%s\", \"modulo\": 8, \"cr\": \"%s\"",
|
||||
UDPSeq++, (int)Now, Dirn, (PORT->isRF)?"true":"false", NODECALLLOPPED, Message->PORT, srcecall, destcall, Message->CTL, Type, CR);
|
||||
"{\"@type\": \"L2Trace\", \"reportFrom\": \"%s\", \"port\": \"%d\", \"srce\": \"%s\", \"dest\": \"%s\", \"ctrl\": %d,"
|
||||
"\"l2type\": \"%s\", \"modulo\": 8, \"cr\": \"%s\"",
|
||||
NODECALLLOPPED, Message->PORT, srcecall, destcall, Message->CTL, Type, CR);
|
||||
|
||||
if (UIFlag)
|
||||
{
|
||||
|
|
@ -944,9 +830,9 @@ void APIL2Trace(struct _MESSAGE * Message, char * Dirn)
|
|||
// supervisory
|
||||
|
||||
if (PF[0])
|
||||
udplen += snprintf(&UDPMsg[udplen], 2048 - udplen, ", \"pf\": \"%s\", \"rseq\": %d", PF, NR);
|
||||
udplen += snprintf(&UDPMsg[udplen], 2048 - udplen, ", \"pf\": \"%s\", \"rseq\": %d, \"tseq\": %d", PF, NR, NS);
|
||||
else
|
||||
udplen += snprintf(&UDPMsg[udplen], 2048 - udplen, ", \"rseq\": %d", NR);
|
||||
udplen += snprintf(&UDPMsg[udplen], 2048 - udplen, ", \"rseq\": %d, \"tseq\": %d", NR, NS);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -958,48 +844,6 @@ void APIL2Trace(struct _MESSAGE * Message, char * Dirn)
|
|||
}
|
||||
|
||||
|
||||
//"@type" = @L3Trace, reportFrom, time, dirn,
|
||||
|
||||
void NetromTCPTrace(struct _MESSAGE * Message, char * Dirn)
|
||||
{
|
||||
char UDPMsg[2048];
|
||||
int udplen;
|
||||
time_t Now = time(NULL);
|
||||
int iLen = Message->LENGTH - (15 + MSGHDDRLEN);
|
||||
int isRF = 0;
|
||||
|
||||
|
||||
udplen = snprintf(UDPMsg, 2048,
|
||||
"{\"@type\": \"L3Trace\", \"serial\": %d, \"time\": %d, \"dirn\": \"%s\", \"isRF\": %s, \"reportFrom\": \"%s\", \"port\": %d",
|
||||
UDPSeq++, (int)Now, Dirn, (isRF)?"true":"false", NODECALLLOPPED, Message->PORT);
|
||||
|
||||
|
||||
udplen += snprintf(&UDPMsg[udplen], 2048 - udplen,
|
||||
", \"ilen\": %d, \"pid\": %d, \"ptcl\": \"%s\"",
|
||||
iLen, Message->PID, PIDtoText(Message->PID));
|
||||
|
||||
if (Message->PID == NETROM_PID)
|
||||
{
|
||||
int n = decodeNETROMIFrame(Message->L2DATA, iLen, &UDPMsg[udplen], 2048 - udplen);
|
||||
|
||||
if (n == 0)
|
||||
return; // Can't decode so don't trace anything;
|
||||
|
||||
udplen += n;
|
||||
}
|
||||
|
||||
|
||||
|
||||
UDPMsg[udplen++] = '}';
|
||||
UDPMsg[udplen] = 0;
|
||||
// Debugprintf(UDPMsg);
|
||||
sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int decodeNETROMUIMsg(unsigned char * Msg, int iLen, char * Buffer, int BufferLen)
|
||||
{
|
||||
int Len = 0;
|
||||
|
|
@ -1026,7 +870,7 @@ int decodeNETROMUIMsg(unsigned char * Msg, int iLen, char * Buffer, int BufferLe
|
|||
|
||||
Msg += 7; // to first field
|
||||
|
||||
Len = snprintf(Buffer, BufferLen, ", \"l3Type\": \"Routing info\", \"type\": \"NODES\", \"fromAlias\": \"%s\", \"nodes\": [", Alias);
|
||||
Len = snprintf(Buffer, BufferLen, ", \"l3Type\": \"Routing info\", \"type\": \"NODES\", \"nodes\": [");
|
||||
|
||||
iLen -= 7; //Header, mnemonic and signature length
|
||||
|
||||
|
|
@ -1077,13 +921,6 @@ int decodeNETROMIFrame(unsigned char * Msg, int iLen, char * Buffer, int BufferL
|
|||
destcall[ConvFromAX25(L3MSG->L3DEST, destcall)] = 0;
|
||||
srcecall[ConvFromAX25(L3MSG->L3SRCE, srcecall)] = 0;
|
||||
|
||||
if (!checkCall(destcall, Msg, iLen))
|
||||
return 0;
|
||||
|
||||
if (!checkCall(srcecall, Msg, iLen))
|
||||
return 0;
|
||||
|
||||
|
||||
if (strcmp(destcall, "KEEPLI") == 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -1118,14 +955,6 @@ int decodeNETROMIFrame(unsigned char * Msg, int iLen, char * Buffer, int BufferL
|
|||
srcUser[ConvFromAX25(&L3MSG->L4DATA[1], srcUser)] = 0;
|
||||
srcNode[ConvFromAX25(&L3MSG->L4DATA[8], srcNode)] = 0;
|
||||
|
||||
if (!checkCall(srcUser, Msg, iLen))
|
||||
return 0;
|
||||
|
||||
|
||||
if (!checkCall(srcNode, Msg, iLen))
|
||||
return 0;
|
||||
|
||||
|
||||
if (netromx)
|
||||
Len += snprintf(&Buffer[Len], BufferLen - Len, ", \"l4Type\": \"CONN REQX\", \"fromCct\": %d, \"srcUser\": \"%s\", \"srcNode\": \"%s\", \"window\": %d, \"service\": %d",
|
||||
(L3MSG->L4INDEX << 8) | L3MSG->L4ID, srcUser, srcNode, L3MSG->L4DATA[0], service);
|
||||
|
|
@ -1140,7 +969,7 @@ int decodeNETROMIFrame(unsigned char * Msg, int iLen, char * Buffer, int BufferL
|
|||
// Can be ACK or NACK depending on Choke flag
|
||||
|
||||
if (L3MSG->L4FLAGS & L4BUSY)
|
||||
Len += snprintf(&Buffer[Len], BufferLen - Len, ", \"l4Type\": \"CONN NAK\", \"toCct\": %d",
|
||||
Len += snprintf(&Buffer[Len], BufferLen - Len, ", \"l4Type\": \"CONN NACK\", \"toCct\": %d",
|
||||
(L3MSG->L4INDEX << 8) | L3MSG->L4ID);
|
||||
else
|
||||
Len += snprintf(&Buffer[Len], BufferLen - Len, ", \"l4Type\": \"CONN ACK\", \"toCct\": %d, \"fromCct\": %d, \"accWin\": %d",
|
||||
|
|
@ -1244,7 +1073,7 @@ int decodeRecordRoute(L3MESSAGE * L3, int iLen, char * Buffer, int BufferLen)
|
|||
Len += snprintf(&Buffer[Len], BufferLen - Len, ", \"l4Type\": \"NRR Request\", \"nrrId\": %d, \"nrrRoute\": \"%s\"",
|
||||
(L3->L4TXNO << 8) | L3->L4RXNO, callList);
|
||||
|
||||
// Debugprintf(Buffer);
|
||||
Debugprintf(Buffer);
|
||||
|
||||
return Len;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4187,7 +4187,7 @@ static BOOL RestartTNC(struct TNCINFO * TNC)
|
|||
SOCKET sock = socket(AF_INET,SOCK_DGRAM,0);
|
||||
struct sockaddr_in destaddr;
|
||||
|
||||
// Debugprintf("trying to restart TNC %s", TNC->ProgramPath);
|
||||
Debugprintf("trying to restart TNC %s", TNC->ProgramPath);
|
||||
|
||||
if (sock == INVALID_SOCKET)
|
||||
return 0;
|
||||
|
|
@ -4210,7 +4210,7 @@ static BOOL RestartTNC(struct TNCINFO * TNC)
|
|||
|
||||
n = sendto(sock, TNC->ProgramPath, (int)strlen(TNC->ProgramPath), 0, (struct sockaddr *)&destaddr, sizeof(destaddr));
|
||||
|
||||
// Debugprintf("Restart TNC - sendto returned %d", n);
|
||||
Debugprintf("Restart TNC - sendto returned %d", n);
|
||||
|
||||
Sleep(100);
|
||||
closesocket(sock);
|
||||
|
|
|
|||
59
HTTPcode.c
59
HTTPcode.c
|
|
@ -147,15 +147,9 @@ char IndexNoAPRS[] = "<meta http-equiv=\"refresh\" content=\"0;url=/Node/NodeInd
|
|||
char Tail[] = "</body></html>";
|
||||
|
||||
char RouteHddr[] = "<h2 align=center>Routes</h2><table align=center border=2 style=font-family:monospace bgcolor=white>"
|
||||
"<tr><th>Port</th><th>Call</th><th>Quality</th><th>Node Count</th><th>Frame Count</th><th>Retries</th><th>Percent</th><th>Maxframe</th>"
|
||||
"<th>Frack</th><th>Last Heard</th><th>Queued</th><th>Rem Qual</th><th>SRTT</th><th>Rem SRTT</th></tr>";
|
||||
|
||||
char RouteLine[] = "<tr><td>%s%d</td><td>%s%s</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d%</td><td>%d</td><td>%d</td>"
|
||||
"<td>%02d:%02d<td>%d</td><td>%d</td></td><td></td><td></td></tr>";
|
||||
|
||||
char RouteLineINP3[] = "<tr><td>%s%d</td><td>%s%s</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d%</td><td>%d</td><td>%d</td>"
|
||||
"<td>%02d:%02d</td><td>%d</td><td>%d</td><td>%4.2fs</td><td>%4.2fs</td></tr>";
|
||||
"<tr><th>Port</th><th>Call</th><th>Quality</th><th>Node Count</th><th>Frame Count</th><th>Retries</th><th>Percent</th><th>Maxframe</th><th>Frack</th><th>Last Heard</th><th>Queued</th><th>Rem Qual</th></tr>";
|
||||
|
||||
char RouteLine[] = "<tr><td>%s%d</td><td>%s%s</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d%</td><td>%d</td><td>%d</td><td>%02d:%02d</td><td>%d</td><td>%d</td></tr>";
|
||||
char xNodeHddr[] = "<align=center><form align=center method=get action=/Node/Nodes.html>"
|
||||
"<table align=center bgcolor=white>"
|
||||
"<tr><td><input type=submit class='btn' name=a value=\"Nodes Sorted by Alias\"></td><td>"
|
||||
|
|
@ -1396,23 +1390,23 @@ int SetupNodeMenu(char * Buff, int LOCAL)
|
|||
char SigninBit[] = "<td><a href=/Node/Signon.html>SYSOP Signin</a></td>";
|
||||
|
||||
char NodeTail[] =
|
||||
"<td><a href=/Node/EditCfg.html>Edit Config</a></td>\
|
||||
<td><div onmouseover=myShow() class='dropdown'>\
|
||||
<button class=\"dropbtn\">View Logs</button>\
|
||||
<div id=\"myDropdown\" class=\"dropdown-content\">\
|
||||
<form id = doDate form action='/node/ShowLog.html'><label>\
|
||||
Select Date: <input type='date' name='date' id=e>\
|
||||
<script>\
|
||||
document.getElementById('e').value = new Date().toISOString().substring(0, 10);\
|
||||
</script></label>\
|
||||
<input type=submit class='btn' name='BBS' value='BBS Log'></br>\
|
||||
<input type=submit class='btn' name='Debug' value='BBS Debug Log'></br>\
|
||||
<input type=submit class='btn' name='Telnet' value='Telnet Log'></br>\
|
||||
<input type=submit class='btn' name='CMS' value='CMS Log'></br>\
|
||||
<input type=submit class='btn' name='Chat' value='Chat Log'></br>\
|
||||
</form></div>\
|
||||
</div>\
|
||||
</td></tr></table>";
|
||||
"<td><a href=/Node/EditCfg.html>Edit Config</a></td>"
|
||||
"<td><div onmouseover=myShow() class='dropdown'>"
|
||||
"<button class=\"dropbtn\">View Logs</button>"
|
||||
"<div id=\"myDropdown\" class=\"dropdown-content\">"
|
||||
"<form id = doDate form action='/node/ShowLog.html'><label>"
|
||||
"Select Date: <input type='date' name='date' id=e>"
|
||||
"<script>"
|
||||
"document.getElementById('e').value = new Date().toISOString().substring(0, 10);"
|
||||
"</script></label>"
|
||||
"<input type=submit class='btn' name='BBS' value='BBS Log'></br>"
|
||||
"<input type=submit class='btn' name='Debug' value='BBS Debug Log'></br>"
|
||||
"<input type=submit class='btn' name='Telnet' value='Telnet Log'></br>"
|
||||
"<input type=submit class='btn' name='CMS' value='CMS Log'></br>"
|
||||
"<input type=submit class='btn' name='Chat' value='Chat Log'></br>"
|
||||
"</form></div>"
|
||||
"</div>"
|
||||
"</td></tr></table>";
|
||||
|
||||
|
||||
Len = sprintf(Buff, NodeMenuHeader, Mycall);
|
||||
|
|
@ -1566,9 +1560,10 @@ VOID SaveConfigFile(SOCKET sock , char * MsgPtr, char * Rest, int LOCAL)
|
|||
}
|
||||
|
||||
ReplyLen = sprintf(Reply, "<html><script>alert(\"%s\");window.close();</script></html>", Mess);
|
||||
HeaderLen = sprintf(Header, "HTTP/1.1 200 OK\r\nContent-Length: %d\r\nContent-Type: text/html\r\n\r\n", ReplyLen);
|
||||
HeaderLen = sprintf(Header, "HTTP/1.1 200 OK\r\nContent-Length: %d\r\nContent-Type: text/html\r\n\r\n", ReplyLen + (int)strlen(Tail));
|
||||
send(sock, Header, HeaderLen, 0);
|
||||
send(sock, Reply, ReplyLen, 0);
|
||||
send(sock, Tail, (int)strlen(Tail), 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -3947,22 +3942,10 @@ doHeader:
|
|||
else
|
||||
Percent = 0;
|
||||
|
||||
if (Routes->INP3Node) // INP3 Enabled?
|
||||
{
|
||||
double srtt = Routes->SRTT/100.0;
|
||||
double nsrtt = Routes->NeighbourSRTT/100.0;
|
||||
|
||||
ReplyLen += sprintf(&_REPLYBUFFER[ReplyLen], RouteLineINP3, Active, Routes->NEIGHBOUR_PORT, Normcall, locked,
|
||||
Routes->NEIGHBOUR_QUAL, NodeCount, Iframes, Retries, Percent, Routes->NBOUR_MAXFRAME, Routes->NBOUR_FRACK,
|
||||
Routes->NEIGHBOUR_TIME >> 8, Routes->NEIGHBOUR_TIME & 0xff, Queued, Routes->OtherendsRouteQual, srtt, nsrtt);
|
||||
}
|
||||
else
|
||||
{
|
||||
ReplyLen += sprintf(&_REPLYBUFFER[ReplyLen], RouteLine, Active, Routes->NEIGHBOUR_PORT, Normcall, locked,
|
||||
Routes->NEIGHBOUR_QUAL, NodeCount, Iframes, Retries, Percent, Routes->NBOUR_MAXFRAME, Routes->NBOUR_FRACK,
|
||||
Routes->NEIGHBOUR_TIME >> 8, Routes->NEIGHBOUR_TIME & 0xff, Queued, Routes->OtherendsRouteQual);
|
||||
}
|
||||
}
|
||||
Routes+=1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
|||
|
||||
char * APIENTRY GetBPQDirectory();
|
||||
|
||||
int BBSLogAge = 7;
|
||||
int LogAge = 7;
|
||||
|
||||
BOOL DeletetoRecycleBin = FALSE;
|
||||
BOOL SuppressMaintEmail = FALSE;
|
||||
|
|
@ -61,7 +61,7 @@ struct Override ** LTFROM;
|
|||
struct Override ** LTTO;
|
||||
struct Override ** LTAT;
|
||||
|
||||
int DeleteBBSLogFiles();
|
||||
int DeleteLogFiles();
|
||||
|
||||
VOID SendNonDeliveryMessage(struct MsgInfo * OldMsg, BOOL Forwarded, int Age);
|
||||
int CreateWPMessage();
|
||||
|
|
@ -281,7 +281,7 @@ VOID DoHouseKeeping(BOOL Manual)
|
|||
|
||||
UpdateWP();
|
||||
|
||||
DeleteBBSLogFiles();
|
||||
DeleteLogFiles();
|
||||
|
||||
RemoveKilledMessages();
|
||||
ExpireMessages();
|
||||
|
|
@ -799,7 +799,7 @@ VOID MailHousekeepingResults()
|
|||
|
||||
extern UCHAR LogDirectory[260];
|
||||
|
||||
int DeleteBBSLogFiles()
|
||||
int DeleteLogFiles()
|
||||
{
|
||||
WIN32_FIND_DATA ffd;
|
||||
|
||||
|
|
@ -848,7 +848,7 @@ int DeleteBBSLogFiles()
|
|||
|
||||
Age = (int)((now - ft.LowPart) / 86400);
|
||||
|
||||
if (Age > BBSLogAge)
|
||||
if (Age > LogAge)
|
||||
{
|
||||
sprintf(File, "%s/logs/%s%c", GetLogDirectory(), ffd.cFileName, 0);
|
||||
if (DeletetoRecycleBin)
|
||||
|
|
@ -875,7 +875,7 @@ int Filter(const struct dirent * dir)
|
|||
return memcmp(dir->d_name, "log", 3) == 0 && strstr(dir->d_name, ".txt");
|
||||
}
|
||||
|
||||
int DeleteBBSLogFiles()
|
||||
int DeleteLogFiles()
|
||||
{
|
||||
struct dirent **namelist;
|
||||
int n;
|
||||
|
|
@ -897,7 +897,7 @@ int DeleteBBSLogFiles()
|
|||
{
|
||||
Age = (now - STAT.st_mtime) / 86400;
|
||||
|
||||
if (Age > BBSLogAge)
|
||||
if (Age > LogAge)
|
||||
{
|
||||
printf("Deleting %s\n", FN);
|
||||
unlink(FN);
|
||||
|
|
|
|||
|
|
@ -50,19 +50,6 @@ BEGIN
|
|||
LTEXT "Enable IGate",IDC_STATIC,5,2,49,10
|
||||
END
|
||||
|
||||
CLOSING DIALOG DISCARDABLE 300, 300, 200, 50
|
||||
STYLE DS_3DLOOK | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU |
|
||||
WS_THICKFRAME
|
||||
CAPTION "BPQ32 Close All"
|
||||
CLASS "CLOSING"
|
||||
FONT 8, "Fixedsys"
|
||||
BEGIN
|
||||
LTEXT "Closing Links - Please wait....",IDC_BACKGROUND,22,20,337,273
|
||||
|
||||
END
|
||||
|
||||
|
||||
|
||||
CONFIG DIALOGEX 249, 200, 160, 118
|
||||
STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION
|
||||
EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE
|
||||
|
|
|
|||
72
L2Code.c
72
L2Code.c
|
|
@ -20,9 +20,6 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
|||
//
|
||||
// C replacement for L2Code.asm
|
||||
//
|
||||
|
||||
#define FRMRHACK
|
||||
|
||||
#define Kernel
|
||||
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
|
|
@ -1218,17 +1215,6 @@ VOID L2LINKACTIVE(struct _LINKTABLE * LINK, struct PORTCONTROL * PORT, MESSAGE *
|
|||
LINK->L2STATE = 2;
|
||||
LINK->Ver2point2 = FALSE;
|
||||
LINK->L2TIMER = 1; // Use retry to send SABM
|
||||
LINK->L2RETRIES--; // Make sure at least one is sent
|
||||
|
||||
// if an L3 link mark neighbour as not V2.2
|
||||
|
||||
if (LINK->LINKTYPE == 3)
|
||||
{
|
||||
struct ROUTE * ROUTE = LINK->NEIGHBOUR; // TO NEIGHBOUR
|
||||
|
||||
if (ROUTE)
|
||||
ROUTE->noV2point2 = 1;
|
||||
}
|
||||
|
||||
ReleaseBuffer(Buffer);
|
||||
return;
|
||||
|
|
@ -1915,7 +1901,7 @@ BOOL InternalL2SETUPCROSSLINK(PROUTE ROUTE, int Retries)
|
|||
else
|
||||
LINK->LINKWINDOW = PORT->PORTWINDOW;
|
||||
|
||||
if (SUPPORT2point2 && (ROUTE->noV2point2 == 0))
|
||||
if (SUPPORT2point2)
|
||||
LINK->L2STATE = 1; // Send XID
|
||||
else
|
||||
LINK->L2STATE = 2;
|
||||
|
|
@ -2170,27 +2156,7 @@ VOID L2_PROCESS(struct _LINKTABLE * LINK, struct PORTCONTROL * PORT, MESSAGE * B
|
|||
|
||||
// FRAME REJECT RECEIVED - LOG IT AND RESET LINK
|
||||
|
||||
//#ifdef FRMRHACK
|
||||
|
||||
// Treat as DM and break link
|
||||
|
||||
Debugprintf("BPQ32 FRMR received, disconnecting link");
|
||||
|
||||
InformPartner(LINK, LINKLOST); // SEND DISC TO OTHER END
|
||||
L2SENDCOMMAND(LINK, DM);
|
||||
|
||||
CLEAROUTLINK(LINK);
|
||||
|
||||
if (PORT->TNC && PORT->TNC->Hardware == H_KISSHF)
|
||||
DetachKISSHF(PORT);
|
||||
|
||||
PORT->L2FRMRRX++;
|
||||
|
||||
return;
|
||||
|
||||
//#endif
|
||||
|
||||
/* RESET2(LINK);
|
||||
RESET2(LINK);
|
||||
|
||||
LINK->L2STATE = 2; // INITIALISING
|
||||
LINK->L2ACKREQ = 0; // DONT SEND ANYTHING ELSE
|
||||
|
|
@ -2200,7 +2166,7 @@ VOID L2_PROCESS(struct _LINKTABLE * LINK, struct PORTCONTROL * PORT, MESSAGE * B
|
|||
|
||||
L2SENDCOMMAND(LINK, SABM | PFBIT);
|
||||
return;
|
||||
*/
|
||||
|
||||
default:
|
||||
|
||||
// ANY OTHER - IGNORE
|
||||
|
|
@ -2380,9 +2346,6 @@ VOID SFRAME(struct _LINKTABLE * LINK, struct PORTCONTROL * PORT, UCHAR CTL, UCHA
|
|||
|
||||
LINK->L2TIMER = ONEMINUTE; // (RE)SET TIMER
|
||||
|
||||
|
||||
LINK->framesResent++;
|
||||
|
||||
PORT = LINK->LINKPORT;
|
||||
|
||||
if (PORT)
|
||||
|
|
@ -2489,20 +2452,6 @@ treatasRR:
|
|||
|
||||
LINK->L2FLAGS &= ~POLLSENT; // CLEAR I(P) or RR(P) SET
|
||||
|
||||
// ?? is this the place to do RTT?
|
||||
|
||||
if (LINK->lastPSent)
|
||||
{
|
||||
int RTT = GetTickCount() - LINK->lastPSent;
|
||||
|
||||
if (LINK->RTT)
|
||||
LINK->RTT = ((LINK->RTT * 90) / 100) + RTT /10; // Smooth - 90% of old + 10% of new
|
||||
else
|
||||
LINK->RTT = RTT;
|
||||
|
||||
LINK->lastPSent = 0;
|
||||
}
|
||||
|
||||
if ((CTL & 0xf) == RNR)
|
||||
{
|
||||
// Dont Clear timer on receipt of RNR(F), spec says should poll for clearing of busy,
|
||||
|
|
@ -2978,8 +2927,6 @@ VOID RESETNS(struct _LINKTABLE * LINK, UCHAR NS)
|
|||
{
|
||||
int Resent = (LINK->LINKNS - NS) & 7; // FRAMES TO RESEND
|
||||
|
||||
LINK->framesResent += Resent;
|
||||
|
||||
LINK->LINKNS = NS; // RESET N(S)
|
||||
|
||||
if (LINK->LINKTYPE == 3) // mode-Node
|
||||
|
|
@ -3203,11 +3150,6 @@ VOID SDETX(struct _LINKTABLE * LINK)
|
|||
LINK->LASTFRAMESENT = time(NULL);
|
||||
LINK->LASTSENTQCOUNT = COUNT_AT_L2(LINK);
|
||||
|
||||
if (LINK->LASTSENTQCOUNT > LINK->maxQueued)
|
||||
LINK->maxQueued = LINK->LASTSENTQCOUNT;
|
||||
|
||||
if (LINK->LASTSENTQCOUNT > LINK->intervalMaxQueued)
|
||||
LINK->intervalMaxQueued = LINK->LASTSENTQCOUNT;
|
||||
|
||||
if (LINK->AllowCompress && Msg->LENGTH > 20 && LINK->TX_Q && Msg->PID == 240) // if short and no more not worth trying compression
|
||||
{
|
||||
|
|
@ -3410,7 +3352,6 @@ VOID SDETX(struct _LINKTABLE * LINK)
|
|||
// FLAG BUFFER TO CAUSE TIMER TO BE RESET AFTER SEND (or ACK if ACKMODE)
|
||||
|
||||
Buffer->Linkptr = LINK;
|
||||
LINK->lastPSent = GetTickCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3863,13 +3804,6 @@ VOID SENDFRMR(struct _LINKTABLE * LINK)
|
|||
MESSAGE * Buffer;
|
||||
UCHAR * ptr;
|
||||
|
||||
#ifdef FRMRHACK // Ignore any frames with invalid n(r). If spurious error retry should fix it. If not link will retry out and reset
|
||||
|
||||
if (LINK->SDREJF & SDNRER)
|
||||
return;
|
||||
|
||||
#endif
|
||||
|
||||
Buffer = SETUPL2MESSAGE(LINK, FRMR);
|
||||
|
||||
if (Buffer == NULL)
|
||||
|
|
|
|||
23
L3Code.c
23
L3Code.c
|
|
@ -236,7 +236,7 @@ BOOL ACTIVATE_DEST(struct DEST_LIST * DEST)
|
|||
return L2SETUPCROSSLINK(ROUTE);
|
||||
}
|
||||
|
||||
// We must be waiting for link to come up
|
||||
// We umst be waiting for link to come up
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
|
@ -620,13 +620,16 @@ VOID PROCROUTES(struct DEST_LIST * DEST, struct ROUTE * ROUTE, int Qual)
|
|||
if (DEST->DEST_STATE & 0x80) // BBS ENTRY
|
||||
return;
|
||||
|
||||
for (Index = 0; Index < 3; Index++)
|
||||
for (Index = 0; Index < 4; Index++)
|
||||
{
|
||||
if (DEST->NRROUTE[Index].ROUT_NEIGHBOUR == ROUTE)
|
||||
{
|
||||
if (Index == 0)
|
||||
{
|
||||
// THIS IS A REFRESH OF BEST - IF THIS ISNT ACTIVE ROUTE, MAKE IT ACTIVE
|
||||
|
||||
if (DEST->DEST_ROUTE > 1) // LEAVE IT IF NOT SELECTED OR ALREADY USING BEST
|
||||
DEST->DEST_ROUTE = 1;
|
||||
}
|
||||
|
||||
goto UpdatateThisEntry;
|
||||
|
|
@ -692,7 +695,6 @@ UpdatateThisEntry:
|
|||
// IT DID - THIS IS ALSO CALLED BY CHECKL3TABLES. TRY RESETING
|
||||
// OBS, BUT NOT QUALITY
|
||||
|
||||
|
||||
if ((DEST->NRROUTE[Index].ROUT_OBSCOUNT & 0x80) == 0)
|
||||
DEST->NRROUTE[Index].ROUT_OBSCOUNT = OBSINIT; // SET OBSOLESCENCE COUNT
|
||||
|
||||
|
|
@ -726,8 +728,6 @@ SORTROUTES:
|
|||
|
||||
goto SORTROUTES; // 1 AND 2 MAY NOW BE WRONG!
|
||||
}
|
||||
|
||||
DEST->DEST_ROUTE = 0; // OForce re-evaluation.
|
||||
}
|
||||
|
||||
int COUNTNODES(struct ROUTE * ROUTE)
|
||||
|
|
@ -1042,8 +1042,7 @@ VOID L3TimerProc()
|
|||
LINK = LINKS;
|
||||
i = MAXLINKS;
|
||||
|
||||
|
||||
while (i--)
|
||||
while (i--);
|
||||
{
|
||||
if (LINK->LINKTYPE == 3) // Only if Internode
|
||||
{
|
||||
|
|
@ -1311,9 +1310,6 @@ VOID REMOVENODE(dest_list * DEST)
|
|||
while (DEST->DEST_Q)
|
||||
ReleaseBuffer(Q_REM(&DEST->DEST_Q));
|
||||
|
||||
if (DEST->DEST_STATE & 0x80) // LOCKED DESTINATION
|
||||
return;
|
||||
|
||||
// MAY NEED TO CHECK FOR L4 CIRCUITS USING DEST, BUT PROBABLY NOT,
|
||||
// AS THEY SHOULD HAVE TIMED OUT LONG AGO
|
||||
|
||||
|
|
@ -1433,7 +1429,6 @@ VOID L3TRYNEXTDEST(struct ROUTE * ROUTE)
|
|||
{
|
||||
// not Locked
|
||||
|
||||
if (ActiveRoute < 3) // Not INP3 Route
|
||||
DEST->NRROUTE[ActiveRoute].ROUT_OBSCOUNT--;
|
||||
|
||||
// if ROUTE HAS EXPIRED - WE SHOULD CLEAR IT, AND MOVE OTHERS (IF ANY) UP
|
||||
|
|
@ -1566,9 +1561,6 @@ struct DEST_LIST * CHECKL3TABLES(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * Msg
|
|||
{
|
||||
int Index = DEST->DEST_ROUTE -1;
|
||||
|
||||
if (Index > 2) // INP3 Route
|
||||
return DEST;
|
||||
|
||||
if (DEST->NRROUTE[Index].ROUT_OBSCOUNT & 0x80) // Locked:
|
||||
return DEST;
|
||||
|
||||
|
|
@ -1597,9 +1589,6 @@ VOID REFRESHROUTE(TRANSPORTENTRY * Session)
|
|||
|
||||
Index--;
|
||||
|
||||
if (Index > 2) // INP3 Route
|
||||
return;
|
||||
|
||||
if (DEST->NRROUTE[Index].ROUT_OBSCOUNT & 0x80)
|
||||
return; // Locked
|
||||
|
||||
|
|
|
|||
50
L4Code.c
50
L4Code.c
|
|
@ -73,7 +73,6 @@ void OutgoingL4ConnectionEvent(TRANSPORTENTRY * L4);
|
|||
void IncomingL4ConnectionEvent(TRANSPORTENTRY * L4);
|
||||
void L4DisconnectEvent(TRANSPORTENTRY * L4, char * Direction, char * Reason);
|
||||
VOID TCPNETROMSend(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame);
|
||||
void L4StatusSeport(TRANSPORTENTRY * L4);
|
||||
|
||||
static UINT APPLMASK;
|
||||
|
||||
|
|
@ -90,8 +89,6 @@ extern int L2Compress;
|
|||
extern int L2CompMaxframe;
|
||||
extern int L2CompPaclen;
|
||||
|
||||
int sessionStatusInterval = 300; // 5 mins
|
||||
|
||||
// L4 Flags Values
|
||||
|
||||
#define DISCPENDING 8 // SEND DISC WHEN ALL DATA ACK'ED
|
||||
|
|
@ -1131,7 +1128,6 @@ VOID L4TimerProc()
|
|||
TRANSPORTENTRY * L4 = L4TABLE;
|
||||
TRANSPORTENTRY * Partner;
|
||||
int MaxLinks = MAXLINKS;
|
||||
time_t Now = time(NULL);
|
||||
|
||||
while (n--)
|
||||
{
|
||||
|
|
@ -1141,12 +1137,6 @@ VOID L4TimerProc()
|
|||
continue;
|
||||
}
|
||||
|
||||
// Check for Status report time
|
||||
|
||||
if (L4->lastStatusSentTime && (Now - L4->lastStatusSentTime) > sessionStatusInterval)
|
||||
L4StatusSeport(L4);
|
||||
|
||||
|
||||
// CHECK FOR L4BUSY SET AND NO LONGER BUSY
|
||||
|
||||
if (L4->NAKBITS & L4BUSY)
|
||||
|
|
@ -1611,7 +1601,6 @@ VOID CONNECTREQUEST(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG, UINT Appl
|
|||
int Index;
|
||||
char APPLCMD[13] = "";
|
||||
|
||||
if (APPL)
|
||||
memcpy(APPLCMD, APPL->APPLCMD, 13);
|
||||
|
||||
memcpy(BPQPARAMS, &L4T1, 2); // SET DEFAULT T1 IN CASE NOT FROM ANOTHER BPQ NODE
|
||||
|
|
@ -1685,8 +1674,6 @@ VOID CONNECTREQUEST(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG, UINT Appl
|
|||
{
|
||||
// At the moment I only handle connects to appls. May support other node commands later.
|
||||
|
||||
memcpy(APPLCMD, CMD->String, 13);
|
||||
|
||||
if (n < APPL1 + NumberofAppls)
|
||||
goto doAPPLConnect;
|
||||
}
|
||||
|
|
@ -1929,34 +1916,19 @@ void L3SWAPADDRESSES(L3MESSAGEBUFFER * L3MSG)
|
|||
|
||||
void SendConNAK(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG)
|
||||
{
|
||||
struct TNCINFO * TNC;
|
||||
|
||||
L3MSG->L4FLAGS = L4CACK | L4BUSY; // REJECT
|
||||
L3MSG->L4DATA[0] = 0; // WINDOW
|
||||
|
||||
L3SWAPADDRESSES(L3MSG);
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
VOID SendL4RESET(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG)
|
||||
{
|
||||
// Paula's extension
|
||||
|
||||
struct TNCINFO * TNC;
|
||||
|
||||
L3MSG->L4RXNO = L3MSG->L4ID;
|
||||
L3MSG->L4TXNO = L3MSG->L4INDEX;
|
||||
|
||||
|
|
@ -1966,19 +1938,7 @@ VOID SendL4RESET(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG)
|
|||
L3MSG->L3TTL = L3LIVES;
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2068,7 +2028,7 @@ TryAgain:
|
|||
|
||||
while (n--)
|
||||
{
|
||||
if (DEST->DEST_COUNT == 0 && DEST->DEST_RTT == 0 && (DEST->DEST_STATE & 0x80) == 0) // Not used and not INP3 and not Appl
|
||||
if (DEST->DEST_COUNT == 0 && DEST->DEST_RTT == 0) // Not used and not INP3
|
||||
{
|
||||
if (DEST->NRROUTE[0].ROUT_QUALITY < WorstQual)
|
||||
{
|
||||
|
|
@ -2298,14 +2258,6 @@ VOID FRAMEFORUS(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG, int ApplMask,
|
|||
return;
|
||||
}
|
||||
|
||||
// if connect to service don't send connected to node messsage as service will send own message
|
||||
|
||||
// if (L4->Service)
|
||||
// {
|
||||
// ReleaseBuffer(L3MSG);
|
||||
// return;
|
||||
// }
|
||||
|
||||
Msg = (PDATAMESSAGE)L3MSG; // reuse input buffer
|
||||
|
||||
Msg->PID = 0xf0;
|
||||
|
|
|
|||
10
LinBPQ.c
10
LinBPQ.c
|
|
@ -85,7 +85,8 @@ VOID GetPGConfig();
|
|||
void SendBBSDataToPktMap();
|
||||
void CloseAllLinks();
|
||||
void hookNodeClosing(char * Reason);
|
||||
void NETROMTCPResolve();
|
||||
|
||||
extern uint64_t INP3timeLoadedMS;
|
||||
|
||||
BOOL IncludesMail = FALSE;
|
||||
BOOL IncludesChat = FALSE;
|
||||
|
|
@ -859,6 +860,8 @@ int main(int argc, char * argv[])
|
|||
if (!isatty(STDOUT_FILENO) || !isatty(STDIN_FILENO))
|
||||
Redirected = 1;
|
||||
|
||||
INP3timeLoadedMS = GetTickCount();
|
||||
|
||||
#endif
|
||||
|
||||
printf("G8BPQ AX25 Packet Switch System Version %s %s\n", TextVerstring, Datestring);
|
||||
|
|
@ -866,6 +869,7 @@ int main(int argc, char * argv[])
|
|||
|
||||
srand(time(NULL));
|
||||
|
||||
|
||||
// look for optarg format parameters
|
||||
|
||||
{
|
||||
|
|
@ -1011,8 +1015,6 @@ int main(int argc, char * argv[])
|
|||
return (0);
|
||||
}
|
||||
|
||||
NETROMTCPResolve();
|
||||
|
||||
for (i=0;PWTEXT[i] > 0x20;i++); //Scan for cr or null
|
||||
|
||||
PWLen=i;
|
||||
|
|
@ -1545,8 +1547,6 @@ int main(int argc, char * argv[])
|
|||
|
||||
Start();
|
||||
|
||||
NETROMTCPResolve();
|
||||
|
||||
INITIALISEPORTS();
|
||||
|
||||
SetApplPorts();
|
||||
|
|
|
|||
|
|
@ -2105,6 +2105,7 @@ int CreateSMTPMessage(SocketConn * sockptr, int i, char * MsgTitle, time_t Date,
|
|||
else
|
||||
strcpy(B2To, Msg->to);
|
||||
|
||||
|
||||
Msg->B2Flags = B2Msg | Attachments;
|
||||
|
||||
if (Msg->type == 'P')
|
||||
|
|
|
|||
|
|
@ -1020,7 +1020,8 @@ void WritePacketLogThread(void * param)
|
|||
int MsgLen;
|
||||
MESSAGE * MSG;
|
||||
MESSAGE * Q;
|
||||
char buffer[2048];
|
||||
char buffer[512];
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
|
|
@ -1074,8 +1075,6 @@ void WritePacketLogThread(void * param)
|
|||
MsgLen = IntDecodeFrame(MSG, buffer, MSG->Timestamp, 0xffffffffffffffff, FALSE, FALSE);
|
||||
IntSetTraceOptionsEx(MMASK, SaveMTX, SaveMCOM, SaveMUI);
|
||||
|
||||
buffer[MsgLen++] = 0x0a; // Add lf
|
||||
|
||||
fwrite(buffer , 1, MsgLen, Handle);
|
||||
|
||||
GetSemaphore(&Semaphore, 101);
|
||||
|
|
|
|||
257
NETROMTCP.c
257
NETROMTCP.c
|
|
@ -59,10 +59,6 @@ BOOL FindNeighbour(UCHAR * Call, int Port, struct ROUTE ** REQROUTE);
|
|||
VOID NETROMMSG(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG);
|
||||
int BPQTRACE(MESSAGE * Msg, BOOL TOAPRS);
|
||||
VOID L3LINKCLOSED(struct _LINKTABLE * LINK, int Reason);
|
||||
void NetromTCPTrace(struct _MESSAGE * Message, char * Dirn);
|
||||
void NETROMCloseTCP(struct ROUTE * Route);
|
||||
|
||||
extern SOCKET NodeAPISocket;
|
||||
|
||||
struct NRTCPMsg
|
||||
{
|
||||
|
|
@ -99,11 +95,11 @@ struct ConnectionInfo * AllocateNRTCPRec()
|
|||
Info = NRTCPInfo[i] = (struct NRTCPSTRUCT *)zalloc(sizeof(struct NRTCPSTRUCT));
|
||||
Info->sockptr = (struct ConnectionInfo *)zalloc(sizeof(struct ConnectionInfo));
|
||||
Info->LINK = (struct _LINKTABLE *)zalloc(sizeof(struct _LINKTABLE));
|
||||
Info->sockptr->Number = i;
|
||||
}
|
||||
else
|
||||
Info = NRTCPInfo[i];
|
||||
|
||||
Info->sockptr->Number = i;
|
||||
sockptr = Info->sockptr;
|
||||
|
||||
if (sockptr->SocketActive == FALSE)
|
||||
|
|
@ -125,7 +121,6 @@ void checkNRTCPSockets(int portNo)
|
|||
SOCKET maxsock;
|
||||
int retval;
|
||||
int i;
|
||||
time_t Now = time(NULL);
|
||||
|
||||
struct timeval timeout;
|
||||
fd_set readfd, writefd, exceptfd;
|
||||
|
|
@ -151,20 +146,6 @@ void checkNRTCPSockets(int portNo)
|
|||
if (sockptr->SocketActive == 0)
|
||||
continue;
|
||||
|
||||
if (sockptr->Connected && (Now - sockptr->LastReceiveTime) > 600)
|
||||
{
|
||||
struct NRTCPSTRUCT * Info = NRTCPInfo[sockptr->Number];
|
||||
|
||||
if (Info)
|
||||
Debugprintf("NETROMTCP link to %s idle for too long, closing", Info->Call);
|
||||
else
|
||||
Debugprintf("NETROMTCP link idle for too long, closing");
|
||||
|
||||
NETROMConnectionLost(sockptr);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (sockptr->Connecting)
|
||||
{
|
||||
// look for complete or failed
|
||||
|
|
@ -229,69 +210,38 @@ int NETROMOpenConnection(struct ROUTE * Route)
|
|||
{
|
||||
struct NRTCPSTRUCT * Info;
|
||||
struct ConnectionInfo * sockptr;
|
||||
char farCall[10];
|
||||
|
||||
farCall[ConvFromAX25(Route->NEIGHBOUR_CALL, farCall)] = 0;
|
||||
Debugprintf("Opening NRTCP Connection");
|
||||
|
||||
if (Route->TCPSession)
|
||||
{
|
||||
// SESSION ALREADY EXISTS
|
||||
|
||||
sockptr = Route->TCPSession->sockptr;
|
||||
|
||||
if (sockptr->Connected || sockptr->Connecting)
|
||||
return TRUE;
|
||||
|
||||
// previous connect failed
|
||||
}
|
||||
else
|
||||
{
|
||||
sockptr = AllocateNRTCPRec();
|
||||
|
||||
if (sockptr == NULL)
|
||||
return 0;
|
||||
|
||||
Debugprintf("Opening NRTCP Connection to %s index %d", farCall, sockptr->Number);
|
||||
|
||||
Info = Route->TCPSession = NRTCPInfo[sockptr->Number];
|
||||
memcpy(Info->Call, farCall, 10);
|
||||
memcpy(Info->Call, MYNETROMCALL, 10);
|
||||
Route->NEIGHBOUR_LINK = Info->LINK;
|
||||
|
||||
Info->Route = Route;
|
||||
Info->LINK->NEIGHBOUR = Route;
|
||||
Info->LINK->LINKPORT = GetPortTableEntryFromPortNum(Route->NEIGHBOUR_PORT);
|
||||
memcpy(Route->NEIGHBOUR_LINK->LINKCALL, Route->NEIGHBOUR_CALL, 7);
|
||||
|
||||
Route->NEIGHBOUR_LINK = Route->TCPSession->LINK; // Just in case!
|
||||
}
|
||||
|
||||
return NETROMTCPConnect(Route, sockptr);
|
||||
}
|
||||
|
||||
void NETROMTCPResolve()
|
||||
{
|
||||
struct ROUTE * Route = NEIGHBOURS;
|
||||
int n = MAXNEIGHBOURS;
|
||||
struct addrinfo hints, *res = 0;
|
||||
char PortString[20];
|
||||
int err;
|
||||
|
||||
while (n--)
|
||||
{
|
||||
if (Route->TCPAddress)
|
||||
{
|
||||
// try to resolve host
|
||||
|
||||
sprintf(PortString, "%d", Route->TCPPort);
|
||||
|
||||
memset(&hints, 0, sizeof hints);
|
||||
hints.ai_family = AF_UNSPEC; // use IPv4 or IPv6, whichever
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
|
||||
getaddrinfo(Route->TCPHost, PortString, &hints, &res);
|
||||
|
||||
err = WSAGetLastError();
|
||||
|
||||
if (res)
|
||||
{
|
||||
Route->TCPAddress->ai_family = res->ai_family;
|
||||
Route->TCPAddress->ai_socktype = res->ai_socktype;
|
||||
Route->TCPAddress->ai_protocol = res->ai_protocol;
|
||||
Route->TCPAddress->ai_addrlen = res->ai_addrlen;
|
||||
memcpy(Route->TCPAddress->ai_addr, res->ai_addr, sizeof(struct sockaddr));
|
||||
freeaddrinfo(res);
|
||||
}
|
||||
}
|
||||
|
||||
Route++;
|
||||
}
|
||||
}
|
||||
|
||||
int NETROMTCPConnect(struct ROUTE * Route, struct ConnectionInfo * sockptr)
|
||||
|
|
@ -303,30 +253,34 @@ int NETROMTCPConnect(struct ROUTE * Route, struct ConnectionInfo * sockptr)
|
|||
struct sockaddr_in sinx;
|
||||
int addrlen=sizeof(sinx);
|
||||
char PortString[20];
|
||||
struct addrinfo * res = Route->TCPAddress;
|
||||
struct addrinfo hints, *res = 0, *saveres;
|
||||
int Port = Route->TCPPort;
|
||||
struct sockaddr_in my_addr;
|
||||
socklen_t len = sizeof(my_addr);
|
||||
struct NRTCPSTRUCT * Info = NRTCPInfo[sockptr->Number];
|
||||
|
||||
// Get my ip address and port
|
||||
|
||||
memset(&my_addr, 0, sizeof(my_addr));
|
||||
getsockname(sockptr->socket, (struct sockaddr *) &my_addr, &len);
|
||||
|
||||
sprintf(PortString, "%d", Port);
|
||||
|
||||
// get host info, make socket, and connect it
|
||||
|
||||
if (res->ai_family == 0)
|
||||
memset(&hints, 0, sizeof hints);
|
||||
|
||||
hints.ai_family = AF_UNSPEC; // use IPv4 or IPv6, whichever
|
||||
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
getaddrinfo(Route->TCPHost, PortString, &hints, &res);
|
||||
|
||||
if (!res)
|
||||
{
|
||||
// err = WSAGetLastError();
|
||||
// Debugprintf("Resolve HostName %s Failed - Error %d", Route->TCPHost, err);
|
||||
err = WSAGetLastError();
|
||||
Debugprintf("Resolve HostName %s Failed - Error %d", Route->TCPHost, err);
|
||||
return FALSE; // Resolve failed
|
||||
}
|
||||
|
||||
// Step thorough the list of hosts
|
||||
|
||||
saveres = res; // Save for free
|
||||
|
||||
sock = sockptr->socket = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
|
||||
|
||||
|
||||
if (sock == INVALID_SOCKET)
|
||||
{
|
||||
Debugprintf, ("Netrom over TCP Create Socket Failed");
|
||||
|
|
@ -345,11 +299,14 @@ int NETROMTCPConnect(struct ROUTE * Route, struct ConnectionInfo * sockptr)
|
|||
//
|
||||
|
||||
sockptr->Connected = TRUE;
|
||||
sockptr->LastReceiveTime = time(NULL);
|
||||
freeaddrinfo(saveres);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
freeaddrinfo(saveres);
|
||||
|
||||
err=WSAGetLastError();
|
||||
|
||||
if (err == 10035 || err == 115 || err == 36) //EWOULDBLOCK
|
||||
|
|
@ -357,13 +314,6 @@ int NETROMTCPConnect(struct ROUTE * Route, struct ConnectionInfo * sockptr)
|
|||
// Connect in Progress
|
||||
|
||||
sockptr->Connecting = TRUE;
|
||||
|
||||
// Get my ip address and port
|
||||
memset(&my_addr, 0, sizeof(my_addr));
|
||||
getsockname(sockptr->socket, (struct sockaddr *) &my_addr, &len);
|
||||
Route->localport = htons(my_addr.sin_port);
|
||||
|
||||
Debugprintf("NRTCP Connection in progress %s local port %d", Info->Call, Route->localport);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
|
|
@ -386,32 +336,18 @@ void NETROMConnectionAccepted(struct ConnectionInfo * sockptr)
|
|||
{
|
||||
// Not sure we can do much here until first message arrives with callsign
|
||||
|
||||
struct sockaddr_in my_addr;
|
||||
socklen_t len = sizeof(my_addr);
|
||||
|
||||
// Get my ip address and port
|
||||
|
||||
memset(&my_addr, 0, sizeof(my_addr));
|
||||
// getsockname(sockptr->socket, (struct sockaddr *) &my_addr, &len);
|
||||
|
||||
Debugprintf("INP3 Accept() Local port %d", htons(sockptr->sin.sin_port));
|
||||
|
||||
sockptr->Connected = TRUE;
|
||||
sockptr->LastReceiveTime = time(NULL);
|
||||
// Debugprintf("NRTCP Connection Accepted");
|
||||
Debugprintf("NRTCP Connection Accepted");
|
||||
}
|
||||
|
||||
void NETROMConnected(struct ConnectionInfo * sockptr, SOCKET sock, struct NRTCPSTRUCT * Info)
|
||||
{
|
||||
// Connection Complete
|
||||
|
||||
// Debugprintf("NRTCP Connected");
|
||||
|
||||
Debugprintf("NRTCP Connection Complete %s Local port %d", Info->Call, Info->Route->localport);
|
||||
Debugprintf("NRTCP Connected");
|
||||
|
||||
sockptr->Connecting = FALSE;
|
||||
sockptr->Connected = TRUE;
|
||||
sockptr->LastReceiveTime = time(NULL);
|
||||
|
||||
Info->LINK->L2STATE = 5;
|
||||
|
||||
|
|
@ -444,8 +380,6 @@ int DataSocket_ReadNETROM(struct ConnectionInfo * sockptr, SOCKET sock, struct N
|
|||
return 0;
|
||||
}
|
||||
|
||||
sockptr->LastReceiveTime = time(NULL);
|
||||
|
||||
sockptr->InputLen += len;
|
||||
|
||||
// Process data
|
||||
|
|
@ -473,40 +407,22 @@ checkLen:
|
|||
{
|
||||
Info->Route = Route;
|
||||
Route->NEIGHBOUR_LINK = Info->LINK;
|
||||
Route->NEIGHBOUR_PORT = portNo;
|
||||
Info->LINK->NEIGHBOUR = Route;
|
||||
Info->LINK->LINKPORT = GetPortTableEntryFromPortNum(portNo);
|
||||
Info->LINK->LINKPORT = GetPortTableEntryFromPortNum(Route->NEIGHBOUR_PORT);
|
||||
Route->TCPSession = Info;
|
||||
Info->LINK->L2STATE = 5;
|
||||
memcpy(Route->NEIGHBOUR_LINK->LINKCALL, axCall, 7);
|
||||
Route->localport = htons(sockptr->sin.sin_port);
|
||||
|
||||
Debugprintf("New NRTCP Connection from %s port %d", Msg->Call, Route->localport);
|
||||
|
||||
|
||||
if (Info->Route->INP3Node)
|
||||
SendRTTMsg(Info->Route);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debugprintf("Neighbour %s port %d not found - closing connection", Msg->Call, portNo);
|
||||
closesocket(sockptr->socket);
|
||||
sockptr->SocketActive = FALSE;
|
||||
memset(sockptr, 0, sizeof(struct ConnectionInfo));
|
||||
Info->Call[0] = 0;
|
||||
return 0;
|
||||
}
|
||||
goto seeifMore; // Should we kill connection?
|
||||
}
|
||||
|
||||
|
||||
if (memcmp(Info->Call, Msg->Call, 10) != 0)
|
||||
{
|
||||
Debugprintf("NRTCP Mismatch - closing connection");
|
||||
|
||||
closesocket(sockptr->socket);
|
||||
sockptr->SocketActive = FALSE;
|
||||
memset(sockptr, 0, sizeof(struct ConnectionInfo));
|
||||
Info->Call[0] = 0;
|
||||
return 0;
|
||||
// something wrong - maybe connection reused
|
||||
}
|
||||
|
||||
// Format as if come from an ax.25 link
|
||||
|
|
@ -518,7 +434,7 @@ checkLen:
|
|||
|
||||
L3Msg->LENGTH = (Msg->Length - 12) + MSGHDDRLEN;
|
||||
L3Msg->Next = 0;
|
||||
L3Msg->Port = portNo;
|
||||
L3Msg->Port = 0;
|
||||
L3Msg->L3PID = NETROM_PID;
|
||||
memcpy(&L3Msg->L3SRCE, Msg->Packet, Msg->Length - 13);
|
||||
|
||||
|
|
@ -542,15 +458,9 @@ checkLen:
|
|||
time(&Buffer->Timestamp);
|
||||
|
||||
BPQTRACE(Buffer, FALSE);
|
||||
|
||||
if(NodeAPISocket)
|
||||
NetromTCPTrace(Buffer, "rcvd");
|
||||
|
||||
ReleaseBuffer(Buffer);
|
||||
}
|
||||
|
||||
Info->Route->NEIGHBOUR_LINK = Info->LINK; // Just in case!
|
||||
|
||||
NETROMMSG(Info->LINK, L3Msg);
|
||||
|
||||
seeifMore:
|
||||
|
|
@ -573,9 +483,6 @@ VOID TCPNETROMSend(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame)
|
|||
int DataLen = Frame->LENGTH - (MSGHDDRLEN + 1); // Not including PID
|
||||
int Ret;
|
||||
PMESSAGE Buffer;
|
||||
struct sockaddr_in my_addr;
|
||||
socklen_t len = sizeof(my_addr);
|
||||
struct ConnectionInfo * sockptr;
|
||||
|
||||
Msg.Length = DataLen + 13; // include PID
|
||||
memcpy(Msg.Call, MYNETROMCALL, 10);
|
||||
|
|
@ -585,47 +492,6 @@ VOID TCPNETROMSend(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame)
|
|||
if (Route->TCPSession == 0)
|
||||
return;
|
||||
|
||||
sockptr = Route->TCPSession->sockptr;
|
||||
|
||||
// Get other port
|
||||
|
||||
if (strcmp(Route->TCPHost, "0.0.0.0") == 0)
|
||||
{
|
||||
// incoming
|
||||
|
||||
// Debugprintf("INP3 Remote port %d", htons(sockptr->sin.sin_port));
|
||||
|
||||
if (Route->localport != htons(sockptr->sin.sin_port))
|
||||
{
|
||||
// Route is linked to wrong session. Close it
|
||||
|
||||
// Route->TCPSession = 0;
|
||||
// Route->NEIGHBOUR_LINK = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// outgoing
|
||||
|
||||
memset(&my_addr, 0, sizeof(my_addr));
|
||||
|
||||
getsockname(sockptr->socket, (struct sockaddr *) &my_addr, &len);
|
||||
// Debugprintf("INP3 Local port %d", htons(my_addr.sin_port));
|
||||
|
||||
if (Route->localport != htons(my_addr.sin_port))
|
||||
{
|
||||
// Route is linked to wrong session. Close it
|
||||
|
||||
// if (sockptr->Connecting == 0)
|
||||
// {
|
||||
// Route->TCPSession = 0;
|
||||
// Route->NEIGHBOUR_LINK = 0;
|
||||
// }
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Ret = send(Route->TCPSession->sockptr->socket, (char *)&Msg, DataLen + 13, 0);
|
||||
|
||||
// Create a dummy L2 message so we can trace it
|
||||
|
|
@ -636,9 +502,9 @@ VOID TCPNETROMSend(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame)
|
|||
{
|
||||
Buffer->CHAIN = 0;
|
||||
Buffer->CTL = 0;
|
||||
Buffer->PORT = Route->NEIGHBOUR_PORT;
|
||||
Buffer->PORT = Route->NEIGHBOUR_PORT | 128; // TX Flag
|
||||
|
||||
memcpy(Buffer->DEST, Route->NEIGHBOUR_CALL, 7);
|
||||
ConvToAX25(Route->TCPSession->Call, Buffer->DEST);
|
||||
ConvToAX25(MYNETROMCALL, Buffer->ORIGIN);
|
||||
|
||||
memcpy(Buffer->L2DATA, &Frame->L3SRCE[0], DataLen);
|
||||
|
|
@ -647,13 +513,7 @@ VOID TCPNETROMSend(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame)
|
|||
Buffer->LENGTH = DataLen + 15 + MSGHDDRLEN;
|
||||
time(&Buffer->Timestamp);
|
||||
|
||||
if(NodeAPISocket)
|
||||
NetromTCPTrace(Buffer, "sent");
|
||||
|
||||
Buffer->PORT = Route->NEIGHBOUR_PORT | 128; // TX Flag
|
||||
BPQTRACE(Buffer, FALSE);
|
||||
|
||||
|
||||
ReleaseBuffer(Buffer);
|
||||
}
|
||||
|
||||
|
|
@ -673,15 +533,15 @@ void NETROMConnectionLost(struct ConnectionInfo * sockptr)
|
|||
{
|
||||
Route = Info->Route;
|
||||
|
||||
if (Route)
|
||||
{
|
||||
Route->NEIGHBOUR_LINK = 0;
|
||||
if (sockptr->Connected)
|
||||
L3LINKCLOSED(Info->LINK, LINKLOST);
|
||||
|
||||
if (sockptr->Connecting)
|
||||
L3LINKCLOSED(Info->LINK, SETUPFAILED);
|
||||
|
||||
Route->TCPSession = 0;
|
||||
Route->localport = 0;
|
||||
}
|
||||
|
||||
Info->Call[0] = 0;
|
||||
Info->LINK->L2STATE = 0;
|
||||
}
|
||||
|
||||
sockptr->SocketActive = FALSE;
|
||||
|
|
@ -689,18 +549,3 @@ void NETROMConnectionLost(struct ConnectionInfo * sockptr)
|
|||
memset(sockptr, 0, sizeof(struct ConnectionInfo));
|
||||
}
|
||||
|
||||
void NETROMCloseTCP(struct ROUTE * Route)
|
||||
{
|
||||
if (Route->TCPSession)
|
||||
{
|
||||
struct ConnectionInfo * sockptr = Route->TCPSession->sockptr;
|
||||
NETROMConnectionLost(sockptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
Route->NEIGHBOUR_LINK = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
6
RHP.c
6
RHP.c
|
|
@ -387,12 +387,6 @@ int processRHCPOpen(struct ConnectionInfo * sockptr, SOCKET Socket, char * Msg,
|
|||
if (_stricmp(pfam, "ax25") != 0)
|
||||
return sprintf(ReplyBuffer, "{\"type\": \"openReply\", \"id\": %d, \"handle\": %d, \"errCode\": 12, \"errText\": \"Bad parameter\"}", ID, 0);
|
||||
|
||||
if (strlen(Local) > 10)
|
||||
return sprintf(ReplyBuffer, "{\"type\": \"openReply\", \"id\": %d, \"handle\": %d, \"errCode\": 6, \"errText\": \"%s\"}", ID, 0, ErrCodes[6]);
|
||||
|
||||
if (strlen(Remote) > 10)
|
||||
return sprintf(ReplyBuffer, "{\"type\": \"openReply\", \"id\": %d, \"handle\": %d, \"errCode\": 7, \"errText\": \"%s\"}", ID, 0, ErrCodes[7]);
|
||||
|
||||
if (_stricmp(Mode, "stream") == 0)
|
||||
{
|
||||
{
|
||||
|
|
|
|||
56
TelnetV6.c
56
TelnetV6.c
|
|
@ -56,7 +56,6 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
|||
|
||||
extern UCHAR LogDirectory[];
|
||||
|
||||
extern int MONTOFILEFLAG;
|
||||
|
||||
static char ClassName[]="TELNETSERVER";
|
||||
static char WindowTitle[] = "Telnet Server";
|
||||
|
|
@ -178,22 +177,24 @@ void NETROMConnectionLost(struct ConnectionInfo * sockptr);
|
|||
void NETROMConnectionAccepted(struct ConnectionInfo * sockptr);
|
||||
struct ConnectionInfo * AllocateNRTCPRec();
|
||||
|
||||
int DeleteLogFile(char * Log, int KeepDays);
|
||||
static int LogAge = 13;
|
||||
|
||||
void DeleteLogFiles(int Age)
|
||||
{
|
||||
DeleteLogFile("Telnet", Age);
|
||||
DeleteLogFile("CMSAccess_", Age);
|
||||
DeleteLogFile("ConnectLog_",Age);
|
||||
DeleteLogFile("APRS_", Age);
|
||||
if (MONTOFILEFLAG)
|
||||
DeleteLogFile("PacketLog_", MONTOFILEFLAG);
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
int DeleteLogFile(char * Log, int KeepDays)
|
||||
int DeleteLogFile(char * Log);
|
||||
|
||||
void DeleteTelnetLogFiles()
|
||||
{
|
||||
DeleteLogFile("/logs/Telnet*.log");
|
||||
DeleteLogFile("/logs/CMSAccess_*.log");
|
||||
DeleteLogFile("/logs/ConnectLog_*.log");
|
||||
}
|
||||
|
||||
int DeleteLogFile(char * Log)
|
||||
{
|
||||
|
||||
|
||||
WIN32_FIND_DATA ffd;
|
||||
|
||||
char szDir[MAX_PATH];
|
||||
|
|
@ -204,11 +205,11 @@ int DeleteLogFile(char * Log, int KeepDays)
|
|||
time_t now = time(NULL);
|
||||
int Age;
|
||||
|
||||
// Prepare string for use with FindFile functions. First, copy the
|
||||
// string to a buffer, then append '\*' to the directory name.
|
||||
|
||||
strcpy(szDir, GetLogDirectory());
|
||||
strcat(szDir, "/Logs/");
|
||||
strcat(szDir, Log);
|
||||
strcat(szDir, "*.log");
|
||||
|
||||
// Find the first file in the directory.
|
||||
|
||||
|
|
@ -217,6 +218,8 @@ int DeleteLogFile(char * Log, int KeepDays)
|
|||
if (INVALID_HANDLE_VALUE == hFind)
|
||||
return dwError;
|
||||
|
||||
// List all the files in the directory with some info about them.
|
||||
|
||||
do
|
||||
{
|
||||
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
|
|
@ -233,7 +236,7 @@ int DeleteLogFile(char * Log, int KeepDays)
|
|||
|
||||
Age = (int)((now - ft.LowPart) / 86400);
|
||||
|
||||
if (Age > KeepDays)
|
||||
if (Age > LogAge)
|
||||
{
|
||||
sprintf(File, "%s/logs/%s%c", GetLogDirectory(), ffd.cFileName, 0);
|
||||
Debugprintf("Deleting %s", File);
|
||||
|
|
@ -253,10 +256,13 @@ int DeleteLogFile(char * Log, int KeepDays)
|
|||
|
||||
int TelFilter(const struct dirent * dir)
|
||||
{
|
||||
return strstr(dir->d_name, ".log") != 0;
|
||||
return (memcmp(dir->d_name, "CMSAccess", 9) == 0
|
||||
|| memcmp(dir->d_name, "Telnet", 6) == 0
|
||||
|| memcmp(dir->d_name, "ConnectLog", 6) == 0)
|
||||
&& strstr(dir->d_name, ".log");
|
||||
}
|
||||
|
||||
int DeleteLogFile(char * Log, int KeepDays)
|
||||
int DeleteTelnetLogFiles()
|
||||
{
|
||||
struct dirent **namelist;
|
||||
int n;
|
||||
|
|
@ -272,22 +278,18 @@ int DeleteLogFile(char * Log, int KeepDays)
|
|||
else
|
||||
{
|
||||
while(n--)
|
||||
{
|
||||
if (memcmp(namelist[n]->d_name, Log, strlen(Log)) == 0)
|
||||
{
|
||||
sprintf(FN, "logs/%s", namelist[n]->d_name);
|
||||
|
||||
if (stat(FN, &STAT) == 0)
|
||||
{
|
||||
Age = (now - STAT.st_mtime) / 86400;
|
||||
|
||||
if (Age > KeepDays)
|
||||
if (Age > LogAge)
|
||||
{
|
||||
Debugprintf("Deleting %s", FN);
|
||||
Debugprintf("Deleting %s\n", FN);
|
||||
unlink(FN);
|
||||
}
|
||||
}
|
||||
}
|
||||
free(namelist[n]);
|
||||
}
|
||||
free(namelist);
|
||||
|
|
@ -318,7 +320,7 @@ void BuffertoNode(struct ConnectionInfo * sockptr, char * MsgPtr, int InputLen)
|
|||
sockptr->InputLen = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL SendAndCheck(struct ConnectionInfo * sockptr, unsigned char * MsgPtr, int len, int flags)
|
||||
{
|
||||
|
|
@ -1192,7 +1194,6 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
|
|||
|
||||
TNC = TNCInfo[n];
|
||||
TNC->Port = n;
|
||||
TNC->PortRecord = PortRecord;
|
||||
TNC->PortRecord->PORTCONTROL.HWType = TNC->Hardware = H_TELNET;
|
||||
TNC->RIG = &TNC->DummyRig; // Not using Rig control, so use Dummy
|
||||
|
||||
|
|
@ -1444,6 +1445,8 @@ void * TelnetExtInit(EXTPORTDATA * PortEntry)
|
|||
}
|
||||
*/
|
||||
|
||||
DeleteTelnetLogFiles();
|
||||
|
||||
initUTF8();
|
||||
|
||||
sprintf(msg,"Telnet Server ");
|
||||
|
|
@ -3871,13 +3874,11 @@ MsgLoop:
|
|||
LFPtr=memchr(MsgPtr, 10, InputLen);
|
||||
|
||||
if (LFPtr == 0)
|
||||
{
|
||||
if (CRPtr)
|
||||
{
|
||||
LFPtr = ++CRPtr;
|
||||
InputLen++;
|
||||
}
|
||||
}
|
||||
if (LFPtr == 0)
|
||||
{
|
||||
// Check Paclen
|
||||
|
|
@ -4570,7 +4571,6 @@ MsgLoop:
|
|||
|
||||
if (P8 == 1)
|
||||
SendPortsForMonitor(sock, sockptr->UserPointer->Secure);
|
||||
|
||||
sockptr->InputLen = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
3
VARA.c
3
VARA.c
|
|
@ -423,11 +423,10 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
|
|||
{
|
||||
TNC->Busy--;
|
||||
if (TNC->Busy == 0)
|
||||
{ SetWindowText(TNC->xIDC_CHANSTATE, "Clear");
|
||||
SetWindowText(TNC->xIDC_CHANSTATE, "Clear");
|
||||
strcpy(TNC->WEB_CHANSTATE, "Clear");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (TNC->BusyDelay)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,15 +10,15 @@
|
|||
|
||||
#endif
|
||||
|
||||
#define KVers 6,0,25,15
|
||||
#define KVerstring "6.0.25.15\0"
|
||||
#define KVers 6,0,25,8
|
||||
#define KVerstring "6.0.25.8\0"
|
||||
|
||||
|
||||
#ifdef CKernel
|
||||
|
||||
#define Vers KVers
|
||||
#define Verstring KVerstring
|
||||
#define Datestring "December 2025"
|
||||
#define Datestring "October 2025"
|
||||
#define VerComments "G8BPQ Packet Switch (C Version)" KVerstring
|
||||
#define VerCopyright "Copyright © 2001-2025 John Wiseman G8BPQ\0"
|
||||
#define VerDesc "BPQ32 Switch\0"
|
||||
|
|
|
|||
6
WINMOR.c
6
WINMOR.c
|
|
@ -618,12 +618,10 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
|
|||
{
|
||||
TNC->Busy--;
|
||||
if (TNC->Busy == 0)
|
||||
{
|
||||
SetWindowText(TNC->xIDC_CHANSTATE, "Clear");
|
||||
strcpy(TNC->WEB_CHANSTATE, "Clear");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (TNC->ConnectCmd && TNC->BusyDelay)
|
||||
{
|
||||
|
|
@ -2929,7 +2927,7 @@ BOOL RestartTNC(struct TNCINFO * TNC)
|
|||
SOCKET sock = socket(AF_INET,SOCK_DGRAM,0);
|
||||
struct sockaddr_in destaddr;
|
||||
|
||||
// Debugprintf("trying to restart TNC %s", TNC->ProgramPath);
|
||||
Debugprintf("trying to restart TNC %s", TNC->ProgramPath);
|
||||
|
||||
if (sock == INVALID_SOCKET)
|
||||
return 0;
|
||||
|
|
@ -2952,7 +2950,7 @@ BOOL RestartTNC(struct TNCINFO * TNC)
|
|||
|
||||
n = sendto(sock, TNC->ProgramPath, (int)strlen(TNC->ProgramPath), 0, (struct sockaddr *)&destaddr, sizeof(destaddr));
|
||||
|
||||
// Debugprintf("Restart TNC - sendto returned %d", n);
|
||||
Debugprintf("Restart TNC - sendto returned %d", n);
|
||||
|
||||
Sleep(100);
|
||||
closesocket(sock);
|
||||
|
|
|
|||
4
WinRPR.c
4
WinRPR.c
|
|
@ -120,7 +120,7 @@ static BOOL RestartTNC(struct TNCINFO * TNC)
|
|||
SOCKET sock = socket(AF_INET,SOCK_DGRAM,0);
|
||||
struct sockaddr_in destaddr;
|
||||
|
||||
// Debugprintf("trying to restart TNC %s", TNC->ProgramPath);
|
||||
Debugprintf("trying to restart TNC %s", TNC->ProgramPath);
|
||||
|
||||
if (sock == INVALID_SOCKET)
|
||||
return 0;
|
||||
|
|
@ -143,7 +143,7 @@ static BOOL RestartTNC(struct TNCINFO * TNC)
|
|||
|
||||
n = sendto(sock, TNC->ProgramPath, (int)strlen(TNC->ProgramPath), 0, (struct sockaddr *)&destaddr, sizeof(destaddr));
|
||||
|
||||
// Debugprintf("Restart TNC - sendto returned %d", n);
|
||||
Debugprintf("Restart TNC - sendto returned %d", n);
|
||||
|
||||
Sleep(100);
|
||||
closesocket(sock);
|
||||
|
|
|
|||
37
asmstrucs.h
37
asmstrucs.h
|
|
@ -184,13 +184,7 @@ typedef struct _TRANSPORTENTRY
|
|||
int NRRID;
|
||||
time_t NRRTime;
|
||||
|
||||
time_t ConnectTime;
|
||||
char Direction[16]; // In or Out
|
||||
|
||||
int Service; // For Paula's Connnect to Service
|
||||
int apiSeq; // for OARC event reporting
|
||||
time_t lastStatusSentTime;
|
||||
|
||||
|
||||
} TRANSPORTENTRY;
|
||||
|
||||
|
|
@ -257,10 +251,6 @@ typedef struct ROUTE
|
|||
char * TCPHost; // For NETROM over TCP
|
||||
int TCPPort;
|
||||
struct NRTCPSTRUCT * TCPSession;
|
||||
struct addrinfo * TCPAddress; // Resolved Address
|
||||
int localport; // for consistancy check
|
||||
int recNum; // This entry's index it Routes table
|
||||
int noV2point2; // Set to force V2.0 connect. Can be set in config or dynamically learned
|
||||
|
||||
} *PROUTE;
|
||||
|
||||
|
|
@ -268,8 +258,10 @@ typedef struct ROUTE
|
|||
|
||||
#define GotRTTRequest 1 // Other end has sent us a RTT Packet
|
||||
#define GotRTTResponse 2 // Other end has sent us a RTT Response
|
||||
#define SentRTTRequest 4
|
||||
#define SentOurRIF 8 // Set when we have sent a rif for our Call and any ApplCalls
|
||||
#define GotRIF 4 // Other end has sent RIF, so is probably an INP3 Node
|
||||
// (could just be monitoring RTT for some reason
|
||||
#define SentRTTRequest 8
|
||||
#define SentOurRIF 16 // Set when we have sent a rif for our Call and any ApplCalls
|
||||
// (only sent when we have seen both a request and response)
|
||||
|
||||
#pragma pack(1)
|
||||
|
|
@ -481,18 +473,18 @@ typedef struct _APPLCALLS
|
|||
typedef struct NR_DEST_ROUTE_ENTRY
|
||||
{
|
||||
struct ROUTE * ROUT_NEIGHBOUR; // POINTER TO NEXT NODE IN PATH
|
||||
uint16_t * Dummy; // Padding so records are same length
|
||||
UCHAR ROUT_QUALITY; // QUALITY
|
||||
UCHAR ROUT_OBSCOUNT;
|
||||
UCHAR ROUT_LOCKED;
|
||||
UCHAR Padding[4]; // So Entries are the same length
|
||||
} *PNR_DEST_ROUTE_ENTRY;
|
||||
|
||||
typedef struct INP3_DEST_ROUTE_ENTRY
|
||||
{
|
||||
struct ROUTE * ROUT_NEIGHBOUR; // POINTER TO NEXT NODE IN PATH
|
||||
uint16_t * RouteLastTT; // Last time sent should be saved for each neighbour. Area is mallod'ed as needed
|
||||
USHORT STT; // Current time to dest from here (was called RTT but is one way not round trip.
|
||||
// Is actually a smoothed value as is calculated from smoothed link times)
|
||||
USHORT LastRTT; // Last Value Reported
|
||||
USHORT RTT; // Current
|
||||
USHORT SRTT; // Smoothed RTT
|
||||
UCHAR Hops;
|
||||
} *PDEST_ROUTE_ENTRY;
|
||||
|
||||
|
|
@ -744,9 +736,6 @@ typedef struct PORTCONTROL
|
|||
UCHAR * BUSY; // % Active (Normally DCD active or TX)
|
||||
|
||||
int Hardware; // TNC H_TYPE. Copied here for access from application context
|
||||
int isRF; // For API reporting. -1 is unspecified
|
||||
int SENDRIFTIMER;
|
||||
time_t LastRIFTime;
|
||||
|
||||
|
||||
} PORTCONTROLX, *PPORTCONTROL;
|
||||
|
|
@ -988,15 +977,6 @@ typedef struct _LINKTABLE
|
|||
int framesRXed;
|
||||
int framesTXed;
|
||||
int framesResent;
|
||||
time_t LastStatusTime;
|
||||
int LastStatusbytesRXed;
|
||||
int LastStatusbytesTXed;
|
||||
int maxQueued;
|
||||
int intervalMaxQueued;
|
||||
|
||||
uint64_t lastPSent; // Time last I frame with P bit sent in mS (for RTT Measurements)
|
||||
int RTT;
|
||||
|
||||
|
||||
// Now support compressing L2 Sessions.
|
||||
// We collect as much data as possible before compressing and re-packetizing
|
||||
|
|
@ -1014,7 +994,6 @@ typedef struct _LINKTABLE
|
|||
|
||||
char ApplName[16];
|
||||
time_t lastStatusSentTime;
|
||||
int apiSeq; // for OARC event reporting
|
||||
|
||||
} LINKTABLE;
|
||||
|
||||
|
|
|
|||
|
|
@ -444,7 +444,7 @@ static size_t ExtProc(int fn, int port, PMESSAGE buff)
|
|||
From[ConvFromAX25(call, &From[1]) + 1] = 0;
|
||||
if (strstr(CantReplyList, From) == 0)
|
||||
{
|
||||
if (strlen(CantReplyList) < 500)
|
||||
if (strlen(CantReplyList) < 500);
|
||||
strcat(CantReplyList, From);
|
||||
Debugprintf("AXIP Packet from %s dropped - can't reply", &From[1]);
|
||||
}
|
||||
|
|
@ -557,7 +557,7 @@ static size_t ExtProc(int fn, int port, PMESSAGE buff)
|
|||
From[ConvFromAX25(call, &From[1]) + 1] = 0;
|
||||
if (strstr(CantReplyList, From) == 0)
|
||||
{
|
||||
if (strlen(CantReplyList) < 500)
|
||||
if (strlen(CantReplyList) < 500);
|
||||
strcat(CantReplyList, From);
|
||||
Debugprintf("AXIP Packet from %s dropped - can't reply", &From[1]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1591,7 +1591,7 @@ extern RECT DebugRect;
|
|||
extern HWND hMonitor;
|
||||
//extern HWND hConsole;
|
||||
//extern RECT ConsoleRect;
|
||||
extern int BBSLogAge;
|
||||
extern int LogAge;
|
||||
extern BOOL DeletetoRecycleBin;
|
||||
extern BOOL SuppressMaintEmail;
|
||||
extern BOOL SaveRegDuringMaint;
|
||||
|
|
|
|||
118
cMain.c
118
cMain.c
|
|
@ -38,7 +38,6 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
|||
#include "cheaders.h"
|
||||
#include "tncinfo.h"
|
||||
#include "mqtt.h"
|
||||
#include "kiss.h"
|
||||
|
||||
VOID L2Routine(struct PORTCONTROL * PORT, PMESSAGE Buffer);
|
||||
VOID ProcessIframe(struct _LINKTABLE * LINK, PDATAMESSAGE Buffer);
|
||||
|
|
@ -58,8 +57,7 @@ VOID L2SENDCOMMAND(struct _LINKTABLE * LINK, int CMD);
|
|||
void WritePacketLogThread(void * param);
|
||||
void hookNodeStarted();
|
||||
void hookNodeRunning();
|
||||
void DeleteLogFiles(int Age);
|
||||
void APIL2Trace(struct _MESSAGE * Message, char * Dirn);
|
||||
void APIL2Trace(struct _MESSAGE * Message, char Dirn);
|
||||
|
||||
#include "configstructs.h"
|
||||
|
||||
|
|
@ -72,15 +70,11 @@ extern int nodeStartedSent;
|
|||
extern SOCKADDR_IN UDPreportdest;
|
||||
extern char NodeAPIServer[80];
|
||||
extern int NodeAPIPort;
|
||||
extern int RIFInterval;
|
||||
|
||||
time_t LastNodeStatus = 0;
|
||||
|
||||
int nodeStatusTimer = 20 * 60; // 20 mins
|
||||
|
||||
|
||||
int LogAge = 10;
|
||||
|
||||
struct PORTCONFIG * PortRec;
|
||||
|
||||
#define RNRSET 0x2 // RNR RECEIVED FROM OTHER END
|
||||
|
|
@ -680,7 +674,6 @@ BOOL Start()
|
|||
struct CMDX * CMD;
|
||||
int PortSlot = 1;
|
||||
uintptr_t int3;
|
||||
int index = 0; // Entry No. in ROUTES
|
||||
|
||||
unsigned char * ptr2 = 0, * ptr3, * ptr4;
|
||||
USHORT * CWPTR;
|
||||
|
|
@ -850,10 +843,6 @@ BOOL Start()
|
|||
MAXLINKS = cfg->C_MAXLINKS;
|
||||
MAXDESTS = cfg->C_MAXDESTS;
|
||||
MAXNEIGHBOURS = cfg->C_MAXNEIGHBOURS;
|
||||
|
||||
if (MAXNEIGHBOURS == 0)
|
||||
MAXNEIGHBOURS = 1;
|
||||
|
||||
MAXCIRCUITS = cfg->C_MAXCIRCUITS;
|
||||
HIDENODES = cfg->C_HIDENODES;
|
||||
|
||||
|
|
@ -892,14 +881,11 @@ BOOL Start()
|
|||
|
||||
PREFERINP3ROUTES = cfg->C_PREFERINP3ROUTES;
|
||||
|
||||
DEBUGINP3 = cfg->C_DEBUGINP3;
|
||||
if (cfg->C_DEBUGINP3)
|
||||
DEBUGINP3 = 0;
|
||||
|
||||
EnableOARCAPI = cfg->C_OARCAPI;
|
||||
|
||||
MONTOFILEFLAG = cfg->C_MONTOFILE;
|
||||
|
||||
RIFInterval = cfg->C_RIFInterval;
|
||||
|
||||
if (cfg->C_OnlyVer2point0)
|
||||
SUPPORT2point2 = 0;
|
||||
|
||||
|
|
@ -1031,7 +1017,6 @@ BOOL Start()
|
|||
PORT->INP3ONLY = PortRec->INP3ONLY;
|
||||
PORT->ALLOWINP3 = PortRec->AllowINP3;
|
||||
PORT->ENABLEINP3 = PortRec->EnableINP3;
|
||||
PORT->isRF = PortRec->isRF;
|
||||
|
||||
PORT->PORTWINDOW = (UCHAR)PortRec->MAXFRAME;
|
||||
|
||||
|
|
@ -1374,7 +1359,6 @@ BOOL Start()
|
|||
char * VIA;
|
||||
char axcall[8];
|
||||
|
||||
|
||||
ConvToAX25(Rcfg->call, ROUTE->NEIGHBOUR_CALL);
|
||||
|
||||
// if VIA convert digis
|
||||
|
|
@ -1419,9 +1403,6 @@ BOOL Start()
|
|||
ROUTE->NoKeepAlive = 0; // Cant have INP3 and NOKEEPALIVES
|
||||
}
|
||||
|
||||
if (Rcfg->noV2point2)
|
||||
ROUTE->noV2point2 = 1;
|
||||
|
||||
ROUTE->NBOUR_MAXFRAME = Rcfg->pwind & 0x3f;
|
||||
|
||||
FRACK = Rcfg->pfrack;
|
||||
|
|
@ -1435,13 +1416,8 @@ BOOL Start()
|
|||
{
|
||||
ROUTE->TCPHost = Rcfg->tcphost;
|
||||
ROUTE->TCPPort = Rcfg->tcpport;
|
||||
|
||||
ROUTE->TCPAddress = (struct addrinfo *)zalloc(sizeof(struct addrinfo));
|
||||
ROUTE->TCPAddress->ai_addr = (struct sockaddr *) zalloc(sizeof(struct sockaddr));
|
||||
}
|
||||
|
||||
ROUTE->recNum = index++;
|
||||
|
||||
Rcfg++;
|
||||
ROUTE++;
|
||||
}
|
||||
|
|
@ -1601,11 +1577,6 @@ BOOL Start()
|
|||
if (AUTOSAVEMH)
|
||||
ReadMH(); // Only if AutoSave configured
|
||||
|
||||
// Tidy Log Files
|
||||
|
||||
DeleteLogFiles(LogAge);
|
||||
|
||||
|
||||
// set up stream number in BPQHOSTVECTOR
|
||||
|
||||
for (i = 0; i < 64; i++)
|
||||
|
|
@ -1680,19 +1651,14 @@ BOOL FindNeighbour(UCHAR * Call, int Port, struct ROUTE ** REQROUTE)
|
|||
{
|
||||
struct ROUTE * ROUTE = NEIGHBOURS;
|
||||
struct ROUTE * FIRSTSPARE = NULL;
|
||||
int n = MAXNEIGHBOURS;
|
||||
char Normcall[10];
|
||||
int n;
|
||||
|
||||
for (n = 0; n < MAXNEIGHBOURS; n++)
|
||||
while (n--)
|
||||
{
|
||||
if (ROUTE->NEIGHBOUR_CALL[0] == 0) // Spare
|
||||
{
|
||||
if (FIRSTSPARE == NULL)
|
||||
{
|
||||
FIRSTSPARE = ROUTE;
|
||||
ROUTE->recNum = n;
|
||||
}
|
||||
}
|
||||
|
||||
if (ROUTE->NEIGHBOUR_PORT != Port)
|
||||
{
|
||||
|
|
@ -1700,6 +1666,7 @@ BOOL FindNeighbour(UCHAR * Call, int Port, struct ROUTE ** REQROUTE)
|
|||
continue;
|
||||
}
|
||||
|
||||
|
||||
Normcall[ConvFromAX25(ROUTE->NEIGHBOUR_CALL, Normcall)] = 0;
|
||||
|
||||
if (CompareCalls(ROUTE->NEIGHBOUR_CALL, Call))
|
||||
|
|
@ -1713,7 +1680,6 @@ BOOL FindNeighbour(UCHAR * Call, int Port, struct ROUTE ** REQROUTE)
|
|||
// ENTRY NOT FOUND - FIRSTSPARE HAS FIRST FREE ENTRY, OR ZERO IF TABLE FULL
|
||||
|
||||
*REQROUTE = FIRSTSPARE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -2062,7 +2028,7 @@ VOID ReadNodes()
|
|||
ptr = strtok_s(NULL, seps, &Context); // INP3
|
||||
if (ptr == NULL) continue;
|
||||
|
||||
if (ROUTE->NEIGHBOUR_FLAG == 0 || ROUTE->OtherendLocked == 0) // Not LOCKED ROUTE
|
||||
if (ROUTE->NEIGHBOUR_FLAG == 0 || ROUTE->OtherendLocked == 0); // Not LOCKED ROUTE
|
||||
ROUTE->OtherendsRouteQual = atoi(ptr);
|
||||
|
||||
ptr = strtok_s(NULL, seps, &Context); // INP3
|
||||
|
|
@ -2313,7 +2279,7 @@ VOID TIMERINTERRUPT()
|
|||
Message = (struct _MESSAGE *)Buffer;
|
||||
|
||||
if(NodeAPISocket)
|
||||
APIL2Trace(Message, "sent");
|
||||
APIL2Trace(Message, 'T');
|
||||
|
||||
Message->PORT |= 0x80; // Set TX Bit
|
||||
|
||||
|
|
@ -2427,8 +2393,8 @@ L2Packet:
|
|||
if (MQTT && PORT->PROTOCOL == 0)
|
||||
MQTTKISSRX(Buffer);
|
||||
|
||||
if(NodeAPISocket && PORT->PROTOCOL == 0)
|
||||
APIL2Trace(Message, "rcvd");
|
||||
if(NodeAPISocket &&PORT->PROTOCOL == 0)
|
||||
APIL2Trace(Message, 'R');
|
||||
|
||||
// Bridge if requested
|
||||
|
||||
|
|
@ -2799,7 +2765,6 @@ VOID INITIALISEPORTS()
|
|||
{
|
||||
char INITMSG[80];
|
||||
struct PORTCONTROL * PORT = PORTTABLE;
|
||||
struct PORTCONTROL * SAVEPORT;
|
||||
|
||||
while (PORT)
|
||||
{
|
||||
|
|
@ -2807,68 +2772,7 @@ VOID INITIALISEPORTS()
|
|||
WritetoConsoleLocal(INITMSG);
|
||||
|
||||
PORT->PORTINITCODE(PORT);
|
||||
SAVEPORT=PORT;
|
||||
|
||||
// See if it is an RF port
|
||||
|
||||
if (PORT->isRF == -1) // Not set
|
||||
{
|
||||
// Try to determine if RF
|
||||
|
||||
if (PORT->PORTTYPE == 0)
|
||||
{
|
||||
struct KISSINFO * KISS = (struct KISSINFO *)PORT;
|
||||
NPASYINFO Port;
|
||||
|
||||
if (KISS->FIRSTPORT && KISS->FIRSTPORT != KISS)
|
||||
{
|
||||
// Not first port on device
|
||||
|
||||
PORT = (struct PORTCONTROL *)KISS->FIRSTPORT;
|
||||
}
|
||||
|
||||
Port = KISSInfo[PORT->PORTNUMBER];
|
||||
|
||||
if (Port)
|
||||
{
|
||||
// KISS like
|
||||
|
||||
if (PORT->PORTIPADDR.s_addr || PORT->KISSSLAVE)
|
||||
{
|
||||
// KISS over UDP or TCP
|
||||
|
||||
if (PORT->KISSTCP)
|
||||
PORT->isRF = 1; // Assume TCP is RF (software modem)
|
||||
else
|
||||
PORT->isRF = 0; // Assuem UDP is Internet
|
||||
}
|
||||
else
|
||||
PORT->isRF = 1; // Serial port
|
||||
}
|
||||
}
|
||||
else if (PORT->PORTTYPE == 14) // Loopback
|
||||
PORT->isRF = 0;
|
||||
|
||||
else if (PORT->PORTTYPE == 16) // External
|
||||
{
|
||||
if (PORT->PROTOCOL == 10) // 'HF' Port
|
||||
{
|
||||
struct TNCINFO * TNC = TNCInfo[PORT->PORTNUMBER];
|
||||
|
||||
if (TNC && TNC->Hardware == H_TELNET)
|
||||
PORT->isRF = 0;
|
||||
else
|
||||
PORT->isRF = 1; // ARDOP etc
|
||||
}
|
||||
else
|
||||
{
|
||||
// External but not HF - AXIP, BPQETHER VKISS, ??
|
||||
|
||||
PORT->isRF = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
PORT = SAVEPORT->PORTPOINTER;
|
||||
PORT = PORT->PORTPOINTER;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
27
compatbits.c
27
compatbits.c
|
|
@ -25,8 +25,6 @@ Stuff to make compiling on WINDOWS and LINUX easier
|
|||
|
||||
#ifdef WIN32
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
typedef unsigned int uint32_t;
|
||||
|
||||
#define pthread_t uint32_t
|
||||
|
|
@ -43,7 +41,6 @@ int pthread_equal(pthread_t T1, pthread_t T2)
|
|||
#include <syslog.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define BOOL int
|
||||
|
||||
|
|
@ -191,27 +188,3 @@ void closesocket(int sock)
|
|||
}
|
||||
|
||||
#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,7 +24,6 @@ Stuff to make compiling on WINDOWS and LINUX easier
|
|||
|
||||
#define strtoll _strtoi64
|
||||
|
||||
|
||||
#ifdef _WIN64
|
||||
#include "stdint.h"
|
||||
#else
|
||||
|
|
@ -220,7 +219,7 @@ typedef struct tagRECT
|
|||
|
||||
#endif
|
||||
|
||||
uint32_t GetTickCountINP3();
|
||||
|
||||
|
||||
#ifdef LINBPQ
|
||||
|
||||
|
|
|
|||
111
config.c
111
config.c
|
|
@ -310,9 +310,7 @@ static char *keywords[] =
|
|||
"LogL4Connects", "LogAllConnects", "SAVEMH", "ENABLEADIFLOG", "ENABLEEVENTS", "SAVEAPRSMSGS",
|
||||
"EnableM0LTEMap", "MQTT", "MQTT_HOST", "MQTT_PORT", "MQTT_USER", "MQTT_PASS",
|
||||
"L4Compress", "L4CompMaxframe", "L4CompPaclen", "L2Compress", "L2CompMaxframe",
|
||||
"L2CompPaclen", "PREFERINP3ROUTES", "OnlyVer2point0", "DEBUGINP3", "ENABLEOARCAPI", "MONTOFILE",
|
||||
"RIFInterval"
|
||||
|
||||
"L2CompPaclen", "PREFERINP3ROUTES", "OnlyVer2point0", "DEBUGINP3", "ENABLEOARCAPI"
|
||||
}; /* parameter keywords */
|
||||
|
||||
static void * offset[] =
|
||||
|
|
@ -336,8 +334,7 @@ static void * offset[] =
|
|||
&xxcfg.C_LogL4Connects, &xxcfg.C_LogAllConnects, &xxcfg.C_SaveMH, &xxcfg.C_ADIF, &xxcfg.C_EVENTS, &xxcfg.C_SaveAPRSMsgs,
|
||||
&xxcfg.C_M0LTEMap, &xxcfg.C_MQTT, &xxcfg.C_MQTT_HOST, &xxcfg.C_MQTT_PORT, &xxcfg.C_MQTT_USER, &xxcfg.C_MQTT_PASS,
|
||||
&xxcfg.C_L4Compress, &xxcfg.C_L4CompMaxframe, &xxcfg.C_L4CompPaclen, &xxcfg.C_L2Compress, &xxcfg.C_L2CompMaxframe,
|
||||
&xxcfg.C_L2CompPaclen, &xxcfg.C_PREFERINP3ROUTES, &xxcfg.C_OnlyVer2point0, &xxcfg.C_DEBUGINP3, &xxcfg.C_OARCAPI, &xxcfg.C_MONTOFILE,
|
||||
&xxcfg.C_RIFInterval}; /* offset for corresponding data in config file */
|
||||
&xxcfg.C_L2CompPaclen, &xxcfg.C_PREFERINP3ROUTES, &xxcfg.C_OnlyVer2point0, &xxcfg.C_DEBUGINP3, &xxcfg.C_OARCAPI}; /* offset for corresponding data in config file */
|
||||
|
||||
static int routine[] =
|
||||
{
|
||||
|
|
@ -360,8 +357,7 @@ static int routine[] =
|
|||
2, 2, 1, 2, 2, 2,
|
||||
2, 2, 0, 1, 20, 20,
|
||||
1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1,
|
||||
1}; // Routine to process param
|
||||
1, 1, 1, 1, 1}; // Routine to process param
|
||||
|
||||
int PARAMLIM = sizeof(routine)/sizeof(int);
|
||||
//int NUMBEROFKEYWORDS = sizeof(routine)/sizeof(int);
|
||||
|
|
@ -383,8 +379,7 @@ static char *pkeywords[] =
|
|||
"BCALL", "DIGIMASK", "NOKEEPALIVES", "COMPORT", "DRIVER", "WL2KREPORT", "UIONLY",
|
||||
"UDPPORT", "IPADDR", "I2CBUS", "I2CDEVICE", "UDPTXPORT", "UDPRXPORT", "NONORMALIZE",
|
||||
"IGNOREUNLOCKEDROUTES", "INP3ONLY", "TCPPORT", "RIGPORT", "PERMITTEDAPPLS", "HIDE",
|
||||
"SMARTID", "KISSCOMMAND", "SendtoM0LTEMap", "PortFreq", "M0LTEMapInfo", "QTSMPort",
|
||||
"ALLOWINP3", "ENABLEINP3", "isRF"}; /* parameter keywords */
|
||||
"SMARTID", "KISSCOMMAND", "SendtoM0LTEMap", "PortFreq", "M0LTEMapInfo", "QTSMPort", "ALLOWINP3", "ENABLEINP3"}; /* parameter keywords */
|
||||
|
||||
static void * poffset[] =
|
||||
{
|
||||
|
|
@ -398,8 +393,7 @@ static void * poffset[] =
|
|||
&xxp.BCALL, &xxp.DIGIMASK, &xxp.DefaultNoKeepAlives, &xxp.IOADDR, &xxp.DLLNAME, &xxp.WL2K, &xxp.UIONLY,
|
||||
&xxp.IOADDR, &xxp.IPADDR, &xxp.INTLEVEL, &xxp.IOADDR, &xxp.IOADDR, &xxp.ListenPort, &xxp.NoNormalize,
|
||||
&xxp.IGNOREUNLOCKED, &xxp.INP3ONLY, &xxp.TCPPORT, &xxp.RIGPORT, &xxp.PERMITTEDAPPLS, &xxp.Hide,
|
||||
&xxp.SmartID, &xxp.KissParams, &xxp.SendtoM0LTEMap, &xxp.PortFreq, &xxp.M0LTEMapInfo, &xxp.QtSMPort,
|
||||
&xxp.AllowINP3, &xxp.EnableINP3, &xxp.isRF}; /* offset for corresponding data in config file */
|
||||
&xxp.SmartID, &xxp.KissParams, &xxp.SendtoM0LTEMap, &xxp.PortFreq, &xxp.M0LTEMapInfo, &xxp.QtSMPort, &xxp.AllowINP3, &xxp.EnableINP3}; /* offset for corresponding data in config file */
|
||||
|
||||
static int proutine[] =
|
||||
{
|
||||
|
|
@ -413,8 +407,7 @@ static int proutine[] =
|
|||
0, 1, 2, 18, 15, 16, 2,
|
||||
1, 17, 1, 1, 1, 1, 2,
|
||||
2, 2, 1, 1, 19, 2,
|
||||
1, 20, 1, 21, 22, 1,
|
||||
1, 1, 1}; /* routine to process parameter */
|
||||
1, 20, 1, 21, 22, 1, 1, 1}; /* routine to process parameter */
|
||||
|
||||
int PPARAMLIM = sizeof(proutine)/sizeof(int);
|
||||
|
||||
|
|
@ -564,6 +557,7 @@ BOOL ProcessConfig()
|
|||
heading = 1;
|
||||
}
|
||||
|
||||
|
||||
paramok[6]=1; /* dont need BUFFERS */
|
||||
paramok[8]=1; /* dont need TRANSDELAY */
|
||||
paramok[13]=1; // NodeAlias
|
||||
|
|
@ -613,36 +607,34 @@ BOOL ProcessConfig()
|
|||
paramok[45+i]=1; /* or APPLCALLS, APPLALIASS APPLQUAL */
|
||||
|
||||
paramok[69]=1; // BText optional
|
||||
paramok[70]=1; // NETROMCALL optional
|
||||
paramok[70]=1; // IPGateway optional
|
||||
paramok[71]=1; // C_IS_CHAT optional
|
||||
|
||||
paramok[72]=1; // MAXRTT optional
|
||||
paramok[73]=1; // MAXTT optional
|
||||
paramok[74]=1; // MAXHOPS optional
|
||||
paramok[75]=1; // LogL4Connects optional
|
||||
paramok[76]=1; // LogAllConnects optional
|
||||
paramok[77]=1; // SAVEMH optional
|
||||
paramok[78]=1; // ENABLEADIFLOG optional
|
||||
paramok[79]=1; // EnableEvents optional
|
||||
paramok[80]=1; // SaveAPRSMsgs optional
|
||||
paramok[81]=1; // EnableM0LTEMap optional
|
||||
paramok[73]=1; // MAXHOPS optional
|
||||
paramok[74]=1; // LogL4Connects optional
|
||||
paramok[75]=1; // LogAllConnects optional
|
||||
paramok[76]=1; // SAVEMH optional
|
||||
paramok[77]=1; // ENABLEADIFLOG optional
|
||||
paramok[78]=1; // EnableEvents optional
|
||||
paramok[79]=1; // SaveAPRSMsgs optional
|
||||
paramok[79]=1; // SaveAPRSMsgs optional
|
||||
paramok[80]=1; // EnableM0LTEMap optional
|
||||
paramok[81]=1; // MQTT Params
|
||||
paramok[82]=1; // MQTT Params
|
||||
paramok[83]=1; // MQTT Params
|
||||
paramok[84]=1; // MQTT Params
|
||||
paramok[85]=1; // MQTT Params
|
||||
paramok[86]=1; // MQTT Params
|
||||
paramok[87]=1; // L4Compress
|
||||
paramok[88]=1; // L4Compress Maxframe
|
||||
paramok[89]=1; // L4Compress Paclen
|
||||
paramok[90]=1; // L2Compress
|
||||
paramok[91]=1; // L2Compress Maxframe
|
||||
paramok[92]=1; // L2Compress Paclen
|
||||
paramok[93]=1; // PREFERINP3ROUTES
|
||||
paramok[94]=1; // ONLYVer2point0
|
||||
paramok[95]=1; // DEBUGINP3
|
||||
paramok[96]=1; // EnableOARCAPI
|
||||
paramok[97]=1; // MONTOFILE
|
||||
paramok[98]=1; // RIFInterval
|
||||
|
||||
paramok[86]=1; // L4Compress
|
||||
paramok[87]=1; // L4Compress Maxframe
|
||||
paramok[88]=1; // L4Compress Paclen
|
||||
paramok[89]=1; // L2Compress
|
||||
paramok[90]=1; // L2Compress Maxframe
|
||||
paramok[91]=1; // L2Compress Paclen
|
||||
paramok[92]=1; // PREFERINP3ROUTES
|
||||
paramok[93]=1; // ONLYVer2point0
|
||||
paramok[94]=1; // DEBUGINP3
|
||||
paramok[95]=1; // EnableOARCAPI
|
||||
|
||||
for (i=0; i < PARAMLIM; i++)
|
||||
{
|
||||
|
|
@ -654,7 +646,7 @@ BOOL ProcessConfig()
|
|||
Consoleprintf("The following parameters were not correctly specified");
|
||||
heading = 1;
|
||||
}
|
||||
Consoleprintf("%s", keywords[i]);
|
||||
Consoleprintf(keywords[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1683,15 +1675,7 @@ int routes(int i)
|
|||
char * val = strtok_s(NULL, " ,=", &context);
|
||||
|
||||
if (val)
|
||||
Route->nokeepalives = atoi(val);
|
||||
}
|
||||
|
||||
else if (strcmp(ptr, "NOV2.2") == 0)
|
||||
{
|
||||
char * val = strtok_s(NULL, " ,=", &context);
|
||||
|
||||
if (val)
|
||||
Route->noV2point2 = atoi(val);
|
||||
Route->farQual = atoi(val);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1834,7 +1818,6 @@ int ports(int i)
|
|||
}
|
||||
|
||||
xxp.SendtoM0LTEMap = 1; // Default to enabled
|
||||
xxp.isRF = -1; // Default to undefined
|
||||
|
||||
while (endport == 0 && !feof(fp1))
|
||||
{
|
||||
|
|
@ -3080,39 +3063,13 @@ int simple(int i)
|
|||
|
||||
/* Set PARAMOK flags on all values that are defaulted */
|
||||
|
||||
for (i=0; i < PARAMLIM; i++)
|
||||
paramok[i]=1;
|
||||
|
||||
paramok[15] = 0; // Must have callsign
|
||||
paramok[45] = 0; // Dont Have Appl1Call
|
||||
paramok[53] = 0; // or APPL1ALIAS
|
||||
|
||||
// Set defined flag on defaulted params
|
||||
|
||||
paramok[0] = 1; // OBSINIT
|
||||
paramok[1] = 1; // OBSMIN
|
||||
paramok[2] = 1; // NODESINTERVAL
|
||||
paramok[3] = 1; // L3TIMETOLIVE
|
||||
paramok[4] = 1; // L4RETRIES
|
||||
paramok[5] = 1; // L4TIMEOUT
|
||||
paramok[7] = 1; // PACLEN
|
||||
paramok[9] = 1; // T3
|
||||
paramok[10] = 1; // IDLETIME
|
||||
paramok[11] = 1; // BBS
|
||||
paramok[12] = 1; // NODE
|
||||
paramok[18] = 1; // IDMSG:
|
||||
paramok[19] = 1; // INFOMSG:
|
||||
paramok[22] = 1; // MAXLINKS
|
||||
paramok[23] = 1; // MAXNODES
|
||||
paramok[24] = 1; // MAXROUTES
|
||||
paramok[25] = 1; // MAXCIRCUITS
|
||||
paramok[26] = 1; // IDINTERVAL
|
||||
paramok[27] = 1; // MINQUAL
|
||||
paramok[28] = 1; // HIDENODES
|
||||
paramok[29] = 1; // L4DELAY
|
||||
paramok[30] = 1; // L4WINDOW
|
||||
paramok[31] = 1; // BTINTERVAL
|
||||
paramok[36] = 1; // CTEXT:
|
||||
paramok[39] = 1; // ENABLE_LINKED
|
||||
paramok[41] = 1; // FULL_CTEXT
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ struct PORTCONFIG
|
|||
int QtSMPort;
|
||||
int AllowINP3;
|
||||
int EnableINP3;
|
||||
short isRF;
|
||||
};
|
||||
|
||||
struct ROUTECONFIG
|
||||
|
|
@ -97,7 +96,6 @@ struct ROUTECONFIG
|
|||
int farQual;
|
||||
int inp3;
|
||||
int nokeepalives;
|
||||
int noV2point2;
|
||||
char * tcphost;
|
||||
int tcpport;
|
||||
};
|
||||
|
|
@ -188,9 +186,6 @@ struct CONFIGTABLE
|
|||
int C_OnlyVer2point0;
|
||||
int C_DEBUGINP3;
|
||||
int C_OARCAPI;
|
||||
int C_MONTOFILE;
|
||||
int C_RIFInterval;
|
||||
|
||||
|
||||
|
||||
//#define ApplOffset 80000 // Applications offset in config buffer
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ int DEBUGINP3 = 0;
|
|||
|
||||
int EnableOARCAPI = 0;
|
||||
|
||||
int RTTInterval = 30; // 10 second increments - 5 Minutes
|
||||
int RTTInterval = 24; // 4 Minutes
|
||||
|
||||
BOOL IPRequired = FALSE;
|
||||
BOOL PMRequired = FALSE;
|
||||
|
|
|
|||
11
debian/NEWS
vendored
11
debian/NEWS
vendored
|
|
@ -1,11 +0,0 @@
|
|||
linbpq (6.0.24.22-2) unstable; urgency=medium
|
||||
|
||||
This is quite a big update, with config moving from /opt/oarc/bpq/bpq32.cfg to
|
||||
/etc/bpq32.cfg. The system shall do this automatically for you, however
|
||||
computers and their programmers are not perfect.
|
||||
|
||||
I strongly recommend at this point backing up your entire
|
||||
/opt/oarc/bpq/ directory (cp -r /opt/oarc/bpq/ ~/bpq-backup/) before
|
||||
proceeding with the upgrade
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Sat, 16 Dec 2023 13:30:06 +0000
|
||||
23
debian/README.Debian
vendored
23
debian/README.Debian
vendored
|
|
@ -1,23 +0,0 @@
|
|||
README for linbpq on Debian
|
||||
===========================
|
||||
|
||||
Please see https://wiki.oarc.uk/packet:linbpq-apt-installation for this guide
|
||||
|
||||
# Set config
|
||||
Copy the config, edit it & set permissions.
|
||||
The permissions are so linbpq web interface can edit the config.
|
||||
|
||||
sudo mv /usr/share/doc/linbpq/examples/bpq32.cfg /etc/bpq32.cfg
|
||||
sudo nano /etc/bpq32.cfg
|
||||
sudo chown :linbpq /etc/bpq32.cfg
|
||||
sudo chmod 644 /etc/bpq32.cfg
|
||||
|
||||
# Start linbpq
|
||||
|
||||
sudo systemctl start linbpq
|
||||
|
||||
# Access your node
|
||||
|
||||
It shall be available by accessing http://localhost:8008 in the browser or telnet localhost 8010
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 26 Mar 2024 00:53:42 +0000
|
||||
50
debian/bpq32.cfg
vendored
50
debian/bpq32.cfg
vendored
|
|
@ -1,50 +0,0 @@
|
|||
SIMPLE
|
||||
NODECALL=MB7NAA
|
||||
NODEALIAS=AANODE
|
||||
LOCATOR=AA00aa
|
||||
PASSWORD=xxxxxxxx
|
||||
AUTOSAVE=1
|
||||
NODESINTERVAL=10
|
||||
MINQUAL=10
|
||||
CTEXT:
|
||||
Thanks for connecting.
|
||||
Type ? for help.
|
||||
***
|
||||
PORT
|
||||
PORTNUM=1
|
||||
ID=VHF
|
||||
TYPE=ASYNC
|
||||
PROTOCOL=KISS
|
||||
KISSOPTIONS=ACKMODE
|
||||
COMPORT=/dev/ttyACM0
|
||||
SPEED=57600
|
||||
FRACK=4000
|
||||
PACLEN=150
|
||||
DIGIFLAG=0
|
||||
QUALITY=192
|
||||
MINQUAL=20
|
||||
ENDPORT
|
||||
|
||||
|
||||
PORT
|
||||
PORTNUM=9
|
||||
ID=Telnet
|
||||
DRIVER=Telnet
|
||||
CONFIG
|
||||
LOGGING=1
|
||||
CMS=1
|
||||
DisconnectOnClose=1
|
||||
SECURETELNET=1
|
||||
TCPPORT=8010
|
||||
FBBPORT=8011
|
||||
HTTPPORT=8008
|
||||
LOGINPROMPT=user:
|
||||
PASSWORDPROMPT=password:
|
||||
MAXSESSIONS=10
|
||||
CTEXT=Thanks for connecting\n Enter ? for list of commands\n\n
|
||||
USER=username,xxxxxxxx,m0aaa,,SYSOP
|
||||
ENDPORT
|
||||
|
||||
LINCHAT
|
||||
|
||||
APPLICATION 2,CHAT,,MB7NAA-9,AACHAT,255
|
||||
359
debian/changelog
vendored
359
debian/changelog
vendored
|
|
@ -1,359 +0,0 @@
|
|||
linbpq (6.0.25.15+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream version 6.0.25.15+repack
|
||||
* Remove Patch for TelnetV6, fixed upstream
|
||||
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Wed, 07 Jan 2026 21:53:20 +0000
|
||||
|
||||
linbpq (6.0.25.13+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
|
||||
|
||||
* 6.0.25.12 hacky merge due t it not ffing.
|
||||
* New upstream version 6.0.25.13+repack
|
||||
* Patch TelnetV6 to build
|
||||
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 23 Dec 2025 16:45:56 +0000
|
||||
|
||||
linbpq (6.0.25.12+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream version 6.0.25.12+repack
|
||||
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Sat, 22 Nov 2025 15:11:09 +0000
|
||||
|
||||
linbpq (6.0.25.11+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream version 6.0.25.11+repack
|
||||
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 11 Nov 2025 21:52:58 +0000
|
||||
|
||||
linbpq (6.0.25.9+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream version 6.0.25.9+repack
|
||||
* Refresh patches
|
||||
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Sun, 09 Nov 2025 22:45:07 +0000
|
||||
|
||||
linbpq (6.0.25.8+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
|
||||
|
||||
* Build on latest gcc standards
|
||||
* New upstream version 6.0.25.8+repack
|
||||
* Refresh patches with gbp pq!
|
||||
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Fri, 24 Oct 2025 00:45:16 +0100
|
||||
|
||||
linbpq (6.0.25.06+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream version 6.0.25.06+repack
|
||||
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Fri, 10 Oct 2025 23:42:04 +0100
|
||||
|
||||
linbpq (6.0.25.1+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream version 6.0.25.1+repack
|
||||
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Sat, 20 Sep 2025 15:43:32 +0100
|
||||
|
||||
linbpq (6.0.24.82+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream version 6.0.24.82+repack
|
||||
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Sun, 17 Aug 2025 22:36:49 +0100
|
||||
|
||||
linbpq (6.0.24.78+repack-1~hibbian~TRIXIE+1) trixie-hibbian-unstable; urgency=medium
|
||||
|
||||
* New Upstream
|
||||
* New files excluded
|
||||
- No binaries in this release at all maybe!
|
||||
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Thu, 31 Jul 2025 01:31:38 +0100
|
||||
|
||||
linbpq (6.0.24.77+repack-1~hibbian~TRIXIE+1) trixie-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream version 6.0.24.77+repack
|
||||
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 22 Jul 2025 21:46:13 +0100
|
||||
|
||||
linbpq (6.0.24.75+repack-1~hibbian~TRIXIE+2) trixie-hibbian-unstable; urgency=medium
|
||||
|
||||
* First trixie release
|
||||
* Drop hard-dep on hibbian-archive-keyring
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Wed, 16 Jul 2025 19:10:33 +0100
|
||||
|
||||
linbpq (6.0.24.75+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream version 6.0.25.75+repack
|
||||
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 15 Jul 2025 01:10:43 +0100
|
||||
|
||||
linbpq (6.0.24.71+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream version 6.0.24.67+repack
|
||||
* New upstream version 6.0.24.69+repack
|
||||
* New upstream version 6.0.24.69.1+repack
|
||||
* New upstream version 6.0.24.71+repack
|
||||
* Okay that's a lot of updates.
|
||||
* Refreshed d/p/makefile to reflect new CFLAG
|
||||
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Wed, 21 May 2025 21:45:59 +0100
|
||||
|
||||
linbpq (6.0.24.66+repack-1~hibbian+2) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* Update postinst script to be a little quieter
|
||||
* MINI_BUILDD_OPTION:
|
||||
auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 11 Mar 2025 00:51:35 +0000
|
||||
|
||||
linbpq (6.0.24.66+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream version 6.0.24.66+repack
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 04 Mar 2025 22:50:09 +0000
|
||||
|
||||
linbpq (6.0.24.65+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New Upstream
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 25 Feb 2025 09:33:24 +0000
|
||||
|
||||
linbpq (6.0.24.59a+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New Upstream
|
||||
* Little tweaks to makefile patch to account for new -rdynamic
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Mon, 03 Feb 2025 22:32:11 +0000
|
||||
|
||||
linbpq (6.0.24.56+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New Upstream
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Mon, 06 Jan 2025 21:37:44 +0000
|
||||
|
||||
linbpq (6.0.24.55+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New Upstream
|
||||
* d/rules
|
||||
- Increased hardening
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Sun, 05 Jan 2025 23:35:06 +0000
|
||||
|
||||
linbpq (6.0.24.54+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New Upstream
|
||||
* Drop AGW Patch
|
||||
* Drop Spelling Patch
|
||||
* Drop Dynamic Links patch
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 17 Dec 2024 16:46:05 +0000
|
||||
|
||||
linbpq (6.0.24.53+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream
|
||||
- Patches refreshed
|
||||
- dropped some edits in ftbfs-gcc14
|
||||
- dropped d/patches/headers.patch
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 03 Dec 2024 00:57:57 +0000
|
||||
|
||||
linbpq (6.0.24.52+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream
|
||||
- Patches happy
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Sat, 30 Nov 2024 21:47:17 +0000
|
||||
|
||||
linbpq (6.0.24.51.1+repack-1~hibbian+2) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* Iron out an issue with time...
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Fri, 29 Nov 2024 19:57:28 +0000
|
||||
|
||||
linbpq (6.0.24.51.1+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream import after bug report
|
||||
* Roll back some ftbfs-gcc14 edits
|
||||
* Remove some more lib headers
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Fri, 29 Nov 2024 19:30:22 +0000
|
||||
|
||||
linbpq (6.0.24.51+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream import
|
||||
- Patches refreshed
|
||||
* Upstream is now repacked to include less files
|
||||
* Big build system review, now using Debian CFLAGS and LDFLAGS
|
||||
- Hardening enabled, mostly
|
||||
- A debug symbols package is now available
|
||||
* Oh yeah, everything is now dynamic linking
|
||||
- libpng
|
||||
- libpaho-mqtt
|
||||
- libjansson
|
||||
- libminiupnpc
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Fri, 29 Nov 2024 13:08:38 +0000
|
||||
|
||||
linbpq (6.0.24.50-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream import
|
||||
* Files excluded at origtargz generation time for cleanliness
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 12 Nov 2024 21:56:38 +0000
|
||||
|
||||
linbpq (6.0.24.49-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New Upstream import
|
||||
* Patches refreshed
|
||||
* Add mqtt requirements
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 05 Nov 2024 21:52:29 +0000
|
||||
|
||||
linbpq (6.0.24.45-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* New upstream import
|
||||
* Patches refreshed
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Fri, 11 Oct 2024 15:48:41 +0100
|
||||
|
||||
linbpq (6.0.24.42-1~hibbian+3) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* 32bit build error
|
||||
- Patch updated to fix hopefully
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Fri, 30 Aug 2024 12:21:57 +0100
|
||||
|
||||
linbpq (6.0.24.42-1~hibbian+2) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* Forgot to fix the ninotnc-smt issue, fixed now
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Fri, 30 Aug 2024 12:05:54 +0100
|
||||
|
||||
linbpq (6.0.24.42-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
|
||||
|
||||
* Install config to /etc
|
||||
* New upstream update
|
||||
* Patches refreshed
|
||||
* Debian hardening enabled
|
||||
- 2 new patches created that touch almost every file
|
||||
- Considered experimental.
|
||||
- gcc14 builds for Debian Trixie!
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Fri, 30 Aug 2024 10:15:11 +0100
|
||||
|
||||
linbpq (6.0.24.40-1) unstable; urgency=medium
|
||||
|
||||
* Fresh upstream release
|
||||
- Patches refreshed
|
||||
* Secure by default patch
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Sun, 07 Jul 2024 16:09:28 +0100
|
||||
|
||||
linbpq (6.0.24.38-1) unstable; urgency=medium
|
||||
|
||||
* New Upstream
|
||||
* Tweak config file per recommendation from 2M0MQN to make first start simple
|
||||
* Bump standards to 4.7.0.0
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Sun, 09 Jun 2024 22:38:40 +0100
|
||||
|
||||
linbpq (6.0.24.34-2) unstable; urgency=medium
|
||||
|
||||
* Fix config permissions bug as reported by Alex 2E1PKY
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Mon, 08 Apr 2024 22:27:02 +0100
|
||||
|
||||
linbpq (6.0.24.34-1) unstable; urgency=medium
|
||||
|
||||
* Upstream bump
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Sat, 06 Apr 2024 02:15:28 +0100
|
||||
|
||||
linbpq (6.0.24.33-1) unstable; urgency=medium
|
||||
|
||||
* Upstream bump
|
||||
* Moved config file to examples
|
||||
* Updated service to fail on no config
|
||||
* Added helpful README.Debian
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 26 Mar 2024 20:24:08 +0000
|
||||
|
||||
linbpq (6.0.24.30-1) unstable; urgency=medium
|
||||
|
||||
* Upstream bump
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Fri, 23 Feb 2024 23:24:46 +0000
|
||||
|
||||
linbpq (6.0.24.29-1) unstable; urgency=medium
|
||||
|
||||
* Upstream bump
|
||||
* Added my new details
|
||||
* Tidied up some packaging errors
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 13 Feb 2024 00:06:33 +0000
|
||||
|
||||
linbpq (6.0.24.27-2) unstable; urgency=medium
|
||||
|
||||
* Permissions fix for web-config-editor users
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Thu, 18 Jan 2024 10:31:56 +0000
|
||||
|
||||
linbpq (6.0.24.27-1) unstable; urgency=medium
|
||||
|
||||
* New Upstream Release
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Tue, 16 Jan 2024 20:51:43 +0000
|
||||
|
||||
linbpq (6.0.24.25-1) unstable; urgency=medium
|
||||
|
||||
* New Upstream Release
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Thu, 28 Dec 2023 10:44:47 +0000
|
||||
|
||||
linbpq (6.0.24.22-2) unstable; urgency=medium
|
||||
|
||||
* Moved config file home, caused chaos
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Sat, 16 Dec 2023 14:40:20 +0000
|
||||
|
||||
linbpq (6.0.24.22-1) unstable; urgency=medium
|
||||
|
||||
* New Upstream Release
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Fri, 08 Dec 2023 12:29:40 +0000
|
||||
|
||||
linbpq (6.0.24.16-1) unstable; urgency=medium
|
||||
|
||||
* New Upstream release
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Tue, 31 Oct 2023 22:50:01 +0000
|
||||
|
||||
linbpq (6.0.24.15-2) unstable; urgency=medium
|
||||
|
||||
* debian/conffiles introduced to stop linbpq overwriting config files
|
||||
- Thanks to Mark 2M0IIG for raising concern about this bug!
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Sun, 15 Oct 2023 21:45:24 +0100
|
||||
|
||||
linbpq (6.0.24.15-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Tue, 10 Oct 2023 22:19:48 +0100
|
||||
|
||||
linbpq (6.0.24.2-1) unstable; urgency=medium
|
||||
|
||||
* Initial release.
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Mon, 28 Aug 2023 23:20:45 +0100
|
||||
20
debian/control
vendored
20
debian/control
vendored
|
|
@ -1,20 +0,0 @@
|
|||
Source: linbpq
|
||||
Section: hamradio
|
||||
Priority: optional
|
||||
Maintainer: Dave Hibberd <hibby@debian.org>
|
||||
Standards-Version: 4.7.2
|
||||
Vcs-Browser: https://git.hibbian.org/Hibbian/linbpq
|
||||
Vcs-Git: https://git.hibbian.org/Hibbian/linbpq.git
|
||||
Homepage: https://www.cantab.net/users/john.wiseman/Documents/
|
||||
Build-Depends: debhelper-compat (= 13)
|
||||
Build-Depends-Arch: libssl-dev, libminiupnpc-dev, libpcap-dev, libconfig-dev, zlib1g-dev, libpaho-mqtt-dev, libjansson-dev, libpng-dev
|
||||
Rules-Requires-Root: no
|
||||
|
||||
Package: linbpq
|
||||
Architecture: linux-any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
|
||||
Description: Packet node and ax25 stack
|
||||
LINBPQ is a Linux version of the BPQ32 Node, BBS and Chat Server components.
|
||||
It is actively developed by John G8BPQ and contains a complete, independent
|
||||
implementation of ax.25 and net/rom as well as BBS and Chat applications and
|
||||
can be used either as a packet switch or as a full featured node.
|
||||
37
debian/copyright
vendored
37
debian/copyright
vendored
|
|
@ -1,37 +0,0 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: linBPQ
|
||||
Upstream-Contact: John Wiseman G8BPQ <john.wiseman@cantab.net>
|
||||
Source: https://www.cantab.net/users/john.wiseman/Documents/
|
||||
Files-Excluded: *.vcproj* *.bak *.lib *.dll *.wav *.asm *.vcxproj* *.pdb *.exe
|
||||
.gitignore XAprs zlib.h zconf.h MQTT* pcap.h miniupnpc.h upnpdev.h
|
||||
igd_desc_parse.h upnpcommands.h upnperrors.h miniupnpctypes.h
|
||||
*.svn-base *.db *.obj
|
||||
|
||||
Files: *
|
||||
Copyright: 1990-2025 John Wiseman G8BPQ <john.wiseman@cantab.net>
|
||||
License: GPL-3
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2016-2025 Dave Hibberd <d@vehibberd.com>
|
||||
License: GPL-3
|
||||
|
||||
Files: debian/linbpq.service
|
||||
Copyright: 2024-2025 Tom Fanning M0LTE
|
||||
License: GPL-3
|
||||
|
||||
License: GPL-3
|
||||
This program 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.
|
||||
.
|
||||
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
The GPL License which applies to this package can be found on your Debian
|
||||
system at /usr/share/common-licenses/GPL-3.
|
||||
2
debian/dirs
vendored
2
debian/dirs
vendored
|
|
@ -1,2 +0,0 @@
|
|||
usr/sbin
|
||||
opt/oarc/bpq
|
||||
3
debian/gbp.conf
vendored
3
debian/gbp.conf
vendored
|
|
@ -1,3 +0,0 @@
|
|||
[DEFAULT]
|
||||
debian-branch = hibbian/latest
|
||||
upstream-branch = upstream/latest
|
||||
6
debian/gitlab-ci.yml
vendored
6
debian/gitlab-ci.yml
vendored
|
|
@ -1,6 +0,0 @@
|
|||
include:
|
||||
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
|
||||
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
|
||||
|
||||
reprotest:
|
||||
extends: .test-reprotest-diffoscope
|
||||
1
debian/install
vendored
1
debian/install
vendored
|
|
@ -1 +0,0 @@
|
|||
debian/bpq32.cfg etc/
|
||||
1
debian/linbpq.examples
vendored
1
debian/linbpq.examples
vendored
|
|
@ -1 +0,0 @@
|
|||
debian/bpq32.cfg
|
||||
14
debian/linbpq.service
vendored
14
debian/linbpq.service
vendored
|
|
@ -1,14 +0,0 @@
|
|||
[Unit]
|
||||
Description=Linbpq systemd service file
|
||||
After=network.target
|
||||
ConditionPathExists=/etc/bpq32.cfg
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/linbpq -c /etc -d /opt/oarc/bpq -l /opt/oarc/bpq
|
||||
WorkingDirectory=/opt/oarc/bpq
|
||||
Restart=always
|
||||
User=linbpq
|
||||
Group=linbpq
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
11
debian/lintian-overrides
vendored
11
debian/lintian-overrides
vendored
|
|
@ -1,11 +0,0 @@
|
|||
# weirdness from oarc packaging
|
||||
linbpq: dir-or-file-in-opt [opt/oarc/]
|
||||
linbpq: dir-or-file-in-opt [opt/oarc/bpq/]
|
||||
# i know!
|
||||
linbpq: no-manual-page [usr/sbin/linbpq]
|
||||
# Directory is populated on first run
|
||||
linbpq: package-contains-empty-directory [opt/oarc/bpq/]
|
||||
# Code convenience
|
||||
linbpq: spelling-error-in-binary Dont Don't [usr/sbin/linbpq]
|
||||
linbpq: spelling-error-in-binary Paramters Parameters [usr/sbin/linbpq]
|
||||
linbpq: spelling-error-in-binary lon long [usr/sbin/linbpq]
|
||||
57
debian/patches/makefile
vendored
57
debian/patches/makefile
vendored
|
|
@ -1,57 +0,0 @@
|
|||
From: Dave Hibberd <hibby@debian.org>
|
||||
Date: Sat, 20 Sep 2025 15:42:15 +0100
|
||||
Subject: makefile
|
||||
|
||||
---
|
||||
makefile | 22 ++++++++++------------
|
||||
1 file changed, 10 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/makefile b/makefile
|
||||
index 26403e5..0f15cc0 100644
|
||||
--- a/makefile
|
||||
+++ b/makefile
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
# To exclude i2c support run make noi2c
|
||||
|
||||
-OBJS = pngwtran.o pngrtran.o pngset.o pngrio.o pngwio.o pngtrans.o pngrutil.o pngwutil.o\
|
||||
- pngread.o pngwrite.o png.o pngerror.o pngget.o pngmem.o APRSIconData.o AISCommon.o\
|
||||
+OBJS = APRSIconData.o AISCommon.o\
|
||||
upnp.o APRSStdPages.o HSMODEM.o WinRPR.o KISSHF.o TNCEmulators.o bpqhdlc.o SerialPort.o\
|
||||
adif.o WebMail.o utf8Routines.o VARA.o LzFind.o Alloc.o LzmaDec.o LzmaEnc.o LzmaLib.o \
|
||||
Multicast.o ARDOP.o IPCode.o FLDigi.o linether.o CMSAuth.o APRSCode.o BPQtoAGW.o KAMPactor.o\
|
||||
@@ -17,12 +16,12 @@ OBJS = pngwtran.o pngrtran.o pngset.o pngrio.o pngwio.o pngtrans.o pngrutil.o pn
|
||||
|
||||
# Configuration:
|
||||
|
||||
-#Default to Linux
|
||||
- CC = gcc
|
||||
- LDFLAGS = -Xlinker -Map=output.map -lrt
|
||||
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
|
||||
+CFLAGS+=$(shell dpkg-buildflags --get CPPFLAGS)
|
||||
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
|
||||
|
||||
-all: CFLAGS = -DLINBPQ -MMD -g -fcommon -fasynchronous-unwind-tables $(EXTRA_CFLAGS)
|
||||
-all: LIBS = -lpaho-mqtt3a -ljansson -lminiupnpc -lm -lz -lpthread -lconfig -lpcap
|
||||
+all: CFLAGS += -DLINBPQ -MMD -g -rdynamic -fcommon -fasynchronous-unwind-tables
|
||||
+all: LIBS = -lpaho-mqtt3a -ljansson -lminiupnpc -lrt -lm -lz -lpthread -lconfig -lpcap -lpng
|
||||
all: linbpq
|
||||
|
||||
#other OS
|
||||
@@ -74,12 +73,11 @@ noi2c: linbpq
|
||||
|
||||
|
||||
linbpq: $(OBJS)
|
||||
- cc $(OBJS) $(CFLAGS) $(LDFLAGS) $(LIBS) -o linbpq
|
||||
- sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq
|
||||
+ $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) $(LIBS) -o linbpq
|
||||
|
||||
-include *.d
|
||||
|
||||
-clean :
|
||||
- rm *.d
|
||||
- rm linbpq $(OBJS)
|
||||
+install:
|
||||
+ install -b -m 755 -D -d debian/linbpq/usr/sbin
|
||||
+ install -b -m 755 -p linbpq debian/linbpq/usr/sbin
|
||||
|
||||
2
debian/patches/series
vendored
2
debian/patches/series
vendored
|
|
@ -1,2 +0,0 @@
|
|||
spelling-fixes.patch
|
||||
makefile
|
||||
21
debian/patches/spelling-fixes.patch
vendored
21
debian/patches/spelling-fixes.patch
vendored
|
|
@ -1,21 +0,0 @@
|
|||
From: Dave Hibberd <hibby@debian.org>
|
||||
Date: Sat, 20 Sep 2025 15:42:15 +0100
|
||||
Subject: spelling-fixes
|
||||
|
||||
---
|
||||
UZ7HODrv.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/UZ7HODrv.c b/UZ7HODrv.c
|
||||
index 2adfe12..75e40ee 100644
|
||||
--- a/UZ7HODrv.c
|
||||
+++ b/UZ7HODrv.c
|
||||
@@ -387,7 +387,7 @@ int UZ7HOSetFreq(int port, struct TNCINFO * TNC, struct AGWINFO * AGW, PDATAMESS
|
||||
|
||||
if (AGW->CenterFreq == 0)
|
||||
{
|
||||
- buffptr->Len = sprintf((UCHAR *)&buffptr->Data[0], "UZ7HO} Invalid Modem Freqency\r");
|
||||
+ buffptr->Len = sprintf((UCHAR *)&buffptr->Data[0], "UZ7HO} Invalid Modem Frequency\r");
|
||||
return 1;
|
||||
}
|
||||
|
||||
47
debian/postinst
vendored
47
debian/postinst
vendored
|
|
@ -1,47 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$1" = configure ]; then
|
||||
|
||||
# if ! getent group linbpq >/dev/null; then
|
||||
# addgroup --system --force-badname linbpq || true
|
||||
# fi
|
||||
|
||||
echo "Creating/updating linbpq user account..."
|
||||
adduser --system --group --home /opt/oarc/bpq \
|
||||
--gecos "linbpq system user" --shell /bin/false \
|
||||
--quiet --disabled-password linbpq || {
|
||||
# adduser failed. Why?
|
||||
if getent passwd linbpq >/dev/null ; then
|
||||
echo "Non-system user linbpq found. I will not overwrite a non-system" >&2
|
||||
echo "user. Remove the user and reinstall linbpq." >&2
|
||||
exit 1
|
||||
fi
|
||||
# unknown adduser error, simply exit
|
||||
exit 1
|
||||
}
|
||||
if ! id -nGz linbpq | grep -qzxF 'dialout' ; then
|
||||
adduser linbpq dialout
|
||||
fi
|
||||
if ! id -nGz linbpq | grep -qzxF 'plugdev' ; then
|
||||
adduser linbpq plugdev
|
||||
fi
|
||||
chown :linbpq /opt/oarc/bpq
|
||||
chmod 775 /opt/oarc/bpq
|
||||
|
||||
# If we have setcap is installed, set the requirements
|
||||
# which allows us to install our binaries without the setuid
|
||||
# bit.
|
||||
if command -v setcap > /dev/null; then
|
||||
setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" /usr/sbin/linbpq
|
||||
else
|
||||
echo "Setcap failed on /usr/sbin/linbpq, Features may be limited" >&2
|
||||
fi
|
||||
else
|
||||
echo "Setcap is not installed, Features may be limited" >&2
|
||||
|
||||
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
14
debian/preinst
vendored
14
debian/preinst
vendored
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
confile="/etc/bpq32.cfg"
|
||||
node="/opt/oarc/bpq/bpq32.cfg"
|
||||
|
||||
if [ -L $confile ]; then
|
||||
rm $confile
|
||||
cp $node $confile
|
||||
mv $node $node.bak
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
6
debian/rules
vendored
6
debian/rules
vendored
|
|
@ -1,6 +0,0 @@
|
|||
#!/usr/bin/make -f
|
||||
|
||||
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
|
||||
|
||||
%:
|
||||
dh $@
|
||||
1
debian/source/format
vendored
1
debian/source/format
vendored
|
|
@ -1 +0,0 @@
|
|||
3.0 (quilt)
|
||||
0
debian/source/include-binaries
vendored
0
debian/source/include-binaries
vendored
0
debian/source/lintian-overrides
vendored
0
debian/source/lintian-overrides
vendored
3
debian/watch
vendored
3
debian/watch
vendored
|
|
@ -1,3 +0,0 @@
|
|||
version=4
|
||||
opts="pgpmode=none,dversionmangle=s/\+repack//,repacksuffix=+repack,repack,compression=xz" \
|
||||
http://127.0.0.1:8000/linbpq-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
|
||||
|
|
@ -354,7 +354,6 @@ png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
|
|||
comp->output_ptr=NULL;
|
||||
/* write anything left in zbuf */
|
||||
if (png_ptr->zstream.avail_out < (png_uint_32)png_ptr->zbuf_size)
|
||||
|
||||
png_write_chunk_data(png_ptr, png_ptr->zbuf,
|
||||
png_ptr->zbuf_size - png_ptr->zstream.avail_out);
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ struct ConnectionInfo
|
|||
char Signon[100]; // User/Pass/Appl for Outgoing Connects
|
||||
BOOL Keepalive; // For HOST (esp CCC) Keepalives
|
||||
time_t LastSendTime;
|
||||
time_t LastReceiveTime;
|
||||
BOOL NoCallsign; // Don't Send Callsign to host if no Signon
|
||||
UCHAR * ResendBuffer; // Used if send() returns EWOULDBLOCK
|
||||
int ResendLen; // Len to resend
|
||||
|
|
|
|||
Loading…
Reference in a new issue