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 
29 #define NSH_NEXT_PROTO_UNASSIGNED 0x0
30 #define NSH_NEXT_PROTO_IPV4 0x1
31 #define NSH_NEXT_PROTO_IPV6 0x2
32 #define NSH_NEXT_PROTO_ETHERNET 0x3
33 #define NSH_NEXT_PROTO_NSH 0x4
34 #define NSH_NEXT_PROTO_MPLS 0x5
35 #define NSH_NEXT_PROTO_EXPERIMENT1 0xFE
36 #define NSH_NEXT_PROTO_EXPERIMENT2 0xFF
37 
38 /*
39  * Network Service Header (NSH)
40  */
41 typedef struct NshHdr_ {
42  uint16_t ver_flags_len;
43  uint8_t md_type;
44  uint8_t next_protocol;
45  uint32_t spi_si;
46 } __attribute__((packed)) NshHdr;
47 
48 void DecodeNSHRegisterTests(void);
49 
50 #endif /* __DECODE_NSH_H__ */
NshHdr_::next_protocol
uint8_t next_protocol
Definition: decode-nsh.h:44
NshHdr_::md_type
uint8_t md_type
Definition: decode-nsh.h:43
NshHdr_::spi_si
uint32_t spi_si
Definition: decode-nsh.h:45
NshHdr_
Definition: decode-nsh.h:41
NshHdr_::ver_flags_len
uint16_t ver_flags_len
Definition: decode-nsh.h:42
DecodeNSHRegisterTests
void DecodeNSHRegisterTests(void)
Definition: decode-nsh.c:283
__attribute__
struct NshHdr_ __attribute__((packed)) NshHdr
DNP3 application object header.
Definition: source-erf-file.c:54