6.0.23.76

This commit is contained in:
g8bpq 2023-06-21 08:21:04 +01:00
parent a21121fbfc
commit 75b5bcc9a9
72 changed files with 22574 additions and 463 deletions

View File

@ -276,9 +276,9 @@ VOID Poll_AGW()
} }
SOCKADDR_IN local_sin; /* Local socket - internet style */ static SOCKADDR_IN local_sin; /* Local socket - internet style */
PSOCKADDR_IN psin; static PSOCKADDR_IN psin;
BOOL AGWAPIInit() BOOL AGWAPIInit()
@ -343,19 +343,19 @@ BOOL AGWAPIInit()
{ {
if (PORT->Hide == 0) if (PORT->Hide == 0)
{ {
VisiblePortToRealPort[v++] = i - 1; VisiblePortToRealPort[v++] = i - 1;
memcpy(ptr,"Port",4); memcpy(ptr,"Port",4);
ptr += sprintf(ptr, "%d", i); ptr += sprintf(ptr, "%d", i);
memcpy(ptr, " with ", 6); memcpy(ptr, " with ", 6);
ptr+=6; ptr+=6;
memcpy(ptr, PORT->PORTDESCRIPTION, 29); // ";" memcpy(ptr, PORT->PORTDESCRIPTION, 29); // ";"
ptr+=29; ptr+=29;
while (*(--ptr) == ' ') {} while (*(--ptr) == ' ') {}
ptr++; ptr++;
*(ptr++)=';'; *(ptr++)=';';
} }
i++; i++;
PORT=PORT->PORTPOINTER; PORT=PORT->PORTPOINTER;
@ -367,7 +367,6 @@ BOOL AGWAPIInit()
return TRUE; return TRUE;
} }
int SetUpHostSessions() int SetUpHostSessions()
{ {
int Stream, i; int Stream, i;

View File

@ -117,7 +117,7 @@ BOOL LogAPRSIS = FALSE;
static char ConfigClassName[]="CONFIG"; static char ConfigClassName[]="CONFIG";
BPQVECSTRUC * APRSMONVECPTR; extern BPQVECSTRUC * APRSMONVECPTR;
extern int MONDECODE(); extern int MONDECODE();
extern VOID * zalloc(int len); extern VOID * zalloc(int len);

10
ARDOP.c
View File

@ -861,6 +861,14 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
// approx 100 mS Timer. May now be needed, as Poll can be called more frequently in some circumstances // approx 100 mS Timer. May now be needed, as Poll can be called more frequently in some circumstances
// G7TAJ's code to record activity for stats display
if ( TNC->BusyFlags && CDBusy )
TNC->PortRecord->PORTCONTROL.ACTIVE += 2;
if ( TNC->PTTState )
TNC->PortRecord->PORTCONTROL.SENDING += 2;
// Check session limit timer // Check session limit timer
if ((STREAM->Connecting || STREAM->Connected) && !STREAM->Disconnecting) if ((STREAM->Connecting || STREAM->Connected) && !STREAM->Disconnecting)
@ -1867,7 +1875,7 @@ VOID ARDOPReleaseTNC(struct TNCINFO * TNC)
} }
VOID ARDOPSuspendPort(struct TNCINFO * TNC) VOID ARDOPSuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC)
{ {
ARDOPSendCommand(TNC, "LISTEN FALSE", TRUE); ARDOPSendCommand(TNC, "LISTEN FALSE", TRUE);
} }

View File

@ -222,10 +222,25 @@ extern BOOL EventsEnabled;
extern BPQVECSTRUC BPQHOSTVECTOR[BPQHOSTSTREAMS + 5]; extern BPQVECSTRUC BPQHOSTVECTOR[BPQHOSTSTREAMS + 5];
/* --- TAJ PG Server--- */
void run_pg( CIRCUIT * conn, struct UserInfo * user );
void startrun_pgThread( RUNPGARGS_PTR Args );
char * SERVERLIST[256][3];
int NUM_SERVERS = 0;
/*------- TAJ END ----------*/
#ifdef LINBPQ #ifdef LINBPQ
extern BPQVECSTRUC ** BPQHOSTVECPTR; extern BPQVECSTRUC ** BPQHOSTVECPTR;
extern char WL2KModes [54][18]; extern char WL2KModes [54][18];
#else #else
__declspec(dllimport) BPQVECSTRUC ** BPQHOSTVECPTR; __declspec(dllimport) BPQVECSTRUC ** BPQHOSTVECPTR;
@ -1020,6 +1035,20 @@ Next:
} }
SortBBSChain(); SortBBSChain();
/*------- TAJ PG SERVER ----------*/
#ifndef WIN32
printf("Number of PG Servers = %d\n", NUM_SERVERS );
for ( int i=0; i< NUM_SERVERS; i++ ) {
printf("Server #%d\t%s\tExec->%s\tDESC->%s\n", i, SERVERLIST[i][0], SERVERLIST[i][1], SERVERLIST[i][2]);
}
#endif
/*------- TAJ END ----------*/
} }
VOID CopyUserDatabase() VOID CopyUserDatabase()
@ -9946,7 +9975,7 @@ BOOL GetConfig(char * ConfigName)
return(EXIT_FAILURE); return(EXIT_FAILURE);
} }
#if IBCONFIG_VER_MINOR > 4 #if LIBCONFIG_VER_MINOR > 5
config_set_option(&cfg, CONFIG_OPTION_AUTOCONVERT, 1); config_set_option(&cfg, CONFIG_OPTION_AUTOCONVERT, 1);
#else #else
config_set_auto_convert (&cfg, 1); config_set_auto_convert (&cfg, 1);
@ -10624,6 +10653,15 @@ int Disconnected (int Stream)
conn->InputBufferLen = 0; conn->InputBufferLen = 0;
} }
/* ---- TAJ PG SERVER ---- */
if ( conn->UserPointer->Temp->RUNPGPARAMS ) {
printf("Freeing RUNPGPARAMS\n");
free(conn->UserPointer->Temp->RUNPGPARAMS);
conn->UserPointer->Temp->RUNPGPARAMS = NULL;
}
/*------- TAJ END --------- */
if (conn->InputMode == 'B') if (conn->InputMode == 'B')
{ {
// Save partly received message for a restart // Save partly received message for a restart
@ -10738,6 +10776,17 @@ int DoReceivedData(int Stream)
return 0; return 0;
} }
/* ---------- TAJ START - PG server --------- */
if (conn->InputMode == 'P') // Inside PG Server
{
user = conn->UserPointer;
run_pg(conn, user);
return 0;
}
/* ---------- TAJ END --------- */
if (conn->InputMode == 'B') if (conn->InputMode == 'B')
{ {
// if in OpenBCM mode, remove FF transparency // if in OpenBCM mode, remove FF transparency
@ -11487,6 +11536,527 @@ extern UCHAR * infile;
BOOL CheckforMIME(SocketConn * sockptr, char * Msg, char ** Body, int * MsgLen); BOOL CheckforMIME(SocketConn * sockptr, char * Msg, char ** Body, int * MsgLen);
/* ---TAJ PG Server --- */
#ifndef WIN32
#define verbose 1
#define TRUE 1
#define FALSE 0
#include <sys/wait.h>
#include <signal.h>
typedef struct _POPENRET
{
FILE * fp;
pid_t pid;
} POPENRET;
/*
* Check if the PG is still running after 5 sec
* if so, kill it
*/
void run_pgTimeoutThread( pid_t process )
{
printf("watchdog thread: PID of subprocess: %d\n", process);
fflush(stdout);
Sleep(5000);
// if still running PID (?) then kill.
if ( getpgid(process) >= 0 ) {
printf("watchdog thread: Still running, so killing %d ... ", process);
// if ( kill( process, SIGTERM ) == 0 ) {
if ( kill( -process, SIGKILL ) == 0 ) {
printf("Killed\n");
} else {
printf("Failed\n");
}
}
printf("watchdog thread: PID=%d Exit\n", process);
fflush(stdout);
//return;
}
//https://sources.debian.org/src/cron/3.0pl1-45/popen.c/
POPENRET my_popen(char *program, char *type, CIRCUIT *conn)
{
register char *cp;
FILE *iop;
int argc, pdes[2];
pid_t pid;
POPENRET PRET;
if (*type != 'r' && *type != 'w' || type[1])
return(PRET);
if (pipe(pdes) < 0)
return(PRET);
iop = NULL;
switch(pid = fork()) {
case -1: /* error */
(void)close(pdes[0]);
(void)close(pdes[1]);
return PRET;
case 0: /* child */
if (*type == 'r') {
if (pdes[1] != 1) {
dup2(pdes[1], 1);
dup2(pdes[1], 2); /* stderr, too! */
(void)close(pdes[1]);
}
(void)close(pdes[0]);
} else {
if (pdes[0] != 0) {
dup2(pdes[0], 0);
(void)close(pdes[0]);
}
(void)close(pdes[1]);
}
setpgid(-pid,pid);
char *args[] = {"sh", "-c", program, NULL};
execve("/bin/sh", args, NULL);
_exit(1);
}
/* parent; assume fdopen can't fail... */
printf("PID=%d\n", pid );
_beginthread((void (*)(void *))run_pgTimeoutThread, 0, (VOID *) pid );
if (*type == 'r') {
iop = fdopen(pdes[0], type);
(void)close(pdes[1]);
} else {
iop = fdopen(pdes[1], type);
(void)close(pdes[0]);
}
char buffer[128];
while (fgets(buffer, sizeof(buffer), iop) != NULL) {
BBSputs(conn, buffer);
// printf("%s", buffer);
// sleep(200);
buffer[0] = '\0';
}
// BBSputs(conn,"\n");
PRET.fp = iop;
PRET.pid= pid;
// (void)close(pdes[0]);
// (void)close(pdes[1]);
return(PRET);
}
int
my_pclose( POPENRET pret )
{
register int fdes;
sigset_t omask, mask;
int stat_loc;
pid_t pid;
FILE * iop = pret.fp;
fdes = fileno(iop);
(void)fclose(iop);
sigemptyset(&mask);
sigaddset(&mask, SIGQUIT);
sigaddset(&mask, SIGINT);
sigaddset(&mask, SIGHUP);
sigprocmask(SIG_BLOCK, &mask, &omask);
pid = waitpid(pret.pid, &stat_loc, 0);
sigprocmask(SIG_SETMASK, &omask, NULL);
if (pid == -1 || !WIFEXITED(stat_loc))
return -1;
// return WEXITSTATUS(stat_loc);
printf( "return = %d\n", WEXITSTATUS(stat_loc));
return stat_loc;
}
int run_server (char **cmd, int nb_cmd, int mode, char *log, char *pgdir, char *data, CIRCUIT * conn)
{
int i;
int ret = 0;
FILE *fp;
POPENRET PRET;
pid_t pid;
char *ptr;
char file[256];
char buf[256];
char dir[256];
char arg[256];
if (mode)
// sprintf (file, " </dev/null >%s", log);
// sprintf (file, " >>%s", log);
// sprintf (file, " | tee -a %s", log);
sprintf(file, "" );
else
sprintf (file, " </dev/null");
if (pgdir)
{
/* remove ';' security reasons */
ptr = strchr(pgdir, ';');
if (ptr)
*ptr = '\0';
sprintf (dir, "cd %s ; ", pgdir);
}
else
*dir = '\0';
*arg = '\0';
if (data)
{
/* remove ';' security reasons */
ptr = strchr(data, ';');
if (ptr)
*ptr = '\0';
sprintf (arg, " %s ", data);
}
for (i = 0; i < nb_cmd; i++)
{
/* remove ';' security reasons */
ptr = strchr(cmd[i], ';');
if (ptr)
*ptr = '\0';
sprintf (buf, "%s%s%s%s", dir, cmd[i], arg, file);
PRET = my_popen (buf, "r", conn);
if (PRET.fp == NULL)
printf ("Failed to run command\n" );
// else {
/* start timeout thread to kill process if it runs for more than 5 sec (make configurable?)*/
// _beginthread((void (*)(void *))run_pgTimeoutThread, 0, (VOID *) PRET.pid );
// }
//ret = (int)PRET.pid;
//wait(&ret);
ret = my_pclose( PRET );
ret = ret >> 8;
if (verbose) {
printf ("Debug: command = {%s}\n", buf);
printf ("Debug: exit code = %d\n", ret);
}
/* fail-safe bypass if filter executable isn't found (exit code 127) (was ret ==127)*/
if (ret > 5) // should never be more than 5
ret = 0;
}
return ( ret );
}
void run_pg( CIRCUIT * conn, struct UserInfo * user )
{
if (!user->Temp->RUNPGPARAMS) {
// printf("Allocating new RUNPGPARAMS\n");
user->Temp->RUNPGPARAMS = (RUNPGARGS_PTR) zalloc(sizeof(RUNPGARGS));
}
user->Temp->RUNPGPARAMS->user = user;
user->Temp->RUNPGPARAMS->conn = conn;
strncpy(user->Temp->RUNPGPARAMS->InputBuffer, conn->InputBuffer, 80); // needs to be length of actual input!
user->Temp->RUNPGPARAMS->Len = conn->InputLen;
if ( conn == 0 || user == 0 ) {
printf("run_pg null err\n");
return;
}
_beginthread((void (*)(void *))startrun_pgThread, 0, user->Temp->RUNPGPARAMS );
return;
}
void startrun_pgThread( RUNPGARGS_PTR Args ) {
CIRCUIT * conn = Args->conn;
struct UserInfo * user = Args->user;
char cmd[20];
sprintf( cmd, "./%s", SERVERLIST[user->Temp->PG_SERVER][1] );
char *ptr = cmd;
char pg_dir[] = "/home/pi/linbpq/linbpq/downloads/new/linbpq/pg/";
char log_file[50] = "pg.log";
char call[6];
char data[80];
char line[80];
char *line_ptr = line;
int index;
char *data_ptr = data;
size_t bufsize = 80;
strcpy( call, conn->UserPointer->Call);
// sprintf( log_file, "%s-%d.log", call, conn);
index = user->Temp->PG_INDEX;
line[0] = '\0';
int Len = Args->Len;
UCHAR * Msg = Args->InputBuffer;
strncpy( line, Msg, Len);
line[ Len - 1 ] = 0; //remove LF
sprintf( data, "%s %d 0 0 %s", call, index, line);
// clear the input queue
conn->InputLen = 0;
conn->InputBufferLen = 0;
int ret = run_server (&ptr, 1, 1, log_file, pg_dir, data_ptr, conn);
switch (ret)
{
case -1: // ERROR or forced closed
case 0: index=0; // Goodbye/Exit
conn->InputMode=0;
SendPrompt(conn, user);
break;
case 1: index++; // inc & keep in PG
break;
case 2: index=0; // disconnect
conn->InputMode=0;
Disconnect(conn->BPQStream);
break;
case 3: printf("data->BBS & end\n");
break;
case 4: printf("data->BBS and inc %d\n", index++);
break;
case 5: printf("call no inc %d\n", ret);
break;
}
user->Temp->PG_INDEX=index;
}
/*---- TAJ END ----- */
#else
#define BUFSIZE 4096
HANDLE g_hChildStd_IN_Rd = NULL;
HANDLE g_hChildStd_IN_Wr = NULL;
HANDLE g_hChildStd_OUT_Rd = NULL;
HANDLE g_hChildStd_OUT_Wr = NULL;
HANDLE g_hInputFile = NULL;
int CreateChildProcess(void);
void WriteToPipe(void);
void ReadFromPipe(void);
void run_pg( CIRCUIT * conn, struct UserInfo * user )
{
// Run PG program, rend anything from program's stdout to the user
int retcode = -1;
SECURITY_ATTRIBUTES saAttr;
char szCmdline[256] = "C:\\test\\hello.exe g8bpq 0";
PROCESS_INFORMATION piProcInfo;
STARTUPINFO siStartInfo;
BOOL bSuccess = FALSE;
DWORD dwRead, dwWritten;
CHAR chBuf[BUFSIZE];
int index = 0;
int ret = 0;
// if first entay allocate RUNPGPARAMS
if (!user->Temp->RUNPGPARAMS)
{
user->Temp->RUNPGPARAMS = (RUNPGARGS_PTR) zalloc(sizeof(RUNPGARGS));
}
user->Temp->RUNPGPARAMS->user = user;
user->Temp->RUNPGPARAMS->conn = conn;
strncpy(user->Temp->RUNPGPARAMS->InputBuffer, conn->InputBuffer, 80); // needs to be length of actual input!
user->Temp->RUNPGPARAMS->Len = conn->InputLen;
index = user->Temp->PG_INDEX;
conn->InputBuffer[conn->InputLen] = 0;
strlop(conn->InputBuffer, 13);
conn->InputLen = 0;
// Build command line. Parmas are:
// - Callsign (format as F6FBB-8).
// - Level number (0 is the first time, up to 99).
// - Flags of the user (binary number as user`s mask of INIT.SRV).
// - Record number of the user in INF.SYS.
// - Received data (each word is a new argument).
// BPQ doesn't support params 3 and 4 (but may supply copy of user record later)
sprintf(szCmdline, "%s/PG/%s %s %d 0 0 %s", BaseDir,
SERVERLIST[user->Temp->PG_SERVER][1], user->Call, index, conn->InputBuffer);
// Set the bInheritHandle flag so pipe handles are inherited.
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = NULL;
// Create a pipe for the child process's STDOUT.
if ( ! CreatePipe(&g_hChildStd_OUT_Rd, &g_hChildStd_OUT_Wr, &saAttr, 0) )
return;
// Ensure the read handle to the pipe for STDOUT is not inherited.
if ( ! SetHandleInformation(g_hChildStd_OUT_Rd, HANDLE_FLAG_INHERIT, 0) )
return;
// Create the child process.
// Set up members of the PROCESS_INFORMATION structure.
ZeroMemory( &piProcInfo, sizeof(PROCESS_INFORMATION) );
// Set up members of the STARTUPINFO structure.
// This structure specifies the STDIN and STDOUT handles for redirection.
ZeroMemory( &siStartInfo, sizeof(STARTUPINFO) );
siStartInfo.cb = sizeof(STARTUPINFO);
siStartInfo.hStdError = g_hChildStd_OUT_Wr;
siStartInfo.hStdOutput = g_hChildStd_OUT_Wr;
siStartInfo.hStdInput = g_hChildStd_IN_Rd;
siStartInfo.dwFlags |= STARTF_USESTDHANDLES;
// Create the child process.
bSuccess = CreateProcess(NULL,
szCmdline, // command line
NULL, // process security attributes
NULL, // primary thread security attributes
TRUE, // handles are inherited
0, // creation flags
NULL, // use parent's environment
NULL, // use parent's current directory
&siStartInfo, // STARTUPINFO pointer
&piProcInfo); // receives PROCESS_INFORMATION
// If an error occurs, exit the application.
if (!bSuccess)
retcode = -1;
else
{
// Wait until child process exits.
if (WaitForSingleObject(piProcInfo.hProcess, 5000) == 0) // Wait max 5 seconds
{
// Success
GetExitCodeProcess(piProcInfo.hProcess, &retcode);
}
else
{
// Failed or ran too long - kill
TerminateProcess(piProcInfo.hProcess, 0);
}
// Close handles to the child process and its primary thread.
// Some applications might keep these handles to monitor the status
// of the child process, for example.
CloseHandle(piProcInfo.hProcess);
CloseHandle(piProcInfo.hThread);
// Close handles to the stdin and stdout pipes no longer needed by the child process.
// If they are not explicitly closed, there is no way to recognize that the child process has ended.
CloseHandle(g_hChildStd_OUT_Wr);
// Send output to User
for (;;)
{
bSuccess = ReadFile( g_hChildStd_OUT_Rd, chBuf, BUFSIZE, &dwRead, NULL);
if( ! bSuccess || dwRead == 0 ) break;
chBuf[dwRead] = 0;
if (retcode == 4)
ProcessLine(conn, user, chBuf, dwRead);
else
BBSputs(conn, chBuf);
if (! bSuccess ) break;
}
}
switch (retcode)
{
case -1: // ERROR or forced closed
BBSputs(conn, "Problem running PG program\r");
index=0;
conn->InputMode=0;
SendPrompt(conn, user);
break;
case 0:
// Goodbye/Exit
index=0;
conn->InputMode=0;
SendPrompt(conn, user);
break;
case 1:
index++; // inc & keep in PG
break;
case 2:
index=0; // disconnect
conn->InputMode=0;
Disconnect(conn->BPQStream);
break;
case 3:
printf("data->BBS & end\n");
break;
case 4:
// Send Output to BBS - was down above
break;
case 5:
printf("call no inc %d\n", ret);
break;
}
user->Temp->PG_INDEX=index;
// The remaining open handles are cleaned up when this process terminates.
// To avoid resource leaks in a larger application, close handles explicitly.
return;
}
#endif
VOID ProcessLine(CIRCUIT * conn, struct UserInfo * user, char* Buffer, int len) VOID ProcessLine(CIRCUIT * conn, struct UserInfo * user, char* Buffer, int len)
{ {
@ -12293,6 +12863,55 @@ VOID ProcessLine(CIRCUIT * conn, struct UserInfo * user, char* Buffer, int len)
return; return;
} }
/*---- TAJ PG Server ----- */
if (_stricmp(Cmd, "PG") == 0)
{
if ( NUM_SERVERS == 0 )
{
BBSputs(conn, "No PG Servers currently defined\r");
SendPrompt(conn, user);
Flush(conn);
return;
}
if ( !Arg1 )
{
char reply[80];
int i;
for (i=0; i< NUM_SERVERS; i++ )
{
sprintf(reply, "%s -> %s\r", SERVERLIST[i][0], SERVERLIST[i][2]);
BBSputs(conn, reply);
}
SendPrompt(conn, user);
return;
}
else
{
int i;
for (i=0; i < NUM_SERVERS; i++ )
{
if ( _stricmp( _strupr(Arg1), SERVERLIST[i][0] ) == 0 ) {
user->Temp->PG_SERVER = i; // index to server to run
user->Temp->PG_INDEX = 0; // newly starting PG
conn->InputMode = 'P'; // Inside PG Server
// conn->InputBuffer is altered above and split into Cmd,Arg1,Context
// so put it back and call PG (removing PG)
sprintf( conn->InputBuffer, "%s", Context);
conn->InputLen = strlen(Context);
run_pg( conn, user );
return;
}
}
}
}
/*---- TAJ END ---- */
if (conn->Flags == 0) if (conn->Flags == 0)
{ {
if (!CheckForTooManyErrors(conn)) if (!CheckForTooManyErrors(conn))
@ -14924,3 +15543,47 @@ int decode_quoted_printable(char *ptr, int len)
} }
return ptr2 - Start; return ptr2 - Start;
} }
VOID GetPGConfig()
{
char FN[256];
FILE *file;
char buf[256],errbuf[256];
char * p_prog, * p_name, * p_desc;
int n = 0;
strcpy(FN, BaseDir);
strcat(FN, "/");
strcat(FN, "PG/PGList.txt");
if ((file = fopen(FN, "r")) == NULL)
return;
while(fgets(buf, 255, file) != NULL)
{
strcpy(errbuf,buf); // save in case of error
p_prog = strtok(buf, ",\n\r");
p_name = strtok(NULL, ",\n\r");
p_desc = strtok(NULL, ",\n\r");
if (p_desc && p_desc[0])
{
while(*(p_name) == ' ') // Remove leading spaces
p_name++;
while(*(p_desc) == ' ')
p_desc++;
SERVERLIST[n][0] = _strdup(p_prog);
SERVERLIST[n][1] = _strdup(p_name);
SERVERLIST[n++][2] = _strdup(p_desc);
}
if (n > 255)
break;
}
NUM_SERVERS = n;
fclose(file);
}

