diff --git a/.codespellrc b/.codespellrc index f724530d45..65f2ea47f9 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,4 +1,4 @@ [codespell] -skip = *.dat,typos-config.toml,.git,./ci,./Dist,./mk,./Tests/ExamplesTest/expected_output,./Tests/ExamplesTest/pcap_examples,./Tests/Packet++Test/PacketExamples,./Tests/Pcap++Test/PcapExamples,./3rdParty/json,./3rdParty/OUIDataset/PCPP_OUIDataset.json +skip = *.dat,typos-config.toml,.git,./ci,./Dist,./mk,./Tests/ExamplesTest/expected_output,./Tests/ExamplesTest/pcap_examples,./Tests/Packet++Test/PacketExamples,./Tests/Pcap++Test/PcapExamples,./3rdParty,./Examples/PcapSearch/dirent-for-Visual-Studio ignore-words = codespell-ignore-list.txt count = diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cb939349d9..8de5f64aca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ exclude: '.*\.(pcap|pcapng|dat|txt)' fail_fast: false repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: check-case-conflict @@ -20,12 +20,12 @@ repos: args: ["--std=c++11", "--language=c++", "--suppressions-list=cppcheckSuppressions.txt", "--inline-suppr", "--force"] # - id: clang-format - repo: https://github.com/codespell-project/codespell - rev: v2.2.5 + rev: v2.2.6 hooks: - id: codespell pass_filenames: false - repo: https://github.com/crate-ci/typos - rev: v1.16.11 + rev: v1.16.19 hooks: - id: typos args: ['--config=typos-config.toml'] diff --git a/CMakeLists.txt b/CMakeLists.txt index afaa6c683a..b8a9b85986 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,6 +103,8 @@ option(PCAPPP_PACKAGE "Package Pcap++ could require a recent version of CMake" O set(CMAKE_CXX_STANDARD 11) # popen()/pclose() are not C++ standards set(CMAKE_CXX_EXTENSIONS ON) +# Set Position Independent Code for static libraries +set(CMAKE_POSITION_INDEPENDENT_CODE ON) # Usually on Windows PCAP_ROOT and Packet_ROOT are at the same location if(WIN32 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1b452d2267..3f83cbddd0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,7 @@ Every code contribution to this project is highly valued and appreciated. I enco - After you're done writing your code, please make sure that: - You added unit-tests for all of the new code, either on `Tests/Packet++Test` or `Tests/Pcap++Test` (whichever makes sense) - PcapPlusPlus compiles successfully on your machine, including all unit-tests and examples - - Unit-tests pass succssfully on your machine (both `Tests/Packet++Test` and `Tests/Pcap++Test`) + - Unit-tests pass successfully on your machine (both `Tests/Packet++Test` and `Tests/Pcap++Test`) - All new APIs are well documented using Doxygen (please use @ for keywords) - Make sure that pre-commit hooks are passing by using `pre-commit run --all-files`. For pre-commit hooks you need to install `cppcheck` on your system. Recommended and tested version is 2.7. You can install by using: - For Linux (apt) `sudo apt install cppcheck` diff --git a/Packet++/header/NflogLayer.h b/Packet++/header/NflogLayer.h index 2fd7804cdc..5df6358fa3 100644 --- a/Packet++/header/NflogLayer.h +++ b/Packet++/header/NflogLayer.h @@ -59,7 +59,7 @@ namespace pcpp NFULA_UID = 11, /** sequence number of packets on this NFLOG socket */ NFULA_SEQ = 12, - /** sequence number of pakets on all NFLOG sockets */ + /** sequence number of packets on all NFLOG sockets */ NFULA_SEQ_GLOBAL = 13, /** GID owning socket on which packet was sent/received */ NFULA_GID = 14, diff --git a/Pcap++/header/DpdkDevice.h b/Pcap++/header/DpdkDevice.h index 6dcb4e46b7..f0cdc8ecac 100644 --- a/Pcap++/header/DpdkDevice.h +++ b/Pcap++/header/DpdkDevice.h @@ -666,7 +666,7 @@ namespace pcpp * @param[in] onPacketsArrive The user callback which will be invoked each time a burst of packets is captured by the device * @param[in] onPacketsArriveUserCookie The user callback is invoked with this cookie as a parameter. It can be used to pass * information from the user application to the callback - * @param coreMask The core-mask for creating the cpature threads + * @param coreMask The core-mask for creating the capture threads * @return True if all capture threads started successfully or false if device is already in capture mode, not all cores in the core-mask are * available to DPDK, there are not enough opened RX queues to match all cores in the core-mask, or if thread invocation failed. In * all of these cases an appropriate error message will be printed diff --git a/Pcap++/src/PcapLiveDevice.cpp b/Pcap++/src/PcapLiveDevice.cpp index ab4eaf0574..ab8e69ccdd 100644 --- a/Pcap++/src/PcapLiveDevice.cpp +++ b/Pcap++/src/PcapLiveDevice.cpp @@ -104,7 +104,6 @@ PcapLiveDevice::PcapLiveDevice(pcap_if_t* pInterface, bool calculateMTU, bool ca //init all other members m_CaptureThreadStarted = false; m_StatsThreadStarted = false; - m_IsLoopback = false; m_StopThread = false; m_CaptureThread = {}; m_StatsThread = {};