suricata
decode-sctp.h
Go to the documentation of this file.
1 /* Copyright (C) 2011 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 Eric Leblond <eric@regit.org>
22  */
23 
24 #ifndef SURICATA_DECODE_SCTP_H
25 #define SURICATA_DECODE_SCTP_H
26 
27 /** size of the packet header without any chunk headers */
28 #define SCTP_HEADER_LEN 12
29 
30 /* XXX RAW* needs to be really 'raw', so no SCNtohs there */
31 #define SCTP_GET_RAW_SRC_PORT(sctph) SCNtohs((sctph)->sh_sport)
32 #define SCTP_GET_RAW_DST_PORT(sctph) SCNtohs((sctph)->sh_dport)
33 
34 #define SCTP_GET_SRC_PORT(p) SCTP_GET_RAW_SRC_PORT(p->sctph)
35 #define SCTP_GET_DST_PORT(p) SCTP_GET_RAW_DST_PORT(p->sctph)
36 
37 typedef struct SCTPHdr_
38 {
39  uint16_t sh_sport; /* source port */
40  uint16_t sh_dport; /* destination port */
41  uint32_t sh_vtag; /* verification tag, defined per flow */
42  uint32_t sh_sum; /* checksum, computed via crc32 */
43 } __attribute__((__packed__)) SCTPHdr;
44 
45 #define CLEAR_SCTP_PACKET(p) { \
46  (p)->sctph = NULL; \
47 } while (0)
48 
50 
51 #endif /* SURICATA_DECODE_SCTP_H */
SCTPHdr_
Definition: decode-sctp.h:38
SCTPHdr_::sh_sport
uint16_t sh_sport
Definition: decode-sctp.h:39
__attribute__
struct SCTPHdr_ __attribute__((__packed__)) SCTPHdr
DNP3 link header.
Definition: decode-vlan.c:103
SCTPHdr_::sh_vtag
uint32_t sh_vtag
Definition: decode-sctp.h:41
SCTPHdr_::sh_dport
uint16_t sh_dport
Definition: decode-sctp.h:40
DecodeSCTPRegisterTests
void DecodeSCTPRegisterTests(void)
SCTPHdr_::sh_sum
uint32_t sh_sum
Definition: decode-sctp.h:42