| 1 | /* |
| 2 | * AIDE (Advanced Intrusion Detection Environment) |
| 3 | * |
| 4 | * Copyright (C) 1999-2002, 2006, 2010, 2019-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 _REPORT_H_INCLUDED |
| 23 | #define _REPORT_H_INCLUDEDcxx . . $ `include/report.h:23:9`! |
| 24 | #include <stdbool.h> |
| 25 | #include <stdio.h> |
| 26 | #include "attributes.h"cxx . . $ `<file>/include/attributes.h`/ |
| 27 | #include "seltree.h"cxx . . $ `<file>/include/seltree.h`/ |
| 28 | #include "config.h"cxx . . $ `<file>/include/config.h`/ |
| 29 | #include "conf_ast.h"cxx . . $ `<file>/include/conf_ast.h`/ |
| 30 | #include "log.h"cxx . . $ `<file>/include/log.h`/ |
| 31 | #include "url.h"cxx . . $ `<file>/include/url.h`/ |
| 32 | #include "db_line.h"cxx . . $ `<file>/include/db_line.h`/ |
| 33 | |
| 34 | /* report level */ |
| 35 | typedef enumcxx . . $ $anonymous_type_cda7d8548f04fc8c_0# { /* preserve order */ |
| 36 | REPORT_LEVEL_UNKNOWNcxx . . $ REPORT_LEVEL_UNKNOWN. = 0, |
| 37 | REPORT_LEVEL_MINIMALcxx . . $ REPORT_LEVEL_MINIMAL. = 1, |
| 38 | REPORT_LEVEL_SUMMARYcxx . . $ REPORT_LEVEL_SUMMARY. = 2, |
| 39 | REPORT_LEVEL_DATABASE_ATTRIBUTEScxx . . $ REPORT_LEVEL_DATABASE_ATTRIBUTES. = 3, |
| 40 | REPORT_LEVEL_LIST_ENTRIEScxx . . $ REPORT_LEVEL_LIST_ENTRIES. = 4, |
| 41 | REPORT_LEVEL_CHANGED_ATTRIBUTEScxx . . $ REPORT_LEVEL_CHANGED_ATTRIBUTES. = 5, |
| 42 | REPORT_LEVEL_ADDED_REMOVED_ATTRIBUTEScxx . . $ REPORT_LEVEL_ADDED_REMOVED_ATTRIBUTES. = 6, |
| 43 | REPORT_LEVEL_ADDED_REMOVED_ENTRIEScxx . . $ REPORT_LEVEL_ADDED_REMOVED_ENTRIES. = 7, |
| 44 | } REPORT_LEVELcxx . . $ REPORT_LEVEL#; |
| 45 | |
| 46 | /* report format */ |
| 47 | typedef enumcxx . . $ $anonymous_type_cda7d8548f04fc8c_1# { |
| 48 | REPORT_FORMAT_UNKNOWNcxx . . $ REPORT_FORMAT_UNKNOWN. = 0, |
| 49 | REPORT_FORMAT_PLAINcxx . . $ REPORT_FORMAT_PLAIN. = 1, |
| 50 | REPORT_FORMAT_JSONcxx . . $ REPORT_FORMAT_JSON. = 2, |
| 51 | } REPORT_FORMATcxx . . $ REPORT_FORMAT#; |
| 52 | |
| 53 | extern const ATTRIBUTEcxx . . $ ATTRIBUTE# report_attrs_ordercxx . . $ report_attrs_order.[]; |
| 54 | extern int report_attrs_order_lengthcxx . . $ report_attrs_order_length.; |
| 55 | |
| 56 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! init_report_urlscxx . . $ init_report_urls(c9857a73d68e59ba).(void); |
| 57 | |
| 58 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! add_report_urlcxx . . $ add_report_url(b6d92bad158dd3b).(url_tcxx . . $ url_t#* url, int, char*, char*); |
| 59 | |
| 60 | REPORT_LEVELcxx . . $ REPORT_LEVEL# get_report_levelcxx . . $ get_report_level(5aff053b5fa218f3).(char *); |
| 61 | REPORT_FORMATcxx . . $ REPORT_FORMAT# get_report_formatcxx . . $ get_report_format(286e75ce408cac52).(char *); |
| 62 | |
| 63 | void log_report_urlscxx . . $ log_report_urls(acc15b7e06406d4e).(LOG_LEVELcxx . . $ LOG_LEVEL#); |
| 64 | |
| 65 | /* |
| 66 | * gen_report() |
| 67 | * Generate report based on the given node |
| 68 | */ |
| 69 | int gen_reportcxx . . $ gen_report(b2b9a89df0a93043).(seltreecxx . . $ seltree#* node); |
| 70 | |
| 71 | typedef struct report_optionscxx . . $ report_options# { |
| 72 | REPORT_LEVELcxx . . $ REPORT_LEVEL# levelcxx . . $ report_options#level.; |
| 73 | REPORT_FORMATcxx . . $ REPORT_FORMAT# formatcxx . . $ report_options#format.; |
| 74 | } report_optionscxx . . $ report_options#; |
| 75 | |
| 76 | extern report_optionscxx . . $ report_options# default_report_optionscxx . . $ default_report_options.; |
| 77 | |
| 78 | typedef struct diff_attrs_entrycxx . . $ diff_attrs_entry# { |
| 79 | char* entrycxx . . $ diff_attrs_entry#entry.; |
| 80 | DB_ATTR_TYPEcxx . . $ `include/attributes.h:25:9`! old_attrscxx . . $ diff_attrs_entry#old_attrs.; |
| 81 | DB_ATTR_TYPEcxx . . $ `include/attributes.h:25:9`! new_attrscxx . . $ diff_attrs_entry#new_attrs.; |
| 82 | } diff_attrs_entrycxx . . $ diff_attrs_entry#; |
| 83 | |
| 84 | typedef struct report_tcxx . . $ report_t# { |
| 85 | url_tcxx . . $ url_t#* urlcxx . . $ report_t#url.; |
| 86 | FILEcxx . . $ FILE#* fdcxx . . $ report_t#fd.; |
| 87 | |
| 88 | REPORT_LEVELcxx . . $ REPORT_LEVEL# levelcxx . . $ report_t#level.; |
| 89 | REPORT_FORMATcxx . . $ REPORT_FORMAT# formatcxx . . $ report_t#format.; |
| 90 | |
| 91 | int detailed_initcxx . . $ report_t#detailed_init.; |
| 92 | int base16cxx . . $ report_t#base16.; |
| 93 | int quietcxx . . $ report_t#quiet.; |
| 94 | int summarize_changescxx . . $ report_t#summarize_changes.; |
| 95 | int groupedcxx . . $ report_t#grouped.; |
| 96 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! appendcxx . . $ report_t#append.; |
| 97 | |
| 98 | #ifdef WITH_E2FSATTRS |
| 99 | long ignore_e2fsattrs; |
| 100 | #endif |
| 101 | |
| 102 | DB_ATTR_TYPEcxx . . $ `include/attributes.h:25:9`! ignore_added_attrscxx . . $ report_t#ignore_added_attrs.; |
| 103 | DB_ATTR_TYPEcxx . . $ `include/attributes.h:25:9`! ignore_removed_attrscxx . . $ report_t#ignore_removed_attrs.; |
| 104 | DB_ATTR_TYPEcxx . . $ `include/attributes.h:25:9`! ignore_changed_attrscxx . . $ report_t#ignore_changed_attrs.; |
| 105 | DB_ATTR_TYPEcxx . . $ `include/attributes.h:25:9`! force_attrscxx . . $ report_t#force_attrs.; |
| 106 | |
| 107 | long ntotalcxx . . $ report_t#ntotal.; |
| 108 | long naddcxx . . $ report_t#nadd., nremcxx . . $ report_t#nrem., nchgcxx . . $ report_t#nchg.; |
| 109 | |
| 110 | diff_attrs_entrycxx . . $ diff_attrs_entry# *diff_attrs_entriescxx . . $ report_t#diff_attrs_entries.; |
| 111 | int num_diff_attrs_entriescxx . . $ report_t#num_diff_attrs_entries.; |
| 112 | |
| 113 | int linenumbercxx . . $ report_t#linenumber.; |
| 114 | char* filenamecxx . . $ report_t#filename.; |
| 115 | char* linebufcxx . . $ report_t#linebuf.; |
| 116 | |
| 117 | } report_tcxx . . $ report_t#; |
| 118 | |
| 119 | void report_printfcxx . . $ report_printf(4e012a91a5600c6).(report_tcxx . . $ report_t#*, const char*, ...) |
| 120 | #ifdef __GNUC__cxx . . $ `<built-in>:8:9`! |
| 121 | __attribute__ ((format (printf, 2, 3))) |
| 122 | #endif |
| 123 | ; |
| 124 | |
| 125 | typedef struct report_format_modulecxx . . $ report_format_module# { |
| 126 | void (*print_report_config_optionscxx . . $ report_format_module#print_report_config_options.)(report_tcxx . . $ report_t#*); |
| 127 | void (*print_report_databasescxx . . $ report_format_module#print_report_databases.)(report_tcxx . . $ report_t#*); |
| 128 | void (*print_report_detailscxx . . $ report_format_module#print_report_details.)(report_tcxx . . $ report_t#*, seltreecxx . . $ seltree#*); |
| 129 | void (*print_report_diff_attrs_entriescxx . . $ report_format_module#print_report_diff_attrs_entries.)(report_tcxx . . $ report_t#*); |
| 130 | void (*print_report_endtime_runtimecxx . . $ report_format_module#print_report_endtime_runtime.)(report_tcxx . . $ report_t#*, const char*, long); |
| 131 | void (*print_report_entriescxx . . $ report_format_module#print_report_entries.)(report_tcxx . . $ report_t#*, seltreecxx . . $ seltree#*, const int); |
| 132 | void (*print_report_footercxx . . $ report_format_module#print_report_footer.)(report_tcxx . . $ report_t#*); |
| 133 | void (*print_report_headercxx . . $ report_format_module#print_report_header.)(report_tcxx . . $ report_t#*); |
| 134 | void (*print_report_new_database_writtencxx . . $ report_format_module#print_report_new_database_written.)(report_tcxx . . $ report_t#*); |
| 135 | void (*print_report_outlinecxx . . $ report_format_module#print_report_outline.)(report_tcxx . . $ report_t#*); |
| 136 | void (*print_report_report_optionscxx . . $ report_format_module#print_report_report_options.)(report_tcxx . . $ report_t#*); |
| 137 | void (*print_report_starttime_versioncxx . . $ report_format_module#print_report_starttime_version.)(report_tcxx . . $ report_t#*, const char*, const char*); |
| 138 | void (*print_report_summarycxx . . $ report_format_module#print_report_summary.)(report_tcxx . . $ report_t#*); |
| 139 | } report_format_modulecxx . . $ report_format_module#; |
| 140 | |
| 141 | char* get_file_type_stringcxx . . $ get_file_type_string(f109d7e0a0ca42b3).(mode_tcxx . . $ mode_t#); |
| 142 | char* get_summarize_changes_stringcxx . . $ get_summarize_changes_string(995b9c65a0e968c6).(report_tcxx . . $ report_t#*, seltreecxx . . $ seltree#*); |
| 143 | char* get_summary_stringcxx . . $ get_summary_string(ec346f625076085b).(report_tcxx . . $ report_t#*); |
| 144 | const char* get_report_level_stringcxx . . $ get_report_level_string(75b820ae76c41009).(REPORT_LEVELcxx . . $ REPORT_LEVEL#); |
| 145 | int get_attribute_valuescxx . . $ get_attribute_values(daa3275b1ddcb9d1).(DB_ATTR_TYPEcxx . . $ `include/attributes.h:25:9`!, db_linecxx . . $ db_line#*,char* **, report_tcxx . . $ report_t#*); |
| 146 | void print_databases_attrscxx . . $ print_databases_attrs(e6fbbe7f0ff0be64).(report_tcxx . . $ report_t# *, void (*)(report_tcxx . . $ report_t# *, db_linecxx . . $ db_line#*)); |
| 147 | void print_dbline_attrscxx . . $ print_dbline_attrs(74750e9842f268de).(report_tcxx . . $ report_t# *, db_linecxx . . $ db_line#*, db_linecxx . . $ db_line#*, DB_ATTR_TYPEcxx . . $ `include/attributes.h:25:9`!, void (*)(report_tcxx . . $ report_t# *, db_linecxx . . $ db_line#*, db_linecxx . . $ db_line#*, ATTRIBUTEcxx . . $ ATTRIBUTE#)); |
| 148 | void print_report_config_optionscxx . . $ print_report_config_options(8fd66a0c554c67cb).(report_tcxx . . $ report_t# *, void (*)(report_tcxx . . $ report_t# *, config_optioncxx . . $ config_option#, const char*)); |
| 149 | void print_report_detailscxx . . $ print_report_details(c1b9a86155df1be7).(report_tcxx . . $ report_t# *, seltreecxx . . $ seltree#*, void (*)(report_tcxx . . $ report_t# *, db_linecxx . . $ db_line#*, db_linecxx . . $ db_line#*, DB_ATTR_TYPEcxx . . $ `include/attributes.h:25:9`!)); |
| 150 | void print_report_entriescxx . . $ print_report_entries(f8d8678ee3db360e).(report_tcxx . . $ report_t#*, seltreecxx . . $ seltree#*, const int, void (*)(report_tcxx . . $ report_t#*, char*, int, seltreecxx . . $ seltree#*)); |
| 151 | void print_report_report_optionscxx . . $ print_report_report_options(8fd66a0c554c67cb).(report_tcxx . . $ report_t# *, void (*)(report_tcxx . . $ report_t# *, config_optioncxx . . $ config_option#, const char*)); |
| 152 | |
| 153 | #endif |