master 25.41
John Wiseman 3 weeks ago
parent 87530633f8
commit af79b9bbbf

4
.gitignore vendored

@ -0,0 +1,4 @@
*.ncb
*.suo
*.user
.svn/*

@ -18,7 +18,7 @@
#ifdef RC_INVOKED
#ifndef _INC_WINDOWS
#define _INC_WINDOWS
#include "..\include\winres.h" // extract from windows header
#include "WIn32bits\winres.h" // extract from windows header
#endif
#endif

@ -633,7 +633,7 @@ int AGWConnected(struct BPQConnectionInfo * Con, int Stream)
// Not listening ??
OutputDebugString("Inbound Connection on Outgoing Stream");
Debugprintf("Inbound Connection on Outgoing Stream");
SendMsg(Stream, "AGWtoBPQ - Inbound Connection on Outgoing Stream\r", 49);
Sleep (500);

@ -1312,9 +1312,7 @@ int DecodeVDM(char *msg)
V_WidthC = val[44];
V_WidthD = val[45];
// sprintf(TraceMsg,"%s %d %d %d %d %d LenA %d LenB %d\n", V_Name, val[41], val[42], val[43], val[44], val[45], V_LenA, V_LenB);
// OutputDebugString(TraceMsg);
//' Type of Fix 4 274 char 46 bits 0-3
FixType = val[46] >>2;

@ -489,30 +489,6 @@ BOOL CheckForTooManyErrors(ConnectionInfo * conn)
return FALSE;
}
VOID __cdecl Debugprintf(const char * format, ...)
{
char Mess[16384];
va_list(arglist);
int Len;
va_start(arglist, format);
Len = vsprintf(Mess, format, arglist);
va_end(arglist);
#ifndef LINBPQ
WriteLogLine(NULL, '!',Mess, Len, LOG_DEBUG_X);
#endif
// #ifdef _DEBUG
strcat(Mess, "\r\n");
OutputDebugString(Mess);
// #endif
return;
}
VOID __cdecl Logprintf(int LogMode, CIRCUIT * conn, int InOut, const char * format, ...)
{
char Mess[1000];
@ -521,7 +497,11 @@ VOID __cdecl Logprintf(int LogMode, CIRCUIT * conn, int InOut, const char * form
va_start(arglist, format);
Len = vsprintf(Mess, format, arglist);
va_end(arglist);
WriteLogLine(conn, InOut, Mess, Len, LogMode);
if (LogMode == LOG_DEBUG_X)
Debugprintf(Mess);
else
WriteLogLine(conn, InOut, Mess, Len, LogMode);
return;
}
@ -13486,7 +13466,6 @@ int DeleteRedundantMessages()
{
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
OutputDebugString(ffd.cFileName);
}
else
{
@ -15549,7 +15528,6 @@ int ReformatSyncMessage(CIRCUIT * conn)
conn->MailBuffer[conn->TempMsg->length] = 0;
// OutputDebugString(conn->MailBuffer);
memcpy(xml, conn->MailBuffer, conn->SyncXMLLen);
xml[conn->SyncXMLLen] = 0;

@ -444,7 +444,7 @@ END
//
// Generated from the TEXTINCLUDE 3 resource.
//
#include "..\StdVer.inc"
#include "StdVer.inc"
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

@ -42,7 +42,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\CInclude;..\CommonSource;..\BPQChat"
AdditionalIncludeDirectories="Win32bits;..\BPQSource"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USE_32BIT_TIME_T"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -65,7 +65,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\lib\bpq32.lib wsock32.lib comctl32.lib winmm.lib ..\lib\libconfig.lib DbgHelp.lib"
AdditionalDependencies="Win32bits\bpq32.lib wsock32.lib comctl32.lib winmm.lib Win32bits\libconfig.lib DbgHelp.lib"
OutputFile="c:\DevProgs\bpq32\BPQChat.exe"
LinkIncremental="2"
GenerateDebugInformation="true"
@ -130,7 +130,7 @@
Name="VCCLCompilerTool"
Optimization="2"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\CInclude;..\CommonSource;..\BPQChat"
AdditionalIncludeDirectories="Win32bits;..\BPQSource"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USE_32BIT_TIME_T"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
@ -152,7 +152,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\lib\bpq32.lib wsock32.lib comctl32.lib winmm.lib ..\lib\libconfig.lib DbgHelp.lib"
AdditionalDependencies="Win32bits\bpq32.lib wsock32.lib comctl32.lib Win32bits\libconfig.lib DbgHelp.lib"
OutputFile="c:\DevProgs\bpq32\BPQChat.exe"
LinkIncremental="1"
GenerateDebugInformation="false"

Binary file not shown.

@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\CKernel;..\CInclude;..\CommonSource;..\BPQMail"
AdditionalIncludeDirectories="..\BPQSource\Win32bits"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USE_32BIT_TIME_T;NOMQTT"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -67,7 +67,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\lib\bpq32.lib wsock32.lib comctl32.lib winmm.lib ..\lib\libconfig.lib DbgHelp.lib"
AdditionalDependencies="Win32bits\bpq32.lib wsock32.lib comctl32.lib winmm.lib Win32bits\libconfig.lib DbgHelp.lib"
OutputFile="c:\DevProgs\bpq32\BPQMail.exe"
LinkIncremental="2"
IgnoreAllDefaultLibraries="false"
@ -134,7 +134,7 @@
Name="VCCLCompilerTool"
Optimization="2"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\CKernel;..\CInclude;..\CommonSource;..\BPQMail"
AdditionalIncludeDirectories="Win32bits"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USE_32BIT_TIME_T;NOMQTT"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
@ -155,7 +155,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\lib\bpq32.lib wsock32.lib comctl32.lib winmm.lib ..\lib\libconfig.lib DbgHelp.lib"
AdditionalDependencies="Win32bits\bpq32.lib wsock32.lib comctl32.lib winmm.lib Win32bits\libconfig.lib DbgHelp.lib"
OutputFile="c:\DevProgs\bpq32\BPQMail.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
@ -203,15 +203,15 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\CommonSource\Alloc.c"
RelativePath="..\BPQSource\Alloc.c"
>
</File>
<File
RelativePath="..\CommonSource\BBSHTMLConfig.c"
RelativePath="..\BPQSource\BBSHTMLConfig.c"
>
</File>
<File
RelativePath="..\CommonSource\BBSUtilities.c"
RelativePath="..\BPQSource\BBSUtilities.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -243,11 +243,11 @@
>
</File>
<File
RelativePath="..\CommonSource\CMSAuth.c"
RelativePath="..\BPQSource\CMSAuth.c"
>
</File>
<File
RelativePath="..\CommonSource\FBBRoutines.c"
RelativePath="..\BPQSource\FBBRoutines.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -269,19 +269,19 @@
</FileConfiguration>
</File>
<File
RelativePath="..\CommonSource\Housekeeping.c"
RelativePath="..\BPQSource\Housekeeping.c"
>
</File>
<File
RelativePath="..\CommonSource\HTMLCommonCode.c"
RelativePath="..\BPQSource\HTMLCommonCode.c"
>
</File>
<File
RelativePath="..\CommonSource\LzFind.c"
RelativePath="..\BPQSource\LzFind.c"
>
</File>
<File
RelativePath="..\CommonSource\lzhuf32.c"
RelativePath="..\BPQSource\lzhuf32.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -305,15 +305,15 @@
</FileConfiguration>
</File>
<File
RelativePath="..\CommonSource\LzmaDec.c"
RelativePath="..\BPQSource\LzmaDec.c"
>
</File>
<File
RelativePath="..\CommonSource\LzmaEnc.c"
RelativePath="..\BPQSource\LzmaEnc.c"
>
</File>
<File
RelativePath="..\CommonSource\LzmaLib.c"
RelativePath="..\BPQSource\LzmaLib.c"
>
</File>
<File
@ -321,7 +321,7 @@
>
</File>
<File
RelativePath="..\CommonSource\MailCommands.c"
RelativePath="..\BPQSource\MailCommands.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -343,11 +343,11 @@
</FileConfiguration>
</File>
<File
RelativePath="..\CommonSource\MailDataDefs.c"
RelativePath="..\BPQSource\MailDataDefs.c"
>
</File>
<File
RelativePath="..\CommonSource\MailRouting.c"
RelativePath="..\BPQSource\MailRouting.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -369,7 +369,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\CommonSource\MailTCP.c"
RelativePath="..\BPQSource\MailTCP.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -391,7 +391,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\CommonSource\MBLRoutines.c"
RelativePath="..\BPQSource\MBLRoutines.c"
>
</File>
<File
@ -399,7 +399,7 @@
>
</File>
<File
RelativePath="..\CommonSource\Multicast.c"
RelativePath="..\BPQSource\Multicast.c"
>
</File>
<File
@ -407,11 +407,11 @@
>
</File>
<File
RelativePath="..\CommonSource\NNTPRoutines.c"
RelativePath="..\BPQSource\NNTPRoutines.c"
>
</File>
<File
RelativePath="..\CommonSource\UIRoutines.c"
RelativePath="..\BPQSource\UIRoutines.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -433,15 +433,15 @@
</FileConfiguration>
</File>
<File
RelativePath="..\CommonSource\utf8Routines.c"
RelativePath="..\BPQSource\utf8Routines.c"
>
</File>
<File
RelativePath="..\CommonSource\WebMail.c"
RelativePath="..\BPQSource\WebMail.c"
>
</File>
<File
RelativePath="..\CommonSource\WPRoutines.c"
RelativePath="..\BPQSource\WPRoutines.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -473,7 +473,7 @@
>
</File>
<File
RelativePath="..\CommonSource\Versions.h"
RelativePath="..\BPQSource\Versions.h"
>
</File>
</Filter>

@ -112,18 +112,6 @@ VOID __cdecl Debugprintf(const char * format, ...);
HKEY REGTREE = HKEY_LOCAL_MACHINE; // Default
VOID __cdecl Debugprintf(const char * format, ...)
{
char Mess[1000];
va_list(arglist);int Len;
va_start(arglist, format);
Len = vsprintf_s(Mess, sizeof(Mess), format, arglist);
va_end(arglist);
strcat(Mess, "\r\n");
OutputDebugString(Mess);
return;
}
#else
extern HKEY REGTREE;
extern int OffsetH, OffsetW;

@ -51,19 +51,6 @@ LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
HWND FrameWnd;
int TimerHandle = 0;
VOID __cdecl Debugprintf(const char * format, ...)
{
char Mess[8192];
va_list(arglist);int Len;
va_start(arglist, format);
Len = vsprintf_s(Mess, sizeof(Mess), format, arglist);
strcat_s(Mess, 999, "\r\n");
OutputDebugString(Mess);
return;
}
VOID WriteMiniDump()
{
#ifdef WIN32
@ -93,7 +80,98 @@ VOID WriteMiniDump()
#endif
}
SYMBOL_INFO * symbol;
HANDLE process;
void printStack(void)
{
#ifdef WIN32
//#ifdef _DEBUG // So we can use on 98/2K
unsigned int i;
void * stack[ 100 ];
unsigned short frames;
DWORD dwDisplacement;
IMAGEHLP_LINE64 line;
char * fptr;
Debugprintf("Stack Backtrace");
process = GetCurrentProcess();
SymSetOptions(SYMOPT_LOAD_LINES);
SymInitialize( process, NULL, TRUE );
frames = RtlCaptureStackBackTrace(0, 60, stack, NULL );
for( i = 0; i < frames; i++ )
{
SymGetLineFromAddr64(process, (DWORD64)stack[i], &dwDisplacement, &line);
SymFromAddr( process, ( DWORD64 )( stack[ i ] ), 0, symbol );
fptr = line.FileName + (int)strlen(line.FileName); // remove path
while (*fptr != '\\' && *fptr != '/')
fptr--;
fptr++;
Debugprintf( "%i: %s - %s Line %d Addr %p", frames - i - 1, symbol->Name, fptr, line.LineNumber, symbol->Address );
}
free(symbol);
//#endif
#endif
}
int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep)
{
Debugprintf("in filter.");
printStack();
if (code == EXCEPTION_ACCESS_VIOLATION)
{
Debugprintf("caught AV as expected.");
return EXCEPTION_EXECUTE_HANDLER;
}
else
{
Debugprintf("didn't catch AV, unexpected.");
return EXCEPTION_CONTINUE_SEARCH;
}
}
LONG WINAPI UnhandledExcepFilter(PEXCEPTION_POINTERS pExcepPointers)
{
DWORD dwDisplacement;
IMAGEHLP_LINE64 line;
char * fptr;
if(pExcepPointers->ExceptionRecord->ExceptionCode == DBG_PRINTEXCEPTION_C)
return EXCEPTION_CONTINUE_EXECUTION;
SymFromAddr( process, ((DWORD)pExcepPointers->ExceptionRecord->ExceptionAddress), 0, symbol );
Debugprintf("Program error trapped\r\n");
SymGetLineFromAddr64(process, (DWORD)pExcepPointers->ExceptionRecord->ExceptionAddress, &dwDisplacement, &line);
fptr = line.FileName + (int)strlen(line.FileName); // remove path
while (*fptr != '\\' && *fptr != '/')
fptr--;
fptr++;
Debugprintf("In Procedure %s - %s Line %d Addr %p\r\n", symbol->Name, fptr, line.LineNumber, symbol->Address );
printStack();
MessageBox(NULL,"Program Error - program closing. See Debug Log for details","BPQ32",MB_ICONSTOP);
RealCloseAllPrograms();
Sleep(1000);
CloseDebugLog();
exit(0);
}
//
// FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)
@ -109,10 +187,20 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
{
MSG msg;
int Running = 1;
struct _EXCEPTION_POINTERS exinfo;
Debugprintf("BPQ32.exe %s Entered", lpCmdLine);
process = GetCurrentProcess();
SymSetOptions(SYMOPT_LOAD_LINES);
SymInitialize( process, NULL, TRUE );
symbol = ( SYMBOL_INFO * )calloc( sizeof( SYMBOL_INFO ) + 256 * sizeof( char ), 1 );
symbol->MaxNameLen = 255;
symbol->SizeOfStruct = sizeof( SYMBOL_INFO );
AddVectoredExceptionHandler(1, UnhandledExcepFilter);
if (_stricmp(lpCmdLine, "Wait") == 0) // If AutoRestart then Delay 5 Secs
Sleep(5000);
@ -125,7 +213,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
// Main message loop:
__try
// __try
{
while(Running)
{
@ -144,16 +232,17 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
}
}
#define EXCEPTMSG "BPQ32.exe Main Loop"
#include "StdExcept.c"
}
// #define EXCEPTMSG "BPQ32.exe Main Loop"
// #include "StdExcept.c"
// }
Debugprintf("BPQ32.exe exiting %d", msg.message);
KillTimer(NULL,TimerHandle);
CloseBPQ32(); // Close Ext Drivers if last bpq32 process
CloseDebugLog();
return (msg.wParam);
}

@ -25,7 +25,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
#define BPQICON 400
BPQICON ICON DISCARDABLE "..\\bpqicon.ico"
BPQICON ICON DISCARDABLE "bpqicon.ico"
//
// Version

@ -16,7 +16,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="C:\Dev\Msdev200\$(SolutionName)\$(ProjectName)\$(ConfigurationName)"
OutputDirectory="C:\Dev\Msdev2005\$(SolutionName)\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
@ -72,7 +72,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\lib\bpq32.lib DbgHelp.lib"
AdditionalDependencies="Win32bits\bpq32.lib DbgHelp.lib"
OutputFile="c:\DevProgs\bpq32\bpq32.exe"
LinkIncremental="1"
SuppressStartupBanner="true"

@ -1351,7 +1351,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include "time.h"
#include "stdio.h"
#include <fcntl.h>
#include <fcntl.h>
#include "compatbits.h"
#include "AsmStrucs.h"
@ -1434,8 +1434,6 @@ void * HSMODEMExtInit(EXTPORTDATA * PortEntry);
void * FreeDataExtInit(EXTPORTDATA * PortEntry);
void * SIXPACKExtInit(EXTPORTDATA * PortEntry);
VOID RealCloseAllPrograms();
extern char * ConfigBuffer; // Config Area
VOID REMOVENODE(dest_list * DEST);
DllExport int ConvFromAX25(unsigned char * incall,unsigned char * outcall);
@ -1448,6 +1446,7 @@ void initADSB();
int CloseAllSessions();
int CloseAllLinks();
void NETROMTCPResolve();
DllExport VOID APIENTRY CloseDebugLog();
extern BOOL ADIFLogEnabled;
@ -1580,8 +1579,8 @@ extern char ReportDest[7];
extern UCHAR ConfigDirectory[260];
DllExport VOID __cdecl Debugprintf(const char * format, ...);
VOID __cdecl Debugprintf(const char * format, ...);
VOID __cdecl Consoleprintf(const char * format, ...);
DllExport int APIENTRY CloseBPQ32();
@ -1849,8 +1848,7 @@ void LoadToolHelperRoutines()
if (ExtDriver == NULL)
{
err=GetLastError();
sprintf(msg,"BPQ32 Error loading kernel32.dll - Error code %d\n", err);
OutputDebugString(msg);
Debugprintf("BPQ32 Error loading kernel32.dll - Error code %d", err);
return;
}
@ -1861,8 +1859,7 @@ void LoadToolHelperRoutines()
if (CreateToolHelp32SnapShotPtr == 0)
{
err=GetLastError();
sprintf(msg,"BPQ32 Error getting CreateToolhelp32Snapshot entry point - Error code %d\n", err);
OutputDebugString(msg);
Debugprintf("BPQ32 Error getting CreateToolhelp32Snapshot entry point - Error code %d\n", err);
return;
}
}
@ -1881,8 +1878,8 @@ BOOL GetProcess(int ProcessID, char * Program)
hProcessSnap = (HANDLE)CreateToolHelp32SnapShotPtr(TH32CS_SNAPPROCESS, 0);
if( hProcessSnap == INVALID_HANDLE_VALUE )
{
OutputDebugString( "CreateToolhelp32Snapshot (of processes) Failed\n" );
return( FALSE );
Debugprintf("CreateToolhelp32Snapshot (of processes) Failed\n" );
return( FALSE );
}
// Set the size of the structure before using it.
@ -1892,7 +1889,7 @@ BOOL GetProcess(int ProcessID, char * Program)
// and exit if unsuccessful
if( !Process32Firstptr( hProcessSnap, &pe32 ) )
{
OutputDebugString( "Process32First Failed\n" ); // Show cause of failure
Debugprintf( "Process32First Failed" ); // Show cause of failure
CloseHandle( hProcessSnap ); // Must clean up the snapshot object!
return( FALSE );
}
@ -1940,7 +1937,7 @@ BOOL IsProcess(int ProcessID)
if( hProcessSnap == INVALID_HANDLE_VALUE )
{
OutputDebugString( "CreateToolhelp32Snapshot (of processes) Failed\n" );
Debugprintf( "CreateToolhelp32Snapshot (of processes) Failed" );
return(TRUE); // Don't know, so assume ok
}
@ -1948,7 +1945,7 @@ BOOL IsProcess(int ProcessID)
if( !Process32Firstptr( hProcessSnap, &pe32 ) )
{
OutputDebugString( "Process32First Failed\n" ); // Show cause of failure
Debugprintf( "Process32First Failed" ); // Show cause of failure
CloseHandle( hProcessSnap ); // Must clean up the snapshot object!
return(TRUE); // Don't know, so assume ok
}
@ -2013,8 +2010,8 @@ VOID CheckforLostProcesses()
{
// Process has died - Treat as a detach
sprintf(Log,"BPQ32 Process %d Died\n", ProcessID);
OutputDebugString(Log);
sprintf(Log,"BPQ32 Process %d Died", ProcessID);
Debugprintf(Log);
// Remove Tray Icon Entry
@ -2023,8 +2020,7 @@ VOID CheckforLostProcesses()
if (PIDArray[i] == ProcessID)
{
hWndArray[i] = 0;
sprintf(Log,"BPQ32 Removing Tray Item %s\n", PopupText[i]);
OutputDebugString(Log);
Debugprintf(Log,"BPQ32 Removing Tray Item %s", PopupText[i]);
DeleteMenu(trayMenu,TRAYBASEID+i,MF_BYCOMMAND);
}
}
@ -2033,7 +2029,7 @@ VOID CheckforLostProcesses()
if (Semaphore.Flag == 1 && ProcessID == Semaphore.SemProcessID)
{
OutputDebugString("BPQ32 Process was holding Semaphore - attempting recovery\r\n");
Debugprintf("BPQ32 Process was holding Semaphore - attempting recovery");
Debugprintf("Last Sem Call %d %x %x %x %x %x %x", SemHeldByAPI,
Sem_eax, Sem_ebx, Sem_ecx, Sem_edx, Sem_esi, Sem_edi);
@ -2055,7 +2051,7 @@ VOID CheckforLostProcesses()
TimerHandle=0;
TimerInst=0xffffffff;
// Tell_Sessions();
OutputDebugString("BPQ32 Process was running timer \n");
Debugprintf("BPQ32 Process was running timer");
if (MinimizetoTray)
Shell_NotifyIcon(NIM_DELETE,&niData);
@ -2095,7 +2091,7 @@ VOID MonitorTimerThread(int x)
if (Semaphore.Flag == 1 && TimerInst == Semaphore.SemProcessID)
{
OutputDebugString("BPQ32 Process was holding Semaphore - attempting recovery\r\n");
Debugprintf("BPQ32 Process was holding Semaphore - attempting recovery");
Debugprintf("Last Sem Call %d %x %x %x %x %x %x", SemHeldByAPI,
Sem_eax, Sem_ebx, Sem_ecx, Sem_edx, Sem_esi, Sem_edi);
Semaphore.Flag = 0;
@ -2116,7 +2112,7 @@ VOID MonitorTimerThread(int x)
if (Closing == FALSE && AttachingProcess == FALSE)
{
OutputDebugString("BPQ32 Reloading BPQ32.exe\n");
Debugprintf("BPQ32 Reloading BPQ32.exe");
StartBPQ32();
}
@ -2194,7 +2190,7 @@ void Semaphored100msCode()
SetupBPQDirectory();
WritetoConsole("Reconfiguring ...\n\n");
OutputDebugString("BPQ32 Reconfiguring ...\n");
Debugprintf("BPQ32 Reconfiguring ...");
GetWindowRect(FrameWnd, &FRect);
@ -2304,7 +2300,7 @@ void Semaphored100msCode()
AGWActive = AGWAPIInit();
GetSemaphore(&Semaphore, 0);
OutputDebugString("BPQ32 Reconfiguration Complete\n");
Debugprintf("BPQ32 Reconfiguration Complete");
}
}
@ -2340,7 +2336,7 @@ void Semaphored100msCode()
}
}
DllExport VOID APIENTRY RealCloseAllPrograms();
VOID UnSemaphored100msCode()
@ -2522,7 +2518,7 @@ FirstInit()
if (ADIFLogEnabled)
ADIFWriteFreqList();
OutputDebugString("BPQ32 Port Initialisation Complete\n");
Debugprintf("BPQ32 Port Initialisation Complete");
if (needAIS)
initAIS();
@ -2609,7 +2605,7 @@ int Check_Timer()
}
GetSemaphore(&Semaphore, 3);
OutputDebugString("BPQ32 Reinitialising External Ports and Attaching Timer\n");
Debugprintf("BPQ32 Reinitialising External Ports and Attaching Timer");
if (!ProcessConfig())
{
@ -2925,7 +2921,7 @@ BOOL APIENTRY DllMain(HANDLE hInst, DWORD ul_reason_being_called, LPVOID lpReser
if (Mutex != NULL)
{
OutputDebugString("Another BPQ32.dll is loaded\n");
Debugprintf("Another BPQ32.dll is loaded");
i=MessageBox(NULL,"BPQ32 DLL already loaded from another directory\nIf you REALLY want this, hit OK, else hit Cancel","BPQ32",MB_OKCANCEL);
FreeSemaphore(&Semaphore);
@ -2999,7 +2995,7 @@ BOOL APIENTRY DllMain(HANDLE hInst, DWORD ul_reason_being_called, LPVOID lpReser
if (Mutex != NULL)
{
OutputDebugString("Another BPQ32.dll is loaded\n");
Debugprintf("Another BPQ32.dll is loaded");
MessageBox(NULL,"BPQ32 DLL already loaded from another directory","BPQ32",MB_ICONSTOP);
FreeSemaphore(&Semaphore);
return (0);
@ -3059,15 +3055,15 @@ SkipInit:
_beginthread(MonitorTimerThread,0,0);
FreeSemaphore(&Semaphore);
AttachedPIDList[AttachedProcesses++] = GetCurrentProcessId();
if (_stricmp(pgm,"bpq32.exe") == 0 && AttachingProcess == 1) AttachingProcess = 0;
GetProcess(GetCurrentProcessId(),pgm);
n=sprintf(buf,"BPQ32 DLL Attach complete - Program %s - %d Process(es) Attached\n",pgm,AttachedProcesses);
OutputDebugString(buf);
Debugprintf("BPQ32 DLL Attach complete - Program %s - %d Process(es) Attached\n",pgm,AttachedProcesses);
FreeSemaphore(&Semaphore);
// Set up local variables
@ -3126,8 +3122,6 @@ SkipInit:
{
char Log[80];
hWndArray[i] = 0;
sprintf(Log,"BPQ32 Removing Tray Item %s\n", PopupText[i]);
OutputDebugString(Log);
DeleteMenu(trayMenu,TRAYBASEID+i,MF_BYCOMMAND);
}
}
@ -3151,7 +3145,7 @@ SkipInit:
{
PEXTPORTDATA PORTVEC=(PEXTPORTDATA)PORTTABLE;
OutputDebugString("BPQ32 Process with Timer closing\n");
Debugprintf("BPQ32 Process with Timer closing\n");
// Call Port Close Routines
@ -3197,7 +3191,7 @@ SkipInit:
if (AttachedProcesses && Closing == FALSE && AttachingProcess == 0) // Other processes
{
OutputDebugString("BPQ32 Reloading BPQ32.exe\n");
Debugprintf("BPQ32 Reloading BPQ32.exe\n");
StartBPQ32();
}
}
@ -3246,8 +3240,7 @@ SkipInit:
}
GetProcess(GetCurrentProcessId(),pgm);
n=sprintf(buf,"BPQ32 DLL Detach complete - Program %s - %d Process(es) Attached\n",pgm,AttachedProcesses);
OutputDebugString(buf);
Debugprintf("BPQ32 DLL Detach complete - Program %s - %d Process(es) Attached\n",pgm,AttachedProcesses);
return 1;
}
@ -3294,7 +3287,7 @@ DllExport int APIENTRY CloseBPQ32()
if (Semaphore.Flag == 1 && ProcessID == Semaphore.SemProcessID)
{
OutputDebugString("BPQ32 Process holding Semaphore called CloseBPQ32 - attempting recovery\r\n");
Debugprintf("BPQ32 Process holding Semaphore called CloseBPQ32 - attempting recovery\r\n");
Debugprintf("Last Sem Call %d %x %x %x %x %x %x", SemHeldByAPI,
Sem_eax, Sem_ebx, Sem_ecx, Sem_edx, Sem_esi, Sem_edi);
@ -3304,7 +3297,7 @@ DllExport int APIENTRY CloseBPQ32()
if (TimerInst == ProcessID)
{
OutputDebugString("BPQ32 Process with Timer called CloseBPQ32\n");
Debugprintf("BPQ32 Process with Timer called CloseBPQ32\n");
if (MinimizetoTray)
Shell_NotifyIcon(NIM_DELETE,&niData);
@ -3345,7 +3338,7 @@ DllExport int APIENTRY CloseBPQ32()
if (AttachedProcesses > 1 && Closing == FALSE && AttachingProcess == 0) // Other processes
{
OutputDebugString("BPQ32 Reloading BPQ32.exe\n");
Debugprintf("BPQ32 Reloading BPQ32.exe\n");
StartBPQ32();
}
}
@ -3514,11 +3507,11 @@ if (_winver < 0x0600)
sprintf(msg,"BPQ32 Ver %s Loaded from: %s by %s\n", VersionString, DLLName, pgm);
WritetoConsole(msg);
OutputDebugString(msg);
Debugprintf(msg);
FormatTime3(Time, NOW);
sprintf(msg,"Loaded %s\n", Time);
WritetoConsole(msg);
OutputDebugString(msg);
Debugprintf(msg);
#pragma warning(push)
#pragma warning(disable : 4996)
@ -3535,12 +3528,12 @@ if (_winver < 0x0600)
#pragma warning(pop)
WritetoConsole(msg);
OutputDebugString(msg);
Debugprintf(msg);
i=sprintf(msg,"BPQ32 Using config from: %s\n\n",BPQDirectory);
WritetoConsole(&msg[6]);
msg[i-1]=0;
OutputDebugString(msg);
Debugprintf(msg);
// Don't write the Version Key if loaded by regsvr32.exe (Installer is running with Admin rights,
// so will write the wrong tree on )
@ -3600,11 +3593,9 @@ HANDLE OpenConfigFile(char *fn)
GetFileTime(handle, NULL, NULL, &LastWriteTime);
FileTimeToSystemTime(&LastWriteTime, &Time);
sprintf(Msg,"BPQ32 Config File %s Created %.2d:%.2d %d/%.2d/%.2d\n", Value,
Debugprintf("BPQ32 Config File %s Created %.2d:%.2d %d/%.2d/%.2d\n", Value,
Time.wHour, Time.wMinute, Time.wYear, Time.wMonth, Time.wDay);
OutputDebugString(Msg);
return(handle);
}
@ -5609,7 +5600,7 @@ int WritetoConsoleSupport(char * buff)
DllExport VOID APIENTRY BPQOutputDebugString(char * String)
{
OutputDebugString(String);
Debugprintf(String);
return;
}
@ -5676,7 +5667,7 @@ BOOLEAN CheckifBPQ32isLoaded()
{
if (AttachingProcess == 0) // Already starting BPQ32
{
OutputDebugString("BPQ32 No other bpq32 programs running - Loading BPQ32.exe\n");
Debugprintf("BPQ32 No other bpq32 programs running - Loading BPQ32.exe");
StartBPQ32();
}
return FALSE;
@ -5773,7 +5764,7 @@ BOOLEAN StartBPQ32()
strcat(Errbuff,Value);
strcat(Errbuff," failed ");
strcat(Errbuff,buff);
OutputDebugString(Errbuff);
Debugprintf(Errbuff);
AttachingProcess = 0;
return FALSE;
}
@ -5831,19 +5822,6 @@ DllExport VOID * APIENTRY GetBuff()
}
VOID __cdecl Debugprintf(const char * format, ...)
{
char Mess[10000];
va_list(arglist);
va_start(arglist, format);
vsprintf(Mess, format, arglist);
va_end(arglist);
strcat(Mess, "\r\n");
OutputDebugString(Mess);
return;
}
unsigned short int compute_crc(unsigned char *buf, int txlen);
@ -6106,7 +6084,7 @@ DllExport VOID APIENTRY CloseAllPrograms()
ShowWindow(hwndClosing, SW_SHOW);
}
VOID RealCloseAllPrograms()
DllExport VOID APIENTRY RealCloseAllPrograms()
{
hookNodeClosing("Shutdown");
Sleep(500);

@ -0,0 +1,50 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C++ Express 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPQWinAPP", "BPQWinAPP.vcproj", "{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinmorControl", "WinmorControl.vcproj", "{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPQMail", "BPQMail.vcproj", "{3766AA10-C777-4ED8-A83D-F1452DE9B665}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LinBPQ", "MailNode.vcproj", "{3766AA10-C777-4ED8-A83D-F1452DE9B666}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CBPQ32", "CBPQ32.vcproj", "{8EFA1E59-8654-4A23-8102-AA77A074D57C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPQChat", "BPQChat.vcproj", "{2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Debug|Win32.ActiveCfg = Debug|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Debug|Win32.Build.0 = Debug|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Release|Win32.ActiveCfg = Release|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B81}.Release|Win32.Build.0 = Release|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Debug|Win32.ActiveCfg = Debug|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Debug|Win32.Build.0 = Debug|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Release|Win32.ActiveCfg = Release|Win32
{005A91EA-3A00-4FB4-ADD9-EB78DBFA2B82}.Release|Win32.Build.0 = Release|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B665}.Debug|Win32.ActiveCfg = Debug|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B665}.Debug|Win32.Build.0 = Debug|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B665}.Release|Win32.ActiveCfg = Release|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B665}.Release|Win32.Build.0 = Release|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B666}.Debug|Win32.ActiveCfg = Debug|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B666}.Debug|Win32.Build.0 = Debug|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B666}.Release|Win32.ActiveCfg = Release|Win32
{3766AA10-C777-4ED8-A83D-F1452DE9B666}.Release|Win32.Build.0 = Release|Win32
{8EFA1E59-8654-4A23-8102-AA77A074D57C}.Debug|Win32.ActiveCfg = Debug|Win32
{8EFA1E59-8654-4A23-8102-AA77A074D57C}.Debug|Win32.Build.0 = Debug|Win32
{8EFA1E59-8654-4A23-8102-AA77A074D57C}.Release|Win32.ActiveCfg = Release|Win32
{8EFA1E59-8654-4A23-8102-AA77A074D57C}.Release|Win32.Build.0 = Release|Win32
{2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Debug|Win32.ActiveCfg = Debug|Win32
{2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Debug|Win32.Build.0 = Debug|Win32
{2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Release|Win32.ActiveCfg = Release|Win32
{2BDD2C8A-2B4A-496C-A2EA-6B49AA0670B1}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

@ -20,7 +20,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="C:\Dev\Msdev2005\$(SolutionName)\$(ProjectName)\$(ConfigurationName)"
OutputDirectory="Win32bits"
IntermediateDirectory="C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="0"
@ -49,7 +49,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\CInclude;..\CommonSource;..\CKernel"
AdditionalIncludeDirectories="..\BPQSource\Win32bits;..\BPQSource"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BPQ32_EXPORTS;MDIKERNEL;_USE_32BIT_TIME_T;BPQ32;NOMQTT"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -74,12 +74,12 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /section:_BPQDATA,srw"
AdditionalDependencies="WS2_32.Lib winmm.lib DbgHelp.lib comctl32.lib Iphlpapi.lib setupapi.lib ..\lib\libconfigd.lib miniupnpc.lib zlibstat.lib"
AdditionalDependencies="WS2_32.Lib winmm.lib DbgHelp.lib comctl32.lib Iphlpapi.lib setupapi.lib Win32bits\libconfigd.lib miniupnpc.lib zlibstat.lib"
OutputFile="c:\DevProgs\BPQ32\bpq32.dll"
LinkIncremental="2"
IgnoreAllDefaultLibraries="false"
IgnoreDefaultLibraryNames="LIBCMTD.lib"
ModuleDefinitionFile="..\CommonSource\bpq32.def"
ModuleDefinitionFile="..\BPQSource\bpq32.def"
GenerateDebugInformation="true"
GenerateMapFile="true"
MapFileName="c:\DevProgs\BPQ32\bpqdev.map"
@ -90,7 +90,7 @@
EnableCOMDATFolding="1"
EntryPointSymbol=""
BaseAddress="0x42000000"
ImportLibrary="..\lib\bpq32.lib"
ImportLibrary="Win32bits\bpq32.lib"
TargetMachine="1"
/>
<Tool
@ -122,7 +122,7 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="C:\Dev\Msdev2005\$(SolutionName)\$(ProjectName)\$(ConfigurationName)"
OutputDirectory="Win32bits"
IntermediateDirectory="C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="0"
@ -158,7 +158,7 @@
AdditionalOptions="/D &quot;MDIKERNEL&quot;"
Optimization="0"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\CInclude;..\CommonSource;..\CKernel"
AdditionalIncludeDirectories="..\BPQSource\Win32bits;..\BPQSource"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;BPQ32_EXPORTS;MDIKERNEL;_USE_32BIT_TIME_T;NOMQTT"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
@ -180,11 +180,11 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /section:_BPQDATA,srw"
AdditionalDependencies="WS2_32.Lib winmm.lib comctl32.lib setupapi.lib ..\lib\libconfig.lib miniupnpc.lib zlibstat.lib DbgHelp.lib"
OutputFile="C:\DevProgs\BPQ32\bpq32.dll"
AdditionalDependencies="WS2_32.Lib winmm.lib comctl32.lib setupapi.lib Win32bits\libconfig.lib miniupnpc.lib zlibstat.lib DbgHelp.lib"
OutputFile="c:\DevProgs\BPQ32\bpq32.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames=""
ModuleDefinitionFile="..\CommonSource\bpq32.def"
ModuleDefinitionFile="..\BPQSource\bpq32.def"
GenerateDebugInformation="true"
ProgramDatabaseFile="c:\DevProgs\BPQ32\bpq32.pdb"
GenerateMapFile="true"
@ -239,19 +239,19 @@
>
</File>
<File
RelativePath="..\CommonSource\adif.c"
RelativePath="..\BPQSource\adif.c"
>
</File>
<File
RelativePath="..\CommonSource\AEAPactor.c"
RelativePath="..\BPQSource\AEAPactor.c"
>
</File>
<File
RelativePath="..\CommonSource\AGWAPI.c"
RelativePath="..\BPQSource\AGWAPI.c"
>
</File>
<File
RelativePath="..\CommonSource\AGWMoncode.c"
RelativePath="..\BPQSource\AGWMoncode.c"
>
</File>
<File
@ -259,7 +259,7 @@
>
</File>
<File
RelativePath="..\CommonSource\APRSCode.c"
RelativePath="..\BPQSource\APRSCode.c"
>
</File>
<File
@ -271,11 +271,11 @@
>
</File>
<File
RelativePath="..\CommonSource\ARDOP.c"
RelativePath="..\BPQSource\ARDOP.c"
>
</File>
<File
RelativePath="..\CommonSource\asmDOSAPI.asm"
RelativePath="..\BPQSource\asmDOSAPI.asm"
>
</File>
<File
@ -283,27 +283,27 @@
>
</File>
<File
RelativePath="..\CommonSource\Bpq32.c"
RelativePath="..\BPQSource\Bpq32.c"
>
</File>
<File
RelativePath="..\CommonSource\bpqaxip.c"
RelativePath="..\BPQSource\bpqaxip.c"
>
</File>
<File
RelativePath="..\CommonSource\bpqether.c"
RelativePath="..\BPQSource\bpqether.c"
>
</File>
<File
RelativePath="..\CommonSource\bpqhdlc.c"
RelativePath="..\BPQSource\bpqhdlc.c"
>
</File>
<File
RelativePath="..\CommonSource\BPQINP3.c"
RelativePath="..\BPQSource\BPQINP3.c"
>
</File>
<File
RelativePath="..\CommonSource\BPQNRR.c"
RelativePath="..\BPQSource\BPQNRR.c"
>
</File>
<File
@ -311,19 +311,19 @@
>
</File>
<File
RelativePath="..\CommonSource\BPQtoAGW.c"
RelativePath="..\BPQSource\BPQtoAGW.c"
>
</File>
<File
RelativePath="..\CommonSource\bpqvkiss.c"
RelativePath="..\BPQSource\bpqvkiss.c"
>
</File>
<File
RelativePath="..\CommonSource\cMain.c"
RelativePath="..\BPQSource\cMain.c"
>
</File>
<File
RelativePath="..\CommonSource\Cmd.c"
RelativePath="..\BPQSource\Cmd.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -335,7 +335,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\CommonSource\CMSAuth.c"
RelativePath="..\BPQSource\CMSAuth.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -347,23 +347,23 @@
</FileConfiguration>
</File>
<File
RelativePath="..\CommonSource\CommonCode.c"
RelativePath="..\BPQSource\CommonCode.c"
>
</File>
<File
RelativePath="..\CommonSource\compatbits.c"
RelativePath="..\BPQSource\compatbits.c"
>
</File>
<File
RelativePath="..\CommonSource\config.c"
RelativePath="..\BPQSource\config.c"
>
</File>
<File
RelativePath="..\CommonSource\datadefs.c"
RelativePath="..\BPQSource\datadefs.c"
>
</File>
<File
RelativePath="..\CommonSource\DOSAPI.c"
RelativePath="..\BPQSource\DOSAPI.c"
>
</File>
<File
@ -375,7 +375,7 @@
>
</File>
<File
RelativePath="..\CommonSource\FLDigi.c"
RelativePath="..\BPQSource\FLDigi.c"
>
</File>
<File
@ -383,15 +383,15 @@
>
</File>
<File
RelativePath="..\CommonSource\HALDriver.c"
RelativePath="..\BPQSource\HALDriver.c"
>
</File>
<File
RelativePath="..\CommonSource\HFCommon.c"
RelativePath="..\BPQSource\HFCommon.c"
>
</File>
<File
RelativePath="..\CommonSource\hid.c"
RelativePath="..\BPQSource\hid.c"
>
</File>
<File
@ -399,43 +399,43 @@
>
</File>
<File
RelativePath="..\CommonSource\HTTPcode.c"
RelativePath="..\BPQSource\HTTPcode.c"
>
</File>
<File
RelativePath="..\CommonSource\IPCode.c"
RelativePath="..\BPQSource\IPCode.c"
>
</File>
<File
RelativePath="..\CommonSource\KAMPactor.c"
RelativePath="..\BPQSource\KAMPactor.c"
>
</File>
<File
RelativePath="..\CommonSource\kiss.c"
RelativePath="..\BPQSource\kiss.c"
>
</File>
<File
RelativePath="..\CommonSource\KISSHF.c"
RelativePath="..\BPQSource\KISSHF.c"
>
</File>
<File
RelativePath="..\CommonSource\L2Code.c"
RelativePath="..\BPQSource\L2Code.c"
>
</File>
<File
RelativePath="..\CommonSource\L3Code.c"
RelativePath="..\BPQSource\L3Code.c"
>
</File>
<File
RelativePath="..\CommonSource\L4Code.c"
RelativePath="..\BPQSource\L4Code.c"
>
</File>
<File
RelativePath="..\CommonSource\md5.c"
RelativePath="..\BPQSource\md5.c"
>
</File>
<File
RelativePath="..\CommonSource\Moncode.c"
RelativePath="..\BPQSource\Moncode.c"
>
</File>
<File
@ -451,7 +451,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\CommonSource\MULTIPSK.c"
RelativePath="..\BPQSource\MULTIPSK.c"
>
</File>
<File
@ -523,7 +523,7 @@
>
</File>
<File
RelativePath="..\CommonSource\PortMapper.c"
RelativePath="..\BPQSource\PortMapper.c"
>
</File>
<File
@ -531,39 +531,39 @@
>
</File>
<File
RelativePath="..\CommonSource\RigControl.c"
RelativePath="..\BPQSource\RigControl.c"
>
</File>
<File
RelativePath="..\CommonSource\SCSPactor.c"
RelativePath="..\BPQSource\SCSPactor.c"
>
</File>
<File
RelativePath="..\CommonSource\SCSTrackeMulti.c"
RelativePath="..\BPQSource\SCSTrackeMulti.c"
>
</File>
<File
RelativePath="..\CommonSource\SCSTracker.c"
RelativePath="..\BPQSource\SCSTracker.c"
>
</File>
<File
RelativePath="..\CommonSource\SerialPort.c"
RelativePath="..\BPQSource\SerialPort.c"
>
</File>
<File
RelativePath="..\CommonSource\TelnetV6.c"
RelativePath="..\BPQSource\TelnetV6.c"
>
</File>
<File
RelativePath="..\CommonSource\TNCCode.c"
RelativePath="..\BPQSource\TNCCode.c"
>
</File>
<File
RelativePath="..\CommonSource\TNCEmulators.c"
RelativePath="..\BPQSource\TNCEmulators.c"
>
</File>
<File
RelativePath="..\CommonSource\UIARQ.c"
RelativePath="..\BPQSource\UIARQ.c"
>
</File>
<File
@ -571,27 +571,27 @@
>
</File>
<File
RelativePath="..\CommonSource\utf8Routines.c"
RelativePath="..\BPQSource\utf8Routines.c"
>
</File>
<File
RelativePath="..\CommonSource\UZ7HODrv.c"
RelativePath="..\BPQSource\UZ7HODrv.c"
>
</File>
<File
RelativePath="..\CommonSource\V4.c"
RelativePath="..\BPQSource\V4.c"
>
</File>
<File
RelativePath="..\CommonSource\VARA.c"
RelativePath="..\BPQSource\VARA.c"
>
</File>
<File
RelativePath="..\CommonSource\WINMOR.c"
RelativePath="..\BPQSource\WINMOR.c"
>
</File>
<File
RelativePath="..\CommonSource\WinRPR.c"
RelativePath="..\BPQSource\WinRPR.c"
>
</File>
</Filter>
@ -601,11 +601,11 @@
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\CommonSource\asmstrucs.h"
RelativePath="..\BPQSource\asmstrucs.h"
>
</File>
<File
RelativePath="..\CommonSource\bpq32.def"
RelativePath="..\BPQSource\bpq32.def"
>
</File>
<File
@ -613,7 +613,7 @@
>
</File>
<File
RelativePath="..\CommonSource\compatbits.h"
RelativePath="..\BPQSource\compatbits.h"
>
</File>
<File
@ -625,7 +625,7 @@
>
</File>
<File
RelativePath="..\CommonSource\Versions.h"
RelativePath="..\BPQSource\Versions.h"
>
</File>
</Filter>
@ -635,7 +635,7 @@
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath="..\CommonSource\KernelScript1.rc"
RelativePath="..\BPQSource\KernelScript1.rc"
>
</File>
</Filter>

@ -468,6 +468,11 @@ VOID RIGRECONFIG(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, str
VOID REBOOT(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct CMDX * CMD)
{
char * ptr = 0;
*(ptr) = 0;
if (Reboot())
{
strcpy(Bufferptr, REBOOTOK);

@ -89,6 +89,113 @@ extern int PoolBuilt;
extern int EnableOARCAPI;
DllExport UCHAR * APIENTRY GetLogDirectory();
FILE * DebugHandle = NULL;
DllExport VOID APIENTRY OpenDebugLog()
{
time_t T;
struct tm * tm;
char FN[256];
T = time(NULL);
tm = gmtime(&T);
if (DebugHandle == 0)
{
sprintf(FN,"%s/logs/NodeDebuglog_%02d%02d%02d.log", GetLogDirectory(), tm->tm_year - 100, tm->tm_mon + 1, tm->tm_mday);
DebugHandle = fopen(FN, "ab");
}
}
DllExport VOID APIENTRY CloseDebugLog()
{
if (DebugHandle)
fclose(DebugHandle);
DebugHandle = 0;
}
DllExport VOID __cdecl Debugprintf(const char * format, ...)
{
char Mess[8192];
time_t T;
struct tm * tm;
int Len;
char LogMsg[256];
va_list(arglist);
va_start(arglist, format);
Len = vsnprintf(Mess, sizeof(Mess), format, arglist);
T = time(NULL);
tm = gmtime(&T);
if (DebugHandle == 0)
{
char FN[256];
sprintf(FN,"%s/logs/NodeDebuglog_%02d%02d%02d.log", GetLogDirectory(), tm->tm_year - 100, tm->tm_mon + 1, tm->tm_mday);
DebugHandle = fopen(FN, "ab");
if (DebugHandle == 0)
return;
}
Len = sprintf(LogMsg, "%02d:%02d:%02d ", tm->tm_hour, tm->tm_min, tm->tm_sec);
fwrite(LogMsg, Len, 1, DebugHandle);
if (DebugHandle == 0)
return;
fwrite(Mess, strlen(Mess), 1, DebugHandle);
fwrite("\r\n", 2, 1, DebugHandle);
return;
}
DllExport VOID __cdecl DebugprintNOLF(const char * format, ...)
{
char Mess[8192];
time_t T;
struct tm * tm;
int Len;
char LogMsg[256];
va_list(arglist);
va_start(arglist, format);
Len = vsnprintf(Mess, sizeof(Mess), format, arglist);
T = time(NULL);
tm = gmtime(&T);
if (DebugHandle == 0)
{
char FN[256];
sprintf(FN,"%s/logs/NodeDebuglog_%02d%02d%02d.log", GetLogDirectory(), tm->tm_year - 100, tm->tm_mon + 1, tm->tm_mday);
DebugHandle = fopen(FN, "ab");
if (DebugHandle == 0)
return;
}
Len = sprintf(LogMsg, "%02d:%02d:%02d ", tm->tm_hour, tm->tm_min, tm->tm_sec);
fwrite(LogMsg, Len, 1, DebugHandle);
if (DebugHandle == 0)
return;
fwrite(Mess, strlen(Mess), 1, DebugHandle);
return;
}
// Read/Write length field in a buffer header
// Needed for Big/LittleEndian and ARM5 (unaligned operation problem) portability
@ -2477,7 +2584,6 @@ HANDLE OpenCOMPort(char * pPort, int speed, BOOL SetDTR, BOOL SetRTS, BOOL Quiet
sprintf(buf,"%s Setup Failed %d ", pPort, GetLastError());
WritetoConsoleLocal(buf);
OutputDebugString(buf);
CloseHandle(fd);
return 0;
}
@ -3803,13 +3909,13 @@ void printStack(void)
#ifdef WIN32
#ifdef _DEBUG // So we can use on 98/2K
unsigned int i;
void * stack[ 100 ];
unsigned short frames;
SYMBOL_INFO * symbol;
HANDLE process;
unsigned int i;
void * stack[ 100 ];
unsigned short frames;
SYMBOL_INFO * symbol;
HANDLE process;
Debugprintf("Stack Backtrace");
Debugprintf("Stack Backtrace");
process = GetCurrentProcess();
@ -3825,9 +3931,9 @@ void printStack(void)
SymFromAddr( process, ( DWORD64 )( stack[ i ] ), 0, symbol );
Debugprintf( "%i: %s - %p", frames - i - 1, symbol->Name, symbol->Address );
}
}
free(symbol);
free(symbol);
#endif
#endif

@ -1754,6 +1754,7 @@ int SetupNodeMenu(char * Buff, int LOCAL)
<script>\
document.getElementById('e').value = new Date().toISOString().substring(0, 10);\
</script></label>\
<input type=submit class='btn' name='NodeDebug' value='Node Debug Log'></br>\
<input type=submit class='btn' name='BBS' value='BBS Log'></br>\
<input type=submit class='btn' name='Debug' value='BBS Debug Log'></br>\
<input type=submit class='btn' name='Telnet' value='Telnet Log'></br>\
@ -3610,6 +3611,7 @@ doHeader:
strcat(inputname, "/logs/");
}
if (strstr(Context, "CMS"))
{
sprintf(Name, "CMSAccess_%04d%02d%02d.log",
@ -3636,6 +3638,13 @@ doHeader:
tm->tm_year - 100, tm->tm_mon+1, tm->tm_mday);
}
if (strstr(Context, "NodeDebug"))
{
sprintf(Name, "NodeDebugLog_%02d%02d%02d.log",
tm->tm_year - 100, tm->tm_mon+1, tm->tm_mday);
CloseDebugLog();
}
strcat(inputname, Name);
if (stat(inputname, &STAT) == -1)

@ -836,7 +836,6 @@ int DeleteBBSLogFiles()
{
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
OutputDebugString(ffd.cFileName);
}
else
{

@ -344,8 +344,8 @@ END
//
// Generated from the TEXTINCLUDE 3 resource.
//
#include "..\CommonSource\Versions.h"
#include "..\StdVer.inc"
#include "Versions.h"
#include "StdVer.inc"
/////////////////////////////////////////////////////////////////////////////

@ -29,6 +29,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#else
#include <iconv.h>
#include <errno.h>
#ifndef MACBPQ
#ifndef FREEBSD
#include <sys/prctl.h>
@ -384,26 +385,88 @@ BOOL CtrlHandler(DWORD fdwCtrlType)
#include <execinfo.h>
#include <signal.h>
#include <backtrace.h>
static struct backtrace_state *state;
static char ** lines;
static char * line;
// Callback to print a niely formatted bsack tracre
static int full_callback (void *data, uintptr_t pc, const char *pathname, int line_number, const char *function)
{
if (pathname == NULL || function == NULL || line_number == 0)
Debugprintf(line);
else
{
const char *filename = rindex(pathname, '/');
if (filename) filename++; else filename = pathname;
Debugprintf("%s %s:%d -- %s", line, filename, line_number, function);
}
return 0;
};
static void error_callback (void *data, const char *message, int error_number)
{
if (error_number == -1)
{
fprintf(stderr, "If you want backtraces, you have to compile with -g\n\n");
_Exit(1);
}
else
{
fprintf(stderr, "Backtrace error %d: %s\n", error_number, message);
}
};
// Linux Signal Handlers
VOID __cdecl DebugprintNOLF(const char * format, ...);
static void segvhandler(int sig)
{
void *array[10];
void *array[50];
size_t size;
char msg[] = "\nSIGSEGV Received\n";
char msg[] = "\nSIGSEGV Received\n\nBacktrace\n\n";
char msg2[] = "\nThere should be a better Backtrace in the Debug Log with source filenames and line numbers\n\n";
int n;
write(STDERR_FILENO, msg, strlen(msg));
// Write the basic backtrace() first as this is meant to be signal safe
// Then try a libbacktrace(), which gives source info may use non-signal safe functions so may not work
write(STDOUT_FILENO, msg, strlen(msg));
// get void*'s for all entries on the stack
size = backtrace(array, 10);
size = backtrace(array, 50);
// print out all the frames to stderr
// normal print
backtrace_symbols_fd(array, size, STDOUT_FILENO);
backtrace_symbols_fd(array, size, STDERR_FILENO);
// if source info for the address is available we want to print it but otherwise print the old style back trace.
write(STDOUT_FILENO, msg, strlen(msg));
backtrace_symbols_fd(array, size, STDOUT_FILENO);
printf("\n");
printf("\n");
write(STDOUT_FILENO, msg2, strlen(msg2));
// backtrace_symbols produces an array of the old style records but isn't signal safe.
// Easiest probably to always print that and add source info if possible
lines = backtrace_symbols(array, size);
Debugprintf(msg);
for (n = 0; n < size; n++)
{
line = lines[n];
backtrace_pcinfo(state, (uintptr_t)array[n], full_callback, error_callback, NULL);
}
hookNodeClosing("sigsegv");
Sleep(500);
@ -427,6 +490,12 @@ static void abrthandler(int sig)
write(STDOUT_FILENO, msg, strlen(msg));
backtrace_symbols_fd(array, size, STDOUT_FILENO);
printf("\n");
printf("\n");
backtrace_print(state, 0, stdout);
backtrace_print(state, 0, stderr);
hookNodeClosing("sigabrt");
Sleep(500);
@ -672,6 +741,7 @@ void ConTermInput(char * Msg)
if (!ConTerm.CONNECTED)
SessionControl(ConTerm.BPQStream, 1, 0);
ConTerm.StackIndex = 0;
// Stack it
@ -709,8 +779,18 @@ void ConTermPoll()
{
// Connected
BPQVECSTRUC * SESS;
TRANSPORTENTRY * L4;
ConTerm.CONNECTED = TRUE;
ConTerm.SlowTimer = 0;
SESS = &BPQHOSTVECTOR[ConTerm.BPQStream - 1];
if (SESS)
{
L4 = SESS->HOSTSESSION;
L4->Secure_Session = 1;
}
}
else
{
@ -896,8 +976,6 @@ void Semaphored100msCode()
// SetupBPQDirectory();
WritetoConsoleLocal("Reconfiguring ...\n\n");
OutputDebugString("BPQ32 Reconfiguring ...\n");
for (i=0;i<NUMBEROFPORTS;i++)
{
@ -983,7 +1061,7 @@ void Semaphored100msCode()
AGWActive = AGWAPIInit();
GetSemaphore(&Semaphore, 2);
OutputDebugString("BPQ32 Reconfiguration Complete\n");
WritetoConsoleLocal("BPQ32 Reconfiguration Complete\n");
}
}
@ -1075,6 +1153,10 @@ void UnSemaphored100msCode()
Slowtimer = 0;
}
#ifndef WIN32
#endif
int main(int argc, char * argv[])
{
@ -1106,6 +1188,8 @@ int main(int argc, char * argv[])
#else
state = backtrace_create_state(argv[0], 0, error_callback, NULL);
signal(SIGSEGV, segvhandler);
signal(SIGABRT, abrthandler);

@ -40,7 +40,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\CKernel;..\CommonSource;..\CInclude"
AdditionalIncludeDirectories="Win32bits;..\BPQSource"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;LINBPQ;_USE_32BIT_TIME_T;NOMQTT"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -61,7 +61,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="kernel32.lib WS2_32.Lib ..\lib\libconfigd.lib DbgHelp.lib setupapi.lib miniupnpc.lib zlibstat.lib"
AdditionalDependencies="kernel32.lib WS2_32.Lib Win32bits\libconfigd.lib DbgHelp.lib setupapi.lib miniupnpc.lib zlibstat.lib"
OutputFile="c:\LINBPQ\$(ProjectName).exe"
LinkIncremental="2"
IgnoreDefaultLibraryNames=""
@ -123,7 +123,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\CKernel;..\CommonSource;..\CInclude"
AdditionalIncludeDirectories="Win32bits;..\BPQSource"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;LINBPQ;_USE_32BIT_TIME_T;NOMQTT"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
@ -142,7 +142,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="kernel32.lib WS2_32.Lib ..\lib\libconfig.lib DbgHelp.lib Setupapi.lib miniupnpc.lib zlibstat.lib"
AdditionalDependencies="kernel32.lib WS2_32.Lib Win32bits\libconfig.lib DbgHelp.lib Setupapi.lib miniupnpc.lib zlibstat.lib"
OutputFile="c:\devprogs\bpq32\LinBPQ.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
@ -188,19 +188,19 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\CommonSource\adif.c"
RelativePath="..\BPQSource\adif.c"
>
</File>
<File
RelativePath="..\CommonSource\AEAPactor.c"
RelativePath="..\BPQSource\AEAPactor.c"
>
</File>
<File
RelativePath="..\CommonSource\AGWAPI.c"
RelativePath="..\BPQSource\AGWAPI.c"
>
</File>
<File
RelativePath="..\CommonSource\AGWMoncode.c"
RelativePath="..\BPQSource\AGWMoncode.c"
>
</File>
<File
@ -208,11 +208,11 @@
>
</File>
<File
RelativePath="..\CommonSource\Alloc.c"
RelativePath="..\BPQSource\Alloc.c"
>
</File>
<File
RelativePath="..\CommonSource\APRSCode.c"
RelativePath="..\BPQSource\APRSCode.c"
>
</File>
<File
@ -224,7 +224,7 @@
>
</File>
<File
RelativePath="..\CommonSource\ARDOP.c"
RelativePath="..\BPQSource\ARDOP.c"
>
</File>
<File
@ -232,11 +232,11 @@
>
</File>
<File
RelativePath="..\CommonSource\BBSHTMLConfig.c"
RelativePath="..\BPQSource\BBSHTMLConfig.c"
>
</File>
<File
RelativePath="..\CommonSource\BBSUtilities.c"
RelativePath="..\BPQSource\BBSUtilities.c"
>
<FileConfiguration
Name="Debug|Win32"
@ -257,63 +257,63 @@
</FileConfiguration>
</File>
<File
RelativePath="..\CommonSource\bpqaxip.c"
RelativePath="..\BPQSource\bpqaxip.c"
>
</File>
<File
RelativePath="..\CommonSource\bpqether.c"
RelativePath="..\BPQSource\bpqether.c"
>
</File>
<File
RelativePath="..\CommonSource\bpqhdlc.c"
RelativePath="..\BPQSource\bpqhdlc.c"
>
</File>
<File
RelativePath="..\CommonSource\BPQINP3.c"
RelativePath="..\BPQSource\BPQINP3.c"
>
</File>
<File
RelativePath="..\CommonSource\BPQNRR.c"
RelativePath="..\BPQSource\BPQNRR.c"
>
</File>
<File
RelativePath="..\CommonSource\BPQtoAGW.c"
RelativePath="..\BPQSource\BPQtoAGW.c"
>
</File>
<File
RelativePath="..\CommonSource\bpqvkiss.c"
RelativePath="..\BPQSource\bpqvkiss.c"
>
</File>
<File
RelativePath="..\CommonSource\ChatHTMLConfig.c"
RelativePath="..\BPQSource\ChatHTMLConfig.c"
>
</File>
<File
RelativePath="..\CommonSource\cMain.c"
RelativePath="..\BPQSource\cMain.c"
>
</File>
<File
RelativePath="..\CommonSource\Cmd.c"
RelativePath="..\BPQSource\Cmd.c"
>
</File>
<File
RelativePath="..\CommonSource\CMSAuth.c"
RelativePath="..\BPQSource\CMSAuth.c"
>
</File>
<File
RelativePath="..\CommonSource\CommonCode.c"
RelativePath="..\BPQSource\CommonCode.c"
>
</File>
<File
RelativePath="..\CommonSource\compatbits.c"
RelativePath="..\BPQSource\compatbits.c"
>
</File>
<File
RelativePath="..\CommonSource\config.c"
RelativePath="..\BPQSource\config.c"
>
</File>
<File
RelativePath="..\CommonSource\datadefs.c"
RelativePath="..\BPQSource\datadefs.c"
>
</File>
<File
@ -325,11 +325,11 @@
>
</File>
<File
RelativePath="..\CommonSource\FBBRoutines.c"
RelativePath="..\BPQSource\FBBRoutines.c"
>
</File>
<File
RelativePath="..\CommonSource\FLDigi.c"
RelativePath="..\BPQSource\FLDigi.c"
>
</File>
<File
@ -341,23 +341,23 @@
>
</File>
<File
RelativePath="..\CommonSource\HALDriver.c"
RelativePath="..\BPQSource\HALDriver.c"
>
</File>
<File
RelativePath="..\CommonSource\HanksRT.c"
RelativePath="..\BPQSource\HanksRT.c"
>
</File>
<File
RelativePath="..\CommonSource\HFCommon.c"
RelativePath="..\BPQSource\HFCommon.c"
>
</File>
<File
RelativePath="..\CommonSource\hid.c"
RelativePath="..\BPQSource\hid.c"
>
</File>
<File
RelativePath="..\CommonSource\Housekeeping.c"
RelativePath="..\BPQSource\Housekeeping.c"
>
</File>
<File
@ -365,63 +365,63 @@
>
</File>
<File
RelativePath="..\CommonSource\HTMLCommonCode.c"
RelativePath="..\BPQSource\HTMLCommonCode.c"
>
</File>
<File
RelativePath="..\CommonSource\HTTPcode.c"
RelativePath="..\BPQSource\HTTPcode.c"
>
</File>
<File
RelativePath="..\CommonSource\IPCode.c"
RelativePath="..\BPQSource\IPCode.c"
>
</File>
<File
RelativePath="..\CommonSource\KAMPactor.c"
RelativePath="..\BPQSource\KAMPactor.c"
>
</File>
<File
RelativePath="..\CommonSource\kiss.c"
RelativePath="..\BPQSource\kiss.c"
>
</File>
<File
RelativePath="..\CommonSource\KISSHF.c"
RelativePath="..\BPQSource\KISSHF.c"
>
</File>
<File
RelativePath="..\CommonSource\L2Code.c"
RelativePath="..\BPQSource\L2Code.c"
>
</File>
<File
RelativePath="..\CommonSource\L3Code.c"
RelativePath="..\BPQSource\L3Code.c"
>
</File>
<File
RelativePath="..\CommonSource\L4Code.c"
RelativePath="..\BPQSource\L4Code.c"
>
</File>
<File
RelativePath="..\CommonSource\LinBPQ.c"
RelativePath="..\BPQSource\LinBPQ.c"
>
</File>
<File
RelativePath="..\CommonSource\LzFind.c"
RelativePath="..\BPQSource\LzFind.c"
>
</File>
<File
RelativePath="..\CommonSource\lzhuf32.c"
RelativePath="..\BPQSource\lzhuf32.c"
>
</File>
<File
RelativePath="..\CommonSource\LzmaDec.c"
RelativePath="..\BPQSource\LzmaDec.c"
>
</File>
<File
RelativePath="..\CommonSource\LzmaEnc.c"
RelativePath="..\BPQSource\LzmaEnc.c"
>
</File>
<File
RelativePath="..\CommonSource\LzmaLib.c"
RelativePath="..\BPQSource\LzmaLib.c"
>
</File>
<File
@ -429,31 +429,31 @@
>
</File>
<File
RelativePath="..\CommonSource\MailCommands.c"
RelativePath="..\BPQSource\MailCommands.c"
>
</File>
<File
RelativePath="..\CommonSource\MailDataDefs.c"
RelativePath="..\BPQSource\MailDataDefs.c"
>
</File>
<File
RelativePath="..\CommonSource\MailRouting.c"
RelativePath="..\BPQSource\MailRouting.c"
>
</File>
<File
RelativePath="..\CommonSource\MailTCP.c"
RelativePath="..\BPQSource\MailTCP.c"
>
</File>
<File
RelativePath="..\CommonSource\MBLRoutines.c"
RelativePath="..\BPQSource\MBLRoutines.c"
>
</File>
<File
RelativePath="..\CommonSource\md5.c"
RelativePath="..\BPQSource\md5.c"
>
</File>
<File
RelativePath="..\CommonSource\Moncode.c"
RelativePath="..\BPQSource\Moncode.c"
>
</File>
<File
@ -461,11 +461,11 @@
>
</File>
<File
RelativePath="..\CommonSource\Multicast.c"
RelativePath="..\BPQSource\Multicast.c"
>
</File>
<File
RelativePath="..\CommonSource\MULTIPSK.c"
RelativePath="..\BPQSource\MULTIPSK.c"
>
</File>
<File
@ -473,7 +473,7 @@
>
</File>
<File
RelativePath="..\CommonSource\NNTPRoutines.c"
RelativePath="..\BPQSource\NNTPRoutines.c"
>
</File>
<File
@ -481,7 +481,7 @@
>
</File>
<File
RelativePath="..\CommonSource\pibits.c"
RelativePath="..\BPQSource\pibits.c"
>
</File>
<File
@ -561,39 +561,39 @@
>
</File>
<File
RelativePath="..\CommonSource\RigControl.c"
RelativePath="..\BPQSource\RigControl.c"
>
</File>
<File
RelativePath="..\CommonSource\SCSPactor.c"
RelativePath="..\BPQSource\SCSPactor.c"
>
</File>
<File
RelativePath="..\CommonSource\SCSTrackeMulti.c"
RelativePath="..\BPQSource\SCSTrackeMulti.c"
>
</File>
<File
RelativePath="..\CommonSource\SCSTracker.c"
RelativePath="..\BPQSource\SCSTracker.c"
>
</File>
<File
RelativePath="..\CommonSource\SerialPort.c"
RelativePath="..\BPQSource\SerialPort.c"
>
</File>
<File
RelativePath="..\CommonSource\TelnetV6.c"
RelativePath="..\BPQSource\TelnetV6.c"
>
</File>
<File
RelativePath="..\CommonSource\TNCCode.c"
RelativePath="..\BPQSource\TNCCode.c"
>
</File>
<File
RelativePath="..\CommonSource\TNCEmulators.c"
RelativePath="..\BPQSource\TNCEmulators.c"
>
</File>
<File
RelativePath="..\CommonSource\UIRoutines.c"
RelativePath="..\BPQSource\UIRoutines.c"
>
</File>
<File
@ -601,27 +601,27 @@
>
</File>
<File
RelativePath="..\CommonSource\utf8Routines.c"
RelativePath="..\BPQSource\utf8Routines.c"
>
</File>
<File
RelativePath="..\CommonSource\UZ7HODrv.c"
RelativePath="..\BPQSource\UZ7HODrv.c"
>
</File>
<File
RelativePath="..\CommonSource\V4.c"
RelativePath="..\BPQSource\V4.c"
>
</File>
<File
RelativePath="..\CommonSource\VARA.c"
RelativePath="..\BPQSource\VARA.c"
>
</File>
<File
RelativePath="..\CommonSource\WebMail.c"
RelativePath="..\BPQSource\WebMail.c"
>
</File>
<File
RelativePath="..\CommonSource\WINMOR.c"
RelativePath="..\BPQSource\WINMOR.c"
>
</File>
<File
@ -629,7 +629,7 @@
>
</File>
<File
RelativePath="..\CommonSource\WPRoutines.c"
RelativePath="..\BPQSource\WPRoutines.c"
>
</File>
</Filter>

Binary file not shown.

File diff suppressed because it is too large Load Diff

@ -36,7 +36,7 @@ END
#define BPQICON 2
BPQICON ICON DISCARDABLE "..\\bpqicon.ico"
BPQICON ICON DISCARDABLE "bpqicon.ico"
#ifdef MAILCHAT

@ -3403,30 +3403,12 @@ NOTDATA:
if (TNC->DEDTXBUFFER[0] == 1)
{
// recovering
// if (!TNC->Recovering)
// {
// sprintf(msg, "Port %d DED Recovery started\n", TNC->ComPort);
// OutputDebugString(msg);
// TNC->Recovering = TRUE;
// }
}
else
{
// Not recovery
// if (TNC->Recovering)
// {
// sprintf(msg, "Port %d DED Recovery completed\n", TNC->ComPort);
// OutputDebugString(msg);
// TNC->Recovering = FALSE;
// }
}
// sprintf(msg,"DED CMD: Port %d CMD %c MSGCHANNEL %d\n", TNC->ComPort, TNC->TONODEBUFFER[0], MSGCHANNEL);
// OutputDebugString(msg);
if (_memicmp(TNC->DEDTXBUFFER, "QRES", 4 == 0))
return SendHostOK(TNC);
@ -3809,32 +3791,8 @@ REALCALL:
HOSTDATAPACKET:
// }
// {
// UCHAR msg[100];
// sprintf(msg,"Host Data Packet: Port %d\n", TNC->ComPort);
// OutputDebugString(msg);
// }
//
// IF WE ALREADY HAVE DATA QUEUED, ADD THIS IT QUEUE
// if (Channel->Chan_TXQ)
// {
// // COPY MESSAGE TO A CHAIN OF BUFFERS
// if (QCOUNT < 10)
// goto CANTSEND; // NO SPACE - RETURN ERROR (?)
//QUEUEFRAME:
// C_Q_ADD(Channel->Chan_TXQ, COPYMSGTOBUFFERS()); // RETURNS EDI = FIRST (OR ONLY) FRAGMENT
// return SendHostOK(TNC);
// MAKE SURE NODE ISNT BUSY
if (TNC->MSGCHANNEL == 0) // UNPROTO Channel

@ -187,6 +187,7 @@ int DeleteLogFile(char * Log, int KeepDays);
void DeleteLogFiles(int Age)
{
DeleteLogFile("NodeDebug", Age);
DeleteLogFile("Telnet", Age);
DeleteLogFile("CMSAccess_", Age);
DeleteLogFile("ConnectLog_",Age);
@ -206,7 +207,7 @@ int DeleteLogFile(char * Log, int KeepDays)
HANDLE hFind = INVALID_HANDLE_VALUE;
DWORD dwError=0;
LARGE_INTEGER ft;
time_t now = NOW;
time_t now = time(NULL);
int Age;
@ -226,7 +227,6 @@ int DeleteLogFile(char * Log, int KeepDays)
{
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
OutputDebugString(ffd.cFileName);
}
else
{

@ -9,15 +9,15 @@
#endif
#define KVers 6,0,25,39
#define KVerstring "6.0.25.39\0"
#define KVers 6,0,25,40
#define KVerstring "6.0.25.40\0"
#ifdef CKernel
#define Vers KVers
#define Verstring KVerstring
#define Datestring "August 2026"
#define Datestring "September 2026"
#define VerComments "G8BPQ Packet Switch (C Version)" KVerstring
#define VerCopyright "Copyright © 2001-2026 John Wiseman G8BPQ\0"
#define VerDesc "BPQ32 Switch\0"

@ -0,0 +1,750 @@
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1995 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#ifndef __AFXRES_H__
#define __AFXRES_H__
#ifdef REZ // Mac resource compiler (mrc) defines REZ
#define RC_INVOKED
#endif
#ifdef RC_INVOKED
#ifndef _INC_WINDOWS
#define _INC_WINDOWS
#include "winres.h" // extract from windows header
#endif
#endif
#ifdef _AFX_MINREBUILD
#pragma component(minrebuild, off)
#endif
#ifdef APSTUDIO_INVOKED
#define APSTUDIO_HIDDEN_SYMBOLS
#endif
/////////////////////////////////////////////////////////////////////////////
// MFC resource types (see Technical note TN024 for implementation details)
#ifndef RC_INVOKED
#define RT_DLGINIT MAKEINTRESOURCE(240)
#define RT_TOOLBAR MAKEINTRESOURCE(241)
#endif
/////////////////////////////////////////////////////////////////////////////
#ifdef APSTUDIO_INVOKED
#undef APSTUDIO_HIDDEN_SYMBOLS
#endif
/////////////////////////////////////////////////////////////////////////////
// General style bits etc
// Tab Control styles
#ifndef TCS_MULTILINE // new in later versions of Win32
#define TCS_MULTILINE 0x0200
#endif
// ControlBar styles
#define CBRS_ALIGN_LEFT 0x1000L
#define CBRS_ALIGN_TOP 0x2000L
#define CBRS_ALIGN_RIGHT 0x4000L
#define CBRS_ALIGN_BOTTOM 0x8000L
#define CBRS_ALIGN_ANY 0xF000L
#define CBRS_BORDER_LEFT 0x0100L
#define CBRS_BORDER_TOP 0x0200L
#define CBRS_BORDER_RIGHT 0x0400L
#define CBRS_BORDER_BOTTOM 0x0800L
#define CBRS_BORDER_ANY 0x0F00L
#define CBRS_TOOLTIPS 0x0010L
#define CBRS_FLYBY 0x0020L
#define CBRS_FLOAT_MULTI 0x0040L
#define CBRS_BORDER_3D 0x0080L
#define CBRS_HIDE_INPLACE 0x0008L
#define CBRS_SIZE_DYNAMIC 0x0004L
#define CBRS_SIZE_FIXED 0x0002L
#define CBRS_FLOATING 0x0001L
#define CBRS_ORIENT_HORZ (CBRS_ALIGN_TOP|CBRS_ALIGN_BOTTOM)
#define CBRS_ORIENT_VERT (CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT)
#define CBRS_ORIENT_ANY (CBRS_ORIENT_HORZ|CBRS_ORIENT_VERT)
#define CBRS_ALL 0xFFFFL
// the CBRS_ style is made up of an alignment style and a draw border style
// the alignment styles are mutually exclusive
// the draw border styles may be combined
#define CBRS_NOALIGN 0x00000000L
#define CBRS_LEFT (CBRS_ALIGN_LEFT|CBRS_BORDER_RIGHT)
#define CBRS_TOP (CBRS_ALIGN_TOP|CBRS_BORDER_BOTTOM)
#define CBRS_RIGHT (CBRS_ALIGN_RIGHT|CBRS_BORDER_LEFT)
#define CBRS_BOTTOM (CBRS_ALIGN_BOTTOM|CBRS_BORDER_TOP)
/////////////////////////////////////////////////////////////////////////////
// Standard window components
// Mode indicators in status bar - these are routed like commands
#define ID_INDICATOR_EXT 0xE700 // extended selection indicator
#define ID_INDICATOR_CAPS 0xE701 // cap lock indicator
#define ID_INDICATOR_NUM 0xE702 // num lock indicator
#define ID_INDICATOR_SCRL 0xE703 // scroll lock indicator
#define ID_INDICATOR_OVR 0xE704 // overtype mode indicator
#define ID_INDICATOR_REC 0xE705 // record mode indicator
#define ID_INDICATOR_KANA 0xE706 // kana lock indicator
#define ID_SEPARATOR 0 // special separator value
#ifndef RC_INVOKED // code only
// Standard control bars (IDW = window ID)
#define AFX_IDW_CONTROLBAR_FIRST 0xE800
#define AFX_IDW_CONTROLBAR_LAST 0xE8FF
#define AFX_IDW_TOOLBAR 0xE800 // main Toolbar for window
#define AFX_IDW_STATUS_BAR 0xE801 // Status bar window
#define AFX_IDW_PREVIEW_BAR 0xE802 // PrintPreview Dialog Bar
#define AFX_IDW_RESIZE_BAR 0xE803 // OLE in-place resize bar
// Note: If your application supports docking toolbars, you should
// not use the following IDs for your own toolbars. The IDs chosen
// are at the top of the first 32 such that the bars will be hidden
// while in print preview mode, and are not likely to conflict with
// IDs your application may have used succesfully in the past.
#define AFX_IDW_DOCKBAR_TOP 0xE81B
#define AFX_IDW_DOCKBAR_LEFT 0xE81C
#define AFX_IDW_DOCKBAR_RIGHT 0xE81D
#define AFX_IDW_DOCKBAR_BOTTOM 0xE81E
#define AFX_IDW_DOCKBAR_FLOAT 0xE81F
// Macro for mapping standard control bars to bitmask (limit of 32)
#define AFX_CONTROLBAR_MASK(nIDC) (1L << (nIDC - AFX_IDW_CONTROLBAR_FIRST))
// parts of Main Frame
#define AFX_IDW_PANE_FIRST 0xE900 // first pane (256 max)
#define AFX_IDW_PANE_LAST 0xE9ff
#define AFX_IDW_HSCROLL_FIRST 0xEA00 // first Horz scrollbar (16 max)
#define AFX_IDW_VSCROLL_FIRST 0xEA10 // first Vert scrollbar (16 max)
#define AFX_IDW_SIZE_BOX 0xEA20 // size box for splitters
#define AFX_IDW_PANE_SAVE 0xEA21 // to shift AFX_IDW_PANE_FIRST
#endif //!RC_INVOKED
#ifndef APSTUDIO_INVOKED
// common style for form views
#define AFX_WS_DEFAULT_VIEW (WS_CHILD | WS_VISIBLE | WS_BORDER)
#endif //!APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Standard app configurable strings
// for application title (defaults to EXE name or name in constructor)
#define AFX_IDS_APP_TITLE 0xE000
// idle message bar line
#define AFX_IDS_IDLEMESSAGE 0xE001
// message bar line when in shift-F1 help mode
#define AFX_IDS_HELPMODEMESSAGE 0xE002
// document title when editing OLE embedding
#define AFX_IDS_APP_TITLE_EMBEDDING 0xE003
// company name
#define AFX_IDS_COMPANY_NAME 0xE004
// object name when server is inplace
#define AFX_IDS_OBJ_TITLE_INPLACE 0xE005
/////////////////////////////////////////////////////////////////////////////
// Standard Commands
// File commands
#define ID_FILE_NEW 0xE100
#define ID_FILE_OPEN 0xE101
#define ID_FILE_CLOSE 0xE102
#define ID_FILE_SAVE 0xE103
#define ID_FILE_SAVE_AS 0xE104
#define ID_FILE_PAGE_SETUP 0xE105
#define ID_FILE_PRINT_SETUP 0xE106
#define ID_FILE_PRINT 0xE107
#define ID_FILE_PRINT_DIRECT 0xE108
#define ID_FILE_PRINT_PREVIEW 0xE109
#define ID_FILE_UPDATE 0xE10A
#define ID_FILE_SAVE_COPY_AS 0xE10B
#define ID_FILE_SEND_MAIL 0xE10C
#define ID_FILE_MRU_FIRST 0xE110
#define ID_FILE_MRU_FILE1 0xE110 // range - 16 max
#define ID_FILE_MRU_FILE2 0xE111
#define ID_FILE_MRU_FILE3 0xE112
#define ID_FILE_MRU_FILE4 0xE113
#define ID_FILE_MRU_FILE5 0xE114
#define ID_FILE_MRU_FILE6 0xE115
#define ID_FILE_MRU_FILE7 0xE116
#define ID_FILE_MRU_FILE8 0xE117
#define ID_FILE_MRU_FILE9 0xE118
#define ID_FILE_MRU_FILE10 0xE119
#define ID_FILE_MRU_FILE11 0xE11A
#define ID_FILE_MRU_FILE12 0xE11B
#define ID_FILE_MRU_FILE13 0xE11C
#define ID_FILE_MRU_FILE14 0xE11D
#define ID_FILE_MRU_FILE15 0xE11E
#define ID_FILE_MRU_FILE16 0xE11F
#define ID_FILE_MRU_LAST 0xE11F
// Edit commands
#define ID_EDIT_CLEAR 0xE120
#define ID_EDIT_CLEAR_ALL 0xE121
#define ID_EDIT_COPY 0xE122
#define ID_EDIT_CUT 0xE123
#define ID_EDIT_FIND 0xE124
#define ID_EDIT_PASTE 0xE125
#define ID_EDIT_PASTE_LINK 0xE126
#define ID_EDIT_PASTE_SPECIAL 0xE127
#define ID_EDIT_REPEAT 0xE128
#define ID_EDIT_REPLACE 0xE129
#define ID_EDIT_SELECT_ALL 0xE12A
#define ID_EDIT_UNDO 0xE12B
#define ID_EDIT_REDO 0xE12C
// Window commands
#define ID_WINDOW_NEW 0xE130
#define ID_WINDOW_ARRANGE 0xE131
#define ID_WINDOW_CASCADE 0xE132
#define ID_WINDOW_TILE_HORZ 0xE133
#define ID_WINDOW_TILE_VERT 0xE134
#define ID_WINDOW_SPLIT 0xE135
#ifndef RC_INVOKED // code only
#define AFX_IDM_WINDOW_FIRST 0xE130
#define AFX_IDM_WINDOW_LAST 0xE13F
#define AFX_IDM_FIRST_MDICHILD 0xFF00 // window list starts here
#endif //!RC_INVOKED
// Help and App commands
#define ID_APP_ABOUT 0xE140
#define ID_APP_EXIT 0xE141
#define ID_HELP_INDEX 0xE142
#define ID_HELP_FINDER 0xE143
#define ID_HELP_USING 0xE144
#define ID_CONTEXT_HELP 0xE145 // shift-F1
// special commands for processing help
#define ID_HELP 0xE146 // first attempt for F1
#define ID_DEFAULT_HELP 0xE147 // last attempt
// Misc
#define ID_NEXT_PANE 0xE150
#define ID_PREV_PANE 0xE151
// Format
#define ID_FORMAT_FONT 0xE160
// OLE commands
#define ID_OLE_INSERT_NEW 0xE200
#define ID_OLE_EDIT_LINKS 0xE201
#define ID_OLE_EDIT_CONVERT 0xE202
#define ID_OLE_EDIT_CHANGE_ICON 0xE203
#define ID_OLE_EDIT_PROPERTIES 0xE204
#define ID_OLE_VERB_FIRST 0xE210 // range - 16 max
#ifndef RC_INVOKED // code only
#define ID_OLE_VERB_LAST 0xE21F
#endif //!RC_INVOKED
// for print preview dialog bar
#define AFX_ID_PREVIEW_CLOSE 0xE300
#define AFX_ID_PREVIEW_NUMPAGE 0xE301 // One/Two Page button
#define AFX_ID_PREVIEW_NEXT 0xE302
#define AFX_ID_PREVIEW_PREV 0xE303
#define AFX_ID_PREVIEW_PRINT 0xE304
#define AFX_ID_PREVIEW_ZOOMIN 0xE305
#define AFX_ID_PREVIEW_ZOOMOUT 0xE306
// View commands (same number used as IDW used for control bar)
#define ID_VIEW_TOOLBAR 0xE800
#define ID_VIEW_STATUS_BAR 0xE801
// -> E8FF reserved for other control bar commands
// RecordForm commands
#define ID_RECORD_FIRST 0xE900
#define ID_RECORD_LAST 0xE901
#define ID_RECORD_NEXT 0xE902
#define ID_RECORD_PREV 0xE903
/////////////////////////////////////////////////////////////////////////////
// Standard control IDs
#ifdef IDC_STATIC
#undef IDC_STATIC
#endif
#define IDC_STATIC (-1) // all static controls
/////////////////////////////////////////////////////////////////////////////
// Standard string error/warnings
#ifndef RC_INVOKED // code only
#define AFX_IDS_SCFIRST 0xEF00
#endif //!RC_INVOKED
#define AFX_IDS_SCSIZE 0xEF00
#define AFX_IDS_SCMOVE 0xEF01
#define AFX_IDS_SCMINIMIZE 0xEF02
#define AFX_IDS_SCMAXIMIZE 0xEF03
#define AFX_IDS_SCNEXTWINDOW 0xEF04
#define AFX_IDS_SCPREVWINDOW 0xEF05
#define AFX_IDS_SCCLOSE 0xEF06
#define AFX_IDS_SCRESTORE 0xEF12
#define AFX_IDS_SCTASKLIST 0xEF13
#define AFX_IDS_MDICHILD 0xEF1F
#define AFX_IDS_DESKACCESSORY 0xEFDA
// General strings
#define AFX_IDS_OPENFILE 0xF000
#define AFX_IDS_SAVEFILE 0xF001
#define AFX_IDS_ALLFILTER 0xF002
#define AFX_IDS_UNTITLED 0xF003
#define AFX_IDS_SAVEFILECOPY 0xF004
#define AFX_IDS_PREVIEW_CLOSE 0xF005
#define AFX_IDS_UNNAMED_FILE 0xF006
#ifdef _MAC
#define AFX_IDS_ABOUT 0xF010
#endif
#define AFX_IDS_HIDE 0xF011
// MFC Standard Exception Error messages
#define AFX_IDP_NO_ERROR_AVAILABLE 0xF020
#define AFX_IDS_NOT_SUPPORTED_EXCEPTION 0xF021
#define AFX_IDS_RESOURCE_EXCEPTION 0xF022
#define AFX_IDS_MEMORY_EXCEPTION 0xF023
#define AFX_IDS_USER_EXCEPTION 0xF024
// Printing and print preview strings
#define AFX_IDS_PRINTONPORT 0xF040
#define AFX_IDS_ONEPAGE 0xF041
#define AFX_IDS_TWOPAGE 0xF042
#define AFX_IDS_PRINTPAGENUM 0xF043
#define AFX_IDS_PREVIEWPAGEDESC 0xF044
#define AFX_IDS_PRINTDEFAULTEXT 0xF045
#define AFX_IDS_PRINTDEFAULT 0xF046
#define AFX_IDS_PRINTFILTER 0xF047
#define AFX_IDS_PRINTCAPTION 0xF048
#define AFX_IDS_PRINTTOFILE 0xF049
// OLE strings
#define AFX_IDS_OBJECT_MENUITEM 0xF080
#define AFX_IDS_EDIT_VERB 0xF081
#define AFX_IDS_ACTIVATE_VERB 0xF082
#define AFX_IDS_CHANGE_LINK 0xF083
#define AFX_IDS_AUTO 0xF084
#define AFX_IDS_MANUAL 0xF085
#define AFX_IDS_FROZEN 0xF086
#define AFX_IDS_ALL_FILES 0xF087
// dynamically changing menu items
#define AFX_IDS_SAVE_MENU 0xF088
#define AFX_IDS_UPDATE_MENU 0xF089
#define AFX_IDS_SAVE_AS_MENU 0xF08A
#define AFX_IDS_SAVE_COPY_AS_MENU 0xF08B
#define AFX_IDS_EXIT_MENU 0xF08C
#define AFX_IDS_UPDATING_ITEMS 0xF08D
// COlePasteSpecialDialog defines
#define AFX_IDS_METAFILE_FORMAT 0xF08E
#define AFX_IDS_DIB_FORMAT 0xF08F
#define AFX_IDS_BITMAP_FORMAT 0xF090
#define AFX_IDS_LINKSOURCE_FORMAT 0xF091
#define AFX_IDS_EMBED_FORMAT 0xF092
// other OLE utility strings
#define AFX_IDS_PASTELINKEDTYPE 0xF094
#define AFX_IDS_UNKNOWNTYPE 0xF095
#define AFX_IDS_RTF_FORMAT 0xF096
#define AFX_IDS_TEXT_FORMAT 0xF097
// OLE datatype format error strings
#define AFX_IDS_INVALID_CURRENCY 0xF098
#define AFX_IDS_INVALID_DATETIME 0xF099
#define AFX_IDS_INVALID_DATETIMESPAN 0xF09A
// General error / prompt strings
#define AFX_IDP_INVALID_FILENAME 0xF100
#define AFX_IDP_FAILED_TO_OPEN_DOC 0xF101
#define AFX_IDP_FAILED_TO_SAVE_DOC 0xF102
#define AFX_IDP_ASK_TO_SAVE 0xF103
#define AFX_IDP_FAILED_TO_CREATE_DOC 0xF104
#define AFX_IDP_FILE_TOO_LARGE 0xF105
#define AFX_IDP_FAILED_TO_START_PRINT 0xF106
#define AFX_IDP_FAILED_TO_LAUNCH_HELP 0xF107
#define AFX_IDP_INTERNAL_FAILURE 0xF108 // general failure
#define AFX_IDP_COMMAND_FAILURE 0xF109 // command failure
#define AFX_IDP_FAILED_MEMORY_ALLOC 0xF10A
// DDV parse errors
#define AFX_IDP_PARSE_INT 0xF110
#define AFX_IDP_PARSE_REAL 0xF111
#define AFX_IDP_PARSE_INT_RANGE 0xF112
#define AFX_IDP_PARSE_REAL_RANGE 0xF113
#define AFX_IDP_PARSE_STRING_SIZE 0xF114
#define AFX_IDP_PARSE_RADIO_BUTTON 0xF115
#define AFX_IDP_PARSE_BYTE 0xF116
#define AFX_IDP_PARSE_UINT 0xF117
#define AFX_IDP_PARSE_DATETIME 0xF118
#define AFX_IDP_PARSE_CURRENCY 0xF119
// CFile/CArchive error strings for user failure
#define AFX_IDP_FAILED_INVALID_FORMAT 0xF120
#define AFX_IDP_FAILED_INVALID_PATH 0xF121
#define AFX_IDP_FAILED_DISK_FULL 0xF122
#define AFX_IDP_FAILED_ACCESS_READ 0xF123
#define AFX_IDP_FAILED_ACCESS_WRITE 0xF124
#define AFX_IDP_FAILED_IO_ERROR_READ 0xF125
#define AFX_IDP_FAILED_IO_ERROR_WRITE 0xF126
// OLE errors / prompt strings
#define AFX_IDP_STATIC_OBJECT 0xF180
#define AFX_IDP_FAILED_TO_CONNECT 0xF181
#define AFX_IDP_SERVER_BUSY 0xF182
#define AFX_IDP_BAD_VERB 0xF183
#define AFX_IDP_FAILED_TO_NOTIFY 0xF185
#define AFX_IDP_FAILED_TO_LAUNCH 0xF186
#define AFX_IDP_ASK_TO_UPDATE 0xF187
#define AFX_IDP_FAILED_TO_UPDATE 0xF188
#define AFX_IDP_FAILED_TO_REGISTER 0xF189
#define AFX_IDP_FAILED_TO_AUTO_REGISTER 0xF18A
#define AFX_IDP_FAILED_TO_CONVERT 0xF18B
#define AFX_IDP_GET_NOT_SUPPORTED 0xF18C
#define AFX_IDP_SET_NOT_SUPPORTED 0xF18D
#define AFX_IDP_ASK_TO_DISCARD 0xF18E
#define AFX_IDP_FAILED_TO_CREATE 0xF18F
// MAPI errors / prompt strings
#define AFX_IDP_FAILED_MAPI_LOAD 0xF190
#define AFX_IDP_INVALID_MAPI_DLL 0xF191
#define AFX_IDP_FAILED_MAPI_SEND 0xF192
#define AFX_IDP_FILE_NONE 0xF1A0
#define AFX_IDP_FILE_GENERIC 0xF1A1
#define AFX_IDP_FILE_NOT_FOUND 0xF1A2
#define AFX_IDP_FILE_BAD_PATH 0xF1A3
#define AFX_IDP_FILE_TOO_MANY_OPEN 0xF1A4
#define AFX_IDP_FILE_ACCESS_DENIED 0xF1A5
#define AFX_IDP_FILE_INVALID_FILE 0xF1A6
#define AFX_IDP_FILE_REMOVE_CURRENT 0xF1A7
#define AFX_IDP_FILE_DIR_FULL 0xF1A8
#define AFX_IDP_FILE_BAD_SEEK 0xF1A9
#define AFX_IDP_FILE_HARD_IO 0xF1AA
#define AFX_IDP_FILE_SHARING 0xF1AB
#define AFX_IDP_FILE_LOCKING 0xF1AC
#define AFX_IDP_FILE_DISKFULL 0xF1AD
#define AFX_IDP_FILE_EOF 0xF1AE
#define AFX_IDP_ARCH_NONE 0xF1B0
#define AFX_IDP_ARCH_GENERIC 0xF1B1
#define AFX_IDP_ARCH_READONLY 0xF1B2
#define AFX_IDP_ARCH_ENDOFFILE 0xF1B3
#define AFX_IDP_ARCH_WRITEONLY 0xF1B4
#define AFX_IDP_ARCH_BADINDEX 0xF1B5
#define AFX_IDP_ARCH_BADCLASS 0xF1B6
#define AFX_IDP_ARCH_BADSCHEMA 0xF1B7
#define AFX_IDS_OCC_SCALEUNITS_PIXELS 0xF1C0
// 0xf200-0xf20f reserved
// font names and point sizes
#define AFX_IDS_STATUS_FONT 0xF230
#define AFX_IDS_TOOLTIP_FONT 0xF231
#define AFX_IDS_UNICODE_FONT 0xF232
#define AFX_IDS_MINI_FONT 0xF233
// ODBC Database errors / prompt strings
#ifndef RC_INVOKED // code only
#define AFX_IDP_SQL_FIRST 0xF280
#endif //!RC_INVOKED
#define AFX_IDP_SQL_CONNECT_FAIL 0xF281
#define AFX_IDP_SQL_RECORDSET_FORWARD_ONLY 0xF282
#define AFX_IDP_SQL_EMPTY_COLUMN_LIST 0xF283
#define AFX_IDP_SQL_FIELD_SCHEMA_MISMATCH 0xF284
#define AFX_IDP_SQL_ILLEGAL_MODE 0xF285
#define AFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED 0xF286
#define AFX_IDP_SQL_NO_CURRENT_RECORD 0xF287
#define AFX_IDP_SQL_NO_ROWS_AFFECTED 0xF288
#define AFX_IDP_SQL_RECORDSET_READONLY 0xF289
#define AFX_IDP_SQL_SQL_NO_TOTAL 0xF28A
#define AFX_IDP_SQL_ODBC_LOAD_FAILED 0xF28B
#define AFX_IDP_SQL_DYNASET_NOT_SUPPORTED 0xF28C
#define AFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED 0xF28D
#define AFX_IDP_SQL_API_CONFORMANCE 0xF28E
#define AFX_IDP_SQL_SQL_CONFORMANCE 0xF28F
#define AFX_IDP_SQL_NO_DATA_FOUND 0xF290
#define AFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED 0xF291
#define AFX_IDP_SQL_ODBC_V2_REQUIRED 0xF292
#define AFX_IDP_SQL_NO_POSITIONED_UPDATES 0xF293
#define AFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED 0xF294
#define AFX_IDP_SQL_DATA_TRUNCATED 0xF295
#define AFX_IDP_SQL_ROW_FETCH 0xF296
#define AFX_IDP_SQL_INCORRECT_ODBC 0xF297
#define AFX_IDP_SQL_UPDATE_DELETE_FAILED 0xF298
#define AFX_IDP_SQL_DYNAMIC_CURSOR_NOT_SUPPORTED 0xF299
// DAO Database errors / prompt strings
#ifndef RC_INVOKED // code only
#define AFX_IDP_DAO_FIRST 0xF2A0
#endif //!RC_INVOKED
#define AFX_IDP_DAO_ENGINE_INITIALIZATION 0xF2A0
#define AFX_IDP_DAO_DFX_BIND 0xF2A1
#define AFX_IDP_DAO_OBJECT_NOT_OPEN 0xF2A2
// ICDAORecordset::GetRows Errors
// These are not placed in DAO Errors collection
// and must be handled directly by MFC.
#define AFX_IDP_DAO_ROWTOOSHORT 0xF2A3
#define AFX_IDP_DAO_BADBINDINFO 0xF2A4
#define AFX_IDP_DAO_COLUMNUNAVAILABLE 0xF2A5
/////////////////////////////////////////////////////////////////////////////
// AFX implementation - control IDs (AFX_IDC)
// Parts of dialogs
#define AFX_IDC_LISTBOX 100
#define AFX_IDC_CHANGE 101
// for print dialog
#define AFX_IDC_PRINT_DOCNAME 201
#define AFX_IDC_PRINT_PRINTERNAME 202
#define AFX_IDC_PRINT_PORTNAME 203
#define AFX_IDC_PRINT_PAGENUM 204
// Property Sheet control id's (determined with Spy++)
#define ID_APPLY_NOW 0x3021
#define ID_WIZBACK 0x3023
#define ID_WIZNEXT 0x3024
#define ID_WIZFINISH 0x3025
#define AFX_IDC_TAB_CONTROL 0x3020
/////////////////////////////////////////////////////////////////////////////
// IDRs for standard components
#ifndef RC_INVOKED // code only
// These are really COMMDLG dialogs, so there usually isn't a resource
// for them, but these IDs are used as help IDs.
#define AFX_IDD_FILEOPEN 28676
#define AFX_IDD_FILESAVE 28677
#define AFX_IDD_FONT 28678
#define AFX_IDD_COLOR 28679
#define AFX_IDD_PRINT 28680
#define AFX_IDD_PRINTSETUP 28681
#define AFX_IDD_FIND 28682
#define AFX_IDD_REPLACE 28683
#endif //!RC_INVOKED
// Standard dialogs app should leave alone (0x7801->)
#define AFX_IDD_NEWTYPEDLG 30721
#define AFX_IDD_PRINTDLG 30722
#define AFX_IDD_PREVIEW_TOOLBAR 30723
#ifdef _MAC
#define AFX_IDD_PREVIEW_SHORTTOOLBAR 30731
#endif
// Dialogs defined for OLE2UI library
#define AFX_IDD_INSERTOBJECT 30724
#define AFX_IDD_CHANGEICON 30725
#define AFX_IDD_CONVERT 30726
#define AFX_IDD_PASTESPECIAL 30727
#define AFX_IDD_EDITLINKS 30728
#define AFX_IDD_FILEBROWSE 30729
#define AFX_IDD_BUSY 30730
#define AFX_IDD_OBJECTPROPERTIES 30732
#define AFX_IDD_CHANGESOURCE 30733
// Standard cursors (0x7901->)
// AFX_IDC = Cursor resources
#define AFX_IDC_CONTEXTHELP 30977 // context sensitive help
#define AFX_IDC_MAGNIFY 30978 // print preview zoom
#define AFX_IDC_SMALLARROWS 30979 // splitter
#define AFX_IDC_HSPLITBAR 30980 // splitter
#define AFX_IDC_VSPLITBAR 30981 // splitter
#define AFX_IDC_NODROPCRSR 30982 // No Drop Cursor
#define AFX_IDC_TRACKNWSE 30983 // tracker
#define AFX_IDC_TRACKNESW 30984 // tracker
#define AFX_IDC_TRACKNS 30985 // tracker
#define AFX_IDC_TRACKWE 30986 // tracker
#define AFX_IDC_TRACK4WAY 30987 // tracker
#define AFX_IDC_MOVE4WAY 30988 // resize bar (server only)
// Mini frame window bitmap ID
#define AFX_IDB_MINIFRAME_MENU 30994
// CheckListBox checks bitmap ID
#define AFX_IDB_CHECKLISTBOX_NT 30995
#define AFX_IDB_CHECKLISTBOX_95 30996
// AFX standard accelerator resources
#define AFX_IDR_PREVIEW_ACCEL 30997
// AFX standard ICON IDs (for MFC V1 apps) (0x7A01->)
#define AFX_IDI_STD_MDIFRAME 31233
#define AFX_IDI_STD_FRAME 31234
/////////////////////////////////////////////////////////////////////////////
// AFX OLE control implementation - control IDs (AFX_IDC)
// Font property page
#define AFX_IDC_FONTPROP 1000
#define AFX_IDC_FONTNAMES 1001
#define AFX_IDC_FONTSTYLES 1002
#define AFX_IDC_FONTSIZES 1003
#define AFX_IDC_STRIKEOUT 1004
#define AFX_IDC_UNDERLINE 1005
#define AFX_IDC_SAMPLEBOX 1006
// Color property page
#define AFX_IDC_COLOR_BLACK 1100
#define AFX_IDC_COLOR_WHITE 1101
#define AFX_IDC_COLOR_RED 1102
#define AFX_IDC_COLOR_GREEN 1103
#define AFX_IDC_COLOR_BLUE 1104
#define AFX_IDC_COLOR_YELLOW 1105
#define AFX_IDC_COLOR_MAGENTA 1106
#define AFX_IDC_COLOR_CYAN 1107
#define AFX_IDC_COLOR_GRAY 1108
#define AFX_IDC_COLOR_LIGHTGRAY 1109
#define AFX_IDC_COLOR_DARKRED 1110
#define AFX_IDC_COLOR_DARKGREEN 1111
#define AFX_IDC_COLOR_DARKBLUE 1112
#define AFX_IDC_COLOR_LIGHTBROWN 1113
#define AFX_IDC_COLOR_DARKMAGENTA 1114
#define AFX_IDC_COLOR_DARKCYAN 1115
#define AFX_IDC_COLORPROP 1116
#define AFX_IDC_SYSTEMCOLORS 1117
// Picture porperty page
#define AFX_IDC_PROPNAME 1201
#define AFX_IDC_PICTURE 1202
#define AFX_IDC_BROWSE 1203
#define AFX_IDC_CLEAR 1204
/////////////////////////////////////////////////////////////////////////////
// IDRs for OLE control standard components
// Standard propery page dialogs app should leave alone (0x7E01->)
#define AFX_IDD_PROPPAGE_COLOR 32257
#define AFX_IDD_PROPPAGE_FONT 32258
#define AFX_IDD_PROPPAGE_PICTURE 32259
#define AFX_IDB_TRUETYPE 32384
/////////////////////////////////////////////////////////////////////////////
// Standard OLE control strings
// OLE Control page strings
#define AFX_IDS_PROPPAGE_UNKNOWN 0xFE01
#define AFX_IDS_COLOR_DESKTOP 0xFE04
#define AFX_IDS_COLOR_APPWORKSPACE 0xFE05
#define AFX_IDS_COLOR_WNDBACKGND 0xFE06
#define AFX_IDS_COLOR_WNDTEXT 0xFE07
#define AFX_IDS_COLOR_MENUBAR 0xFE08
#define AFX_IDS_COLOR_MENUTEXT 0xFE09
#define AFX_IDS_COLOR_ACTIVEBAR 0xFE0A
#define AFX_IDS_COLOR_INACTIVEBAR 0xFE0B
#define AFX_IDS_COLOR_ACTIVETEXT 0xFE0C
#define AFX_IDS_COLOR_INACTIVETEXT 0xFE0D
#define AFX_IDS_COLOR_ACTIVEBORDER 0xFE0E
#define AFX_IDS_COLOR_INACTIVEBORDER 0xFE0F
#define AFX_IDS_COLOR_WNDFRAME 0xFE10
#define AFX_IDS_COLOR_SCROLLBARS 0xFE11
#define AFX_IDS_COLOR_BTNFACE 0xFE12
#define AFX_IDS_COLOR_BTNSHADOW 0xFE13
#define AFX_IDS_COLOR_BTNTEXT 0xFE14
#define AFX_IDS_COLOR_BTNHIGHLIGHT 0xFE15
#define AFX_IDS_COLOR_DISABLEDTEXT 0xFE16
#define AFX_IDS_COLOR_HIGHLIGHT 0xFE17
#define AFX_IDS_COLOR_HIGHLIGHTTEXT 0xFE18
#define AFX_IDS_REGULAR 0xFE19
#define AFX_IDS_BOLD 0xFE1A
#define AFX_IDS_ITALIC 0xFE1B
#define AFX_IDS_BOLDITALIC 0xFE1C
#define AFX_IDS_SAMPLETEXT 0xFE1D
#define AFX_IDS_DISPLAYSTRING_FONT 0xFE1E
#define AFX_IDS_DISPLAYSTRING_COLOR 0xFE1F
#define AFX_IDS_DISPLAYSTRING_PICTURE 0xFE20
#define AFX_IDS_PICTUREFILTER 0xFE21
#define AFX_IDS_PICTYPE_UNKNOWN 0xFE22
#define AFX_IDS_PICTYPE_NONE 0xFE23
#define AFX_IDS_PICTYPE_BITMAP 0xFE24
#define AFX_IDS_PICTYPE_METAFILE 0xFE25
#define AFX_IDS_PICTYPE_ICON 0xFE26
#define AFX_IDS_COLOR_PPG 0xFE28
#define AFX_IDS_COLOR_PPG_CAPTION 0xFE29
#define AFX_IDS_FONT_PPG 0xFE2A
#define AFX_IDS_FONT_PPG_CAPTION 0xFE2B
#define AFX_IDS_PICTURE_PPG 0xFE2C
#define AFX_IDS_PICTURE_PPG_CAPTION 0xFE2D
#define AFX_IDS_PICTUREBROWSETITLE 0xFE30
#define AFX_IDS_BORDERSTYLE_0 0xFE31
#define AFX_IDS_BORDERSTYLE_1 0xFE32
// OLE Control verb names
#define AFX_IDS_VERB_EDIT 0xFE40
#define AFX_IDS_VERB_PROPERTIES 0xFE41
// OLE Control internal error messages
#define AFX_IDP_PICTURECANTOPEN 0xFE83
#define AFX_IDP_PICTURECANTLOAD 0xFE84
#define AFX_IDP_PICTURETOOLARGE 0xFE85
#define AFX_IDP_PICTUREREADFAILED 0xFE86
// Standard OLE Control error strings
#define AFX_IDP_E_ILLEGALFUNCTIONCALL 0xFEA0
#define AFX_IDP_E_OVERFLOW 0xFEA1
#define AFX_IDP_E_OUTOFMEMORY 0xFEA2
#define AFX_IDP_E_DIVISIONBYZERO 0xFEA3
#define AFX_IDP_E_OUTOFSTRINGSPACE 0xFEA4
#define AFX_IDP_E_OUTOFSTACKSPACE 0xFEA5
#define AFX_IDP_E_BADFILENAMEORNUMBER 0xFEA6
#define AFX_IDP_E_FILENOTFOUND 0xFEA7
#define AFX_IDP_E_BADFILEMODE 0xFEA8
#define AFX_IDP_E_FILEALREADYOPEN 0xFEA9
#define AFX_IDP_E_DEVICEIOERROR 0xFEAA
#define AFX_IDP_E_FILEALREADYEXISTS 0xFEAB
#define AFX_IDP_E_BADRECORDLENGTH 0xFEAC
#define AFX_IDP_E_DISKFULL 0xFEAD
#define AFX_IDP_E_BADRECORDNUMBER 0xFEAE
#define AFX_IDP_E_BADFILENAME 0xFEAF
#define AFX_IDP_E_TOOMANYFILES 0xFEB0
#define AFX_IDP_E_DEVICEUNAVAILABLE 0xFEB1
#define AFX_IDP_E_PERMISSIONDENIED 0xFEB2
#define AFX_IDP_E_DISKNOTREADY 0xFEB3
#define AFX_IDP_E_PATHFILEACCESSERROR 0xFEB4
#define AFX_IDP_E_PATHNOTFOUND 0xFEB5
#define AFX_IDP_E_INVALIDPATTERNSTRING 0xFEB6
#define AFX_IDP_E_INVALIDUSEOFNULL 0xFEB7
#define AFX_IDP_E_INVALIDFILEFORMAT 0xFEB8
#define AFX_IDP_E_INVALIDPROPERTYVALUE 0xFEB9
#define AFX_IDP_E_INVALIDPROPERTYARRAYINDEX 0xFEBA
#define AFX_IDP_E_SETNOTSUPPORTEDATRUNTIME 0xFEBB
#define AFX_IDP_E_SETNOTSUPPORTED 0xFEBC
#define AFX_IDP_E_NEEDPROPERTYARRAYINDEX 0xFEBD
#define AFX_IDP_E_SETNOTPERMITTED 0xFEBE
#define AFX_IDP_E_GETNOTSUPPORTEDATRUNTIME 0xFEBF
#define AFX_IDP_E_GETNOTSUPPORTED 0xFEC0
#define AFX_IDP_E_PROPERTYNOTFOUND 0xFEC1
#define AFX_IDP_E_INVALIDCLIPBOARDFORMAT 0xFEC2
#define AFX_IDP_E_INVALIDPICTURE 0xFEC3
#define AFX_IDP_E_PRINTERERROR 0xFEC4
#define AFX_IDP_E_CANTSAVEFILETOTEMP 0xFEC5
#define AFX_IDP_E_SEARCHTEXTNOTFOUND 0xFEC6
#define AFX_IDP_E_REPLACEMENTSTOOLONG 0xFEC7
#ifdef _AFX_MINREBUILD
#pragma component(minrebuild, on)
#endif
#endif //__AFXRES_H__
/////////////////////////////////////////////////////////////////////////////

@ -0,0 +1,75 @@
//
// Standard __except handler to dump stack and code around eip
//
__except(memcpy(&exinfo, GetExceptionInformation(), sizeof(struct _EXCEPTION_POINTERS)), EXCEPTION_EXECUTE_HANDLER)
{
unsigned __int32 SPPtr = 0;
unsigned __int32 SPVal = 0;
unsigned __int32 eip = 0;
unsigned __int32 rev = 0;
int i;
DWORD Stack[16];
DWORD CodeDump[16];
#ifndef BPQ64
eip = exinfo.ContextRecord->Eip;
SPPtr = exinfo.ContextRecord->Esp;
__asm
{
mov eax, SPPtr
mov SPVal,eax
lea edi,Stack
mov esi,eax
mov ecx,64
rep movsb
lea edi,CodeDump
mov esi,eip
mov ecx,64
rep movsb
}
Debugprintf("BPQ32 *** Program Error %x at %x in %s",
exinfo.ExceptionRecord->ExceptionCode, exinfo.ExceptionRecord->ExceptionAddress, EXCEPTMSG);
Debugprintf("EAX %x EBX %x ECX %x EDX %x ESI %x EDI %x ESP %x",
exinfo.ContextRecord->Eax, exinfo.ContextRecord->Ebx, exinfo.ContextRecord->Ecx,
exinfo.ContextRecord->Edx, exinfo.ContextRecord->Esi, exinfo.ContextRecord->Edi, SPVal);
#endif
Debugprintf("Stack:");
Debugprintf("%08x %08x %08x %08x %08x %08x %08x %08x %08x ",
SPVal, Stack[0], Stack[1], Stack[2], Stack[3], Stack[4], Stack[5], Stack[6], Stack[7]);
Debugprintf("%08x %08x %08x %08x %08x %08x %08x %08x %08x ",
SPVal+32, Stack[8], Stack[9], Stack[10], Stack[11], Stack[12], Stack[13], Stack[14], Stack[15]);
Debugprintf("Code:");
for (i = 0; i < 16; i++)
{
rev = (CodeDump[i] & 0xff) << 24;
rev |= (CodeDump[i] & 0xff00) << 8;
rev |= (CodeDump[i] & 0xff0000) >> 8;
rev |= (CodeDump[i] & 0xff000000) >> 24;
CodeDump[i] = rev;
}
Debugprintf("%08x %08x %08x %08x %08x %08x %08x %08x %08x ",
eip, CodeDump[0], CodeDump[1], CodeDump[2], CodeDump[3], CodeDump[4], CodeDump[5], CodeDump[6], CodeDump[7]);
Debugprintf("%08x %08x %08x %08x %08x %08x %08x %08x %08x ",
eip+32, CodeDump[8], CodeDump[9], CodeDump[10], CodeDump[11], CodeDump[12], CodeDump[13], CodeDump[14], CodeDump[15]);
// Note - no closing } so additional code may be run in the __except block
#undef EXCEPTMSG

@ -0,0 +1,572 @@
EXCLUDEBITS EQU 0 ; INCLUDE ExcludeList SUPPORT
TNCBUFFLEN EQU 400h
BPQHOSTSTREAMS EQU 64
;BUFFLEN EQU 400 ; ??
MAXAPPLS EQU 32 ; Max Application Commands
ApplOffset EQU 80000 ; Applications string in buffer
C_INFOMSG EQU 85000 ; Info Msg in buffer
ApplStringLen EQU 48 ; Length of each config entry
ALIASLEN EQU 32 ; Max chars in command alias
MHENTRIES EQU 30 ; Entries in MH List
;
; BUFFLEN-4 = L2 POINTER (FOR CLEARING TIMEOUT WHEN ACKMODE USED)
; BUFFLEN-8 = TIMESTAMP
; BUFFLEN-12 = BUFFER ALLOCATED FLAG (ADDR OF ALLOCATING ROUTINE)
;MAXDATA EQU BUFFLEN-16
MAXDIGIS EQU 8
;
; BPQHOST MODE VECTOR STRUC
;
BPQVECSTRUC STRUC
HOSTSESSION DD 0
HOSTFLAGS DB 0 ; ALLOCATED AND STATE CHANGE FLAGS
HOSTAPPLMASK DD 0
HOSTAPPLFLAGS DB 0
HOSTSTREAM DB 0 ; STREAM NUMBER
HOSTTRACEQ DD 0
HOSTHANDLE DD 0 ; HANDLE FOR POSTING MSGS TO
HOSTAPPLNUM DD 0 ; Application Number
STREAMOWNER DD 0 ; PID of Process owning stream
HOSTPGMNAME DB 32 dup (0);
BPQVECSTRUC ENDS
; HOSTFLAGS = Bit 80 = Allocated
; Bit 40 = Disc Request
; Bit 20 = Stay Flag
; Bit 02 and 01 State Change Bits
VECTORLENGTH EQU TYPE BPQVECSTRUC
;
; BASIC LINK LEVEL MESSAGE BUFFER LAYOUT
;
MESSAGE STRUC
MSGCHAIN DD ? ; CHAIN WORD
MSGPORT DB ? ; PORT
MSGLENGTH DW ? ; LENGTH
MSGDEST DB 7 DUP (?) ; DESTINATION
MSGORIGIN DB 7 DUP (?) ; ORIGIN
;
; MAY BE UP TO 56 BYTES OF DIGIS
;
MSGCONTROL DB ? ; CONTROL BYTE
MSGPID DB ? ; PROTOCOL IDENTIFIER
MSGDATA DB ? ; START OF LEVEL 2 MESSAGE
;
MESSAGE ENDS
;
L3MESSAGE STRUC
;
; NETROM LEVEL 3 MESSAGE - WITHOUT L2 INFO
;
L3HEADER DB 7 DUP (?) ; CHAIN, PORT, LENGTH
L3PID DB ? ; PID
L3SRCE DB 7 DUP (?) ; ORIGIN NODE
L3DEST DB 7 DUP (?) ; DEST NODE
L3MONR DB ? ; TX MONITOR FIELD - TO PREVENT MESSAGE GOING
; ROUND THE NETWORK FOR EVER DUE TO ROUTING LOOP
;
; NETROM LEVEL 4 DATA
;
L4INDEX DB ? ; TRANSPORT SESSION INDEX
L4ID DB ? ; TRANSPORT SESSION ID
L4TXNO DB ? ; TRANSMIT SEQUENCE NUMBER
L4RXNO DB ? ; RECEIVE (ACK) SEQ NUMBER
L4FLAGS DB ? ; FRAGMENTATION, ACK/NAK, FLOW CONTROL AND MSG TYPE BITS
L4DATA DB ? ; DATA
L4CALLS DB 14 DUP (?) ; CALLS IN CONNECT REQUEST
L4_BPQ DB ? ; THENODE EXTENDED CONNECT PARAMS
L3MESSAGE ENDS
;
; L4FLAGS DEFINITION
;
L4BUSY EQU 80H ; BNA - DONT SEND ANY MORE
L4NAK EQU 40H ; NEGATIVE RESPONSE FLAG
L4MORE EQU 20H ; MORE DATA FOLLOWS - FRAGMENTATION FLAG
L4CREQ EQU 1 ; CONNECT REQUEST
L4CACK EQU 2 ; CONNECT ACK
L4DREQ EQU 3 ; DISCONNECT REQUEST
L4DACK EQU 4 ; DISCONNECT ACK
L4INFO EQU 5 ; INFORMATION
L4IACK EQU 6 ; INFORMATION ACK
;
; PORT CONTROL TABLE
;
PORTCONTROL STRUC
PORTCALL DB 7 DUP (0)
PORTALIAS DB 7 DUP (0) ; USED FOR UPLINKS ONLY
PORTNUMBER DB ?
PORTPOINTER DD ? ; NEXT IN CHAIN
PORTQUALITY DB ? ; 'STANDARD' QUALITY FOR THIS PORT
PORTRX_Q DD ? ; FRAMES RECEIVED ON THIS PORT
PORTTX_Q DD ? ; FRAMES TO BE SENT ON THIS PORT
PORTTXROUTINE DD ? ; POINTER TO TRANSMIT ROUTINE FOR THIS PORT
PORTRXROUTINE DD ? ; POINTER TO RECEIVE ROUTINE FOR THIS PORT
PORTINITCODE DD ? ; INITIALISATION ROUTINE
PORTTIMERCODE DD ?
PORTCLOSECODE DD ?
PORTTXCHECK DD ? ; OK to Send Check
PORTDESCRIPTION DB 30 DUP (0) ; TEXT DESCRIPTION OF FREQ/SPEED ETC
PORTBBSFLAG DB ? ; NZ MEANS PORT CALL/ALIAS ARE FOR BBS
PORTL3FLAG DB ? ; NZ RESTRICTS OUTGOING L2 CONNECTS
;
; CWID FIELDS
;
CWID DW 9 DUP (0) ; 8 ELEMENTS + FLAG
ELEMENT DW ? ; REMAINING BITS OF CURRENT CHAR
CWPOINTER DD ? ; POINTER TO NEXT CHAR
CWIDTIMER DW ? ; TIME TO NEXT ID
CWSTATE DB ? ; STATE MACHINE FOR CWID
CWTYPE DB ? ; SET TO USE ON/OFF KEYING INSTEAD OF
; FSK (FOR RUH MODEMS)
PORTMINQUAL DB ? ; MIN QUAL TO BRAOCAST ON THIS PORT
; STATS COUNTERS
;
L2DIGIED DD ?
L2FRAMES DD ?
L2FRAMESFORUS DD ?
L2FRAMESSENT DD ?
L2TIMEOUTS DD ?
L2ORUNC DD ? ; OVERRUNS
L2URUNC DD ? ; UNDERRUNS
L1DISCARD DD ? ; FRAMES DISCARDED (UNABLE TO TX DUE TO DCD)
L2FRMRRX DD ?
L2FRMRTX DD ?
RXERRORS DD ? ; RECEIVE ERRORS
L2REJCOUNT DD ? ; REJ FRAMES RECEIVED
L2OUTOFSEQ DD ? ; FRAMES RECEIVED OUT OF SEQUENCE
L2RESEQ DD ? ; FRAMES RESEQUENCED
SENDING DW 0 ; LINK STATUS BITS
ACTIVE DW 0
AVSENDING DB 0 ; LAST MINUTE
AVACTIVE DB 0
PORTTYPE DB 0 ; H/W TYPE
; 0 = ASYNC, 2 = PC120, 4 = DRSI
; 6 = TOSH, 8 = QUAD, 10 = RLC100
; 12 = RLC400 14 = INTERNAL 16 = EXTERNAL ; 18 = i2c
PROTOCOL DB 0 ; PORT PROTOCOL
; 0 = KISS, 2 = NETROM, 4 = BPQKISS
; 6 = HDLC, 8 = L2, 10 = PACTOR
IOBASE DW ? ; CONFIG PARAMS FOR HARDWARE DRIVERS
INTLEVEL DB ? ; FIRST 4 SAME FOR ALL H/W TYPES
BAUDRATE DD ? ; SPEED
CHANNELNUM DB ? ; ON MULTICHANNEL H/W
INTCHAIN DD ? ; POINTER TO NEXT PORT USING THIS LEVEL
PORTWINDOW DB ? ; L2 WINDOW FOR THIS PORT
PORTTXDELAY DW ? ; TX DELAY FOR THIS PORT
PORTPERSISTANCE DB ? ; PERSISTANCE VALUE FOR THIS PORT
FULLDUPLEX DB ? ; FULL DUPLEX IF SET
SOFTDCDFLAG DB ? ; IF SET USE 'SOFT DCD' - IF MODEM CANT GIVE A REAL ONE
PORTSLOTTIME DB ? ; SLOT TIME
PORTTAILTIME DB ? ; TAIL TIME
BBSBANNED DB ? ; SET IF PORT CAN'T ACCEPT L2 CALLS TO BBS CALLSIGN
PORTT1 DB ? ; L2 TIMEOUT
PORTT2 DB ? ; L2 DELAYED ACK TIMER
PORTN2 DB ? ; RETRIES
PORTPACLEN DB ? ; DEFAULT PACLEN FOR INCOMING SESSIONS
PORTINTERRUPT DD ? ; ADDRESS OF INTERRUPT HANDLER
QUAL_ADJUST DB ? ; % REDUCTION IN QUALITY IF ON SAME PORT
PERMITTEDCALLS DD ? ; POINTER TO PERMITED CALLS LIST
PORTUNPROTO DD ? ; POINTER TO UI DEST AND DIGI LIST
PORTDISABLED DB 0 ; PORT TX DISABLE FLAG
DIGIFLAG DB 0 ; ENABLE/DISABLE/UI ONLY
DIGIPORT DB 0 ; CROSSBAND DIGI PORT
DIGIMASK DW 0 ; CROSSBAND DIGI MASK
USERS DB 0 ; MAX USERS ON PORT
KISSFLAGS DB 0 ; KISS SPECIAL MODE BITS
PORTINTERLOCK DB 0 ; TO DEFINE PORTS WHICH CANT TX AT SAME TIME
NODESPACLEN DB 0 ; MAX LENGTH OF 'NODES' MSG
TXPORT DB 0 ; PORT FOR SHARED TX OPERATION
PORTMHEARD DD 0 ; POINTER TO MH DATA
PARAMTIMER DW 0 ; MOVED FROM HW DATA FOR SYSOPH
PORTMAXDIGIS DB 0 ; DIGIS ALLOWED ON THIS PORT
PORTALIAS2 DB 7 DUP (0) ; 2ND ALIAS FOR DIGIPEATING FOR APRS
PORTBCALL DB 7 DUP (0) ; Source for Beacons
PortNoKeepAlive DB 0; ; Default to No Keepalives
PortUIOnly DB 0;
UICAPABLE DB 0; ; Pactor-style port that can do UI
WL2K DB 189 DUP (0) ; WL2K Report Data
PORTIPADDR DD 0;
SerialPortName DD 0 ; Serial Port Name for Unix
XDIGIS DD 0; ; Cross Port Digi Definitions
NormalizeQuality DD 0 ; Normalise Node Qualities
IgnoreUnlocked DD 0 ; Ignore Unlocked Routes
HARDWAREDATA DB 200 DUP (?) ; WORK AREA FOR HARDWARE DRIVERS
PORTCONTROL ENDS
;
; DEFINE MAPPING FOR EXTERNAL DRIVER
;
EXTDATA STRUC
DB HARDWAREDATA DUP (0) ; REMAP HARDWARE INFO
PORT_EXT_ADDR DD ? ; ADDR OF RESIDENT ROUTINE
PORT_DLL_NAME DB 16 DUP (0);
EXTRESTART DB ? ; FLAG FOR DRIVER REINIT
DLLHANDLE DD ?
MAXHOSTMODESESSIONS DD ? ; Max Host Sessions supported (Used for KAM Pactor + ax.25 support)
ATTACHEDSESSIONS DD 27 DUP (0); Owning Sessions for PACTOR, etc
PERMITGATEWAY DD 0 ; Set if ax.25 ports can change callsign (ie SCS, not KAM
SCANCAPABILITIES DD 0 ; Type of scan control Controller supports (None, Simple, Connect Lock)
UI_Q DD 0 ; Unproto Frames for Session Mode Drivers (TRK, etc)
EXTDATA ENDS
IF TYPE EXTDATA GT TYPE PORTCONTROL
.ERR2 TOO MUCH PORT DATA
ENDIF
EXTERNAL EQU 16
L2 EQU 8
;
; CW STATE MACHINE EQUATES
;
dot equ 1b
dash equ 10b
dotspace equ 100b
letterspace equ 1000b
IDPENDING EQU 10000B
;
; LEVEL 2 LINK CONTROL TABLE
;
LINKTABLE STRUC
LINKCALL DB 7 DUP (?) ; CALLSIGN OF STATION
OURCALL DB 7 DUP (?) ; CALLSIGN OF OUR END
DIGIS DB MAXDIGIS*7 DUP (?) ; LEVEL 2 DIGIS IN PATH
LINKPORT DD ? ; PORT POINTER
LINKTYPE DB ? ; 1 = UP, 2= DOWN, 3 = INTERNODE
LINKNR DB ?
LINKNS DB ? ; LEV 2 SEQUENCE COUNTS
LINKWS DB ? ; WINDOW START
LINKOWS DB ? ; OLD (LAST ACKED) WINDOW START
LINKWINDOW DB ? ; LEVEL 2 WINDOW SIZE
L2FLAGS DB ? ; CONTROL BITS
VER1FLAG DB ? ; SET IF OTHER END RUNNING VERSION 1
RX_Q DD ? ; PACKETS RECEIVED ON THIS LINK
TX_Q DD ? ; PACKETS TO SEND
FRAMES DD 8 DUP (?) ; FRAMES WAITING ACK
RXFRAMES DD 8 DUP (?) ; Frames received out of sequence
L2STATE DB ? ; PROCESSING STATE
L2TIMER DW ? ; FRAME RETRY TIMER
L2TIME DB ? ; RETRY TIMER INITIAL VALUE
L2SLOTIM DW ? ; DELAY FOR LINK VALIDATION POLL
L2ACKREQ DB ? ; DELAYED TEXT ACK TIMER
REJTIMER DB ? ; TO TIME OUT REJ IN VERSION 1
LAST_F_TIME DW ? ; TIME LAST R(F) SENT
SDREJF DB ? ; FLAGS FOR FRMR
SDRBYTE DB ? ; SAVED CONTROL BYTE FOR FRMR
SDTSLOT DB ? ; POINTER TO NEXT TXSLOT TO USE
L2RETRIES DB ? ; RETRY COUNTER
SESSACTIVE DB ? ; SET WHEN WE ARE SURE SESSION IS UP
KILLTIMER DW ? ; TIME TO KILL IDLE LINK
CIRCUITPOINTER DD ? ; POINTER TO L4 CIRCUIT TABLE ENTRY
; (IF UP/DOWN)
NEIGHBOUR DD ? ; POINTER TO NEIGHBOUR (IF CROSSLINK)
L2FRAG_Q DD ? ; DEFRAGMENTATION QUEUE
LINKTABLE ENDS
;
; L2FLAGS EQUATES
;
REJSENT EQU 1B ; SET WHEN FIRST REJ IS SENT IN REPLY
; TO AN I(P)
RNRSET EQU 10B ; RNR RECEIVED FROM OTHER END
;DISCPENDING EQU 1000B ; SEND DISC WHEN ALL DATA ACK'ED
RNRSENT EQU 10000B ; WE HAVE SEND RNR
POLLSENT EQU 100000B ; POLL BIT OUTSTANDING
;
; FRMR REJECT FLAGS
;
SDINVC EQU 1B ; INVALID COMMAND
SDNRER EQU 1000B ; INVALID N(R)
TRANSPORTENTRY STRUC
L4USER DB 7 DUP (?) ; CALL OF ORIGINATING USER
L4TARGET DD ? ; POINTER TO TARGET LINK/DEST
L4MYCALL DB 7 DUP (0) ; CALL WE ARE USING
CIRCUITINDEX DB ? ; OUR CIRCUIT INFO
CIRCUITID DB ?
FARINDEX DB ?
FARID DB ? ; OTHER END'S INFO
L4WINDOW DB ? ; WINDOW SIZE
L4WS DB ? ; WINDOW START - NEXT FRAME TO ACK
TXSEQNO DB ?
RXSEQNO DB ? ; TRANSPORT LEVEL SEQUENCE INFO
L4LASTACKED DB ? ; LAST SEQUENCE ACKED
FLAGS DB ? ; TRANSPORT LEVEL FLAGS
NAKBITS DB ? ; NAK & CHOKE BITS TO BE SENT
L4CROSSLINK DD ? ; POINTER TO LINKED L4 SESSION ENTRY
L4CIRCUITTYPE DB ? ; BIT SIGNIFICANT - SEE BELOW
KAMSESSION DB ? ; Session Number on KAM Host Mode TNC
L4TX_Q DD ?
L4RX_Q DD ?
L4HOLD_Q DD ? ; FRAMES WAITING TO BE ACKED
L4RESEQ_Q DD ? ; FRAMES RECEIVED OUT OF SEQUENCE
L4STATE DB ?
L4TIMER DW ?
L4ACKREQ DB ? ; DATA ACK NEEDED
L4RETRIES DB ? ; RETRY COUNTER
L4KILLTIMER DW 0 ; IDLE CIRCUIT TIMER
SESSIONT1 DW 0 ; TIMEOUT FOR SESSIONS FROM HERE
SESSPACLEN DB 0 ; PACLEN FOR THIS SESSION
BADCOMMANDS DB 0 ; SUCCESSIVE BAD COMMANDS
STAYFLAG DB 0 ; STAY CONNECTED FLAG
SPYFLAG DB 0 ; SPY - CONNECT TO NODE VIA BBS CALLSIGN
RTT_SEQ DB 0 ; SEQUENCE NUMBER BEING TIMED
RTT_TIMER DD 0 ; TIME ABOVE SEQUENCE WAS SENT
PASSWORD DW 0 ; AUTHORISATION CODE FOR REMOTE SYSOP
;
SESS_APPLFLAGS DB 0 ; APPL FLAGS FOR THIS SESSION
Authorised_Session DB 0; // Set if Host session from BPQTerminal or BPQMailChat
DUMPPTR DD 0 ; POINTER FOR REMOTE DUMP MODE
PARTCMDBUFFER DD 0 ; Save area for incomplete commmand
Frequency DD 0 ; If known - for CMS Reporting Hz
RMSCall DB 10 DUP (0);
Mode DB 0 ; ditto
UNPROTO DD 0 ; Unproto Mode flag - port number if in unproto mode
UAddrLen DD 0 ;
UADDRESS DB 64 DUP (0); Unproto Address String - Dest + Digis
LISTEN DD 0 ; Listen Mode flag - port number of Listen Mode
APPL DB 16 DUP (0); Set if session initiated by an APPL
L4LIMIT dd 0 ; Idle Timout for this session
TRANSPORTENTRY ENDS
;
; CIRCUITTYPE EQUATES
;
L2LINK EQU 1
SESSION EQU 10B
UPLINK EQU 100B
DOWNLINK EQU 1000B
BPQHOST EQU 100000B
PACTOR EQU 1000000B
;
; FLAGS EQUATES
;
DISCPENDING EQU 1000B ; SEND DISC WHEN ALL DATA ACK'ED
;
; TOP 4 BITS MATCH L4FLAGS BITS - ALSO USED FOR NAKBITS
;
;L4BUSY EQU 80H ; BNA - DONT SEND ANY MORE
;L4NAK EQU 40H ; NEGATIVE RESPONSE FLAG
;L4MORE EQU 20H ; MORE DATA FOLLOWS - FRAGMENTATION FLAG
DEST_LIST STRUC
DEST_CHAIN DD ? ; SORTED LIST CHAIN
DEST_CALL DB 7 DUP (?) ; DESTINATION CALLSIGN (AX25 FORMAT)
DEST_ALIAS DB 6 DUP (?)
DEST_STATE DB ? ; CONTROL BITS - SETTING UP, ACTIVE ETC
DEST_ROUTE DB ? ; CURRENTY ACTIVE DESTINATION
INP3FLAGS DB ?
ROUT1_NEIGHBOUR DD ? ; POINTER TO NEXT NODE IN PATH
ROUT1_QUALITY DB ? ; QUALITY
ROUT1_OBSCOUNT DB ?
db 5 dup (?); Padding
ROUT2_NEIGHBOUR DD ?
ROUT2_QUALITY DB ?
ROUT2_OBSCOUNT DB ?
db 5 dup (?); Padding
ROUT3_NEIGHBOUR DD ?
ROUT3_QUALITY DB ?
ROUT3_OBSCOUNT DB ?
db 5 dup (?); Padding
INPROUT1_NEIGHBOUR DD ?
LastRTT1 DW ?; // Last Value Reported
RTT1 DW ?; // Current
SRTT1 DW ?; // Smoothed RTT
Hops1 DB ?;
INPROUT2_NEIGHBOUR DD ?
LastRTT2 DW ?; // Last Value Reported
RTT2 DW ?; // Current
SRTT2 DW ?; // Smoothed RTT
Hops2 DB ?;
INPROUT3_NEIGHBOUR DD ?
LastRTT3 DW ?; // Last Value Reported
RTT3 DW ?; // Current
SRTT3 DW ?; // Smoothed RTT
Hops3 DB ?;
DEST_Q DD ? ; QUEUE OF FRAMES FOR THIS DESTINATION
DEST_RTT DD ? ; SMOOTHED ROUND TRIP TIMER
DEST_COUNT DD ? ; FRAMES SENT
DEST_LIST ENDS
;
; MODEFLAG DEFINITIONS
;
COMMAND EQU 1B
TRANS EQU 10B
CONV EQU 100B
;
; APPL DEFINITIONS
;
BBSAPPL EQU 1B
HOSTAPPL EQU 10B
SYSOPAPPL EQU 100B
;
; HOSTFLAG DEFINITIONS
;
;HOSTMODE EQU 1B ; PK232 HOSTMODE ENABLED
;HOSTESCBIT EQU 10B ; IN ESCAPE SEQUENCE
;UFQ EQU 100B ; UFQ MODE (IE NOT AA4RE)
;POLLED EQU 1000B ; POLL RECEIVED
;KISSMODE EQU 10000B ; KISS MODE
;KISSESC EQU 100000B ; IN ESCAPE SEQUENCE
;
; APPLFLAGS BITS
;
CMD_TO_APPL EQU 1B ; PASS COMMAND TO APPLICATION
MSG_TO_USER EQU 10B ; SEND 'CONNECTED' TO USER
MSG_TO_APPL EQU 100B ; SEND 'CONECTED' TO APPL
;
; HDLC COMMANDS (WITHOUT P/F)
;
UI EQU 3
SABM EQU 2FH
DISC EQU 43H
DM EQU 0FH
UA EQU 63H
FRMR EQU 87H
RR EQU 1
RNR EQU 5
REJ EQU 9
;
PFBIT EQU 10H ; POLL/FINAL BIT IN CONTROL BYTE
;
; MH DATA AREA
;
;MHSTRUC STRUC
;MHCALL DB 7 DUP (0)
;MHTIME DD 0 ; ? FROM BIOS
;MHDIGI DB 0
;MHFreq DB 12 DUP (0)
;MHLocator DB 6 DUP (0)
;MHSTRUC ENDS
; Application Calls/Alias Supports multiple L4 application calls
APPLCALLS STRUC
APPLCALL DB 7 DUP (0) ; ax.25
APPLALIAS_TEXT DB 10 DUP (0) ; TEXT, WITH APPENDED SPACE
APPLCALL_TEXT DB 10 DUP (0)
APPLALIAS DB 6 DUP (0)
APFiller DB 0
APPLQUAL DW 0
APPNODEPOINTER DD 0 ; Pointer to "NODES" entry for this App (if L4)
APPLCMDNAME DB 13 DUP (0) ; Command to invoke this APPL
APPLHASALIAS DD 0
APPLPORT DD 0 ; Port if Appl has an alias
APPLALIASPTR DD 0 ; Pointer to Alias if defined
APPLCALLS ENDS
; New Style APPL configuration
APPLCONFIG STRUC
ACCommand DB 12 DUP (0);
ACCommandAlias DB 48 DUP (0);
ACApplCall DB 10 DUP (0);
ACApplAlias DB 10 DUP (0);
ACApplQual DD 0
APPLCONFIG ENDS
;
; HARDWARE TYPE EQUATES
;
KISS EQU 0
PC120 EQU 2
DRSI EQU 4
TOSH EQU 6
QUADRAM EQU 8
RLC100 EQU 0AH
RLC400 EQU 0CH
INTERNAL EQU 0EH
EXTERNAL EQU 10H
BAYCOM EQU 12H
PA0HZP EQU 14H

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,321 @@
/* ----------------------------------------------------------------------------
libconfig - A library for processing structured configuration files
Copyright (C) 2005-2010 Mark A Lindner
This file is part of libconfig.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, see
<http://www.gnu.org/licenses/>.
----------------------------------------------------------------------------
*/
#ifndef __libconfig_h
#define __libconfig_h
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
#if defined(LIBCONFIG_STATIC)
#define LIBCONFIG_API
#elif defined(LIBCONFIG_EXPORTS)
#define LIBCONFIG_API __declspec(dllexport)
#else /* ! LIBCONFIG_EXPORTS */
#define LIBCONFIG_API __declspec(dllimport)
#endif /* LIBCONFIG_STATIC */
#else /* ! WIN32 */
#define LIBCONFIG_API
#endif /* WIN32 */
#define LIBCONFIG_VER_MAJOR 1
#define LIBCONFIG_VER_MINOR 4
#define LIBCONFIG_VER_REVISION 9
#include <stdio.h>
#define CONFIG_TYPE_NONE 0
#define CONFIG_TYPE_GROUP 1
#define CONFIG_TYPE_INT 2
#define CONFIG_TYPE_INT64 3
#define CONFIG_TYPE_FLOAT 4
#define CONFIG_TYPE_STRING 5
#define CONFIG_TYPE_BOOL 6
#define CONFIG_TYPE_ARRAY 7
#define CONFIG_TYPE_LIST 8
#define CONFIG_FORMAT_DEFAULT 0
#define CONFIG_FORMAT_HEX 1
#define CONFIG_OPTION_AUTOCONVERT 0x01
#define CONFIG_TRUE (1)
#define CONFIG_FALSE (0)
typedef union config_value_t
{
int ival;
long long llval;
double fval;
char *sval;
struct config_list_t *list;
} config_value_t;
typedef struct config_setting_t
{
char *name;
short type;
short format;
config_value_t value;
struct config_setting_t *parent;
struct config_t *config;
void *hook;
unsigned int line;
const char *file;
} config_setting_t;
typedef enum
{
CONFIG_ERR_NONE = 0,
CONFIG_ERR_FILE_IO = 1,
CONFIG_ERR_PARSE = 2
} config_error_t;
typedef struct config_list_t
{
unsigned int length;
config_setting_t **elements;
} config_list_t;
typedef struct config_t
{
config_setting_t *root;
void (*destructor)(void *);
unsigned short flags;
unsigned short tab_width;
short default_format;
const char *include_dir;
const char *error_text;
const char *error_file;
int error_line;
config_error_t error_type;
const char **filenames;
unsigned int num_filenames;
} config_t;
extern LIBCONFIG_API int config_read(config_t *config, FILE *stream);
extern LIBCONFIG_API void config_write(const config_t *config, FILE *stream);
extern LIBCONFIG_API void config_set_default_format(config_t *config,
short format);
extern LIBCONFIG_API void config_set_auto_convert(config_t *config, int flag);
extern LIBCONFIG_API int config_get_auto_convert(const config_t *config);
extern LIBCONFIG_API int config_read_string(config_t *config, const char *str);
extern LIBCONFIG_API int config_read_file(config_t *config,
const char *filename);
extern LIBCONFIG_API int config_write_file(config_t *config,
const char *filename);
extern LIBCONFIG_API void config_set_destructor(config_t *config,
void (*destructor)(void *));
extern LIBCONFIG_API void config_set_include_dir(config_t *config,
const char *include_dir);
extern LIBCONFIG_API void config_init(config_t *config);
extern LIBCONFIG_API void config_destroy(config_t *config);
extern LIBCONFIG_API int config_setting_get_int(
const config_setting_t *setting);
extern LIBCONFIG_API long long config_setting_get_int64(
const config_setting_t *setting);
extern LIBCONFIG_API double config_setting_get_float(
const config_setting_t *setting);
extern LIBCONFIG_API int config_setting_get_bool(
const config_setting_t *setting);
extern LIBCONFIG_API const char *config_setting_get_string(
const config_setting_t *setting);
extern LIBCONFIG_API int config_setting_lookup_int(
const config_setting_t *setting, const char *name, int *value);
extern LIBCONFIG_API int config_setting_lookup_int64(
const config_setting_t *setting, const char *name, long long *value);
extern LIBCONFIG_API int config_setting_lookup_float(
const config_setting_t *setting, const char *name, double *value);
extern LIBCONFIG_API int config_setting_lookup_bool(
const config_setting_t *setting, const char *name, int *value);
extern LIBCONFIG_API int config_setting_lookup_string(
const config_setting_t *setting, const char *name, const char **value);
extern LIBCONFIG_API int config_setting_set_int(config_setting_t *setting,
int value);
extern LIBCONFIG_API int config_setting_set_int64(config_setting_t *setting,
long long value);
extern LIBCONFIG_API int config_setting_set_float(config_setting_t *setting,
double value);
extern LIBCONFIG_API int config_setting_set_bool(config_setting_t *setting,
int value);
extern LIBCONFIG_API int config_setting_set_string(config_setting_t *setting,
const char *value);
extern LIBCONFIG_API int config_setting_set_format(config_setting_t *setting,
short format);
extern LIBCONFIG_API short config_setting_get_format(
const config_setting_t *setting);
extern LIBCONFIG_API int config_setting_get_int_elem(
const config_setting_t *setting, int idx);
extern LIBCONFIG_API long long config_setting_get_int64_elem(
const config_setting_t *setting, int idx);
extern LIBCONFIG_API double config_setting_get_float_elem(
const config_setting_t *setting, int idx);
extern LIBCONFIG_API int config_setting_get_bool_elem(
const config_setting_t *setting, int idx);
extern LIBCONFIG_API const char *config_setting_get_string_elem(
const config_setting_t *setting, int idx);
extern LIBCONFIG_API config_setting_t *config_setting_set_int_elem(
config_setting_t *setting, int idx, int value);
extern LIBCONFIG_API config_setting_t *config_setting_set_int64_elem(
config_setting_t *setting, int idx, long long value);
extern LIBCONFIG_API config_setting_t *config_setting_set_float_elem(
config_setting_t *setting, int idx, double value);
extern LIBCONFIG_API config_setting_t *config_setting_set_bool_elem(
config_setting_t *setting, int idx, int value);
extern LIBCONFIG_API config_setting_t *config_setting_set_string_elem(
config_setting_t *setting, int idx, const char *value);
#define /* const char * */ config_get_include_dir(/* const config_t * */ C) \
((C)->include_dir)
#define /* int */ config_setting_type(/* const config_setting_t * */ S) \
((S)->type)
#define /* int */ config_setting_is_group(/* const config_setting_t * */ S) \
((S)->type == CONFIG_TYPE_GROUP)
#define /* int */ config_setting_is_array(/* const config_setting_t * */ S) \
((S)->type == CONFIG_TYPE_ARRAY)
#define /* int */ config_setting_is_list(/* const config_setting_t * */ S) \
((S)->type == CONFIG_TYPE_LIST)
#define /* int */ config_setting_is_aggregate( \
/* const config_setting_t * */ S) \
(((S)->type == CONFIG_TYPE_GROUP) || ((S)->type == CONFIG_TYPE_LIST) \
|| ((S)->type == CONFIG_TYPE_ARRAY))
#define /* int */ config_setting_is_number(/* const config_setting_t * */ S) \
(((S)->type == CONFIG_TYPE_INT) \
|| ((S)->type == CONFIG_TYPE_INT64) \
|| ((S)->type == CONFIG_TYPE_FLOAT))
#define /* int */ config_setting_is_scalar(/* const config_setting_t * */ S) \
(((S)->type == CONFIG_TYPE_BOOL) || ((S)->type == CONFIG_TYPE_STRING) \
|| config_setting_is_number(S))
#define /* const char * */ config_setting_name( \
/* const config_setting_t * */ S) \
((S)->name)
#define /* config_setting_t * */ config_setting_parent( \
/* const config_setting_t * */ S) \
((S)->parent)
#define /* int */ config_setting_is_root( \
/* const config_setting_t * */ S) \
((S)->parent ? CONFIG_FALSE : CONFIG_TRUE)
extern LIBCONFIG_API int config_setting_index(const config_setting_t *setting);
extern LIBCONFIG_API int config_setting_length(
const config_setting_t *setting);
extern LIBCONFIG_API config_setting_t *config_setting_get_elem(
const config_setting_t *setting, unsigned int idx);
extern LIBCONFIG_API config_setting_t *config_setting_get_member(
const config_setting_t *setting, const char *name);
extern LIBCONFIG_API config_setting_t *config_setting_add(
config_setting_t *parent, const char *name, int type);
extern LIBCONFIG_API int config_setting_remove(config_setting_t *parent,
const char *name);
extern LIBCONFIG_API int config_setting_remove_elem(config_setting_t *parent,
unsigned int idx);
extern LIBCONFIG_API void config_setting_set_hook(config_setting_t *setting,
void *hook);
#define config_setting_get_hook(S) ((S)->hook)
extern LIBCONFIG_API config_setting_t *config_lookup(const config_t *config,
const char *path);
extern LIBCONFIG_API config_setting_t *config_lookup_from(
config_setting_t *setting, const char *path);
extern LIBCONFIG_API int config_lookup_int(const config_t *config,
const char *path, int *value);
extern LIBCONFIG_API int config_lookup_int64(const config_t *config,
const char *path,
long long *value);
extern LIBCONFIG_API int config_lookup_float(const config_t *config,
const char *path, double *value);
extern LIBCONFIG_API int config_lookup_bool(const config_t *config,
const char *path, int *value);
extern LIBCONFIG_API int config_lookup_string(const config_t *config,
const char *path,
const char **value);
#define /* config_setting_t * */ config_root_setting( \
/* const config_t * */ C) \
((C)->root)
#define /* void */ config_set_default_format(/* config_t * */ C, \
/* short */ F) \
(C)->default_format = (F)
#define /* short */ config_get_default_format(/* config_t * */ C) \
((C)->default_format)
#define /* void */ config_set_tab_width(/* config_t * */ C, \
/* unsigned short */ W) \
(C)->tab_width = ((W) & 0x0F)
#define /* unsigned char */ config_get_tab_width(/* const config_t * */ C) \
((C)->tab_width)
#define /* unsigned short */ config_setting_source_line( \
/* const config_setting_t * */ S) \
((S)->line)
#define /* const char */ config_setting_source_file( \
/* const config_setting_t * */ S) \
((S)->file)
#define /* const char * */ config_error_text(/* const config_t * */ C) \
((C)->error_text)
#define /* const char * */ config_error_file(/* const config_t * */ C) \
((C)->error_file)
#define /* int */ config_error_line(/* const config_t * */ C) \
((C)->error_line)
#define /* config_error_t */ config_error_type(/* const config_t * */ C) \
((C)->error_type)
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __libconfig_h */

