Go to the documentation of this file.
45 for (uint32_t x = 0; x <= mbuffer->
max; x++) {
86 if (local_id >= fb->
size) {
87 uint32_t old_size = fb->
size;
88 uint32_t new_size = local_id + 1;
89 uint32_t grow_by = new_size - old_size;
90 SCLogDebug(
"size is %u, need %u, so growing by %u", old_size, new_size, grow_by);
107 #ifdef DEBUG_VALIDATION
108 buffer->multi =
true;
131 InspectionBufferApplyTransformsInternal(det_ctx, buffer, transforms);
136 memset(buffer, 0,
sizeof(*buffer));
137 buffer->
buf =
SCCalloc(initial_size,
sizeof(uint8_t));
138 if (buffer->
buf != NULL) {
139 buffer->
size = initial_size;
146 #ifdef DEBUG_VALIDATION
160 #ifdef DEBUG_VALIDATION
168 InspectionBufferApplyTransformsInternal(det_ctx, buffer, transforms);
174 #ifdef DEBUG_VALIDATION
180 if (det_ctx && list_id != -1)
193 InspectionBufferSetupInternal(det_ctx, list_id, buffer, data, data_len);
201 InspectionBufferSetupInternal(det_ctx, list_id, buffer, data, data_len);
202 InspectionBufferApplyTransformsInternal(det_ctx, buffer, transforms);
207 if (buffer->
buf != NULL) {
210 memset(buffer, 0,
sizeof(*buffer));
222 uint32_t new_size = (buffer->
size == 0) ? 4096 : buffer->
size;
223 while (new_size < min_size) {
230 buffer->
size = new_size;
251 uint32_t copy_size =
MIN(buf_len, buffer->
size);
252 memcpy(buffer->
buf, buf, copy_size);
@ DETECT_EVENT_TOO_MANY_BUFFERS
void InspectionBufferApplyTransforms(DetectEngineThreadCtx *det_ctx, InspectionBuffer *buffer, const DetectEngineTransforms *transforms)
SigTableElmt * sigmatch_table
void InspectionBufferCopy(InspectionBuffer *buffer, uint8_t *buf, uint32_t buf_len)
void InspectionBufferClean(DetectEngineThreadCtx *det_ctx)
void InspectionBufferSetup(DetectEngineThreadCtx *det_ctx, const int list_id, InspectionBuffer *buffer, const uint8_t *data, const uint32_t data_len)
setup the buffer with our initial data
void DetectEngineSetEvent(DetectEngineThreadCtx *det_ctx, uint8_t e)
InspectionBuffer * InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
#define DETECT_TRANSFORMS_MAX
void InspectionBufferFree(InspectionBuffer *buffer)
InspectionBuffer * buffers
#define SCRealloc(ptr, sz)
uint32_t * to_clear_queue
void InspectionBufferInit(InspectionBuffer *buffer, uint32_t initial_size)
struct DetectEngineThreadCtx_::@98 inspect
void InspectionBufferSetupAndApplyTransforms(DetectEngineThreadCtx *det_ctx, const int list_id, InspectionBuffer *buffer, const uint8_t *data, const uint32_t data_len, const DetectEngineTransforms *transforms)
setup the buffer with our initial data
void InspectionBufferSetupMultiEmpty(InspectionBuffer *buffer)
setup the buffer empty
uint8_t * SCInspectionBufferCheckAndExpand(InspectionBuffer *buffer, uint32_t min_size)
make sure that the buffer has at least 'min_size' bytes Expand the buffer if necessary
struct DetectEngineThreadCtx_::@99 multi_inspect
void(* Transform)(DetectEngineThreadCtx *, InspectionBuffer *, void *context)
InspectionBuffer * inspection_buffers
#define DEBUG_VALIDATE_BUG_ON(exp)
void InspectionBufferSetupMulti(DetectEngineThreadCtx *det_ctx, InspectionBuffer *buffer, const DetectEngineTransforms *transforms, const uint8_t *data, const uint32_t data_len)
setup the buffer with our initial data
InspectionBuffer * InspectionBufferMultipleForListGet(DetectEngineThreadCtx *det_ctx, const int list_id, const uint32_t local_id)
for a InspectionBufferMultipleForList get a InspectionBuffer
void SCInspectionBufferTruncate(InspectionBuffer *buffer, uint32_t buf_len)