]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
src: remove some unused parameters
authorPhilippe Antoine <pantoine@oisf.net>
Tue, 14 May 2024 20:38:22 +0000 (22:38 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 31 May 2024 11:11:09 +0000 (13:11 +0200)
18 files changed:
src/app-layer-detect-proto.c
src/app-layer-frames.c
src/app-layer-htp-file.c
src/app-layer-htp-file.h
src/app-layer-htp.c
src/app-layer.c
src/app-layer.h
src/decode.c
src/detect-fragbits.c
src/detect-replace.c
src/stream-tcp-reassemble.c
src/tm-threads.c
src/tm-threads.h
src/util-classification-config.c
src/util-exception-policy.c
src/util-reference-config.c
src/util-streaming-buffer.c
src/util-threshold-config.c

index c47a437659fdb54aa459db128a2c0c585953853a..68fca345f7147d20b8cc86225a67eeef93e93e99 100644 (file)
@@ -460,7 +460,7 @@ static AppLayerProtoDetectProbingParserPort *AppLayerProtoDetectGetProbingParser
  * \brief Call the probing expectation to see if there is some for this flow.
  *
  */
-static AppProto AppLayerProtoDetectPEGetProto(Flow *f, uint8_t ipproto, uint8_t flags)
+static AppProto AppLayerProtoDetectPEGetProto(Flow *f, uint8_t flags)
 {
     AppProto alproto = ALPROTO_UNKNOWN;
 
@@ -1444,7 +1444,7 @@ AppProto AppLayerProtoDetectGetProto(AppLayerProtoDetectThreadCtx *tctx, Flow *f
 
     /* Look if flow can be found in expectation list */
     if (!FLOW_IS_PE_DONE(f, flags)) {
-        alproto = AppLayerProtoDetectPEGetProto(f, ipproto, flags);
+        alproto = AppLayerProtoDetectPEGetProto(f, flags);
     }
 
  end:
index 832752cf16e914ac225e0a7e25d178e84e5cd887..0aa0e19b82acb047d40ea97a35b7fd7ef4fa223a 100644 (file)
@@ -464,8 +464,8 @@ Frame *AppLayerFrameNewByPointer(Flow *f, const StreamSlice *stream_slice,
     return r;
 }
 
-static Frame *AppLayerFrameUdp(Flow *f, const StreamSlice *stream_slice,
-        const uint32_t frame_start_rel, const int64_t len, int dir, uint8_t frame_type)
+static Frame *AppLayerFrameUdp(
+        Flow *f, const uint32_t frame_start_rel, const int64_t len, int dir, uint8_t frame_type)
 {
     BUG_ON(f->proto != IPPROTO_UDP);
 
@@ -511,7 +511,7 @@ Frame *AppLayerFrameNewByRelativeOffset(Flow *f, const StreamSlice *stream_slice
     BUG_ON(f->alparser == NULL);
 
     if (f->proto == IPPROTO_UDP) {
-        return AppLayerFrameUdp(f, stream_slice, frame_start_rel, len, dir, frame_type);
+        return AppLayerFrameUdp(f, frame_start_rel, len, dir, frame_type);
     }
 
     FramesContainer *frames_container = AppLayerFramesSetupContainer(f);
@@ -666,8 +666,7 @@ Frame *AppLayerFrameGetById(Flow *f, const int dir, const FrameId frame_id)
     return FrameGetById(frames, frame_id);
 }
 
-static inline bool FrameIsDone(
-        const Frame *frame, const uint64_t abs_offset, const uint64_t abs_right_edge)
+static inline bool FrameIsDone(const Frame *frame, const uint64_t abs_right_edge)
 {
     /* frame with negative length means we don't know the size yet. */
     if (frame->len < 0)
@@ -688,7 +687,6 @@ static void FramePrune(Frames *frames, const TcpStream *stream, const bool eof)
     SCLogDebug("start: left edge %" PRIu64 ", left_edge_rel %u, stream base %" PRIu64,
             (uint64_t)frames->left_edge_rel + STREAM_BASE_OFFSET(stream), frames->left_edge_rel,
             STREAM_BASE_OFFSET(stream));
-    const uint64_t abs_offset = STREAM_BASE_OFFSET(stream);
     const uint64_t acked = StreamTcpGetUsable(stream, eof);
     uint64_t le = STREAM_APP_PROGRESS(stream);
 
@@ -699,7 +697,7 @@ static void FramePrune(Frames *frames, const TcpStream *stream, const bool eof)
         if (i < FRAMES_STATIC_CNT) {
             Frame *frame = &frames->sframes[i];
             FrameDebug("prune(s)", frames, frame);
-            if (eof || FrameIsDone(frame, abs_offset, acked)) {
+            if (eof || FrameIsDone(frame, acked)) {
                 // remove by not incrementing 'x'
                 SCLogDebug("removing %p id %" PRIi64, frame, frame->id);
                 FrameDebug("remove(s)", frames, frame);
@@ -720,7 +718,7 @@ static void FramePrune(Frames *frames, const TcpStream *stream, const bool eof)
             const uint16_t o = i - FRAMES_STATIC_CNT;
             Frame *frame = &frames->dframes[o];
             FrameDebug("prune(d)", frames, frame);
-            if (eof || FrameIsDone(frame, abs_offset, acked)) {
+            if (eof || FrameIsDone(frame, acked)) {
                 // remove by not incrementing 'x'
                 SCLogDebug("removing %p id %" PRIi64, frame, frame->id);
                 FrameDebug("remove(d)", frames, frame);
index b2c8776a7192fe731f74f9daa2a42f845e85d1da..9bcff0668f1a4005baffaa24116dc1e3d4f61a99 100644 (file)
@@ -216,8 +216,7 @@ int HTPFileOpenWithRange(HtpState *s, HtpTxUserData *txud, const uint8_t *filena
  *  \retval -1 error
  *  \retval -2 file doesn't need storing
  */
-int HTPFileStoreChunk(
-        HtpState *s, HtpTxUserData *tx, const uint8_t *data, uint32_t data_len, uint8_t direction)
+int HTPFileStoreChunk(HtpTxUserData *tx, const uint8_t *data, uint32_t data_len, uint8_t direction)
 {
     SCEnter();
 
@@ -303,8 +302,8 @@ bool HTPFileCloseHandleRange(const StreamingBufferConfig *sbcfg, FileContainer *
  *  \retval -1 error
  *  \retval -2 not storing files on this flow/tx
  */
-int HTPFileClose(HtpState *s, HtpTxUserData *tx, const uint8_t *data, uint32_t data_len,
-        uint8_t flags, uint8_t direction)
+int HTPFileClose(
+        HtpTxUserData *tx, const uint8_t *data, uint32_t data_len, uint8_t flags, uint8_t direction)
 {
     SCEnter();
 
index 5e05bcb28b17bcc6a333f2a12600f3c461bc02c9..53a47d5d3020c55fce06ef1a50d26c9ec10a4a1f 100644 (file)
@@ -33,11 +33,11 @@ int HTPFileOpenWithRange(HtpState *, HtpTxUserData *, const uint8_t *, uint16_t,
         uint32_t, htp_tx_t *, bstr *rawvalue, HtpTxUserData *htud);
 bool HTPFileCloseHandleRange(const StreamingBufferConfig *sbcfg, FileContainer *, const uint16_t,
         HttpRangeContainerBlock *, const uint8_t *, uint32_t);
-int HTPFileStoreChunk(HtpState *, HtpTxUserData *, const uint8_t *, uint32_t, uint8_t);
+int HTPFileStoreChunk(HtpTxUserData *, const uint8_t *, uint32_t, uint8_t);
 
 int HTPParseContentRange(bstr *rawvalue, HTTPContentRange *range);
-int HTPFileClose(HtpState *, HtpTxUserData *tx, const uint8_t *data, uint32_t data_len,
-        uint8_t flags, uint8_t direction);
+int HTPFileClose(HtpTxUserData *tx, const uint8_t *data, uint32_t data_len, uint8_t flags,
+        uint8_t direction);
 
 void HTPFileParserRegisterTests(void);
 
index d17adf579dd6ab7b4579356f8650aba5fe9c04c8..c4df1d93dc0d79413465237c2fb2ecc29c69a9e5 100644 (file)
@@ -1465,8 +1465,7 @@ static int HtpRequestBodyHandleMultipart(HtpState *hstate, HtpTxUserData *htud,
             printf("FILEDATA (final chunk) END: \n");
 #endif
             if (!(htud->tsflags & HTP_DONTSTORE)) {
-                if (HTPFileClose(hstate, htud, filedata, filedata_len, flags, STREAM_TOSERVER) ==
-                        -1) {
+                if (HTPFileClose(htud, filedata, filedata_len, flags, STREAM_TOSERVER) == -1) {
                     goto end;
                 }
             }
@@ -1497,8 +1496,7 @@ static int HtpRequestBodyHandleMultipart(HtpState *hstate, HtpTxUserData *htud,
 #endif
 
                 if (!(htud->tsflags & HTP_DONTSTORE)) {
-                    result = HTPFileStoreChunk(
-                            hstate, htud, filedata, filedata_len, STREAM_TOSERVER);
+                    result = HTPFileStoreChunk(htud, filedata, filedata_len, STREAM_TOSERVER);
                     if (result == -1) {
                         goto end;
                     } else if (result == -2) {
@@ -1598,7 +1596,7 @@ static int HtpRequestBodyHandleMultipart(HtpState *hstate, HtpTxUserData *htud,
                 } else if (result == -2) {
                     htud->tsflags |= HTP_DONTSTORE;
                 } else {
-                    if (HTPFileClose(hstate, htud, NULL, 0, 0, STREAM_TOSERVER) == -1) {
+                    if (HTPFileClose(htud, NULL, 0, 0, STREAM_TOSERVER) == -1) {
                         goto end;
                     }
                 }
@@ -1675,7 +1673,7 @@ static int HtpRequestBodyHandleMultipart(HtpState *hstate, HtpTxUserData *htud,
                     } else if (result == -2) {
                         htud->tsflags |= HTP_DONTSTORE;
                     } else {
-                        if (HTPFileClose(hstate, htud, NULL, 0, 0, STREAM_TOSERVER) == -1) {
+                        if (HTPFileClose(htud, NULL, 0, 0, STREAM_TOSERVER) == -1) {
                             goto end;
                         }
                     }
@@ -1763,7 +1761,7 @@ static int HtpRequestBodyHandlePOSTorPUT(HtpState *hstate, HtpTxUserData *htud,
         /* otherwise, just store the data */
 
         if (!(htud->tsflags & HTP_DONTSTORE)) {
-            result = HTPFileStoreChunk(hstate, htud, data, data_len, STREAM_TOSERVER);
+            result = HTPFileStoreChunk(htud, data, data_len, STREAM_TOSERVER);
             if (result == -1) {
                 goto end;
             } else if (result == -2) {
@@ -1843,7 +1841,7 @@ static int HtpResponseBodyHandle(HtpState *hstate, HtpTxUserData *htud,
         /* otherwise, just store the data */
 
         if (!(htud->tcflags & HTP_DONTSTORE)) {
-            result = HTPFileStoreChunk(hstate, htud, data, data_len, STREAM_TOCLIENT);
+            result = HTPFileStoreChunk(htud, data, data_len, STREAM_TOCLIENT);
             SCLogDebug("result %d", result);
             if (result == -1) {
                 goto end;
@@ -1959,7 +1957,7 @@ static int HTPCallbackRequestBodyData(htp_tx_data_t *d)
     } else {
         if (tx_ud->tsflags & HTP_FILENAME_SET) {
             SCLogDebug("closing file that was being stored");
-            (void)HTPFileClose(hstate, tx_ud, NULL, 0, FILE_TRUNCATED, STREAM_TOSERVER);
+            (void)HTPFileClose(tx_ud, NULL, 0, FILE_TRUNCATED, STREAM_TOSERVER);
             tx_ud->tsflags &= ~HTP_FILENAME_SET;
         }
     }
@@ -2050,7 +2048,7 @@ static int HTPCallbackResponseBodyData(htp_tx_data_t *d)
     } else {
         if (tx_ud->tcflags & HTP_FILENAME_SET) {
             SCLogDebug("closing file that was being stored");
-            (void)HTPFileClose(hstate, tx_ud, NULL, 0, FILE_TRUNCATED, STREAM_TOCLIENT);
+            (void)HTPFileClose(tx_ud, NULL, 0, FILE_TRUNCATED, STREAM_TOCLIENT);
             tx_ud->tcflags &= ~HTP_FILENAME_SET;
         }
     }
@@ -2273,7 +2271,7 @@ static int HTPCallbackRequestComplete(htp_tx_t *tx)
     if (htud != NULL) {
         if (htud->tsflags & HTP_FILENAME_SET) {
             SCLogDebug("closing file that was being stored");
-            (void)HTPFileClose(hstate, htud, NULL, 0, 0, STREAM_TOSERVER);
+            (void)HTPFileClose(htud, NULL, 0, 0, STREAM_TOSERVER);
             htud->tsflags &= ~HTP_FILENAME_SET;
             if (abs_right_edge < (uint64_t)UINT32_MAX) {
                 StreamTcpReassemblySetMinInspectDepth(
@@ -2328,7 +2326,7 @@ static int HTPCallbackResponseComplete(htp_tx_t *tx)
     if (htud != NULL) {
         if (htud->tcflags & HTP_FILENAME_SET) {
             SCLogDebug("closing file that was being stored");
-            (void)HTPFileClose(hstate, htud, NULL, 0, 0, STREAM_TOCLIENT);
+            (void)HTPFileClose(htud, NULL, 0, 0, STREAM_TOCLIENT);
             htud->tcflags &= ~HTP_FILENAME_SET;
         }
     }
index 1dc72ed63dac721c595d69a20d481c3216aeb61e..b2b720d5f57626a9e7b3bf38ef8a7a9586b618e9 100644 (file)
@@ -1056,7 +1056,7 @@ int AppLayerDeSetup(void)
     SCReturnInt(0);
 }
 
-AppLayerThreadCtx *AppLayerGetCtxThread(ThreadVars *tv)
+AppLayerThreadCtx *AppLayerGetCtxThread(void)
 {
     SCEnter();
 
index 2a6b4df1462afceb1f2660ed70c67c74ac9a09fe..1dea87ee34a8ac2d40cf01c8bb718e6af37b6bd1 100644 (file)
@@ -102,7 +102,7 @@ int AppLayerDeSetup(void);
  * \retval Pointer to the newly create thread context, on success;
  *         NULL, on failure.
  */
-AppLayerThreadCtx *AppLayerGetCtxThread(ThreadVars *tv);
+AppLayerThreadCtx *AppLayerGetCtxThread(void);
 
 /**
  * \brief Destroys the context created by AppLayerGetCtxThread().
@@ -121,21 +121,15 @@ void AppLayerRegisterThreadCounters(ThreadVars *tv);
 
 void AppLayerProfilingResetInternal(AppLayerThreadCtx *app_tctx);
 
-static inline void AppLayerProfilingReset(AppLayerThreadCtx *app_tctx)
-{
-#ifdef PROFILING
-    AppLayerProfilingResetInternal(app_tctx);
-#endif
-}
-
 void AppLayerProfilingStoreInternal(AppLayerThreadCtx *app_tctx, Packet *p);
 
-static inline void AppLayerProfilingStore(AppLayerThreadCtx *app_tctx, Packet *p)
-{
 #ifdef PROFILING
-    AppLayerProfilingStoreInternal(app_tctx, p);
+#define AppLayerProfilingReset(app_tctx)    AppLayerProfilingResetInternal(app_tctx)
+#define AppLayerProfilingStore(app_tctx, p) AppLayerProfilingStoreInternal(app_tctx, p)
+#else
+#define AppLayerProfilingReset(app_tctx)
+#define AppLayerProfilingStore(app_tctx, p)
 #endif
-}
 
 void AppLayerRegisterGlobalCounters(void);
 
index ff99f9a77e4d2ad23e6b2540a44930f8c73576d3..f74737ed2cddbba40153baa7fc9fb595d3731bd8 100644 (file)
@@ -776,7 +776,7 @@ DecodeThreadVars *DecodeThreadVarsAlloc(ThreadVars *tv)
     if ((dtv = SCCalloc(1, sizeof(DecodeThreadVars))) == NULL)
         return NULL;
 
-    dtv->app_tctx = AppLayerGetCtxThread(tv);
+    dtv->app_tctx = AppLayerGetCtxThread();
 
     if (OutputFlowLogThreadInit(tv, NULL, &dtv->output_flow_thread_data) != TM_ECODE_OK) {
         SCLogError("initializing flow log API for thread failed");
index ec82bd0446a1cb957083a1eaf28c2c4f07740eff..1d004962596cbb1dd87eca53350fc01cdd60ab7c 100644 (file)
@@ -480,7 +480,7 @@ static int FragBitsTestParse03 (void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(&dtv, 0, sizeof(DecodeThreadVars));
-    dtv.app_tctx = AppLayerGetCtxThread(&tv);
+    dtv.app_tctx = AppLayerGetCtxThread();
 
     FlowInitConfig(FLOW_QUIET);
 
@@ -562,7 +562,7 @@ static int FragBitsTestParse04 (void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(&dtv, 0, sizeof(DecodeThreadVars));
-    dtv.app_tctx = AppLayerGetCtxThread(&tv);
+    dtv.app_tctx = AppLayerGetCtxThread();
 
     FlowInitConfig(FLOW_QUIET);
 
index 78b4a5f1d88b8582e8fee6914ba9faf02438da28..620e9ed9355f1c4f36b015347eddfe0b56b371ef 100644 (file)
@@ -246,7 +246,7 @@ int DetectReplaceLongPatternMatchTest(uint8_t *raw_eth_pkt, uint16_t pktsize,
     PacketCopyData(p, raw_eth_pkt, pktsize);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&th_v, 0, sizeof(th_v));
-    dtv.app_tctx = AppLayerGetCtxThread(&th_v);
+    dtv.app_tctx = AppLayerGetCtxThread();
 
     FlowInitConfig(FLOW_QUIET);
     DecodeEthernet(&th_v, &dtv, p, GET_PKT_DATA(p), pktsize);
index 080f67961750cae836ce034a6fea1c7262a3ba2e..317e021a8ed9bfd8c79e502bf1f028a0f8f5e2a6 100644 (file)
@@ -560,7 +560,7 @@ TcpReassemblyThreadCtx *StreamTcpReassembleInitThreadCtx(ThreadVars *tv)
     if (unlikely(ra_ctx == NULL))
         return NULL;
 
-    ra_ctx->app_tctx = AppLayerGetCtxThread(tv);
+    ra_ctx->app_tctx = AppLayerGetCtxThread();
 
     SCMutexLock(&segment_thread_pool_mutex);
     if (segment_thread_pool == NULL) {
index 557d994140c7acd27cef39f4e564705cfbea6f92..032ceef45fe6e669fef0d8ed7f2152a09ed96fb8 100644 (file)
@@ -139,7 +139,7 @@ TmEcode TmThreadsSlotVarRun(ThreadVars *tv, Packet *p, TmSlot *slot)
         /* handle error */
         if (unlikely(r == TM_ECODE_FAILED)) {
             /* Encountered error.  Return packets to packetpool and return */
-            TmThreadsSlotProcessPktFail(tv, s, NULL);
+            TmThreadsSlotProcessPktFail(tv, NULL);
             return TM_ECODE_FAILED;
         }
         if (s->tm_flags & TM_FLAG_DECODE_TM) {
index f98a42fe6135b325df65dcadc70487b6401c332a..67bea14110328dcc2b5cf475d51bed047d9dfe95 100644 (file)
@@ -141,7 +141,7 @@ static inline void TmThreadsCleanDecodePQ(PacketQueueNoLock *pq)
     }
 }
 
-static inline void TmThreadsSlotProcessPktFail(ThreadVars *tv, TmSlot *s, Packet *p)
+static inline void TmThreadsSlotProcessPktFail(ThreadVars *tv, Packet *p)
 {
     if (p != NULL) {
         TmqhOutputPacketpool(tv, p);
@@ -176,7 +176,7 @@ static inline bool TmThreadsHandleInjectedPackets(ThreadVars *tv)
 #endif
             TmEcode r = TmThreadsSlotVarRun(tv, extra_p, tv->tm_flowworker);
             if (r == TM_ECODE_FAILED) {
-                TmThreadsSlotProcessPktFail(tv, tv->tm_flowworker, extra_p);
+                TmThreadsSlotProcessPktFail(tv, extra_p);
                 break;
             }
             tv->tmqh_out(tv, extra_p);
@@ -199,7 +199,7 @@ static inline TmEcode TmThreadsSlotProcessPkt(ThreadVars *tv, TmSlot *s, Packet
 
     TmEcode r = TmThreadsSlotVarRun(tv, p, s);
     if (unlikely(r == TM_ECODE_FAILED)) {
-        TmThreadsSlotProcessPktFail(tv, s, p);
+        TmThreadsSlotProcessPktFail(tv, p);
         return TM_ECODE_FAILED;
     }
 
index 5bcc0960c88722f2ecbe84c93436ae8959001359..e4dc6d5190d4b260283acb6029ead8b7fb680b2f 100644 (file)
@@ -178,7 +178,7 @@ static const char *SCClassConfGetConfFilename(const DetectEngineCtx *de_ctx)
 /**
  * \brief Releases resources used by the Classification Config API.
  */
-static void SCClassConfDeInitLocalResources(DetectEngineCtx *de_ctx, FILE *fd)
+static void SCClassConfDeInitLocalResources(FILE *fd)
 {
     if (fd != NULL) {
         fclose(fd);
@@ -549,7 +549,7 @@ bool SCClassConfLoadClassificationConfigFile(DetectEngineCtx *de_ctx, FILE *fd)
         ret = false;
     }
 
-    SCClassConfDeInitLocalResources(de_ctx, fd);
+    SCClassConfDeInitLocalResources(fd);
 
     return ret;
 }
index eebda2f70ef44e7573fe3e32deb9824637bbacdb..9900720202690c486d92ac757b1f70cbb53de076 100644 (file)
@@ -61,7 +61,7 @@ void SetMasterExceptionPolicy(void)
     g_eps_master_switch = ExceptionPolicyParse("exception-policy", true);
 }
 
-static enum ExceptionPolicy GetMasterExceptionPolicy(const char *option)
+static enum ExceptionPolicy GetMasterExceptionPolicy(void)
 {
     return g_eps_master_switch;
 }
@@ -208,7 +208,7 @@ static enum ExceptionPolicy ExceptionPolicyGetDefault(
 {
     enum ExceptionPolicy p = EXCEPTION_POLICY_NOT_SET;
     if (g_eps_have_exception_policy) {
-        p = GetMasterExceptionPolicy(option);
+        p = GetMasterExceptionPolicy();
 
         if (p == EXCEPTION_POLICY_AUTO) {
             p = ExceptionPolicyPickAuto(midstream, support_flow);
index e1d6aa36366ac4d599e480250dfb5b8c1e9729b0..8a84af57d6c7e55913483ae90ef0267c9a335243 100644 (file)
@@ -167,13 +167,11 @@ static const char *SCRConfGetConfFilename(const DetectEngineCtx *de_ctx)
 /**
  * \brief Releases local resources used by the Reference Config API.
  */
-static void SCRConfDeInitLocalResources(DetectEngineCtx *de_ctx, FILE *fd)
+static void SCRConfDeInitLocalResources(FILE *fd)
 {
     if (fd != NULL) {
         fclose(fd);
     }
-
-    return;
 }
 
 /**
@@ -506,7 +504,7 @@ int SCRConfLoadReferenceConfigFile(DetectEngineCtx *de_ctx, FILE *fd)
     }
 
     bool rc = SCRConfParseFile(de_ctx, fd);
-    SCRConfDeInitLocalResources(de_ctx, fd);
+    SCRConfDeInitLocalResources(fd);
 
     return rc ? 0 : -1;
 }
index 69d865370118e94e43a88e97b69019d91169f9da..6f9146269bbc939fa1c26f53b82a352e29ba7efc 100644 (file)
@@ -153,9 +153,9 @@ static inline bool RegionsIntersect(const StreamingBufferConfig *cfg,
 /** \internal
  *  \brief find the first region for merging.
  */
-static StreamingBufferRegion *FindFirstRegionForOffset(const StreamingBuffer *sb,
-        const StreamingBufferConfig *cfg, StreamingBufferRegion *r, const uint64_t offset,
-        const uint32_t len, StreamingBufferRegion **prev)
+static StreamingBufferRegion *FindFirstRegionForOffset(const StreamingBufferConfig *cfg,
+        StreamingBufferRegion *r, const uint64_t offset, const uint32_t len,
+        StreamingBufferRegion **prev)
 {
     const uint64_t data_re = offset + len;
     SCLogDebug("looking for first region matching %" PRIu64 "/%" PRIu64, offset, data_re);
@@ -172,9 +172,8 @@ static StreamingBufferRegion *FindFirstRegionForOffset(const StreamingBuffer *sb
     return NULL;
 }
 
-static StreamingBufferRegion *FindLargestRegionForOffset(const StreamingBuffer *sb,
-        const StreamingBufferConfig *cfg, StreamingBufferRegion *r, const uint64_t offset,
-        const uint32_t len)
+static StreamingBufferRegion *FindLargestRegionForOffset(const StreamingBufferConfig *cfg,
+        StreamingBufferRegion *r, const uint64_t offset, const uint32_t len)
 {
     const uint64_t data_re = offset + len;
     SCLogDebug("starting at %p/%" PRIu64 ", offset %" PRIu64 ", data_re %" PRIu64, r,
@@ -197,9 +196,8 @@ static StreamingBufferRegion *FindLargestRegionForOffset(const StreamingBuffer *
     return candidate;
 }
 
-static StreamingBufferRegion *FindRightEdge(const StreamingBuffer *sb,
-        const StreamingBufferConfig *cfg, StreamingBufferRegion *r, const uint64_t offset,
-        const uint32_t len)
+static StreamingBufferRegion *FindRightEdge(const StreamingBufferConfig *cfg,
+        StreamingBufferRegion *r, const uint64_t offset, const uint32_t len)
 {
     const uint64_t data_re = offset + len;
     StreamingBufferRegion *candidate = r;
@@ -368,8 +366,8 @@ static int WARN_UNUSED SBBInit(StreamingBuffer *sb, const StreamingBufferConfig
  *
  * [gap][block]
  **/
-static int WARN_UNUSED SBBInitLeadingGap(StreamingBuffer *sb, const StreamingBufferConfig *cfg,
-        StreamingBufferRegion *region, uint64_t offset, uint32_t data_len)
+static int WARN_UNUSED SBBInitLeadingGap(
+        StreamingBuffer *sb, const StreamingBufferConfig *cfg, uint64_t offset, uint32_t data_len)
 {
     DEBUG_VALIDATE_BUG_ON(!RB_EMPTY(&sb->sbb_tree));
 
@@ -1384,21 +1382,21 @@ static StreamingBufferRegion *BufferInsertAtRegionDo(StreamingBuffer *sb,
     SCLogDebug("offset %" PRIu64 ", len %u", offset, len);
     StreamingBufferRegion *start_prev = NULL;
     StreamingBufferRegion *start =
-            FindFirstRegionForOffset(sb, cfg, &sb->region, offset, len, &start_prev);
+            FindFirstRegionForOffset(cfg, &sb->region, offset, len, &start_prev);
     if (start) {
         const uint64_t insert_re = offset + len;
         const uint64_t insert_start_offset = MIN(start->stream_offset, offset);
         uint64_t insert_adjusted_re = insert_re;
 
         SCLogDebug("start region %p/%" PRIu64 "/%u", start, start->stream_offset, start->buf_size);
-        StreamingBufferRegion *big = FindLargestRegionForOffset(sb, cfg, start, offset, len);
+        StreamingBufferRegion *big = FindLargestRegionForOffset(cfg, start, offset, len);
         DEBUG_VALIDATE_BUG_ON(big == NULL);
         if (big == NULL) {
             sc_errno = SC_EINVAL;
             return NULL;
         }
         SCLogDebug("big region %p/%" PRIu64 "/%u", big, big->stream_offset, big->buf_size);
-        StreamingBufferRegion *end = FindRightEdge(sb, cfg, big, offset, len);
+        StreamingBufferRegion *end = FindRightEdge(cfg, big, offset, len);
         DEBUG_VALIDATE_BUG_ON(end == NULL);
         if (end == NULL) {
             sc_errno = SC_EINVAL;
@@ -1461,8 +1459,7 @@ static StreamingBufferRegion *BufferInsertAtRegionDo(StreamingBuffer *sb,
  *  \note sets sc_errno
  */
 static StreamingBufferRegion *BufferInsertAtRegion(StreamingBuffer *sb,
-        const StreamingBufferConfig *cfg, const uint8_t *data, const uint32_t data_len,
-        const uint64_t data_offset)
+        const StreamingBufferConfig *cfg, const uint32_t data_len, const uint64_t data_offset)
 {
     SCLogDebug("data_offset %" PRIu64 ", data_len %u, re %" PRIu64, data_offset, data_len,
             data_offset + data_len);
@@ -1519,7 +1516,7 @@ int StreamingBufferInsertAt(StreamingBuffer *sb, const StreamingBufferConfig *cf
         return SC_EINVAL;
     }
 
-    StreamingBufferRegion *region = BufferInsertAtRegion(sb, cfg, data, data_len, offset);
+    StreamingBufferRegion *region = BufferInsertAtRegion(sb, cfg, data_len, offset);
     if (region == NULL) {
         return sc_errno;
     }
@@ -1590,7 +1587,7 @@ int StreamingBufferInsertAt(StreamingBuffer *sb, const StreamingBufferConfig *cf
                 } else {
                     /* gap before data in empty list */
                     SCLogDebug("empty sbb list: invoking SBBInitLeadingGap");
-                    if ((r = SBBInitLeadingGap(sb, cfg, region, offset, data_len)) != SC_OK)
+                    if ((r = SBBInitLeadingGap(sb, cfg, offset, data_len)) != SC_OK)
                         return r;
                 }
             }
@@ -1603,7 +1600,7 @@ int StreamingBufferInsertAt(StreamingBuffer *sb, const StreamingBufferConfig *cf
             } else {
                 /* gap before data in empty list */
                 SCLogDebug("empty sbb list: invoking SBBInitLeadingGap");
-                if ((r = SBBInitLeadingGap(sb, cfg, region, offset, data_len)) != SC_OK)
+                if ((r = SBBInitLeadingGap(sb, cfg, offset, data_len)) != SC_OK)
                     return r;
             }
             if (rel_offset == region->buf_offset) {
index 8f287adf2cd3df5ff9d7011cdb48a568606f2ac5..79663e8db9382124c7974e0f6f29e6094a7f4664 100644 (file)
@@ -344,9 +344,8 @@ error:
  *  \retval -1 error
  */
 static int SetupThresholdRule(DetectEngineCtx *de_ctx, uint32_t id, uint32_t gid,
-        uint8_t parsed_type, uint8_t parsed_track, uint32_t parsed_count,
-        uint32_t parsed_seconds, uint32_t parsed_timeout, uint8_t parsed_new_action,
-        const char *th_ip)
+        uint8_t parsed_type, uint8_t parsed_track, uint32_t parsed_count, uint32_t parsed_seconds,
+        uint32_t parsed_timeout, uint8_t parsed_new_action)
 {
     Signature *s = NULL;
     SigMatch *sm = NULL;
@@ -894,9 +893,8 @@ static int SCThresholdConfAddThresholdtype(char *rawstr, DetectEngineCtx *de_ctx
                     parsed_count, parsed_seconds, parsed_timeout, parsed_new_action,
                     th_ip);
     } else {
-        r = SetupThresholdRule(de_ctx, id, gid, parsed_type, parsed_track,
-                    parsed_count, parsed_seconds, parsed_timeout, parsed_new_action,
-                    th_ip);
+        r = SetupThresholdRule(de_ctx, id, gid, parsed_type, parsed_track, parsed_count,
+                parsed_seconds, parsed_timeout, parsed_new_action);
     }
     if (r < 0) {
         goto error;