diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2023-08-18 00:07:39 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2023-08-18 00:07:39 (GMT) |
commit | 2424c52c4f3bc44ce5f36348442cfa103e0989c2 (patch) | |
tree | f68aea488f403b234d4fcc6fd6e0f7b88a628ac8 /src/analysis/scan/matches/pending.h | |
parent | 1c5a0e67186def152536d9c506e2e6c3a3a265c5 (diff) |
Create some modifiers and handle match properties inside ROST.
Diffstat (limited to 'src/analysis/scan/matches/pending.h')
-rw-r--r-- | src/analysis/scan/matches/pending.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/analysis/scan/matches/pending.h b/src/analysis/scan/matches/pending.h index de2fd5f..0a1fe5c 100644 --- a/src/analysis/scan/matches/pending.h +++ b/src/analysis/scan/matches/pending.h @@ -25,6 +25,9 @@ #define _ANALYSIS_SCAN_MATCHES_PENDING_H +#include <stdbool.h> + + #include "../../content.h" @@ -33,7 +36,9 @@ typedef struct _match_area_t { phys_t start; /* Point de départ */ - phys_t length; /* Taille de la zone couverte */ + phys_t end; /* Point d'arrivée (exclus) */ + + unsigned long ttl; /* Durée de vie pour analyse */ } match_area_t; @@ -55,21 +60,34 @@ void init_pending_matches(pending_matches_t *); /* Libère la mémoire utilisée par une consolidation. */ void exit_pending_matches(pending_matches_t *); +// TODO ajouter un assert(used == 0) si !initialized */ #define are_pending_matches_initialized(pm) pm->initialized #define set_pending_matches_initialized(pm) pm->initialized = true -/* Détermine la zone de correspondance idéale pour complément. */ -bool find_target_in_pending_matches(pending_matches_t *, phys_t, size_t *); +/* Dénombre les correspondances établies jusque là. */ +size_t count_pending_matches(const pending_matches_t *); + +/* Fournit la liste des correspondances établies à présent. */ +const match_area_t *get_all_pending_matches(const pending_matches_t *, size_t *); /* Ajoute au suivi la définition d'une nouvelle correspondance. */ -void add_pending_matches(pending_matches_t *, phys_t, phys_t); +void add_pending_match(pending_matches_t *, phys_t, phys_t); /* Etend une zone couverte dans le suivi des correspondances. */ -void extend_pending_matches(pending_matches_t *, size_t, phys_t); +void extend_pending_match(pending_matches_t *, size_t, phys_t); + +/* Détermine si une correspondance se situe dans une plage. */ +bool has_pending_match_ending_between(const pending_matches_t *, size_t, phys_t, phys_t, phys_t); + +/* Détermine si une correspondance se termine à une position. */ +bool has_pending_match_ending_at(const pending_matches_t *, size_t, phys_t); + +/* Réinitialisation à 0 tous les TTL de correspondances. */ +void reset_pending_matches_ttl(pending_matches_t *); -/* Retire une correspondance finalement non établie du suivi. */ -void remove_pending_matches(pending_matches_t *, size_t); +/* Retire toutes les correspondances sans issue pour l'analyse. */ +void purge_pending_matches(pending_matches_t *); |