From 8f74d5733d6a994acf1ddc985c5a3673619fd805 Mon Sep 17 00:00:00 2001 From: Adrian ZgorzaƂek Date: Sat, 1 Aug 2020 23:25:13 +0100 Subject: 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. --- example/reader_util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'example/reader_util.c') 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 */, -- cgit v1.2.3