Squashed commit of the following:
commit
3a742fa01840835d4c7f92caac80e8ded9176d1b
Author: Steven Baigal (sbaigal) <sbaigal@cisco.com>
Date: Tue Jun 15 09:08:33 2021 -0400
control: remove SHELL compile flag from header
set ( CONTROL_INCLUDES control.h )
if ( ENABLE_SHELL )
- set ( SHELL_SOURCES control.cc control_mgmt.cc control_mgmt.h )
+ set ( SHELL_SOURCES control_mgmt.cc control_mgmt.h )
endif ( ENABLE_SHELL )
add_library ( control OBJECT
- control.h
+ control.cc
${SHELL_SOURCES}
)
ControlConn* ControlConn::query_from_lua(const lua_State* L)
{
+#ifdef SHELL
return ControlMgmt::find_control(L);
+#else
+ UNUSED(L);
+ return nullptr;
+#endif
}
//------------------------------------------------------------------------
class ControlConn
{
public:
-#ifdef SHELL
ControlConn(int fd, bool local);
~ControlConn();
std::string next_command;
class Shell *shell;
int fd;
- bool local;
+ bool local = false;
bool blocked = false;
-#else
- SO_PUBLIC bool is_local() const { return false; }
- SO_PUBLIC bool respond(const char*, va_list&) { return false;}
- SO_PUBLIC bool respond(const char*, ...) __attribute__((format (printf, 2, 3))) { return false; }
- SO_PUBLIC static ControlConn* query_from_lua(const lua_State*) { return nullptr; }
-#endif
};
#endif
static HostCacheModule module;
#define LOG_MAX 128
static char logged_message[LOG_MAX+1];
-#ifdef SHELL
+
static ControlConn ctrlcon(1, true);
ControlConn::ControlConn(int, bool) {}
ControlConn::~ControlConn() {}
ControlConn* ControlConn::query_from_lua(const lua_State*) { return &ctrlcon; }
bool ControlConn::respond(const char*, ...) { return true; }
-#endif
+
namespace snort
{
const SnortConfig* SnortConfig::get_conf()
} // end of namespace snort
void snort::main_broadcast_command(snort::AnalyzerCommand*, ControlConn*) {}
-#ifdef SHELL
+
static ControlConn s_ctrlcon(1, true);
ControlConn::ControlConn(int, bool) {}
ControlConn::~ControlConn() {}
ControlConn* ControlConn::query_from_lua(const lua_State*) { return &s_ctrlcon; }
bool ControlConn::respond(const char*, ...) { return true; }
-#endif
+
HostCacheMac* get_host_cache_mac() { return nullptr; }
DataPurgeAC::~DataPurgeAC() = default;