Writing Security Tools and Exploits

The basics of a GUI tap module in Ethereal are the same as those for a line-mode tap module in Tethereal. However, in Ethereal, if you wish to produce output in the GUI, you must learn how to program the GTK+ library, the GUI library that Ethereal uses. This GUI library is used by Ethereal on all of the platforms it supports UNIX, Mac OS, and Windows.
To add a new tap module to Ethereal, we create a new C file in the GTK directory of the Ethereal source code. All Ethereal source files that are specific to the GTK+ library are in this directory. This segregates the files from Tethereal, the line-mode version of Ethereal. Put the name of our new tap module's C source file in makefile.common, in the ETHEREAL_TAP_SRC variable definition. Once it is there, both the UNIX build (including Mac OS) and the Windows build will build our tap module.
The tap module must provide a registration function that hooks the tap module into Ethereal's command-line interface (CLI) and Ethereal's GUI menu. The registration function's name should start with register_tap_listener and be defined so that the name of the function is at the beginning of the line. The Ethereal build uses a script, make-tapreg-dotc, in the top-level Ethereal directory to find all tap module registration functions. That is why the name of our registration function must conform...