aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/ndpi_private.h1
-rw-r--r--src/include/ndpi_typedefs.h1
-rw-r--r--src/lib/ndpi_main.c7
-rw-r--r--src/lib/ndpi_utils.c3
4 files changed, 12 insertions, 0 deletions
diff --git a/src/include/ndpi_private.h b/src/include/ndpi_private.h
index 620ce2532..2eaa4b27e 100644
--- a/src/include/ndpi_private.h
+++ b/src/include/ndpi_private.h
@@ -217,6 +217,7 @@ struct ndpi_detection_module_config_struct {
int use_client_ip_in_guess;
int use_client_port_in_guess;
int tcp_fingerprint_enabled;
+ int tcp_fingerprint_raw_enabled;
char filename_config[CFG_MAX_LEN];
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
index 481097c2f..7c53e8369 100644
--- a/src/include/ndpi_typedefs.h
+++ b/src/include/ndpi_typedefs.h
@@ -1394,6 +1394,7 @@ struct ndpi_flow_struct {
struct {
char *fingerprint;
+ char *fingerprint_raw;
ndpi_os os_hint;
} tcp;
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 0cc57e19b..6d9e65f2a 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -6883,6 +6883,9 @@ void ndpi_free_flow_data(struct ndpi_flow_struct* flow) {
if(flow->tcp.fingerprint)
ndpi_free(flow->tcp.fingerprint);
+ if(flow->tcp.fingerprint_raw)
+ ndpi_free(flow->tcp.fingerprint_raw);
+
if(flow->http.url)
ndpi_free(flow->http.url);
@@ -7237,6 +7240,9 @@ static int ndpi_init_packet(struct ndpi_detection_module_struct *ndpi_str,
flow->tcp.fingerprint = ndpi_strdup(fingerprint), flow->tcp.os_hint = ndpi_os_unknown;
+ if(ndpi_str->cfg.tcp_fingerprint_raw_enabled)
+ flow->tcp.fingerprint_raw = ndpi_strdup(options_fp);
+
if(ndpi_str->tcp_fingerprint_hashmap != NULL) {
u_int16_t ret;
@@ -12018,6 +12024,7 @@ static const struct cfg_param {
{ NULL, "fpc", "1", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(fpc_enabled), NULL },
{ NULL, "metadata.tcp_fingerprint", "enable", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(tcp_fingerprint_enabled), NULL },
+ { NULL, "metadata.tcp_fingerprint_raw", "disable", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(tcp_fingerprint_raw_enabled), NULL },
{ NULL, "flow_risk_lists.load", "1", NULL, NULL, CFG_PARAM_ENABLE_DISABLE, __OFF(flow_risk_lists_enabled), NULL },
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c
index 926cf16d6..490519582 100644
--- a/src/lib/ndpi_utils.c
+++ b/src/lib/ndpi_utils.c
@@ -1867,6 +1867,9 @@ int ndpi_flow2json(struct ndpi_detection_module_struct *ndpi_struct,
if(flow->tcp.fingerprint)
ndpi_serialize_string_string(serializer, "tcp_fingerprint", flow->tcp.fingerprint);
+ if(flow->tcp.fingerprint_raw)
+ ndpi_serialize_string_string(serializer, "tcp_fingerprint_raw", flow->tcp.fingerprint_raw);
+
ndpi_serialize_string_string(serializer, "proto",
ndpi_get_ip_proto_name(l4_protocol, l4_proto_name, sizeof(l4_proto_name)));