6.0.23.42

This commit is contained in:
John Wiseman 2023-01-25 10:12:51 +00:00
parent 9a44d00480
commit c15de2c7f7
17 changed files with 121 additions and 67 deletions

View File

@ -3201,6 +3201,19 @@ static VOID ADSBConnect(void * unused)
destaddr.sin_family = AF_INET; destaddr.sin_family = AF_INET;
destaddr.sin_port = htons(ADSBPort); destaddr.sin_port = htons(ADSBPort);
if (destaddr.sin_addr.s_addr == INADDR_NONE)
{
// Resolve name to address
struct hostent * HostEnt = gethostbyname(ADSBHost);
if (!HostEnt)
return; // Resolve failed
memcpy(&destaddr.sin_addr.s_addr,HostEnt->h_addr,4);
}
TCPSock = socket(AF_INET,SOCK_STREAM,0); TCPSock = socket(AF_INET,SOCK_STREAM,0);
if (TCPSock == INVALID_SOCKET) if (TCPSock == INVALID_SOCKET)

View File

@ -4273,6 +4273,18 @@ static VOID TCPConnect(void * unused)
destaddr.sin_family = AF_INET; destaddr.sin_family = AF_INET;
destaddr.sin_port = htons(HostPort); destaddr.sin_port = htons(HostPort);
if (destaddr.sin_addr.s_addr == INADDR_NONE)
{
// Resolve name to address
struct hostent * HostEnt = gethostbyname(HostName);
if (!HostEnt)
return; // Resolve failed
memcpy(&destaddr.sin_addr.s_addr,HostEnt->h_addr,4);
}
TCPSock = socket(AF_INET,SOCK_STREAM,0); TCPSock = socket(AF_INET,SOCK_STREAM,0);
if (TCPSock == INVALID_SOCKET) if (TCPSock == INVALID_SOCKET)

View File

@ -3522,7 +3522,7 @@ VOID ARDOPProcessResponse(struct TNCINFO * TNC, UCHAR * Buffer, int MsgLen)
if (_memicmp(Buffer, "PINGACK ", 8) == 0) if (_memicmp(Buffer, "PINGACK ", 8) == 0)
{ {
WritetoTrace(TNC, Buffer, MsgLen - 1); WritetoTrace(TNC, Buffer, MsgLen - 1);
// Drop through to return touser // Drop through to return to user
} }
if (_memicmp(Buffer, "CQ ", 3) == 0 && MsgLen > 10) if (_memicmp(Buffer, "CQ ", 3) == 0 && MsgLen > 10)

View File

@ -1133,6 +1133,12 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Fix SESSIONTIMELIMIT processing // Fix SESSIONTIMELIMIT processing
// Add STOPPORT/STARTPORT for UZ7HO driver // Add STOPPORT/STARTPORT for UZ7HO driver
// Fix processing of extended QtSM 'g' frame (36) // Fix processing of extended QtSM 'g' frame (36)
// Allow setting just freq on Yaseu rigs (37)
// Enable KISSHF driver on Linux (40)
// Allow AISHOST and ADSBHOST to be a name as well as an address (41)
// Fix Interlock of incoming UZ7HO connections (41)
// Disable VARA Actions menu if not sysop (41)
// Fix Port CTEXT on UZ7HO B C or D channels (42)
#define CKernel #define CKernel

View File

@ -14,7 +14,7 @@ int SEMCLASHES = 0;
VOID __cdecl Debugprintf(const char * format, ...) VOID __cdecl Debugprintf(const char * format, ...)
{ {
char Mess[1000]; char Mess[65536];
va_list(arglist);int Len; va_list(arglist);int Len;
va_start(arglist, format); va_start(arglist, format);
@ -29,7 +29,7 @@ VOID __cdecl Debugprintf(const char * format, ...)
VOID __cdecl Logprintf(int LogMode, ChatCIRCUIT * conn, int InOut, const char * format, ...) VOID __cdecl Logprintf(int LogMode, ChatCIRCUIT * conn, int InOut, const char * format, ...)
{ {
char Mess[1000]; char Mess[65536];
va_list(arglist);int Len; va_list(arglist);int Len;
va_start(arglist, format); va_start(arglist, format);
@ -85,7 +85,7 @@ void FreeSemaphore(struct SEM * Semaphore)
VOID __cdecl nodeprintf(ChatCIRCUIT * conn, const char * format, ...) VOID __cdecl nodeprintf(ChatCIRCUIT * conn, const char * format, ...)
{ {
char Mess[1000]; char Mess[65536];
int len; int len;
va_list(arglist); va_list(arglist);

15
Cmd.c
View File

@ -3975,11 +3975,16 @@ VOID ATTACHCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX
if (rxInterlock == OtherTNC->RXRadio || txInterlock == OtherTNC->TXRadio) // Same Group if (rxInterlock == OtherTNC->RXRadio || txInterlock == OtherTNC->TXRadio) // Same Group
{ {
if (OtherTNC->PortRecord->ATTACHEDSESSIONS[0]) int n;
{
Bufferptr = Cmdprintf(Session, Bufferptr, "Sorry, interlocked port %d is in use\r", i); for (n = 0; n <= 26; n++)
SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER)); {
return; if (OtherTNC->PortRecord->ATTACHEDSESSIONS[n])
{
Bufferptr = Cmdprintf(Session, Bufferptr, "Sorry, interlocked port %d is in use\r", i);
SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER));
return;
}
} }
} }
} }

View File

