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:
Jason Ish
2026-03-05 21:21:09 +00:00
committed by Victor Julien
parent 7dd23392cc
commit 8c7172e707
4 changed files with 9 additions and 46 deletions
+9
View File
@@ -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
------------------
-30
View File
@@ -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];
-12
View File
@@ -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.
*
-4
View File
@@ -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;
}