aboutsummaryrefslogtreecommitdiff
path: root/example/reader_util.h
diff options
context:
space:
mode:
authorAdrian Zgorzałek <adrian@adek.io>2020-08-01 23:25:13 +0100
committerAdrian Zgorzałek <adrian@adek.io>2020-08-09 14:30:12 +0100
commit8f74d5733d6a994acf1ddc985c5a3673619fd805 (patch)
tree3798ed6051ab302ad1dd26577cef1868575b9d5b /example/reader_util.h
parent95dfbdc64a48c3f8e57189499d5bb82b1b41ab09 (diff)
OpenBSD: Introduce pkt_timeval to deal with (bpf_)_timeval
Some BSD APIs called in example/ return `struct bpf_timeval`, where nDPI APIs expect `struct timeval`. These two structs, besides having a different name, share the exact same set of fields.
Diffstat (limited to 'example/reader_util.h')
-rw-r--r--example/reader_util.h11
1 files changed, 6 insertions, 5 deletions
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 */