diff options
author | Nardi Ivan <nardi.ivan@gmail.com> | 2020-09-07 16:35:04 +0200 |
---|---|---|
committer | Nardi Ivan <nardi.ivan@gmail.com> | 2020-09-08 10:34:05 +0200 |
commit | a1014e88958035a44f78734860aee5db3f327dce (patch) | |
tree | fb6774db170fbc2d05913a3516799927624534c6 /example/reader_util.c | |
parent | 601928cc8ee1788098ea3dcdc4180b75b380bc84 (diff) |
http: create a common function to parse User Agent field
Prepare the code to handle UA information from flows other than HTTP
Diffstat (limited to 'example/reader_util.c')
-rw-r--r-- | example/reader_util.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/example/reader_util.c b/example/reader_util.c index d0f16ab62..8a0c3b97a 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -1139,6 +1139,7 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl } /* TLS */ else if((is_ndpi_proto(flow, NDPI_PROTOCOL_TLS)) + || ((is_ndpi_proto(flow, NDPI_PROTOCOL_QUIC))) || (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_TLS) || (flow->ndpi_flow->protos.stun_ssl.ssl.ja3_client[0] != '\0') ) { @@ -1147,6 +1148,8 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl sizeof(flow->ssh_tls.client_requested_server_name), "%s", flow->ndpi_flow->protos.stun_ssl.ssl.client_requested_server_name); + snprintf(flow->http.user_agent, sizeof(flow->http.user_agent), "%s", flow->ndpi_flow->http.user_agent ? flow->ndpi_flow->http.user_agent : ""); + if(flow->ndpi_flow->protos.stun_ssl.ssl.server_names_len > 0 && flow->ndpi_flow->protos.stun_ssl.ssl.server_names) flow->ssh_tls.server_names = ndpi_strdup(flow->ndpi_flow->protos.stun_ssl.ssl.server_names); flow->ssh_tls.notBefore = flow->ndpi_flow->protos.stun_ssl.ssl.notBefore; |