Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 19 commits into from
Aug 22, 2024

Conversation

Dimi1010
Copy link
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.

Copy link

codecov bot commented Aug 12, 2024

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.

Pcap++/header/PcapDevice.h Outdated Show resolved Hide resolved
Pcap++/header/PcapDevice.h Outdated Show resolved Hide resolved
Pcap++/header/PcapDevice.h Outdated Show resolved Hide resolved
Pcap++/header/PcapDevice.h Outdated Show resolved Hide resolved
Pcap++/header/PcapDevice.h Outdated Show resolved Hide resolved
Pcap++/header/PcapDevice.h Show resolved Hide resolved
Pcap++/header/PcapDevice.h Outdated Show resolved Hide resolved
Pcap++/header/PcapDevice.h Outdated Show resolved Hide resolved
@Dimi1010 Dimi1010 requested review from seladb and tigercosmos August 21, 2024 06:35
@tigercosmos tigercosmos merged commit a3a99cb into seladb:dev Aug 22, 2024
40 checks passed
@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