pcap
A packet capture API around pcap/wpcap
2.5.0
7.7M downloads/mo
#3578 most downloaded on crates.io
rust-pcap/pcap
What this package is like to depend on
Last release 8 days ago
15 Aug 2026
Ships fairly regularly
a new release about every 4 months
Some releases are documented
notes for 19 of 46 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
46 releases · first in 2015
2 releases in the last 12 months
see the full history below
Release timeline
46 releases · Mar 2015 to Aug 2026Releases
latest 46-
2.5.015 Aug 2026Release notes
Open source →Added
- Binding for
pcap_dispatchadded. It can be accessed via thedispatchcall on Activated captures and processes a batch of packets per call, making packet loss less likely in high traffic situations.
- Binding for
-
2.4.026 Nov 2025Release notes
Open source →Changed
- MSRV is now
1.64. - Binding for
pcap_breakloopadded. It can be accessed via thebreakloop_handlecall on Activated captures.
- MSRV is now
-
2.3.019 Jul 2025Release notes
Open source →Added
- Added
packet_header_size()for applications that need to know the size of internal typepcap_pkthdr(for instance to calculate exact send queue sizes).
- Added
-
2.2.001 Sep 2024Release notes
Open source →Added
- Added an implementation of
AsFdonCapture<Active>on non-Windows.
- Added an implementation of
-
2.1.027 Aug 2024 -
2.0.021 Apr 2024 -
1.3.015 Mar 2024Release notes
Open source →Added
- Binding for
pcap_loopadded. It can be accessed via thefor_eachcall on Activated captures.
- Binding for
-
1.2.019 Jan 2024 -
1.1.012 May 2023Release notes
Open source →Added
lending-iterUNSTABLE feature that introduces lending iterator using GATs.
Changed
- Examples in the docs have been fixed.
-
1.0.019 Nov 2022 -
0.11.001 Oct 2022Release notes
Open source →Added
SendQueue::queue_sg()can add scattered packets, as a slice ofstd::io::IoSlices, toSendQueues.
Changed
- Rename
sendqueue::Synctosendqueue::SendSyncto avoid collision withSyncin std's prelude. - Build script will fall back to
pkg-configif available andLIBPCAP_LIBDIRhasn't been explicitly set.
-
0.10.117 Aug 2022 -
0.10.016 Aug 2022Release notes
Open source →Added
- doc will now include all features.
- Support for sendqueues on Windows.
PacketStream::capture_mutto still be able to inject packets when usingPacketStream.Capture::iter()that return an iterator that use a codec likeCapture::stream().Packet<Dead>::dead_with_precisionto enable creating a pcap with nanosecond precision.flagsfield toDevice.
Removed
BpfProgramno longer haveCloneimplementation see #261
Changed
- MSRV is now
1.41.0. PacketStreamhas been moved from modstreamto therootof the crate.PacketCodechas been moved from modstreamto therootof the crate.PacketCodec::decode()no longer returns aResult.PacketCodec::Typehas been renamed toPacketCodec::Item.Device::lookupnow returnsResult<Option<Device>, Error>rather thanResult<Device, Error>.Ok(None)means that the lookup succeeded, but no suitable devices were available. This is consistent with libpcap.CaptureandSavefileno longer implement theSynctrait. The underlyinglibpcaplibrary does not promise thread-safe access for the same capture object from multiple threads.- Switched from
winapitowindows-sysfor Windows builds.windows-sysrequires rustc 1.46.0. Capture::nexthave been renamenext_packetto avoid any confusion withIterator::next.
Removed
- mod
streamis no longer public. docs-rsfeature.fullfeature.stream::SelectableFdandstream::PacketStream::newas they were only meant to be used internally.
-
0.9.214 Apr 2022Release notes
Open source →Changed
capture-streamrequires rustc version 1.49.0 due to dependency ontokio.
-
0.9.107 Nov 2021 -
0.9.012 Sep 2021Release notes
Open source →Added
savefile.flushsupport.
Changed
- Updated dependency
tokiofrom version 0.2 to 1.0. capture-streamrequires rustc version 1.45.0 due to dependency ontokio.
-
0.8.130 Dec 2020 -
0.8.030 Dec 2020Release notes
Open source →Added
Derive(Clone)toDevicestruct (#100).- Build-time
libpcapversion detection. - Support for immediate mode.
- Const value for Linktype (#145).
- Support for BPF compile.
Changed
- Opt into Rust 2018.
- Now minimum supported rustc version is 1.40.0.
- Updated dependency from deprecated
tokio-coretotokio0.2. - Updated dependency
futuresfrom version 0.1 to 0.3. - Feature
tokiorenamed tocapture-streambecause Cargo does not allow features and dependencies to have the same name. PCAP_LIBDIRrenamed toLIBPCAP_LIBDIRto distinguish thepcapcrate from thelibpcaplibrary.- All methods that construct objects out of a
RawFdare now unsafe. - All methods that take a raw pointer are now unsafe. Some of these functions
were renamed from
newtofrom_handleto underline this.
Removed
- Feature flags
pcap-savefile-append,pcap-fopen-offline-precision(replaced by build-timelibpcapversion detection).
-
0.7.004 Aug 2017 -
0.6.119 Jun 2017Nothing published for this version
-
0.6.020 May 2017Nothing published for this version
-
0.5.726 Apr 2016Nothing published for this version
-
0.5.621 Apr 2016Nothing published for this version
-
0.5.514 Apr 2016Nothing published for this version
-
0.5.407 Mar 2016Nothing published for this version
-
0.5.328 Feb 2016Nothing published for this version
-
0.5.214 Dec 2015Nothing published for this version
-
0.5.113 Dec 2015Nothing published for this version
-
0.5.029 Oct 2015Nothing published for this version
-
0.4.217 Sep 2015Nothing published for this version
-
0.4.112 Sep 2015Nothing published for this version
-
0.4.010 Sep 2015Nothing published for this version
-
0.3.307 Sep 2015Nothing published for this version
-
0.3.206 Aug 2015Nothing published for this version
-
0.3.104 Aug 2015Nothing published for this version
-
0.3.031 Jul 2015Nothing published for this version
-
0.2.327 Jul 2015Nothing published for this version
-
0.2.227 Jul 2015Nothing published for this version
-
0.2.120 Jul 2015Nothing published for this version
-
0.2.015 Jul 2015Nothing published for this version
-
0.1.317 Jun 2015Nothing published for this version
-
0.1.220 May 2015Nothing published for this version
-
0.1.103 Apr 2015Nothing published for this version
-
0.1.026 Mar 2015Nothing published for this version
-
0.0.211 Mar 2015Nothing published for this version
-
0.0.110 Mar 2015Nothing published for this version