suricata
decode-sctp.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SCTPHdr_
 
struct  SCTPChunkHdr_
 
struct  SCTPVars_
 

Macros

#define SCTP_HEADER_LEN   12
 
#define SCTP_CHUNK_HDR_LEN   4
 
#define SCTP_MAX_TRACKED_CHUNKS   16
 
#define SCTP_MAX_DATA_CHUNKS   16
 
#define SCTP_DATA_CHUNK_HDR_LEN   16
 
#define SCTP_CHUNK_TYPE_DATA   0x00
 
#define SCTP_CHUNK_TYPE_INIT   0x01
 
#define SCTP_CHUNK_TYPE_INIT_ACK   0x02
 
#define SCTP_CHUNK_TYPE_SACK   0x03
 
#define SCTP_CHUNK_TYPE_HEARTBEAT   0x04
 
#define SCTP_CHUNK_TYPE_HB_ACK   0x05
 
#define SCTP_CHUNK_TYPE_ABORT   0x06
 
#define SCTP_CHUNK_TYPE_SHUTDOWN   0x07
 
#define SCTP_CHUNK_TYPE_SHUTDOWN_ACK   0x08
 
#define SCTP_CHUNK_TYPE_ERROR   0x09
 
#define SCTP_CHUNK_TYPE_COOKIE_ECHO   0x0A
 
#define SCTP_CHUNK_TYPE_COOKIE_ACK   0x0B
 
#define SCTP_CHUNK_TYPE_ECNE   0x0C
 
#define SCTP_CHUNK_TYPE_CWR   0x0D
 
#define SCTP_CHUNK_TYPE_SHUTDOWN_COMPLETE   0x0E
 
#define SCTP_CHUNK_TYPE_FORWARD_TSN   0xC0
 
#define SCTP_GET_RAW_SRC_PORT(sctph)   SCNtohs((sctph)->sh_sport)
 
#define SCTP_GET_RAW_DST_PORT(sctph)   SCNtohs((sctph)->sh_dport)
 
#define SCTP_GET_RAW_VTAG(sctph)   SCNtohl((sctph)->sh_vtag)
 
#define SCTP_GET_RAW_SUM(sctph)   SCNtohl((sctph)->sh_sum)
 

Typedefs

typedef struct SCTPVars_ SCTPVars
 

Functions

struct SCTPHdr_ __attribute__ ((__packed__)) SCTPHdr
 DNP3 link header. More...
 
void DecodeSCTPRegisterTests (void)
 

Variables

uint16_t sh_sport
 
uint16_t sh_dport
 
uint32_t sh_vtag
 
uint32_t sh_sum
 
uint8_t type
 
uint8_t flags
 
uint16_t length
 

Detailed Description

Author
Eric Leblond eric@.nosp@m.regi.nosp@m.t.org

Definition in file decode-sctp.h.

Macro Definition Documentation

◆ SCTP_CHUNK_HDR_LEN

#define SCTP_CHUNK_HDR_LEN   4

size of a chunk header (type + flags + length)

Definition at line 32 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_ABORT

#define SCTP_CHUNK_TYPE_ABORT   0x06

Definition at line 55 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_COOKIE_ACK

#define SCTP_CHUNK_TYPE_COOKIE_ACK   0x0B

Definition at line 60 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_COOKIE_ECHO

#define SCTP_CHUNK_TYPE_COOKIE_ECHO   0x0A

Definition at line 59 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_CWR

#define SCTP_CHUNK_TYPE_CWR   0x0D

Definition at line 62 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_DATA

#define SCTP_CHUNK_TYPE_DATA   0x00

Definition at line 49 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_ECNE

#define SCTP_CHUNK_TYPE_ECNE   0x0C

Definition at line 61 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_ERROR

#define SCTP_CHUNK_TYPE_ERROR   0x09

Definition at line 58 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_FORWARD_TSN

#define SCTP_CHUNK_TYPE_FORWARD_TSN   0xC0

