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 #include "rust.h"
47 
49 {
50  /* TEMPLATE_START_REMOVE */
51  /* Only register if enabled in config. */
52  if (ConfGetNode("app-layer.protocols.template-rust") == NULL) {
53  return;
54  }
55  /* TEMPLATE_END_REMOVE */
56  SCLogNotice("Registering Rust template parser.");
57  rs_template_register_parser();
58 #ifdef UNITTESTS
61 #endif
62 }
63 
64 #ifdef UNITTESTS
65 #endif
66 
68 {
69 #ifdef UNITTESTS
70 #endif
71 }
RegisterTemplateRustParsers
void RegisterTemplateRustParsers(void)
Definition: app-layer-template-rust.c:48
ConfGetNode
ConfNode * ConfGetNode(const char *name)
Get a ConfNode by name.
Definition: conf.c:176
rust.h
util-unittest.h
app-layer-detect-proto.h
app-layer-parser.h
stream.h
AppLayerParserRegisterProtocolUnittests
void AppLayerParserRegisterProtocolUnittests(uint8_t ipproto, AppProto alproto, void(*RegisterUnittests)(void))
Definition: app-layer-parser.c:1707
conf.h
TemplateRustParserRegisterTests
void TemplateRustParserRegisterTests(void)
Definition: app-layer-template-rust.c:67
app-layer-template-rust.h
suricata-common.h
SCLogNotice
#define SCLogNotice(...)
Macro used to log NOTICE messages.
Definition: util-debug.h:232
ALPROTO_TEMPLATE_RUST
@ ALPROTO_TEMPLATE_RUST
Definition: app-layer-protos.h:56