From 231748bb0e6f274eb91824bf1e3b1693370ec0de Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Fri, 15 Mar 2024 10:12:51 +0100 Subject: LRU cache: move to 64 bits long keys (#2346) Tradeoff between key comparison efficiency (i.e. no `memcmp`) and key length. At least in the ipv4 cases, we have no more different entries with the same key. --- src/include/ndpi_private.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/include/ndpi_private.h') diff --git a/src/include/ndpi_private.h b/src/include/ndpi_private.h index bb704e63e..25ff5c4a7 100644 --- a/src/include/ndpi_private.h +++ b/src/include/ndpi_private.h @@ -660,8 +660,8 @@ int is_rtp_or_rtcp(struct ndpi_detection_module_struct *ndpi_struct, u_int8_t rtp_get_stream_type(u_int8_t payloadType, ndpi_multimedia_flow_type *s_type); /* Bittorrent */ -u_int32_t make_bittorrent_host_key(struct ndpi_flow_struct *flow, int client, int offset); -u_int32_t make_bittorrent_peers_key(struct ndpi_flow_struct *flow); +u_int64_t make_bittorrent_host_key(struct ndpi_flow_struct *flow, int client, int offset); +u_int64_t make_bittorrent_peers_key(struct ndpi_flow_struct *flow); int search_into_bittorrent_cache(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow); @@ -673,7 +673,7 @@ int stun_search_into_zoom_cache(struct ndpi_detection_module_struct *ndpi_struct int tpkt_verify_hdr(const struct ndpi_packet_struct * const packet); /* Mining Protocols (Ethereum, Monero, ...) */ -u_int32_t mining_make_lru_cache_key(struct ndpi_flow_struct *flow); +u_int64_t mining_make_lru_cache_key(struct ndpi_flow_struct *flow); /* Protocols init */ -- cgit v1.2.3