From ce08a43bdaf5fc5ea81e76d6c5cd30b459bdaba7 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 25 Jan 2018 10:32:13 +0100 Subject: [PATCH] file: use enum for state Makes debugging easier. --- src/util-file.h | 2 +- src/util-lua-common.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/util-file.h b/src/util-file.h index 9b578bc1f5..8de0369937 100644 --- a/src/util-file.h +++ b/src/util-file.h @@ -64,7 +64,7 @@ typedef enum FileState_ { typedef struct File_ { uint16_t flags; uint16_t name_len; - int16_t state; + FileState state; StreamingBuffer *sb; uint64_t txid; /**< tx this file is part of */ uint32_t file_track_id; /**< id used by protocol parser. Optional diff --git a/src/util-lua-common.c b/src/util-lua-common.c index 2b605aa236..06a43f6863 100644 --- a/src/util-lua-common.c +++ b/src/util-lua-common.c @@ -803,6 +803,14 @@ static int LuaCallbackFileStatePushToStackFromFile(lua_State *luastate, const Fi case FILE_STATE_ERROR: state = "ERROR"; break; + case FILE_STATE_OPENED: + state = "OPENED"; + break; + case FILE_STATE_NONE: + state = "NONE"; + break; + case FILE_STATE_MAX: + break; } lua_pushstring (luastate, state); -- 2.47.2