aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-03-12 14:44:49 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-03-12 14:44:49 +0000
commit2f1cf619fc28ed3582cf641201aee3c0dc8c6c84 (patch)
tree6d4605c28a11f8f0cc71a14e7426c1eb32efb554 /src/lua/lua_common.h
parenteecfe4ea3aca90f90f3db562b5a8b38c310ec816 (diff)
downloadrspamd-2f1cf619fc28ed3582cf641201aee3c0dc8c6c84.tar.gz
rspamd-2f1cf619fc28ed3582cf641201aee3c0dc8c6c84.zip
[Feature] Print map id when using it in lua logger
Diffstat (limited to 'src/lua/lua_common.h')
-rw-r--r--src/lua/lua_common.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h
index ed284ff5b..69e02142b 100644
--- a/src/lua/lua_common.h
+++ b/src/lua/lua_common.h
@@ -82,6 +82,28 @@ struct rspamd_lua_regexp {
gint re_flags;
};
+struct rspamd_map;
+struct lua_map_callback_data;
+struct radix_tree_compressed;
+
+enum rspamd_lua_map_type {
+ RSPAMD_LUA_MAP_RADIX = 0,
+ RSPAMD_LUA_MAP_SET,
+ RSPAMD_LUA_MAP_HASH,
+ RSPAMD_LUA_MAP_CALLBACK
+};
+
+struct rspamd_lua_map {
+ struct rspamd_map *map;
+ enum rspamd_lua_map_type type;
+
+ union {
+ struct radix_tree_compressed *radix;
+ GHashTable *hash;
+ struct lua_map_callback_data *cbdata;
+ } data;
+};
+
/* Common utility functions */
/**
@@ -176,6 +198,8 @@ gint rspamd_lua_push_header (lua_State * L,
*/
struct rspamd_task *lua_check_task (lua_State * L, gint pos);
+struct rspamd_lua_map *lua_check_map (lua_State * L, gint pos);
+
/**
* Push ip address from a string (nil is pushed if a string cannot be converted)
*/