Libtrace
Libtrace is a library for capturing and processing network packet traces. It supports many common input methods, including device capture and trace files, and multiple formats, including pcap, DAG and OS-native sockets. The libtrace API allows programmers to easily access packet header information without needing to concern themselves with the other headers that might be present in the packet. Libtrace also supports writing captured packets to network trace files using the pcap and ERF formats and comes bundled with a series of tools that perform most common trace manipulation tasks.