@ -2307,6 +2307,9 @@ doHeader:
if (TNC == 0) if (TNC == 0)
return 1; return 1;
if (LOCAL == FALSE && COOKIE == FALSE)
return 1;
if (strcmp(input, "Abort") == 0) if (strcmp(input, "Abort") == 0)
{ {
if (TNC->ForcedCloseProc) if (TNC->ForcedCloseProc)

View File

@ -130,7 +130,7 @@ int AddtoHistory(struct user_t * user, char * text)
struct HistoryRec * Rec; struct HistoryRec * Rec;
struct HistoryRec * ptr; struct HistoryRec * ptr;
int n = 1; int n = 1;
char buf[512]; char buf[2048];
char Stamp[16]; char Stamp[16];
struct tm * tm; struct tm * tm;
time_t Now = time(NULL); time_t Now = time(NULL);
@ -150,6 +150,9 @@ int AddtoHistory(struct user_t * user, char * text)
tm = gmtime(&Now); tm = gmtime(&Now);
if (strlen(text) + strlen(user->name) + strlen(user->call) > 2000)
return 0; // Shouldn't be that long, but protect buffer
sprintf(Stamp,"%02d:%02d ", tm->tm_hour, tm->tm_min); sprintf(Stamp,"%02d:%02d ", tm->tm_hour, tm->tm_min);
sprintf(buf, "%s%-6.6s %s %c %s\r", Stamp, user->call, user->name, ':', text); sprintf(buf, "%s%-6.6s %s %c %s\r", Stamp, user->call, user->name, ':', text);
@ -290,11 +293,11 @@ VOID __cdecl nprintf(ChatCIRCUIT * conn, const char * format, ...)
{ {
// seems to be printf to a socket // seems to be printf to a socket
char buff[600]; char buff[65536];
va_list(arglist); va_list(arglist);
va_start(arglist, format); va_start(arglist, format);
vsprintf(buff, format, arglist); vsnprintf(buff, sizeof(buff), format, arglist);
nputs(conn, buff); nputs(conn, buff);
} }
@ -517,6 +520,11 @@ VOID ProcessChatLine(ChatCIRCUIT * conn, struct UserInfo * user, char* OrigBuffe
WCHAR BufferW[65536]; WCHAR BufferW[65536];
UCHAR BufferB[65536]; UCHAR BufferB[65536];
// Sanity Check
if (len > 32768)
return;
// Convert to UTF8 if not already in UTF-8 // Convert to UTF8 if not already in UTF-8
if (len == 73 && memcmp(&OrigBuffer[40], " ", 20) == 0) if (len == 73 && memcmp(&OrigBuffer[40], " ", 20) == 0)

View File

@ -1379,6 +1379,7 @@ void * SerialExtInit(EXTPORTDATA * PortEntry);
void * WinRPRExtInit(EXTPORTDATA * PortEntry); void * WinRPRExtInit(EXTPORTDATA * PortEntry);
void * HSMODEMExtInit(EXTPORTDATA * PortEntry); void * HSMODEMExtInit(EXTPORTDATA * PortEntry);
void * FreeDataExtInit(EXTPORTDATA * PortEntry); void * FreeDataExtInit(EXTPORTDATA * PortEntry);
void * KISSHFExtInit(EXTPORTDATA * PortEntry);
void * InitializeExtDriver(PEXTPORTDATA PORTVEC) void * InitializeExtDriver(PEXTPORTDATA PORTVEC)
{ {
@ -1455,6 +1456,9 @@ void * InitializeExtDriver(PEXTPORTDATA PORTVEC)
if (strstr(Value, "VARA")) if (strstr(Value, "VARA"))
return VARAExtInit; return VARAExtInit;
if (strstr(Value, "KISSHF"))
return KISSHFExtInit;
if (strstr(Value, "SERIAL")) if (strstr(Value, "SERIAL"))
return SerialExtInit; return SerialExtInit;

View File

@ -820,36 +820,6 @@ int Rig_CommandEx(struct RIGPORTINFO * PORT, struct RIGINFO * RIG, int Session,
return FALSE; return FALSE;
} }
if (RIG->RIGOK == 0)
{
if (Session != -1)
{
if (PORT->Closed)
sprintf(Command, "Sorry - Radio port closed\r");
else
sprintf(Command, "Sorry - Radio not responding\r");
}
return FALSE;
}
if (n == 2 && _stricmp(FreqString, "FREQ") == 0)
{
if (RIG->Valchar[0])
sprintf(Command, "Frequency is %s MHz\r", RIG->Valchar);
else
sprintf(Command, "Frequency not known\r");
return FALSE;
}
if (n == 2 && _stricmp(FreqString, "PTT") == 0)
{
Rig_PTTEx(RIG, TRUE, NULL);
RIG->PTTTimer = 10; // 1 sec
sprintf(Command, "Ok\r");
return FALSE;
}
if (n > 1) if (n > 1)
{ {
if (_stricmp(FreqString, "SCANSTART") == 0) if (_stricmp(FreqString, "SCANSTART") == 0)
@ -905,6 +875,38 @@ int Rig_CommandEx(struct RIGPORTINFO * PORT, struct RIGINFO * RIG, int Session,
} }
} }
if (RIG->RIGOK == 0)
{
if (Session != -1)
{
if (PORT->Closed)
sprintf(Command, "Sorry - Radio port closed\r");
else
sprintf(Command, "Sorry - Radio not responding\r");
}
return FALSE;
}
if (n == 2 && _stricmp(FreqString, "FREQ") == 0)
{
if (RIG->Valchar[0])
sprintf(Command, "Frequency is %s MHz\r", RIG->Valchar);
else
sprintf(Command, "Frequency not known\r");
return FALSE;
}
if (n == 2 && _stricmp(FreqString, "PTT") == 0)
{
Rig_PTTEx(RIG, TRUE, NULL);
RIG->PTTTimer = 10; // 1 sec
sprintf(Command, "Ok\r");
return FALSE;
}
RIG->Session = Session; // BPQ Stream RIG->Session = Session; // BPQ Stream
RIG->PollCounter = 50; // Dont read freq for 5 secs in case clash with Poll RIG->PollCounter = 50; // Dont read freq for 5 secs in case clash with Poll

View File

@ -2179,15 +2179,17 @@ VOID ProcessAGWPacket(struct TNCINFO * TNC, UCHAR * Message)
if (TNC == NULL) if (TNC == NULL)
return; return;
PORT = &TNC->PortRecord->PORTCONTROL;
if (strstr(Message, " To Station")) if (strstr(Message, " To Station"))
{ {
char noStreams[] = "No free sessions - disconnecting\r"; char noStreams[] = "No free sessions - disconnecting\r";
// Incoming. Look for a free Stream // Incoming. Look for a free Stream
Stream = 1; Stream = 0;
while(Stream <= AGW->MaxSessions) while(Stream < AGW->MaxSessions)
{ {
if (TNC->PortRecord->ATTACHEDSESSIONS[Stream] == 0) if (TNC->PortRecord->ATTACHEDSESSIONS[Stream] == 0)
goto GotStream; goto GotStream;

18
VARA.c
View File

@ -918,8 +918,9 @@ char WebProcTemplate[] = "<html><meta http-equiv=expires content=0>"
"{location.reload()}\n" "{location.reload()}\n"
"</script>\r\n" "</script>\r\n"
"</head><title>%s</title></head><body id=Text onload=\"ScrollOutput()\">\r\n" "</head><title>%s</title></head><body id=Text onload=\"ScrollOutput()\">\r\n"
"<h2 style=\"margin-bottom: 0.2em; text-align:center\">%s</h2>" "<h2 style=\"margin-bottom: 0.2em; text-align:center\">%s</h2>";
"<span class='dropdown' style=\"position: absolute; left: 10;top: 12;\">"
char Menubit[] = "<span class='dropdown' style=\"position: absolute; left: 10;top: 12;\">"
"<button class='dropbtn'>Actions</button>\r\n" "<button class='dropbtn'>Actions</button>\r\n"
"<span class='dropdown-content'>" "<span class='dropdown-content'>"
"<a href='javascript:xxx(\"Abort\");'>Abort Session</a>" "<a href='javascript:xxx(\"Abort\");'>Abort Session</a>"
@ -942,6 +943,9 @@ static int WebProc(struct TNCINFO * TNC, char * Buff, BOOL LOCAL)
{ {
int Len = sprintf(Buff, WebProcTemplate, TNC->Port, TNC->Port, "VARA Status", "VARA Status"); int Len = sprintf(Buff, WebProcTemplate, TNC->Port, TNC->Port, "VARA Status", "VARA Status");
if (LOCAL)
Len += sprintf(&Buff[Len], Menubit, TNC->TXOffset, TNC->TXOffset);
if (TNC->TXFreq) if (TNC->TXFreq)
Len += sprintf(&Buff[Len], sliderBit, TNC->TXOffset, TNC->TXOffset); Len += sprintf(&Buff[Len], sliderBit, TNC->TXOffset, TNC->TXOffset);
@ -2285,17 +2289,11 @@ VOID VARAProcessReceivedControl(struct TNCINFO * TNC)
if (TNC->InputLen > 8000) // Shouldnt have packets longer than this if (TNC->InputLen > 8000) // Shouldnt have packets longer than this
TNC->InputLen=0; TNC->InputLen=0;
// I don't think it likely we will get packets this long, but be aware...
// We can get pretty big ones in the faster
InputLen=recv(TNC->TCPSock, &TNC->ARDOPBuffer[TNC->InputLen], 8192 - TNC->InputLen, 0); InputLen=recv(TNC->TCPSock, &TNC->ARDOPBuffer[TNC->InputLen], 8192 - TNC->InputLen, 0);
if (InputLen == 0 || InputLen == SOCKET_ERROR) if (InputLen == 0 || InputLen == SOCKET_ERROR)
{ {
// Does this mean closed?
closesocket(TNC->TCPSock); closesocket(TNC->TCPSock);
TNC->TCPSock = 0; TNC->TCPSock = 0;
@ -2324,7 +2322,7 @@ loop:
if ((ptr2 - ptr) == 1) // CR if ((ptr2 - ptr) == 1) // CR
{ {
// Usual Case - single meg in buffer // Usual Case - single msg in buffer
VARAProcessResponse(TNC, TNC->ARDOPBuffer, TNC->InputLen); VARAProcessResponse(TNC, TNC->ARDOPBuffer, TNC->InputLen);
TNC->InputLen=0; TNC->InputLen=0;

View File

@ -10,16 +10,16 @@
#endif #endif
#define KVers 6,0,23,36 #define KVers 6,0,23,42
#define KVerstring "6.0.23.36\0" #define KVerstring "6.0.23.42\0"
#ifdef CKernel #ifdef CKernel
#define Vers KVers #define Vers KVers
#define Verstring KVerstring #define Verstring KVerstring
#define Datestring "December 2022" #define Datestring "January 2023"
#define VerComments "G8BPQ Packet Switch (C Version)" KVerstring #define VerComments "G8BPQ Packet Switch (C Version)" KVerstring
#define VerCopyright "Copyright © 2001-2022 John Wiseman G8BPQ\0" #define VerCopyright "Copyright © 2001-2023 John Wiseman G8BPQ\0"
#define VerDesc "BPQ32 Switch\0" #define VerDesc "BPQ32 Switch\0"
#define VerProduct "BPQ32" #define VerProduct "BPQ32"
@ -30,7 +30,7 @@
#define Vers 1,0,16,1 #define Vers 1,0,16,1
#define Verstring "1.0.16.1\0" #define Verstring "1.0.16.1\0"
#define VerComments "Internet Terminal for G8BPQ Packet Switch\0" #define VerComments "Internet Terminal for G8BPQ Packet Switch\0"
#define VerCopyright "Copyright © 2011-2022 John Wiseman G8BPQ\0" #define VerCopyright "Copyright © 2011-2023 John Wiseman G8BPQ\0"
#define VerDesc "Simple TCP Terminal Program for G8BPQ Switch\0" #define VerDesc "Simple TCP Terminal Program for G8BPQ Switch\0"
#define VerProduct "BPQTermTCP" #define VerProduct "BPQTermTCP"
@ -41,7 +41,7 @@
#define Vers 2,2,5,1 #define Vers 2,2,5,1
#define Verstring "2.2.5.1\0" #define Verstring "2.2.5.1\0"
#define VerComments "Simple Terminal for G8BPQ Packet Switch\0" #define VerComments "Simple Terminal for G8BPQ Packet Switch\0"
#define VerCopyright "Copyright © 1999-2022 John Wiseman G8BPQ\0" #define VerCopyright "Copyright © 1999-2023 John Wiseman G8BPQ\0"
#define VerDesc "Simple Terminal Program for G8BPQ Switch\0" #define VerDesc "Simple Terminal Program for G8BPQ Switch\0"
#define VerProduct "BPQTerminal" #define VerProduct "BPQTerminal"
@ -52,7 +52,7 @@
#define Vers 2,2,0,3 #define Vers 2,2,0,3
#define Verstring "2.2.0.3\0" #define Verstring "2.2.0.3\0"
#define VerComments "MDI Terminal for G8BPQ Packet Switch\0" #define VerComments "MDI Terminal for G8BPQ Packet Switch\0"
#define VerCopyright "Copyright © 1999-2022 John Wiseman G8BPQ\0" #define VerCopyright "Copyright © 1999-2023 John Wiseman G8BPQ\0"
#define VerDesc "MDI Terminal Program for G8BPQ Switch\0" #define VerDesc "MDI Terminal Program for G8BPQ Switch\0"
#endif #endif
@ -62,7 +62,7 @@
#define Vers KVers #define Vers KVers
#define Verstring KVerstring #define Verstring KVerstring
#define VerComments "Mail server for G8BPQ Packet Switch\0" #define VerComments "Mail server for G8BPQ Packet Switch\0"
#define VerCopyright "Copyright © 2009-2022 John Wiseman G8BPQ\0" #define VerCopyright "Copyright © 2009-2023 John Wiseman G8BPQ\0"
#define VerDesc "Mail server for G8BPQ's 32 Bit Switch\0" #define VerDesc "Mail server for G8BPQ's 32 Bit Switch\0"
#define VerProduct "BPQMail" #define VerProduct "BPQMail"
@ -97,7 +97,7 @@
#define Vers 0,1,0,0 #define Vers 0,1,0,0
#define Verstring "0.1.0.0\0" #define Verstring "0.1.0.0\0"
#define VerComments "Password Generation Utility for G8BPQ Packet Switch\0" #define VerComments "Password Generation Utility for G8BPQ Packet Switch\0"
#define VerCopyright "Copyright © 2011-2022 John Wiseman G8BPQ\0" #define VerCopyright "Copyright © 2011-2023 John Wiseman G8BPQ\0"
#define VerDesc "Password Generation Utility for G8BPQ Switch\0" #define VerDesc "Password Generation Utility for G8BPQ Switch\0"
#endif #endif
@ -107,7 +107,7 @@
#define Vers KVers #define Vers KVers
#define Verstring KVerstring #define Verstring KVerstring
#define VerComments "APRS Client for G8BPQ Switch\0" #define VerComments "APRS Client for G8BPQ Switch\0"
#define VerCopyright "Copyright © 2012-2022 John Wiseman G8BPQ\0" #define VerCopyright "Copyright © 2012-2023 John Wiseman G8BPQ\0"
#define VerDesc "APRS Client for G8BPQ Switch\0" #define VerDesc "APRS Client for G8BPQ Switch\0"
#define VerProduct "BPQAPRS" #define VerProduct "BPQAPRS"
@ -118,7 +118,7 @@
#define Vers KVers #define Vers KVers
#define Verstring KVerstring #define Verstring KVerstring
#define VerComments "Chat server for G8BPQ Packet Switch\0" #define VerComments "Chat server for G8BPQ Packet Switch\0"
#define VerCopyright "Copyright © 2009-2022 John Wiseman G8BPQ\0" #define VerCopyright "Copyright © 2009-2023 John Wiseman G8BPQ\0"
#define VerDesc "Chat server for G8BPQ's 32 Bit Switch\0" #define VerDesc "Chat server for G8BPQ's 32 Bit Switch\0"
#define VerProduct "BPQChat" #define VerProduct "BPQChat"

View File

@ -66,6 +66,7 @@
// Add History (28) // Add History (28)
// Add connect scripts to config page text (31) // Add connect scripts to config page text (31)
// Fix History (31) // Fix History (31)
// Stop buffer overflow in History (
#include "BPQChat.h" #include "BPQChat.h"
#include "Dbghelp.h" #include "Dbghelp.h"

BIN
debug/bpq32.pdb Normal file

Binary file not shown.

View File

@ -28,7 +28,7 @@ noi2c: linbpq
linbpq: $(OBJS) linbpq: $(OBJS)
gcc $(OBJS) -Xlinker -Map=output.map -l:libminiupnpc.a -lcrypto -lrt -lm -lz -lpthread -lconfig -lpcap -lasound -o linbpq gcc $(OBJS) -Xlinker -Map=output.map -l:libminiupnpc.a -lcrypto -lrt -lm -lz -lpthread -lconfig -lpcap -o linbpq
sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq
-include *.d -include *.d

View File

@ -28,7 +28,7 @@ noi2c: linbpq
linbpq: $(OBJS) linbpq: $(OBJS)
gcc $(OBJS) -Xlinker -Map=output.map -l:libminiupnpc.a -lcrypto -lrt -lm -lz -lpthread -lconfig -lpcap -o linbpq gcc $(OBJS) -Xlinker -Map=output.map -l:libminiupnpc.a -lcrypto -lrt -lm -lz -lpthread -lconfig -lpcap -lasound -o linbpq
sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq
-include *.d -include *.d