New upstream version 6.0.24.34

This commit is contained in:
Hibby 2024-04-06 02:10:08 +01:00
parent 5332f8b012
commit 933e6c5b86
28 changed files with 1011 additions and 126 deletions

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="SKIGACER"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="SKIGACER"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -4817,6 +4817,7 @@ BOOL CreateMonitorWindow(char * MonSize)
Cinfo->hConsole = ChildWnd;
// return if its not possible to create the child window
if(NULL == ChildWnd)
{
return 0;
@ -4839,8 +4840,8 @@ BOOL CreateMonitorWindow(char * MonSize)
Cinfo = &MonWindow;
// MoveWindow(Cinfo->hConsole, Rect.left - (OffsetW /2), Rect.top - OffsetH,
// Rect.right-Rect.left, Rect.bottom-Rect.top, TRUE);
MoveWindow(ChildWnd, Rect.left - (OffsetW /2), Rect.top - OffsetH, Rect.right - Rect.left, Rect.bottom - Rect.top, TRUE);
MoveWindows(Cinfo);

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -1211,6 +1211,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Fix possible crash in SCSPactor PTCPORT code (29)
// Add NodeAPI call sendLinks and remove get from other calls (32)
// Improve validation of Web Beacon Config (33)
// Support SNMP via host ip stack as well as IPGateway (34)
#define CKernel
@ -6477,7 +6478,7 @@ VOID SaveBPQ32Windows()
SaveMDIWindowPos(StatusWnd, "", "StatusWindowSize", StatusMinimized);
SaveMDIWindowPos(hConsWnd, "", "WindowSize", ConsoleMinimized);
for (i=0;i<NUMBEROFPORTS;i++)
for (i=0; i<NUMBEROFPORTS; i++)
{
if (PORTVEC->PORTCONTROL.PORTTYPE == 0x10) // External
{

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="C:\Devprogs\BPQ32\bpq32.exe"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="C:\Devprogs\BPQ32\bpq32.exe"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="C:\Devprogs\BPQ32\bpq32.exe"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="C:\DevProgs\BPQ32\bpq32.exe"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="SKIGACER"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="C:\DevProgs\BPQ32\bpq32.exe"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="SKIGACER"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="C:\DevProgs\BPQ32\bpq32.exe"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="SKIGACER"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="C:\DevProgs\BPQ32\bpq32.exe"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="SKIGACER"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -426,3 +426,5 @@ extern char Message[MaxBPQPortNo + 1][1000]; // Beacon Text
extern int MinCounter[MaxBPQPortNo + 1]; // Interval Countdown
extern BOOL SendFromFile[MaxBPQPortNo + 1];
DllExport uint64_t APIENTRY GetPortFrequency(int PortNo, char * FreqStringMhz);

View File

@ -4753,6 +4753,7 @@ LRESULT CALLBACK UIWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
extern struct DATAMESSAGE * REPLYBUFFER;
char * __cdecl Cmdprintf(TRANSPORTENTRY * Session, char * Bufferptr, const char * format, ...);
void GetPortCTEXT(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX * CMD)
{
char FN[250];
@ -4816,6 +4817,75 @@ void GetPortCTEXT(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CM
Debugprintf("CTEXT Read for ports %s\r", &PortList[1]);
}
// Get the current frequency for a port. This can get a bit complicated, especially if looking for centre freq
// rather than dial freq (as this depends on mode).
//
// Used for various reporting functions - MH, Maps, BBS New User message,
// I think I'll try PORT "PortFreq" setting first then if that isn't available via rigcontrol.
//
// For now at least will report dial freq if using RIGCONTROL
DllExport uint64_t APIENTRY GetPortFrequency(int PortNo, char * FreqString)
{
struct PORTCONTROL * PORT = GetPortTableEntryFromPortNum(PortNo);
double freq = 0.0;
uint64_t freqint = 0;
char * ptr;
int n = 3;
FreqString[0] = 0;
if (PORT == 0)
return 0;
if (PORT->PortFreq)
{
freqint = PORT->PortFreq;
freq = freqint / 1000000.0;
}
else
{
// Try rigcontrol
struct TNCINFO * TNC;
struct RIGINFO * RIG = 0;
int RigPort;
if (PORT->RIGPort)
TNC = TNCInfo[PORT->RIGPort];
else
TNC = TNCInfo[PortNo];
if (TNC)
RIG = TNC->RIG;
if (RIG == 0)
return 0;
// Frequency should be in valchar
if (RIG->Valchar[0] == 0)
return 0;
freq = atof(TNC->RIG->Valchar);
freqint = (int64_t)(freq * 1000000.0);
}
sprintf(FreqString, "%.6f", freq);
// Return 3 digits after . (KHz) unless more are significant
ptr = &FreqString[strlen(FreqString) - 1];
while (n-- && *(ptr) == '0')
*ptr-- = 0;
return freqint;
}
SOCKET OpenHTTPSock(char * Host)
{
SOCKET sock = 0;

View File

@ -2482,7 +2482,7 @@ doHeader:
UIUIDigi[Slot] = _strdup(&Param[0]);
GetParam(input, "File=", &Param[0]);
strcpy(FN[Slot], &Param[1]);
strcpy(FN[Slot], &Param[0]);
GetParam(input, "Text=", &Param[0]);
strcpy(Message[Slot], &Param[0]);

129
IPCode.c
View File

@ -5179,33 +5179,17 @@ int BuildReply(UCHAR * Buffer, int Offset, UCHAR * OID, int OIDLen, UCHAR * Valu
// snmpget -v1 -c jnos [ve4klm.ampr.org | www.langelaar.net] 1.3.6.1.2.1.2.2.1.16.5
VOID ProcessSNMPMessage(PIPMSG IPptr)
int ProcessSNMPPayload(UCHAR * Msg, int Len, UCHAR * Reply, int * OffPtr)
{
int Len;
PUDPMSG UDPptr = (PUDPMSG)&IPptr->Data;
char Community[256];
UCHAR OID[256];
int OIDLen;
UCHAR * Msg;
int Type;
int Length, ComLen;
int IntVal;
int ReqID;
int RequestType;
Len = ntohs(IPptr->IPLENGTH);
Len-=20;
Check_Checksum(UDPptr, Len);
// 4 bytes version
// Null Terminated Community
Msg = (char *) UDPptr;
Msg += 8; // Over UDP Header
Len -= 8;
// ASN 1 Encoding - Type, Len, Data
@ -5217,7 +5201,7 @@ VOID ProcessSNMPMessage(PIPMSG IPptr)
// First should be a Sequence
if (Type != 0x30)
return;
return 0;
Len -= 2;
@ -5228,7 +5212,7 @@ VOID ProcessSNMPMessage(PIPMSG IPptr)
// Should be Integer - SNMP Version - We support V1, identified by zero
if (Type != 2 || Length != 1 || IntVal != 0)
return;
return 0;
Len -= 3;
@ -5238,7 +5222,7 @@ VOID ProcessSNMPMessage(PIPMSG IPptr)
// Should Be String (community)
if (Type != 4)
return;
return 0;
memcpy(Community, Msg, ComLen);
Community[ComLen] = 0;
@ -5264,23 +5248,23 @@ VOID ProcessSNMPMessage(PIPMSG IPptr)
Length = *(Msg++);
if (Type != 2)
return;
return 0;
ReqID = ASNGetInt(Msg, Length);
Len -= (2 + Length);
Msg += Length;
// Two more Integers - error status, error index
Type = *(Msg++);
Length = *(Msg++);
if (Type != 2)
return;
return 0;
ASNGetInt(Msg, Length);
Len -= (2 + Length);
Msg += Length;
@ -5288,10 +5272,10 @@ VOID ProcessSNMPMessage(PIPMSG IPptr)
Length = *(Msg++);
if (Type != 2)
return;
return 0;
ASNGetInt(Msg, Length);
Len -= (2 + Length);
Msg += Length;
@ -5303,7 +5287,7 @@ VOID ProcessSNMPMessage(PIPMSG IPptr)
Len -= 2;
if (Type != 0x30)
return;
return 0;
Type = *(Msg++);
Length = *(Msg++);
@ -5311,7 +5295,7 @@ VOID ProcessSNMPMessage(PIPMSG IPptr)
Len -= 2;
if (Type != 0x30)
return;
return 0;
// Next is OID
@ -5319,7 +5303,7 @@ VOID ProcessSNMPMessage(PIPMSG IPptr)
Length = *(Msg++);
if (Type != 6) // Object ID
return;
return 0;
memcpy(OID, Msg, Length);
OID[Length] = 0;
@ -5328,16 +5312,16 @@ VOID ProcessSNMPMessage(PIPMSG IPptr)
Len -=2; // Header
Len -= Length;
Msg += Length;
// Should Just have a null value left
Type = *(Msg++);
Length = *(Msg++);
if (Type != 5 || Length != 0)
return;
return 0;
Len -=2; // Header
@ -5346,12 +5330,11 @@ VOID ProcessSNMPMessage(PIPMSG IPptr)
if (RequestType = 160)
{
UCHAR Reply[256];
int Offset = 255;
int PDULen, SendLen;
int PDULen = 0;
char Value[256];
int ValLen;
// Only Support Get
if (memcmp(OID, sysName, sysNameLen) == 0)
@ -5360,7 +5343,7 @@ VOID ProcessSNMPMessage(PIPMSG IPptr)
Value[0] = 4; // String
Value[1] = ValLen;
memcpy(&Value[2], MYNODECALL, ValLen);
PDULen = BuildReply(Reply, Offset, sysName, sysNameLen, Value, ReqID);
}
else if (memcmp(OID, sysUpTime, sysUpTimeLen) == 0)
@ -5390,7 +5373,7 @@ VOID ProcessSNMPMessage(PIPMSG IPptr)
}
else
return;
return 0;
Offset -= PDULen;
Offset -= ComLen;
@ -5408,25 +5391,59 @@ VOID ProcessSNMPMessage(PIPMSG IPptr)
Reply[--Offset] = PDULen + ComLen + 5;
Reply[--Offset] = 48;
SendLen = PDULen + ComLen + 7;
*OffPtr = Offset;
memcpy(UDPptr->UDPData, &Reply[Offset], SendLen);
// Swap Dest to Origin
IPptr->IPDEST = IPptr->IPSOURCE;
IPptr->IPSOURCE.addr = OurIPAddr;
UDPptr->DESTPORT = UDPptr->SOURCEPORT;
UDPptr->SOURCEPORT = htons(161);
SendLen += 8; // UDP Header
UDPptr->LENGTH = htons(SendLen);
IPptr->IPLENGTH = htons(SendLen + 20);
CheckSumAndSendUDP(IPptr, UDPptr, SendLen);
return PDULen + ComLen + 7;
}
// Ingnore others
return 0;
}
VOID ProcessSNMPMessage(PIPMSG IPptr)
{
int Len;
PUDPMSG UDPptr = (PUDPMSG)&IPptr->Data;
UCHAR * Msg;
int Type;
int Length, ComLen;
int IntVal;
UCHAR Reply[256];
int PDULen, SendLen;
int Offset = 0;
Len = ntohs(IPptr->IPLENGTH);
Len-=20;
Check_Checksum(UDPptr, Len);
// 4 bytes version
// Null Terminated Community
Msg = (char *) UDPptr;
Msg += 8; // Over UDP Header
Len -= 8;
SendLen = ProcessSNMPPayload(Msg, Len, Reply, &Offset);
if (SendLen == 0)
return;
memcpy(UDPptr->UDPData, &Reply[Offset], SendLen);
// Swap Dest to Origin
IPptr->IPDEST = IPptr->IPSOURCE;
IPptr->IPSOURCE.addr = OurIPAddr;
UDPptr->DESTPORT = UDPptr->SOURCEPORT;
UDPptr->SOURCEPORT = htons(161);
SendLen += 8; // UDP Header
UDPptr->LENGTH = htons(SendLen);
IPptr->IPLENGTH = htons(SendLen + 20);
CheckSumAndSendUDP(IPptr, UDPptr, SendLen);
}

View File

@ -470,61 +470,15 @@ VOID MHPROC(struct PORTCONTROL * PORT, MESSAGE * Buffer)
PMHSTRUC MHBASE = MH;
int i;
int OldCount = 0;
char Freq[16] = "";
char Freq[64] = "";
char DIGI = '*';
double ReportFreq = 0;
// if port has Rigcontrol associated with it, get frequency
// if port has a freq associated with it use it
struct TNCINFO * TNC = PORT->TNC;
GetPortFrequency(PORT->PORTNUMBER, Freq);
if (TNC && TNC->RIG && TNC->RIG->Valchar[0])
{
if (TNC->Hardware == H_UZ7HO)
{
// See if we have Center Freq Info
if (TNC->AGWInfo->CenterFreq)
{
ReportFreq = atof(TNC->RIG->Valchar) + ((TNC->AGWInfo->CenterFreq * 1.0) / 1000000.0);
}
#ifdef WIN32
else if (TNC->AGWInfo->hFreq)
{
char Centre[16];
double ModemFreq;
SendMessage(TNC->AGWInfo->hFreq, WM_GETTEXT, 15, (LPARAM)Centre);
ModemFreq = atof(Centre);
ReportFreq = atof(TNC->RIG->Valchar) + (ModemFreq / 1000000);
}
#endif
else
ReportFreq = atof(TNC->RIG->Valchar) + 0.0015; // Assume 1500
}
else
// Not UZ7HO or Linux
ReportFreq = atof(TNC->RIG->Valchar) + 0.0015;
_gcvt(ReportFreq, 9, Freq);
}
else
{
if (PORT->RIGPort)
{
struct TNCINFO * TNC = TNCInfo[PORT->RIGPort];
if (TNC && TNC->RIG)
{
strcpy(Freq, TNC->RIG->Valchar);
Freq[11] = 0;
}
}
}
// if (Buffer->ORIGIN[6] & 1)
// if (Buffer->ORIGIN[6] & 1)
DIGI = 0; // DOn't think we want to do this
// See if in list

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -859,6 +859,11 @@ BOOL CheckforMIME(SocketConn * sockptr, char * Msg, char ** Body, int * MsgLen)
int Files = 0;
if (*MsgLen > 5000000)
{
int xxx = 1;
}
ptr = Msg;
while(*ptr != 13)

View File

@ -85,6 +85,7 @@ void processDRATSFrame(unsigned char * Message, int Len, struct ConnectionInfo *
void DRATSConnectionLost(struct ConnectionInfo * sockptr);
int BuildRigCtlPage(char * _REPLYBUFFER);
void ProcessWebmailWebSockThread(void * conn);
int ProcessSNMPPayload(UCHAR * Msg, int Len, UCHAR * Reply, int * OffPtr);
#ifndef LINBPQ
extern HKEY REGTREE;
@ -540,6 +541,9 @@ int ProcessLine(char * buf, int Port)
else if (_stricmp(param,"SYNCPORT") == 0)
TCP->SyncPort = atoi(value);
else if (_stricmp(param,"SNMPPORT") == 0)
TCP->SNMPPort = atoi(value);
else if ((_stricmp(param,"CMDPORT") == 0) || (_stricmp(param,"LINUXPORT") == 0))
{
int n = 0;
@ -1562,6 +1566,46 @@ void * TelnetExtInit(EXTPORTDATA * PortEntry)
return ExtProc;
}
SOCKET OpenUDPSocket(struct TNCINFO * TNC)
{
u_long param = 1;
struct sockaddr_in sinx;
int err, ret;
struct TCPINFO * TCP = TNC->TCPInfo;
char Msg[80];
TCP->SNMPsock = socket(AF_INET,SOCK_DGRAM,0);
if (TCP->SNMPsock == INVALID_SOCKET)
{
WritetoConsoleLocal("Failed to create SNMP UDP socket");
return 0;
}
ioctl (TCP->SNMPsock, FIONBIO, &param);
sinx.sin_family = AF_INET;
sinx.sin_addr.s_addr = INADDR_ANY;
sinx.sin_port = htons(TCP->SNMPPort);
ret = bind(TCP->SNMPsock, (struct sockaddr *) &sinx, sizeof(sinx));
if (ret != 0)
{
// Bind Failed
err = WSAGetLastError();
sprintf(Msg, "Bind Failed for SNMP UDP socket %d - error code = %d", TCP->SNMPPort, err);
WritetoConsoleLocal(Msg);
return 0;
}
return TCP->SNMPsock;
}
SOCKET OpenSocket4(struct TNCINFO * xTNC, int port)
{
struct sockaddr_in local_sin; /* Local socket - internet style */
@ -1658,6 +1702,9 @@ BOOL OpenSockets(struct TNCINFO * TNC)
if (TCP->DRATSPort)
TCP->DRATSsock = OpenSocket4(TNC, TCP->DRATSPort);
if (TCP->SNMPPort)
TCP->SNMPsock = OpenUDPSocket(TNC);
CMSUser.UserName = _strdup("CMS");
TriModeUser.Secure = TRUE;
@ -2181,6 +2228,31 @@ VOID TelnetPoll(int Port)
nosocks:
// Try SNMP
if (TCP->SNMPsock)
{
struct sockaddr_in rxaddr;
char rxbuff[500];
int addrlen = sizeof(struct sockaddr_in);
int Offset = 0;
int len = recvfrom(TCP->SNMPsock, rxbuff, 500, 0,(struct sockaddr *)&rxaddr, &addrlen);
if (len > 0)
{
UCHAR Reply[256];
int SendLen;
SendLen = ProcessSNMPPayload(rxbuff, len, Reply, &Offset);
if (SendLen == 0)
return;
sendto(TCP->SNMPsock, &Reply[Offset], SendLen, 0, (struct sockaddr *)&rxaddr, addrlen);
return;
}
}
while (TELNETMONVECPTR->HOSTTRACEQ)
{
int len;

View File

@ -10,8 +10,8 @@
#endif
#define KVers 6,0,24,33
#define KVerstring "6.0.24.33\0"
#define KVers 6,0,24,34
#define KVerstring "6.0.24.34\0"
#ifdef CKernel

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -690,6 +690,7 @@ typedef struct PORTCONTROL
time_t SmartIDNeeded; // Time to send next smart ID
time_t SmartIDInterval; // Smart ID Interval (Secs)
int SendtoM0LTEMap;
uint64_t PortFreq; // Configured freq
} PORTCONTROLX, *PPORTCONTROL;

View File

@ -264,6 +264,8 @@ int APIENTRY CountFramesQueuedOnStream(int Stream);
char * APIENTRY GetLOC();
DllExport uint64_t APIENTRY GetPortFrequency(int PortNo, char * FreqString);
#else
struct PORTCONTROL * (FAR WINAPI * GetPortTableEntryFromPortNum) (int portnum);

View File

@ -1079,6 +1079,7 @@ BOOL Start()
}
PORT->SendtoM0LTEMap = PortRec->SendtoM0LTEMap;
PORT->PortFreq = PortRec->PortFreq;
if (PortRec->BBSFLAG) // Appl 1 not permitted - BBSFLAG=NOBBS
PORT->PERMITTEDAPPLS &= 0xfffffffe; // Clear bottom bit

View File

@ -251,6 +251,8 @@ int tnctypes(int i,char *value,char *rec);
int do_kiss(char *value,char *rec);
int decode_ded_rec(char *rec);
int simple(int i);
int64_t int64_value(int64_t * val, char value[], char rec[]);
int C_Q_ADD_NP(VOID *PQ, VOID *PBUFF);
int doSerialPortName(int i, char * value, char * rec);
@ -364,7 +366,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"}; /* parameter keywords */
"SMARTID", "KISSCOMMAND", "SendtoM0LTEMap", "PortFreq"}; /* parameter keywords */
static void * poffset[] =
{
@ -378,7 +380,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}; /* offset for corresponding data in config file */
&xxp.SmartID, &xxp.KissParams, &xxp.SendtoM0LTEMap, &xxp.PortFreq}; /* offset for corresponding data in config file */
static int proutine[] =
{
@ -392,7 +394,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}; /* routine to process parameter */
1, 20, 1, 21}; /* routine to process parameter */
int PPARAMLIM = sizeof(proutine)/sizeof(int);
@ -1326,6 +1328,11 @@ int int_value(short * val, char value[], char rec[])
return(1);
}
int64_t int64_value(int64_t * val, char value[], char rec[])
{
*val = strtoll(value, NULL, 10);
return(1);
}
/************************************************************************/
/* VALIDATE HEX INT VALUES */
@ -2227,6 +2234,11 @@ int decode_port_rec(char * rec)
cn = doKissCommand(i, value, rec); // Permitted Apps
break;
case 21:
cn = int64_value(poffset[i], value, rec); /* INTEGER VALUES */
break;
case 9:

View File

@ -78,6 +78,7 @@ struct PORTCONFIG
int SmartID;
unsigned char * KissParams;
int SendtoM0LTEMap;
uint64_t PortFreq;
};
struct ROUTECONFIG

