Prerequisites for Developing Ethereal

 < Day Day Up > 



The first step in the development process is to acquire the Ethereal source. You can download many different distributions from the Ethereal website, such as the currently released source code or the last nightly backup of the source code. You can also utilize the Concurrent Versions System (CVS) to keep up to date throughout your development process. CVS is the most risky, compared to released versions of Ethereal, because you are compiling code that hasn’t been fully tested. Generally, however, the CVS code is of very high quality.

Even if you have an issue with the current CVS code, you can generally get one of the members of the Ethereal mailing list (ethereal-dev@ethereal.com) to make a quick change to resolve the issue. CVS gives you access to code changes as they are checked into the master build. It is the most up–to-date, but can contain unidentified bugs. Please keep in mind that the CVS distribution can be and is routinely updated as well. You might develop with the current released code and then find out that a specific function you are working with has changed. Instructions for utilizing the latest builds and CVS can also be found at the www.ethereal.com website.

Before you can add to or modify Ethereal, you must be able to build the application from source. To build from source you will need to acquire additional libraries and tools. Ethereal is a multiplatform application, meaning that it can run on many different operating systems. You will need to be able to build on the particular operating system that you will be developing on.

start sidebar
Notes from the Underground…
Development Note

Because of the wide range of development on the Ethereal project, there may already be work in progress on a specific feature or protocol dissector. The Ethereal developer mailing list (ethereal-dev@ethereal.com.) is a good way to determine if work is already being done in a specific area. Questions can be posted to the ethereal-dev mailing list before you start work on a specific protocol dissector or feature. You can consult the Ethereal website for more information on the available mailing lists at www.ethereal.com.

end sidebar

It is also important to understand that Ethereal is developed and built using a number of different programming languages. This includes many UNIX-based programs and shell scripts. For example, several modules within Ethereal are written in python and Perl. Although it may not be necessary for you to be proficient in each programming language, you might find times where you need to understand enough about the language to make a simple change. A majority of the code base for Ethereal is ANSI-C. The requirement for ANSI-C is due to the portability of the code to multiple operating system platforms. Special care should be taken when writing in C to use only those functions that are defined as ANSI-C and are portable. You should be able to use just about any C compiler with the Ethereal source. This would include GNU C Compiler (gcc) on Linux, as well as Microsoft Visual C++ on Windows.

Skills

To build a new dissector or modify the main application, you will need to be able to program in C. However, please keep in mind that modifications to existing dissectors may require you to be knowledgeable in another language.

start sidebar
Damage & Defense
Portability

Before starting any work you need to read the portability section 1.1.1 of the README.developer document contained in the doc directory of the source distribution. The word portability is used in reference to the steps a developer should take to ensure that Ethereal source can be compiled on all of the supported operating systems. For example, you wouldn’t want to use a function that only exists on a win32 platform. This would cause Ethereal source to not compile or build correctly on the other supported operating systems. Typically, when a program is written to one operating system platform and then made to run on a different platform, the process is called porting. This is where the name portability is derived from.

end sidebar

Modifications to the Ethereal GUI will require some knowledge of GTK. The GTK website at www.gtk.org, contains online and downloadable tutorials for programming in GTK.

Contributions to the Ethereal project come from many different levels of developers. Some are novices while others might be considered to be experts. However, the overall Ethereal project is maintained by a group of highly experienced developers. New additions and or contributions are first reviewed by this group and then incorporated into the source distribution following any necessary changes. In some cases, the individual who reviews the changes might make a recommendation to the original developer for a specific change, or in other cases they may make the changes themselves.

Tools/Libraries

In most cases, you will need the developer kit for access to necessary libraries. A developer kit is different from the normal binary distribution. Generally, the developer package includes the compiled binaries for the operating system it was built for. For example, since Ethereal utilizes the GTK libraries for its GUI implementation, you will need to ensure that you have the developer kit for GTK. You will also need to make sure that you download the correct developer kit for the operating system that you are going to develop on. It is important to try to use the latest released version of the developer kit if possible. Although you might be able to build Ethereal with an older set of libraries, the results of the application running might not be as expected. However, in some cases this might not be an option. Some operating systems only support certain versions of support libraries. In general, you can consult the Ethereal developer mailing list or the developer section of the www.ethereal.com website.

Win32 ports of the required libraries are not necessarily located at their respective project site. For example, the win32 port for the libpcap library is called WinPcap. The following web pages list places where you can look for Win32 library ports. The www.ethereal.com/distribution/win32/development web page contains most of what you will need, but if you want to build with GTK 2.x you will need additional library packages not listed on the Ethereal website. Refer to the web pages located at www.gimp.org/~tml/gimp/win32.for GTK 2.x information and access to the Win32 ports.

When building Ethereal, you will need the GTK and GLIB libraries. Ethereal can be built using the older GTK 1.2, 1.3, or the newer GTK 2.x versions. The newer 2.x versions of GTK add more font control and have a better look and feel. These libraries can be downloaded from www.gtk.org. The installation chapter in this book identifies some of these issues when installing on Solaris and Red Hat distributions.

