aboutsummaryrefslogtreecommitdiff
path: root/src/include/ndpi_api.h
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2025-05-20 23:14:59 +0200
committerLuca Deri <deri@ntop.org>2025-05-20 23:14:59 +0200
commitc590dc49551b32f12ebb4850e13a99cacbf90366 (patch)
tree00267be44fc76d2f5745d3e4a7575e82965fb814 /src/include/ndpi_api.h
parent34ee4d0b1d2ed080a85a93780a0eaf68136c109f (diff)
Added new APi calls
- ndpi_is_master_only_protocol() - ndpi_normalize_protocol() These two APi calls are used to normalize mater/app nDPI protocols
Diffstat (limited to 'src/include/ndpi_api.h')
-rw-r--r--src/include/ndpi_api.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h
index c06319aef..812f4d9b7 100644
--- a/src/include/ndpi_api.h
+++ b/src/include/ndpi_api.h
@@ -2392,6 +2392,25 @@ extern "C" {
u_int32_t ndpi_cache_address_restore(struct ndpi_detection_module_struct *ndpi_struct, char *path, u_int32_t epoch_now);
u_int32_t ndpi_cache_address_flush_expired(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t epoch_now);
+ /* Protocol normalization functions */
+ /**
+ * Checks if the specified protocol identifier can be placed only on the master_protocol field of ndpi_master_app_protocol
+ * @param ndpi_str nDPI detection module
+ * @param proto_id nDPI protocol identifier
+ * @return true if proto_id cannot be used s app_protocol but only on master_protocol, false is it can be used on both fields
+ */
+ bool ndpi_is_master_only_protocol(struct ndpi_detection_module_struct *ndpi_str, u_int16_t proto_id);
+
+ /**
+ * Normalizes the ndpi_master_app_protocol by reworking values of the specified proto, placing the master/app protocols
+ * in the corresponding protocol fields
+ * @param ndpi_str nDPI detection module
+ * @param proto_id nDPI protocol identifier
+ * @return true if the protocok has been modified/normalized, false if proto has not been modified
+ */
+ bool ndpi_normalize_protocol(struct ndpi_detection_module_struct *ndpi_str,
+ ndpi_master_app_protocol *proto);
+
/* ******************************* */
const char *ndpi_lru_cache_idx_to_name(lru_cache_type idx);