diff options
author | Luca Deri <deri@ntop.org> | 2019-09-26 23:50:02 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2019-09-26 23:50:02 +0200 |
commit | 17f560a1cd5a539bf8940072bac05ccbf3b547f9 (patch) | |
tree | d647cc792cb15f1700ece1c7e95fb2bb14713439 /src/lib/ndpi_main.c | |
parent | 194cdcf581f7d405fca191f99eedcb734e68f5ec (diff) |
Added ndpi_extra_dissection_possible() API call
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 380b622b3..cde2e13a9 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -6288,4 +6288,43 @@ int ndpi_flowv6_flow_hash(u_int8_t l4_proto, struct ndpi_in6_addr *src_ip, struc return(0); /* OK */ } -/* **************************************** */ +/* ******************************************************************** */ + +/* + This function tells if it's possible to further dissect a given flow + 0 - All possible dissection has been completed + 1 - Additional dissection is possible +*/ +u_int8_t ndpi_extra_dissection_possible(struct ndpi_detection_module_struct *ndpi_struct, + struct ndpi_flow_struct *flow) { + +#if 0 + printf("[DEBUG] %s(%u.%u)\n", __FUNCTION__, + flow->detected_protocol_stack[0], + flow->detected_protocol_stack[1]); +#endif + + if(flow->check_extra_packets) return(1); + + switch(flow->detected_protocol_stack[0]) { + case NDPI_PROTOCOL_TLS: + if(!flow->l4.tcp.tls_srv_cert_fingerprint_processed) + return(1); + break; + + case NDPI_PROTOCOL_HTTP: + if(flow->host_server_name[0] == '\0') + return(1); + break; + + case NDPI_PROTOCOL_DNS: + if((ndpi_struct->dns_dont_dissect_response == 0) + && (flow->host_server_name[0] == '\0')) + return(1); + break; + } + + return(0); +} + +/* ******************************************************************** */ |