src: apply clang formatting changes

pull/13207/head
Shivani Bhardwaj 12 months ago committed by Victor Julien
parent 623229728d
commit edbba842e8

@ -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;

@ -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);

@ -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);
}
}
}

@ -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);
}
}

@ -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)) {

Loading…
Cancel
Save