Binary file not shown.

Binary file not shown.

@ -0,0 +1,697 @@
/*-
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved.
*
* This code is derived from the Stanford/CMU enet packet filter,
* (net/enet.c) distributed as part of 4.3BSD, and code contributed
* to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
* Berkeley Laboratory.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)bpf.h 7.1 (Berkeley) 5/7/91
*
* @(#) $Header: /tcpdump/master/libpcap/pcap-bpf.h,v 1.34.2.6 2005/08/13 22:29:47 hannes Exp $ (LBL)
*/
/*
* This is libpcap's cut-down version of bpf.h; it includes only
* the stuff needed for the code generator and the userland BPF
* interpreter, and the libpcap APIs for setting filters, etc..
*
* "pcap-bpf.c" will include the native OS version, as it deals with
* the OS's BPF implementation.
*
* XXX - should this all just be moved to "pcap.h"?
*/
#ifndef BPF_MAJOR_VERSION
#ifdef __cplusplus
extern "C" {
#endif
/* BSD style release date */
#define BPF_RELEASE 199606
#ifdef MSDOS /* must be 32-bit */
typedef long bpf_int32;
typedef unsigned long bpf_u_int32;
#else
typedef int bpf_int32;
typedef u_int bpf_u_int32;
#endif
/*
* Alignment macros. BPF_WORDALIGN rounds up to the next
* even multiple of BPF_ALIGNMENT.
*/
#ifndef __NetBSD__
#define BPF_ALIGNMENT sizeof(bpf_int32)
#else
#define BPF_ALIGNMENT sizeof(long)
#endif
#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
#define BPF_MAXINSNS 512
#define BPF_MAXBUFSIZE 0x8000
#define BPF_MINBUFSIZE 32
/*
* Structure for "pcap_compile()", "pcap_setfilter()", etc..
*/
struct bpf_program {
u_int bf_len;
struct bpf_insn *bf_insns;
};
/*
* Struct return by BIOCVERSION. This represents the version number of
* the filter language described by the instruction encodings below.
* bpf understands a program iff kernel_major == filter_major &&
* kernel_minor >= filter_minor, that is, if the value returned by the
* running kernel has the same major number and a minor number equal
* equal to or less than the filter being downloaded. Otherwise, the
* results are undefined, meaning an error may be returned or packets
* may be accepted haphazardly.
* It has nothing to do with the source code version.
*/
struct bpf_version {
u_short bv_major;
u_short bv_minor;
};
/* Current version number of filter architecture. */
#define BPF_MAJOR_VERSION 1
#define BPF_MINOR_VERSION 1
/*
* Data-link level type codes.
*
* Do *NOT* add new values to this list without asking
* "tcpdump-workers@tcpdump.org" for a value. Otherwise, you run the
* risk of using a value that's already being used for some other purpose,
* and of having tools that read libpcap-format captures not being able
* to handle captures with your new DLT_ value, with no hope that they
* will ever be changed to do so (as that would destroy their ability
* to read captures using that value for that other purpose).
*/
/*
* These are the types that are the same on all platforms, and that
* have been defined by <net/bpf.h> for ages.
*/
#define DLT_NULL 0 /* BSD loopback encapsulation */
#define DLT_EN10MB 1 /* Ethernet (10Mb) */
#define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */
#define DLT_AX25 3 /* Amateur Radio AX.25 */
#define DLT_PRONET 4 /* Proteon ProNET Token Ring */
#define DLT_CHAOS 5 /* Chaos */
#define DLT_IEEE802 6 /* IEEE 802 Networks */
#define DLT_ARCNET 7 /* ARCNET, with BSD-style header */
#define DLT_SLIP 8 /* Serial Line IP */
#define DLT_PPP 9 /* Point-to-point Protocol */
#define DLT_FDDI 10 /* FDDI */
/*
* These are types that are different on some platforms, and that
* have been defined by <net/bpf.h> for ages. We use #ifdefs to
* detect the BSDs that define them differently from the traditional
* libpcap <net/bpf.h>
*
* XXX - DLT_ATM_RFC1483 is 13 in BSD/OS, and DLT_RAW is 14 in BSD/OS,
* but I don't know what the right #define is for BSD/OS.
*/
#define DLT_ATM_RFC1483 11 /* LLC-encapsulated ATM */
#ifdef __OpenBSD__
#define DLT_RAW 14 /* raw IP */
#else
#define DLT_RAW 12 /* raw IP */
#endif
/*
* Given that the only OS that currently generates BSD/OS SLIP or PPP
* is, well, BSD/OS, arguably everybody should have chosen its values
* for DLT_SLIP_BSDOS and DLT_PPP_BSDOS, which are 15 and 16, but they
* didn't. So it goes.
*/
#if defined(__NetBSD__) || defined(__FreeBSD__)
#ifndef DLT_SLIP_BSDOS
#define DLT_SLIP_BSDOS 13 /* BSD/OS Serial Line IP */
#define DLT_PPP_BSDOS 14 /* BSD/OS Point-to-point Protocol */
#endif
#else
#define DLT_SLIP_BSDOS 15 /* BSD/OS Serial Line IP */
#define DLT_PPP_BSDOS 16 /* BSD/OS Point-to-point Protocol */
#endif
/*
* 17 is used for DLT_OLD_PFLOG in OpenBSD;
* OBSOLETE: DLT_PFLOG is 117 in OpenBSD now as well. See below.
* 18 is used for DLT_PFSYNC in OpenBSD; don't use it for anything else.
*/
#define DLT_ATM_CLIP 19 /* Linux Classical-IP over ATM */
/*
* Apparently Redback uses this for its SmartEdge 400/800. I hope
* nobody else decided to use it, too.
*/
#define DLT_REDBACK_SMARTEDGE 32
/*
* These values are defined by NetBSD; other platforms should refrain from
* using them for other purposes, so that NetBSD savefiles with link
* types of 50 or 51 can be read as this type on all platforms.
*/
#define DLT_PPP_SERIAL 50 /* PPP over serial with HDLC encapsulation */
#define DLT_PPP_ETHER 51 /* PPP over Ethernet */
/*
* The Axent Raptor firewall - now the Symantec Enterprise Firewall - uses
* a link-layer type of 99 for the tcpdump it supplies. The link-layer
* header has 6 bytes of unknown data, something that appears to be an
* Ethernet type, and 36 bytes that appear to be 0 in at least one capture
* I've seen.
*/
#define DLT_SYMANTEC_FIREWALL 99
/*
* Values between 100 and 103 are used in capture file headers as
* link-layer types corresponding to DLT_ types that differ
* between platforms; don't use those values for new DLT_ new types.
*/
/*
* This value was defined by libpcap 0.5; platforms that have defined
* it with a different value should define it here with that value -
* a link type of 104 in a save file will be mapped to DLT_C_HDLC,
* whatever value that happens to be, so programs will correctly
* handle files with that link type regardless of the value of
* DLT_C_HDLC.
*
* The name DLT_C_HDLC was used by BSD/OS; we use that name for source
* compatibility with programs written for BSD/OS.
*
* libpcap 0.5 defined it as DLT_CHDLC; we define DLT_CHDLC as well,
* for source compatibility with programs written for libpcap 0.5.
*/
#define DLT_C_HDLC 104 /* Cisco HDLC */
#define DLT_CHDLC DLT_C_HDLC
#define DLT_IEEE802_11 105 /* IEEE 802.11 wireless */
/*
* 106 is reserved for Linux Classical IP over ATM; it's like DLT_RAW,
* except when it isn't. (I.e., sometimes it's just raw IP, and
* sometimes it isn't.) We currently handle it as DLT_LINUX_SLL,
* so that we don't have to worry about the link-layer header.)
*/
/*
* Frame Relay; BSD/OS has a DLT_FR with a value of 11, but that collides
* with other values.
* DLT_FR and DLT_FRELAY packets start with the Q.922 Frame Relay header
* (DLCI, etc.).
*/
#define DLT_FRELAY 107
/*
* OpenBSD DLT_LOOP, for loopback devices; it's like DLT_NULL, except
* that the AF_ type in the link-layer header is in network byte order.
*
* OpenBSD defines it as 12, but that collides with DLT_RAW, so we
* define it as 108 here. If OpenBSD picks up this file, it should
* define DLT_LOOP as 12 in its version, as per the comment above -
* and should not use 108 as a DLT_ value.
*/
#define DLT_LOOP 108
/*
* Encapsulated packets for IPsec; DLT_ENC is 13 in OpenBSD, but that's
* DLT_SLIP_BSDOS in NetBSD, so we don't use 13 for it in OSes other
* than OpenBSD.
*/
#ifdef __OpenBSD__
#define DLT_ENC 13
#else
#define DLT_ENC 109
#endif
/*
* Values between 110 and 112 are reserved for use in capture file headers
* as link-layer types corresponding to DLT_ types that might differ
* between platforms; don't use those values for new DLT_ types
* other than the corresponding DLT_ types.
*/
/*
* This is for Linux cooked sockets.
*/
#define DLT_LINUX_SLL 113
/*
* Apple LocalTalk hardware.
*/
#define DLT_LTALK 114
/*
* Acorn Econet.
*/
#define DLT_ECONET 115
/*
* Reserved for use with OpenBSD ipfilter.
*/
#define DLT_IPFILTER 116
/*
* OpenBSD DLT_PFLOG; DLT_PFLOG is 17 in OpenBSD, but that's DLT_LANE8023
* in SuSE 6.3, so we can't use 17 for it in capture-file headers.
*
* XXX: is there a conflict with DLT_PFSYNC 18 as well?
*/
#ifdef __OpenBSD__
#define DLT_OLD_PFLOG 17
#define DLT_PFSYNC 18
#endif
#define DLT_PFLOG 117
/*
* Registered for Cisco-internal use.
*/
#define DLT_CISCO_IOS 118
/*
* For 802.11 cards using the Prism II chips, with a link-layer
* header including Prism monitor mode information plus an 802.11
* header.
*/
#define DLT_PRISM_HEADER 119
/*
* Reserved for Aironet 802.11 cards, with an Aironet link-layer header
* (see Doug Ambrisko's FreeBSD patches).
*/
#define DLT_AIRONET_HEADER 120
/*
* Reserved for Siemens HiPath HDLC.
*/
#define DLT_HHDLC 121
/*
* This is for RFC 2625 IP-over-Fibre Channel.
*
* This is not for use with raw Fibre Channel, where the link-layer
* header starts with a Fibre Channel frame header; it's for IP-over-FC,
* where the link-layer header starts with an RFC 2625 Network_Header
* field.
*/
#define DLT_IP_OVER_FC 122
/*
* This is for Full Frontal ATM on Solaris with SunATM, with a
* pseudo-header followed by an AALn PDU.
*
* There may be other forms of Full Frontal ATM on other OSes,
* with different pseudo-headers.
*
* If ATM software returns a pseudo-header with VPI/VCI information
* (and, ideally, packet type information, e.g. signalling, ILMI,
* LANE, LLC-multiplexed traffic, etc.), it should not use
* DLT_ATM_RFC1483, but should get a new DLT_ value, so tcpdump
* and the like don't have to infer the presence or absence of a
* pseudo-header and the form of the pseudo-header.
*/
#define DLT_SUNATM 123 /* Solaris+SunATM */
/*
* Reserved as per request from Kent Dahlgren <kent@praesum.com>
* for private use.
*/
#define DLT_RIO 124 /* RapidIO */
#define DLT_PCI_EXP 125 /* PCI Express */
#define DLT_AURORA 126 /* Xilinx Aurora link layer */
/*
* Header for 802.11 plus a number of bits of link-layer information
* including radio information, used by some recent BSD drivers as
* well as the madwifi Atheros driver for Linux.
*/
#define DLT_IEEE802_11_RADIO 127 /* 802.11 plus radiotap radio header */
/*
* Reserved for the TZSP encapsulation, as per request from
* Chris Waters <chris.waters@networkchemistry.com>
* TZSP is a generic encapsulation for any other link type,
* which includes a means to include meta-information
* with the packet, e.g. signal strength and channel
* for 802.11 packets.
*/
#define DLT_TZSP 128 /* Tazmen Sniffer Protocol */
/*
* BSD's ARCNET headers have the source host, destination host,
* and type at the beginning of the packet; that's what's handed
* up to userland via BPF.
*
* Linux's ARCNET headers, however, have a 2-byte offset field
* between the host IDs and the type; that's what's handed up
* to userland via PF_PACKET sockets.
*
* We therefore have to have separate DLT_ values for them.
*/
#define DLT_ARCNET_LINUX 129 /* ARCNET */
/*
* Juniper-private data link types, as per request from
* Hannes Gredler <hannes@juniper.net>. The DLT_s are used
* for passing on chassis-internal metainformation such as
* QOS profiles, etc..
*/
#define DLT_JUNIPER_MLPPP 130
#define DLT_JUNIPER_MLFR 131
#define DLT_JUNIPER_ES 132
#define DLT_JUNIPER_GGSN 133
#define DLT_JUNIPER_MFR 134
#define DLT_JUNIPER_ATM2 135
#define DLT_JUNIPER_SERVICES 136
#define DLT_JUNIPER_ATM1 137
/*
* Apple IP-over-IEEE 1394, as per a request from Dieter Siegmund
* <dieter@apple.com>. The header that's presented is an Ethernet-like
* header:
*
* #define FIREWIRE_EUI64_LEN 8
* struct firewire_header {
* u_char firewire_dhost[FIREWIRE_EUI64_LEN];
* u_char firewire_shost[FIREWIRE_EUI64_LEN];
* u_short firewire_type;
* };
*
* with "firewire_type" being an Ethernet type value, rather than,
* for example, raw GASP frames being handed up.
*/
#define DLT_APPLE_IP_OVER_IEEE1394 138
/*
* Various SS7 encapsulations, as per a request from Jeff Morriss
* <jeff.morriss[AT]ulticom.com> and subsequent discussions.
*/
#define DLT_MTP2_WITH_PHDR 139 /* pseudo-header with various info, followed by MTP2 */
#define DLT_MTP2 140 /* MTP2, without pseudo-header */
#define DLT_MTP3 141 /* MTP3, without pseudo-header or MTP2 */
#define DLT_SCCP 142 /* SCCP, without pseudo-header or MTP2 or MTP3 */
/*
* DOCSIS MAC frames.
*/
#define DLT_DOCSIS 143
/*
* Linux-IrDA packets. Protocol defined at http://www.irda.org.
* Those packets include IrLAP headers and above (IrLMP...), but
* don't include Phy framing (SOF/EOF/CRC & byte stuffing), because Phy
* framing can be handled by the hardware and depend on the bitrate.
* This is exactly the format you would get capturing on a Linux-IrDA
* interface (irdaX), but not on a raw serial port.
* Note the capture is done in "Linux-cooked" mode, so each packet include
* a fake packet header (struct sll_header). This is because IrDA packet
* decoding is dependant on the direction of the packet (incomming or
* outgoing).
* When/if other platform implement IrDA capture, we may revisit the
* issue and define a real DLT_IRDA...
* Jean II
*/
#define DLT_LINUX_IRDA 144
/*
* Reserved for IBM SP switch and IBM Next Federation switch.
*/
#define DLT_IBM_SP 145
#define DLT_IBM_SN 146
/*
* Reserved for private use. If you have some link-layer header type
* that you want to use within your organization, with the capture files
* using that link-layer header type not ever be sent outside your
* organization, you can use these values.
*
* No libpcap release will use these for any purpose, nor will any
* tcpdump release use them, either.
*
* Do *NOT* use these in capture files that you expect anybody not using
* your private versions of capture-file-reading tools to read; in
* particular, do *NOT* use them in products, otherwise you may find that
* people won't be able to use tcpdump, or snort, or Ethereal, or... to
* read capture files from your firewall/intrusion detection/traffic
* monitoring/etc. appliance, or whatever product uses that DLT_ value,
* and you may also find that the developers of those applications will
* not accept patches to let them read those files.
*
* Also, do not use them if somebody might send you a capture using them
* for *their* private type and tools using them for *your* private type
* would have to read them.
*
* Instead, ask "tcpdump-workers@tcpdump.org" for a new DLT_ value,
* as per the comment above, and use the type you're given.
*/
#define DLT_USER0 147
#define DLT_USER1 148
#define DLT_USER2 149
#define DLT_USER3 150
#define DLT_USER4 151
#define DLT_USER5 152
#define DLT_USER6 153
#define DLT_USER7 154
#define DLT_USER8 155
#define DLT_USER9 156
#define DLT_USER10 157
#define DLT_USER11 158
#define DLT_USER12 159
#define DLT_USER13 160
#define DLT_USER14 161
#define DLT_USER15 162
/*
* For future use with 802.11 captures - defined by AbsoluteValue
* Systems to store a number of bits of link-layer information
* including radio information:
*
* http://www.shaftnet.org/~pizza/software/capturefrm.txt
*
* but it might be used by some non-AVS drivers now or in the
* future.
*/
#define DLT_IEEE802_11_RADIO_AVS 163 /* 802.11 plus AVS radio header */
/*
* Juniper-private data link type, as per request from
* Hannes Gredler <hannes@juniper.net>. The DLT_s are used
* for passing on chassis-internal metainformation such as
* QOS profiles, etc..
*/
#define DLT_JUNIPER_MONITOR 164
/*
* Reserved for BACnet MS/TP.
*/
#define DLT_BACNET_MS_TP 165
/*
* Another PPP variant as per request from Karsten Keil <kkeil@suse.de>.
*
* This is used in some OSes to allow a kernel socket filter to distinguish
* between incoming and outgoing packets, on a socket intended to
* supply pppd with outgoing packets so it can do dial-on-demand and
* hangup-on-lack-of-demand; incoming packets are filtered out so they
* don't cause pppd to hold the connection up (you don't want random
* input packets such as port scans, packets from old lost connections,
* etc. to force the connection to stay up).
*
* The first byte of the PPP header (0xff03) is modified to accomodate
* the direction - 0x00 = IN, 0x01 = OUT.
*/
#define DLT_PPP_PPPD 166
/*
* Names for backwards compatibility with older versions of some PPP
* software; new software should use DLT_PPP_PPPD.
*/
#define DLT_PPP_WITH_DIRECTION DLT_PPP_PPPD
#define DLT_LINUX_PPP_WITHDIRECTION DLT_PPP_PPPD
/*
* Juniper-private data link type, as per request from
* Hannes Gredler <hannes@juniper.net>. The DLT_s are used
* for passing on chassis-internal metainformation such as
* QOS profiles, cookies, etc..
*/
#define DLT_JUNIPER_PPPOE 167
#define DLT_JUNIPER_PPPOE_ATM 168
#define DLT_GPRS_LLC 169 /* GPRS LLC */
#define DLT_GPF_T 170 /* GPF-T (ITU-T G.7041/Y.1303) */
#define DLT_GPF_F 171 /* GPF-F (ITU-T G.7041/Y.1303) */
/*
* Requested by Oolan Zimmer <oz@gcom.com> for use in Gcom's T1/E1 line
* monitoring equipment.
*/
#define DLT_GCOM_T1E1 172
#define DLT_GCOM_SERIAL 173
/*
* Juniper-private data link type, as per request from
* Hannes Gredler <hannes@juniper.net>. The DLT_ is used
* for internal communication to Physical Interface Cards (PIC)
*/
#define DLT_JUNIPER_PIC_PEER 174
/*
* Link types requested by Gregor Maier <gregor@endace.com> of Endace
* Measurement Systems. They add an ERF header (see
* http://www.endace.com/support/EndaceRecordFormat.pdf) in front of
* the link-layer header.
*/
#define DLT_ERF_ETH 175 /* Ethernet */
#define DLT_ERF_POS 176 /* Packet-over-SONET */
/*
* Requested by Daniele Orlandi <daniele@orlandi.com> for raw LAPD
* for vISDN (http://www.orlandi.com/visdn/). Its link-layer header
* includes additional information before the LAPD header, so it's
* not necessarily a generic LAPD header.
*/
#define DLT_LINUX_LAPD 177
/*
* Juniper-private data link type, as per request from
* Hannes Gredler <hannes@juniper.net>.
* The DLT_ are used for prepending meta-information
* like interface index, interface name
* before standard Ethernet, PPP, Frelay & C-HDLC Frames
*/
#define DLT_JUNIPER_ETHER 178
#define DLT_JUNIPER_PPP 179
#define DLT_JUNIPER_FRELAY 180
#define DLT_JUNIPER_CHDLC 181
/*
* The instruction encodings.
*/
/* instruction classes */
#define BPF_CLASS(code) ((code) & 0x07)
#define BPF_LD 0x00
#define BPF_LDX 0x01
#define BPF_ST 0x02
#define BPF_STX 0x03
#define BPF_ALU 0x04
#define BPF_JMP 0x05
#define BPF_RET 0x06
#define BPF_MISC 0x07
/* ld/ldx fields */
#define BPF_SIZE(code) ((code) & 0x18)
#define BPF_W 0x00
#define BPF_H 0x08
#define BPF_B 0x10
#define BPF_MODE(code) ((code) & 0xe0)
#define BPF_IMM 0x00
#define BPF_ABS 0x20
#define BPF_IND 0x40
#define BPF_MEM 0x60
#define BPF_LEN 0x80
#define BPF_MSH 0xa0
/* alu/jmp fields */
#define BPF_OP(code) ((code) & 0xf0)
#define BPF_ADD 0x00
#define BPF_SUB 0x10
#define BPF_MUL 0x20
#define BPF_DIV 0x30
#define BPF_OR 0x40
#define BPF_AND 0x50
#define BPF_LSH 0x60
#define BPF_RSH 0x70
#define BPF_NEG 0x80
#define BPF_JA 0x00
#define BPF_JEQ 0x10
#define BPF_JGT 0x20
#define BPF_JGE 0x30
#define BPF_JSET 0x40
#define BPF_SRC(code) ((code) & 0x08)
#define BPF_K 0x00
#define BPF_X 0x08
/* ret - BPF_K and BPF_X also apply */
#define BPF_RVAL(code) ((code) & 0x18)
#define BPF_A 0x10
/* misc */
#define BPF_MISCOP(code) ((code) & 0xf8)
#define BPF_TAX 0x00
#define BPF_TXA 0x80
/*
* The instruction data structure.
*/
struct bpf_insn {
u_short code;
u_char jt;
u_char jf;
bpf_int32 k;
};
/*
* Macros for insn array initializers.
*/
#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
#if __STDC__ || defined(__cplusplus)
extern int bpf_validate(struct bpf_insn *, int);
extern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int);
#else
extern int bpf_validate();
extern u_int bpf_filter();
#endif
/*
* Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
*/
#define BPF_MEMWORDS 16
#ifdef __cplusplus
}
#endif
#endif

@ -0,0 +1,64 @@
/*
* Copyright (c) 2002 - 2003
* NetGroup, Politecnico di Torino (Italy)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Politecnico di Torino nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#define SIZEOF_CHAR 1
#define SIZEOF_SHORT 2
#define SIZEOF_INT 4
#ifndef _MSC_EXTENSIONS
#define SIZEOF_LONG_LONG 8
#endif
/*
* Avoids a compiler warning in case this was already defined
* (someone defined _WINSOCKAPI_ when including 'windows.h', in order
* to prevent it from including 'winsock.h')
*/
#ifdef _WINSOCKAPI_
#undef _WINSOCKAPI_
#endif
//#include <winsock2.h>
#include <fcntl.h>
//#include "bittypes.h"
#include <time.h>
#include <io.h>
#ifndef __MINGW32__
//#include "IP6_misc.h"
#endif
#define caddr_t char*
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#define inline __inline

@ -0,0 +1,257 @@
/* -*- Mode: c; tab-width: 8; indent-tabs-mode: 1; c-basic-offset: 8; -*- */
/*
* Copyright (c) 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the Computer Systems
* Engineering Group at Lawrence Berkeley Laboratory.
* 4. Neither the name of the University nor of the Laboratory may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.45.2.3 2003/11/21 10:20:50 guy Exp $ (LBL)
*/
#ifndef lib_pcap_h
#define lib_pcap_h
#ifdef WIN32
//#include "pcap-stdinc.h"
#else /* WIN32 */
#include <sys/types.h>
#include <sys/time.h>
#endif /* WIN32 */
#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H
#include "pcap-bpf.h"
#endif
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
#define PCAP_VERSION_MAJOR 2
#define PCAP_VERSION_MINOR 4
#define PCAP_ERRBUF_SIZE 256
/*
* Compatibility for systems that have a bpf.h that
* predates the bpf typedefs for 64-bit support.
*/
#if BPF_RELEASE - 0 < 199406
typedef int bpf_int32;
typedef u_int bpf_u_int32;
#endif
typedef struct pcap pcap_t;
typedef struct pcap_dumper pcap_dumper_t;
typedef struct pcap_if pcap_if_t;
typedef struct pcap_addr pcap_addr_t;
/*
* The first record in the file contains saved values for some
* of the flags used in the printout phases of tcpdump.
* Many fields here are 32 bit ints so compilers won't insert unwanted
* padding; these files need to be interchangeable across architectures.
*
* Do not change the layout of this structure, in any way (this includes
* changes that only affect the length of fields in this structure).
*
* Also, do not change the interpretation of any of the members of this
* structure, in any way (this includes using values other than
* LINKTYPE_ values, as defined in "savefile.c", in the "linktype"
* field).
*
* Instead:
*
* introduce a new structure for the new format, if the layout
* of the structure changed;
*
* send mail to "tcpdump-workers@tcpdump.org", requesting a new
* magic number for your new capture file format, and, when
* you get the new magic number, put it in "savefile.c";
*
* use that magic number for save files with the changed file
* header;
*
* make the code in "savefile.c" capable of reading files with
* the old file header as well as files with the new file header
* (using the magic number to determine the header format).
*
* Then supply the changes to "patches@tcpdump.org", so that future
* versions of libpcap and programs that use it (such as tcpdump) will
* be able to read your new capture file format.
*/
struct pcap_file_header {
bpf_u_int32 magic;
u_short version_major;
u_short version_minor;
bpf_int32 thiszone; /* gmt to local correction */
bpf_u_int32 sigfigs; /* accuracy of timestamps */
bpf_u_int32 snaplen; /* max length saved portion of each pkt */
bpf_u_int32 linktype; /* data link type (LINKTYPE_*) */
};
/*
* Each packet in the dump file is prepended with this generic header.
* This gets around the problem of different headers for different
* packet interfaces.
*/
struct pcap_pkthdr {
struct timeval ts; /* time stamp */
bpf_u_int32 caplen; /* length of portion present */
bpf_u_int32 len; /* length this packet (off wire) */
};
/*
* As returned by the pcap_stats()
*/
struct pcap_stat {
u_int ps_recv; /* number of packets received */
u_int ps_drop; /* number of packets dropped */
u_int ps_ifdrop; /* drops by interface XXX not yet supported */
#ifdef WIN32
u_int bs_capt; /* number of packets that reach the application */
#endif /* WIN32 */
};
/*
* Item in a list of interfaces.
*/
struct pcap_if {
struct pcap_if *next;
char *name; /* name to hand to "pcap_open_live()" */
char *description; /* textual description of interface, or NULL */
struct pcap_addr *addresses;
bpf_u_int32 flags; /* PCAP_IF_ interface flags */
};
#define PCAP_IF_LOOPBACK 0x00000001 /* interface is loopback */
/*
* Representation of an interface address.
*/
struct pcap_addr {
struct pcap_addr *next;
struct sockaddr *addr; /* address */
struct sockaddr *netmask; /* netmask for that address */
struct sockaddr *broadaddr; /* broadcast address for that address */
struct sockaddr *dstaddr; /* P2P destination address for that address */
};
typedef void (*pcap_handler)(u_char *, const struct pcap_pkthdr *,
const u_char *);
char *pcap_lookupdev(char *);
int pcap_lookupnet(const char *, bpf_u_int32 *, bpf_u_int32 *, char *);
pcap_t *pcap_open_live(const char *, int, int, int, char *);
pcap_t *pcap_open_dead(int, int);
pcap_t *pcap_open_offline(const char *, char *);
void pcap_close(pcap_t *);
int pcap_loop(pcap_t *, int, pcap_handler, u_char *);
int pcap_dispatch(pcap_t *, int, pcap_handler, u_char *);
const u_char*
pcap_next(pcap_t *, struct pcap_pkthdr *);
int pcap_next_ex(pcap_t *, struct pcap_pkthdr **, const u_char **);
void pcap_breakloop(pcap_t *);
int pcap_stats(pcap_t *, struct pcap_stat *);
int pcap_setfilter(pcap_t *, struct bpf_program *);
int pcap_getnonblock(pcap_t *, char *);
int pcap_setnonblock(pcap_t *, int, char *);
void pcap_perror(pcap_t *, char *);
char *pcap_strerror(int);
char *pcap_geterr(pcap_t *);
int pcap_compile(pcap_t *, struct bpf_program *, char *, int,
bpf_u_int32);
int pcap_compile_nopcap(int, int, struct bpf_program *,
char *, int, bpf_u_int32);
void pcap_freecode(struct bpf_program *);
int pcap_datalink(pcap_t *);
int pcap_list_datalinks(pcap_t *, int **);
int pcap_set_datalink(pcap_t *, int);
int pcap_datalink_name_to_val(const char *);
const char *pcap_datalink_val_to_name(int);
const char *pcap_datalink_val_to_description(int);
int pcap_snapshot(pcap_t *);
int pcap_is_swapped(pcap_t *);
int pcap_major_version(pcap_t *);
int pcap_minor_version(pcap_t *);
/* XXX */
FILE *pcap_file(pcap_t *);
int pcap_fileno(pcap_t *);
pcap_dumper_t *pcap_dump_open(pcap_t *, const char *);
int pcap_dump_flush(pcap_dumper_t *);
void pcap_dump_close(pcap_dumper_t *);
void pcap_dump(u_char *, const struct pcap_pkthdr *, const u_char *);
FILE *pcap_dump_file(pcap_dumper_t *);
int pcap_findalldevs(pcap_if_t **, char *);
void pcap_freealldevs(pcap_if_t *);
const char *pcap_lib_version(void);
/* XXX this guy lives in the bpf tree */
u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int);
int bpf_validate(struct bpf_insn *f, int len);
char *bpf_image(struct bpf_insn *, int);
void bpf_dump(struct bpf_program *, int);
#ifdef WIN32
/*
* Win32 definitions
*/
int pcap_setbuff(pcap_t *p, int dim);
int pcap_setmode(pcap_t *p, int mode);
int pcap_sendpacket(pcap_t *p, u_char *buf, int size);
int pcap_setmintocopy(pcap_t *p, int size);
#ifdef WPCAP
/* Include file with the wpcap-specific extensions */
#include <Win32-Extensions.h>
#endif
#define MODE_CAPT 0
#define MODE_STAT 1
#else
/*
* UN*X definitions
*/
int pcap_get_selectable_fd(pcap_t *);
#endif /* WIN32 */
#ifdef __cplusplus
}
#endif
#endif

