diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3d24645dd..e10205734 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -39,9 +39,10 @@ jobs: # uses: turtlebrowser/get-conan@4dc7e6dd45c8b1e02e909979d7cfc5ebba6ddbe2 uses: turtlebrowser/get-conan@v1.0 - - name: Conan profile + - name: Conan profile and settings run: | conan profile new --detect default + conan config set general.revisions_enabled=1 - name: Conan profile (linux-workaround) if: matrix.os == 'ubuntu-latest' @@ -52,7 +53,7 @@ jobs: if: matrix.os == 'macos-latest' working-directory: ${{github.workspace}}/build run: | - conan remote add public-conan https://api.bintray.com/conan/bincrafters/public-conan + conan remote add ns1labs-conan https://ns1labs.jfrog.io/artifactory/api/conan/ns1labs-conan conan install --build=missing .. - name: linux package install diff --git a/CMakeLists.txt b/CMakeLists.txt index 3caa6d861..89daca2c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,8 @@ add_compile_options(-Wall -pedantic -W -Wextra -Wno-unknown-pragmas) include(conan) -conan_add_remote(NAME bincrafters INDEX 1 - URL https://api.bintray.com/conan/bincrafters/public-conan +conan_add_remote(NAME ns1labs INDEX 1 + URL https://ns1labs.jfrog.io/artifactory/api/conan/ns1labs-conan VERIFY_SSL True) conan_cmake_autodetect(settings) diff --git a/conanfile.txt b/conanfile.txt index 8953038d6..c4fc956e6 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -5,7 +5,7 @@ docopt.cpp/0.6.3 nlohmann_json/3.9.1 cpp-httplib/0.8.0 corrade/2020.06 -pcapplusplus/20.08@bincrafters/stable +pcapplusplus/ns1-dev json-schema-validator/2.1.0 [build_requires] diff --git a/src/handlers/net/NetStreamHandler.cpp b/src/handlers/net/NetStreamHandler.cpp index 54036997a..acb29b8e2 100644 --- a/src/handlers/net/NetStreamHandler.cpp +++ b/src/handlers/net/NetStreamHandler.cpp @@ -241,10 +241,10 @@ void NetworkMetricsBucket::process_packet(bool deep, pcpp::Packet &payload, Pack auto IP6layer = payload.getLayerOfType(); if (IP4layer) { if (dir == PacketDirection::toHost) { - _srcIPCard.update(IP4layer->getSrcIpAddress().toInt()); - _topIPv4.update(IP4layer->getSrcIpAddress().toInt()); + _srcIPCard.update(IP4layer->getSrcIPv4Address().toInt()); + _topIPv4.update(IP4layer->getSrcIPv4Address().toInt()); if (geo::enabled()) { - if (IPv4tosockaddr(IP4layer->getSrcIpAddress(), &sa4)) { + if (IPv4tosockaddr(IP4layer->getSrcIPv4Address(), &sa4)) { if (geo::GeoIP().enabled()) { _topGeoLoc.update(geo::GeoIP().getGeoLocString(reinterpret_cast(&sa4))); } @@ -254,10 +254,10 @@ void NetworkMetricsBucket::process_packet(bool deep, pcpp::Packet &payload, Pack } } } else if (dir == PacketDirection::fromHost) { - _dstIPCard.update(IP4layer->getDstIpAddress().toInt()); - _topIPv4.update(IP4layer->getDstIpAddress().toInt()); + _dstIPCard.update(IP4layer->getDstIPv4Address().toInt()); + _topIPv4.update(IP4layer->getDstIPv4Address().toInt()); if (geo::enabled()) { - if (IPv4tosockaddr(IP4layer->getDstIpAddress(), &sa4)) { + if (IPv4tosockaddr(IP4layer->getDstIPv4Address(), &sa4)) { if (geo::GeoIP().enabled()) { _topGeoLoc.update(geo::GeoIP().getGeoLocString(reinterpret_cast(&sa4))); } @@ -269,10 +269,10 @@ void NetworkMetricsBucket::process_packet(bool deep, pcpp::Packet &payload, Pack } } else if (IP6layer) { if (dir == PacketDirection::toHost) { - _srcIPCard.update(reinterpret_cast(IP6layer->getSrcIpAddress().toBytes()), 16); - _topIPv6.update(IP6layer->getSrcIpAddress().toString()); + _srcIPCard.update(reinterpret_cast(IP6layer->getSrcIPv6Address().toBytes()), 16); + _topIPv6.update(IP6layer->getSrcIPv6Address().toString()); if (geo::enabled()) { - if (IPv6tosockaddr(IP6layer->getSrcIpAddress(), &sa6)) { + if (IPv6tosockaddr(IP6layer->getSrcIPv6Address(), &sa6)) { if (geo::GeoIP().enabled()) { _topGeoLoc.update(geo::GeoIP().getGeoLocString(reinterpret_cast(&sa6))); } @@ -282,10 +282,10 @@ void NetworkMetricsBucket::process_packet(bool deep, pcpp::Packet &payload, Pack } } } else if (dir == PacketDirection::fromHost) { - _dstIPCard.update(reinterpret_cast(IP6layer->getDstIpAddress().toBytes()), 16); - _topIPv6.update(IP6layer->getDstIpAddress().toString()); + _dstIPCard.update(reinterpret_cast(IP6layer->getDstIPv6Address().toBytes()), 16); + _topIPv6.update(IP6layer->getDstIPv6Address().toString()); if (geo::enabled()) { - if (IPv6tosockaddr(IP6layer->getDstIpAddress(), &sa6)) { + if (IPv6tosockaddr(IP6layer->getDstIPv6Address(), &sa6)) { if (geo::GeoIP().enabled()) { _topGeoLoc.update(geo::GeoIP().getGeoLocString(reinterpret_cast(&sa6))); } diff --git a/src/inputs/pcap/PcapInputStream.cpp b/src/inputs/pcap/PcapInputStream.cpp index 292ca95ca..702b98c08 100644 --- a/src/inputs/pcap/PcapInputStream.cpp +++ b/src/inputs/pcap/PcapInputStream.cpp @@ -54,7 +54,7 @@ static void _packet_arrives_cb(pcpp::RawPacket *rawPacket, [[maybe_unused]] pcpp stream->process_raw_packet(rawPacket); } -static void _pcap_stats_update([[maybe_unused]] pcap_stat &stats, [[maybe_unused]] void *cookie) +static void _pcap_stats_update([[maybe_unused]] pcpp::IPcapDevice::PcapStats& stats, [[maybe_unused]] void *cookie) { // auto stream = static_cast(cookie); // TODO expose this @@ -213,20 +213,20 @@ void PcapInputStream::process_raw_packet(pcpp::RawPacket *rawPacket) auto IP6layer = packet.getLayerOfType(); if (IP4layer) { for (auto &i : _hostIPv4) { - if (IP4layer->getDstIpAddress().matchSubnet(i.address, i.mask)) { + if (IP4layer->getDstIPv4Address().matchSubnet(i.address, i.mask)) { dir = PacketDirection::toHost; break; - } else if (IP4layer->getSrcIpAddress().matchSubnet(i.address, i.mask)) { + } else if (IP4layer->getSrcIPv4Address().matchSubnet(i.address, i.mask)) { dir = PacketDirection::fromHost; break; } } } else if (IP6layer) { for (auto &i : _hostIPv6) { - if (IP6layer->getDstIpAddress().matchSubnet(i.address, i.mask)) { + if (IP6layer->getDstIPv6Address().matchSubnet(i.address, i.mask)) { dir = PacketDirection::toHost; break; - } else if (IP6layer->getSrcIpAddress().matchSubnet(i.address, i.mask)) { + } else if (IP6layer->getSrcIPv6Address().matchSubnet(i.address, i.mask)) { dir = PacketDirection::fromHost; break; } @@ -346,19 +346,19 @@ void PcapInputStream::_get_hosts_from_libpcap_iface() continue; } if (i.addr->sa_family == AF_INET) { - auto adrcvt = pcpp::sockaddr2in_addr(i.addr); + auto adrcvt = pcpp::internal::sockaddr2in_addr(i.addr); if (!adrcvt) { throw PcapException("couldn't parse IPv4 address on device"); } - auto nmcvt = pcpp::sockaddr2in_addr(i.netmask); + auto nmcvt = pcpp::internal::sockaddr2in_addr(i.netmask); if (!nmcvt) { throw PcapException("couldn't parse IPv4 netmask address on device"); } - _hostIPv4.emplace_back(IPv4subnet(pcpp::IPv4Address(pcpp::in_addr2int(*adrcvt)), pcpp::IPv4Address(pcpp::in_addr2int(*nmcvt)))); + _hostIPv4.emplace_back(IPv4subnet(pcpp::IPv4Address(pcpp::internal::in_addr2int(*adrcvt)), pcpp::IPv4Address(pcpp::internal::in_addr2int(*nmcvt)))); } else if (i.addr->sa_family == AF_INET6) { char buf1[INET6_ADDRSTRLEN]; - pcpp::sockaddr2string(i.addr, buf1); - auto nmcvt = pcpp::sockaddr2in6_addr(i.netmask); + pcpp::internal::sockaddr2string(i.addr, buf1); + auto nmcvt = pcpp::internal::sockaddr2in6_addr(i.netmask); if (!nmcvt) { throw PcapException("couldn't parse IPv4 netmask address on device"); }