Added ndpi_finalize_initalization() initialization function

This commit is contained in:
Luca
2019-11-07 19:28:16 +00:00
parent ac46a4dd58
commit 0558d641f2
6 changed files with 171 additions and 147 deletions
+7 -6
View File
@@ -44,6 +44,12 @@ typedef struct
* add pattern to automata anymore. */
unsigned short automata_open;
/* Statistic Variables */
unsigned long total_patterns; /* Total patterns in the automata */
} AC_AUTOMATA_t;
typedef struct {
/* It is possible to feed a large input to the automata chunk by chunk to
* be searched using ac_automata_search(). in fact by default automata
* thinks that all chunks are related unless you do ac_automata_reset().
@@ -51,18 +57,13 @@ typedef struct
AC_NODE_t * current_node; /* Pointer to current node while searching */
unsigned long base_position; /* Represents the position of current chunk
related to whole input text */
/* Statistic Variables */
unsigned long total_patterns; /* Total patterns in the automata */
} AC_AUTOMATA_t;
} AC_SEARCH_t;
AC_AUTOMATA_t * ac_automata_init (MATCH_CALLBACK_f mc);
AC_ERROR_t ac_automata_add (AC_AUTOMATA_t * thiz, AC_PATTERN_t * str);
void ac_automata_finalize (AC_AUTOMATA_t * thiz);
int ac_automata_search (AC_AUTOMATA_t * thiz, AC_TEXT_t * str, AC_REP_t * param);
void ac_automata_reset (AC_AUTOMATA_t * thiz);
void ac_automata_release (AC_AUTOMATA_t * thiz, u_int8_t free_pattern);
void ac_automata_display (AC_AUTOMATA_t * thiz, char repcast);