Avoid useless host automa lookup (#1724)
The host automa is used for two tasks: * protocol sub-classification (obviously); * DGA evaluation: the idea is that if a domain is present in this automa, it can't be a DGA, regardless of its format/name. In most dissectors both checks are executed, i.e. the code is something like: ``` ndpi_match_host_subprotocol(..., flow->host_server_name, ...); ndpi_check_dga_name(..., flow->host_server_name,...); ``` In that common case, we can perform only one automa lookup: if we check the sub-classification before the DGA, we can avoid the second lookup in the DGA function itself.
This commit is contained in:
@@ -1149,7 +1149,7 @@ extern "C" {
|
||||
/* DGA */
|
||||
int ndpi_check_dga_name(struct ndpi_detection_module_struct *ndpi_str,
|
||||
struct ndpi_flow_struct *flow,
|
||||
char *name, u_int8_t is_hostname);
|
||||
char *name, u_int8_t is_hostname, u_int8_t check_subproto);
|
||||
|
||||
/* Serializer (supports JSON, TLV, CSV) */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user