suricata
util-spm-bs.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

uint8_t * BasicSearch (const uint8_t *, uint32_t, const uint8_t *, uint16_t)
 Basic search improved. Limits are better handled, so it doesn't start searches that wont fit in the remaining buffer. More...
 
uint8_t * BasicSearchNocase (const uint8_t *, uint32_t, const uint8_t *, uint16_t)
 Basic search case less. More...
 
uint32_t SCBasicSearchNocaseIndex (const uint8_t *, uint32_t, const uint8_t *, uint16_t)
 

Detailed Description

Function Documentation

◆ BasicSearch()

uint8_t* BasicSearch ( const uint8_t *  haystack,
uint32_t  haystack_len,
const uint8_t *  needle,
uint16_t  needle_len 
)

Basic search improved. Limits are better handled, so it doesn't start searches that wont fit in the remaining buffer.

Use libc's memmem if available.

Parameters
haystackpointer to the buffer to search in
haystack_lenlength limit of the buffer
needlepointer to the pattern we ar searching for
needle_lenlength limit of the needle
Return values
ptrto start of the match; NULL if no match

Definition at line 49 of file util-spm-bs.c.

References SCEnter, SCLogDebug, and SCReturnPtr.

Referenced by UTHmemsearch().

Here is the caller graph for this function:

◆ BasicSearchNocase()

uint8_t* BasicSearchNocase ( const uint8_t *  haystack,
uint32_t  haystack_len,
const uint8_t *  needle,
uint16_t  needle_len 
)

Basic search case less.

Parameters
haystackpointer to the buffer to search in
haystack_lenlength limit of the buffer
needlepointer to the pattern we ar searching for
needle_lenlength limit of the needle
Return values
ptrto start of the match; NULL if no match

Definition at line 106 of file util-spm-bs.c.

References u8_tolower.

Referenced by SCBasicSearchNocaseIndex().

Here is the caller graph for this function:

◆ SCBasicSearchNocaseIndex()

uint32_t SCBasicSearchNocaseIndex ( const uint8_t *  ,
uint32_t  ,
const uint8_t *  ,
uint16_t   
)

Definition at line 139 of file util-spm-bs.c.

References BasicSearchNocase().

Here is the call graph for this function: