suricata
|
#include "suricata-common.h"
Go to the source code of this file.
Macros | |
#define | ALPHABET_SIZE 256 |
Functions | |
void | Bs2BmBadchars (const uint8_t *, uint16_t, uint8_t *) |
Array setup function for Bs2Bm of bad characters index (not found at the needle) More... | |
uint8_t * | Bs2Bm (const uint8_t *, uint32_t, const uint8_t *, uint16_t, const uint8_t[]) |
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 *, uint32_t, const uint8_t *, uint16_t, const uint8_t[]) |
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... | |
Definition in file util-spm-bs2bm.h.
#define ALPHABET_SIZE 256 |
Definition at line 30 of file util-spm-bs2bm.h.
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.