suricata
app-layer-template-rust.c
Go to the documentation of this file.
1 /* Copyright (C) 2018 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 /*
19  * TODO: Update \author in this file and app-layer-templaterust.h.
20  * TODO: Implement your app-layer logic with unit tests.
21  * TODO: Remove SCLogNotice statements or convert to debug.
22  */
23 
24 /**
25  * \file
26  *
27  * \author FirstName LastName <yourname@domain>
28  *
29  * TemplateRust application layer detector and parser for learning and
30  * templaterust pruposes.
31  *
32  * This templaterust implements a simple application layer for something
33  * like the echo protocol running on port 7.
34  */
35 
36 #include "suricata-common.h"
37 #include "stream.h"
38 #include "conf.h"
39 
40 #include "util-unittest.h"
41 
42 #include "app-layer-detect-proto.h"
43 #include "app-layer-parser.h"
44 
46 
47 #ifdef HAVE_RUST
48 #include "rust-applayertemplate-template-gen.h"
49 #endif
50 
52 {
53 #ifdef HAVE_RUST
54  /* TEMPLATE_START_REMOVE */
55  /* Only register if enabled in config. */
56  if (ConfGetNode("app-layer.protocols.template-rust") == NULL) {
57  return;
58  }
59  /* TEMPLATE_END_REMOVE */
60  SCLogNotice("Registring Rust template parser.");
61  rs_template_register_parser();
62 #endif
63 #ifdef UNITTESTS
66 #endif
67 }
68 
69 #ifdef UNITTESTS
70 #endif
71 
73 {
74 #ifdef UNITTESTS
75 #endif
76 }
void TemplateRustParserRegisterTests(void)
#define SCLogNotice(...)
Macro used to log NOTICE messages.
Definition: util-debug.h:269
void AppLayerParserRegisterProtocolUnittests(uint8_t ipproto, AppProto alproto, void(*RegisterUnittests)(void))
void RegisterTemplateRustParsers(void)
ConfNode * ConfGetNode(const char *name)
Get a ConfNode by name.
Definition: conf.c:176