suricata
|
Go to the source code of this file.
Functions | |
void | Bs2BmBadchars (const uint8_t *needle, uint16_t needle_len, uint8_t *badchars) |
Array setup function for Bs2Bm of bad characters index (not found at the needle) More... | |
uint8_t * | Bs2Bm (const uint8_t *haystack, uint32_t haystack_len, const uint8_t *needle, uint16_t needle_len, const uint8_t badchars[]) |
Basic search with a bad characters array. The array badchars contains flags at character's ascii index that can't be inside the needle. So the skips can be faster. More... | |
uint8_t * | Bs2BmNocase (const uint8_t *haystack, uint32_t haystack_len, const uint8_t *needle, uint16_t needle_len, const uint8_t badchars[]) |
Basic search case less with a bad characters array. The array badchars contains flags at character's ascii index that can't be inside the needle. So the skips can be faster. More... | |
Bs2Bm use a simple context array to determine the characters that are not present on the pattern. This way on partial matches broken by a char not present, we can skip to the next character making less checks
Definition in file util-spm-bs2bm.c.
uint8_t* Bs2Bm | ( | const uint8_t * | haystack, |
uint32_t | haystack_len, | ||
const uint8_t * | needle, | ||
uint16_t | needle_len, | ||
const uint8_t | badchars[] | ||
) |
Basic search with a bad characters array. The array badchars contains flags at character's ascii index that can't be inside the needle. So the skips can be faster.
haystack | pointer to the buffer to search in |
haystack_len | length limit of the buffer |
needle | pointer to the pattern we ar searching for |
needle_len | length limit of the needle |
badchars | pointer to an array of bachars prepared by Bs2BmBadchars() |
ptr | to start of the match; NULL if no match |
Definition at line 69 of file util-spm-bs2bm.c.
Referenced by Bs2bmSearch().
void Bs2BmBadchars | ( | const uint8_t * | needle, |
uint16_t | needle_len, | ||
uint8_t * | badchars | ||
) |
Array setup function for Bs2Bm of bad characters index (not found at the needle)
needle | pointer to the pattern we ar searching for |
needle_len | length limit of the needle |
badchars | pointer to an empty array of bachars. The array prepared contains characters that can't be inside the needle_len. So the skips can be faster |
Definition at line 43 of file util-spm-bs2bm.c.
References ALPHABET_SIZE.
Referenced by Bs2bmSearch().
uint8_t* Bs2BmNocase | ( | const uint8_t * | haystack, |
uint32_t | haystack_len, | ||
const uint8_t * | needle, | ||
uint16_t | needle_len, | ||
const uint8_t | badchars[] | ||
) |
Basic search case less with a bad characters array. The array badchars contains flags at character's ascii index that can't be inside the needle. So the skips can be faster.
haystack | pointer to the buffer to search in |
haystack_len | length limit of the buffer |
needle | pointer to the pattern we ar searching for |
needle_len | length limit of the needle |
badchars | pointer to an array of bachars prepared by Bs2BmBadchars() |
ptr | to start of the match; NULL if no match |
Definition at line 119 of file util-spm-bs2bm.c.
References u8_tolower.