Skip to content

Commit 4415715

Browse files
Add comprehensive SCTP protocol support
Implement full SCTP (Stream Control Transmission Protocol) layer with support for: Core Protocol (RFC 9260): - All standard chunk types (DATA, INIT, INIT-ACK, SACK, HEARTBEAT, ABORT, SHUTDOWN, ERROR, COOKIE-ECHO, COOKIE-ACK, ECNE, CWR, SHUTDOWN-COMPLETE) - CRC32c checksum calculation and validation - Chunk and parameter action bits helpers - Bundling validation per RFC 9260 - Host Name Address deprecation detection Extensions: - AUTH chunk with HMAC-SHA1/SHA256 computation and verification (RFC 4895) - ASCONF/ASCONF-ACK for dynamic address reconfiguration (RFC 5061) - RE-CONFIG for stream reconfiguration (RFC 6525) - FORWARD-TSN for partial reliability (RFC 3758) - I-DATA and I-FORWARD-TSN for message interleaving (RFC 8260) - PAD chunk (RFC 4820) - NR-SACK experimental support (IANA registered, draft-based) - Zero Checksum Acceptable parameter (RFC 9653) Additional features: - Type-safe chunk views: Zero-overhead wrapper classes for all 24 chunk types, enabling type-safe field access without runtime overhead - Parameter iterators for INIT, RE-CONFIG, and ASCONF chunks - Error cause iterator for ABORT/ERROR chunks - Extended PPID enum with 70+ protocol identifiers from IANA registry - Chunk creation APIs for building SCTP packets Includes 91 test cases covering parsing, creation, and validation.
1 parent 6ba29cf commit 4415715

25 files changed

Lines changed: 10794 additions & 12 deletions

Packet++/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ add_library(
4848
src/RadiusLayer.cpp
4949
src/RawPacket.cpp
5050
src/S7CommLayer.cpp
51+
src/SctpLayer.cpp
5152
src/SdpLayer.cpp
5253
src/SingleCommandTextProtocol.cpp
5354
src/SipLayer.cpp
@@ -130,6 +131,7 @@ set(
130131
header/RadiusLayer.h
131132
header/RawPacket.h
132133
header/S7CommLayer.h
134+
header/SctpLayer.h
133135
header/SdpLayer.h
134136
header/SingleCommandTextProtocol.h
135137
header/SipLayer.h

Packet++/header/IPv4Layer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ namespace pcpp
9797
PACKETPP_IPPROTO_DSTOPTS = 60,
9898
/// VRRP protocol
9999
PACKETPP_IPPROTO_VRRP = 112,
100+
/// SCTP (Stream Control Transmission Protocol)
101+
PACKETPP_IPPROTO_SCTP = 132,
100102
/// Raw IP packets
101103
PACKETPP_IPPROTO_RAW = 255,
102104
/// Maximum value

Packet++/header/ProtocolType.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ namespace pcpp
260260
/// FTP protocol family (FTPControl and FtpData protocols)
261261
const ProtocolTypeFamily FTP = 0x3c29;
262262

263+
/// SCTP (Stream Control Transmission Protocol)
264+
const ProtocolType SCTP = 62;
265+
263266
/// @}
264267

265268
/// An enum representing OSI model layers

0 commit comments

Comments
 (0)