From 977751efdbe61374bbe54f709b3fd6c1b971a9d6 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Wed, 14 Nov 2018 15:24:15 +0100 Subject: Added ndpi_flowv4_flow_hash and ndpi_flowv6_flow_hash skeletons for implementing https://github.com/corelight/community-id-spec --- src/lib/ndpi_main.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/lib/ndpi_main.c') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 8e9bb53fc..3a6cd84ef 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -6063,3 +6063,27 @@ u_int ndpi_get_ndpi_detection_module_size() { void ndpi_set_log_level(struct ndpi_detection_module_struct *ndpi_mod, u_int l) { ndpi_mod->ndpi_log_level = l; } + +/* ******************************************************************** */ + +/* + NOTE: + - Leave fields empty/zero when information is missing (e.g. with ICMP ports are zero) + - The hash_buf most be 30+1 bits or longer + - Return code: 0 = OK, -1 otherwise + */ + +int ndpi_flowv4_flow_hash(u_int8_t l4_proto, u_int32_t src_ip, + u_int32_t dst_ip, u_int16_t src_port, u_int16_t dst_port, + u_int8_t icmp_type, u_int8_t icmp_code, + u_char *hash_buf, u_int8_t hash_buf_len) { + + return(0); /* OK */ +} + +int ndpi_flowv6_flow_hash(u_int8_t l4_proto, struct ndpi_in6_addr *src_ip, struct ndpi_in6_addr *dst_ip, + u_int16_t src_port, u_int16_t dst_port, u_int8_t icmp_type, u_int8_t icmp_code, + u_char *hash_buf, u_int8_t hash_buf_len) { + + return(0); /* OK */ +} -- cgit v1.2.3