| 1 | /* |
| 2 | * AIDE (Advanced Intrusion Detection Environment) |
| 3 | * |
| 4 | * Copyright (C) 1999-2002, 2004-2005, 2013, 2016, 2020, 2022-2025 Rami Lehti, |
| 5 | * Pablo Virolainen, 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 _DB_H_INCLUDED |
| 23 | #define _DB_H_INCLUDEDcxx . . $ `include/db.h:23:9`! |
| 24 | |
| 25 | #include <stdbool.h> |
| 26 | #include <stdio.h> |
| 27 | #include "db_config.h"cxx . . $ `<file>/include/db_config.h`/ |
| 28 | #include "util.h"cxx . . $ `<file>/include/util.h`/ |
| 29 | |
| 30 | typedef enumcxx . . $ $anonymous_type_392304a1032d2441_0# { |
| 31 | DB_TYPE_INcxx . . $ DB_TYPE_IN., |
| 32 | DB_TYPE_OUTcxx . . $ DB_TYPE_OUT., |
| 33 | DB_TYPE_NEWcxx . . $ DB_TYPE_NEW., |
| 34 | } DB_TYPEcxx . . $ DB_TYPE#; |
| 35 | |
| 36 | typedef structcxx . . $ $anonymous_type_392304a1032d2441_1# { |
| 37 | db_linecxx . . $ db_line#* linecxx . . $ $anonymous_type_392304a1032d2441_1#line.; |
| 38 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! limitcxx . . $ $anonymous_type_392304a1032d2441_1#limit.; |
| 39 | } db_entry_tcxx . . $ db_entry_t#; |
| 40 | |
| 41 | bytecxx . . $ byte#* base64tobytecxx . . $ base64tobyte(3ddd0ff516b096d7).(char*, int, size_t *); |
| 42 | |
| 43 | db_linecxx . . $ db_line#* db_char2linecxx . . $ db_char2line(237a20c9d441aa86).(char**, databasecxx . . $ database#*); |
| 44 | |
| 45 | int db_initcxx . . $ db_init(d8a340524e05b6c1).(databasecxx . . $ database#*, boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`!, boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`!); |
| 46 | |
| 47 | db_entry_tcxx . . $ db_entry_t# db_readlinecxx . . $ db_readline(9768d9fab7f01dc3).(databasecxx . . $ database#*, boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`!); |
| 48 | |
| 49 | int db_writespeccxx . . $ db_writespec(d87c77e6d45fe0c5).(db_configcxx . . $ db_config#*); |
| 50 | |
| 51 | int db_writelinecxx . . $ db_writeline(bb1b3cc1d92abff8).(db_linecxx . . $ db_line#*,db_configcxx . . $ db_config#*); |
| 52 | |
| 53 | void db_closecxx . . $ db_close(49f6e7a06ebc5aa8).(void); |
| 54 | |
| 55 | void free_db_linecxx . . $ free_db_line(5dc4328f64ce0e3d).(db_linecxx . . $ db_line#* dl); |
| 56 | |
| 57 | #define DB_OLDcxx . . $ `include/db.h:57:9`! (1<<0) |
| 58 | #define DB_DISKcxx . . $ `include/db.h:58:9`! (1<<1) |
| 59 | #define DB_NEWcxx . . $ `include/db.h:59:9`! (1<<2) |
| 60 | #define NODE_ADDEDcxx . . $ `include/db.h:60:9`! (1<<4) |
| 61 | #define NODE_REMOVEDcxx . . $ `include/db.h:61:9`! (1<<5) |
| 62 | #define NODE_CHANGEDcxx . . $ `include/db.h:62:9`! (1<<6) |
| 63 | #define NODE_FREEcxx . . $ `include/db.h:63:9`! (1<<7) |
| 64 | |
| 65 | #define NODE_MOVED_OUTcxx . . $ `include/db.h:65:9`! (1<<11) |
| 66 | #define NODE_MOVED_INcxx . . $ `include/db.h:66:9`! (1<<12) |
| 67 | #define NODE_ALLOW_NEWcxx . . $ `include/db.h:67:9`! (1<<13) |
| 68 | #define NODE_ALLOW_RMcxx . . $ `include/db.h:68:9`! (1<<14) |
| 69 | #define NODE_CHECK_INODEcxx . . $ `include/db.h:69:9`! (1<<15) |
| 70 | #define NODE_HAS_SUB_RULEScxx . . $ `include/db.h:70:9`! (1<<16) |
| 71 | |
| 72 | #define LOG_DB_FORMAT_LINEcxx . . $ `include/db.h:72:9`!(log_level, format, ...) \ |
| 73 | log_msg(log_level, "%s:%li: " format , (db->url)->raw, db->lineno, __VA_ARGS__); |
| 74 | |
| 75 | #endif |