-
Notifications
You must be signed in to change notification settings - Fork 684
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed BpfFilterWrapper to use smart pointers internally. (#1382)
* Changed BpfFilterWrapper to use unique_ptr with custom deleter instead of manually handling the raw bpf_program pointer. Added BpfProgramDeleter class to clean up bpf_program's held inside unique_ptr objects. * Marked deleter method as const. * Renamed namespace 'detail' to 'internal', merging it with the existing 'internal' namespace. * Added deleter struct for 'pcap_t' calling 'pcap_close'. Changed 'pcap_t' raw ptr to use smart pointer in 'setFilter'. * Changed bpf_program construction to utilize unique_ptrs everywhere. * Removed unnessesary call to `freeProgram`. * Added copy ctor and assignment operators as the inclusion of 'unique_ptr' disabled the implicitly declared ones. * Documentation update. * Simplified BpfFilterWrapper default ctor.
- Loading branch information
Showing
2 changed files
with
55 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters