From 55af595b8458773292e3e9910009ffac9b70eb25 Mon Sep 17 00:00:00 2001 From: Pavel Odintsov Date: Sun, 2 Apr 2023 21:42:11 +0100 Subject: [PATCH] Eliminated non portable dependencies in example plugin --- src/example_plugin/example_collector.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/example_plugin/example_collector.cpp b/src/example_plugin/example_collector.cpp index d34cc98..3f20878 100644 --- a/src/example_plugin/example_collector.cpp +++ b/src/example_plugin/example_collector.cpp @@ -1,16 +1,10 @@ #include "../all_logcpp_libraries.hpp" -// For support uint32_t, uint16_t -#include - // For config map operations #include #include -// For support: IPPROTO_TCP, IPPROTO_ICMP, IPPROTO_UDP -#include -#include -#include +#include "../iana_ip_protocols.hpp" #include "example_collector.hpp" @@ -53,15 +47,15 @@ void start_example_collection(process_packet_pointer func_ptr) { current_packet.sample_ratio = 1; /* ICMP */ - current_packet.protocol = IPPROTO_ICMP; + current_packet.protocol = IpProtocolNumberICMP; /* TCP */ - current_packet.protocol = IPPROTO_TCP; + current_packet.protocol = IpProtocolNumberTCP; current_packet.source_port = 0; current_packet.destination_port = 0; /* UDP */ - current_packet.protocol = IPPROTO_UDP; + current_packet.protocol = IpProtocolNumberUDP; current_packet.source_port = 0; current_packet.destination_port = 0;