suricata
app-layer-nbss.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2010 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 Kirby Kuehl <kkuehl@gmail.com>
22  */
23 
24 #ifndef __APP_LAYER_NBSS_H__
25 #define __APP_LAYER_NBSS_H__
26 
27 #include "suricata-common.h"
28 #include "app-layer-protos.h"
29 #include "app-layer-parser.h"
30 #include "flow.h"
31 #include "stream.h"
32 
33 /*
34  http://ubiqx.org/cifs/rfc-draft/rfc1002.html#s4.3
35  All session packets are of the following general structure:
36 
37  1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
38  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
39  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40  | TYPE | FLAGS | LENGTH |
41  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
42  | |
43  / TRAILER (Packet Type Dependent) /
44  | |
45  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
46 
47  The TYPE, FLAGS, and LENGTH fields are present in every session
48  packet.
49 */
50 
51 #define NBSS_SESSION_MESSAGE 0x00
52 #define NBSS_SESSION_REQUEST 0x81
53 #define NBSS_POSITIVE_SESSION_RESPONSE 0x82
54 #define NBSS_NEGATIVE_SESSION_RESPONSE 0x83
55 #define NBSS_RETARGET_SESSION_RESPONSE 0x84
56 #define NBSS_SESSION_KEEP_ALIVE 0x85
57 
58 typedef struct NBSSHdr_ {
59  uint8_t type;
60  uint8_t flags;
61  uint32_t length;
62 } NBSSHdr;
63 
64 #define NBSS_HDR_LEN 4
65 
66 #endif /* __APP_LAYER_NBSS_H__ */
uint8_t type
uint32_t length
struct NBSSHdr_ NBSSHdr
uint8_t flags