Definition at line 64 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_HB_ACK

#define SCTP_CHUNK_TYPE_HB_ACK   0x05

Definition at line 54 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_HEARTBEAT

#define SCTP_CHUNK_TYPE_HEARTBEAT   0x04

Definition at line 53 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_INIT

#define SCTP_CHUNK_TYPE_INIT   0x01

Definition at line 50 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_INIT_ACK

#define SCTP_CHUNK_TYPE_INIT_ACK   0x02

Definition at line 51 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_SACK

#define SCTP_CHUNK_TYPE_SACK   0x03

Definition at line 52 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_SHUTDOWN

#define SCTP_CHUNK_TYPE_SHUTDOWN   0x07

Definition at line 56 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_SHUTDOWN_ACK

#define SCTP_CHUNK_TYPE_SHUTDOWN_ACK   0x08

Definition at line 57 of file decode-sctp.h.

◆ SCTP_CHUNK_TYPE_SHUTDOWN_COMPLETE

#define SCTP_CHUNK_TYPE_SHUTDOWN_COMPLETE   0x0E

Definition at line 63 of file decode-sctp.h.

◆ SCTP_DATA_CHUNK_HDR_LEN

#define SCTP_DATA_CHUNK_HDR_LEN   16

DATA chunk overhead before user data (chunk hdr + TSN + SID + SSN + PPID)

Definition at line 46 of file decode-sctp.h.

◆ SCTP_GET_RAW_DST_PORT

#define SCTP_GET_RAW_DST_PORT (   sctph)    SCNtohs((sctph)->sh_dport)

Definition at line 94 of file decode-sctp.h.

◆ SCTP_GET_RAW_SRC_PORT

#define SCTP_GET_RAW_SRC_PORT (   sctph)    SCNtohs((sctph)->sh_sport)

Definition at line 93 of file decode-sctp.h.

◆ SCTP_GET_RAW_SUM

#define SCTP_GET_RAW_SUM (   sctph)    SCNtohl((sctph)->sh_sum)

Definition at line 96 of file decode-sctp.h.

◆ SCTP_GET_RAW_VTAG

#define SCTP_GET_RAW_VTAG (   sctph)    SCNtohl((sctph)->sh_vtag)

Definition at line 95 of file decode-sctp.h.

◆ SCTP_HEADER_LEN

#define SCTP_HEADER_LEN   12

size of the packet header without any chunk headers

Definition at line 29 of file decode-sctp.h.

◆ SCTP_MAX_DATA_CHUNKS

#define SCTP_MAX_DATA_CHUNKS   16

max number of DATA chunk payloads tracked per packet

Definition at line 43 of file decode-sctp.h.

◆ SCTP_MAX_TRACKED_CHUNKS

#define SCTP_MAX_TRACKED_CHUNKS   16

max number of chunks tracked per packet for detection/logging value chosen to keep per-packet overhead low while still allowing some room to track chunks. SCTP has no hard limit on the number of chunks per packet. A packet can carry as many chunks as fit within the MTU, though in practice most packets contain only a few chunks.

Definition at line 40 of file decode-sctp.h.

Typedef Documentation

◆ SCTPVars

typedef struct SCTPVars_ SCTPVars

Function Documentation

◆ DecodeSCTPRegisterTests()

void DecodeSCTPRegisterTests ( void  )

Definition at line 682 of file decode-sctp.c.

References UtRegisterTest().

Here is the call graph for this function:

Variable Documentation

◆ flags

uint8_t flags

Definition at line 1 of file decode-sctp.h.

◆ length

uint16_t length

◆ sh_dport

uint16_t sh_dport

Definition at line 1 of file decode-sctp.h.

◆ sh_sport

uint16_t sh_sport

Definition at line 0 of file decode-sctp.h.

◆ sh_sum

uint32_t sh_sum

Definition at line 3 of file decode-sctp.h.

◆ sh_vtag

uint32_t sh_vtag

Definition at line 2 of file decode-sctp.h.

◆ type