From edbba842e8f13941ec71af76dc9ec5e286a75339 Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Fri, 9 May 2025 11:02:30 +0530 Subject: [PATCH] src: apply clang formatting changes --- src/decode.h | 2 +- src/detect-engine-build.c | 3 ++- src/detect-engine-mpm.c | 24 ++++++++---------------- src/detect-engine-siggroup.c | 2 +- src/detect.c | 7 ++++--- 5 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/decode.h b/src/decode.h index 0387395504..a283eaa2e6 100644 --- a/src/decode.h +++ b/src/decode.h @@ -241,7 +241,7 @@ typedef uint16_t Port; /* structure to store the sids/gids/etc the detection engine * found in this packet */ typedef struct PacketAlert_ { - SigIntId iid; /* Internal ID, used for sorting */ + SigIntId iid; /* Internal ID, used for sorting */ uint8_t action; /* Internal num, used for thresholding */ uint8_t flags; const struct Signature_ *s; diff --git a/src/detect-engine-build.c b/src/detect-engine-build.c index 342167786e..3915aff01f 100644 --- a/src/detect-engine-build.c +++ b/src/detect-engine-build.c @@ -1750,7 +1750,8 @@ int SigPrepareStage1(DetectEngineCtx *de_ctx) for (Signature *s = de_ctx->sig_list; s != NULL; s = s->next) { de_ctx->sig_array[s->iid] = s; - SCLogDebug("Signature %" PRIu32 ", internal id %" PRIu32 ", ptrs %p %p ", s->id, s->iid, s, de_ctx->sig_array[s->iid]); + SCLogDebug("Signature %" PRIu32 ", internal id %" PRIu32 ", ptrs %p %p ", s->id, s->iid, s, + de_ctx->sig_array[s->iid]); if (s->type == SIG_TYPE_PDONLY) { SCLogDebug("Signature %"PRIu32" is considered \"PD only\"", s->id); diff --git a/src/detect-engine-mpm.c b/src/detect-engine-mpm.c index 9da22f41bf..3ac3896a91 100644 --- a/src/detect-engine-mpm.c +++ b/src/detect-engine-mpm.c @@ -976,27 +976,19 @@ static void PopulateMpmHelperAddPattern(MpmCtx *mpm_ctx, const DetectContentData if (cd->flags & DETECT_CONTENT_NOCASE) { if (chop) { - MpmAddPatternCI(mpm_ctx, - cd->content + cd->fp_chop_offset, cd->fp_chop_len, - pat_offset, pat_depth, - cd->id, s->iid, flags|MPM_PATTERN_CTX_OWNS_ID); + MpmAddPatternCI(mpm_ctx, cd->content + cd->fp_chop_offset, cd->fp_chop_len, pat_offset, + pat_depth, cd->id, s->iid, flags | MPM_PATTERN_CTX_OWNS_ID); } else { - MpmAddPatternCI(mpm_ctx, - cd->content, cd->content_len, - pat_offset, pat_depth, - cd->id, s->iid, flags|MPM_PATTERN_CTX_OWNS_ID); + MpmAddPatternCI(mpm_ctx, cd->content, cd->content_len, pat_offset, pat_depth, cd->id, + s->iid, flags | MPM_PATTERN_CTX_OWNS_ID); } } else { if (chop) { - MpmAddPatternCS(mpm_ctx, - cd->content + cd->fp_chop_offset, cd->fp_chop_len, - pat_offset, pat_depth, - cd->id, s->iid, flags|MPM_PATTERN_CTX_OWNS_ID); + MpmAddPatternCS(mpm_ctx, cd->content + cd->fp_chop_offset, cd->fp_chop_len, pat_offset, + pat_depth, cd->id, s->iid, flags | MPM_PATTERN_CTX_OWNS_ID); } else { - MpmAddPatternCS(mpm_ctx, - cd->content, cd->content_len, - pat_offset, pat_depth, - cd->id, s->iid, flags|MPM_PATTERN_CTX_OWNS_ID); + MpmAddPatternCS(mpm_ctx, cd->content, cd->content_len, pat_offset, pat_depth, cd->id, + s->iid, flags | MPM_PATTERN_CTX_OWNS_ID); } } } diff --git a/src/detect-engine-siggroup.c b/src/detect-engine-siggroup.c index 2fbf257f46..2163010e58 100644 --- a/src/detect-engine-siggroup.c +++ b/src/detect-engine-siggroup.c @@ -514,7 +514,7 @@ void SigGroupHeadPrintSigs(DetectEngineCtx *de_ctx, SigGroupHead *sgh) for (u = 0; u < (sgh->init->sig_size * 8); u++) { if (sgh->init->sig_array[u / 8] & (1 << (u % 8))) { SCLogDebug("%" PRIu32, u); - printf("s->iid %"PRIu32" ", u); + printf("s->iid %" PRIu32 " ", u); } } diff --git a/src/detect.c b/src/detect.c index 02d649c624..8f39e8ff30 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1863,8 +1863,8 @@ static void DetectRunTx(ThreadVars *tv, /* threat detect rules will be inspected */ } - SCLogDebug("%p/%"PRIu64" inspecting: sid %u (%u), flags %08x", - tx.tx_ptr, tx.tx_id, s->id, s->iid, inspect_flags ? *inspect_flags : 0); + SCLogDebug("%p/%" PRIu64 " inspecting: sid %u (%u), flags %08x", tx.tx_ptr, tx.tx_id, + s->id, s->iid, inspect_flags ? *inspect_flags : 0); if (inspect_flags) { if (*inspect_flags & DE_STATE_FLAG_FULL_INSPECT) { @@ -1933,7 +1933,8 @@ static void DetectRunTx(ThreadVars *tv, alert_flags |= PACKET_ALERT_FLAG_APPLY_ACTION_TO_PACKET; } - SCLogDebug("%p/%"PRIu64" sig %u (%u) matched", tx.tx_ptr, tx.tx_id, s->id, s->iid); + SCLogDebug( + "%p/%" PRIu64 " sig %u (%u) matched", tx.tx_ptr, tx.tx_id, s->id, s->iid); AlertQueueAppend(det_ctx, s, p, tx.tx_id, alert_flags); if ((s->flags & SIG_FLAG_FIREWALL) && (s->action & ACTION_ACCEPT)) { -- 2.47.2