style: remove latest warnings

about unused variables
pull/6424/head
Philippe Antoine 4 years ago committed by Victor Julien
parent f6ba3699bb
commit cb30772372

@ -51,7 +51,6 @@ impl FileChunk {
#[derive(Debug)] #[derive(Debug)]
#[derive(Default)] #[derive(Default)]
pub struct FileTransferTracker { pub struct FileTransferTracker {
file_size: u64,
pub tracked: u64, pub tracked: u64,
cur_ooo: u64, // how many bytes do we have queued from ooo chunks cur_ooo: u64, // how many bytes do we have queued from ooo chunks
track_id: u32, track_id: u32,

@ -78,13 +78,6 @@ impl State {
} }
} }
#[derive(Debug, Clone)]
struct Mark {
position: usize,
state_index: usize,
state: State,
}
/// A "mark" or saved state for a JsonBuilder object. /// A "mark" or saved state for a JsonBuilder object.
/// ///
/// The name is full, and the types are u64 as this object is used /// The name is full, and the types are u64 as this object is used

@ -1468,9 +1468,10 @@ void EngineAnalysisRules(const DetectEngineCtx *de_ctx,
if (rule_content == 1) { if (rule_content == 1) {
//todo: warning if content is weak, separate warning for pcre + weak content //todo: warning if content is weak, separate warning for pcre + weak content
} }
if (rule_flow == 0 && rule_flags == 0 if (rule_flow == 0 && rule_flags == 0 && !(s->proto.flags & DETECT_PROTO_ANY) &&
&& !(s->proto.flags & DETECT_PROTO_ANY) && DetectProtoContainsProto(&s->proto, IPPROTO_TCP) DetectProtoContainsProto(&s->proto, IPPROTO_TCP) &&
&& (rule_content || rule_content_http || rule_pcre || rule_pcre_http || rule_flowbits || rule_flowint)) { (rule_content || rule_content_http || rule_pcre || rule_pcre_http || rule_flowbits ||
rule_flowint)) {
rule_warning += 1; rule_warning += 1;
warn_tcp_no_flow = 1; warn_tcp_no_flow = 1;
} }
@ -1537,7 +1538,8 @@ void EngineAnalysisRules(const DetectEngineCtx *de_ctx,
if (rule_ipv6_only) fprintf(rule_engine_analysis_FD, " Rule is IPv6 only.\n"); if (rule_ipv6_only) fprintf(rule_engine_analysis_FD, " Rule is IPv6 only.\n");
if (rule_ipv4_only) fprintf(rule_engine_analysis_FD, " Rule is IPv4 only.\n"); if (rule_ipv4_only) fprintf(rule_engine_analysis_FD, " Rule is IPv4 only.\n");
if (packet_buf) fprintf(rule_engine_analysis_FD, " Rule matches on packets.\n"); if (packet_buf) fprintf(rule_engine_analysis_FD, " Rule matches on packets.\n");
if (!rule_flow_nostream && stream_buf && (rule_flow || rule_flowbits || rule_flowint || rule_content || rule_pcre)) { if (!rule_flow_nostream && stream_buf &&
(rule_flow || rule_flowbits || rule_flowint || rule_content || rule_pcre)) {
fprintf(rule_engine_analysis_FD, " Rule matches on reassembled stream.\n"); fprintf(rule_engine_analysis_FD, " Rule matches on reassembled stream.\n");
} }
for(size_t i = 0; i < ARRAY_SIZE(analyzer_items); i++) { for(size_t i = 0; i < ARRAY_SIZE(analyzer_items); i++) {

@ -629,7 +629,6 @@ static json_t *RulesGroupPrintSghStats(const DetectEngineCtx *de_ctx, const SigG
uint32_t payload_no_mpm_cnt = 0; uint32_t payload_no_mpm_cnt = 0;
uint32_t syn_cnt = 0; uint32_t syn_cnt = 0;
uint32_t mpms_total = 0;
uint32_t mpms_min = 0; uint32_t mpms_min = 0;
uint32_t mpms_max = 0; uint32_t mpms_max = 0;
@ -741,7 +740,6 @@ static json_t *RulesGroupPrintSghStats(const DetectEngineCtx *de_ctx, const SigG
} }
uint32_t w = PatternStrength(cd->content, cd->content_len); uint32_t w = PatternStrength(cd->content, cd->content_len);
mpms_total += w;
if (mpms_min == 0) if (mpms_min == 0)
mpms_min = w; mpms_min = w;
if (w < mpms_min) if (w < mpms_min)

@ -807,8 +807,10 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data)
*/ */
memset(&ts, 0, sizeof(ts)); memset(&ts, 0, sizeof(ts));
uint32_t hash_passes = 0; uint32_t hash_passes = 0;
#ifdef FM_PROFILE
uint32_t hash_row_checks = 0; uint32_t hash_row_checks = 0;
uint32_t hash_passes_chunks = 0; uint32_t hash_passes_chunks = 0;
#endif
uint32_t hash_full_passes = 0; uint32_t hash_full_passes = 0;
const uint32_t min_timeout = FlowTimeoutsMin(); const uint32_t min_timeout = FlowTimeoutsMin();
@ -904,9 +906,11 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data)
FlowTimeoutHash(&ftd->timeout, &ts, ftd->min, ftd->max, &counters); FlowTimeoutHash(&ftd->timeout, &ts, ftd->min, ftd->max, &counters);
hash_passes++; hash_passes++;
hash_full_passes++; hash_full_passes++;
hash_passes_chunks += 1;
hash_passes++; hash_passes++;
#ifdef FM_PROFILE
hash_passes_chunks += 1;
hash_row_checks += counters.rows_checked; hash_row_checks += counters.rows_checked;
#endif
StatsIncr(th_v, ftd->cnt.flow_mgr_full_pass); StatsIncr(th_v, ftd->cnt.flow_mgr_full_pass);
} else { } else {
/* non-emergency mode: scan part of the hash */ /* non-emergency mode: scan part of the hash */
@ -922,8 +926,10 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data)
} }
} }
hash_passes++; hash_passes++;
#ifdef FM_PROFILE
hash_row_checks += counters.rows_checked; hash_row_checks += counters.rows_checked;
hash_passes_chunks += chunks; hash_passes_chunks += chunks;
#endif
} }
flow_last_sec = rt; flow_last_sec = rt;

Loading…
Cancel
Save