From f0edf58062f82e56020e8f95fc2830a8067b3f3a Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Fri, 3 Nov 2023 21:13:06 -0400 Subject: [PATCH 1/2] Upgrade pcapplusplus from 22.11 to 23.09 --- conanfile.txt | 2 +- libs/visor_dns/DnsLayer.cpp | 4 ++-- libs/visor_dns/DnsLayer.h | 2 +- libs/visor_dns/DnsResource.cpp | 2 +- libs/visor_dns/DnsResourceData.cpp | 4 ++-- libs/visor_dns/DnsResourceData.h | 2 +- libs/visor_dns/tests/benchmark_dns.cpp | 6 ++--- libs/visor_tcp/VisorTcpLayer.h | 2 +- libs/visor_utils/utils.cpp | 2 +- libs/visor_utils/utils.h | 2 +- src/handlers/bgp/BgpStreamHandler.cpp | 2 +- src/handlers/bgp/BgpStreamHandler.h | 2 +- src/handlers/dhcp/DhcpStreamHandler.h | 8 +++---- src/handlers/dns/v1/DnsStreamHandler.cpp | 6 ++--- src/handlers/dns/v1/tests/test_dns_layer.cpp | 10 ++++---- src/handlers/dns/v2/DnsStreamHandler.cpp | 6 ++--- src/handlers/dns/v2/tests/test_dns_layer.cpp | 10 ++++---- src/handlers/net/v1/NetStreamHandler.cpp | 8 +++---- src/handlers/net/v2/NetStreamHandler.cpp | 8 +++---- src/handlers/netprobe/NetProbeStreamHandler.h | 2 +- src/inputs/dnstap/DnstapInputStream.h | 2 +- src/inputs/flow/FlowInputStream.cpp | 10 ++++---- src/inputs/netprobe/NetProbe.h | 4 ++-- src/inputs/netprobe/NetProbeInputStream.cpp | 10 ++++---- src/inputs/netprobe/NetProbeInputStream.h | 2 +- src/inputs/netprobe/PingProbe.cpp | 4 ++-- src/inputs/netprobe/PingProbe.h | 4 ++-- src/inputs/pcap/PcapInputStream.cpp | 24 +++++++++---------- src/inputs/pcap/PcapInputStream.h | 8 +++---- src/inputs/pcap/afpacket.cpp | 2 +- src/inputs/pcap/afpacket.h | 2 +- src/inputs/pcap/tests/test_parse_pcap.cpp | 8 +++---- 32 files changed, 85 insertions(+), 85 deletions(-) diff --git a/conanfile.txt b/conanfile.txt index 190ca3b31..a6bf34638 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -9,7 +9,7 @@ libmaxminddb/1.7.1 nlohmann_json/3.11.2 openssl/1.1.1w opentelemetry-proto/1.0.0 -pcapplusplus/22.11 +pcapplusplus/23.09 protobuf/3.21.12 sigslot/1.2.2 spdlog/1.12.0 diff --git a/libs/visor_dns/DnsLayer.cpp b/libs/visor_dns/DnsLayer.cpp index 006615f15..a38354b0b 100644 --- a/libs/visor_dns/DnsLayer.cpp +++ b/libs/visor_dns/DnsLayer.cpp @@ -2,12 +2,12 @@ #include "DnsLayer.h" #include "EndianPortable.h" -#include +#include #ifdef __GNUC__ #pragma GCC diagnostic push #pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" #endif -#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif diff --git a/libs/visor_dns/DnsLayer.h b/libs/visor_dns/DnsLayer.h index ba4567eb8..c28c4e742 100644 --- a/libs/visor_dns/DnsLayer.h +++ b/libs/visor_dns/DnsLayer.h @@ -10,7 +10,7 @@ #include "DnsLayerEnums.h" #include "DnsResource.h" #include "DnsResourceData.h" -#include +#include #include #ifdef __GNUC__ #pragma GCC diagnostic pop diff --git a/libs/visor_dns/DnsResource.cpp b/libs/visor_dns/DnsResource.cpp index 8b329d6e5..97ad533c9 100644 --- a/libs/visor_dns/DnsResource.cpp +++ b/libs/visor_dns/DnsResource.cpp @@ -7,7 +7,7 @@ #pragma GCC diagnostic push #pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" #endif -#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif diff --git a/libs/visor_dns/DnsResourceData.cpp b/libs/visor_dns/DnsResourceData.cpp index 61ef5eb3e..e13821d5e 100644 --- a/libs/visor_dns/DnsResourceData.cpp +++ b/libs/visor_dns/DnsResourceData.cpp @@ -2,14 +2,14 @@ #include "DnsResourceData.h" #include "EndianPortable.h" -#include +#include #include #include #ifdef __GNUC__ #pragma GCC diagnostic push #pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" #endif -#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #pragma GCC diagnostic ignored "-Wunused-parameter" diff --git a/libs/visor_dns/DnsResourceData.h b/libs/visor_dns/DnsResourceData.h index b7c683920..4c80d3172 100644 --- a/libs/visor_dns/DnsResourceData.h +++ b/libs/visor_dns/DnsResourceData.h @@ -2,7 +2,7 @@ #define PV_PACKETPP_DNS_RESOURCE_DATA #include "DnsResource.h" -#include +#include #include #include #include diff --git a/libs/visor_dns/tests/benchmark_dns.cpp b/libs/visor_dns/tests/benchmark_dns.cpp index 4144dd372..09ee28b34 100644 --- a/libs/visor_dns/tests/benchmark_dns.cpp +++ b/libs/visor_dns/tests/benchmark_dns.cpp @@ -13,9 +13,9 @@ #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #pragma clang diagnostic ignored "-Wc99-extensions" #endif -#include "IPv4Layer.h" -#include "PacketUtils.h" -#include "PcapFileDevice.h" +#include +#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif diff --git a/libs/visor_tcp/VisorTcpLayer.h b/libs/visor_tcp/VisorTcpLayer.h index 414357fb8..b1f4b5a27 100644 --- a/libs/visor_tcp/VisorTcpLayer.h +++ b/libs/visor_tcp/VisorTcpLayer.h @@ -18,7 +18,7 @@ #ifdef TCPOPT_CCECHO #undef TCPOPT_CCECHO #endif // TCPOPT_CCECHO -#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif diff --git a/libs/visor_utils/utils.cpp b/libs/visor_utils/utils.cpp index 7702801ea..e9ca8d431 100644 --- a/libs/visor_utils/utils.cpp +++ b/libs/visor_utils/utils.cpp @@ -1,6 +1,6 @@ #include "utils.h" #include "EndianPortable.h" -#include +#include #include #include diff --git a/libs/visor_utils/utils.h b/libs/visor_utils/utils.h index 1488bc1d5..28c6053b9 100644 --- a/libs/visor_utils/utils.h +++ b/libs/visor_utils/utils.h @@ -15,7 +15,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wold-style-cast" #endif -#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif diff --git a/src/handlers/bgp/BgpStreamHandler.cpp b/src/handlers/bgp/BgpStreamHandler.cpp index 270c513e7..3dd09b471 100644 --- a/src/handlers/bgp/BgpStreamHandler.cpp +++ b/src/handlers/bgp/BgpStreamHandler.cpp @@ -3,7 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #include "BgpStreamHandler.h" -#include +#include namespace visor::handler::bgp { diff --git a/src/handlers/bgp/BgpStreamHandler.h b/src/handlers/bgp/BgpStreamHandler.h index 5e74788dc..2974c367e 100644 --- a/src/handlers/bgp/BgpStreamHandler.h +++ b/src/handlers/bgp/BgpStreamHandler.h @@ -13,7 +13,7 @@ #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #endif -#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif diff --git a/src/handlers/dhcp/DhcpStreamHandler.h b/src/handlers/dhcp/DhcpStreamHandler.h index 8c4fb4faf..fe53e4d69 100644 --- a/src/handlers/dhcp/DhcpStreamHandler.h +++ b/src/handlers/dhcp/DhcpStreamHandler.h @@ -12,10 +12,10 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #endif -#include "DhcpLayer.h" -#include "DhcpV6Layer.h" -#include "EthLayer.h" -#include "IPv6Layer.h" +#include +#include +#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif diff --git a/src/handlers/dns/v1/DnsStreamHandler.cpp b/src/handlers/dns/v1/DnsStreamHandler.cpp index fff191de1..5cc0c0d30 100644 --- a/src/handlers/dns/v1/DnsStreamHandler.cpp +++ b/src/handlers/dns/v1/DnsStreamHandler.cpp @@ -15,9 +15,9 @@ #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #pragma clang diagnostic ignored "-Wc99-extensions" #endif -#include -#include -#include +#include +#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif diff --git a/src/handlers/dns/v1/tests/test_dns_layer.cpp b/src/handlers/dns/v1/tests/test_dns_layer.cpp index b4f8d4a3d..4c7c52898 100644 --- a/src/handlers/dns/v1/tests/test_dns_layer.cpp +++ b/src/handlers/dns/v1/tests/test_dns_layer.cpp @@ -14,11 +14,11 @@ #pragma clang diagnostic ignored "-Wc99-extensions" #pragma clang diagnostic ignored "-Wrange-loop-analysis" #endif -#include "DnsLayer.h" -#include -#include -#include -#include +#include +#include +#include +#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #pragma GCC diagnostic ignored "-Wold-style-cast" diff --git a/src/handlers/dns/v2/DnsStreamHandler.cpp b/src/handlers/dns/v2/DnsStreamHandler.cpp index 64cfb4905..2ad2b7325 100644 --- a/src/handlers/dns/v2/DnsStreamHandler.cpp +++ b/src/handlers/dns/v2/DnsStreamHandler.cpp @@ -15,9 +15,9 @@ #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #pragma clang diagnostic ignored "-Wc99-extensions" #endif -#include -#include -#include +#include +#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif diff --git a/src/handlers/dns/v2/tests/test_dns_layer.cpp b/src/handlers/dns/v2/tests/test_dns_layer.cpp index 8834d8f96..d5f15a2b9 100644 --- a/src/handlers/dns/v2/tests/test_dns_layer.cpp +++ b/src/handlers/dns/v2/tests/test_dns_layer.cpp @@ -14,11 +14,11 @@ #pragma clang diagnostic ignored "-Wc99-extensions" #pragma clang diagnostic ignored "-Wrange-loop-analysis" #endif -#include "DnsLayer.h" -#include -#include -#include -#include +#include +#include +#include +#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #pragma GCC diagnostic ignored "-Wold-style-cast" diff --git a/src/handlers/net/v1/NetStreamHandler.cpp b/src/handlers/net/v1/NetStreamHandler.cpp index 48bf4d900..5ade9ca2a 100644 --- a/src/handlers/net/v1/NetStreamHandler.cpp +++ b/src/handlers/net/v1/NetStreamHandler.cpp @@ -15,10 +15,10 @@ #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #pragma clang diagnostic ignored "-Wc99-extensions" #endif -#include "IPv4Layer.h" -#include "IPv6Layer.h" -#include "PacketUtils.h" -#include "TimespecTimeval.h" +#include +#include +#include +#include #include "VisorTcpLayer.h" #ifdef __GNUC__ #pragma GCC diagnostic pop diff --git a/src/handlers/net/v2/NetStreamHandler.cpp b/src/handlers/net/v2/NetStreamHandler.cpp index 64517dfef..225f60ed4 100644 --- a/src/handlers/net/v2/NetStreamHandler.cpp +++ b/src/handlers/net/v2/NetStreamHandler.cpp @@ -15,10 +15,10 @@ #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #pragma clang diagnostic ignored "-Wc99-extensions" #endif -#include "IPv4Layer.h" -#include "IPv6Layer.h" -#include "PacketUtils.h" -#include "TimespecTimeval.h" +#include +#include +#include +#include #include "VisorTcpLayer.h" #ifdef __GNUC__ #pragma GCC diagnostic pop diff --git a/src/handlers/netprobe/NetProbeStreamHandler.h b/src/handlers/netprobe/NetProbeStreamHandler.h index a12f7444d..ba351cc37 100644 --- a/src/handlers/netprobe/NetProbeStreamHandler.h +++ b/src/handlers/netprobe/NetProbeStreamHandler.h @@ -15,7 +15,7 @@ #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #endif -#include +#include #include #ifdef __GNUC__ #pragma GCC diagnostic pop diff --git a/src/inputs/dnstap/DnstapInputStream.h b/src/inputs/dnstap/DnstapInputStream.h index df3ccdbb0..eec4b674d 100644 --- a/src/inputs/dnstap/DnstapInputStream.h +++ b/src/inputs/dnstap/DnstapInputStream.h @@ -19,7 +19,7 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #endif -#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif diff --git a/src/inputs/flow/FlowInputStream.cpp b/src/inputs/flow/FlowInputStream.cpp index 0fc19f491..9d9f16ef5 100644 --- a/src/inputs/flow/FlowInputStream.cpp +++ b/src/inputs/flow/FlowInputStream.cpp @@ -12,11 +12,11 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #endif -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/inputs/netprobe/NetProbe.h b/src/inputs/netprobe/NetProbe.h index cd7bec611..e8597fb24 100644 --- a/src/inputs/netprobe/NetProbe.h +++ b/src/inputs/netprobe/NetProbe.h @@ -10,8 +10,8 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #endif -#include -#include +#include +#include #include #include #ifdef __GNUC__ diff --git a/src/inputs/netprobe/NetProbeInputStream.cpp b/src/inputs/netprobe/NetProbeInputStream.cpp index bad365871..e8bc702b8 100644 --- a/src/inputs/netprobe/NetProbeInputStream.cpp +++ b/src/inputs/netprobe/NetProbeInputStream.cpp @@ -14,11 +14,11 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #endif -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif diff --git a/src/inputs/netprobe/NetProbeInputStream.h b/src/inputs/netprobe/NetProbeInputStream.h index a2d4145f0..7225d6f55 100644 --- a/src/inputs/netprobe/NetProbeInputStream.h +++ b/src/inputs/netprobe/NetProbeInputStream.h @@ -6,7 +6,7 @@ #include "InputStream.h" #include "NetProbe.h" -#include +#include #include namespace uvw { diff --git a/src/inputs/netprobe/PingProbe.cpp b/src/inputs/netprobe/PingProbe.cpp index 5098377dd..974549b01 100644 --- a/src/inputs/netprobe/PingProbe.cpp +++ b/src/inputs/netprobe/PingProbe.cpp @@ -2,8 +2,8 @@ #include "NetProbeException.h" #include "ThreadName.h" -#include -#include +#include +#include #include namespace visor::input::netprobe { diff --git a/src/inputs/netprobe/PingProbe.h b/src/inputs/netprobe/PingProbe.h index 1120a8cb3..e3407c728 100644 --- a/src/inputs/netprobe/PingProbe.h +++ b/src/inputs/netprobe/PingProbe.h @@ -26,8 +26,8 @@ typedef int SOCKET; #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #pragma clang diagnostic ignored "-Wc99-extensions" #endif -#include -#include +#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif diff --git a/src/inputs/pcap/PcapInputStream.cpp b/src/inputs/pcap/PcapInputStream.cpp index fd04cc7c3..c1cbf1875 100644 --- a/src/inputs/pcap/PcapInputStream.cpp +++ b/src/inputs/pcap/PcapInputStream.cpp @@ -15,20 +15,20 @@ #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #pragma clang diagnostic ignored "-Wc99-extensions" #endif -#include // used only for mock generator -#include -#include -#include -#include -#include -#include -#include +#include // used only for mock generator +#include +#include +#include +#include +#include +#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif -#include #include #include +#include #include using namespace std::chrono; @@ -76,7 +76,7 @@ PcapInputStream::PcapInputStream(const std::string &name) this, _tcp_connection_start_cb, _tcp_connection_end_cb, - {true, 1, 1000, 50}) + pcpp::TcpReassemblyConfiguration(true, 1, 1000, 50)) { pcpp::Logger::getInstance().suppressLogs(); } @@ -111,7 +111,7 @@ void PcapInputStream::start() } if (config_exists("debug") && config_get("debug")) { - pcpp::Logger::getInstance().setAllModlesToLogLevel(pcpp::Logger::LogLevel::Debug); + pcpp::Logger::getInstance().setAllModulesToLogLevel(pcpp::Logger::LogLevel::Debug); } _cur_pcap_source = PcapInputStream::DefaultPcapSource; @@ -257,7 +257,7 @@ void PcapInputStream::tcp_message_ready(int8_t side, const pcpp::TcpStreamData & for (auto &proxy : _event_proxies) { dynamic_cast(proxy.get())->tcp_message_ready_cb(side, tcpData, _packet_dir_cache); } - if (_lru_list->put(tcpData.getConnectionData().flowKey, tcpData.getConnectionData().endTime, &_deleted_data)){ + if (_lru_list->put(tcpData.getConnectionData().flowKey, tcpData.getConnectionData().endTime, &_deleted_data)) { _lru_overflow.push_back(_deleted_data.first); } } diff --git a/src/inputs/pcap/PcapInputStream.h b/src/inputs/pcap/PcapInputStream.h index 647c2fdd0..c327dd53e 100644 --- a/src/inputs/pcap/PcapInputStream.h +++ b/src/inputs/pcap/PcapInputStream.h @@ -16,10 +16,10 @@ #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #endif -#include -#include -#include -#include +#include +#include +#include +#include #include #include #ifdef __GNUC__ diff --git a/src/inputs/pcap/afpacket.cpp b/src/inputs/pcap/afpacket.cpp index d6e56d5e5..688a4a9b4 100644 --- a/src/inputs/pcap/afpacket.cpp +++ b/src/inputs/pcap/afpacket.cpp @@ -6,7 +6,7 @@ #include "afpacket.h" #include "utils.h" -#include +#include #include #include #include diff --git a/src/inputs/pcap/afpacket.h b/src/inputs/pcap/afpacket.h index 1c2b33b40..87c5a8d93 100644 --- a/src/inputs/pcap/afpacket.h +++ b/src/inputs/pcap/afpacket.h @@ -10,7 +10,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wold-style-cast" #endif -#include +#include #ifdef __GNUC__ #pragma GCC diagnostic pop #endif diff --git a/src/inputs/pcap/tests/test_parse_pcap.cpp b/src/inputs/pcap/tests/test_parse_pcap.cpp index 0633701b3..9710c22b0 100644 --- a/src/inputs/pcap/tests/test_parse_pcap.cpp +++ b/src/inputs/pcap/tests/test_parse_pcap.cpp @@ -5,10 +5,10 @@ #pragma clang diagnostic ignored "-Wc99-extensions" #pragma clang diagnostic ignored "-Wrange-loop-analysis" #endif -#include -#include -#include -#include +#include +#include +#include +#include #include #include #ifdef __GNUC__ From 46ea9dd4eff79d8e3281839a3c962e58507462e1 Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Sat, 4 Nov 2023 12:13:39 -0400 Subject: [PATCH 2/2] Fix macos python version --- .github/workflows/build-develop.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index e140a7437..f341dbdd2 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -33,6 +33,11 @@ jobs: # We'll use this as our working directory for all subsequent commands run: cmake -E make_directory ${{github.workspace}}/build + - name: Python Setup + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Get Conan id: conan uses: turtlebrowser/get-conan@main