Go to the documentation of this file.
25 #ifndef SURICATA_UTIL_SPM_BM
26 #define SURICATA_UTIL_SPM_BM
30 #define ALPHABET_SIZE 256
44 uint8_t *
BoyerMoore(
const uint8_t *x,
const uint16_t
m,
const uint8_t *y,
const uint32_t n,
46 uint8_t *
BoyerMooreNocase(
const uint8_t *x,
const uint16_t
m,
const uint8_t *y,
const uint32_t n,
void BoyerMooreCtxToNocase(BmCtx *, uint8_t *, uint16_t)
Given a BmCtx structure, recreate the pre/suffixes for nocase.
uint8_t * BoyerMoore(const uint8_t *x, const uint16_t m, const uint8_t *y, const uint32_t n, const BmCtx *bm_ctx)
Boyer Moore search algorithm Is better as the pattern length increases and for big buffers to search ...
void BoyerMooreCtxDeInit(BmCtx *)
Free the memory allocated to Boyer Moore context.
uint16_t bmBc[ALPHABET_SIZE]
BmCtx * BoyerMooreCtxInit(const uint8_t *needle, uint16_t needle_len)
Setup a Boyer Moore context.
BmCtx * BoyerMooreNocaseCtxInit(uint8_t *needle, uint16_t needle_len)
Setup a Boyer Moore context for nocase search.
uint8_t * BoyerMooreNocase(const uint8_t *x, const uint16_t m, const uint8_t *y, const uint32_t n, const BmCtx *bm_ctx)
Boyer Moore search algorithm Is better as the pattern length increases and for big buffers to search ...