Skip to content

Added a RAII PcapHandle wrapper class that manages a Pcap handle. - #1532

Merged
tigercosmos merged 19 commits into
seladb:devfrom
Dimi1010:feature/pcap_handle_wrapper
Aug 22, 2024
Merged

tigercosmos merged 19 commits into
seladb:devfrom
Dimi1010:feature/pcap_handle_wrapper

Conversation

@Dimi1010

Copy link
Copy Markdown
Collaborator

This PR adds a class PcapHandle that wraps a pcap_t* handle and manages the lifecycle of the handle via RAII mechanism, in a similar fashion to std::unique_ptr.

PS: The diff of PcapDevice.cpp is a bit messed up because the formatter ran on it... might be easier to review after #1516 has been merged.

@codecov

codecov Bot commented Aug 12, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 77.87611% with 25 lines in your changes missing coverage. Please review.

Project coverage is 82.92%. Comparing base (2e9aebb) to head (7a89dca).
Report is 1 commits behind head on dev.

Files Patch % Lines
Pcap++/src/PcapLiveDevice.cpp 54.54% 6 Missing and 4 partials ⚠️
Pcap++/src/PcapDevice.cpp 82.22% 7 Missing and 1 partial ⚠️
Pcap++/src/PcapRemoteDevice.cpp 0.00% 4 Missing ⚠️
Pcap++/src/WinPcapLiveDevice.cpp 62.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1532      +/-   ##
==========================================
- Coverage   82.93%   82.92%   -0.01%     
==========================================
  Files         273      273              
  Lines       46282    46343      +61     
  Branches     9459     9398      -61     
==========================================
+ Hits        38382    38430      +48     
- Misses       7056     7084      +28     
+ Partials      844      829      -15     
Flag Coverage Δ
fedora39 74.54% <60.00%> (+0.01%) ⬆️
macos-12 80.90% <67.53%> (+0.01%) ⬆️
macos-13 80.32% <67.53%> (+0.01%) ⬆️
macos-14 80.24% <67.53%> (+0.01%) ⬆️
mingw32 71.44% <52.00%> (-0.03%) ⬇️
mingw64 71.45% <52.00%> (-0.02%) ⬇️
npcap 84.89% <80.64%> (-0.02%) ⬇️
rhel94 74.31% <60.00%> (-0.03%) ⬇️
ubuntu2004 57.91% <56.92%> (+0.01%) ⬆️
ubuntu2004-zstd 58.03% <56.92%> (+0.01%) ⬆️
ubuntu2204 74.25% <60.00%> (-0.02%) ⬇️
ubuntu2204-icpx 58.43% <59.74%> (-0.01%) ⬇️
ubuntu2404 74.50% <60.00%> (-0.03%) ⬇️
unittest 82.92% <77.87%> (-0.01%) ⬇️
windows-2019 84.93% <81.05%> (+0.01%) ⬆️
windows-2022 84.93% <81.05%> (+<0.01%) ⬆️
winpcap 84.91% <80.43%> (+0.01%) ⬆️
xdp 49.30% <35.38%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread Pcap++/header/PcapDevice.h Outdated
Comment thread Pcap++/header/PcapDevice.h Outdated
Comment thread Pcap++/header/PcapDevice.h Outdated
Comment thread Pcap++/header/PcapDevice.h Outdated
Comment thread Pcap++/header/PcapDevice.h Outdated
Comment thread Pcap++/header/PcapDevice.h
Comment thread Pcap++/header/PcapDevice.h Outdated
Comment thread Pcap++/header/PcapDevice.h Outdated
@Dimi1010
Dimi1010 requested review from seladb and tigercosmos August 21, 2024 06:35
Comment thread Pcap++/src/PcapLiveDevice.cpp Outdated
@tigercosmos
tigercosmos merged commit a3a99cb into seladb:dev Aug 22, 2024
@Dimi1010
Dimi1010 deleted the feature/pcap_handle_wrapper branch August 22, 2024 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants