init: move main to a separate file

so as to reuse code from suricata.c with fuzz targets
pull/4550/head
Philippe Antoine 6 years ago committed by Victor Julien
parent bb42be7e08
commit af2a689a99

@ -321,6 +321,7 @@ log-stats.c log-stats.h \
log-tcp-data.c log-tcp-data.h \
log-tlslog.c log-tlslog.h \
log-tlsstore.c log-tlsstore.h \
main.c \
output.c output.h \
output-file.c output-file.h \
output-filedata.c output-filedata.h \

@ -0,0 +1,23 @@
/* Copyright (C) 2020 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
#include "suricata.h"
int main(int argc, char **argv)
{
return SuricataMain(argc, argv);
}

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2014 Open Information Security Foundation
/* Copyright (C) 2007-2020 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
@ -2980,7 +2980,7 @@ int InitGlobal(void) {
return 0;
}
int main(int argc, char **argv)
int SuricataMain(int argc, char **argv)
{
SCInstanceInit(&suricata, argv[0]);

@ -188,6 +188,7 @@ int SuriHasSigFile(void);
extern int run_mode;
int SuricataMain(int argc, char **argv);
int InitGlobal(void);
int PostConfLoadedSetup(SCInstance *suri);

Loading…
Cancel
Save