aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorLuca Deri <lucaderi@users.noreply.github.com>2020-08-19 21:48:38 +0200
committerGitHub <noreply@github.com>2020-08-19 21:48:38 +0200
commitd87bdf93025e4eb1d43b0f1076d777dad92fe1d4 (patch)
tree2a0a143f1ec4250f6909f3f73da655e464773b10 /example
parent673d8b7fac1f7c1f3865348190a9d48bff58f176 (diff)
parent56a3a33bc0e21640ab1c345b7953e7b5c076673b (diff)
Merge pull request #977 from adek05/dev
Enable building on OpenBSD 6.7
Diffstat (limited to 'example')
-rw-r--r--example/reader_util.c8
-rw-r--r--example/reader_util.h11
2 files changed, 10 insertions, 9 deletions
diff --git a/example/reader_util.c b/example/reader_util.c
index 7e68a378d..d0f16ab62 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -692,7 +692,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
u_int8_t **payload,
u_int16_t *payload_len,
u_int8_t *src_to_dst_direction,
- struct timeval when) {
+ pkt_timeval when) {
u_int32_t idx, l4_offset, hashval;
struct ndpi_flow_info flow;
void *ret;
@@ -979,7 +979,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info6(struct ndpi_workflow * workflo
u_int8_t **payload,
u_int16_t *payload_len,
u_int8_t *src_to_dst_direction,
- struct timeval when) {
+ pkt_timeval when) {
struct ndpi_iphdr iph;
memset(&iph, 0, sizeof(iph));
@@ -1300,7 +1300,7 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
u_int16_t ipsize, u_int16_t rawsize,
const struct pcap_pkthdr *header,
const u_char *packet,
- struct timeval when,
+ pkt_timeval when,
FILE * csv_fp) {
struct ndpi_id_struct *src, *dst;
struct ndpi_flow_info *flow = NULL;
@@ -1330,7 +1330,7 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
&payload, &payload_len, &src_to_dst_direction, when);
if(flow != NULL) {
- struct timeval tdiff;
+ pkt_timeval tdiff;
workflow->stats.ip_packet_count++;
workflow->stats.total_wire_bytes += rawsize + 24 /* CRC etc */,
diff --git a/example/reader_util.h b/example/reader_util.h
index d4e3dc74f..4dba29ddc 100644
--- a/example/reader_util.h
+++ b/example/reader_util.h
@@ -31,6 +31,7 @@
#include "uthash.h"
#include <pcap.h>
+#include "ndpi_includes.h"
#include "ndpi_classify.h"
#include "ndpi_typedefs.h"
@@ -128,13 +129,13 @@ struct flow_metrics {
struct ndpi_entropy {
// Entropy fields
- struct timeval src2dst_last_pkt_time, dst2src_last_pkt_time, flow_last_pkt_time;
+ pkt_timeval src2dst_last_pkt_time, dst2src_last_pkt_time, flow_last_pkt_time;
u_int16_t src2dst_pkt_len[MAX_NUM_PKTS]; /*!< array of packet appdata lengths */
- struct timeval src2dst_pkt_time[MAX_NUM_PKTS]; /*!< array of arrival times */
+ pkt_timeval src2dst_pkt_time[MAX_NUM_PKTS]; /*!< array of arrival times */
u_int16_t dst2src_pkt_len[MAX_NUM_PKTS]; /*!< array of packet appdata lengths */
- struct timeval dst2src_pkt_time[MAX_NUM_PKTS]; /*!< array of arrival times */
- struct timeval src2dst_start; /*!< first packet arrival time */
- struct timeval dst2src_start; /*!< first packet arrival time */
+ pkt_timeval dst2src_pkt_time[MAX_NUM_PKTS]; /*!< array of arrival times */
+ pkt_timeval src2dst_start; /*!< first packet arrival time */
+ pkt_timeval dst2src_start; /*!< first packet arrival time */
u_int32_t src2dst_opackets; /*!< non-zero packet counts */
u_int32_t dst2src_opackets; /*!< non-zero packet counts */
u_int16_t src2dst_pkt_count; /*!< packet counts */