forked from OISF/suricata
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 OISF#5816 (cherry picked from commit c2c8cdb)
- Loading branch information
1 parent
bdbe712
commit cf6df33
Showing
4 changed files
with
68 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters