suricata
decode-nsh.h
Go to the documentation of this file.
1 /* Copyright (C) 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 Carl Smith <carl.smith@alliedtelesis.co.nz>
22  *
23  */
24 
25 #ifndef __DECODE_NSH_H__
26 #define __DECODE_NSH_H__
27 
28 #include "decode.h"
29 #include "threadvars.h"
30 
31 #define NSH_NEXT_PROTO_UNASSIGNED 0x0
32 #define NSH_NEXT_PROTO_IPV4 0x1
33 #define NSH_NEXT_PROTO_IPV6 0x2
34 #define NSH_NEXT_PROTO_ETHERNET 0x3
35 #define NSH_NEXT_PROTO_NSH 0x4
36 #define NSH_NEXT_PROTO_MPLS 0x5
37 #define NSH_NEXT_PROTO_EXPERIMENT1 0xFE
38 #define NSH_NEXT_PROTO_EXPERIMENT2 0xFF
39 
40 /*
41  * Network Service Header (NSH)
42  */
43 typedef struct NshHdr_ {
44  uint16_t ver_flags_len;
45  uint8_t md_type;
46  uint8_t next_protocol;
47  uint32_t spi_si;
48 } __attribute__((packed)) NshHdr;
49 
50 void DecodeNSHRegisterTests(void);
51 
52 #endif /* __DECODE_NSH_H__ */
NshHdr_::next_protocol
uint8_t next_protocol
Definition: decode-nsh.h:46
NshHdr_::md_type
uint8_t md_type
Definition: decode-nsh.h:45
NshHdr_::spi_si
uint32_t spi_si
Definition: decode-nsh.h:47
decode.h
NshHdr_
Definition: decode-nsh.h:43
NshHdr_::ver_flags_len
uint16_t ver_flags_len
Definition: decode-nsh.h:44
DecodeNSHRegisterTests
void DecodeNSHRegisterTests(void)
Definition: decode-nsh.c:278
threadvars.h
__attribute__
struct NshHdr_ __attribute__((packed)) NshHdr
DNP3 application object header.
Definition: source-erf-file.c:53