@ -0,0 +1,597 @@
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1995 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
// winres.h - Windows resource definitions
// extracted from WINUSER.H and COMMCTRL.H
#ifdef _AFX_MINREBUILD
#pragma component(minrebuild, off)
#endif
#define VS_VERSION_INFO 1
#ifdef APSTUDIO_INVOKED
#define APSTUDIO_HIDDEN_SYMBOLS // Ignore following symbols
#endif
#ifndef WINVER
#define WINVER 0x0400 // default to Windows Version 4.0
#endif
#define OBM_CLOSE 32754
#define OBM_UPARROW 32753
#define OBM_DNARROW 32752
#define OBM_RGARROW 32751
#define OBM_LFARROW 32750
#define OBM_REDUCE 32749
#define OBM_ZOOM 32748
#define OBM_RESTORE 32747
#define OBM_REDUCED 32746
#define OBM_ZOOMD 32745
#define OBM_RESTORED 32744
#define OBM_UPARROWD 32743
#define OBM_DNARROWD 32742
#define OBM_RGARROWD 32741
#define OBM_LFARROWD 32740
#define OBM_MNARROW 32739
#define OBM_COMBO 32738
#define OBM_UPARROWI 32737
#define OBM_DNARROWI 32736
#define OBM_RGARROWI 32735
#define OBM_LFARROWI 32734
#define OBM_OLD_CLOSE 32767
#define OBM_SIZE 32766
#define OBM_OLD_UPARROW 32765
#define OBM_OLD_DNARROW 32764
#define OBM_OLD_RGARROW 32763
#define OBM_OLD_LFARROW 32762
#define OBM_BTSIZE 32761
#define OBM_CHECK 32760
#define OBM_CHECKBOXES 32759
#define OBM_BTNCORNERS 32758
#define OBM_OLD_REDUCE 32757
#define OBM_OLD_ZOOM 32756
#define OBM_OLD_RESTORE 32755
#define OCR_NORMAL 32512
#define OCR_IBEAM 32513
#define OCR_WAIT 32514
#define OCR_CROSS 32515
#define OCR_UP 32516
#define OCR_SIZE 32640
#define OCR_ICON 32641
#define OCR_SIZENWSE 32642
#define OCR_SIZENESW 32643
#define OCR_SIZEWE 32644
#define OCR_SIZENS 32645
#define OCR_SIZEALL 32646
#define OCR_ICOCUR 32647
#define OCR_NO 32648
#define OIC_SAMPLE 32512
#define OIC_HAND 32513
#define OIC_QUES 32514
#define OIC_BANG 32515
#define OIC_NOTE 32516
#if (WINVER >= 0x0400)
#define OCR_APPSTARTING 32650
#define OIC_WINLOGO 32517
#define OIC_WARNING OIC_BANG
#define OIC_ERROR OIC_HAND
#define OIC_INFORMATION OIC_NOTE
#endif
#define WS_OVERLAPPED 0x00000000L
#define WS_POPUP 0x80000000L
#define WS_CHILD 0x40000000L
#define WS_CLIPSIBLINGS 0x04000000L
#define WS_CLIPCHILDREN 0x02000000L
#define WS_VISIBLE 0x10000000L
#define WS_DISABLED 0x08000000L
#define WS_MINIMIZE 0x20000000L
#define WS_MAXIMIZE 0x01000000L
#define WS_CAPTION 0x00C00000L
#define WS_BORDER 0x00800000L
#define WS_DLGFRAME 0x00400000L
#define WS_VSCROLL 0x00200000L
#define WS_HSCROLL 0x00100000L
#define WS_SYSMENU 0x00080000L
#define WS_THICKFRAME 0x00040000L
#define WS_MINIMIZEBOX 0x00020000L
#define WS_MAXIMIZEBOX 0x00010000L
#define WS_GROUP 0x00020000L
#define WS_TABSTOP 0x00010000L
// other aliases
#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
#define WS_POPUPWINDOW (WS_POPUP | WS_BORDER | WS_SYSMENU)
#define WS_CHILDWINDOW (WS_CHILD)
#define WS_TILED WS_OVERLAPPED
#define WS_ICONIC WS_MINIMIZE
#define WS_SIZEBOX WS_THICKFRAME
#define WS_TILEDWINDOW WS_OVERLAPPEDWINDOW
#define WS_EX_DLGMODALFRAME 0x00000001L
#define WS_EX_NOPARENTNOTIFY 0x00000004L
#define WS_EX_TOPMOST 0x00000008L
#define WS_EX_ACCEPTFILES 0x00000010L
#define WS_EX_TRANSPARENT 0x00000020L
#if (WINVER >= 0x0400)
#define WS_EX_MDICHILD 0x00000040L
#define WS_EX_TOOLWINDOW 0x00000080L
#define WS_EX_WINDOWEDGE 0x00000100L
#define WS_EX_CLIENTEDGE 0x00000200L
#define WS_EX_CONTEXTHELP 0x00000400L
#define WS_EX_RIGHT 0x00001000L
#define WS_EX_LEFT 0x00000000L
#define WS_EX_RTLREADING 0x00002000L
#define WS_EX_LTRREADING 0x00000000L
#define WS_EX_LEFTSCROLLBAR 0x00004000L
#define WS_EX_RIGHTSCROLLBAR 0x00000000L
#define WS_EX_CONTROLPARENT 0x00010000L
#define WS_EX_STATICEDGE 0x00020000L
#define WS_EX_APPWINDOW 0x00040000L
#define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE)
#define WS_EX_PALETTEWINDOW (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST)
#endif
#define VK_LBUTTON 0x01
#define VK_RBUTTON 0x02
#define VK_CANCEL 0x03
#define VK_MBUTTON 0x04
#define VK_BACK 0x08
#define VK_TAB 0x09
#define VK_CLEAR 0x0C
#define VK_RETURN 0x0D
#define VK_SHIFT 0x10
#define VK_CONTROL 0x11
#define VK_MENU 0x12
#define VK_PAUSE 0x13
#define VK_CAPITAL 0x14
#define VK_ESCAPE 0x1B
#define VK_SPACE 0x20
#define VK_PRIOR 0x21
#define VK_NEXT 0x22
#define VK_END 0x23
#define VK_HOME 0x24
#define VK_LEFT 0x25
#define VK_UP 0x26
#define VK_RIGHT 0x27
#define VK_DOWN 0x28
#define VK_SELECT 0x29
#define VK_PRINT 0x2A
#define VK_EXECUTE 0x2B
#define VK_SNAPSHOT 0x2C
#define VK_INSERT 0x2D
#define VK_DELETE 0x2E
#define VK_HELP 0x2F
#define VK_NUMPAD0 0x60
#define VK_NUMPAD1 0x61
#define VK_NUMPAD2 0x62
#define VK_NUMPAD3 0x63
#define VK_NUMPAD4 0x64
#define VK_NUMPAD5 0x65
#define VK_NUMPAD6 0x66
#define VK_NUMPAD7 0x67
#define VK_NUMPAD8 0x68
#define VK_NUMPAD9 0x69
#define VK_MULTIPLY 0x6A
#define VK_ADD 0x6B
#define VK_SEPARATOR 0x6C
#define VK_SUBTRACT 0x6D
#define VK_DECIMAL 0x6E
#define VK_DIVIDE 0x6F
#define VK_F1 0x70
#define VK_F2 0x71
#define VK_F3 0x72
#define VK_F4 0x73
#define VK_F5 0x74
#define VK_F6 0x75
#define VK_F7 0x76
#define VK_F8 0x77
#define VK_F9 0x78
#define VK_F10 0x79
#define VK_F11 0x7A
#define VK_F12 0x7B
#define VK_F13 0x7C
#define VK_F14 0x7D
#define VK_F15 0x7E
#define VK_F16 0x7F
#define VK_F17 0x80
#define VK_F18 0x81
#define VK_F19 0x82
#define VK_F20 0x83
#define VK_F21 0x84
#define VK_F22 0x85
#define VK_F23 0x86
#define VK_F24 0x87
#define VK_NUMLOCK 0x90
#define VK_SCROLL 0x91
#define VK_LSHIFT 0xA0
#define VK_RSHIFT 0xA1
#define VK_LCONTROL 0xA2
#define VK_RCONTROL 0xA3
#define VK_LMENU 0xA4
#define VK_RMENU 0xA5
#if (WINVER >= 0x0400)
#define VK_PROCESSKEY 0xE5
#endif /* WINVER >= 0x0400 */
#define VK_ATTN 0xF6
#define VK_CRSEL 0xF7
#define VK_EXSEL 0xF8
#define VK_EREOF 0xF9
#define VK_PLAY 0xFA
#define VK_ZOOM 0xFB
#define VK_NONAME 0xFC
#define VK_PA1 0xFD
#define VK_OEM_CLEAR 0xFE
#define SC_SIZE 0xF000
#define SC_MOVE 0xF010
#define SC_MINIMIZE 0xF020
#define SC_MAXIMIZE 0xF030
#define SC_NEXTWINDOW 0xF040
#define SC_PREVWINDOW 0xF050
#define SC_CLOSE 0xF060
#define SC_VSCROLL 0xF070
#define SC_HSCROLL 0xF080
#define SC_MOUSEMENU 0xF090
#define SC_KEYMENU 0xF100
#define SC_ARRANGE 0xF110
#define SC_RESTORE 0xF120
#define SC_TASKLIST 0xF130
#define SC_SCREENSAVE 0xF140
#define SC_HOTKEY 0xF150
#define DS_ABSALIGN 0x01L
#define DS_SYSMODAL 0x02L
#define DS_LOCALEDIT 0x20L
#define DS_SETFONT 0x40L
#define DS_MODALFRAME 0x80L
#define DS_NOIDLEMSG 0x100L
#define DS_SETFOREGROUND 0x200L
#ifdef _MAC
#define DS_WINDOWSUI 0x8000L
#endif
#if (WINVER >= 0x0400)
#define DS_3DLOOK 0x0004L
#define DS_FIXEDSYS 0x0008L
#define DS_NOFAILCREATE 0x0010L
#define DS_CONTROL 0x0400L
#define DS_CENTER 0x0800L
#define DS_CENTERMOUSE 0x1000L
#define DS_CONTEXTHELP 0x2000L
#endif
#define SS_LEFT 0x00000000L
#define SS_CENTER 0x00000001L
#define SS_RIGHT 0x00000002L
#define SS_ICON 0x00000003L
#define SS_BLACKRECT 0x00000004L
#define SS_GRAYRECT 0x00000005L
#define SS_WHITERECT 0x00000006L
#define SS_BLACKFRAME 0x00000007L
#define SS_GRAYFRAME 0x00000008L
#define SS_WHITEFRAME 0x00000009L
#define SS_SIMPLE 0x0000000BL
#define SS_LEFTNOWORDWRAP 0x0000000CL
#define SS_BITMAP 0x0000000EL
#if (WINVER >= 0x0400)
#define SS_OWNERDRAW 0x0000000DL
#define SS_ENHMETAFILE 0x0000000FL
#define SS_ETCHEDHORZ 0x00000010L
#define SS_ETCHEDVERT 0x00000011L
#define SS_ETCHEDFRAME 0x00000012L
#endif
#define SS_NOPREFIX 0x00000080L
#if (WINVER >= 0x0400)
#define SS_NOTIFY 0x00000100L
#endif
#define SS_CENTERIMAGE 0x00000200L
#if (WINVER >= 0x0400)
#define SS_RIGHTJUST 0x00000400L
#define SS_REALSIZEIMAGE 0x00000800L
#define SS_SUNKEN 0x00001000L
#endif
#define BS_PUSHBUTTON 0x00000000L
#define BS_DEFPUSHBUTTON 0x00000001L
#define BS_CHECKBOX 0x00000002L
#define BS_AUTOCHECKBOX 0x00000003L
#define BS_RADIOBUTTON 0x00000004L
#define BS_3STATE 0x00000005L
#define BS_AUTO3STATE 0x00000006L
#define BS_GROUPBOX 0x00000007L
#define BS_USERBUTTON 0x00000008L
#define BS_AUTORADIOBUTTON 0x00000009L
#define BS_OWNERDRAW 0x0000000BL
#define BS_LEFTTEXT 0x00000020L
#if (WINVER >= 0x0400)
#define BS_TEXT 0x00000000L
#define BS_ICON 0x00000040L
#define BS_BITMAP 0x00000080L
#define BS_LEFT 0x00000100L
#define BS_RIGHT 0x00000200L
#define BS_CENTER 0x00000300L
#define BS_TOP 0x00000400L
#define BS_BOTTOM 0x00000800L
#define BS_VCENTER 0x00000C00L
#define BS_PUSHLIKE 0x00001000L
#define BS_MULTILINE 0x00002000L
#define BS_NOTIFY 0x00004000L
#define BS_FLAT 0x00008000L
#define BS_RIGHTBUTTON BS_LEFTTEXT
#endif
#define ES_LEFT 0x00000000L
#define ES_CENTER 0x00000001L
#define ES_RIGHT 0x00000002L
#define ES_MULTILINE 0x00000004L
#define ES_UPPERCASE 0x00000008L
#define ES_LOWERCASE 0x00000010L
#define ES_PASSWORD 0x00000020L
#define ES_AUTOVSCROLL 0x00000040L
#define ES_AUTOHSCROLL 0x00000080L
#define ES_NOHIDESEL 0x00000100L
#define ES_OEMCONVERT 0x00000400L
#define ES_READONLY 0x00000800L
#define ES_WANTRETURN 0x00001000L
#if (WINVER >= 0x0400)
#define ES_NUMBER 0x2000L
#endif
#define SBS_HORZ 0x0000L
#define SBS_VERT 0x0001L
#define SBS_TOPALIGN 0x0002L
#define SBS_LEFTALIGN 0x0002L
#define SBS_BOTTOMALIGN 0x0004L
#define SBS_RIGHTALIGN 0x0004L
#define SBS_SIZEBOXTOPLEFTALIGN 0x0002L
#define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
#define SBS_SIZEBOX 0x0008L
#if (WINVER >= 0x0400)
#define SBS_SIZEGRIP 0x0010L
#endif
#define LBS_NOTIFY 0x0001L
#define LBS_SORT 0x0002L
#define LBS_NOREDRAW 0x0004L
#define LBS_MULTIPLESEL 0x0008L
#define LBS_OWNERDRAWFIXED 0x0010L
#define LBS_OWNERDRAWVARIABLE 0x0020L
#define LBS_HASSTRINGS 0x0040L
#define LBS_USETABSTOPS 0x0080L
#define LBS_NOINTEGRALHEIGHT 0x0100L
#define LBS_MULTICOLUMN 0x0200L
#define LBS_WANTKEYBOARDINPUT 0x0400L
#define LBS_EXTENDEDSEL 0x0800L
#define LBS_DISABLENOSCROLL 0x1000L
#if (WINVER >= 0x0400)
#define LBS_NOSEL 0x4000L
#endif
#define LBS_STANDARD (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
#define CBS_SIMPLE 0x0001L
#define CBS_DROPDOWN 0x0002L
#define CBS_DROPDOWNLIST 0x0003L
#define CBS_OWNERDRAWFIXED 0x0010L
#define CBS_OWNERDRAWVARIABLE 0x0020L
#define CBS_AUTOHSCROLL 0x0040L
#define CBS_OEMCONVERT 0x0080L
#define CBS_SORT 0x0100L
#define CBS_HASSTRINGS 0x0200L
#define CBS_NOINTEGRALHEIGHT 0x0400L
#define CBS_DISABLENOSCROLL 0x0800L
#if (WINVER >= 0x0400)
#define CBS_UPPERCASE 0x2000L
#define CBS_LOWERCASE 0x4000L
#endif
// operation messages sent to DLGINIT
#define WM_USER 0x0400
#define LB_ADDSTRING (WM_USER+1)
#define CB_ADDSTRING (WM_USER+3)
#if (WINVER >= 0x0400)
#define HDS_HORZ 0x00000000
#define HDS_BUTTONS 0x00000002
#define HDS_HIDDEN 0x00000008
#define TTS_ALWAYSTIP 0x01
#define TTS_NOPREFIX 0x02
#define SBARS_SIZEGRIP 0x0100
#define TBS_AUTOTICKS 0x0001
#define TBS_VERT 0x0002
#define TBS_HORZ 0x0000
#define TBS_TOP 0x0004
#define TBS_BOTTOM 0x0000
#define TBS_LEFT 0x0004
#define TBS_RIGHT 0x0000
#define TBS_BOTH 0x0008
#define TBS_NOTICKS 0x0010
#define TBS_ENABLESELRANGE 0x0020
#define TBS_FIXEDLENGTH 0x0040
#define TBS_NOTHUMB 0x0080
#define UDS_WRAP 0x0001
#define UDS_SETBUDDYINT 0x0002
#define UDS_ALIGNRIGHT 0x0004
#define UDS_ALIGNLEFT 0x0008
#define UDS_AUTOBUDDY 0x0010
#define UDS_ARROWKEYS 0x0020
#define UDS_HORZ 0x0040
#define UDS_NOTHOUSANDS 0x0080
#define CCS_TOP 0x00000001L
#define CCS_NOMOVEY 0x00000002L
#define CCS_BOTTOM 0x00000003L
#define CCS_NORESIZE 0x00000004L
#define CCS_NOPARENTALIGN 0x00000008L
#define CCS_NOHILITE 0x00000010L
#define CCS_ADJUSTABLE 0x00000020L
#define CCS_NODIVIDER 0x00000040L
#define LVS_ICON 0x0000
#define LVS_REPORT 0x0001
#define LVS_SMALLICON 0x0002
#define LVS_LIST 0x0003
#define LVS_TYPEMASK 0x0003
#define LVS_SINGLESEL 0x0004
#define LVS_SHOWSELALWAYS 0x0008
#define LVS_SORTASCENDING 0x0010
#define LVS_SORTDESCENDING 0x0020
#define LVS_SHAREIMAGELISTS 0x0040
#define LVS_NOLABELWRAP 0x0080
#define LVS_AUTOARRANGE 0x0100
#define LVS_EDITLABELS 0x0200
#define LVS_NOSCROLL 0x2000
#define LVS_ALIGNTOP 0x0000
#define LVS_ALIGNLEFT 0x0800
#define LVS_ALIGNMASK 0x0c00
#define LVS_OWNERDRAWFIXED 0x0400
#define LVS_NOCOLUMNHEADER 0x4000
#define LVS_NOSORTHEADER 0x8000
#define TVS_HASBUTTONS 0x0001
#define TVS_HASLINES 0x0002
#define TVS_LINESATROOT 0x0004
#define TVS_EDITLABELS 0x0008
#define TVS_DISABLEDRAGDROP 0x0010
#define TVS_SHOWSELALWAYS 0x0020
#define TCS_FORCEICONLEFT 0x0010
#define TCS_FORCELABELLEFT 0x0020
#define TCS_SHAREIMAGELISTS 0x0040
#define TCS_TABS 0x0000
#define TCS_BUTTONS 0x0100
#define TCS_SINGLELINE 0x0000
#define TCS_MULTILINE 0x0200
#define TCS_RIGHTJUSTIFY 0x0000
#define TCS_FIXEDWIDTH 0x0400
#define TCS_RAGGEDRIGHT 0x0800
#define TCS_FOCUSONBUTTONDOWN 0x1000
#define TCS_OWNERDRAWFIXED 0x2000
#define TCS_TOOLTIPS 0x4000
#define TCS_FOCUSNEVER 0x8000
#define ACS_CENTER 0x0001
#define ACS_TRANSPARENT 0x0002
#define ACS_AUTOPLAY 0x0004
#endif // (WINVER >= 0x0400)
// 32-bit language/sub-language identifiers
#ifndef LANG_NEUTRAL
// Primary language IDs.
#define LANG_NEUTRAL 0x00
#define LANG_BULGARIAN 0x02
#define LANG_CHINESE 0x04
#define LANG_CROATIAN 0x1a
#define LANG_CZECH 0x05
#define LANG_DANISH 0x06
#define LANG_DUTCH 0x13
#define LANG_ENGLISH 0x09
#define LANG_FINNISH 0x0b
#define LANG_FRENCH 0x0c
#define LANG_GERMAN 0x07
#define LANG_GREEK 0x08
#define LANG_HUNGARIAN 0x0e
#define LANG_ICELANDIC 0x0f
#define LANG_ITALIAN 0x10
#define LANG_JAPANESE 0x11
#define LANG_KOREAN 0x12
#define LANG_NORWEGIAN 0x14
#define LANG_POLISH 0x15
#define LANG_PORTUGUESE 0x16
#define LANG_ROMANIAN 0x18
#define LANG_RUSSIAN 0x19
#define LANG_SLOVAK 0x1b
#define LANG_SLOVENIAN 0x24
#define LANG_SPANISH 0x0a
#define LANG_SWEDISH 0x1d
#define LANG_TURKISH 0x1f
#endif //!LANG_NEUTRAL
#ifndef SUBLANG_NEUTRAL
// Sublanguage IDs.
#define SUBLANG_NEUTRAL 0x00
#define SUBLANG_DEFAULT 0x01
#define SUBLANG_SYS_DEFAULT 0x02
#define SUBLANG_CHINESE_TRADITIONAL 0x01
#define SUBLANG_CHINESE_SIMPLIFIED 0x02
#define SUBLANG_CHINESE_HONGKONG 0x03
#define SUBLANG_CHINESE_SINGAPORE 0x04
#define SUBLANG_DUTCH 0x01
#define SUBLANG_DUTCH_BELGIAN 0x02
#define SUBLANG_ENGLISH_US 0x01
#define SUBLANG_ENGLISH_UK 0x02
#define SUBLANG_ENGLISH_AUS 0x03
#define SUBLANG_ENGLISH_CAN 0x04
#define SUBLANG_ENGLISH_NZ 0x05
#define SUBLANG_ENGLISH_EIRE 0x06
#define SUBLANG_FRENCH 0x01
#define SUBLANG_FRENCH_BELGIAN 0x02
#define SUBLANG_FRENCH_CANADIAN 0x03
#define SUBLANG_FRENCH_SWISS 0x04
#define SUBLANG_GERMAN 0x01
#define SUBLANG_GERMAN_SWISS 0x02
#define SUBLANG_GERMAN_AUSTRIAN 0x03
#define SUBLANG_ITALIAN 0x01
#define SUBLANG_ITALIAN_SWISS 0x02
#define SUBLANG_NORWEGIAN_BOKMAL 0x01
#define SUBLANG_NORWEGIAN_NYNORSK 0x02
#define SUBLANG_PORTUGUESE 0x02
#define SUBLANG_PORTUGUESE_BRAZILIAN 0x01
#define SUBLANG_SPANISH 0x01
#define SUBLANG_SPANISH_MEXICAN 0x02
#define SUBLANG_SPANISH_MODERN 0x03
#endif //!SUBLANG_NEUTRAL
#ifdef APSTUDIO_INVOKED
#undef APSTUDIO_HIDDEN_SYMBOLS
#endif
#define IDOK 1
#define IDCANCEL 2
#define IDABORT 3
#define IDRETRY 4
#define IDIGNORE 5
#define IDYES 6
#define IDNO 7
#if (WINVER >= 0x0400)
#define IDCLOSE 8
#define IDHELP 9
#endif
#ifdef IDC_STATIC
#undef IDC_STATIC
#endif
#define IDC_STATIC (-1)
#ifdef _AFX_MINREBUILD
#pragma component(minrebuild, on)
#endif

