mirror of https://github.com/OISF/suricata
exceptions: make types and ToStr fns more accessible
Decode file needed ExceptionPolicy types and exception-policy file needed Decode types, rendering some works quite difficult to work around. ExceptionPolicyToStr is useful for registering exception policy counters, so make that public. Part of Task #5816pull/10805/head
parent
ce001d8eae
commit
c2c8cdb78a
@ -0,0 +1,54 @@
|
||||
/* Copyright (C) 2024 Open Information Security Foundation
|
||||
*
|
||||
* You can copy, redistribute or modify this Program under the terms of
|
||||
* the GNU General Public License version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* version 2 along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*/
|
||||
|
||||
#ifndef UTIL_EXCEPTION_POLICY_TYPES_H
|
||||
#define UTIL_EXCEPTION_POLICY_TYPES_H
|
||||
|
||||
enum ExceptionPolicy {
|
||||
EXCEPTION_POLICY_NOT_SET = 0,
|
||||
EXCEPTION_POLICY_AUTO,
|
||||
EXCEPTION_POLICY_PASS_PACKET,
|
||||
EXCEPTION_POLICY_PASS_FLOW,
|
||||
EXCEPTION_POLICY_BYPASS_FLOW,
|
||||
EXCEPTION_POLICY_DROP_PACKET,
|
||||
EXCEPTION_POLICY_DROP_FLOW,
|
||||
EXCEPTION_POLICY_REJECT,
|
||||
};
|
||||
|
||||
#define EXCEPTION_POLICY_MAX EXCEPTION_POLICY_REJECT + 1
|
||||
|
||||
/* Max length = possible exception policy scenarios + counter names
|
||||
* + exception policy type. E.g.:
|
||||
* "tcp.reassembly_exception_policy.drop_packet" + 1 */
|
||||
#define EXCEPTION_POLICY_COUNTER_MAX_LEN 44
|
||||
|
||||
typedef struct ExceptionPolicyCounters_ {
|
||||
/* Follows enum order */
|
||||
uint16_t eps_id[EXCEPTION_POLICY_MAX];
|
||||
} ExceptionPolicyCounters;
|
||||
|
||||
typedef struct ExceptionPolicyStatsSetts_ {
|
||||
char eps_name[EXCEPTION_POLICY_MAX][EXCEPTION_POLICY_COUNTER_MAX_LEN];
|
||||
bool valid_settings_ids[EXCEPTION_POLICY_MAX];
|
||||
bool valid_settings_ips[EXCEPTION_POLICY_MAX];
|
||||
} ExceptionPolicyStatsSetts;
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue