]> git.ipfire.org Git - thirdparty/suricata.git/commit
suricata: move SuricataMain into main()
authorJason Ish <jason.ish@oisf.net>
Mon, 26 Feb 2024 22:45:07 +0000 (16:45 -0600)
committerVictor Julien <victor@inliniac.net>
Mon, 25 Mar 2024 16:36:29 +0000 (17:36 +0100)
commit2c71c7fe6ae7be1bafb8eac5e8513b90f026f785
tree1643822ee42e07654c3eff576fa42e1aa88472ab
parentc476fcc85b6f13b408f8189ec2ae155103b9cdb3
suricata: move SuricataMain into main()

Move the contents of SuricataMain into the `main()` function found in
main.c. This forces the Suricata application to bootstrap and run
Suricata through the same interfaces as a library user might do.

Required exposing StartInternalRunMode as SCStartInternalRunmode. Its
arguable whether those "actions" belong in the library or just the
application, but I think that is separation we can look at later.

For now the lib example and Suricata's own main are the same, however
the example will probably extend more into programmatically
configuring Suricata or dynamically registering a runmode, which
doesn't really belong the main Suricata application.
examples/lib/simple/main.c
src/main.c
src/suricata.c
src/suricata.h