suricata
app-layer-nfs-udp.c
Go to the documentation of this file.
1 /* Copyright (C) 2015-2020 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  * \file
20  *
21  * \author Victor Julien <victor@inliniac.net>
22  *
23  * NFS application layer detector and parser
24  */
25 
26 #include "suricata-common.h"
27 #include "stream.h"
28 #include "conf.h"
29 
30 #include "util-unittest.h"
31 
32 #include "app-layer-detect-proto.h"
33 #include "app-layer-parser.h"
34 
35 #include "app-layer-nfs-udp.h"
36 
37 #include "rust.h"
38 
39 /* Enum of app-layer events for an echo protocol. Normally you might
40  * have events for errors in parsing data, like unexpected data being
41  * received. For echo we'll make something up, and log an app-layer
42  * level alert if an empty message is received.
43  *
44  * Example rule:
45  *
46  * alert nfs any any -> any any (msg:"SURICATA NFS empty message"; \
47  * app-layer-event:nfs.empty_message; sid:X; rev:Y;)
48  */
49 enum {
51 };
52 
54  {"EMPTY_MESSAGE", NFS_DECODER_EVENT_EMPTY_MESSAGE},
55  { NULL, 0 }
56 };
57 
58 
60 static SuricataFileContext sfc = { &sbcfg };
61 
63 {
64  rs_nfs_init(&sfc);
65  rs_nfs_udp_register_parser();
66 
67 #ifdef UNITTESTS
70 #endif
71 }
72 
73 #ifdef UNITTESTS
74 #endif
75 
77 {
78 #ifdef UNITTESTS
79 #endif
80 }
app-layer-nfs-udp.h
STREAMING_BUFFER_CONFIG_INITIALIZER
#define STREAMING_BUFFER_CONFIG_INITIALIZER
Definition: util-streaming-buffer.h:77
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:1752
conf.h
suricata-common.h
SCEnumCharMap_
Definition: util-enum.h:27
StreamingBufferConfig_
Definition: util-streaming-buffer.h:67
SuricataFileContext_
Definition: rust-context.h:58
NFS_DECODER_EVENT_EMPTY_MESSAGE
@ NFS_DECODER_EVENT_EMPTY_MESSAGE
Definition: app-layer-nfs-udp.c:50
nfs_udp_decoder_event_table
SCEnumCharMap nfs_udp_decoder_event_table[]
Definition: app-layer-nfs-udp.c:53
RegisterNFSUDPParsers
void RegisterNFSUDPParsers(void)
Definition: app-layer-nfs-udp.c:62
ALPROTO_NFS
@ ALPROTO_NFS
Definition: app-layer-protos.h:45
NFSUDPParserRegisterTests
void NFSUDPParserRegisterTests(void)
Definition: app-layer-nfs-udp.c:76