]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
init: move main to a separate file
authorPhilippe Antoine <contact@catenacyber.fr>
Wed, 22 Jan 2020 08:33:05 +0000 (09:33 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 14 Feb 2020 10:19:01 +0000 (11:19 +0100)
so as to reuse code from suricata.c with fuzz targets

src/Makefile.am
src/main.c [new file with mode: 0644]
src/suricata.c
src/suricata.h

index e755556b4d08fffb23ce65a3273677d956d456ed..f1ed9147529f91f68ae99893ba959215483b8b20 100755 (executable)
@@ -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 \
diff --git a/src/main.c b/src/main.c
new file mode 100644 (file)
index 0000000..05c9276
--- /dev/null
@@ -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);
+}
index fc43fe7809f95bfe8b1b4a8557a1146a2cd5cfdc..8489c1cea300d84da304c60508530ee7f9a4c10e 100644 (file)
@@ -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]);
 
index f61d6c89ad9e4c7ec3a984f06f821e7fd3eeda84..1b4111610b5de42be816ed6afeff60341224786e 100644 (file)
@@ -188,6 +188,7 @@ int SuriHasSigFile(void);
 
 extern int run_mode;
 
+int SuricataMain(int argc, char **argv);
 int InitGlobal(void);
 int PostConfLoadedSetup(SCInstance *suri);