14926
BBSUtilities.c.bak Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1355,6 +1355,7 @@ BOOL CreateMulticastConsole();
char * CheckToAddress(CIRCUIT * conn, char * Addr); char * CheckToAddress(CIRCUIT * conn, char * Addr);
BOOL CheckifPacket(char * Via); BOOL CheckifPacket(char * Via);
int GetHTMLForms(); int GetHTMLForms();
VOID GetPGConfig();
struct _EXCEPTION_POINTERS exinfox; struct _EXCEPTION_POINTERS exinfox;
@ -1708,6 +1709,14 @@ int APIENTRY WinMain(HINSTANCE hInstance,
FreeForwardingStruct(user); FreeForwardingStruct(user);
free(user->ForwardingInfo); free(user->ForwardingInfo);
} }
/* ---------- TAJ --PG Server------*/
if ( user->Temp->RUNPGPARAMS ) {
printf("Also freeing RUNPGARGS\n");
free(user->Temp->RUNPGPARAMS);
}
/* --------------------------------*/
free(user->Temp); free(user->Temp);
@ -3003,9 +3012,9 @@ int RefreshMainWindow()
#define VERSION_MAJOR 2 #define VERSION_MAJOR 2
#define VERSION_MINOR 0 #define VERSION_MINOR 0
SOCKADDR_IN local_sin; /* Local socket - internet style */ static SOCKADDR_IN local_sin; /* Local socket - internet style */
PSOCKADDR_IN psin; static PSOCKADDR_IN psin;
SOCKET sock; SOCKET sock;
@ -3333,6 +3342,7 @@ BOOL Initialise()
// CreateWPReport(); // CreateWPReport();
CreatePipeThread(); CreatePipeThread();
GetPGConfig();
return TRUE; return TRUE;
} }

3651
BPQMail.c.bak Normal file

File diff suppressed because it is too large Load Diff

346
BPQMail.vcxproj Normal file
View File

@ -0,0 +1,346 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{3766AA10-C777-4ED8-A83D-F1452DE9B665}</ProjectGuid>
<RootNamespace>TelnetServer</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>15.0.28307.799</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>C:\Dev\Msdev2005\$(SolutionName)\$(ProjectName)\$(Configuration)\</OutDir>
<IntDir>C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>C:\Dev\Msdev2005\$(SolutionName)\$(ProjectName)\$(Configuration)\</OutDir>
<IntDir>C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<CustomBuildStep>
<Command />
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\CKernel;..\CInclude;..\CommonSource;..\BPQMail;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>..\lib\bpq32.lib;wsock32.lib;comctl32.lib;winmm.lib;..\lib\libconfig.lib;DbgHelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>c:\DevProgs\bpq32\BPQMail.exe</OutputFile>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<GenerateMapFile>true</GenerateMapFile>
<MapFileName>$(IntDir)BBSListings\bpqmail.map</MapFileName>
<MapExports>true</MapExports>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\CKernel;..\CInclude;..\CommonSource;..\BPQMail;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>..\lib\bpq32.lib;wsock32.lib;comctl32.lib;winmm.lib;..\lib\libconfig.lib;DbgHelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>c:\DevProgs\bpq32\BPQMail.exe</OutputFile>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<GenerateMapFile>true</GenerateMapFile>
<MapFileName>$(IntDir)BBSListings\bpqmail.map</MapFileName>
<MapExports>true</MapExports>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Command />
</PreBuildEvent>
<CustomBuildStep>
<Command />
</CustomBuildStep>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>..\CKernel;..\CInclude;..\CommonSource;..\BPQMail;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>..\lib\bpq32.lib;wsock32.lib;comctl32.lib;winmm.lib;..\lib\libconfig.lib;DbgHelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>c:\DevProgs\bpq32\BPQMail.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>c:\DevProgs\bpq32\BPQMail.pdb</ProgramDatabaseFile>
<GenerateMapFile>true</GenerateMapFile>
<MapFileName>c:\DevProgs\bpq32\BPQMail.map</MapFileName>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<LinkTimeCodeGeneration />
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>..\CKernel;..\CInclude;..\CommonSource;..\BPQMail;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>..\lib\bpq32.lib;wsock32.lib;comctl32.lib;winmm.lib;..\lib\libconfig.lib;DbgHelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>c:\DevProgs\bpq32\BPQMail.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>c:\DevProgs\bpq32\BPQMail.pdb</ProgramDatabaseFile>
<GenerateMapFile>true</GenerateMapFile>
<MapFileName>c:\DevProgs\bpq32\BPQMail.map</MapFileName>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<LinkTimeCodeGeneration>
</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Alloc.c" />
<ClCompile Include="BBSHTMLConfig.c" />
<ClCompile Include="BBSUtilities.c">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<AssemblerOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">All</AssemblerOutput>
<AssemblerOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'">All</AssemblerOutput>
<AssemblerListingLocation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)</AssemblerListingLocation>
<AssemblerListingLocation Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)</AssemblerListingLocation>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
</ClCompile>
<ClCompile Include="BPQMail.c" />
<ClCompile Include="BPQMailConfig.c" />
<ClCompile Include="CMSAuth.c" />
<ClCompile Include="FBBRoutines.c">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
</ClCompile>
<ClCompile Include="Housekeeping.c" />
<ClCompile Include="HTMLCommonCode.c" />
<ClCompile Include="LzFind.c" />
<ClCompile Include="lzhuf32.c">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<AssemblerOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">All</AssemblerOutput>
<AssemblerOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'">All</AssemblerOutput>
<AssemblerListingLocation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)</AssemblerListingLocation>
<AssemblerListingLocation Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)</AssemblerListingLocation>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
</ClCompile>
<ClCompile Include="LzmaDec.c" />
<ClCompile Include="LzmaEnc.c" />
<ClCompile Include="LzmaLib.c" />
<ClCompile Include="MailCommands.c">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
</ClCompile>
<ClCompile Include="MailDataDefs.c" />
<ClCompile Include="MailRouting.c">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
</ClCompile>
<ClCompile Include="MailTCP.c">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
</ClCompile>
<ClCompile Include="MBLRoutines.c" />
<ClCompile Include="Monitor.c" />
<ClCompile Include="Multicast.c" />
<ClCompile Include="MultiConsole.c" />
<ClCompile Include="NNTPRoutines.c" />
<ClCompile Include="UIRoutines.c">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
</ClCompile>
<ClCompile Include="utf8Routines.c" />
<ClCompile Include="WebMail.c" />
<ClCompile Include="WPRoutines.c">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="bpqmailrc.h" />
<ClInclude Include="Versions.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="BPQMail.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

113
BPQMail.vcxproj.filters Normal file
View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Alloc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BBSHTMLConfig.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BBSUtilities.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BPQMail.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BPQMailConfig.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CMSAuth.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FBBRoutines.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Housekeeping.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="HTMLCommonCode.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="LzFind.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lzhuf32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="LzmaDec.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="LzmaEnc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="LzmaLib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MailCommands.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MailDataDefs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MailRouting.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MailTCP.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MBLRoutines.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Monitor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Multicast.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MultiConsole.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="NNTPRoutines.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="UIRoutines.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="utf8Routines.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="WebMail.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="WPRoutines.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="bpqmailrc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Versions.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="BPQMail.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

4
BPQMail.vcxproj.user Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

View File

@ -92,7 +92,6 @@ HBRUSH bgBrush;
extern BOOL FrameMaximized; extern BOOL FrameMaximized;
char RTFHeader[4000]; char RTFHeader[4000];
int RTFHddrLen; int RTFHddrLen;
struct ConsoleInfo * ConsHeader = NULL; struct ConsoleInfo * ConsHeader = NULL;
@ -241,11 +240,6 @@ int ClientHeight, ClientWidth;
#define MAXLINES 1000 #define MAXLINES 1000
#define LINELEN 200 #define LINELEN 200
char RTFHeader[4000];
int RTFHddrLen;
char FontName[100] = "FixedSys"; char FontName[100] = "FixedSys";
int FontSize = 20; int FontSize = 20;
int FontWidth = 8; int FontWidth = 8;

View File

