Added the ability to define a custom DGA detection function by overwriting

the value of the function pointer ndpi_dga_function curently set to NULL
(that means the nDPI internal DGA function will be used)
This commit is contained in:
Luca Deri
2021-03-08 22:57:30 +01:00
parent c3490e80a7
commit bb6423a79f
3 changed files with 267 additions and 243 deletions
+6 -1
View File
@@ -47,7 +47,12 @@ extern "C" {
#define SAVE_DETECTION_BITMASK_AS_UNKNOWN 1
#define NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN 0
/*
In case a custom DGA function is used, the fucntion
below must be overwritten,
*/
extern ndpi_custom_dga_predict_fctn ndpi_dga_function;
/**
* Check if a string is encoded with punycode
* ( https://tools.ietf.org/html/rfc3492 )
+3
View File
@@ -1662,6 +1662,9 @@ struct ndpi_hw_struct {
double *s;
};
/* Prototype used to define custom DGA detection function */
typedef int (*ndpi_custom_dga_predict_fctn)(const char* domain, int domain_length);
/* **************************************** */
#endif /* __NDPI_TYPEDEFS_H__ */