Chapter 2: The Libpcap Library
Overview
URL: | http://www.tcpdump.org |
Primary author: | A consortium of talented people (originally from The Lawrence Berkeley National Laboratory) |
Component type: | C language library, packet capture |
License: | BSD |
Version profiled: | .0.7.1 |
Dependencies: | None |
Almost every disparate operating system provides different semantics on how to access low-level network packet-capturing functionality. These semantics are arcane and often mnemonic, making it complex to write portable code. The libpcap library addresses these concerns by providing a common highlevel application programming interface (API) into the packet-capturing framework of many operating systems. By standardizing the interface, libpcap provides an abstraction layer for the programmer, facilitating the rapid development of portable applications.Libpcap is an open-source, freely available C library providing a user-land interface for packet capture across a broad range of platforms. Applications utilizing libpcap include network statistics collection, network debugging, and-as we will see later-a strong foundation for advanced security monitoring and information collection suites. At this writing, libpcap has been ported to the latest versions of almost every commonly used operating system.While libpcap's main role is to provide a solid framework for live packet capture, it also offers additional functionality with strong support for packet filtering and offline capture file support.