| 1 | /* |
| 2 | * AIDE (Advanced Intrusion Detection Environment) |
| 3 | * |
| 4 | * Copyright (C) 1999-2002, 2006, 2016, 2020-2025 Rami Lehti, Pablo Virolainen, |
| 5 | * Richard van den Berg, Hannes von Haugwitz |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License as |
| 9 | * published by the Free Software Foundation; either version 2 of the |
| 10 | * License, or (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along |
| 18 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | */ |
| 21 | |
| 22 | #ifndef _RX_RULE_H_INCLUDED |
| 23 | #define _RX_RULE_H_INCLUDEDcxx . . $ `include/rx_rule.h:23:10`! |
| 24 | |
| 25 | #include "config.h"cxx . . $ `<file>/include/config.h`/ |
| 26 | #include "file.h"cxx . . $ `<file>/include/file.h`/ |
| 27 | #include <sys/stat.h> |
| 28 | #define PCRE2_CODE_UNIT_WIDTHcxx . . $ `include/rx_rule.h:28:9`! 8 |
| 29 | #include <pcre2.h> |
| 30 | #include "attributes.h"cxx . . $ `<file>/include/attributes.h`/ |
| 31 | |
| 32 | typedef struct rx_restriction_tcxx . . $ rx_restriction_t# { |
| 33 | FT_TYPEcxx . . $ `include/file.h:28:9`! f_typecxx . . $ rx_restriction_t#f_type.; |
| 34 | #ifdef HAVE_FSTYPEcxx . . $ `./include/config.h:53:9`! |
| 35 | FS_TYPEcxx . . $ `include/file.h:49:9`! fs_typecxx . . $ rx_restriction_t#fs_type.; |
| 36 | #endif |
| 37 | } rx_restriction_tcxx . . $ rx_restriction_t#; |
| 38 | |
| 39 | typedef enumcxx . . $ $anonymous_type_8427ebbcdf7f3926_0# { |
| 40 | AIDE_RECURSIVE_NEGATIVE_RULEcxx . . $ AIDE_RECURSIVE_NEGATIVE_RULE.=0, |
| 41 | AIDE_NON_RECURSIVE_NEGATIVE_RULEcxx . . $ AIDE_NON_RECURSIVE_NEGATIVE_RULE.=1, |
| 42 | AIDE_SELECTIVE_RULEcxx . . $ AIDE_SELECTIVE_RULE.=2, |
| 43 | AIDE_EQUAL_RULEcxx . . $ AIDE_EQUAL_RULE.=3, |
| 44 | } AIDE_RULE_TYPEcxx . . $ AIDE_RULE_TYPE#; |
| 45 | |
| 46 | typedef struct rx_rulecxx . . $ rx_rule# { |
| 47 | char* rxcxx . . $ rx_rule#rx.; /* Regular expression in text form */ |
| 48 | pcre2_codecxx . . $ pcre2_code_8#* crxcxx . . $ rx_rule#crx.; /* Compiled regexp */ |
| 49 | pcre2_match_datacxx . . $ pcre2_match_data_8# *mdcxx . . $ rx_rule#md.; |
| 50 | AIDE_RULE_TYPEcxx . . $ AIDE_RULE_TYPE# typecxx . . $ rx_rule#type.; |
| 51 | DB_ATTR_TYPEcxx . . $ `include/attributes.h:25:9`! attrcxx . . $ rx_rule#attr.; /* Which attributes to save */ |
| 52 | char *config_filenamecxx . . $ rx_rule#config_filename.; |
| 53 | int config_linenumbercxx . . $ rx_rule#config_linenumber.; |
| 54 | char *config_linecxx . . $ rx_rule#config_line.; |
| 55 | char *prefixcxx . . $ rx_rule#prefix.; |
| 56 | rx_restriction_tcxx . . $ rx_restriction_t# restrictioncxx . . $ rx_rule#restriction.; |
| 57 | } rx_rulecxx . . $ rx_rule#; |
| 58 | |
| 59 | typedef enum match_resultcxx . . $ match_result# { |
| 60 | RESULT_NO_RULE_MATCHcxx . . $ RESULT_NO_RULE_MATCH. = 0, |
| 61 | RESULT_RECURSIVE_NEGATIVE_MATCHcxx . . $ RESULT_RECURSIVE_NEGATIVE_MATCH. = (1<<0), |
| 62 | RESULT_NON_RECURSIVE_NEGATIVE_MATCHcxx . . $ RESULT_NON_RECURSIVE_NEGATIVE_MATCH. = (1<<1), |
| 63 | RESULT_SELECTIVE_MATCHcxx . . $ RESULT_SELECTIVE_MATCH. = (1<<2), |
| 64 | RESULT_EQUAL_MATCHcxx . . $ RESULT_EQUAL_MATCH. = (1<<3), |
| 65 | RESULT_PARTIAL_MATCHcxx . . $ RESULT_PARTIAL_MATCH. = (1<<4), |
| 66 | RESULT_NO_LIMIT_MATCHcxx . . $ RESULT_NO_LIMIT_MATCH. = (1<<5), |
| 67 | RESULT_PARTIAL_LIMIT_MATCHcxx . . $ RESULT_PARTIAL_LIMIT_MATCH. = (1<<6), |
| 68 | RESULT_PART_LIMIT_AND_NO_RECURSE_MATCHcxx . . $ RESULT_PART_LIMIT_AND_NO_RECURSE_MATCH. = (1<<7), |
| 69 | RESULT_NEGATIVE_PARENT_MATCHcxx . . $ RESULT_NEGATIVE_PARENT_MATCH. = (1<<8), |
| 70 | } match_resultcxx . . $ match_result#; |
| 71 | |
| 72 | typedef struct match_tcxx . . $ match_t# { |
| 73 | match_resultcxx . . $ match_result# resultcxx . . $ match_t#result.; |
| 74 | rx_rulecxx . . $ rx_rule#* rulecxx . . $ match_t#rule.; |
| 75 | int lengthcxx . . $ match_t#length.; |
| 76 | } match_tcxx . . $ match_t#; |
| 77 | |
| 78 | char* get_rule_type_long_stringcxx . . $ get_rule_type_long_string(10604bca7de90ad2).(AIDE_RULE_TYPEcxx . . $ AIDE_RULE_TYPE#); |
| 79 | char* get_rule_type_charcxx . . $ get_rule_type_char(10604bca7de90ad2).(AIDE_RULE_TYPEcxx . . $ AIDE_RULE_TYPE#); |
| 80 | |
| 81 | /* memory for the returned string is obtained with malloc(3), and should be freed with free(3). */ |
| 82 | char *get_restriction_stringcxx . . $ get_restriction_string(7c1dd464d1a8aef8).(rx_restriction_tcxx . . $ rx_restriction_t#); |
| 83 | |
| 84 | char *get_match_result_stringcxx . . $ get_match_result_string(20a00c1e59edb1b6).(match_resultcxx . . $ match_result#); |
| 85 | char *get_match_result_desccxx . . $ get_match_result_desc(20a00c1e59edb1b6).(match_resultcxx . . $ match_result#); |
| 86 | #endif /* RX_RULE_H_INCLUDED */ |