aboutsummaryrefslogtreecommitdiff
path: root/example/ndpiReader.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2021-04-27 08:12:14 +0200
committerLuca Deri <deri@ntop.org>2021-04-27 08:12:14 +0200
commit70686249c91d2cd40910fcf136b92474272d5a41 (patch)
treeefb2b557f8a86ed3c6a50ac10498bc07a1c4a68c /example/ndpiReader.c
parent7b62db81c335d0a826c9e7bb753000c3647e97c8 (diff)
Updated code due to https://github.com/ntop/nDPI/pull/1175
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r--example/ndpiReader.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index 3a88c0aab..851203962 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -174,12 +174,13 @@ struct receiver *receivers = NULL, *topReceivers = NULL;
#define WIRESHARK_NTOP_MAGIC 0x19680924
+PACK_ON
struct ndpi_packet_trailer {
u_int32_t magic; /* WIRESHARK_NTOP_MAGIC */
u_int16_t master_protocol /* e.g. HTTP */, app_protocol /* e.g. FaceBook */;
ndpi_risk flow_risk;
char name[16];
-};
+} PACK_OFF;
static pcap_dumper_t *extcap_dumper = NULL;
static pcap_t *extcap_fifo_h = NULL;
@@ -3285,7 +3286,7 @@ static void ndpi_process_packet(u_char *args,
memcpy(extcap_buf, packet, h.caplen);
memset(trailer, 0, sizeof(struct ndpi_packet_trailer));
trailer->magic = htonl(WIRESHARK_NTOP_MAGIC);
- trailer->flow_risk = htonl(flow_risk);
+ trailer->flow_risk = htonll(flow_risk);
trailer->master_protocol = htons(p.master_protocol), trailer->app_protocol = htons(p.app_protocol);
ndpi_protocol2name(ndpi_thread_info[thread_id].workflow->ndpi_struct, p, trailer->name, sizeof(trailer->name));
crc = (uint32_t*)&extcap_buf[h.caplen+sizeof(struct ndpi_packet_trailer)];