Added ndpi_is_protocol_detected() API call

This commit is contained in:
Luca Deri
2020-02-13 15:20:47 +01:00
parent d4ae8a5f16
commit f89f25c118
2 changed files with 14 additions and 0 deletions
+3
View File
@@ -982,6 +982,9 @@ extern "C" {
void ndpi_data_print_window_values(struct ndpi_analyze_struct *s); /* debug */
ndpi_url_risk ndpi_validate_url(char *url);
u_int8_t ndpi_is_protocol_detected(struct ndpi_detection_module_struct *ndpi_str,
ndpi_protocol proto);
#ifdef __cplusplus
}
#endif
+11
View File
@@ -1379,3 +1379,14 @@ ndpi_url_risk ndpi_validate_url(char *url) {
return(rc);
}
/* ******************************************************************** */
u_int8_t ndpi_is_protocol_detected(struct ndpi_detection_module_struct *ndpi_str,
ndpi_protocol proto) {
if((proto.master_protocol != NDPI_PROTOCOL_UNKNOWN)
|| (proto.app_protocol != NDPI_PROTOCOL_UNKNOWN)
|| (proto.category != NDPI_PROTOCOL_CATEGORY_UNSPECIFIED))
return(1);
else
return(0);
}