mirror of
https://github.com/OISF/suricata.git
synced 2026-10-11 22:09:53 +00:00
lib: remove the built-in library run-mode
This run-mode does not allow for capture ThreadVars to be created at the appropriate place in the application life cycle. Instead, applications should register their own custom run-mode. Ticket: #8259
This commit is contained in:
@@ -84,6 +84,15 @@ Other Changes
|
||||
``app-layer.protocols.sip.tcp.enabled`` would be read and preferred over
|
||||
``app-layer.protocols.sip.enabled``.
|
||||
|
||||
Changes for Library Users and Plugin Developers
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- The built-in library run-mode has been removed. If your application
|
||||
is relying on this run-mode, it should implement its own application
|
||||
specific run-mode. See the example, ``examples/lib/custom`` for an
|
||||
example. For more details, see
|
||||
https://redmine.openinfosecfoundation.org/issues/8259.
|
||||
|
||||
Upgrading to 8.0.1
|
||||
------------------
|
||||
|
||||
|
||||
@@ -26,36 +26,6 @@
|
||||
#include "runmodes.h"
|
||||
#include "tm-threads.h"
|
||||
|
||||
/** \brief register runmodes for suricata as a library */
|
||||
void SCRunModeLibIdsRegister(void)
|
||||
{
|
||||
RunModeRegisterNewRunMode(RUNMODE_LIB, "offline", "Library offline mode (pcap replaying)",
|
||||
SCRunModeLibIdsOffline, NULL);
|
||||
RunModeRegisterNewRunMode(RUNMODE_LIB, "live", "Library live mode", SCRunModeLibIdsLive, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
/** \brief runmode for offline packet processing (pcap files) */
|
||||
int SCRunModeLibIdsOffline(void)
|
||||
{
|
||||
TimeModeSetOffline();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** \brief runmode for live packet processing */
|
||||
int SCRunModeLibIdsLive(void)
|
||||
{
|
||||
TimeModeSetLive();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *SCRunModeLibGetDefaultMode(void)
|
||||
{
|
||||
return "live";
|
||||
}
|
||||
|
||||
ThreadVars *SCRunModeLibCreateThreadVars(int worker_id)
|
||||
{
|
||||
char tname[TM_THREAD_NAME_MAX];
|
||||
|
||||
@@ -27,18 +27,6 @@
|
||||
|
||||
#include "threadvars.h"
|
||||
|
||||
/** \brief register runmodes for suricata as a library */
|
||||
void SCRunModeLibIdsRegister(void);
|
||||
|
||||
/** \brief runmode for live packet processing */
|
||||
int SCRunModeLibIdsLive(void);
|
||||
|
||||
/** \brief runmode for offline packet processing (pcap files) */
|
||||
int SCRunModeLibIdsOffline(void);
|
||||
|
||||
/** \brief runmode default mode (live) */
|
||||
const char *SCRunModeLibGetDefaultMode(void);
|
||||
|
||||
/**
|
||||
* \brief Create ThreadVars for use by a user provided thread.
|
||||
*
|
||||
|
||||
@@ -245,7 +245,6 @@ void RunModeRegisterRunModes(void)
|
||||
RunModeUnixSocketRegister();
|
||||
RunModeIpsWinDivertRegister();
|
||||
RunModeDpdkRegister();
|
||||
SCRunModeLibIdsRegister();
|
||||
#ifdef UNITTESTS
|
||||
UtRunModeRegister();
|
||||
#endif
|
||||
@@ -358,9 +357,6 @@ static const char *RunModeGetConfOrDefault(int capture_mode, const char *capture
|
||||
custom_mode = RunModeDpdkGetDefaultMode();
|
||||
break;
|
||||
#endif
|
||||
case RUNMODE_LIB:
|
||||
custom_mode = SCRunModeLibGetDefaultMode();
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user