suricata
app-layer-nfs-udp.c
Go to the documentation of this file.
1
/* Copyright (C) 2015-2021 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
28
29
30
#include "
app-layer-nfs-udp.h
"
31
#include "
util-enum.h
"
32
33
#include "
rust.h
"
34
#include "rust-bindings.h"
35
#include "
util-streaming-buffer.h
"
36
37
/* Enum of app-layer events for an echo protocol. Normally you might
38
* have events for errors in parsing data, like unexpected data being
39
* received. For echo we'll make something up, and log an app-layer
40
* level alert if an empty message is received.
41
*
42
* Example rule:
43
*
44
* alert nfs any any -> any any (msg:"SURICATA NFS empty message"; \
45
* app-layer-event:nfs.empty_message; sid:X; rev:Y;)
46
*/
47
enum
{
48
NFS_DECODER_EVENT_EMPTY_MESSAGE
,
49
};
50
51
SCEnumCharMap
nfs_udp_decoder_event_table
[] = {
52
{
"EMPTY_MESSAGE"
,
NFS_DECODER_EVENT_EMPTY_MESSAGE
},
53
{ NULL, 0 }
54
};
55
56
57
static
StreamingBufferConfig
sbcfg =
STREAMING_BUFFER_CONFIG_INITIALIZER
;
58
static
SuricataFileContext sfc = { &sbcfg };
59
60
void
RegisterNFSUDPParsers
(
void
)
61
{
62
SCNfsInit(&sfc);
63
SCRegisterNfsUdpParser();
64
65
}
app-layer-nfs-udp.h
STREAMING_BUFFER_CONFIG_INITIALIZER
#define STREAMING_BUFFER_CONFIG_INITIALIZER
Definition:
util-streaming-buffer.h:74
rust.h
NFS_DECODER_EVENT_EMPTY_MESSAGE
@ NFS_DECODER_EVENT_EMPTY_MESSAGE
Definition:
app-layer-nfs-udp.c:48
suricata-common.h
util-streaming-buffer.h
SCEnumCharMap_
Definition:
util-enum.h:27
StreamingBufferConfig_
Definition:
util-streaming-buffer.h:65
nfs_udp_decoder_event_table
SCEnumCharMap nfs_udp_decoder_event_table[]
Definition:
app-layer-nfs-udp.c:51
RegisterNFSUDPParsers
void RegisterNFSUDPParsers(void)
Definition:
app-layer-nfs-udp.c:60
util-enum.h
src
app-layer-nfs-udp.c
Generated on Tue Oct 13 2026 23:30:19 for suricata by
1.8.18