Skip to content

Commit cd0e428

Browse files
catenacybervictorjulien
authored andcommitted
detect/http: remove unused function parameter
Will help to use generic DetectEngineInspectBufferGeneric
1 parent 49783fa commit cd0e428

5 files changed

Lines changed: 12 additions & 15 deletions

File tree

src/detect-http-header-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ int HttpHeaderExpandBuffer(HttpHeaderThreadData *td, HttpHeaderBuffer *buf, size
9696
return 0;
9797
}
9898

99-
HttpHeaderBuffer *HttpHeaderGetBufferSpace(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags,
99+
HttpHeaderBuffer *HttpHeaderGetBufferSpace(DetectEngineThreadCtx *det_ctx, uint8_t flags,
100100
const int keyword_id, HttpHeaderThreadData **ret_hdr_td)
101101
{
102102
*ret_hdr_td = NULL;

src/detect-http-header-common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ typedef struct HttpHeaderThreadData_ {
4242
void *HttpHeaderThreadDataInit(void *data);
4343
void HttpHeaderThreadDataFree(void *data);
4444

45-
HttpHeaderBuffer *HttpHeaderGetBufferSpace(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags,
45+
HttpHeaderBuffer *HttpHeaderGetBufferSpace(DetectEngineThreadCtx *det_ctx, uint8_t flags,
4646
const int keyword_id, HttpHeaderThreadData **ret_hdr_td);
4747

4848
int HttpHeaderExpandBuffer(HttpHeaderThreadData *td, HttpHeaderBuffer *buf, size_t size);

src/detect-http-header-names.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,12 @@ static int g_keyword_thread_id = 0;
7676
static HttpHeaderThreadDataConfig g_td_config = { BUFFER_SIZE_STEP };
7777

7878
static uint8_t *GetBufferForTX(
79-
htp_tx_t *tx, DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, uint32_t *buffer_len)
79+
htp_tx_t *tx, DetectEngineThreadCtx *det_ctx, uint8_t flags, uint32_t *buffer_len)
8080
{
8181
*buffer_len = 0;
8282

8383
HttpHeaderThreadData *hdr_td = NULL;
84-
HttpHeaderBuffer *buf =
85-
HttpHeaderGetBufferSpace(det_ctx, f, flags, g_keyword_thread_id, &hdr_td);
84+
HttpHeaderBuffer *buf = HttpHeaderGetBufferSpace(det_ctx, flags, g_keyword_thread_id, &hdr_td);
8685
if (unlikely(buf == NULL)) {
8786
return NULL;
8887
}
@@ -150,7 +149,7 @@ static InspectionBuffer *GetBuffer1ForTX(DetectEngineThreadCtx *det_ctx,
150149
InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id);
151150
if (buffer->inspect == NULL) {
152151
uint32_t rawdata_len = 0;
153-
uint8_t *rawdata = GetBufferForTX(txv, det_ctx, f, flow_flags, &rawdata_len);
152+
uint8_t *rawdata = GetBufferForTX(txv, det_ctx, flow_flags, &rawdata_len);
154153
if (rawdata_len == 0)
155154
return NULL;
156155

src/detect-http-header.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,12 @@ static int g_keyword_thread_id = 0;
6969
static HttpHeaderThreadDataConfig g_td_config = { BUFFER_SIZE_STEP };
7070

7171
static uint8_t *GetBufferForTX(
72-
htp_tx_t *tx, DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, uint32_t *buffer_len)
72+
htp_tx_t *tx, DetectEngineThreadCtx *det_ctx, uint8_t flags, uint32_t *buffer_len)
7373
{
7474
*buffer_len = 0;
7575

7676
HttpHeaderThreadData *hdr_td = NULL;
77-
HttpHeaderBuffer *buf =
78-
HttpHeaderGetBufferSpace(det_ctx, f, flags, g_keyword_thread_id, &hdr_td);
77+
HttpHeaderBuffer *buf = HttpHeaderGetBufferSpace(det_ctx, flags, g_keyword_thread_id, &hdr_td);
7978
if (unlikely(buf == NULL)) {
8079
return NULL;
8180
}
@@ -186,7 +185,7 @@ static uint8_t DetectEngineInspectBufferHttpHeader(DetectEngineCtx *de_ctx,
186185
}
187186

188187
uint32_t rawdata_len = 0;
189-
uint8_t *rawdata = GetBufferForTX(txv, det_ctx, f, flags, &rawdata_len);
188+
uint8_t *rawdata = GetBufferForTX(txv, det_ctx, flags, &rawdata_len);
190189
if (rawdata_len == 0) {
191190
SCLogDebug("no data");
192191
if (engine->match_on_null && eof) {
@@ -245,7 +244,7 @@ static void PrefilterMpmHttpHeader(DetectEngineThreadCtx *det_ctx, const void *p
245244
InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id);
246245
if (buffer->inspect == NULL) {
247246
uint32_t rawdata_len = 0;
248-
uint8_t *rawdata = GetBufferForTX(txv, det_ctx, f, flags, &rawdata_len);
247+
uint8_t *rawdata = GetBufferForTX(txv, det_ctx, flags, &rawdata_len);
249248
if (rawdata_len == 0)
250249
return;
251250

src/detect-http-start.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,12 @@ static int g_keyword_thread_id = 0;
7575
static HttpHeaderThreadDataConfig g_td_config = { BUFFER_SIZE_STEP };
7676

7777
static uint8_t *GetBufferForTX(
78-
htp_tx_t *tx, DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, uint32_t *buffer_len)
78+
htp_tx_t *tx, DetectEngineThreadCtx *det_ctx, uint8_t flags, uint32_t *buffer_len)
7979
{
8080
*buffer_len = 0;
8181

8282
HttpHeaderThreadData *hdr_td = NULL;
83-
HttpHeaderBuffer *buf =
84-
HttpHeaderGetBufferSpace(det_ctx, f, flags, g_keyword_thread_id, &hdr_td);
83+
HttpHeaderBuffer *buf = HttpHeaderGetBufferSpace(det_ctx, flags, g_keyword_thread_id, &hdr_td);
8584
if (unlikely(buf == NULL)) {
8685
return NULL;
8786
}
@@ -155,7 +154,7 @@ static InspectionBuffer *GetBuffer1ForTX(DetectEngineThreadCtx *det_ctx,
155154
InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id);
156155
if (buffer->inspect == NULL) {
157156
uint32_t rawdata_len = 0;
158-
uint8_t *rawdata = GetBufferForTX(txv, det_ctx, f, flow_flags, &rawdata_len);
157+
uint8_t *rawdata = GetBufferForTX(txv, det_ctx, flow_flags, &rawdata_len);
159158
if (rawdata_len == 0)
160159
return NULL;
161160

0 commit comments

Comments
 (0)