summaryrefslogtreecommitdiff
path: root/src/analysis/scan/patterns/backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/scan/patterns/backend.c')
-rw-r--r--src/analysis/scan/patterns/backend.c61
1 files changed, 57 insertions, 4 deletions
diff --git a/src/analysis/scan/patterns/backend.c b/src/analysis/scan/patterns/backend.c
index 0ecc7fe..50cc889 100644
--- a/src/analysis/scan/patterns/backend.c
+++ b/src/analysis/scan/patterns/backend.c
@@ -155,9 +155,9 @@ size_t g_engine_backend_get_atom_max_size(const GEngineBackend *backend)
/******************************************************************************
* *
* Paramètres : backend = moteur de recherche à manipuler. *
-* context = contexte de l'analyse à mener. *
* plain = chaîne de caractères classique à intégrer. *
* len = taille de cette chaîne. *
+* tmp_id = identifiants temporaires vers le motif. [OUT] *
* *
* Description : Inscrit dans le moteur une chaîne de caractères à rechercher.*
* *
@@ -167,14 +167,14 @@ size_t g_engine_backend_get_atom_max_size(const GEngineBackend *backend)
* *
******************************************************************************/
-patid_t g_engine_backend_enroll_plain_pattern(GEngineBackend *backend, GScanContext *context, const uint8_t *plain, size_t len)
+bool g_engine_backend_enroll_plain_pattern(GEngineBackend *backend, const uint8_t *plain, size_t len, uint32_t tmp_id[2])
{
- patid_t result; /* Identifiant à retourner */
+ bool result; /* Bilan à retourner */
GEngineBackendClass *class; /* Classe à activer */
class = G_ENGINE_BACKEND_GET_CLASS(backend);
- result = class->enroll_plain(backend, context, plain, len);
+ result = class->enroll_plain(backend, plain, len, tmp_id);
return result;
@@ -208,6 +208,59 @@ void g_engine_backend_warm_up(GEngineBackend *backend)
/******************************************************************************
* *
* Paramètres : backend = moteur de recherche à manipuler. *
+* tmp_id = identifiants temporaires vers le motif. [OUT] *
+* *
+* Description : Récupère les identifiants finaux pour un motif recherché. *
+* *
+* Retour : Identifiant constitué ou INVALID_PATTERN_ID en cas d'échec. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+patid_t g_engine_backend_build_plain_pattern_id(const GEngineBackend *backend, const uint32_t tmp_id[2])
+{
+ patid_t result; /* Identifiant à retourner */
+ GEngineBackendClass *class; /* Classe à activer */
+
+ class = G_ENGINE_BACKEND_GET_CLASS(backend);
+
+ result = class->build_id(backend, tmp_id);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : backend = moteur de recherche à manipuler. *
+* *
+* Description : Détermine le nombre d'identifiants constitués. *
+* *
+* Retour : Quantité de gestionnaires de suivi à prévoir. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+size_t g_engine_backend_count_plain_pattern_ids(const GEngineBackend *backend)
+{
+ size_t result; /* Quantité à retourner */
+ GEngineBackendClass *class; /* Classe à activer */
+
+ class = G_ENGINE_BACKEND_GET_CLASS(backend);
+
+ result = class->count_ids(backend);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : backend = moteur de recherche à manipuler. *
* context = lieu d'enregistrement des résultats. *
* *
* Description : Parcours un contenu binaire à la recherche de motifs. *