diff options
author | Luca Deri <deri@ntop.org> | 2023-07-13 21:54:51 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2023-07-13 21:54:51 +0200 |
commit | 1f55dc511f9eb4e2bc8f880f1599f01c527a6397 (patch) | |
tree | ac48162be9a38d7ffdca002efd03cdb549c01b21 /example/reader_util.c | |
parent | bd0fcb2e62e5fa1fb3f4342e605e15f1f4920efc (diff) |
Implemented Count-Min Sketch [count how many times a value has been observed]
- ndpi_cm_sketch_init()
- ndpi_cm_sketch_add()
- ndpi_cm_sketch_count()
- ndpi_cm_sketch_destroy()
Diffstat (limited to 'example/reader_util.c')
-rw-r--r-- | example/reader_util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/example/reader_util.c b/example/reader_util.c index 1f53bd3b5..b9112b92e 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -111,8 +111,8 @@ struct payload_stats *pstats = NULL; u_int32_t max_num_packets_per_flow = 10; /* ETTA requires min 10 pkts for record. */ u_int32_t max_packet_payload_dissection = 128; u_int32_t max_num_reported_top_payloads = 25; -u_int16_t min_pattern_len = 4; -u_int16_t max_pattern_len = 8; +u_int16_t min_pattern_len = 4; +u_int16_t max_pattern_len = 8; /* *********************************************************** */ @@ -861,7 +861,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow flow.src_ip = iph->saddr, flow.dst_ip = iph->daddr; flow.src_port = htons(*sport), flow.dst_port = htons(*dport); flow.hashval = hashval = flow.protocol + ntohl(flow.src_ip) + ntohl(flow.dst_ip) - + ntohs(flow.src_port) + ntohs(flow.dst_port); + + ntohs(flow.src_port) + ntohs(flow.dst_port); #if 0 { |