The console version of Ethereal, called Tethereal, only requires the GLIB libraries. If you will only be building the Tethereal application, you will not need GTK.

If you will be building with packet capture support in Ethereal or Tethereal, you will need to make sure that you have the libpcap libraries from: www.tcpdump.org. Without packet capture support, users of the compiled program will only be able to view packet trace files. They will not be able to perform new packet captures. Win32 developers will need the WinPcap libraries instead of libpcap. These can be downloaded from http://winpcap.polito.it/.

The following is a list of libraries needed to build Ethereal. Remember that you will need to download the developer kit to acquire the necessary libraries for your operating system. Some packages are optional and can be linked to add additional features. UNIX/Linux operating systems will detect the installed libraries by the automake process. Automake will identify the library packages that can be included when you build Ethereal. On Win32 based computers the config.nmake file should be modified to define what libraries that you wish to include in the build process. These libraries will then be added to the final binary during the linker process of the build.

  • glib Low-level core library for GTK (required).

  • gettext GNU language conversion (required by glib).

  • libiconv Character set conversion library (required by glib).

  • GTK GIMP toolkit for creating graphical user interfaces (required for Ethereal build).

  • libpcap Packet capture library for UNIX/Linux-based operating systems.

  • WinPcap Packet capture library for Win32 based operating systems (optional).

  • ADNS GNU Advanced DNS client library (optional) adds DNS lookup support.

  • net-snmp Simple Network Management Protocol (SNMP) library (optional) adds SNMP support.

  • pcre Perl Compatible Regular Expressions library (optional) adds Perl expression filters.

  • zlib File compression library (optional) adds compressed file support.

If you will be building with GTK version 1.2 or 1.3, no additional libraries are needed for GTK. Otherwise, when building with GTK 2.x you will need the following additional libraries:

  • atk Accessibility toolkit (required).

  • pango Internalization of text (required).

Windows users must choose to either attempt to build from within cygwin using gcc or with a Win32-based compiler such as Microsoft’s Visual C++ (MSVC++). They will also need to download a number of additional libraries. The default location specified in the Ethereal distribution for the libraries on Win32 is C:\ethereal-win32-libs. You should download and extract each required library to this location. Ethereal’s scripts will then locate the libraries at build time. Otherwise, you will need to modify the config.nmake file located in the main distribution directory to point to the correct location for each library.

Tools that you might need are specific to the operating system in which you need them to run. The Ethereal compile and build process utilizes a number of script files. These scripts will require a number of tools to run successfully. Most of the tools have their roots in the UNIX/Linux operating systems. To compile and build Ethereal on non-UNIX-based operating systems you will need to have access to similar tools.

Windows users will also need to install cygwin. Cygwin is a Linux-like environment for Windows-based computers. It gives both a Linux Application Program Interface (API) emulator as well as a set of Linux-based tools. These tools are what allow the scripts utilized by Ethereal during the build process to work on Windows-based computers. Cygwin can be downloaded and installed from www.cygwin.com.

Windows users will also need to download Python. Python can be downloaded and installed from www.python.org/.

Most UNIX and Linux-based operating systems will include a C compiler and many of the required tools needed to build Ethereal.

The following is a list of tools needed to compile and build Ethereal:

  • Cygwin Provides UNIX/Linux tools for Win32 developers. This is not needed for UNIX/Linux.

  • Perl Needed for all operating systems.

  • pod2man Part of Perl.

  • pod2html Part of Perl.

  • Python Needed for all operating systems.

  • Flex Needed for all operating systems.

  • Bison Needed for all operating systems.

start sidebar
Tools & Traps…
Building on UNIX and Linux-Based Operating Systems

Detailed instructions for building the Ethereal binaries from source are included in the INSTALL file, located in the main source directory. Chapter 3 of this book also outlines the build process on RedHat Linux.

Building on Windows-Based Operating Systems

Detailed instructions for building the Ethereal binaries from source are included in the file README.win32, located in the main source directory. This file includes instructions on building on both MSVC++ and Cygwin.It is also important to use CMD.EXE and not COMMAND.COM when attempting to build Ethereal. The program CMD.EXE provides long name support whereas the older COMMAND.COM is limited to 8.3 file naming conventions. Ethereal’s source contains long named files and is not supported with command.com.

Windows users may need to update or change the default environment variables for their compiler to locate additional support libraries. For example, when building Ethereal, the wiretap source must include header files for winsock support. It is important that the build process can locate the correct include files. Validate that the following user environment variables are defined correctly:

  • Include

  • Lib

    It’s important to also make sure that cygwin is located in the user path environment variable to locate the necessary cygwin executables during the build process. These executables are the Windows equivalent of necessary UNIX/Linux binaries. For example bison.exe is the equivalent of its UNIX/Linux counterpart bison.

end sidebar



 < Day Day Up > 



Ethereal Packet Sniffing
Ethereal Packet Sniffing (Syngress)
ISBN: 1932266828
EAN: 2147483647
Year: 2004
Pages: 105
Authors: Syngress

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net