suricata
runmode-lib.h
Go to the documentation of this file.
1/* Copyright (C) 2023-2024 Open Information Security Foundation
2 *
3 * You can copy, redistribute or modify this Program under the terms of
4 * the GNU General Public License version 2 as published by the Free
5 * Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * version 2 along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 */
17
18/** \file
19 *
20 * \author Angelo Mirabella <angelo.mirabella@broadcom.com>
21 *
22 * Library runmode.
23 */
24
25#ifndef SURICATA_RUNMODE_LIB_H
26#define SURICATA_RUNMODE_LIB_H
27
28#include "threadvars.h"
29
30/** \brief register runmodes for suricata as a library */
32
33/** \brief runmode for live packet processing */
34int SCRunModeLibIdsLive(void);
35
36/** \brief runmode for offline packet processing (pcap files) */
38
39/** \brief runmode default mode (live) */
40const char *SCRunModeLibGetDefaultMode(void);
41
42/**
43 * \brief Create ThreadVars for use by a user provided thread.
44 *
45 * Unlike other runmodes, this does not spawn a thread, as the threads
46 * are controlled by the application using Suricata as a library.
47 *
48 * \param worker_id an ID to give this ThreadVars instance
49 *
50 * \return Pointer to allocated ThreadVars or NULL on failure
51 */
53
54/** \brief start the "fake" worker.
55 *
56 * This method performs all the initialization tasks.
57 */
58int SCRunModeLibSpawnWorker(void *);
59
60#endif /* SURICATA_RUNMODE_LIB_H */
int SCRunModeLibIdsLive(void)
runmode for live packet processing
Definition runmode-lib.c:47
int SCRunModeLibIdsOffline(void)
runmode for offline packet processing (pcap files)
Definition runmode-lib.c:39
ThreadVars * SCRunModeLibCreateThreadVars(int worker_id)
Create ThreadVars for use by a user provided thread.
Definition runmode-lib.c:59
void SCRunModeLibIdsRegister(void)
register runmodes for suricata as a library
Definition runmode-lib.c:30
const char * SCRunModeLibGetDefaultMode(void)
runmode default mode (live)
Definition runmode-lib.c:54
int SCRunModeLibSpawnWorker(void *)
start the "fake" worker.
Definition runmode-lib.c:95
Per thread variable structure.
Definition threadvars.h:58