@ -495,7 +495,7 @@ static int ProcessLine(char * buf, int Port, BOOL CheckPort)
BPQport = Port; BPQport = Port;
p_ipad = ptr; p_ipad = ptr;
} }
if(BPQport > 0 && BPQport <33) if(BPQport > 0 && BPQport < MAXBPQPORTS)
{ {
p_udpport = strtok(NULL, " \t\n\r"); p_udpport = strtok(NULL, " \t\n\r");

13
Bpq32.c
View File

@ -89,8 +89,8 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// 410c December 2007 // 410c December 2007
// Fix problem with NT introduced in V410a // Fix problem with NT introduced in V410a
// Display location of DLL on Console // Display location of DLL on Console
// 410d January 2008 // 410d January 2008
@ -1165,7 +1165,14 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Support 64 ports (69) // Support 64 ports (69)
// Fix Node commands for setting UZ7HO Modem (70) // Fix Node commands for setting UZ7HO Modem (70)
// Fix processing SABM on an existing session (71) // Fix processing SABM on an existing session (71)
// Extend KISS Node command to send more than one parameter byte (72)
// Add G7TAJ's code to record activity of HF ports for stats display (72)
// Add option to send KISS command to TNC on startup (73)
// Fix Bug in DED Emulator Monitor code (74)
// Add Filters to DED Monitor code (75)
// Detect loss of DED application (76)
// Fix connects to Application Alias with UZ7HO Driver (76)
// Fix Interlock of ports on same UZ7HO modem. (76)
#define CKernel #define CKernel

View File

@ -50,7 +50,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\CInclude;..\CommonSource;..\CKernel" AdditionalIncludeDirectories="..\CInclude;..\CommonSource;..\CKernel"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BPQ32_EXPORTS;MDIKERNEL;_USE_32BIT_TIME_T" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BPQ32_EXPORTS;MDIKERNEL;_USE_32BIT_TIME_T;BPQ32"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"

View File

@ -291,7 +291,7 @@ extern int FULL_CTEXT; // CTEXT ON ALL CONNECTS IF NZ
// Although externally streams are numbered 1 to 64, internally offsets are 0 - 63 // Although externally streams are numbered 1 to 64, internally offsets are 0 - 63
extern BPQVECSTRUC DUMMY; // Needed to force correct order of following extern BPQVECSTRUC DUMMYVEC; // Needed to force correct order of following
extern BPQVECSTRUC BPQHOSTVECTOR[BPQHOSTSTREAMS + 5]; extern BPQVECSTRUC BPQHOSTVECTOR[BPQHOSTSTREAMS + 5];
@ -370,8 +370,8 @@ extern int MINBUFFCOUNT;
extern UCHAR BPQDirectory[]; extern UCHAR BPQDirectory[];
extern UCHAR BPQProgramDirectory[]; extern UCHAR BPQProgramDirectory[];
extern char WINMOR[]; extern UCHAR WINMOR[];
extern char PACTORCALL[]; extern UCHAR PACTORCALL[];
extern UCHAR MCOM; extern UCHAR MCOM;
extern UCHAR MUIONLY; extern UCHAR MUIONLY;

View File

@ -528,8 +528,8 @@ VOID FreeList(char ** Hddr)
#include "libconfig.h" #include "libconfig.h"
config_t cfg; static config_t cfg;
config_setting_t * group; static config_setting_t * group;
extern char ChatWelcomeMsg[1000]; extern char ChatWelcomeMsg[1000];

31
Cmd.c
View File

@ -3963,7 +3963,7 @@ VOID ATTACHCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX
if (rxInterlock || txInterlock) if (rxInterlock || txInterlock)
{ {
for (i=1; i<33; i++) for (i=1; i <= MAXBPQPORTS; i++)
{ {
OtherTNC = TNCInfo[i]; OtherTNC = TNCInfo[i];
@ -5059,7 +5059,6 @@ VOID WL2KSYSOP(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX
} }
VOID CloseKISSPort(struct PORTCONTROL * PortVector); VOID CloseKISSPort(struct PORTCONTROL * PortVector);
int OpenConnection(struct PORTCONTROL * PortVector);
VOID STOPCMS(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX * CMD) VOID STOPCMS(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX * CMD)
{ {
@ -5330,7 +5329,7 @@ VOID STARTPORT(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX
return; return;
} }
if (OpenConnection(PORT), TRUE) if (OpenConnection(PORT))
Bufferptr = Cmdprintf(Session, Bufferptr, "Port Opened\r"); Bufferptr = Cmdprintf(Session, Bufferptr, "Port Opened\r");
else else
Bufferptr = Cmdprintf(Session, Bufferptr, "Port Open Failed\r"); Bufferptr = Cmdprintf(Session, Bufferptr, "Port Open Failed\r");
@ -5355,9 +5354,8 @@ VOID STARTPORT(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX
#define FEND 0xC0
int ASYSEND(struct PORTCONTROL * PortVector, char * buffer, int count); int ASYSEND(struct PORTCONTROL * PortVector, char * buffer, int count);
int KissEncode(UCHAR * inbuff, UCHAR * outbuff, int len);
VOID KISSCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX * CMD) VOID KISSCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX * CMD)
{ {
@ -5365,9 +5363,12 @@ VOID KISSCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX *
char * ptr, * Context; char * ptr, * Context;
int portno = 0; int portno = 0;
int cmd = 0, val = 0;
struct PORTCONTROL * PORT = PORTTABLE; struct PORTCONTROL * PORT = PORTTABLE;
int n = NUMBEROFPORTS; int n = NUMBEROFPORTS;
UCHAR KissString[128];
UCHAR ENCBUFF[256];
int KissLen = 0;
unsigned char * Kissptr = KissString;
// Send KISS Command to TNC // Send KISS Command to TNC
@ -5380,17 +5381,16 @@ VOID KISSCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX *
portno = atoi (ptr); portno = atoi (ptr);
ptr = strtok_s(NULL, " ", &Context); ptr = strtok_s(NULL, " ", &Context);
if (ptr) while (ptr && ptr[0] && KissLen < 120)
{ {
cmd = atoi (ptr); *(Kissptr++) = atoi (ptr);
KissLen++;
ptr = strtok_s(NULL, " ", &Context); ptr = strtok_s(NULL, " ", &Context);
if (ptr)
val = atoi (ptr);
} }
} }
if (portno == 0 || cmd == 0) if (portno == 0 || KissLen == 0)
{ {
strcpy(Bufferptr, BADMSG); strcpy(Bufferptr, BADMSG);
Bufferptr += (int)strlen(BADMSG); Bufferptr += (int)strlen(BADMSG);
@ -5403,8 +5403,6 @@ VOID KISSCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX *
if (PORT->PORTNUMBER == portno) if (PORT->PORTNUMBER == portno)
{ {
struct KISSINFO * KISS; struct KISSINFO * KISS;
UCHAR ENCBUFF[16];
unsigned char * ptr = ENCBUFF;
if (PORT->PORTTYPE != 0 && PORT->PORTTYPE != 22) if (PORT->PORTTYPE != 0 && PORT->PORTTYPE != 22)
{ {
@ -5424,17 +5422,14 @@ VOID KISSCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX *
// Send Command // Send Command
*(ptr++) = FEND; KissLen = KissEncode(KissString, ENCBUFF, KissLen);
*(ptr++) = KISS->OURCTRL | cmd;
*(ptr++) = (UCHAR)val;
*(ptr++) = FEND;
PORT = (struct PORTCONTROL *)KISS->FIRSTPORT; // ALL FRAMES GO ON SAME Q PORT = (struct PORTCONTROL *)KISS->FIRSTPORT; // ALL FRAMES GO ON SAME Q
PORT->Session = Session; PORT->Session = Session;
PORT->LastKISSCmdTime = time(NULL); PORT->LastKISSCmdTime = time(NULL);
ASYSEND(PORT, ENCBUFF, 4); ASYSEND(PORT, ENCBUFF, KissLen);
Bufferptr = Cmdprintf(Session, Bufferptr, "Command Sent\r"); Bufferptr = Cmdprintf(Session, Bufferptr, "Command Sent\r");
SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER)); SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER));

View File

@ -913,9 +913,8 @@ BOOL ProcessIncommingConnectEx(struct TNCINFO * TNC, char * Call, int Stream, BO
PMSGWITHLEN buffptr; PMSGWITHLEN buffptr;
int Totallen = 0; int Totallen = 0;
UCHAR * ptr; UCHAR * ptr;
struct PORTCONTROL * PORT; struct PORTCONTROL * PORT = TNC->PortRecord;
PORT = &TNC->PortRecord->PORTCONTROL;
// Stop Scanner // Stop Scanner
@ -3264,7 +3263,7 @@ VOID SendReportMsg(char * buff, int txlen)
buff[txlen++] = (crc&0xff); buff[txlen++] = (crc&0xff);
buff[txlen++] = (crc>>8); buff[txlen++] = (crc>>8);
sendto(ReportSocket, buff, txlen, 0, (LPSOCKADDR)&reportdest, sizeof(reportdest)); sendto(ReportSocket, buff, txlen, 0, (struct sockaddr *)&reportdest, sizeof(reportdest));
} }
VOID SendLocation() VOID SendLocation()

View File

@ -25,7 +25,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include "CHeaders.h" #include "CHeaders.h"
int (WINAPI FAR *GetModuleFileNameExPtr)(); extern int (WINAPI FAR *GetModuleFileNameExPtr)();
extern int (WINAPI FAR *EnumProcessesPtr)(); extern int (WINAPI FAR *EnumProcessesPtr)();
@ -218,6 +218,14 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
// 100 mS Timer. // 100 mS Timer.
// G7TAJ's code to record activity for stats display
if ( TNC->BusyFlags && CDBusy )
TNC->PortRecord->PORTCONTROL.ACTIVE += 2;
if ( TNC->PTTState )
TNC->PortRecord->PORTCONTROL.SENDING += 2;
// See if waiting for busy to clear before sending a connect // See if waiting for busy to clear before sending a connect
if (TNC->BusyDelay) if (TNC->BusyDelay)
@ -1122,7 +1130,7 @@ static int WebProc(struct TNCINFO * TNC, char * Buff, BOOL LOCAL)
return Len; return Len;
} }
VOID FLDIGISuspendPort(struct TNCINFO * TNC) VOID FLDIGISuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC)
{ {
TNC->FLInfo->CONOK = FALSE; TNC->FLInfo->CONOK = FALSE;
} }

View File

@ -43,7 +43,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
int KillTNC(struct TNCINFO * TNC); int KillTNC(struct TNCINFO * TNC);
static int RestartTNC(struct TNCINFO * TNC); static int RestartTNC(struct TNCINFO * TNC);
int (WINAPI FAR *GetModuleFileNameExPtr)(); extern int (WINAPI FAR *GetModuleFileNameExPtr)();
extern int (WINAPI FAR *EnumProcessesPtr)(); extern int (WINAPI FAR *EnumProcessesPtr)();
static int Socket_Data(int sock, int error, int eventcode); static int Socket_Data(int sock, int error, int eventcode);
VOID MoveWindows(struct TNCINFO * TNC); VOID MoveWindows(struct TNCINFO * TNC);
@ -73,7 +73,7 @@ int FreeDataDisconnect(struct TNCINFO * TNC);
int FreeGetData(struct TNCINFO * TNC); int FreeGetData(struct TNCINFO * TNC);
static void SendBeacon(struct TNCINFO * TNC, int Interval); static void SendBeacon(struct TNCINFO * TNC, int Interval);
void buildParamString(struct TNCINFO * TNC, char * line); void buildParamString(struct TNCINFO * TNC, char * line);
VOID FreeDataSuspendPort(struct TNCINFO * TNC); VOID FreeDataSuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC);
VOID FreeDataReleasePort(struct TNCINFO * TNC); VOID FreeDataReleasePort(struct TNCINFO * TNC);
@ -450,9 +450,17 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
{ {
case 7: case 7:
// 100 mS Timer. May now be needed, as Poll can be called more frequently in some circumstances // 100 mS Timer. May now be needed, as Poll can be called more frequently in some circumstances
SendPoll(TNC); // G7TAJ's code to record activity for stats display
if ( TNC->BusyFlags && CDBusy )
TNC->PortRecord->PORTCONTROL.ACTIVE += 2;
if ( TNC->PTTState )
TNC->PortRecord->PORTCONTROL.SENDING += 2;
SendPoll(TNC);
// Check for buffered data to send // Check for buffered data to send
@ -599,7 +607,7 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
// Stop Listening, and set MYCALL to user's call // Stop Listening, and set MYCALL to user's call
FreeDataSuspendPort(TNC); FreeDataSuspendPort(TNC, TNC);
FreeDataChangeMYC(TNC, TNC->Streams[0].MyCall); FreeDataChangeMYC(TNC, TNC->Streams[0].MyCall);
TNC->SessionTimeLimit = TNC->DefaultSessionTimeLimit; // Reset Limit TNC->SessionTimeLimit = TNC->DefaultSessionTimeLimit; // Reset Limit
@ -1049,7 +1057,7 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
if (TNC->ConnectPending == 0 && TNC->PTTState == 0) if (TNC->ConnectPending == 0 && TNC->PTTState == 0)
{ {
FreeDataSuspendPort(TNC); FreeDataSuspendPort(TNC, TNC);
TNC->GavePermission = TRUE; TNC->GavePermission = TRUE;
return 0; // OK to Change return 0; // OK to Change
} }
@ -1098,7 +1106,7 @@ VOID FreeDataReleaseTNC(struct TNCINFO * TNC)
} }
VOID FreeDataSuspendPort(struct TNCINFO * TNC) VOID FreeDataSuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC)
{ {
// char CMD[] = "{\"type\" : \"set\", \"command\" : \"listen\", \"state\": \"False\"}\n"; // char CMD[] = "{\"type\" : \"set\", \"command\" : \"listen\", \"state\": \"False\"}\n";
// send(TNC->TCPDataSock, CMD, strlen(CMD), 0); // send(TNC->TCPDataSock, CMD, strlen(CMD), 0);

View File

@ -4,7 +4,7 @@ char VersionStringWithBuild[50]="";
int Ver[4] = {Vers}; int Ver[4] = {Vers};
char TextVerstring[50] = ""; char TextVerstring[50] = "";
VOID GetVersionInfo(TCHAR * File) void GetVersionInfo(char * File)
{ {
#ifndef LINBPQ #ifndef LINBPQ

View File

@ -1623,7 +1623,7 @@ BOOL InterlockedCheckBusy(struct TNCINFO * ThisTNC)
if (rxInterlock == 0 && txInterlock == 0) if (rxInterlock == 0 && txInterlock == 0)
return ThisTNC->Busy; // No Interlock return ThisTNC->Busy; // No Interlock
for (i=1; i<33; i++) for (i=1; i <= MAXBPQPORTS; i++)
{ {
TNC = TNCInfo[i]; TNC = TNCInfo[i];

View File

@ -115,7 +115,7 @@ struct HSMODEMINFO
int KillTNC(struct TNCINFO * TNC); int KillTNC(struct TNCINFO * TNC);
int RestartTNC(struct TNCINFO * TNC); int RestartTNC(struct TNCINFO * TNC);
int (WINAPI FAR *GetModuleFileNameExPtr)(); extern int (WINAPI FAR *GetModuleFileNameExPtr)();
extern int (WINAPI FAR *EnumProcessesPtr)(); extern int (WINAPI FAR *EnumProcessesPtr)();
#include "bpq32.h" #include "bpq32.h"
@ -283,7 +283,7 @@ static int ProcessLine(char * buf, int Port)
return (TRUE); return (TRUE);
} }
char * Config; static char * Config;
static char * ptr1, * ptr2; static char * ptr1, * ptr2;
int HSMODEMGetLine(char * buf) int HSMODEMGetLine(char * buf)
@ -413,7 +413,15 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
// 100 mS Timer. May now be needed, as Poll can be called more frequently in some circumstances // 100 mS Timer. May now be needed, as Poll can be called more frequently in some circumstances
if (TNC->CONNECTED) // G7TAJ's code to record activity for stats display
if ( TNC->BusyFlags && CDBusy )
TNC->PortRecord->PORTCONTROL.ACTIVE += 2;
if ( TNC->PTTState )
TNC->PortRecord->PORTCONTROL.SENDING += 2;
if (TNC->CONNECTED)
{ {
TNC->CONNECTED--; TNC->CONNECTED--;
@ -890,7 +898,7 @@ VOID HSMODEMReleaseTNC(struct TNCINFO * TNC)
} }
VOID HSMODEMSuspendPort(struct TNCINFO * TNC) VOID HSMODEMSuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC)
{ {
HSMODEMSendCommand(TNC, "CONOK OFF\r"); HSMODEMSendCommand(TNC, "CONOK OFF\r");
} }

View File

@ -1382,7 +1382,7 @@ int SetupNodeMenu(char * Buff, int LOCAL)
Len = sprintf(Buff, NodeMenuHeader, Mycall); Len = sprintf(Buff, NodeMenuHeader, Mycall);
for (i=1; i<33; i++) for (i=1; i <= MAXBPQPORTS; i++)
{ {
TNC = TNCInfo[i]; TNC = TNCInfo[i];
if (TNC == NULL) if (TNC == NULL)

View File

@ -135,10 +135,10 @@ int AddtoHistory(struct user_t * user, char * text)
struct tm * tm; struct tm * tm;
time_t Now = time(NULL); time_t Now = time(NULL);
// Don't want to grow indefinitely and fill memory. We only allow display upt 24 hours back, so if first record is older that that // Don't want to grow indefinitely and fill memory. We only allow display up to 24 hours back, so if first record is older that that
// remove and reuse it // remove and reuse it
if (History && History->Time < Now - 86400) if (History && History->Time < Now - 86400)
{ {
Rec = History; Rec = History;
History = Rec->next; // Remove from front of chain History = Rec->next; // Remove from front of chain
@ -183,9 +183,6 @@ int AddtoHistory(struct user_t * user, char * text)
int ChatIsUTF8(unsigned char *ptr, int len) int ChatIsUTF8(unsigned char *ptr, int len)
{ {
int n; int n;
@ -785,9 +782,7 @@ VOID ProcessChatLine(ChatCIRCUIT * conn, struct UserInfo * user, char* OrigBuffe
int n = HistoryCount; int n = HistoryCount;
if (param) if (param)
interval = atoi(param) * 60; interval = atoi(param);
start = time(NULL) - interval;
if (interval < 1) if (interval < 1)
{ {
@ -802,6 +797,8 @@ VOID ProcessChatLine(ChatCIRCUIT * conn, struct UserInfo * user, char* OrigBuffe
interval = 1440; // Limit to 1 day interval = 1440; // Limit to 1 day
} }
start = time(NULL) - (interval * 60);
// Find first record to send // Find first record to send
while (ptr) while (ptr)

View File

@ -331,6 +331,14 @@ ok:
// 100 mS Timer. May now be needed, as Poll can be called more frequently in some circumstances // 100 mS Timer. May now be needed, as Poll can be called more frequently in some circumstances
// G7TAJ's code to record activity for stats display
if ( TNC->BusyFlags && CDBusy )
TNC->PortRecord->PORTCONTROL.ACTIVE += 2;
if ( TNC->PTTState )
TNC->PortRecord->PORTCONTROL.SENDING += 2;
CheckRXKAM(TNC); CheckRXKAM(TNC);
KAMPoll(port); KAMPoll(port);

View File

@ -30,7 +30,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include "CHeaders.h" #include "CHeaders.h"
int (WINAPI FAR *GetModuleFileNameExPtr)(); extern int (WINAPI FAR *GetModuleFileNameExPtr)();
extern int (WINAPI FAR *EnumProcessesPtr)(); extern int (WINAPI FAR *EnumProcessesPtr)();
#include "bpq32.h" #include "bpq32.h"
@ -720,7 +720,7 @@ VOID KISSHFReleaseTNC(struct TNCINFO * TNC)
ReleaseOtherPorts(TNC); ReleaseOtherPorts(TNC);
} }
VOID KISSHFSuspendPort(struct TNCINFO * TNC) VOID KISSHFSuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC)
{ {
} }

View File

@ -37,7 +37,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#define REJSENT 1 // SET WHEN FIRST REJ IS SENT IN REPLY #define REJSENT 1 // SET WHEN FIRST REJ IS SENT IN REPLY
// TO AN I(P) // TO AN I(P)
#define RNRSET 2 // RNR RECEIVED FROM OTHER END #define RNRSET 0x2 // RNR RECEIVED FROM OTHER END
#define DISCPENDING 8 // SEND DISC WHEN ALL DATA ACK'ED #define DISCPENDING 8 // SEND DISC WHEN ALL DATA ACK'ED
#define RNRSENT 0x10 // WE HAVE SEND RNR #define RNRSENT 0x10 // WE HAVE SEND RNR
#define POLLSENT 0x20 // POLL BIT OUTSTANDING #define POLLSENT 0x20 // POLL BIT OUTSTANDING
@ -127,7 +127,7 @@ UCHAR ALIASMSG = 0;
extern UINT APPLMASK; extern UINT APPLMASK;
static UCHAR ISNETROMMSG = 0; static UCHAR ISNETROMMSG = 0;
UCHAR MSGFLAG = 0; UCHAR MSGFLAG = 0;
extern UCHAR * ALIASPTR; extern char * ALIASPTR;
UCHAR QSTCALL[7] = {'Q'+'Q','S'+'S','T'+'T',0x40,0x40,0x40,0xe0}; // QST IN AX25 UCHAR QSTCALL[7] = {'Q'+'Q','S'+'S','T'+'T',0x40,0x40,0x40,0xe0}; // QST IN AX25
UCHAR NODECALL[7] = {0x9C, 0x9E, 0x88, 0x8A, 0xA6, 0x40, 0xE0}; // 'NODES' IN AX25 FORMAT UCHAR NODECALL[7] = {0x9C, 0x9E, 0x88, 0x8A, 0xA6, 0x40, 0xE0}; // 'NODES' IN AX25 FORMAT

View File

@ -42,7 +42,7 @@ VOID CLOSECURRENTSESSION(TRANSPORTENTRY * Session);
VOID SENDL4DISC(TRANSPORTENTRY * Session); VOID SENDL4DISC(TRANSPORTENTRY * Session);
int C_Q_COUNT(VOID * Q); int C_Q_COUNT(VOID * Q);
TRANSPORTENTRY * SetupSessionForL2(struct _LINKTABLE * LINK); TRANSPORTENTRY * SetupSessionForL2(struct _LINKTABLE * LINK);
VOID InformPartner(struct _LINKTABLE * LINK); VOID InformPartner(struct _LINKTABLE * LINK, int Reason);
VOID IFRM150(TRANSPORTENTRY * Session, PDATAMESSAGE Buffer); VOID IFRM150(TRANSPORTENTRY * Session, PDATAMESSAGE Buffer);
VOID SendConNAK(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG); VOID SendConNAK(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG);
BOOL FINDCIRCUIT(L3MESSAGEBUFFER * L3MSG, TRANSPORTENTRY ** REQL4, int * NewIndex); BOOL FINDCIRCUIT(L3MESSAGEBUFFER * L3MSG, TRANSPORTENTRY ** REQL4, int * NewIndex);
@ -416,7 +416,7 @@ int GETBUSYBIT(TRANSPORTENTRY * L4)
return L4->NAKBITS; return L4->NAKBITS;
} }
VOID Q_IP_MSG(PDATAMESSAGE Buffer) VOID Q_IP_MSG(MESSAGE * Buffer)
{ {
if (IPHOSTVECTOR.HOSTAPPLFLAGS & 0x80) if (IPHOSTVECTOR.HOSTAPPLFLAGS & 0x80)
{ {
@ -1084,7 +1084,7 @@ VOID ProcessIframe(struct _LINKTABLE * LINK, PDATAMESSAGE Buffer)
if (Buffer->PID == 0xCC || Buffer->PID == 0xCD) if (Buffer->PID == 0xCC || Buffer->PID == 0xCD)
{ {
Q_IP_MSG(Buffer); Q_IP_MSG((MESSAGE *)Buffer);
return; return;
} }
@ -1100,7 +1100,7 @@ VOID ProcessIframe(struct _LINKTABLE * LINK, PDATAMESSAGE Buffer)
{ {
// MUST KILL SESSION // MUST KILL SESSION
InformPartner(LINK); // CLOSE IT InformPartner(LINK, NORMALCLOSE); // CLOSE IT
LINK->CIRCUITPOINTER = NULL; // AND UNHOOK LINK->CIRCUITPOINTER = NULL; // AND UNHOOK
} }
LINK->LINKTYPE = 3; // NOW WE KNOW ITS A CROSSLINK LINK->LINKTYPE = 3; // NOW WE KNOW ITS A CROSSLINK
@ -1721,7 +1721,7 @@ VOID FRAMEFORUS(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG, int ApplMask,
if (L3MSG->L4ID == 0x0C && L3MSG->L4INDEX == 0x0C) if (L3MSG->L4ID == 0x0C && L3MSG->L4INDEX == 0x0C)
{ {
Q_IP_MSG((PDATAMESSAGE)L3MSG); Q_IP_MSG((MESSAGE *)L3MSG);
return; return;
} }

206
LinBPQ.c
View File

@ -190,8 +190,8 @@ BOOL ChatInit();
VOID CloseChat(); VOID CloseChat();
VOID CloseTNCEmulator(); VOID CloseTNCEmulator();
config_t cfg; static config_t cfg;
config_setting_t * group; static config_setting_t * group;
BOOL MonBBS = TRUE; BOOL MonBBS = TRUE;
BOOL MonCHAT = TRUE; BOOL MonCHAT = TRUE;
@ -257,6 +257,26 @@ int Slowtimer = 0;
#define REPORTINTERVAL 15 * 549; // Magic Ticks Per Minute for PC's nominal 100 ms timer #define REPORTINTERVAL 15 * 549; // Magic Ticks Per Minute for PC's nominal 100 ms timer
int ReportTimer = 0; int ReportTimer = 0;
// Console Terminal Support
struct ConTermS
{
int BPQStream;
BOOL Active;
int Incoming;
char kbbuf[INPUTLEN];
int kbptr;
char * KbdStack[MAXSTACK];
int StackIndex;
BOOL CONNECTED;
int SlowTimer;
};
struct ConTermS ConTerm = {0, 0};
VOID CheckProgramErrors() VOID CheckProgramErrors()
{ {
@ -486,7 +506,7 @@ int SESSHDDRLEN = 0;
UCHAR MCOM; UCHAR MCOM;
UCHAR MUIONLY; UCHAR MUIONLY;
UCHAR MTX; UCHAR MTX;
unsigned long long MMASK; uint64_t MMASK;
UCHAR AuthorisedProgram; // Local Variable. Set if Program is on secure list UCHAR AuthorisedProgram; // Local Variable. Set if Program is on secure list
@ -518,6 +538,177 @@ UCHAR * GetLogDirectory()
} }
extern int POP3Timer; extern int POP3Timer;
// Console Terminal Stuff
#ifndef WIN32
#define _getch getchar
/**
Linux (POSIX) implementation of _kbhit().
Morgan McGuire, morgan@cs.brown.edu
*/
#include <stdio.h>
#include <sys/select.h>
#include <termios.h>
#include <stropts.h>
int _kbhit() {
static const int STDIN = 0;
static int initialized = 0;
if (! initialized) {
// Use termios to turn off line buffering
struct termios term;
tcgetattr(STDIN, &term);
term.c_lflag &= ~ICANON;
tcsetattr(STDIN, TCSANOW, &term);
setbuf(stdin, NULL);
initialized = 1;
}
int bytesWaiting;
ioctl(STDIN, FIONREAD, &bytesWaiting);
return bytesWaiting;
}
#endif
void ConTermInput(char * Msg)
{
int i;
if (ConTerm.BPQStream == 0)
{
ConTerm.BPQStream = FindFreeStream();
if (ConTerm.BPQStream == 255)
{
ConTerm.BPQStream = 0;
printf("No Free Streams\n");
return;
}
}
if (!ConTerm.CONNECTED)
SessionControl(ConTerm.BPQStream, 1, 0);
ConTerm.StackIndex = 0;
// Stack it
if (ConTerm.KbdStack[19])
free(ConTerm.KbdStack[19]);
for (i = 18; i >= 0; i--)
{
ConTerm.KbdStack[i+1] = ConTerm.KbdStack[i];
}
ConTerm.KbdStack[0] = _strdup(ConTerm.kbbuf);
ConTerm.kbbuf[ConTerm.kbptr]=13;
SendMsg(ConTerm.BPQStream, ConTerm.kbbuf, ConTerm.kbptr+1);
}
void ConTermPoll()
{
int port, sesstype, paclen, maxframe, l4window, len;
int state, change, InputLen, count;
char callsign[11] = "";
char Msg[300];
// Get current Session State. Any state changed is ACK'ed
// automatically. See BPQHOST functions 4 and 5.
SessionState(ConTerm.BPQStream, &state, &change);
if (change == 1)
{
if (state == 1)
{
// Connected
ConTerm.CONNECTED = TRUE;
ConTerm.SlowTimer = 0;
}
else
{
ConTerm.CONNECTED = FALSE;
printf("*** Disconnected\n");
}
}
GetMsg(ConTerm.BPQStream, Msg, &InputLen, &count);
if (InputLen)
{
char * ptr = Msg;
char * ptr2 = ptr;
Msg[InputLen] = 0;
while (ptr)
{
ptr2 = strlop(ptr, 13);
// Replace CR with CRLF
printf(ptr);
if (ptr2)
printf("\r\n");
ptr = ptr2;
}
}
if (_kbhit())
{
unsigned char c = _getch();
if (c == 0xe0)
{
// Cursor control
c = _getch();
if (c == 75) // cursor left
c = 8;
}
#ifdef WIN32
printf("%c", c);
#endif
if (c == 8)
{
if (ConTerm.kbptr)
ConTerm.kbptr--;
printf(" \b"); // Already echoed bs - clear typed char from screen
return;
}
if (c == 13 || c == 10)
{
ConTermInput(ConTerm.kbbuf);
ConTerm.kbptr = 0;
return;
}
ConTerm.kbbuf[ConTerm.kbptr++] = c;
fflush(NULL);
}
return;
}
int Redirected = 0;
int main(int argc, char * argv[]) int main(int argc, char * argv[])
{ {
int i; int i;
@ -556,6 +747,12 @@ int main(int argc, char * argv[])
prctl(PR_SET_DUMPABLE, 1); // Enable Core Dumps even with setcap prctl(PR_SET_DUMPABLE, 1); // Enable Core Dumps even with setcap
#endif #endif
#endif #endif
// Disable Console Terminal if stdout redirected
if (!isatty(STDOUT_FILENO))
Redirected = 1;
#endif #endif
printf("G8BPQ AX25 Packet Switch System Version %s %s\n", TextVerstring, Datestring); printf("G8BPQ AX25 Packet Switch System Version %s %s\n", TextVerstring, Datestring);
@ -1214,6 +1411,9 @@ int main(int argc, char * argv[])
FreeSemaphore(&Semaphore); FreeSemaphore(&Semaphore);
if (Redirected == 0)
ConTermPoll();
if (NUMBEROFTNCPORTS) if (NUMBEROFTNCPORTS)
TNCTimer(); TNCTimer();

View File

@ -219,3 +219,4 @@ char ** HoldTo; // Hold on TO Call
char ** HoldAt; // Hold on AT Call char ** HoldAt; // Hold on AT Call
char ** HoldBID; // Hold on BID char ** HoldBID; // Hold on BID
struct ConsoleInfo * ConsHeader[2];

View File

@ -11,7 +11,7 @@
<DebugSettings <DebugSettings
Command="$(TargetPath)" Command="$(TargetPath)"
WorkingDirectory="C:\linbpq" WorkingDirectory="C:\linbpq"
CommandArguments="" CommandArguments="mail"
Attach="false" Attach="false"
DebuggerType="3" DebuggerType="3"
Remote="1" Remote="1"

View File

@ -23,7 +23,6 @@
<ProjectGuid>{3766AA10-C777-4ED8-A83D-F1452DE9B666}</ProjectGuid> <ProjectGuid>{3766AA10-C777-4ED8-A83D-F1452DE9B666}</ProjectGuid>
<RootNamespace>MailNode</RootNamespace> <RootNamespace>MailNode</RootNamespace>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@ -68,23 +67,20 @@
<_ProjectFileVersion>15.0.28307.799</_ProjectFileVersion> <_ProjectFileVersion>15.0.28307.799</_ProjectFileVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir> <OutDir>C:\Dev\Msdev2005\$(SolutionName)\$(ProjectName)\$(Configuration)\</OutDir>
<IntDir>C:\Dev\Msdev2005\Intermed\LinBPQ\$(Configuration)\</IntDir> <IntDir>C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<IntDir>C:\Dev\Msdev2005\Intermed\LinBPQ\$(Configuration)\</IntDir>
<OutDir>c:\LinBPQ</OutDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir> <OutDir>C:\Dev\Msdev2005\$(SolutionName)\$(ProjectName)\$(Configuration)\</OutDir>
<IntDir>C:\Dev\Msdev2005\Intermed\LinBPQ\$(Configuration)\</IntDir> <IntDir>C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<IntDir>C:\Dev\Msdev2005\Intermed\LinBPQ\$(Configuration)\</IntDir>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
@ -99,7 +95,7 @@
<DebugInformationFormat>EditAndContinue</DebugInformationFormat> <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>kernel32.lib;WS2_32.Lib;C:\Dev\Msdev2005\Projects\BPQ32\CKernel\Debug\libconfig.lib;DbgHelp.lib;setupapi.lib;miniupnpc.lib;zlibstat.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>kernel32.lib;WS2_32.Lib;..\lib\libconfigd.lib;DbgHelp.lib;setupapi.lib;miniupnpc.lib;zlibstat.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>c:\LINBPQ\$(ProjectName).exe</OutputFile> <OutputFile>c:\LINBPQ\$(ProjectName).exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile> <GenerateMapFile>true</GenerateMapFile>
@ -120,10 +116,10 @@
<PrecompiledHeader> <PrecompiledHeader>
</PrecompiledHeader> </PrecompiledHeader>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>kernel32.lib;WS2_32.Lib;C:\Dev\Msdev2005\Projects\BPQ32\CKernel\x64\Debug\libconfig.lib;DbgHelp.lib;setupapi.lib;C:\Users\John\OneDrive\Dev\Source\miniupnpc-2.2.3\msvc\x64\Debug\miniupnpc.lib;zlibstat64.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>kernel32.lib;WS2_32.Lib;C:\OneDrive\Dev\Source\bpq32\libconfig\x64\Release\libconfig.lib;DbgHelp.lib;setupapi.lib;C:\OneDrive\Dev\Source\miniupnpc-2.2.3\msvc\x64\Debug\miniupnpc.lib;C:\Users\johnw\Downloads\zlib-1.2.11-binaries-x64-release\zlib-1.2.11\binaries\x64\Release\zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>c:\LINBPQ\$(ProjectName).exe</OutputFile> <OutputFile>c:\LINBPQ\$(ProjectName).exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile> <GenerateMapFile>true</GenerateMapFile>
@ -131,7 +127,7 @@
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<StackReserveSize>4000000</StackReserveSize> <StackReserveSize>4000000</StackReserveSize>
<StackCommitSize>0</StackCommitSize> <StackCommitSize>0</StackCommitSize>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -144,7 +140,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>kernel32.lib;WS2_32.Lib;..\lib\libconfig.lib;DbgHelp.lib;Setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>kernel32.lib;WS2_32.Lib;..\lib\libconfig.lib;DbgHelp.lib;Setupapi.lib;miniupnpc.lib;zlibstat.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>c:\devprogs\bpq32\LinBPQ.exe</OutputFile> <OutputFile>c:\devprogs\bpq32\LinBPQ.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
@ -158,7 +154,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories>..\CKernel;..\CommonSource;..\CInclude;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\CKernel;..\CommonSource;..\CInclude;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;LINBPQ;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;LINBPQ;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader> <PrecompiledHeader>
</PrecompiledHeader> </PrecompiledHeader>
@ -166,7 +162,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>kernel32.lib;WS2_32.Lib;..\lib\libconfig.lib;DbgHelp.lib;Setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>kernel32.lib;WS2_32.Lib;..\lib\libconfig.lib;DbgHelp.lib;Setupapi.lib;miniupnpc.lib;zlibstat.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>c:\devprogs\bpq32\LinBPQ.exe</OutputFile> <OutputFile>c:\devprogs\bpq32\LinBPQ.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
@ -215,6 +211,7 @@
<ClCompile Include="config.c" /> <ClCompile Include="config.c" />
<ClCompile Include="datadefs.c" /> <ClCompile Include="datadefs.c" />
<ClCompile Include="DRATS.c" /> <ClCompile Include="DRATS.c" />
<ClCompile Include="Events.c" />
<ClCompile Include="FBBRoutines.c" /> <ClCompile Include="FBBRoutines.c" />
<ClCompile Include="FLDigi.c" /> <ClCompile Include="FLDigi.c" />
<ClCompile Include="FreeDATA.c" /> <ClCompile Include="FreeDATA.c" />
@ -288,7 +285,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="png.h" /> <ClInclude Include="png.h" />
<ClInclude Include="pngconf.h" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">

324
MailNode.vcxproj.filters Normal file
View File

@ -0,0 +1,324 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="adif.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AEAPactor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AGWAPI.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AGWMoncode.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AISCommon.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Alloc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="APRSCode.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="APRSIconData.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="APRSStdPages.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ARDOP.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="base64.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BBSHTMLConfig.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BBSUtilities.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="bpqaxip.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="bpqether.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="bpqhdlc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BPQINP3.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BPQNRR.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BPQtoAGW.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="bpqvkiss.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ChatHTMLConfig.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cMain.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Cmd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CMSAuth.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CommonCode.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="compatbits.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="config.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="datadefs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DRATS.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Events.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FBBRoutines.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FLDigi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FreeDATA.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="HALDriver.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="HanksRT.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="HFCommon.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="hid.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Housekeeping.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="HSMODEM.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="HTMLCommonCode.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="HTTPcode.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="IPCode.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="KAMPactor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="kiss.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="KISSHF.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="L2Code.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="L3Code.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="L4Code.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="LinBPQ.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="LzFind.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lzhuf32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="LzmaDec.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="LzmaEnc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="LzmaLib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MailCommands.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MailDataDefs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MailRouting.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MailTCP.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MBLRoutines.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="md5.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Moncode.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Multicast.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MULTIPSK.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="NNTPRoutines.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pibits.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="png.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngerror.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pnggccrd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngget.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngmem.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngpread.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngread.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngrio.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngrtran.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngrutil.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngset.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngtrans.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngvcrd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngwio.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngwrite.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngwtran.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pngwutil.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RigControl.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SCSPactor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SCSTrackeMulti.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SCSTracker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SerialPort.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TelnetV6.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TNCCode.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TNCEmulators.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="UIRoutines.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="upnp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="utf8Routines.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="UZ7HODrv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="V4.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="VARA.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="WebMail.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="WINMOR.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="WinRPR.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="WPRoutines.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="png.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

8
MailNode.vcxproj.user Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerCommand>C:\Dev\Msdev2005\projects\bpq32\BPQMail\x64\Debug\LinBPQ.exe</LocalDebuggerCommand>
<LocalDebuggerWorkingDirectory>c:\linbpq</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

View File

@ -39,9 +39,8 @@ int CurrentSockets=0;
#define VERSION_MAJOR 2 #define VERSION_MAJOR 2
#define VERSION_MINOR 0 #define VERSION_MINOR 0
SOCKADDR_IN local_sin; /* Local socket - internet style */ static SOCKADDR_IN local_sin; /* Local socket - internet style */
static PSOCKADDR_IN psin;
PSOCKADDR_IN psin;
SOCKET smtpsock, pop3sock; SOCKET smtpsock, pop3sock;

View File

@ -60,7 +60,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#define NODES_SIG 0xFF #define NODES_SIG 0xFF
char * strlop(char * buf, char delim); char * strlop(char * buf, char delim);
UCHAR * DisplayINP3RIF(UCHAR * ptr1, UCHAR * ptr2, int msglen); UCHAR * DisplayINP3RIF(UCHAR * ptr1, UCHAR * ptr2, unsigned int msglen);
char * DISPLAY_NETROM(MESSAGE * ADJBUFFER, UCHAR * Output, int MsgLen); char * DISPLAY_NETROM(MESSAGE * ADJBUFFER, UCHAR * Output, int MsgLen);
UCHAR * DISPLAYIPDATAGRAM(IPMSG * IP, UCHAR * Output, int MsgLen); UCHAR * DISPLAYIPDATAGRAM(IPMSG * IP, UCHAR * Output, int MsgLen);
@ -145,7 +145,7 @@ int APRSDecodeFrame(MESSAGE * msg, char * buffer, time_t Stamp, uint64_t Mask)
{ {
return IntDecodeFrame(msg, buffer, Stamp, Mask, TRUE, FALSE); return IntDecodeFrame(msg, buffer, Stamp, Mask, TRUE, FALSE);
} }
DllExport int APIENTRY DecodeFrame(MESSAGE * msg, char * buffer, int Stamp) DllExport int APIENTRY DecodeFrame(MESSAGE * msg, char * buffer, time_t Stamp)
{ {
return IntDecodeFrame(msg, buffer, Stamp, MMASK, FALSE, FALSE); return IntDecodeFrame(msg, buffer, Stamp, MMASK, FALSE, FALSE);
} }

View File

@ -31,6 +31,9 @@ BOOL FlashOnConnect;
BOOL WrapInput; BOOL WrapInput;
BOOL CloseWindowOnBye; BOOL CloseWindowOnBye;
char RTFHeader[4000];
int RTFHddrLen = 0;
RECT ConsoleRect; RECT ConsoleRect;
char chatMsg[] = "\rSysop wants to chat to you\r"; char chatMsg[] = "\rSysop wants to chat to you\r";

24
PG/Loop.c Normal file
View File

@ -0,0 +1,24 @@
#include <stdio.h>
#include <windows.h>
/*
* TST_PG.C
*
* Little test program of "PG" command for FBB BBS software.
*
* (C) F6FBB 1991.
*
* FBB software 5.14 and up.
*
*
* This program echoes to the user what he types
* or executes a BBS command preceded by "CMD"
* until "BYE" is received
*/
main(int argc, char **argv)
{
Sleep(10000);
return 0;
}

BIN
PG/Loop.exe Normal file

Binary file not shown.

BIN
PG/Loop.obj Normal file

Binary file not shown.

53
PG/PGTest.c Normal file
View File

@ -0,0 +1,53 @@
#include <stdio.h>
/*
* TST_PG.C
*
* Little test program of "PG" command for FBB BBS software.
*
* (C) F6FBB 1991.
*
* FBB software 5.14 and up.
*
*
* This program echoes to the user what he types
* or executes a BBS command preceded by "CMD"
* until "BYE" is received
*/
main(int argc, char **argv)
{
int i;
int level = atoi(argv[2]); /* Get level from argument list */
/* and transform it to integer */
if (level == 0) { /* Is level equal to 0 ? */
/* This is the first call */
printf("Hello %s, type BYE when you want to stop !\n", argv[1]);
return(1); /* program will be called again */
}
else {
strupr(argv[5]); /* Capitalise the first word */
if (strcmp(argv[5], "BYE") == 0) { /* is BYE received ? */
printf("Ok, bye-bye\n");
return(0); /* Yes, go on BBS */
}
else if (strcmp(argv[5], "CMD") == 0) { /* is CMD received ? */
for (i = 6 ; i < argc ; i++) /* List line arguments */
printf("%s ", argv[i]); /* sent by user */
putchar('\n');
for (i = 6 ; i < argc ; i++) /* List line arguments */
printf("%s ", argv[i]); /* sent by user */
putchar('\n');
return(4); /* Yes, send command */
}
else {
printf("You told me : "); /* These are other lines */
for (i = 5 ; i < argc ; i++) /* List line arguments */
printf("%s ", argv[i]); /* sent by user */
putchar('\n');
return(1); /* No, call again program */
}
}
}

BIN
PG/PGTest.exe Normal file

Binary file not shown.

BIN
PG/PGTest.obj Normal file

Binary file not shown.

View File

@ -896,10 +896,10 @@ int Rig_CommandEx(struct RIGPORTINFO * PORT, struct RIGINFO * RIG, TRANSPORTENTR
{ {
if (RIG->NumberofBands) if (RIG->NumberofBands)
{ {
RIG->ScanStopped &= (0xffffffff ^ (1 << Port)); RIG->ScanStopped &= (0xffffffffffffffff ^ ((uint64_t)1 << Port));
if (Session != (TRANSPORTENTRY *) -1) // Used for internal Stop/Start if (Session != (TRANSPORTENTRY *) -1) // Used for internal Stop/Start
RIG->ScanStopped &= 0xfffffffe; // Clear Manual Stopped Bit RIG->ScanStopped &= 0xfffffffffffffffe; // Clear Manual Stopped Bit
if (n > 2) if (n > 2)
RIG->ScanCounter = atoi(Mode) * 10; //Start Delay RIG->ScanCounter = atoi(Mode) * 10; //Start Delay
@ -926,7 +926,7 @@ int Rig_CommandEx(struct RIGPORTINFO * PORT, struct RIGINFO * RIG, TRANSPORTENTR
if (_stricmp(FreqString, "SCANSTOP") == 0) if (_stricmp(FreqString, "SCANSTOP") == 0)
{ {
RIG->ScanStopped |= (1 << Port); RIG->ScanStopped |= ((uint64_t)1 << Port);
if (Session != (TRANSPORTENTRY *) -1) // Used for internal Stop/Start if (Session != (TRANSPORTENTRY *) -1) // Used for internal Stop/Start
RIG->ScanStopped |= 1; // Set Manual Stopped Bit RIG->ScanStopped |= 1; // Set Manual Stopped Bit
@ -2800,7 +2800,7 @@ void CheckRX(struct RIGPORTINFO * PORT)
return; return;
if (PORT->RXBuffer[Length-1] != 0xfd) if (PORT->RXBuffer[Length-1] != 0xfd)
return; return; // Echo
ProcessICOMFrame(PORT, PORT->RXBuffer, Length); // Could have multiple packets in buffer ProcessICOMFrame(PORT, PORT->RXBuffer, Length); // Could have multiple packets in buffer

View File

@ -114,7 +114,7 @@ int DoScanLine(struct TNCINFO * TNC, char * Buff, int Len);
VOID SuspendOtherPorts(struct TNCINFO * ThisTNC); VOID SuspendOtherPorts(struct TNCINFO * ThisTNC);
VOID ReleaseOtherPorts(struct TNCINFO * ThisTNC); VOID ReleaseOtherPorts(struct TNCINFO * ThisTNC);
VOID PTCSuspendPort(struct TNCINFO * TNC); VOID PTCSuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC);
VOID PTCReleasePort(struct TNCINFO * TNC); VOID PTCReleasePort(struct TNCINFO * TNC);
int KissEncode(UCHAR * inbuff, UCHAR * outbuff, int len); int KissEncode(UCHAR * inbuff, UCHAR * outbuff, int len);
int CheckMode(struct TNCINFO * TNC); int CheckMode(struct TNCINFO * TNC);
@ -468,6 +468,14 @@ ok:
// 100 mS Timer. May now be needed, as Poll can be called more frequently in some circumstances // 100 mS Timer. May now be needed, as Poll can be called more frequently in some circumstances
// G7TAJ's code to record activity for stats display
if ( TNC->BusyFlags && CDBusy )
TNC->PortRecord->PORTCONTROL.ACTIVE += 2;
if ( TNC->PTTState )
TNC->PortRecord->PORTCONTROL.SENDING += 2;
SCSCheckRX(TNC); SCSCheckRX(TNC);
SCSPoll(port); SCSPoll(port);
@ -4147,7 +4155,7 @@ VOID CloseComplete(struct TNCINFO * TNC, int Stream)
} }
VOID PTCSuspendPort(struct TNCINFO * TNC) VOID PTCSuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC)
{ {
struct STREAMINFO * STREAM = &TNC->Streams[0]; struct STREAMINFO * STREAM = &TNC->Streams[0];

View File

@ -108,7 +108,7 @@ BOOL TrkWriteCommBlock(struct TNCINFO * TNC)
} }
VOID TRKSuspendPort(struct TNCINFO * TNC) VOID TRKSuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC)
{ {
struct STREAMINFO * STREAM = &TNC->Streams[0]; struct STREAMINFO * STREAM = &TNC->Streams[0];
@ -367,6 +367,14 @@ ok:
// 100 mS Timer. // 100 mS Timer.
// G7TAJ's code to record activity for stats display
if ( TNC->BusyFlags && CDBusy )
TNC->PortRecord->PORTCONTROL.ACTIVE += 2;
if ( TNC->PTTState )
TNC->PortRecord->PORTCONTROL.SENDING += 2;
// See if waiting for connect after changing MYCALL // See if waiting for connect after changing MYCALL
if (TNC->SlowTimer) if (TNC->SlowTimer)

View File

@ -39,7 +39,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include "CHeaders.h" #include "CHeaders.h"
int (WINAPI FAR *GetModuleFileNameExPtr)(); extern int (WINAPI FAR *GetModuleFileNameExPtr)();
extern int (WINAPI FAR *EnumProcessesPtr)(); extern int (WINAPI FAR *EnumProcessesPtr)();
#include "bpq32.h" #include "bpq32.h"
@ -722,7 +722,7 @@ VOID SerialReleaseTNC(struct TNCINFO * TNC)
} }
VOID SerialSuspendPort(struct TNCINFO * TNC) VOID SerialSuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC)
{ {
SerialSendCommand(TNC, "CONOK OFF\r"); SerialSendCommand(TNC, "CONOK OFF\r");
} }

View File

@ -55,7 +55,7 @@ VOID GETDATA(struct TNCDATA * TNC);
VOID DOCONMODECHANGE(struct TNCDATA * TNC, int Stream); VOID DOCONMODECHANGE(struct TNCDATA * TNC, int Stream);
VOID SEND_CONNECTED(struct TNCDATA * TNC, int ToStream); VOID SEND_CONNECTED(struct TNCDATA * TNC, int ToStream);
VOID READCHANGE(int Stream); VOID READCHANGE(int Stream);
VOID DOMONITORING(int NeedTrace); VOID DOMONITORING(int NeedTrace, struct TNCDATA * TNC);
int APIENTRY DecodeFrame(MESSAGE * msg, char * buffer, time_t Stamp); int APIENTRY DecodeFrame(MESSAGE * msg, char * buffer, time_t Stamp);
time_t APIENTRY GetRaw(int stream, char * msg, int * len, int * count); time_t APIENTRY GetRaw(int stream, char * msg, int * len, int * count);
BOOL TfPut(struct TNCDATA * TNC, UCHAR character); BOOL TfPut(struct TNCDATA * TNC, UCHAR character);
@ -73,10 +73,11 @@ VOID DisableAppl(struct TNCDATA * TNC);
int BPQSerialSetPollDelay(HANDLE hDevice, int PollDelay); int BPQSerialSetPollDelay(HANDLE hDevice, int PollDelay);
int BPQSerialSendData(struct TNCDATA * TNC, UCHAR * Message,int MsgLen); int BPQSerialSendData(struct TNCDATA * TNC, UCHAR * Message,int MsgLen);
int BPQSerialGetData(struct TNCDATA * TNC, UCHAR * Message, unsigned int BufLen, ULONG * MsgLen); int BPQSerialGetData(struct TNCDATA * TNC, UCHAR * Message, unsigned int BufLen, ULONG * MsgLen);
int SendHostOK(struct TNCDATA * TNC);
extern struct TNCDATA * TNCCONFIGTABLE; extern struct TNCDATA * TNCCONFIGTABLE;
struct TNCDATA * TNC2TABLE; // malloc'ed struct TNCDATA * TNC2TABLE = NULL; // malloc'ed
extern int NUMBEROFTNCPORTS; extern int NUMBEROFTNCPORTS;
// MODEFLAG DEFINITIONS // MODEFLAG DEFINITIONS
@ -1214,7 +1215,7 @@ VOID TNCTRANS(struct TNCDATA * TNC, char * Tail, CMDX * CMD)
TNCStream->MODEFLAG |= TRANS; TNCStream->MODEFLAG |= TRANS;
TNCStream->MODEFLAG &= ~(COMMAND+CONV); TNCStream->MODEFLAG &= ~(COMMAND+CONV);
} }
static VOID RESTART(struct TNCDATA * TNC) static VOID TNCRESTART(struct TNCDATA * TNC)
{ {
// REINITIALISE CHANNEL // REINITIALISE CHANNEL
@ -1242,12 +1243,12 @@ static VOID RESTART(struct TNCDATA * TNC)
} }
static VOID UNPROTOCMD(struct TNCDATA * TNC, char * Tail, CMDX * CMD) static VOID TNCUNPROTOCMD(struct TNCDATA * TNC, char * Tail, CMDX * CMD)
{ {
} }
CMDX COMMANDLIST[] = CMDX TNCCOMMANDLIST[] =
{ {
"AUTOLF ",2, ONOFF, offsetof(struct TNCDATA, AUTOLF), "AUTOLF ",2, ONOFF, offsetof(struct TNCDATA, AUTOLF),
"BBSMON ",6, ONOFF, offsetof(struct TNCDATA, BBSMON), "BBSMON ",6, ONOFF, offsetof(struct TNCDATA, BBSMON),
@ -1292,15 +1293,15 @@ CMDX COMMANDLIST[] =
"PACLEN ",1,VALUE, offsetof(struct TNCDATA, TPACLEN), "PACLEN ",1,VALUE, offsetof(struct TNCDATA, TPACLEN),
"PASS ",3,VALHEX, offsetof(struct TNCDATA, PASSCHAR), "PASS ",3,VALHEX, offsetof(struct TNCDATA, PASSCHAR),
"RELEASE ",3,TNCRELEASE,0, "RELEASE ",3,TNCRELEASE,0,
"RESTART ",7,RESTART,0, "RESTART ",7,TNCRESTART,0,
"TRANS ",1,TNCTRANS,0, "TRANS ",1,TNCTRANS,0,
"UNPROTO ",1,UNPROTOCMD,0, "UNPROTO ",1,TNCUNPROTOCMD,0,
"USERS ",2,VALUE, offsetof(struct TNCDATA, Users), "USERS ",2,VALUE, offsetof(struct TNCDATA, Users),
}; };
static CMDX * CMD = NULL;
int NUMBEROFTNCCOMMANDS = sizeof(COMMANDLIST)/sizeof(CMDX);
int NUMBEROFTNCCOMMANDS = sizeof(TNCCOMMANDLIST)/sizeof(CMDX);
/*NEWVALUE DW 0 /*NEWVALUE DW 0
HEXFLAG DB 0 HEXFLAG DB 0
@ -1449,9 +1450,13 @@ BOOL InitializeTNCEmulator()
{ {
// Com Port may be a hardware device (ie /dev/ttyUSB0) COMn or VCOMn (BPQ Virtual COM) // Com Port may be a hardware device (ie /dev/ttyUSB0) COMn or VCOMn (BPQ Virtual COM)
char * Baud = strlop(TNC->PORTNAME, ','); char * Baud = strlop(TNC->PORTNAME, ':');
char * PNptr; char * PNptr;
if (Baud == 0)
Baud = strlop(TNC->PORTNAME, ',');
PNptr = &TNC->PORTNAME[0]; PNptr = &TNC->PORTNAME[0];
// Only show last element of name on Streams display // Only show last element of name on Streams display
@ -1750,17 +1755,46 @@ VOID TNCTimer()
struct TNCDATA * TNC = TNC2TABLE; struct TNCDATA * TNC = TNC2TABLE;
struct StreamInfo * channel; struct StreamInfo * channel;
int n; int n;
int NeedTrace = 0; int NeedTrace = 0;
struct TNCDATA * TTNC = 0; // First TNC2
while (TNC) while (TNC)
{ {
if (TNC->LastDEDPollTime && (time(NULL) > TNC->LastDEDPollTime + 30)) // No polls for 30 secs
{
int Len = 0;
int Count;
TNC->LastDEDPollTime = 0;
Debugprintf("DED Host Application Lost");
TNC->MODE = 0;
TNC->HOSTSTATE = 0;
DisableAppl(TNC);
// Clear Monitor Q
GetRaw(TNC->Channels[0]->BPQStream, (char *)&MONITORDATA, &Len, &Count);
while (Len)
{
GetRaw(TNC->Channels[0]->BPQStream, (char *)&MONITORDATA, &Len, &Count);
}
continue;
}
if (TNC->Mode != TNC2) if (TNC->Mode != TNC2)
goto NotTNC2; goto NotTNC2;
NeedTrace |= TNC->TRACEFLAG; //SEE IF ANY PORTS ARE MONITORING if (TTNC == 0 && TNC->TNC2Stream[0]) // Save first TNC2 TNC
TTNC = TNC;
// CHECK FOR PACTIMER EXPIRY AND CMDTIME
NeedTrace |= TNC->TRACEFLAG; //SEE IF ANY PORTS ARE MONITORING
// CHECK FOR PACTIMER EXPIRY AND CMDTIME
if (TNC->CMDTMR) if (TNC->CMDTMR)
{ {
@ -1820,7 +1854,8 @@ NotTNC2:
NextTNC: NextTNC:
TNC = TNC->Next; TNC = TNC->Next;
} }
DOMONITORING(NeedTrace); if (TTNC) // Only if we have TNC2 Streams
DOMONITORING(NeedTrace, TTNC);
} }
/* /*
@ -2213,35 +2248,28 @@ void CheckForDataFromTerminal(struct TNCDATA * TNC)
} }
VOID DOMONITORING(int NeedTrace) VOID DOMONITORING(int NeedTrace, struct TNCDATA * TTNC)
{ {
// IF ANY PORTS HAVE MONITOR ENABLED, SET MONITOR BIT ON FIRST PORT // IF ANY PORTS HAVE MONITOR ENABLED, SET MONITOR BIT ON FIRST PORT
struct TNCDATA * TNC = TNC2TABLE; // malloc'ed
int Tracebit = 0, len, count, n; int Tracebit = 0, len, count, n;
time_t Stamp; time_t Stamp;
uint64_t SaveMMASK = MMASK; uint64_t SaveMMASK = MMASK;
BOOL SaveMTX = MTX; BOOL SaveMTX = MTX;
BOOL SaveMCOM = MCOM; BOOL SaveMCOM = MCOM;
BOOL SaveMUI = MUIONLY; BOOL SaveMUI = MUIONLY;
int BPQStream = 0; struct TNCDATA * TNC = TNC2TABLE;
int BPQStream = TTNC->TNC2Stream[0]->BPQPort;
if (NeedTrace) if (NeedTrace)
Tracebit = 0x80; Tracebit = 0x80;
if (TNC->Channels[0])
BPQStream = TNC->Channels[0]->BPQStream;
else if (TNC->TNC2Stream[0])
BPQStream = TNC->TNC2Stream[0]->BPQPort;
else if (TNC->BPQPort)
BPQStream = TNC->BPQPort;
if (BPQStream) if (BPQStream)
{ {
if (TNC->CONOK) if (TTNC->CONOK && TTNC->Mode == TNC2)
SetAppl(BPQStream, TNC->APPLFLAGS | Tracebit, TNC->APPLICATION); SetAppl(BPQStream, TTNC->APPLFLAGS | Tracebit, TTNC->APPLICATION);
else else
SetAppl(BPQStream, TNC->APPLFLAGS | Tracebit, 0); SetAppl(BPQStream, TTNC->APPLFLAGS | Tracebit, 0);
} }
Stamp = GetRaw(BPQStream, (char *)&MONITORDATA, &len, &count); Stamp = GetRaw(BPQStream, (char *)&MONITORDATA, &len, &count);
@ -2585,7 +2613,7 @@ VOID TNCCOMMAND(struct TNCDATA * TNC)
ptr2 = ptr1; // Save ptr2 = ptr1; // Save
CMD = &COMMANDLIST[0]; CMD = &TNCCOMMANDLIST[0];
n = 0; n = 0;
for (n = 0; n < NUMBEROFTNCCOMMANDS; n++) for (n = 0; n < NUMBEROFTNCCOMMANDS; n++)
@ -3198,7 +3226,7 @@ VOID DisableAppl(struct TNCDATA * TNC)
{ {
int i, Stream; int i, Stream;
for (i = 1; i <= TNC->HOSTSTREAMS; i++) for (i = 0; i <= TNC->HOSTSTREAMS; i++)
{ {
Stream = TNC->Channels[i]->BPQStream; Stream = TNC->Channels[i]->BPQStream;
@ -3218,6 +3246,17 @@ VOID EnableAppl(struct TNCDATA * TNC)
} }
} }
VOID EnableDEDAppl(struct TNCDATA * TNC)
{
int i;
SetAppl(TNC->Channels[0]->BPQStream, 2 | TNC->TRACEFLAG, TNC->APPLICATION);
for (i = 1; i <= TNC->HOSTSTREAMS; i++)
{
SetAppl(TNC->Channels[i]->BPQStream, TNC->APPLFLAGS, TNC->APPLICATION);
}
}
BOOL TfPut(struct TNCDATA * TNC, UCHAR character) BOOL TfPut(struct TNCDATA * TNC, UCHAR character)
{ {
struct StreamInfo * Channel; struct StreamInfo * Channel;
@ -3298,8 +3337,8 @@ CHARMODE:
TNC->MODE = 1; TNC->MODE = 1;
TNC->CURSOR = (UCHAR *)&TNC->TONODEBUFFER; TNC->CURSOR = (UCHAR *)&TNC->TONODEBUFFER;
EnableAppl(TNC);
EnableDEDAppl(TNC);
return(TRUE); return(TRUE);
} }
@ -3372,24 +3411,29 @@ NOTDATA:
} }
if (TNC->DEDTXBUFFER[0] == 1)
goto DUFFHOSTCMD;
// sprintf(msg,"DED CMD: Port %d CMD %c MSGCHANNEL %d\n", TNC->ComPort, TNC->TONODEBUFFER[0], MSGCHANNEL); // sprintf(msg,"DED CMD: Port %d CMD %c MSGCHANNEL %d\n", TNC->ComPort, TNC->TONODEBUFFER[0], MSGCHANNEL);
// OutputDebugString(msg); // OutputDebugString(msg);
if (_memicmp(TNC->DEDTXBUFFER, "QRES", 4 == 0)) if (_memicmp(TNC->DEDTXBUFFER, "QRES", 4 == 0))
goto SENDHOSTOK; return SendHostOK(TNC);
switch (toupper(TNC->DEDTXBUFFER[0])) switch (toupper(TNC->DEDTXBUFFER[0]))
{ {
case 1: case 1: // Recovery
goto DUFFHOSTCMD; PUTCHARx(TNC, TNC->MSGCHANNEL);
for (i=0; i < LBADCMDREPLY; i++)
{
PUTCHARx(TNC, BADCMDREPLY[i]);
}
return TRUE;
case 'G': case 'G':
goto POLL; PROCESSPOLL(TNC, Channel);
return TRUE;
case 'I': case 'I':
goto ICMD; goto ICMD;
@ -3399,20 +3443,95 @@ NOTDATA:
TNC->MODE = TNC->DEDTXBUFFER[5] & 1; TNC->MODE = TNC->DEDTXBUFFER[5] & 1;
if (TNC->MODE) if (TNC->MODE)
EnableAppl(TNC); EnableDEDAppl(TNC);
else else
DisableAppl(TNC); DisableAppl(TNC);
goto SENDHOSTOK; return SendHostOK(TNC);
case 'C': case 'C':
goto CCMD; goto CCMD;
case 'D': case 'D':
goto DCMD;
// DISCONNECT REQUEST
Disconnect(Channel->BPQStream);
return SendHostOK(TNC);
case 'L': case 'L':
goto LCMD;
// Poll
PUTCHARx(TNC, TNC->MSGCHANNEL); // REPLY ON SAME CHANNEL
PUTCHARx(TNC, 1);
// GET STATE AND QUEUED BUFFERS
if (TNC->MSGCHANNEL)
{
// Data Channel
LocalSessionState(Channel->BPQStream, &State, &Change, FALSE);
if (State == 0)
Work = '0';
else
Work = '4'; // AX.25 STATE
PUTCHARx(TNC, Change + '0'); // Status Messages
PUTCHARx(TNC, ' ');
// GET OTHER QUEUE COUNTS
Count = RXCount(Channel->BPQStream);
sprintf(WorkString, "%d", Count); // message count
PUTSTRING(TNC, WorkString);
PUTCHARx(TNC, ' ');
// NOT SENT IS NUMBER ON OUR QUEUE, NOT ACKED NUMBER FROM SWITCH
// SEE HOW MANY BUFFERS ATTACHED TO Q HEADER IN BX
Count = 0;// C_Q_COUNT(Channel->Chan_TXQ);
sprintf(WorkString, "%d", Count); // message count
PUTSTRING(TNC, WorkString);
PUTCHARx(TNC, ' ');
if (Count > 8)
Work = '8'; // Busy
Count = CountFramesQueuedOnSession(L4);
sprintf(WorkString, "%d", Count); // message count
PUTSTRING(TNC, WorkString);
PUTCHARx(TNC, ' ');
}
else
{
//SEE IF MONITORED FRAMES AVAILABLE
TNC->LastDEDPollTime = time(NULL);
if (MONCount(TNC->Channels[0]->BPQStream))
Work = 0x31;
else
Work = 0x30;
}
PUTCHARx(TNC, '0');
PUTCHARx(TNC, ' ');
PUTCHARx(TNC, Work);
PUTCHARx(TNC, 0);
return TRUE;
case '@': case '@':
goto ATCOMMAND; goto ATCOMMAND;
@ -3425,14 +3544,52 @@ NOTDATA:
case 'M': case 'M':
if (TNC->DEDTXBUFFER[1] == 'N') // Support BPQ Extensions IUSC followed by optional port list
goto DISABLEMONITOR;
goto ENABLEMONITOR; if (TNC->DEDTXBUFFER[1] == 'N')
TNC->TRACEFLAG = 0;
else
{
char * ptr, * ptr2;
int port;
uint64_t mask = 0;
TNC->DEDTXBUFFER[TNC->MSGLENGTH] = 0;
ptr = strlop(TNC->DEDTXBUFFER, ' ');
_strupr(TNC->DEDTXBUFFER);
if (strchr(TNC->DEDTXBUFFER, 'U'))
TNC->MUIONLY = 1;
// Ptocess Mask
while (ptr && ptr[0])
{
ptr2 = strlop(ptr, ',');
port = atoi(ptr);
if (port)
{
mask |= ((uint64_t)1 << (port - 1));
ptr = ptr2;
}
}
if (mask)
TNC->MMASK = mask;
TNC->TRACEFLAG = 0x80;
}
SetAppl(TNC->Channels[0]->BPQStream, 2 | TNC->TRACEFLAG, TNC->APPLICATION);
return SendHostOK(TNC);
case 'K': case 'K':
case 'O': case 'O':
goto SENDHOSTOK; return SendHostOK(TNC);
case 'V': // Vesrion case 'V': // Vesrion
@ -3444,7 +3601,7 @@ NOTDATA:
return TRUE; return TRUE;
default: default:
goto SENDHOSTOK; return SendHostOK(TNC);
ATCOMMAND: ATCOMMAND:
@ -3547,40 +3704,15 @@ ICMD:
} }
ECMD: ECMD:
goto SENDHOSTOK; return SendHostOK(TNC);
DUFFHOSTCMD:
PUTCHARx(TNC, TNC->MSGCHANNEL);
for (i=0; i < LBADCMDREPLY; i++)
{
PUTCHARx(TNC, BADCMDREPLY[i]);
}
return TRUE;
ENABLEMONITOR:
TNC->TRACEFLAG = 0x80;
goto MONCOM;
DISABLEMONITOR:
TNC->TRACEFLAG = 0;
MONCOM:
SetAppl(TNC->Channels[0]->BPQStream, 2 | TNC->TRACEFLAG, TNC->APPLICATION);
goto SENDHOSTOK;
CCMD: CCMD:
// CONNECT REQUEST // CONNECT REQUEST
if (TNC->MSGCHANNEL == 0) if (TNC->MSGCHANNEL == 0)
goto SENDHOSTOK; // SETTING UNPROTO ADDR - JUST ACK IT return SendHostOK(TNC); // SETTING UNPROTO ADDR - JUST ACK IT
*TNC->DEDCURSOR = 0; *TNC->DEDCURSOR = 0;
@ -3651,91 +3783,13 @@ REALCALL:
// READCHANGE(Channel->BPQStream); // Suppress Connected to Switch // READCHANGE(Channel->BPQStream); // Suppress Connected to Switch
goto SENDHOSTOK; return SendHostOK(TNC);
} }
} }
goto SENDHOSTOK; return SendHostOK(TNC);
DCMD:
// DISCONNECT REQUEST
Disconnect(Channel->BPQStream);
goto SENDHOSTOK;
LCMD:
PUTCHARx(TNC, TNC->MSGCHANNEL); // REPLY ON SAME CHANNEL
PUTCHARx(TNC, 1);
// GET STATE AND QUEUED BUFFERS
if (TNC->MSGCHANNEL)
goto NORM_L;
// TO MONITOR CHANNEL
// SEE IF MONITORED FRAMES AVAILABLE
if (MONCount(TNC->Channels[0]->BPQStream))
Work = 0x31;
else
Work = 0x30;
goto MON_L;
NORM_L:
LocalSessionState(Channel->BPQStream, &State, &Change, FALSE);
if (State == 0)
Work = '0';
else
Work = '4'; // AX.25 STATE
PUTCHARx(TNC, Change + '0'); // Status Messages
PUTCHARx(TNC, ' ');
// GET OTHER QUEUE COUNTS
Count = RXCount(Channel->BPQStream);
sprintf(WorkString, "%d", Count); // message count
PUTSTRING(TNC, WorkString);
PUTCHARx(TNC, ' ');
// NOT SENT IS NUMBER ON OUR QUEUE, NOT ACKED NUMBER FROM SWITCH
// SEE HOW MANY BUFFERS ATTACHED TO Q HEADER IN BX
Count = 0;// C_Q_COUNT(Channel->Chan_TXQ);
sprintf(WorkString, "%d", Count); // message count
PUTSTRING(TNC, WorkString);
PUTCHARx(TNC, ' ');
if (Count > 8)
Work = '8'; // Busy
Count = CountFramesQueuedOnSession(L4);
sprintf(WorkString, "%d", Count); // message count
PUTSTRING(TNC, WorkString);
PUTCHARx(TNC, ' ');
MON_L:
PUTCHARx(TNC, '0');
PUTCHARx(TNC, ' ');
PUTCHARx(TNC, Work);
PUTCHARx(TNC, 0);
return TRUE;
HOSTDATAPACKET: HOSTDATAPACKET:
@ -3763,7 +3817,7 @@ HOSTDATAPACKET:
// C_Q_ADD(Channel->Chan_TXQ, COPYMSGTOBUFFERS()); // RETURNS EDI = FIRST (OR ONLY) FRAGMENT // C_Q_ADD(Channel->Chan_TXQ, COPYMSGTOBUFFERS()); // RETURNS EDI = FIRST (OR ONLY) FRAGMENT
// goto SENDHOSTOK; // return SendHostOK(TNC);
// MAKE SURE NODE ISNT BUSY // MAKE SURE NODE ISNT BUSY
@ -3778,17 +3832,13 @@ HOSTDATAPACKET:
// OK TO PASS TO NODE // OK TO PASS TO NODE
SENDENFORCINGPACLEN(Channel, TNC->DEDTXBUFFER, TNC->MSGLENGTH); SENDENFORCINGPACLEN(Channel, TNC->DEDTXBUFFER, TNC->MSGLENGTH);
goto SENDHOSTOK; return SendHostOK(TNC);
SendUnproto: SendUnproto:
SendMsg(0, TXBUFFERPTR, TNC->MSGLENGTH); SendMsg(0, TXBUFFERPTR, TNC->MSGLENGTH);
goto SENDHOSTOK; return SendHostOK(TNC);
POLL:
PROCESSPOLL(TNC, Channel);
return TRUE;
YCMD: YCMD:
@ -3835,83 +3885,53 @@ YCMD:
TNC->HOSTSTREAMS = Work; TNC->HOSTSTREAMS = Work;
} }
/* return SendHostOK(TNC);
}
Why is this here?
{
int Len=0;
UCHAR Message[1000];
while (TNC->RXCOUNT > 0)
{
Message[Len++]= *(TNC->PUTPTR++);
TNC->RXCOUNT--;
if (TNC->PUTPTR == &TNC->TOUSERBUFFER[TNCBUFFLEN])
TNC->PUTPTR = (UCHAR *)&TNC->TOUSERBUFFER;
if (Len > 900)
{
BPQSerialSendData(TNC, Message, Len);
Len = 0;
}
}
if (Len > 0)
{
BPQSerialSendData(TNC, Message, Len);
}
}
_asm {
popad
RET
*/
SENDHOSTOK:
int SendHostOK(struct TNCDATA * TNC)
{
PUTCHARx(TNC, TNC->MSGCHANNEL); // REPLY ON SAME CHANNEL PUTCHARx(TNC, TNC->MSGCHANNEL); // REPLY ON SAME CHANNEL
PUTCHARx(TNC, 0); // NOTHING DOING PUTCHARx(TNC, 0); // NOTHING DOING
return TRUE; return TRUE;
} }
int PROCESSPOLL(struct TNCDATA * TNC, struct StreamInfo * Channel) int PROCESSPOLL(struct TNCDATA * TNC, struct StreamInfo * Channel)
{ {
int PollType; // DED Mode - ASK SWITCH FOR STATUS CHANGE OR ANY RECEIVED DATA
// ASK SWITCH FOR STATUS CHANGE OR ANY RECEIVED DATA if (TNC->MSGLENGTH == 1) // General Poll
{
if (STATUSPOLL(TNC, Channel))
return TRUE; // Status was reported
if (TNC->MSGLENGTH == 1) if (DATAPOLL(TNC, Channel))
goto GENERALPOLL; return TRUE; // Data Sent
PollType = 0; PUTCHARx(TNC, TNC->MSGCHANNEL); // REPLY ON SAME CHANNEL
PUTCHARx(TNC, 0); // NOTHING DOING
// HE'S BEING AWKWARD, AND USING SPECIFIC DATA/STATUS POLL return TRUE;
}
if (TNC->TONODEBUFFER[1] == '0') // HE'S BEING AWKWARD, AND USING SPECIFIC DATA/STATUS POLL
goto DATAONLY;
STATUSPOLL(TNC, Channel); if (TNC->TONODEBUFFER[1] == '0') // Data only
{
if (DATAPOLL(TNC, Channel))
return TRUE; // Data Sent
GENERALPOLL: PUTCHARx(TNC, TNC->MSGCHANNEL); // REPLY ON SAME CHANNEL
PUTCHARx(TNC, 0); // NOTHING DOING
return TRUE;
}
// Must be Status only
if (STATUSPOLL(TNC, Channel)) if (STATUSPOLL(TNC, Channel))
return TRUE; // Status was reported return TRUE; // Status was reported
DATAONLY:
if (DATAPOLL(TNC, Channel))
return TRUE; // Data Sent
goto SENDHOSTOK; // NOTHING DOING
SENDHOSTOK:
PUTCHARx(TNC, TNC->MSGCHANNEL); // REPLY ON SAME CHANNEL PUTCHARx(TNC, TNC->MSGCHANNEL); // REPLY ON SAME CHANNEL
PUTCHARx(TNC, 0); // NOTHING DOING PUTCHARx(TNC, 0); // NOTHING DOING
@ -3980,13 +4000,15 @@ and then the very next poll to channel 0 will get:
*/ */
Decoded[Len] = 0;
iptr = strchr(&Decoded[10], ':'); // Info if present iptr = strchr(&Decoded[10], ':'); // Info if present
MONHEADER[0] = 4; // NO DATA FOLLOWS MONHEADER[0] = 4; // NO DATA FOLLOWS
MONCURSOR = &MONHEADER[1]; MONCURSOR = &MONHEADER[1];
if (strstr(Decoded, "NET/ROM") || strstr(Decoded, "NODES br") || strstr(Decoded, "INP3 RIF")) if (strstr(Decoded, "NET/ROM") || strstr(Decoded, "NODES br") || strstr(Decoded, "INP3 RIF"))
pid = 0xcf; return 0; //pid = 0xcf;
else else
pid = 0xf0; pid = 0xf0;
@ -4763,21 +4785,21 @@ nochange:
return; return;
} }
int DOCOMMAND(struct TNCDATA * conn) int DOCOMMAND(struct TNCDATA * TNC)
{ {
char Errbuff[500]; char Errbuff[500];
int i; int i;
// PROCESS NORMAL MODE COMMAND // PROCESS NORMAL MODE COMMAND
sprintf(Errbuff, "BPQHOST Port %d Normal Mode CMD %s\n",conn->ComPort, conn->TONODEBUFFER); Debugprintf(Errbuff, "BPQHOST Port %d Normal Mode CMD %s\n",TNC->ComPort, TNC->TONODEBUFFER);
OutputDebugString(Errbuff);
// IF ECHO ENABLED, ECHO IT // IF ECHO ENABLED, ECHO IT
if (conn->ECHOFLAG) if (TNC->ECHOFLAG)
{ {
UCHAR * ptr = conn->TONODEBUFFER; UCHAR * ptr = TNC->TONODEBUFFER;
UCHAR c; UCHAR c;
do do
@ -4786,36 +4808,35 @@ int DOCOMMAND(struct TNCDATA * conn)
if (c == 0x1b) c = ':'; if (c == 0x1b) c = ':';
PUTCHARx(conn, c); PUTCHARx(TNC, c);
} while (c != 13); } while (c != 13);
} }
if (conn->TONODEBUFFER[0] != 0x1b) if (TNC->TONODEBUFFER[0] != 0x1b)
goto NOTCOMMAND; // DATA IN NORMAL MODE - IGNORE goto NOTCOMMAND; // DATA IN NORMAL MODE - IGNORE
switch (toupper(conn->TONODEBUFFER[1])) switch (toupper(TNC->TONODEBUFFER[1]))
{ {
case 'J': case 'J':
if (conn->TONODEBUFFER[6] == 0x0d) if (TNC->TONODEBUFFER[6] == 0x0d)
conn->MODE = 0; TNC->MODE = 0;
else else
conn->MODE = conn->TONODEBUFFER[6] & 1; TNC->MODE = TNC->TONODEBUFFER[6] & 1;
if (conn->MODE) if (TNC->MODE)
EnableAppl(conn);
else
DisableAppl(conn);
if (conn->MODE)
{ {
// send host mode ack // send host mode ack
// PUTCHARx(conn, 0); // PUTCHARx(conn, 0);
// PUTCHARx(conn, 0); // PUTCHARx(conn, 0);
conn->CURSOR = (UCHAR *)&conn->TONODEBUFFER; EnableDEDAppl(TNC);
}
else
{
DisableAppl(TNC);
return 0; return 0;
} }
@ -4823,20 +4844,20 @@ int DOCOMMAND(struct TNCDATA * conn)
case 'E': case 'E':
conn->ECHOFLAG = conn->TONODEBUFFER[2] & 1; TNC->ECHOFLAG = TNC->TONODEBUFFER[2] & 1;
break; break;
case 'I': case 'I':
{ {
// Save call // Save call
char * Call = &conn->TONODEBUFFER[2]; char * Call = &TNC->TONODEBUFFER[2];
*(conn->CURSOR - 2) = 0; *(TNC->CURSOR - 2) = 0;
for (i = 0; i <= conn->HOSTSTREAMS; i++) for (i = 0; i <= TNC->HOSTSTREAMS; i++)
{ {
strcpy(conn->Channels[i]->MYCall, Call); strcpy(TNC->Channels[i]->MYCall, Call);
} }
break;; break;;
@ -4845,11 +4866,11 @@ int DOCOMMAND(struct TNCDATA * conn)
// PARAMS COMMAND - RETURN FIXED STRING // PARAMS COMMAND - RETURN FIXED STRING
PARAMPORT = conn->TONODEBUFFER[2]; PARAMPORT = TNC->TONODEBUFFER[2];
for (i=0; i < LPARAMREPLY; i++) for (i=0; i < LPARAMREPLY; i++)
{ {
PUTCHARx(conn, PARAMREPLY[i]); PUTCHARx(TNC, PARAMREPLY[i]);
} }
break; break;
@ -4859,7 +4880,7 @@ int DOCOMMAND(struct TNCDATA * conn)
// Return Channel Not Connected // Return Channel Not Connected
PUTSTRING(conn, "* CHANNEL NOT CONNECTED *\r"); PUTSTRING(TNC, "* CHANNEL NOT CONNECTED *\r");
default: default:
@ -4875,7 +4896,7 @@ int DOCOMMAND(struct TNCDATA * conn)
NOTCOMMAND: NOTCOMMAND:
conn->CURSOR = (UCHAR *)&conn->TONODEBUFFER; TNC->CURSOR = (UCHAR *)&TNC->TONODEBUFFER;
return 0; return 0;
@ -4960,7 +4981,7 @@ int DATAPOLL(struct TNCDATA * TNC, struct StreamInfo * Channel)
return TRUE; return TRUE;
} }
OutputDebugString("BPQHOST Mondata Flag Set with no data"); Debugprintf("BPQHOST Mondata Flag Set with no data");
NOMONITOR: NOMONITOR:
@ -4968,7 +4989,7 @@ NOMONITOR:
stamp = GetRaw(TNC->Channels[0]->BPQStream, (char *)&MONITORDATA, &Len, &Count); stamp = GetRaw(TNC->Channels[0]->BPQStream, (char *)&MONITORDATA, &Len, &Count);
if (Len) while (Len)
{ {
// Use Normal Decode, then reformat to DED standard // Use Normal Decode, then reformat to DED standard
@ -4978,14 +4999,18 @@ NOMONITOR:
BOOL SaveMUI = MUIONLY; BOOL SaveMUI = MUIONLY;
unsigned char Decoded[1000]; unsigned char Decoded[1000];
IntSetTraceOptionsEx(TNC->MMASK, TNC->MTX, TNC->MCOM, 0); IntSetTraceOptionsEx(TNC->MMASK, TNC->MTX, TNC->MCOM, TNC->MUIONLY);
Len = IntDecodeFrame(&MONITORDATA, Decoded, stamp, TNC->MMASK, FALSE, FALSE); Len = IntDecodeFrame(&MONITORDATA, Decoded, stamp, TNC->MMASK, FALSE, FALSE);
IntSetTraceOptionsEx(SaveMMASK, SaveMTX, SaveMCOM, SaveMUI); IntSetTraceOptionsEx(SaveMMASK, SaveMTX, SaveMCOM, SaveMUI);
if (Len) if (Len)
{ {
return ConvertToDEDMonFormat(TNC, Decoded, Len, &MONITORDATA); if (ConvertToDEDMonFormat(TNC, Decoded, Len, &MONITORDATA))
return 1;
stamp = GetRaw(TNC->Channels[0]->BPQStream, (char *)&MONITORDATA, &Len, &Count);
} }
} }
return 0; return 0;
} }

View File

@ -99,6 +99,9 @@ extern HWND ClientWnd, FrameWnd;
extern HANDLE hInstance; extern HANDLE hInstance;
static RECT Rect; static RECT Rect;
LRESULT CALLBACK TelWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
#endif #endif
extern int REALTIMETICKS; extern int REALTIMETICKS;
@ -126,9 +129,6 @@ static int ProcessLine(char * buf, int Port);
VOID __cdecl Debugprintf(const char * format, ...); VOID __cdecl Debugprintf(const char * format, ...);
char * strlop(char * buf, char delim); char * strlop(char * buf, char delim);
#ifndef LINBPQ
LRESULT CALLBACK TelWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
#endif
int DisplaySessions(struct TNCINFO * TNC); int DisplaySessions(struct TNCINFO * TNC);
int DoStateChange(int Stream); int DoStateChange(int Stream);
@ -185,7 +185,9 @@ void DeleteTelnetLogFiles()
int DeleteLogFile(char * Log) int DeleteLogFile(char * Log)
{ {
WIN32_FIND_DATA ffd;
WIN32_FIND_DATA ffd;
char szDir[MAX_PATH]; char szDir[MAX_PATH];
char File[MAX_PATH]; char File[MAX_PATH];
@ -290,7 +292,6 @@ int DeleteTelnetLogFiles()
void BuffertoNode(struct ConnectionInfo * sockptr, char * MsgPtr, int InputLen) void BuffertoNode(struct ConnectionInfo * sockptr, char * MsgPtr, int InputLen)
{ {
// Queue to Node. Data may arrive it large quatities, possibly exceeding node buffer capacity // Queue to Node. Data may arrive it large quatities, possibly exceeding node buffer capacity
@ -792,23 +793,12 @@ scanCTEXT:
static int MaxStreams = 26; static int MaxStreams = 26;
struct TNCINFO * CreateTTYInfo(int port, int speed);
BOOL OpenConnection(int);
BOOL SetupConnection(int);
BOOL CloseConnection(struct TNCINFO * conn);
BOOL WriteCommBlock(struct TNCINFO * TNC);
BOOL DestroyTTYInfo(int port);
void CheckRX(struct TNCINFO * TNC); void CheckRX(struct TNCINFO * TNC);
VOID TelnetPoll(int Port); VOID TelnetPoll(int Port);
VOID ProcessTermModeResponse(struct TNCINFO * TNC); VOID ProcessTermModeResponse(struct TNCINFO * TNC);
VOID DoTNCReinit(struct TNCINFO * TNC); VOID DoTNCReinit(struct TNCINFO * TNC);
VOID DoTermModeTimeout(struct TNCINFO * TNC); VOID DoTermModeTimeout(struct TNCINFO * TNC);
VOID ProcessPacket(struct TNCINFO * TNC, UCHAR * rxbuffer, int Len);
VOID ProcessKPacket(struct TNCINFO * TNC, UCHAR * rxbuffer, int Len);
VOID ProcessKHOSTPacket(struct TNCINFO * TNC, UCHAR * rxbuffer, int Len);
VOID ProcessKNormCommand(struct TNCINFO * TNC, UCHAR * rxbuffer);
VOID ProcessHostFrame(struct TNCINFO * TNC, UCHAR * rxbuffer, int Len);
VOID DoMonitor(struct TNCINFO * TNC, UCHAR * Msg, int Len); VOID DoMonitor(struct TNCINFO * TNC, UCHAR * Msg, int Len);
@ -1672,6 +1662,7 @@ BOOL OpenSockets(struct TNCINFO * TNC)
SOCKET OpenSocket6(struct TNCINFO * TNC, int port) SOCKET OpenSocket6(struct TNCINFO * TNC, int port)
{ {
struct sockaddr_in6 local_sin; /* Local socket - internet style */ struct sockaddr_in6 local_sin; /* Local socket - internet style */
struct sockaddr_in6 * psin; struct sockaddr_in6 * psin;
SOCKET sock; SOCKET sock;
@ -2774,7 +2765,7 @@ LRESULT CALLBACK TelWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
// struct ConnectionInfo * ConnectionInfo; // struct ConnectionInfo * ConnectionInfo;
for (i=1; i<33; i++) for (i=1; i <= MAXBPQPORTS; i++)
{ {
TNC = TNCInfo[i]; TNC = TNCInfo[i];
if (TNC == NULL) if (TNC == NULL)
@ -3122,7 +3113,6 @@ LRESULT CALLBACK TelWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
return DefMDIChildProc(hWnd, message, wParam, lParam); return DefMDIChildProc(hWnd, message, wParam, lParam);
} }
#endif #endif
int Socket_Accept(struct TNCINFO * TNC, SOCKET SocketId, int Port) int Socket_Accept(struct TNCINFO * TNC, SOCKET SocketId, int Port)

View File

@ -25,7 +25,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include "CHeaders.h" #include "CHeaders.h"
int (WINAPI FAR *GetModuleFileNameExPtr)(); extern int (WINAPI FAR *GetModuleFileNameExPtr)();
extern int (WINAPI FAR *EnumProcessesPtr)(); extern int (WINAPI FAR *EnumProcessesPtr)();

View File

@ -339,8 +339,13 @@ BOOL UZ7HOStartPort(struct PORTCONTROL * PORT)
VOID UZ7HOSuspendPort(struct TNCINFO * TNC) VOID UZ7HOSuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC)
{ {
// We don't want to suspend port if on same TNC
if (MasterPort[TNC->Port] == MasterPort[ThisTNC->Port])
return;
TNC->PortRecord->PORTCONTROL.PortSuspended = TRUE; TNC->PortRecord->PORTCONTROL.PortSuspended = TRUE;
RegisterAPPLCalls(TNC, TRUE); RegisterAPPLCalls(TNC, TRUE);
} }
@ -2315,6 +2320,16 @@ GotStream:
if (_stricmp(RXHeader->callto, Appl) == 0) if (_stricmp(RXHeader->callto, Appl) == 0)
break; break;
memcpy(Appl, APPL->APPLALIAS_TEXT, 10);
ptr=strchr(Appl, ' ');
if (ptr)
*ptr = 0;
if (_stricmp(RXHeader->callto, Appl) == 0)
break;
} }
if (App < 32) if (App < 32)

2
V4.c
View File

@ -40,7 +40,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include "tncinfo.h" #include "tncinfo.h"
#include "bpq32.h" #include "bpq32.h"
int (WINAPI FAR *GetModuleFileNameExPtr)(); extern int (WINAPI FAR *GetModuleFileNameExPtr)();
#define WSA_ACCEPT WM_USER + 1 #define WSA_ACCEPT WM_USER + 1
#define WSA_DATA WM_USER + 2 #define WSA_DATA WM_USER + 2

13
VARA.c
View File

@ -34,7 +34,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include <Psapi.h> #include <Psapi.h>
#endif #endif
int (WINAPI FAR *GetModuleFileNameExPtr)(); extern int (WINAPI FAR *GetModuleFileNameExPtr)();
extern int (WINAPI FAR *EnumProcessesPtr)(); extern int (WINAPI FAR *EnumProcessesPtr)();
#define SD_RECEIVE 0x00 #define SD_RECEIVE 0x00
@ -342,8 +342,15 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
// approx 100 mS Timer. May now be needed, as Poll can be called more frequently in some circumstances // approx 100 mS Timer. May now be needed, as Poll can be called more frequently in some circumstances
// Check session limit timer // G7TAJ's code to record activity for stats display
if ( TNC->BusyFlags && CDBusy )
TNC->PortRecord->PORTCONTROL.ACTIVE += 2;
if ( TNC->PTTState )
TNC->PortRecord->PORTCONTROL.SENDING += 2;
// Check session limit timer
if ((STREAM->Connecting || STREAM->Connected) && !STREAM->Disconnecting) if ((STREAM->Connecting || STREAM->Connected) && !STREAM->Disconnecting)
{ {
@ -970,7 +977,7 @@ static int WebProc(struct TNCINFO * TNC, char * Buff, BOOL LOCAL)
return Len; return Len;
} }
VOID VARASuspendPort(struct TNCINFO * TNC) VOID VARASuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC)
{ {
VARASendCommand(TNC, "LISTEN OFF\r", TRUE); VARASendCommand(TNC, "LISTEN OFF\r", TRUE);
} }

View File

@ -10,8 +10,8 @@
#endif #endif
#define KVers 6,0,23,71 #define KVers 6,0,23,76
#define KVerstring "6.0.23.71\0" #define KVerstring "6.0.23.76\0"
#ifdef CKernel #ifdef CKernel

View File

@ -76,8 +76,8 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include <Psapi.h> #include <Psapi.h>
#endif #endif
int (WINAPI FAR *GetModuleFileNameExPtr)(); extern int (WINAPI FAR *GetModuleFileNameExPtr)();
int (WINAPI FAR *EnumProcessesPtr)(); extern int (WINAPI FAR *EnumProcessesPtr)();
#define SD_RECEIVE 0x00 #define SD_RECEIVE 0x00
@ -1339,7 +1339,7 @@ VOID SuspendOtherPorts(struct TNCINFO * ThisTNC)
if (rxInterlock == 0 || txInterlock == 0) if (rxInterlock == 0 || txInterlock == 0)
return; return;
for (i=1; i<33; i++) for (i = 1; i <= MAXBPQPORTS; i++)
{ {
TNC = TNCInfo[i]; TNC = TNCInfo[i];
if (TNC == NULL) if (TNC == NULL)
@ -1350,7 +1350,7 @@ VOID SuspendOtherPorts(struct TNCINFO * ThisTNC)
if (rxInterlock == TNC->RXRadio || txInterlock == TNC->TXRadio) // Same Group if (rxInterlock == TNC->RXRadio || txInterlock == TNC->TXRadio) // Same Group
if (TNC->SuspendPortProc) if (TNC->SuspendPortProc)
TNC->SuspendPortProc(TNC); TNC->SuspendPortProc(TNC, ThisTNC);
} }
} }
@ -1366,7 +1366,7 @@ VOID ReleaseOtherPorts(struct TNCINFO * ThisTNC)
if (rxInterlock == 0 && txInterlock == 0) if (rxInterlock == 0 && txInterlock == 0)
return; return;
for (i=1; i<33; i++) for (i=1; i <= MAXBPQPORTS; i++)
{ {
TNC = TNCInfo[i]; TNC = TNCInfo[i];
if (TNC == NULL) if (TNC == NULL)
@ -1381,7 +1381,7 @@ VOID ReleaseOtherPorts(struct TNCINFO * ThisTNC)
} }
} }
VOID WinmorSuspendPort(struct TNCINFO * TNC) VOID WinmorSuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC)
{ {
if (TNC->CONNECTED) if (TNC->CONNECTED)
send(TNC->TCPSock, "CODEC FALSE\r\n", 14, 0); send(TNC->TCPSock, "CODEC FALSE\r\n", 14, 0);

View File

@ -34,7 +34,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include "CHeaders.h" #include "CHeaders.h"
int (WINAPI FAR *GetModuleFileNameExPtr)(); extern int (WINAPI FAR *GetModuleFileNameExPtr)();
extern int (WINAPI FAR *EnumProcessesPtr)(); extern int (WINAPI FAR *EnumProcessesPtr)();
#include "tncinfo.h" #include "tncinfo.h"
@ -98,7 +98,7 @@ BOOL KAMStartPort(struct PORTCONTROL * PORT);
BOOL KAMStopPort(struct PORTCONTROL * PORT); BOOL KAMStopPort(struct PORTCONTROL * PORT);
extern VOID TRKSuspendPort(struct TNCINFO * TNC); extern VOID TRKSuspendPort(struct TNCINFO * TNC, struct TNCINFO * ThisTNC);
extern VOID TRKReleasePort(struct TNCINFO * TNC); extern VOID TRKReleasePort(struct TNCINFO * TNC);
extern VOID CloseDebugLogFile(int Port); extern VOID CloseDebugLogFile(int Port);
extern BOOL OpenDebugLogFile(int Port); extern BOOL OpenDebugLogFile(int Port);
@ -495,6 +495,14 @@ ok:
// 100 mS Timer. // 100 mS Timer.
// G7TAJ's code to record activity for stats display
if ( TNC->BusyFlags && CDBusy )
TNC->PortRecord->PORTCONTROL.ACTIVE += 2;
if ( TNC->PTTState )
TNC->PortRecord->PORTCONTROL.SENDING += 2;
// See if waiting for connect after changing MYCALL // See if waiting for connect after changing MYCALL
if (TNC->SlowTimer) if (TNC->SlowTimer)

View File

@ -730,6 +730,9 @@ typedef struct KISSINFO
struct KISSINFO * POLLPOINTER; // LAST GROUP POLLED struct KISSINFO * POLLPOINTER; // LAST GROUP POLLED
int POLLED; // SET WHEN POLL RECEIVED int POLLED; // SET WHEN POLL RECEIVED
UCHAR * KISSCMD; // Commands to be sent when port opened
int KISSCMDLEN;
// UCHAR WIN32INFO[16]; // FOR WINDOWS DRIVER // UCHAR WIN32INFO[16]; // FOR WINDOWS DRIVER
} *PKISSINFO; } *PKISSINFO;
@ -1158,6 +1161,7 @@ struct TNCDATA
BOOL MCON; // TRACE MODE FLAGS BOOL MCON; // TRACE MODE FLAGS
BOOL MCOM; BOOL MCOM;
BOOL MALL; BOOL MALL;
BOOL MUIONLY;
BOOL AUTOLF; // Add LF after CR BOOL AUTOLF; // Add LF after CR
BOOL BBSMON; // SPECIAL SHORT MONITOR FOR BBS BOOL BBSMON; // SPECIAL SHORT MONITOR FOR BBS
BOOL MTX; // MONITOR TRANSMITTED FRAMES BOOL MTX; // MONITOR TRANSMITTED FRAMES
@ -1210,6 +1214,8 @@ struct TNCDATA
int MONLENGTH; int MONLENGTH;
int MONFLAG; int MONFLAG;
time_t LastDEDPollTime; // To detect lost host program
// Kantronics Fields // Kantronics Fields
int RXBPtr; int RXBPtr;

View File

@ -1344,7 +1344,7 @@ LRESULT FAR PASCAL ConfigWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lPa
BOOL UDPFlag, BCFlag; BOOL UDPFlag, BCFlag;
struct AXIPPORTINFO * PORT; struct AXIPPORTINFO * PORT;
for (i=1; i<33; i++) for (i=1; i <= MAXBPQPORTS; i++)
{ {
PORT = Portlist[i]; PORT = Portlist[i];
if (PORT == NULL) if (PORT == NULL)
@ -1648,7 +1648,7 @@ LRESULT CALLBACK MHWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
int i; int i;
for (i=1; i<33; i++) for (i=1; i <= MAXBPQPORTS; i++)
{ {
PORT = Portlist[i]; PORT = Portlist[i];
if (PORT == NULL) if (PORT == NULL)

View File

@ -198,6 +198,10 @@ char WindowSize[32];
extern config_setting_t * group; extern config_setting_t * group;
char RTFHeader[4000];
int RTFHddrLen;
int ProgramErrors = 0; int ProgramErrors = 0;
// Forward declarations of functions included in this code module: // Forward declarations of functions included in this code module:
@ -1255,9 +1259,8 @@ int RefreshMainWindow()
#define VERSION_MAJOR 2 #define VERSION_MAJOR 2
#define VERSION_MINOR 0 #define VERSION_MINOR 0
SOCKADDR_IN local_sin; /* Local socket - internet style */ static SOCKADDR_IN local_sin; /* Local socket - internet style */
static PSOCKADDR_IN psin;
PSOCKADDR_IN psin;
SOCKET sock; SOCKET sock;

View File

@ -483,9 +483,8 @@ typedef struct user_t
#define MAXLINES 1000 #define MAXLINES 1000
#define LINELEN 200 #define LINELEN 200
char RTFHeader[4000]; extern char RTFHeader[4000];
extern int RTFHddrLen;
int RTFHddrLen;
struct ConsoleInfo struct ConsoleInfo
{ {

View File

@ -350,6 +350,17 @@ struct B2RestartData
int Count; // Give up if too many restarts int Count; // Give up if too many restarts
}; };
//------ TAJ -----
typedef struct PGARGS
{
CIRCUIT * conn;
struct UserInfo * user;
char InputBuffer[80];
int Len;
}RUNPGARGS, *RUNPGARGS_PTR;
//---------------
#pragma pack(1) #pragma pack(1)
struct TempUserInfo struct TempUserInfo
@ -375,7 +386,11 @@ struct TempUserInfo
int LLCount; // Number still to send in List Last N int LLCount; // Number still to send in List Last N
int UpdateLatest; // if set, save last listed as latest int UpdateLatest; // if set, save last listed as latest
BOOL IncludeKilled; // Show Killed Messages if SYSOP BOOL IncludeKilled; // Show Killed Messages if SYSOP
//--- TAJ ---
int PG_INDEX; // current index of PG server
int PG_SERVER; // PG server to run
RUNPGARGS_PTR RUNPGPARAMS; // pointer to RUNPGARGS for dealloc
//-----------
}; };
#define PMSG 1 #define PMSG 1
@ -759,9 +774,8 @@ struct FBBHeaderLine
#define MAXLINES 1000 #define MAXLINES 1000
#define LINELEN 200 #define LINELEN 200
char RTFHeader[4000]; extern char RTFHeader[4000];
extern int RTFHddrLen;
int RTFHddrLen;
struct ConsoleInfo struct ConsoleInfo
{ {
@ -1577,7 +1591,7 @@ extern BOOL WarnNoRoute;
extern BOOL SendPtoMultiple; extern BOOL SendPtoMultiple;
extern BOOL Localtime; extern BOOL Localtime;
struct ConsoleInfo * ConsHeader[2]; extern struct ConsoleInfo * ConsHeader[2];
extern BOOL NeedHomeBBS; extern BOOL NeedHomeBBS;
extern char ConfigName[250]; extern char ConfigName[250];

1604
bpqmail.h.bak Normal file

File diff suppressed because it is too large Load Diff

24
cMain.c
View File

@ -1050,6 +1050,30 @@ BOOL Start()
PORT->SmartIDInterval = PortRec->SmartID; PORT->SmartIDInterval = PortRec->SmartID;
if (PortRec->KissParams && (PORT->PORTTYPE == 0 || PORT->PORTTYPE == 22))
{
struct KISSINFO * KISS = (struct KISSINFO *)PORT;
UCHAR KissString[128];
int KissLen = 0;
unsigned char * Kissptr = KissString;
char * ptr;
char * Context;
ptr = strtok_s(PortRec->KissParams, " ", &Context);
while (ptr && ptr[0] && KissLen < 120)
{
*(Kissptr++) = atoi (ptr);
KissLen++;
ptr = strtok_s(NULL, " ", &Context);
}
KISS->KISSCMD = malloc(256);
KISS->KISSCMDLEN = KissEncode(KissString, KISS->KISSCMD, KissLen);
realloc(KISS->KISSCMD, KISS->KISSCMDLEN);
}
if (PortRec->BBSFLAG) // Appl 1 no permitted - BBSFLAG=NOBBS if (PortRec->BBSFLAG) // Appl 1 no permitted - BBSFLAG=NOBBS
PORT->PERMITTEDAPPLS &= 0xfffffffe; // Clear bottom bit PORT->PERMITTEDAPPLS &= 0xfffffffe; // Clear bottom bit

View File

@ -255,6 +255,7 @@ int simple(int i);
int C_Q_ADD_NP(VOID *PQ, VOID *PBUFF); int C_Q_ADD_NP(VOID *PQ, VOID *PBUFF);
int doSerialPortName(int i, char * value, char * rec); int doSerialPortName(int i, char * value, char * rec);
int doPermittedAppls(int i, char * value, char * rec); int doPermittedAppls(int i, char * value, char * rec);
int doKissCommand(int i, char * value, char * rec);
BOOL ProcessAPPLDef(char * rec); BOOL ProcessAPPLDef(char * rec);
BOOL ToLOC(double Lat, double Lon , char * Locator); BOOL ToLOC(double Lat, double Lon , char * Locator);
@ -360,7 +361,7 @@ static char *pkeywords[] =
"BCALL", "DIGIMASK", "NOKEEPALIVES", "COMPORT", "DRIVER", "WL2KREPORT", "UIONLY", "BCALL", "DIGIMASK", "NOKEEPALIVES", "COMPORT", "DRIVER", "WL2KREPORT", "UIONLY",
"UDPPORT", "IPADDR", "I2CBUS", "I2CDEVICE", "UDPTXPORT", "UDPRXPORT", "NONORMALIZE", "UDPPORT", "IPADDR", "I2CBUS", "I2CDEVICE", "UDPTXPORT", "UDPRXPORT", "NONORMALIZE",
"IGNOREUNLOCKEDROUTES", "INP3ONLY", "TCPPORT", "RIGPORT", "PERMITTEDAPPLS", "HIDE", "IGNOREUNLOCKEDROUTES", "INP3ONLY", "TCPPORT", "RIGPORT", "PERMITTEDAPPLS", "HIDE",
"SMARTID"}; /* parameter keywords */ "SMARTID", "KISSCOMMAND"}; /* parameter keywords */
static void * poffset[] = static void * poffset[] =
{ {
@ -374,7 +375,7 @@ static void * poffset[] =
&xxp.BCALL, &xxp.DIGIMASK, &xxp.DefaultNoKeepAlives, &xxp.IOADDR, &xxp.DLLNAME, &xxp.WL2K, &xxp.UIONLY, &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.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.IGNOREUNLOCKED, &xxp.INP3ONLY, &xxp.TCPPORT, &xxp.RIGPORT, &xxp.PERMITTEDAPPLS, &xxp.Hide,
&xxp.SmartID}; /* offset for corresponding data in config file */ &xxp.SmartID, &xxp.KissParams}; /* offset for corresponding data in config file */
static int proutine[] = static int proutine[] =
{ {
@ -388,7 +389,7 @@ static int proutine[] =
0, 1, 2, 18, 15, 16, 2, 0, 1, 2, 18, 15, 16, 2,
1, 17, 1, 1, 1, 1, 2, 1, 17, 1, 1, 1, 1, 2,
2, 2, 1, 1, 19, 2, 2, 2, 1, 1, 19, 2,
1}; /* routine to process parameter */ 1, 20}; /* routine to process parameter */
int PPARAMLIM = sizeof(proutine)/sizeof(int); int PPARAMLIM = sizeof(proutine)/sizeof(int);
@ -2209,7 +2210,11 @@ int decode_port_rec(char * rec)
break; break;
case 19: case 19:
cn = doPermittedAppls(i,value,rec); // COMPORT cn = doPermittedAppls(i,value,rec); // Permitted Apps
break;
case 20:
cn = doKissCommand(i, value, rec); // Permitted Apps
break; break;
@ -2365,7 +2370,7 @@ int doPermittedAppls(int i, char * value, char * rec)
char * Context; char * Context;
char * ptr1 = strtok_s(value, " ,=\t\n\r", &Context); char * ptr1 = strtok_s(value, " ,=\t\n\r", &Context);
// Param is a comma separated list of Appl Numbers allowes to connect on this port // Param is a comma separated list of Appl Numbers allowed to connect on this port
while (ptr1 && ptr1[0]) while (ptr1 && ptr1[0])
{ {
@ -2378,6 +2383,13 @@ int doPermittedAppls(int i, char * value, char * rec)
return 1; return 1;
} }
int doKissCommand(int i, char * value, char * rec)
{
// Param is kiss command and any operands as decimal bytes
xxp.KissParams = _strdup(strlop(rec, '='));
return 1;
}
int hwtypes(i, value, rec) int hwtypes(i, value, rec)
@ -2612,7 +2624,7 @@ static int troutine[] =
#define TPARAMLIM 6 #define TPARAMLIM 6
extern CMDX COMMANDLIST[]; extern CMDX TNCCOMMANDLIST[];
extern int NUMBEROFTNCCOMMANDS; extern int NUMBEROFTNCCOMMANDS;
int decode_tnc_rec(char * rec) int decode_tnc_rec(char * rec)
@ -2689,7 +2701,7 @@ int decode_tnc_rec(char * rec)
// Try process as TNC2 Command // Try process as TNC2 Command
int n = 0; int n = 0;
CMDX * CMD = &COMMANDLIST[0]; CMDX * CMD = &TNCCOMMANDLIST[0];
char * ptr1 = key_word; char * ptr1 = key_word;
UCHAR * valueptr; UCHAR * valueptr;

View File

@ -1,4 +1,7 @@
#ifndef CONFIGSTRUCT
#define CONFIGSTRUCT
// MAKE SURE SHORTS ARE CORRECTLY ALLIGNED FOR ARMV5 // MAKE SURE SHORTS ARE CORRECTLY ALLIGNED FOR ARMV5
@ -73,6 +76,7 @@ struct PORTCONFIG
long long txOffset; // Transverter tx offset long long txOffset; // Transverter tx offset
long long rxOffset; // Transverter rx offset ppa long long rxOffset; // Transverter rx offset ppa
int SmartID; int SmartID;
unsigned char * KissParams;
}; };
struct ROUTECONFIG struct ROUTECONFIG
@ -177,5 +181,7 @@ struct UPNP
char * WANPort; char * WANPort;
}; };
#endif

55
kiss.c
View File

@ -34,12 +34,15 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include <time.h> #include <time.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#ifndef RP2040
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <termios.h> #include <termios.h>
#include <syslog.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#include <signal.h> #include <signal.h>
#include <ctype.h> #include <ctype.h>
#include <syslog.h>
//#include <netax25/ttyutils.h> //#include <netax25/ttyutils.h>
@ -113,7 +116,7 @@ int ConnecttoTCP(NPASYINFO ASY);
int KISSGetTCPMessage(NPASYINFO ASY); int KISSGetTCPMessage(NPASYINFO ASY);
VOID CloseKISSPort(struct PORTCONTROL * PortVector); VOID CloseKISSPort(struct PORTCONTROL * PortVector);
int ReadCOMBlockEx(HANDLE fd, char * Block, int MaxLength, BOOL * Error); int ReadCOMBlockEx(HANDLE fd, char * Block, int MaxLength, BOOL * Error);
void processDRATSFrame(unsigned char * Message, int Len); void processDRATSFrame(unsigned char * Message, int Len, struct ConnectionInfo * sockptr);
extern struct PORTCONTROL * PORTTABLE; extern struct PORTCONTROL * PORTTABLE;
extern int NUMBEROFPORTS; extern int NUMBEROFPORTS;
@ -157,7 +160,7 @@ int ASYSEND(struct PORTCONTROL * PortVector, char * buffer, int count)
if (ret == -1) if (ret == -1)
{ {
Debugprintf ("i2c Write Error\r"); Debugprintf ("i2c Write Error\r");
usleep(1000); Sleep(1);
ret = i2c_smbus_write_byte(Port->idComDev, *(ptr)); ret = i2c_smbus_write_byte(Port->idComDev, *(ptr));
} }
ptr++; ptr++;
@ -306,11 +309,15 @@ int ASYINIT(int comport, int speed, struct PORTCONTROL * PortVector, char Channe
} }
else if (PortVector->PORTIPADDR.s_addr || PortVector->KISSSLAVE) else if (PortVector->PORTIPADDR.s_addr || PortVector->KISSSLAVE)
{ {
#ifndef RP2040
SOCKET sock; SOCKET sock;
u_long param=1; u_long param=1;
BOOL bcopt=TRUE; BOOL bcopt=TRUE;
struct sockaddr_in sinx; struct sockaddr_in sinx;
// KISS over UDP or TCP // KISS over UDP or TCP
if (PortVector->ListenPort == 0) if (PortVector->ListenPort == 0)
@ -423,8 +430,8 @@ int ASYINIT(int comport, int speed, struct PORTCONTROL * PortVector, char Channe
npKISSINFO->RXBPTR=&npKISSINFO->RXBUFFER[0]; npKISSINFO->RXBPTR=&npKISSINFO->RXBUFFER[0];
npKISSINFO->RXMPTR=&npKISSINFO->RXMSG[0]; npKISSINFO->RXMPTR=&npKISSINFO->RXMSG[0];
OpenConnection(PortVector, comport); OpenConnection(PortVector);
#endif
} }
npKISSINFO->Portvector = PortVector; npKISSINFO->Portvector = PortVector;
@ -452,9 +459,10 @@ NPASYINFO CreateKISSINFO( int port,int speed )
HANDLE OpenConnection(struct PORTCONTROL * PortVector, int port) HANDLE OpenConnection(struct PORTCONTROL * PortVector)
{ {
NPASYINFO npKISSINFO = KISSInfo[PortVector->PORTNUMBER]; NPASYINFO npKISSINFO = KISSInfo[PortVector->PORTNUMBER];
struct KISSINFO * KISS = (struct KISSINFO *) PortVector;
HANDLE ComDev = 0 ; HANDLE ComDev = 0 ;
if (npKISSINFO == NULL) if (npKISSINFO == NULL)
@ -474,8 +482,6 @@ HANDLE OpenConnection(struct PORTCONTROL * PortVector, int port)
{ {
// RFM22/23 module or TNC-PI- send a reset // RFM22/23 module or TNC-PI- send a reset
struct KISSINFO * KISS = (struct KISSINFO *) PortVector;
ENCBUFF[0] = FEND; ENCBUFF[0] = FEND;
ENCBUFF[1] = KISS->OURCTRL | 15; // Action command ENCBUFF[1] = KISS->OURCTRL | 15; // Action command
ENCBUFF[2] = 2; // Reset command ENCBUFF[2] = 2; // Reset command
@ -487,13 +493,15 @@ HANDLE OpenConnection(struct PORTCONTROL * PortVector, int port)
{ {
// SCS Tracker - Send Enter KISS (CAN)(ESC)@K(CR) // SCS Tracker - Send Enter KISS (CAN)(ESC)@K(CR)
struct KISSINFO * KISS = (struct KISSINFO *) PortVector;
memcpy(ENCBUFF, "\x18\x1b@K\r", 5); // Enter KISS memcpy(ENCBUFF, "\x18\x1b@K\r", 5); // Enter KISS
ASYSEND(PortVector, ENCBUFF, 5); ASYSEND(PortVector, ENCBUFF, 5);
} }
if (KISS->KISSCMD && KISS->KISSCMDLEN)
ASYSEND(PortVector, KISS->KISSCMD, KISS->KISSCMDLEN);
return ComDev; return ComDev;
} }
int ReadCommBlock(NPASYINFO npKISSINFO, char * lpszBlock, int nMaxLength ) int ReadCommBlock(NPASYINFO npKISSINFO, char * lpszBlock, int nMaxLength )
@ -509,7 +517,7 @@ int ReadCommBlock(NPASYINFO npKISSINFO, char * lpszBlock, int nMaxLength )
if (npKISSINFO->ReopenTimer > 300) // about 30 secs if (npKISSINFO->ReopenTimer > 300) // about 30 secs
{ {
npKISSINFO->idComDev = OpenConnection(npKISSINFO->Portvector, npKISSINFO->bPort); npKISSINFO->idComDev = OpenConnection(npKISSINFO->Portvector);
npKISSINFO->ReopenTimer = 0; npKISSINFO->ReopenTimer = 0;
} }
} }
@ -1573,7 +1581,7 @@ SeeifMore:
VEC = PORT->Session->L4TARGET.HOST; VEC = PORT->Session->L4TARGET.HOST;
C_Q_ADD(&PORT->Session->L4TX_Q, (UINT *)Buffer); C_Q_ADD(&PORT->Session->L4TX_Q, (UINT *)Buffer);
#ifndef LINBPQ #ifdef BPQ32
if (VEC) if (VEC)
PostMessage(VEC->HOSTHANDLE, BPQMsg, VEC->HOSTSTREAM, 2); PostMessage(VEC->HOSTHANDLE, BPQMsg, VEC->HOSTSTREAM, 2);
#endif #endif
@ -1588,13 +1596,13 @@ SeeifMore:
} }
// checksum if necessary // checksum if necessary
#ifndef RP2040
if (KISS->PORT.KISSFLAGS & DRATS) if (KISS->PORT.KISSFLAGS & DRATS)
{ {
processDRATSFrame(&Port->RXMSG[1], len - 2); processDRATSFrame(&Port->RXMSG[1], len - 2, 0);
return 0; return 0;
} }
#endif
if (len < 15) if (len < 15)
return 0; // too short for AX25 return 0; // too short for AX25
@ -1821,6 +1829,7 @@ int ConnecttoTCP(NPASYINFO ASY)
VOID ConnecttoTCPThread(NPASYINFO ASY) VOID ConnecttoTCPThread(NPASYINFO ASY)
{ {
#ifndef RP2040
char Msg[255]; char Msg[255];
int err,i; int err,i;
u_long param=1; u_long param=1;
@ -1829,6 +1838,7 @@ VOID ConnecttoTCPThread(NPASYINFO ASY)
// struct hostent * HostEnt; // struct hostent * HostEnt;
SOCKADDR_IN sinx; SOCKADDR_IN sinx;
int addrlen=sizeof(sinx); int addrlen=sizeof(sinx);
struct KISSINFO * KISS = (struct KISSINFO *) ASY->Portvector;
sinx.sin_family = AF_INET; sinx.sin_family = AF_INET;
sinx.sin_addr.s_addr = INADDR_ANY; sinx.sin_addr.s_addr = INADDR_ANY;
@ -1886,9 +1896,15 @@ VOID ConnecttoTCPThread(NPASYINFO ASY)
ASY->Connecting = FALSE; ASY->Connecting = FALSE;
ioctlsocket (sock, FIONBIO, &param); ioctlsocket (sock, FIONBIO, &param);
// If configured send TNC command
if (KISS->KISSCMD && KISS->KISSCMDLEN)
send(sock, KISS->KISSCMD, KISS->KISSCMDLEN, 0);
continue; continue;
} }
else else
{ {
err=WSAGetLastError(); err=WSAGetLastError();
@ -1910,10 +1926,13 @@ VOID ConnecttoTCPThread(NPASYINFO ASY)
} }
Sleep (57000/2); // 1/2 Mins Sleep (57000/2); // 1/2 Mins
} }
#endif
} }
int KISSGetTCPMessage(NPASYINFO ASY) int KISSGetTCPMessage(NPASYINFO ASY)
{ {
#ifndef RP2040
int index=0; int index=0;
ULONG param = 1; ULONG param = 1;
@ -1989,6 +2008,8 @@ int KISSGetTCPMessage(NPASYINFO ASY)
{ {
// Reopen Listening Socket // Reopen Listening Socket
SOCKET sock; SOCKET sock;
u_long param=1; u_long param=1;
BOOL bcopt=TRUE; BOOL bcopt=TRUE;
@ -2020,7 +2041,7 @@ int KISSGetTCPMessage(NPASYINFO ASY)
else else
ASY->Listening = TRUE; ASY->Listening = TRUE;
} }
} }
#endif
return 0; return 0;
} }

