Introduction

Next Previous Top

2. Broad Overview

Libnet is a simple C library. It is designed to be small, efficient and easy to use. Libnet's main goal is portable packet creation and injection. At the time this manual was written, Libnet was in version 1.0.0 and had 15 different packet assemblers and two types of packet injection, IP-layer and link-layer (more on those below).

By itself, libnet is moderately useful. It can build and inject packets to the network. Libnet, however, has no provisions for packet capture. For this, one must look to libpcap [1]. Together, libnet and libpcap are powerful tools available to the network programmer.

Libnet 1.0.0 consists of about:

- 7600 lines of code
- 33 source files
- 12 include files
- 50 some-odd functions

This manual attempts to document as much of libnet as possible, but is probably not complete. It assumes you have a good working knowledge of C and the TCP/IP protocol suite, but since you're already here, you probably have all of those tools.

2.1 Ports

Libnet has been compiled and tested successfully on the following platforms:

- OpenBSD 2.5, 2.4, 2.3, 2.2 (i386)
- FreeBSD 3.3-STABLE, 3.2-RELEASE, 3.1-CURRENT, 3.0, 2.2 (i386)
- NetBSD 1.3.2 (i386)
- BSD/OS 3.x (i386)
- BSDi 3.0 (i386)
- Linux 2.2.x, 2.0.3x, 2.1.124 (i386, alpha) (libc: 2.4.x, glibc: 2.0.x)
- Solaris 7 (SPARC, gcc 2.7.2[13], 2.8.2), 2.6 (SPARC, gcc 2.8.2), 2.5.x (SPARC, gcc 2.7.2[13])
- IRIX 6.2
- MacOS 5.3rhapsody (powerpc)

If your platform is not listed, don't despair.. It might work! If it does, please drop me a line. If it doesn't and you port libnet to your platform, please send me diffs!

Libnet is not as yet portable to Microsoft operating systems.

2.2 Getting Started

Go get the library: http://www.packetfactory.net/libnet. Even if your operating system includes it, you might want to check and make sure you have the most recent version of libnet. Libnet uses GNU autoconf for precompilation configuration, to start it on its way, simply type `./configure.` From there, you'll want to build the library by running ``make`` in the same directory. If there are any errors or warnings, please send them to mike@infonexus.com.

Next Previous Top