From b994246ac4728bb9b2f38e73fb97f5c7b1e91249 Mon Sep 17 00:00:00 2001 From: Matteo Biscosi Date: Wed, 28 Aug 2024 10:25:04 +0200 Subject: [PATCH] Mac removed from memory after 300 seconds of inactivity instead of 30 seconds --- include/Mac.h | 4 ++++ include/ntop_defines.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/Mac.h b/include/Mac.h index ffae52b3daae..fecda93e0ac0 100644 --- a/include/Mac.h +++ b/include/Mac.h @@ -162,6 +162,10 @@ class Mac : public GenericHashEntry { stats->incSentStats(t, num_pkts, num_bytes), last_seen = t; } + bool is_hash_entry_state_idle_transition_ready() { + return ((getUses() == 0) && is_active_entry_now_idle(MAX_MAC_IDLE)); + } + inline void incnDPIStats(time_t when, ndpi_protocol_category_t ndpi_category, u_int64_t sent_packets, u_int64_t sent_bytes, u_int64_t sent_goodput_bytes, u_int64_t rcvd_packets, diff --git a/include/ntop_defines.h b/include/ntop_defines.h index 9f07f3d2ed3c..10f80393f2e3 100644 --- a/include/ntop_defines.h +++ b/include/ntop_defines.h @@ -195,10 +195,11 @@ with incomplete TWH */ #define MAX_FLOW_IDLE 60 /* sec */ #define MAX_LOCAL_HOST_IDLE 300 /* sec */ +#define MAX_MAC_IDLE 300 /* sec */ #define MAX_REMOTE_HOST_IDLE 60 /* sec */ #define MAX_HASH_ENTRY_IDLE \ 60 /* sec - Generic idle time for hash entries different from hosts and \ - flows (i.e., ASes and Macs) */ + flows (i.e., ASes and Countries) */ #define MAX_PROBE_IDLE_IDLE 1800 /* 30 min (Used in ZMQParserInterface.cpp) */ #define MAX_RRD_QUEUE_LEN 200000 /* timeseries in the queue */ #define MIN_NUM_IDLE_ENTRIES_IF 5000