4
kiss.h
View File

@ -45,7 +45,7 @@ typedef struct tagASYINFO
} ASYINFO, *NPASYINFO ; } ASYINFO, *NPASYINFO ;
NPASYINFO KISSInfo[33] = {0}; NPASYINFO KISSInfo[MAXBPQPORTS] = {0};
#define _fmemset memset #define _fmemset memset
@ -59,6 +59,6 @@ NPASYINFO CreateKISSINFO( int port, int speed );
BOOL DestroyKISSINFO(NPASYINFO npKISSINFO) ; BOOL DestroyKISSINFO(NPASYINFO npKISSINFO) ;
int ReadCommBlock(NPASYINFO npKISSINFO, char * lpszBlock, int nMaxLength); int ReadCommBlock(NPASYINFO npKISSINFO, char * lpszBlock, int nMaxLength);
static BOOL WriteCommBlock(NPASYINFO npKISSINFO, char * lpByte, DWORD dwBytesToWrite); static BOOL WriteCommBlock(NPASYINFO npKISSINFO, char * lpByte, DWORD dwBytesToWrite);
HANDLE OpenConnection(struct PORTCONTROL * PortVector, int port); HANDLE OpenConnection(struct PORTCONTROL * PortVector);
BOOL SetupConnection(NPASYINFO npKISSINFO); BOOL SetupConnection(NPASYINFO npKISSINFO);
BOOL CloseConnection(NPASYINFO npKISSINFO); BOOL CloseConnection(NPASYINFO npKISSINFO);