@ -1534,7 +1534,7 @@ TNCRunning:
sprintf(Msg, "Connect Failed for WinRPR socket - error code = %d Port %d\n",
WSAGetLastError(), htons(TNC->destaddr.sin_port));
WritetoConsoleLocal(Msg);
// WritetoConsoleLocal(Msg);
sprintf(TNC->WEB_COMMSSTATE, "Connection to TNC failed");
MySetWindowText(TNC, TNC->xIDC_COMMSSTATE, TNC->WEB_COMMSSTATE);

@ -36,6 +36,7 @@
#include <malloc.h>
#include <memory.h>
#include <Psapi.h>
#include "bpq32.h"
#define BPQICON 400
@ -70,17 +71,6 @@ int addrlen = sizeof(struct sockaddr_in);
BOOL MinimizetoTray=FALSE;
VOID __cdecl Debugprintf(const char * format, ...)
{
char Mess[10000];
va_list(arglist);
va_start(arglist, format);
vsprintf(Mess, format, arglist);
strcat(Mess, "\r\n");
OutputDebugString(Mess);
return;
}
char * strlop(char * buf, char delim)
{
@ -527,7 +517,7 @@ HANDLE OpenCOMPort(char * pPort, int speed, BOOL SetDTR, BOOL SetRTS, BOOL Quiet
else
{
sprintf(buf,"%s Setup Failed %d ", pPort, GetLastError());
OutputDebugString(buf);
Debugprintf(buf);
CloseHandle(fd);
return 0;
}

@ -72,7 +72,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="WS2_32.Lib Psapi.lib"
AdditionalDependencies="WS2_32.Lib Psapi.lib Win32bits\bpq32.lib"
OutputFile="c:\DevProgs\bpq32\WinmorControl.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
@ -169,7 +169,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="WS2_32.Lib Psapi.lib"
AdditionalDependencies="WS2_32.Lib Psapi.lib Win32bits\bpq32.lib"
OutputFile="c:\DevProgs\bpq32\WinmorControl.exe"
LinkIncremental="1"
SuppressStartupBanner="true"

@ -270,6 +270,13 @@ char * APIENTRY GetLOC();
uint64_t APIENTRY GetPortFrequency(int PortNo, char * FreqString);
VOID APIENTRY RealCloseAllPrograms();
VOID APIENTRY CloseAllPrograms();
VOID __cdecl Debugprintf(const char * format, ...);
VOID APIENTRY OpenDebugLog();
VOID APIENTRY CloseDebugLog();
#else
struct PORTCONTROL * (FAR WINAPI * GetPortTableEntryFromPortNum) (int portnum);

@ -400,9 +400,7 @@ static size_t ExtProc(int fn, int port, PMESSAGE buff)
if (len > MAXDATA)
{
sprintf(errmsg,"BPQAXIP Invalid Msg Len=%d Source=%s",len,inet_ntoa(RXaddr.rxaddr.sin_addr));
OutputDebugString(errmsg);
DumpFrameInHex(&rxbuff[20], len);
Debugprintf(errmsg,"BPQAXIP Invalid Msg Len=%d Source=%s",len,inet_ntoa(RXaddr.rxaddr.sin_addr));
return 0;
}
@ -458,8 +456,7 @@ static size_t ExtProc(int fn, int port, PMESSAGE buff)
// CRC Error
//
sprintf(errmsg,"BPQAXIP Invalid CRC=%d Source=%s",crc,inet_ntoa(RXaddr.rxaddr.sin_addr));
OutputDebugString(errmsg);
Debugprintf(errmsg,"BPQAXIP Invalid CRC=%d Source=%s",crc,inet_ntoa(RXaddr.rxaddr.sin_addr));
return (0);
}
@ -503,9 +500,7 @@ static size_t ExtProc(int fn, int port, PMESSAGE buff)
if (len > MAXDATA)
{
sprintf(errmsg,"BPQAXIP Invalid Msg Len=%d Source=%s Port %d",len,inet_ntoa(RXaddr.rxaddr.sin_addr),PORT->udpport[i]);
OutputDebugString(errmsg);
DumpFrameInHex(&rxbuff[0], len);
Debugprintf(errmsg,"BPQAXIP Invalid Msg Len=%d Source=%s Port %d",len,inet_ntoa(RXaddr.rxaddr.sin_addr),PORT->udpport[i]);
return 0;
}
@ -2731,24 +2726,6 @@ int Update_MH_KeepAlive(struct AXIPPORTINFO * PORT, struct in_addr ipad, char pr
}
int DumpFrameInHex(unsigned char * msg, int len)
{
char errmsg[100];
int i=0;
for (i=0;i<len;i+=16)
{
sprintf(errmsg,"%04x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x ",
i, msg[i], msg[i+1],msg[i+2],msg[i+3],msg[i+4],msg[i+5],msg[i+6],msg[i+7],
msg[i+8],msg[i+9],msg[i+10],msg[i+11],msg[i+12],msg[i+13],msg[i+14],msg[i+15]);
OutputDebugString(errmsg);
}
return 0;
}
int GetMessageFromBuffer(struct AXIPPORTINFO * PORT, char * Buffer)
{
struct arp_table_entry * sockptr;
@ -3052,7 +3029,6 @@ VOID TCPConnectThread(void * Param)
//
arp->TCPState = TCPConnected;
OutputDebugString("AXTCP Connected\r\n");
ioctl (arp->TCPSock, FIONBIO, &param);
Alerted = 0;
}
@ -3065,10 +3041,8 @@ VOID TCPConnectThread(void * Param)
if (Alerted == 0)
{
i = sprintf(Msg, "Connect Failed for AX/TCP port %d - error code = %d\n", htons(arp->destaddr.sin_port), err);
WritetoConsole(Msg);
OutputDebugString(Msg);
Alerted = 1;
Debugprintf("Connect Failed for AX/TCP port %d - error code = %d", htons(arp->destaddr.sin_port), err);
Alerted = 1;
}
closesocket(arp->TCPSock);
arp->TCPSock = 0;

@ -363,7 +363,6 @@ int HDLCINIT(HDLCDATA * PORTVEC)
else
{
Init98(PORTVEC);
OutputDebugString("HDLC Win98 Return from Init98\n");
return 0;
}
@ -376,8 +375,6 @@ int Init98(HDLCDATA * PORTVEC)
Win98 = TRUE;
OutputDebugString("Init HDLC 98\n");
//
// Open HDLC Driver, send send config params
//
@ -394,32 +391,14 @@ int Init98(HDLCDATA * PORTVEC)
if (hDevice == INVALID_HANDLE_VALUE)
{
hDevice=0;
err=GetLastError();
sprintf(msg,"Error loading Driver \\\\.\\BPQHDLC.VXD - Error code %d\n",err);
OutputDebugString(msg);
MessageBox(NULL,msg,"BPQ32",MB_ICONSTOP);
WritetoConsole("Initialisation Failed");
return (FALSE);
}
// OutputDebugString("Calling GetVersion\n");
// fResult = DeviceIoControl(
// hDevice, // device handle
// 10,//DIOC_GETVERSION, // control code
// NULL,0,// input parameters
// bOutput, 4, &cb, // output parameters
// 0);
srand( (unsigned)time( NULL ) ); //Prime random no generator
}
OutputDebugString("Calling Initialize\n");
//
// Initialize Driver for this card and channel
@ -436,9 +415,6 @@ int Init98(HDLCDATA * PORTVEC)
memcpy(&PORTVEC->DRIVERPORTTABLE,bOutput,4);
Debugprintf("BPQ32 HDLC Driver Table ADDR %X", PORTVEC->DRIVERPORTTABLE);
OutputDebugString("Initialize Returned\n");
return (TRUE);
}
@ -607,8 +583,7 @@ int Init2K(HDLCDATA * PORTVEC)
err=GetLastError();
sprintf(msg,"Error Opening Driver \\device\\BPQHDLC - Error code %d\n", err);
OutputDebugString(msg);
Debugprintf("Error Opening Driver \\device\\BPQHDLC - Error code %d", err);
WritetoConsole(msg);

