master 24.10
John Wiseman 2 years ago
parent fdc47cac32
commit 84b3067c72

@ -35,6 +35,9 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include <fcntl.h>
//#include "vmm.h"
uint64_t timeLoadedMS = 0;
static VOID SendNetFrame(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame)
{
// INP3 should only ever send over an active link, so just queue the message
@ -320,7 +323,7 @@ VOID ProcessRTTReply(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff)
Route->Timeout = 0; // Got Response
sscanf(&Buff->L4DATA[6], "%d", &OrigTime);
RTT = GetTickCount() - OrigTime;
RTT = (GetTickCount() - timeLoadedMS) - OrigTime;
if (RTT > 60000)
return; // Ignore if more than 60 secs
@ -379,6 +382,11 @@ VOID ProcessINP3RIF(struct ROUTE * Route, UCHAR * ptr1, int msglen, int Port)
rtt = (*ptr1++ << 8);
rtt += *ptr1++;
// rtt is value from remote node. Add our RTT to that node and update hops
rtt += Route->SRTT;
hops++;
msglen -= 10;
while (*ptr1 && msglen > 0)
@ -766,7 +774,7 @@ VOID SendRTTMsg(struct ROUTE * Route)
Msg->L4FLAGS = L4INFO;
sprintf(Stamp, "%10d %10d %10d %10d ", GetTickCount(), Route->SRTT/10, Route->RTT/10, 0);
sprintf(Stamp, "%10llu %10d %10d %10d ", (GetTickCount() - timeLoadedMS), Route->SRTT/10, Route->RTT/10, 0);
memcpy(RTTMsg.TXTIME, Stamp, 44);
memcpy(Msg->L4DATA, &RTTMsg, 236);

@ -1185,6 +1185,8 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Fix 64 bit compatibility problems in SCSTracker and UZ7HO drivers
// Add Chat PACLEN config (5)
// Fix NC to Application Call (6)
// Fix INP3 L3RTT messages on Linux and correct RTT calculation (9)
// Get Beacon config from config file on windows (9)
#define CKernel
@ -1410,6 +1412,8 @@ extern char MAPCOMMENT[]; // Locator for Reporting - may be Maidenhead or LAT:L
extern char LOC[7]; // Maidenhead Locator for Reporting
extern char ReportDest[7];
extern uint64_t timeLoadedMS;
VOID __cdecl Debugprintf(const char * format, ...);
VOID __cdecl Consoleprintf(const char * format, ...);
@ -2292,6 +2296,9 @@ FirstInit()
GetModuleFileNameExPtr = (FARPROCX)GetProcAddress(ExtDriver,"GetModuleFileNameExA");
EnumProcessesPtr = (FARPROCX)GetProcAddress(ExtDriver,"EnumProcesses");
}
timeLoadedMS = GetTickCount();
INITIALISEPORTS();
OpenReportingSockets();

@ -4093,10 +4093,10 @@ VOID SaveUIConfig()
config_destroy(&cfg);
}
int GetRegConfig();
VOID GetUIConfig()
{
#ifdef LINBPQ
char Key[100];
char CfgFN[256];
char Digis[100];
@ -4123,7 +4123,13 @@ VOID GetUIConfig()
if (stat(CfgFN, &STAT) == -1)
{
// No file. If Windows try to read from registy
#ifndef LINBPQ
GetRegConfig();
#else
Debugprintf("UIUtil Config File not found\n");
#endif
return;
}
@ -4163,8 +4169,42 @@ VOID GetUIConfig()
}
}
#else
_beginthread(UIThread, 0, NULL);
}
#ifndef LINBPQ
int GetIntValue(config_setting_t * group, char * name)
{
config_setting_t *setting;
setting = config_setting_get_member (group, name);
if (setting)
return config_setting_get_int (setting);
return 0;
}
BOOL GetStringValue(config_setting_t * group, char * name, char * value)
{
const char * str;
config_setting_t *setting;
setting = config_setting_get_member (group, name);
if (setting)
{
str = config_setting_get_string (setting);
strcpy(value, str);
return TRUE;
}
value[0] = 0;
return FALSE;
}
int GetRegConfig()
{
int retCode, Vallen, Type, i;
char Key[80];
char Size[80];
@ -4239,14 +4279,9 @@ VOID GetUIConfig()
SaveUIConfig();
#endif
_beginthread(UIThread, 0, NULL);
return TRUE;
}
#ifndef LINBPQ
INT_PTR CALLBACK ChildDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
// This processes messages from controls on the tab subpages

@ -75,6 +75,8 @@ void SaveAIS();
void initAIS();
void DRATSPoll();
extern uint64_t timeLoadedMS;
BOOL IncludesMail = FALSE;
BOOL IncludesChat = FALSE;
@ -755,6 +757,10 @@ int main(int argc, char * argv[])
if (!isatty(STDOUT_FILENO) || !isatty(STDIN_FILENO))
Redirected = 1;
timeLoadedMS = GetTickCount();
printf("Loaded at %llu ms\r\n", timeLoadedMS);
#endif
printf("G8BPQ AX25 Packet Switch System Version %s %s\n", TextVerstring, Datestring);
@ -1799,6 +1805,8 @@ struct TNCINFO * TNC;
#define CLOCK_REALTIME 0
#define CLOCK_MONOTONIC 0
int clock_gettime(int clk_id, struct timespec *t){
mach_timebase_info_data_t timebase;
mach_timebase_info(&timebase);
@ -1813,7 +1821,8 @@ int clock_gettime(int clk_id, struct timespec *t){
#endif
#endif
int GetTickCount()
uint64_t GetTickCount()
{
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);

@ -10,8 +10,8 @@
#endif
#define KVers 6,0,24,8
#define KVerstring "6.0.24.8\0"
#define KVers 6,0,24,9
#define KVerstring "6.0.24.9\0"
#ifdef CKernel

@ -54,7 +54,6 @@ uintptr_t _beginthread(void(__cdecl *start_address)(void *), unsigned stack_size
#else
int Sleep(int ms);
int GetTickCount();
#define ioctlsocket ioctl
@ -142,6 +141,9 @@ typedef DWORD COLORREF;
#define MoveFile rename
#define CreateDirectory mkdir
uint64_t GetTickCount();
int sprintf_s(char * string, int plen, const char * format, ...);

Loading…
Cancel
Save

Powered by TurnKey Linux.