View File

@ -23,7 +23,7 @@ all: CFLAGS = -DLINBPQ -MMD -g -fcommon
all: linbpq all: linbpq
noi2c: CFLAGS = -DLINBPQ -MMD -DNOI2C -g noi2c: CFLAGS = -DLINBPQ -MMD -DNOI2C -g -fcommon
noi2c: linbpq noi2c: linbpq

View File

@ -1,3 +1,6 @@
#ifndef RIGCONTROL
#define RIGCONTROL
#ifndef LINBPQ #ifndef LINBPQ
#include "Rigresource.h" #include "Rigresource.h"
#endif #endif
@ -75,7 +78,7 @@ struct RIGINFO
struct _EXTPORTDATA * PortRecord[32]; // BPQ32 port record(s) for this rig (null terminated list) struct _EXTPORTDATA * PortRecord[32]; // BPQ32 port record(s) for this rig (null terminated list)
UCHAR RigAddr; UCHAR RigAddr;
int ScanStopped; // Scanning enabled if zero. Bits used for interlocked scanning (eg winmor/pactor on same port uint64_t ScanStopped; // Scanning enabled if zero. Bits used for interlocked scanning (eg winmor/pactor on same port
int ScanCounter; int ScanCounter;
int PollCounter; // Don't poll too often; int PollCounter; // Don't poll too often;
int ScanFreq; // Scan Rate int ScanFreq; // Scan Rate
@ -261,3 +264,5 @@ struct RIGPORTINFO
#define W98_SERIAL_GETDATA 0x801 #define W98_SERIAL_GETDATA 0x801
#define W98_SERIAL_SETDATA 0x802 #define W98_SERIAL_SETDATA 0x802
#endif