View File

@ -41,8 +41,9 @@ int sendNodeList(char * response, char * token,int Flags);
int sendUserList(char * response, char * token,int Flags);
int sendInfo(char * response, char * token, int Flags);
int sendLinks(char * response, char * token, int Flags);
int sendPortMHList(char * response, char * token, int Flags);
int sendPortMHList(char * response, char * token, int param);
void BuildPortMH(char * MHJSON, struct PORTCONTROL * PORT);
DllExport struct PORTCONTROL * APIENTRY GetPortTableEntryFromSlot(int portslot);
// Token list
@ -67,17 +68,43 @@ int APIProcessHTTPMessage(char * response, char * Method, char * URL, char * req
char * token_begin = strstr(request, auth_header);
char token[TOKEN_SIZE + 1]= "";
int Flags = 0;
char * Tok = strlop(URL, '?');
char * param = strlop(Tok, '&');
if (param)
Flags = atoi(param);
// Node Flags isn't currently used
if (Tok && strlen(Tok) == TOKEN_SIZE)
char * Tok;
char * param;
if (token_begin)
{
// assume auth token
// Using Auth Header
strcpy(token, Tok);
// Extract the token from the request (assuming it's present in the request headers)
if (token_begin == NULL)
{
Debugprintf("Invalid request: No authentication token provided.\n");
return send_http_response(response, "403 (Forbidden)");
}
token_begin += strlen(auth_header); // Move to the beginning of the token
strncpy(token, token_begin, TOKEN_SIZE);
token[TOKEN_SIZE] = '\0'; // Null-terminate the token
param = strlop(URL, '?');
}
else
{
// Token must be first param of URL
Tok = strlop(URL, '?');
param = strlop(Tok, '&');
if (Tok && strlen(Tok) == TOKEN_SIZE)
{
// assume auth token
strcpy(token, Tok);
}
}
remove_expired_tokens(); // Tidy up
@ -123,7 +150,7 @@ int APIProcessHTTPMessage(char * response, char * Method, char * URL, char * req
else if (_stricmp(URL, "/api/links") == 0)
return sendLinks(response, token, Flags);
else if (strstr(URL, "/api/mheardport") != 0)
return sendPortMHList(response, token, Flags);
return sendPortMHList(response, token, atoi(param));
return send_http_response(response, "401 Invalid API Call");
}
@ -145,6 +172,7 @@ int request_token(char * response)
Token * generate_token()
{
// Generate a random authentication token
int i;
Token * token = malloc(sizeof(Token));
@ -159,6 +187,7 @@ Token * generate_token()
}
// Function to add the token to the token_list
void add_token_to_list(Token* token)
{
if (token_list == NULL)
@ -706,9 +735,9 @@ int sendLinks(char * response, char * token, int Flags)
return ReplyLen;
}
int sendPortMHList(char * response, char * token, int Flags)
int sendPortMHList(char * response, char * token, int param)
{
struct PORTCONTROL * PORTVEC = GetPortTableEntryFromPortNum(Flags);
struct PORTCONTROL * PORTVEC = GetPortTableEntryFromPortNum(param);
response[0] = 0;

View File

@ -113,6 +113,7 @@ struct TCPINFO
int APIPort;
int TriModePort;
int SyncPort;
int SNMPPort;
int DRATSPort;
int CMDPort[33];
char RELAYHOST[64];
@ -165,6 +166,7 @@ struct TCPINFO
SOCKET TriModeDataSock;
SOCKET Syncsock;
SOCKET DRATSsock;
SOCKET SNMPsock;
struct ConnectionInfo * TriModeControlSession;
SOCKET sock6;