diff options
Diffstat (limited to 'third_party/libwebrtc/net/dcsctp/public')
-rw-r--r-- | third_party/libwebrtc/net/dcsctp/public/dcsctp_options.h | 15 | ||||
-rw-r--r-- | third_party/libwebrtc/net/dcsctp/public/types.h | 21 |
2 files changed, 28 insertions, 8 deletions
diff --git a/third_party/libwebrtc/net/dcsctp/public/dcsctp_options.h b/third_party/libwebrtc/net/dcsctp/public/dcsctp_options.h index d19798054c..600e8a362e 100644 --- a/third_party/libwebrtc/net/dcsctp/public/dcsctp_options.h +++ b/third_party/libwebrtc/net/dcsctp/public/dcsctp_options.h @@ -196,14 +196,13 @@ struct DcSctpOptions { // Disables SCTP packet crc32 verification. For fuzzers only! bool disable_checksum_verification = false; - // Controls the acceptance of zero checksum, as defined in - // https://datatracker.ietf.org/doc/draft-tuexen-tsvwg-sctp-zero-checksum/ - // This should only be enabled if the packet integrity can be ensured by lower - // layers, which DTLS will do in WebRTC, as defined by RFC8261. - // - // This will also enable sending packets without a checksum value (set to 0) - // once both peers have negotiated this feature. - bool enable_zero_checksum = false; + // Controls the "zero checksum option" feature, as defined in + // https://www.ietf.org/archive/id/draft-ietf-tsvwg-sctp-zero-checksum-06.html. + // To have this feature enabled, both peers must be configured to use the + // same (defined, not "none") alternate error detection method. + ZeroChecksumAlternateErrorDetectionMethod + zero_checksum_alternate_error_detection_method = + ZeroChecksumAlternateErrorDetectionMethod::None(); }; } // namespace dcsctp diff --git a/third_party/libwebrtc/net/dcsctp/public/types.h b/third_party/libwebrtc/net/dcsctp/public/types.h index 02e2ce1e5e..1565cd7b58 100644 --- a/third_party/libwebrtc/net/dcsctp/public/types.h +++ b/third_party/libwebrtc/net/dcsctp/public/types.h @@ -151,6 +151,27 @@ class LifecycleId : public webrtc::StrongAlias<class LifecycleIdTag, uint64_t> { static constexpr LifecycleId NotSet() { return LifecycleId(0); } }; + +// To enable zero checksum feature, both peers must agree on which alternate +// error detection method that is used. See +// https://www.ietf.org/archive/id/draft-ietf-tsvwg-sctp-zero-checksum-06.html. +class ZeroChecksumAlternateErrorDetectionMethod + : public webrtc::StrongAlias< + class ZeroChecksumAlternateErrorDetectionMethodTag, + uint32_t> { + public: + constexpr explicit ZeroChecksumAlternateErrorDetectionMethod( + const UnderlyingType& v) + : webrtc::StrongAlias<class ZeroChecksumAlternateErrorDetectionMethodTag, + uint32_t>(v) {} + + static constexpr ZeroChecksumAlternateErrorDetectionMethod None() { + return ZeroChecksumAlternateErrorDetectionMethod(0); + } + static constexpr ZeroChecksumAlternateErrorDetectionMethod LowerLayerDtls() { + return ZeroChecksumAlternateErrorDetectionMethod(1); + } +}; } // namespace dcsctp #endif // NET_DCSCTP_PUBLIC_TYPES_H_ |