View File

@ -1,3 +1,5 @@
#ifndef TELNETSERVER
#define TELNETSERVER
#ifndef LINBPQ #ifndef LINBPQ
//#include "resource.h" //#include "resource.h"
@ -80,7 +82,7 @@ struct ConnectionInfo
#define NOP 241 //No operation #define NOP 241 //No operation
#define xDM 242 //Data mark Indicates the position of a Synch event within the data stream. This should always be accompanied by a TCP urgent notification. #define xDM 242 //Data mark Indicates the position of a Synch event within the data stream. This should always be accompanied by a TCP urgent notification.
#define BRK 243 //Break Indicates that the "break" or "attention" key was hi. #define BRK 243 //Break Indicates that the "break" or "attention" key was hi.
#define IP 244 //Suspend Interrupt or abort the process to which the NVT is connected. #define IPx 244 //Suspend Interrupt or abort the process to which the NVT is connected.
#define AO 245 //Abort output Allows the current process to run to completion but does not send its output to the user. #define AO 245 //Abort output Allows the current process to run to completion but does not send its output to the user.
#define AYT 246 //Are you there Send back to the NVT some visible evidence that the AYT was received. #define AYT 246 //Are you there Send back to the NVT some visible evidence that the AYT was received.
#define EC 247 //Erase character The receiver should delete the last preceding undeleted character from the data stream. #define EC 247 //Erase character The receiver should delete the last preceding undeleted character from the data stream.
@ -104,3 +106,5 @@ struct ConnectionInfo
#define linemode 34 //1184 #define linemode 34 //1184
#define environmentvariables 36 //1408 #define environmentvariables 36 //1408
#endif

View File

@ -76,8 +76,8 @@ typedef unsigned __STDINT_LONGLONG uint_least64_t;
*/ */
typedef char int_fast8_t; typedef char int_fast8_t;
typedef unsigned char uint_fast8_t; typedef unsigned char uint_fast8_t;
typedef short int_fast16_t; //typedef short int_fast16_t;
typedef unsigned short uint_fast16_t; //typedef unsigned short uint_fast16_t;
typedef int int_fast32_t; typedef int int_fast32_t;
typedef unsigned int uint_fast32_t; typedef unsigned int uint_fast32_t;
typedef __STDINT_LONGLONG int_fast64_t; typedef __STDINT_LONGLONG int_fast64_t;