@ -60,6 +60,7 @@ void hookNodeStarted();
void hookNodeRunning();
void DeleteLogFiles(int Age);
void APIL2Trace(struct _MESSAGE * Message, char * Dirn);
DllExport VOID APIENTRY CloseDebugLog();
#include "configstructs.h"
@ -2253,6 +2254,7 @@ int TIMERINTERRUPT()
{
lastMinuteSecs = NOW;
CloseDebugLog();
L3MinuteTimerProc();
if (needAIS)

@ -148,7 +148,7 @@ char * SetupNodeHeader(struct DATAMESSAGE * Buffer);
VOID L4CONNECTFAILED(TRANSPORTENTRY * L4);
int CountFramesQueuedOnSession(TRANSPORTENTRY * Session);
VOID CLEARSESSIONENTRY(TRANSPORTENTRY * Session);
VOID __cdecl Debugprintf(const char * format, ...);
Dll VOID __cdecl Debugprintf(const char * format, ...);
int APIENTRY Restart();
int APIENTRY Reboot();

@ -179,11 +179,6 @@ int Sleep(int ms)
return 0;
}
VOID OutputDebugString(char * string)
{
syslog(LOG_DEBUG, "%s", string);
}
void closesocket(int sock)
{
if (sock)

@ -238,9 +238,6 @@ VOID md5(char *arg, unsigned char * checksum);
int APIENTRY SendRaw(int port, char * msg, int len);
VOID OutputDebugString(char * string);
#endif
#ifdef APIENTRY

@ -918,7 +918,7 @@ int BPQTRACE(MESSAGE * Msg, BOOL TOAPRS);
static int ProcessLine(char * buf, int Port);
VOID __cdecl Debugprintf(const char * format, ...);
Dll VOID __cdecl Debugprintf(const char * format, ...);
VOID __cdecl Consoleprintf(const char * format, ...);
extern BOOL MinimizetoTray;

Loading…
Cancel
Save

Powered by TurnKey Linux.