suricata
util-exception-policy.h
Go to the documentation of this file.
1/* Copyright (C) 2022-2025 Open Information Security Foundation
2 *
3 * You can copy, redistribute or modify this Program under the terms of
4 * the GNU General Public License version 2 as published by the Free
5 * Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * version 2 along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 */
17
18/**
19 * \file
20 */
21
22#ifndef SURICATA_UTIL_EXCEPTION_POLICY_H
23#define SURICATA_UTIL_EXCEPTION_POLICY_H
24
25#include "decode.h"
27
28const char *ExceptionPolicyEnumToString(enum ExceptionPolicy policy, bool is_json);
29const char *ExceptionPolicyTargetFlagToString(uint8_t target_flag);
30enum ExceptionPolicy ExceptionPolicyTargetPolicy(uint8_t target_flag);
33 Packet *p, enum ExceptionPolicy policy, enum PacketDropReason drop_reason);
34enum ExceptionPolicy ExceptionPolicyParse(const char *option, const bool support_flow);
35enum ExceptionPolicy ExceptionPolicyMidstreamParse(bool midstream_enabled);
37 ExceptionPolicyStatsSetts *setting, enum ExceptionPolicy conf_policy,
38 const char *default_str, bool (*isExceptionPolicyValid)(enum ExceptionPolicy));
39
41#ifdef DEBUG
42extern uint64_t g_eps_applayer_error_offset_ts;
43extern uint64_t g_eps_applayer_error_offset_tc;
44extern uint64_t g_eps_pcap_packet_loss;
45extern uint64_t g_eps_stream_ssn_memcap;
46extern uint64_t g_eps_stream_reassembly_memcap;
47extern uint64_t g_eps_flow_memcap;
48extern uint64_t g_eps_defrag_memcap;
49extern bool g_eps_is_alert_queue_fail_mode;
50#endif
51
52int ExceptionSimulationCommandLineParser(const char *name, const char *arg);
53
54#endif
PacketDropReason
Definition decode.h:380
ThreadVars * tv
Per thread variable structure.
Definition threadvars.h:58
const char * name
const char * ExceptionPolicyTargetFlagToString(uint8_t target_flag)
enum ExceptionPolicy ExceptionPolicyTargetPolicy(uint8_t target_flag)
const char * ExceptionPolicyEnumToString(enum ExceptionPolicy policy, bool is_json)
enum ExceptionPolicy ExceptionPolicyMidstreamParse(bool midstream_enabled)
int ExceptionSimulationCommandLineParser(const char *name, const char *arg)
enum ExceptionPolicy g_eps_master_switch
void ExceptionPolicySetStatsCounters(ThreadVars *tv, ExceptionPolicyCounters *counter, ExceptionPolicyStatsSetts *setting, enum ExceptionPolicy conf_policy, const char *default_str, bool(*isExceptionPolicyValid)(enum ExceptionPolicy))
void ExceptionPolicyApply(Packet *p, enum ExceptionPolicy policy, enum PacketDropReason drop_reason)
enum ExceptionPolicy ExceptionPolicyParse(const char *option, const bool support_flow)
void SetMasterExceptionPolicy(void)