System information

442
Observer Suite Custom Decode Kit
The Custom Decode DLL entry point functions: CustomDecodeFrame(),
CustomDecodeIP(), CustomDecodeUDP(), and CustomDecodeTCP() are called from
Observer to permit a programmer to add a custom decode.
For example, if you decide to write a decode for UDP port 8765, when your
CustomDecodeUDP() function is called, you have to check in the UDP
header whether or not the port is 8765.
If it is, you do your decode, adding lines to the Tree Control in a way similar
to the CustomDecode sample project. When you are finished, you return
TRUE from CustomDecodeUDP().
If the port is not 8765, just return FALSE from CustomDecodeUDP() and
Observer will perform the default processing. See the CustomDecode
sample project code for more details.
Using the Custom Decode Kit
The DLL code can be built using the Microsoft Development Studio C++ compiler. The
DLL entry points are of “extern C” type for maximum compatibility.
You can use any other C or C++ compiler as long as the entry point API
function definitions are preserved intact and the functions are explicitly
exported in a .def file.
A new decode DLL can be renamed to something other than CustomDecode.DLL by
changing the output module name and a LIBRARY name in the CustomDecode.DEF file.
It is necessary to use multiple, distinct names if Observer Suite is going to use multiple
decode DLLs.
Currently, Observer supports up to eight (8) simultaneously loaded custom
decode DLLs.
The code can be written in generic C++ or the programmer can create a DLL project with
MFC support and include in it CustomDecode.cpp, CustomDecode.h, CustomDecode.def,
UserDefinedFunctions.cpp and UserDefinedFunctions.h. In this case, it will be necessary
to name the project something other than CustomDecode and to delete the DllMain()
function code from CustomDecode.cpp file.
Files Included
The CustomDecode project includes the following files:
CustomDecode.cpp, CustomDecode.h, and CustomDecode.def
These files include four entry point functions, defined as follows:
//decode starting at a frame protocol header
extern “C” BOOL FAR PASCAL CustomDecodeFrame
void * pFrameStart,