mediasoup 3.20.0 → 3.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node/lib/Consumer.d.ts.map +1 -1
- package/node/lib/Consumer.js +5 -4
- package/node/lib/DataConsumer.d.ts +2 -3
- package/node/lib/DataConsumer.d.ts.map +1 -1
- package/node/lib/DataConsumer.js +10 -7
- package/node/lib/DataConsumerTypes.d.ts +5 -4
- package/node/lib/DataConsumerTypes.d.ts.map +1 -1
- package/node/lib/DataProducer.d.ts.map +1 -1
- package/node/lib/DataProducer.js +2 -1
- package/node/lib/PipeTransport.d.ts.map +1 -1
- package/node/lib/PipeTransport.js +5 -4
- package/node/lib/PlainTransport.d.ts.map +1 -1
- package/node/lib/PlainTransport.js +6 -5
- package/node/lib/Producer.d.ts.map +1 -1
- package/node/lib/Producer.js +4 -3
- package/node/lib/Router.js +1 -1
- package/node/lib/WebRtcTransport.d.ts.map +1 -1
- package/node/lib/WebRtcTransport.js +6 -5
- package/node/lib/fbs/consumer/degrade-request.d.ts +30 -0
- package/node/lib/fbs/consumer/degrade-request.d.ts.map +1 -0
- package/node/lib/fbs/consumer/degrade-request.js +124 -0
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts +24 -0
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts.map +1 -0
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.js +102 -0
- package/node/lib/fbs/data-consumer/send-response.d.ts +21 -0
- package/node/lib/fbs/data-consumer/send-response.d.ts.map +1 -0
- package/node/lib/fbs/data-consumer/send-response.js +91 -0
- package/node/lib/fbs/data-consumer.d.ts +1 -0
- package/node/lib/fbs/data-consumer.d.ts.map +1 -1
- package/node/lib/fbs/data-consumer.js +4 -1
- package/node/lib/fbs/producer/degrade-request.d.ts +30 -0
- package/node/lib/fbs/producer/degrade-request.d.ts.map +1 -0
- package/node/lib/fbs/producer/degrade-request.js +124 -0
- package/node/lib/fbs/response/body.d.ts +7 -5
- package/node/lib/fbs/response/body.d.ts.map +1 -1
- package/node/lib/fbs/response/body.js +7 -3
- package/node/lib/fbs/response/response.d.ts +3 -2
- package/node/lib/fbs/response/response.d.ts.map +1 -1
- package/node/lib/fbs/sctp-parameters/num-sctp-streams.d.ts.map +1 -1
- package/node/lib/fbs/sctp-parameters/num-sctp-streams.js +5 -5
- package/node/lib/fbs/transport/sctp-negotiated-max-streams-notification.d.ts +24 -0
- package/node/lib/fbs/transport/sctp-negotiated-max-streams-notification.d.ts.map +1 -0
- package/node/lib/fbs/transport/sctp-negotiated-max-streams-notification.js +102 -0
- package/node/lib/fbs/transport/sctp-negotiated-options-notification.d.ts +24 -0
- package/node/lib/fbs/transport/sctp-negotiated-options-notification.d.ts.map +1 -0
- package/node/lib/fbs/transport/sctp-negotiated-options-notification.js +102 -0
- package/node/lib/fbs/worker/close-notification.d.ts +18 -0
- package/node/lib/fbs/worker/close-notification.d.ts.map +1 -0
- package/node/lib/fbs/worker/close-notification.js +78 -0
- package/node/lib/fbs/worker/close-request.d.ts +18 -0
- package/node/lib/fbs/worker/close-request.d.ts.map +1 -0
- package/node/lib/fbs/worker/close-request.js +78 -0
- package/node/lib/fbs/worker/close-worker-notification.d.ts +18 -0
- package/node/lib/fbs/worker/close-worker-notification.d.ts.map +1 -0
- package/node/lib/fbs/worker/close-worker-notification.js +78 -0
- package/node/lib/sctpParametersTypes.d.ts +23 -0
- package/node/lib/sctpParametersTypes.d.ts.map +1 -1
- package/node/lib/test/test-Consumer.js +194 -0
- package/node/lib/test/test-DataConsumer.js +6 -0
- package/node/lib/test/test-Router.js +11 -0
- package/node/lib/test/test-werift-sctp.js +7 -0
- package/npm-scripts.mjs +2 -2
- package/package.json +7 -6
- package/worker/Makefile +5 -1
- package/worker/deps/libwebrtc/meson.build +5 -1
- package/worker/fbs/dataConsumer.fbs +4 -0
- package/worker/fbs/response.fbs +1 -0
- package/worker/fuzzer/src/RTC/RTP/FuzzerPacket.cpp +2 -2
- package/worker/include/Channel/ChannelMessageRegistrator.hpp +4 -3
- package/worker/include/Channel/ChannelNotification.hpp +0 -4
- package/worker/include/Channel/ChannelRequest.hpp +3 -4
- package/worker/include/DepLibSRTP.hpp +2 -2
- package/worker/include/RTC/ActiveSpeakerObserver.hpp +2 -2
- package/worker/include/RTC/AudioLevelObserver.hpp +2 -2
- package/worker/include/RTC/Consumer.hpp +1 -1
- package/worker/include/RTC/DataConsumer.hpp +2 -2
- package/worker/include/RTC/DtlsTransport.hpp +4 -4
- package/worker/include/RTC/ICE/IceServer.hpp +2 -2
- package/worker/include/RTC/ICE/StunPacket.hpp +34 -34
- package/worker/include/RTC/KeyFrameRequestManager.hpp +3 -3
- package/worker/include/RTC/Parameters.hpp +2 -2
- package/worker/include/RTC/PipeConsumer.hpp +6 -5
- package/worker/include/RTC/PlainTransport.hpp +0 -1
- package/worker/include/RTC/PortManager.hpp +92 -12
- package/worker/include/RTC/Producer.hpp +7 -6
- package/worker/include/RTC/RTCP/Feedback.hpp +1 -2
- package/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp +2 -2
- package/worker/include/RTC/RTCP/Packet.hpp +2 -2
- package/worker/include/RTC/RTCP/Sdes.hpp +1 -1
- package/worker/include/RTC/RTP/Codecs/DependencyDescriptor.hpp +2 -1
- package/worker/include/RTC/RTP/Packet.hpp +57 -57
- package/worker/include/RTC/RTP/ProbationGenerator.hpp +2 -2
- package/worker/include/RTC/RTP/SharedPacket.hpp +4 -4
- package/worker/include/RTC/Router.hpp +12 -11
- package/worker/include/RTC/RtcLogger.hpp +2 -2
- package/worker/include/RTC/RtpDictionaries.hpp +6 -6
- package/worker/include/RTC/RtpListener.hpp +4 -4
- package/worker/include/RTC/SCTP/association/Association.hpp +13 -13
- package/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +2 -2
- package/worker/include/RTC/SCTP/association/NegotiatedCapabilities.hpp +2 -2
- package/worker/include/RTC/SCTP/association/PacketSender.hpp +3 -3
- package/worker/include/RTC/SCTP/association/StateCookie.hpp +9 -9
- package/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +4 -4
- package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +24 -24
- package/worker/include/RTC/SCTP/association/TransmissionControlBlockContextInterface.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/Chunk.hpp +86 -86
- package/worker/include/RTC/SCTP/packet/ErrorCause.hpp +18 -18
- package/worker/include/RTC/SCTP/packet/Packet.hpp +33 -33
- package/worker/include/RTC/SCTP/packet/Parameter.hpp +24 -24
- package/worker/include/RTC/SCTP/packet/TLV.hpp +13 -13
- package/worker/include/RTC/SCTP/packet/UserData.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/chunks/AbortAssociationChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/AnyDataChunk.hpp +9 -9
- package/worker/include/RTC/SCTP/packet/chunks/AnyForwardTsnChunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/chunks/CookieAckChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/CookieEchoChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/DataChunk.hpp +11 -11
- package/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp +6 -6
- package/worker/include/RTC/SCTP/packet/chunks/HeartbeatAckChunk.hpp +6 -6
- package/worker/include/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.hpp +6 -6
- package/worker/include/RTC/SCTP/packet/chunks/IDataChunk.hpp +6 -6
- package/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp +7 -7
- package/worker/include/RTC/SCTP/packet/chunks/InitAckChunk.hpp +10 -10
- package/worker/include/RTC/SCTP/packet/chunks/InitChunk.hpp +8 -8
- package/worker/include/RTC/SCTP/packet/chunks/OperationErrorChunk.hpp +6 -6
- package/worker/include/RTC/SCTP/packet/chunks/ReConfigChunk.hpp +10 -10
- package/worker/include/RTC/SCTP/packet/chunks/SackChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/ShutdownAckChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/ShutdownChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/UnknownChunk.hpp +2 -2
- package/worker/include/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/errorCauses/UnknownErrorCause.hpp +2 -2
- package/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/CookiePreservativeParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/parameters/IPv4AddressParameter.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/parameters/IPv6AddressParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp +7 -7
- package/worker/include/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/StateCookieParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/parameters/UnknownParameter.hpp +2 -2
- package/worker/include/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp +7 -7
- package/worker/include/RTC/SCTP/public/AssociationInterface.hpp +7 -7
- package/worker/include/RTC/SCTP/public/AssociationListenerInterface.hpp +26 -26
- package/worker/include/RTC/SCTP/public/AssociationMetrics.hpp +7 -7
- package/worker/include/RTC/SCTP/public/Message.hpp +1 -1
- package/worker/include/RTC/SCTP/public/SctpOptions.hpp +4 -4
- package/worker/include/RTC/SCTP/public/SctpTypes.hpp +10 -10
- package/worker/include/RTC/SCTP/rx/DataTracker.hpp +1 -1
- package/worker/include/RTC/SCTP/rx/ReassemblyStreamsInterface.hpp +1 -1
- package/worker/include/RTC/SCTP/tx/OutstandingData.hpp +39 -39
- package/worker/include/RTC/SCTP/tx/RetransmissionErrorCounter.hpp +1 -1
- package/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp +14 -14
- package/worker/include/RTC/SCTP/tx/RoundRobinSendQueue.hpp +1 -1
- package/worker/include/RTC/SctpListener.hpp +2 -2
- package/worker/include/RTC/SimulcastConsumer.hpp +2 -1
- package/worker/include/RTC/TcpServer.hpp +3 -2
- package/worker/include/RTC/Transport.hpp +8 -8
- package/worker/include/RTC/UdpSocket.hpp +3 -2
- package/worker/include/RTC/WebRtcServer.hpp +4 -5
- package/worker/include/RTC/WebRtcTransport.hpp +2 -2
- package/worker/include/Settings.hpp +3 -3
- package/worker/include/Worker.hpp +3 -3
- package/worker/include/handles/TcpServerHandle.hpp +2 -2
- package/worker/meson.build +9 -4
- package/worker/mocks/include/Channel/MockChannelMessageRegistrator.hpp +4 -3
- package/worker/src/Channel/ChannelNotification.cpp +5 -4
- package/worker/src/Channel/ChannelRequest.cpp +9 -6
- package/worker/src/DepLibSRTP.cpp +1 -1
- package/worker/src/RTC/AudioLevelObserver.cpp +2 -2
- package/worker/src/RTC/DataConsumer.cpp +13 -3
- package/worker/src/RTC/DataProducer.cpp +1 -1
- package/worker/src/RTC/DtlsTransport.cpp +3 -3
- package/worker/src/RTC/ICE/IceServer.cpp +1 -1
- package/worker/src/RTC/ICE/StunPacket.cpp +77 -77
- package/worker/src/RTC/PipeTransport.cpp +5 -4
- package/worker/src/RTC/PlainTransport.cpp +9 -8
- package/worker/src/RTC/PortManager.cpp +174 -114
- package/worker/src/RTC/Producer.cpp +0 -1
- package/worker/src/RTC/RTCP/Feedback.cpp +6 -6
- package/worker/src/RTC/RTCP/FeedbackPs.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackPsAfb.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackPsPli.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackPsRemb.cpp +2 -2
- package/worker/src/RTC/RTCP/FeedbackRtp.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackRtpSrReq.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp +2 -2
- package/worker/src/RTC/RTCP/Packet.cpp +2 -2
- package/worker/src/RTC/RTCP/Sdes.cpp +1 -1
- package/worker/src/RTC/RTP/Codecs/DependencyDescriptor.cpp +2 -1
- package/worker/src/RTC/RTP/Packet.cpp +68 -68
- package/worker/src/RTC/RTP/ProbationGenerator.cpp +3 -3
- package/worker/src/RTC/RTP/RtpStreamRecv.cpp +3 -3
- package/worker/src/RTC/RTP/RtxStream.cpp +2 -2
- package/worker/src/RTC/RTP/SharedPacket.cpp +4 -4
- package/worker/src/RTC/Router.cpp +5 -5
- package/worker/src/RTC/RtcLogger.cpp +1 -1
- package/worker/src/RTC/RtpDictionaries/RtpCodecMimeType.cpp +4 -4
- package/worker/src/RTC/RtpDictionaries/RtpParameters.cpp +2 -3
- package/worker/src/RTC/SCTP/association/Association.cpp +100 -97
- package/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +6 -6
- package/worker/src/RTC/SCTP/association/NegotiatedCapabilities.cpp +3 -3
- package/worker/src/RTC/SCTP/association/PacketSender.cpp +1 -1
- package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +2 -2
- package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +5 -5
- package/worker/src/RTC/SCTP/packet/Chunk.cpp +52 -52
- package/worker/src/RTC/SCTP/packet/ErrorCause.cpp +14 -14
- package/worker/src/RTC/SCTP/packet/Packet.cpp +17 -17
- package/worker/src/RTC/SCTP/packet/Parameter.cpp +17 -17
- package/worker/src/RTC/SCTP/packet/TLV.cpp +8 -8
- package/worker/src/RTC/SCTP/packet/chunks/AbortAssociationChunk.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/chunks/CookieAckChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/CookieEchoChunk.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/chunks/DataChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/ForwardTsnChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/HeartbeatAckChunk.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/chunks/IDataChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/IForwardTsnChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/InitAckChunk.cpp +4 -4
- package/worker/src/RTC/SCTP/packet/chunks/InitChunk.cpp +4 -4
- package/worker/src/RTC/SCTP/packet/chunks/OperationErrorChunk.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/chunks/ReConfigChunk.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/chunks/ShutdownAckChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/ShutdownChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.cpp +4 -4
- package/worker/src/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/CookiePreservativeParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/parameters/IPv4AddressParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/IPv6AddressParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/StateCookieParameter.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.cpp +3 -3
- package/worker/src/RTC/SCTP/rx/InterleavedReassemblyStreams.cpp +1 -0
- package/worker/src/RTC/SCTP/rx/TraditionalReassemblyStreams.cpp +1 -0
- package/worker/src/RTC/SCTP/tx/OutstandingData.cpp +8 -8
- package/worker/src/RTC/SCTP/tx/RoundRobinSendQueue.cpp +1 -1
- package/worker/src/RTC/SvcConsumer.cpp +6 -2
- package/worker/src/RTC/TcpServer.cpp +4 -4
- package/worker/src/RTC/Transport.cpp +42 -19
- package/worker/src/RTC/UdpSocket.cpp +4 -4
- package/worker/src/RTC/WebRtcServer.cpp +8 -8
- package/worker/src/RTC/WebRtcTransport.cpp +9 -8
- package/worker/src/Settings.cpp +2 -2
- package/worker/src/lib.cpp +1 -2
- package/worker/subprojects/packagefiles/ankerl-unordered-dense/meson.build +5 -0
- package/worker/subprojects/unordered-dense.wrap +9 -0
- package/worker/tasks.py +293 -196
- package/worker/test/src/RTC/ICE/TestStunPacket.cpp +22 -22
- package/worker/test/src/RTC/ICE/iceCommon.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpEcn.cpp +8 -8
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpNack.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpSrReq.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpTllei.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestSenderReport.cpp +1 -1
- package/worker/test/src/RTC/RTP/TestPacket.cpp +26 -26
- package/worker/test/src/RTC/RTP/TestSharedPacket.cpp +1 -1
- package/worker/test/src/RTC/RTP/rtpCommon.cpp +1 -1
- package/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp +4 -4
- package/worker/test/src/RTC/SCTP/packet/TestPacket.cpp +14 -14
- package/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp +4 -4
- package/worker/test/src/RTC/SCTP/packet/chunks/TestCookieAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestCookieEchoChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestForwardTsnChunk.cpp +3 -3
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp +3 -3
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp +9 -9
- package/worker/test/src/RTC/SCTP/packet/chunks/TestIDataChunk.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp +3 -3
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp +3 -3
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp +8 -8
- package/worker/test/src/RTC/SCTP/packet/chunks/TestOperationErrorChunk.cpp +7 -7
- package/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp +6 -6
- package/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownCompleteChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestUnknownChunk.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestCookieReceivedWhileShuttingDownErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidMandatoryParameterErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidStreamIdentifierErrorCause.cpp +6 -6
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestMissingMandatoryParameterErrorCause.cpp +11 -11
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestNoUserDataErrorCause.cpp +6 -6
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestOutOfResourceErrorCause.cpp +5 -5
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestProtocolViolationErrorCause.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestRestartOfAnAssociationWithNewAddressesErrorCause.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestStaleCookieErrorCause.cpp +6 -6
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedChunkTypeErrorCause.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedParametersErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnresolvableAddressErrorCause.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUserInitiatedAbortErrorCause.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/parameters/TestAddIncomingStreamsRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestAddOutgoingStreamsRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestCookiePreservativeParameter.cpp +7 -7
- package/worker/test/src/RTC/SCTP/packet/parameters/TestForwardTsnSupportedParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestHeartbeatInfoParameter.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv4AddressParameter.cpp +7 -7
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp +7 -7
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/parameters/TestReconfigurationResponseParameter.cpp +5 -5
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSsnTsnResetRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestStateCookieParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedAddressTypesParameter.cpp +6 -6
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp +3 -3
- package/worker/test/src/RTC/SCTP/packet/parameters/TestUnknownParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestUnrecognizedParameterParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestZeroChecksumAcceptableParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/sctpCommon.cpp +1 -1
- package/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp +3 -3
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp +1 -1
- package/worker/test/src/RTC/TestNackGenerator.cpp +1 -1
- package/worker/test/src/RTC/TestPortManager.cpp +126 -0
- package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +2 -2
- package/worker/test/src/RTC/TestTransportTuple.cpp +3 -2
- package/worker/test/src/Utils/TestCrypto.cpp +3 -3
- package/worker/test/src/Utils/TestString.cpp +1 -1
|
@@ -98,7 +98,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
98
98
|
request->CheckAuthentication(usernameFragment1, password) ==
|
|
99
99
|
RTC::ICE::StunPacket::AuthenticationResult::OK);
|
|
100
100
|
|
|
101
|
-
// Trying to modify a STUN
|
|
101
|
+
// Trying to modify a STUN packet once protected must throw.
|
|
102
102
|
REQUIRE_THROWS_AS(request->Protect("qweqwe"), MediaSoupError);
|
|
103
103
|
REQUIRE_THROWS_AS(request->Protect(), MediaSoupError);
|
|
104
104
|
|
|
@@ -138,7 +138,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
138
138
|
request->CheckAuthentication(usernameFragment1, password) ==
|
|
139
139
|
RTC::ICE::StunPacket::AuthenticationResult::OK);
|
|
140
140
|
|
|
141
|
-
// Trying to modify a STUN
|
|
141
|
+
// Trying to modify a STUN packet once protected must throw.
|
|
142
142
|
REQUIRE_THROWS_AS(request->Protect("qweqwe"), MediaSoupError);
|
|
143
143
|
REQUIRE_THROWS_AS(request->Protect(), MediaSoupError);
|
|
144
144
|
|
|
@@ -178,7 +178,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
178
178
|
request->CheckAuthentication(usernameFragment1, password) ==
|
|
179
179
|
RTC::ICE::StunPacket::AuthenticationResult::OK);
|
|
180
180
|
|
|
181
|
-
// Trying to modify a STUN
|
|
181
|
+
// Trying to modify a STUN packet once protected must throw.
|
|
182
182
|
REQUIRE_THROWS_AS(request->Protect("qweqwe"), MediaSoupError);
|
|
183
183
|
REQUIRE_THROWS_AS(request->Protect(), MediaSoupError);
|
|
184
184
|
}
|
|
@@ -516,7 +516,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
516
516
|
uint16_t errorCode = 666;
|
|
517
517
|
std::string errorReasonPhrase = "UPPS UNKNOWN ERROR 😊";
|
|
518
518
|
|
|
519
|
-
// Total length of the
|
|
519
|
+
// Total length of the attributes.
|
|
520
520
|
size_t attributesLen =
|
|
521
521
|
(4 + 27 + 1) + (4 + 4) + (4 + 8) + (4) + (4 + 4) + (4 + 18 + 2) + (4 + 4 + 23 + 1);
|
|
522
522
|
|
|
@@ -528,7 +528,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
528
528
|
request->AddSoftware(software);
|
|
529
529
|
request->AddErrorCode(errorCode, errorReasonPhrase);
|
|
530
530
|
|
|
531
|
-
// It should fail if we try to add a duplicated
|
|
531
|
+
// It should fail if we try to add a duplicated attribute.
|
|
532
532
|
REQUIRE_THROWS_AS(request->AddUsername(username), MediaSoupError);
|
|
533
533
|
REQUIRE_THROWS_AS(request->AddPriority(priority), MediaSoupError);
|
|
534
534
|
REQUIRE_THROWS_AS(request->AddIceControlling(iceControlling), MediaSoupError);
|
|
@@ -646,7 +646,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
646
646
|
transactionId,
|
|
647
647
|
RTC::ICE::StunPacket::TransactionIdLength));
|
|
648
648
|
|
|
649
|
-
/* Protect the STUN
|
|
649
|
+
/* Protect the STUN packet. */
|
|
650
650
|
|
|
651
651
|
std::string password = "asjhdkjhkasd";
|
|
652
652
|
|
|
@@ -683,7 +683,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
683
683
|
request->CheckAuthentication(usernameFragment1, password) ==
|
|
684
684
|
RTC::ICE::StunPacket::AuthenticationResult::OK);
|
|
685
685
|
|
|
686
|
-
// Trying to modify a STUN
|
|
686
|
+
// Trying to modify a STUN packet once protected must throw.
|
|
687
687
|
REQUIRE_THROWS_AS(request->Protect("qweqwe"), MediaSoupError);
|
|
688
688
|
REQUIRE_THROWS_AS(request->Protect(), MediaSoupError);
|
|
689
689
|
}
|
|
@@ -732,7 +732,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
732
732
|
|
|
733
733
|
uv_ip4_addr("22.33.0.125", 5678, xorMappedAddressIn);
|
|
734
734
|
|
|
735
|
-
// Total length of the
|
|
735
|
+
// Total length of the attributes.
|
|
736
736
|
size_t attributesLen = (4 + 8);
|
|
737
737
|
|
|
738
738
|
successResponse->AddXorMappedAddress(xorMappedAddress);
|
|
@@ -797,7 +797,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
797
797
|
|
|
798
798
|
uv_ip6_addr("2001:db8::1234", 20002, xorMappedAddressIn6);
|
|
799
799
|
|
|
800
|
-
// Total length of the
|
|
800
|
+
// Total length of the attributes.
|
|
801
801
|
attributesLen = (4 + 20);
|
|
802
802
|
|
|
803
803
|
successResponse->AddXorMappedAddress(xorMappedAddress);
|
|
@@ -838,7 +838,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
838
838
|
REQUIRE(ip == Utils::IP::NormalizeIp(expectedIp));
|
|
839
839
|
REQUIRE(port == 20002);
|
|
840
840
|
|
|
841
|
-
/* Protect the STUN
|
|
841
|
+
/* Protect the STUN packet. */
|
|
842
842
|
|
|
843
843
|
std::string password = "asjhdkjhkasd";
|
|
844
844
|
|
|
@@ -875,7 +875,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
875
875
|
successResponse->CheckAuthentication(password) ==
|
|
876
876
|
RTC::ICE::StunPacket::AuthenticationResult::OK);
|
|
877
877
|
|
|
878
|
-
// Trying to modify a STUN
|
|
878
|
+
// Trying to modify a STUN packet once protected must throw.
|
|
879
879
|
REQUIRE_THROWS_AS(successResponse->Protect("qweqwe"), MediaSoupError);
|
|
880
880
|
REQUIRE_THROWS_AS(successResponse->Protect(), MediaSoupError);
|
|
881
881
|
}
|
|
@@ -918,7 +918,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
918
918
|
uint16_t errorCode = 666;
|
|
919
919
|
std::string errorReasonPhrase = "UPPS UNKNOWN ERROR 😊";
|
|
920
920
|
|
|
921
|
-
// Total length of the
|
|
921
|
+
// Total length of the attributes.
|
|
922
922
|
size_t attributesLen = (4 + 4 + 23 + 1);
|
|
923
923
|
|
|
924
924
|
errorResponse->AddErrorCode(errorCode, errorReasonPhrase);
|
|
@@ -949,7 +949,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
949
949
|
/*hasMessageIntegrity*/ false,
|
|
950
950
|
/*hasFingerprint*/ false);
|
|
951
951
|
|
|
952
|
-
/* Protect the STUN
|
|
952
|
+
/* Protect the STUN packet. */
|
|
953
953
|
|
|
954
954
|
std::string password = "23786asdas123";
|
|
955
955
|
|
|
@@ -985,7 +985,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
985
985
|
REQUIRE(
|
|
986
986
|
errorResponse->CheckAuthentication(password) == RTC::ICE::StunPacket::AuthenticationResult::OK);
|
|
987
987
|
|
|
988
|
-
// Trying to modify a STUN
|
|
988
|
+
// Trying to modify a STUN packet once protected must throw.
|
|
989
989
|
REQUIRE_THROWS_AS(errorResponse->Protect("qweqwe"), MediaSoupError);
|
|
990
990
|
REQUIRE_THROWS_AS(errorResponse->Protect(), MediaSoupError);
|
|
991
991
|
|
|
@@ -1002,7 +1002,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
1002
1002
|
errorCode = 400;
|
|
1003
1003
|
errorReasonPhrase = "Bad Request";
|
|
1004
1004
|
|
|
1005
|
-
// Total length of the
|
|
1005
|
+
// Total length of the attributes.
|
|
1006
1006
|
attributesLen = (4 + 4 + 11 + 1);
|
|
1007
1007
|
|
|
1008
1008
|
errorResponse->AddErrorCode(errorCode, errorReasonPhrase);
|
|
@@ -1033,9 +1033,9 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
1033
1033
|
/*hasMessageIntegrity*/ false,
|
|
1034
1034
|
/*hasFingerprint*/ false);
|
|
1035
1035
|
|
|
1036
|
-
/* Protect the STUN
|
|
1036
|
+
/* Protect the STUN packet (without password). */
|
|
1037
1037
|
|
|
1038
|
-
// Protect() without password only adds FINGERPRINT
|
|
1038
|
+
// Protect() without password only adds FINGERPRINT attribute.
|
|
1039
1039
|
errorResponse->Protect();
|
|
1040
1040
|
|
|
1041
1041
|
CHECK_STUN_PACKET(/*packet*/ errorResponse.get(),
|
|
@@ -1064,12 +1064,12 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
1064
1064
|
/*hasMessageIntegrity*/ false,
|
|
1065
1065
|
/*hasFingerprint*/ true);
|
|
1066
1066
|
|
|
1067
|
-
// Cannot check authentication in a STUN
|
|
1067
|
+
// Cannot check authentication in a STUN packet without MESSAGE-INTEGRITY.
|
|
1068
1068
|
REQUIRE(
|
|
1069
1069
|
errorResponse->CheckAuthentication(password) ==
|
|
1070
1070
|
RTC::ICE::StunPacket::AuthenticationResult::BAD_MESSAGE);
|
|
1071
1071
|
|
|
1072
|
-
// Trying to modify a STUN
|
|
1072
|
+
// Trying to modify a STUN packet once protected must throw.
|
|
1073
1073
|
REQUIRE_THROWS_AS(errorResponse->Protect("qweqwe"), MediaSoupError);
|
|
1074
1074
|
REQUIRE_THROWS_AS(errorResponse->Protect(), MediaSoupError);
|
|
1075
1075
|
}
|
|
@@ -1151,7 +1151,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
1151
1151
|
successResponse->CheckAuthentication("qwekqjhwekjahsd") ==
|
|
1152
1152
|
RTC::ICE::StunPacket::AuthenticationResult::OK);
|
|
1153
1153
|
|
|
1154
|
-
// Trying to modify a STUN
|
|
1154
|
+
// Trying to modify a STUN packet once protected must throw.
|
|
1155
1155
|
REQUIRE_THROWS_AS(successResponse->Protect("qweqwe"), MediaSoupError);
|
|
1156
1156
|
REQUIRE_THROWS_AS(successResponse->Protect(), MediaSoupError);
|
|
1157
1157
|
}
|
|
@@ -1167,7 +1167,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
1167
1167
|
std::unique_ptr<RTC::ICE::StunPacket> errorResponse{ request->CreateErrorResponse(
|
|
1168
1168
|
iceCommon::ResponseFactoryBuffer, sizeof(iceCommon::ResponseFactoryBuffer), 666, "BAD STUFF") };
|
|
1169
1169
|
|
|
1170
|
-
// Total length of the
|
|
1170
|
+
// Total length of the attributes (ERROR-CODE).
|
|
1171
1171
|
const size_t attributesLen = (4 + 4 + 9 + 3);
|
|
1172
1172
|
|
|
1173
1173
|
CHECK_STUN_PACKET(/*packet*/ errorResponse.get(),
|
|
@@ -1236,7 +1236,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]")
|
|
|
1236
1236
|
errorResponse->CheckAuthentication("qwekqjhwekjahsd") ==
|
|
1237
1237
|
RTC::ICE::StunPacket::AuthenticationResult::OK);
|
|
1238
1238
|
|
|
1239
|
-
// Trying to modify a STUN
|
|
1239
|
+
// Trying to modify a STUN packet once protected must throw.
|
|
1240
1240
|
REQUIRE_THROWS_AS(errorResponse->Protect("qweqwe"), MediaSoupError);
|
|
1241
1241
|
REQUIRE_THROWS_AS(errorResponse->Protect(), MediaSoupError);
|
|
1242
1242
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
namespace iceCommon
|
|
5
5
|
{
|
|
6
|
-
// NOTE: We don't need `alignas(4)` for STUN
|
|
6
|
+
// NOTE: We don't need `alignas(4)` for STUN packet parsing. However we do it
|
|
7
7
|
// for consistency with rtpCommon.cpp and sctpCommon.cpp.
|
|
8
8
|
alignas(4) thread_local uint8_t FactoryBuffer[];
|
|
9
9
|
alignas(4) thread_local uint8_t ResponseFactoryBuffer[];
|
|
@@ -8,16 +8,16 @@ SCENARIO("RTCP Feedback RTP ECN", "[rtcp][feedback-rtp][ecn]")
|
|
|
8
8
|
// clang-format off
|
|
9
9
|
alignas(4) uint8_t buffer[] =
|
|
10
10
|
{
|
|
11
|
-
0x88, 0xcd, 0x00, 0x07, // Type: 205 (Generic RTP
|
|
11
|
+
0x88, 0xcd, 0x00, 0x07, // Type: 205 (Generic RTP feedback), Count: 8 (ECN) Length: 7
|
|
12
12
|
0x00, 0x00, 0x00, 0x01, // Sender SSRC: 0x00000001
|
|
13
13
|
0x03, 0x30, 0xbd, 0xee, // Media source SSRC: 0x0330bdee
|
|
14
|
-
0x00, 0x00, 0x00, 0x01, // Extended
|
|
15
|
-
0x00, 0x00, 0x00, 0x01, // ECT (0)
|
|
16
|
-
0x00, 0x00, 0x00, 0x01, // ECT (1)
|
|
17
|
-
0x00, 0x01, // ECN-CE
|
|
18
|
-
0x00, 0x01, // not-ECT
|
|
19
|
-
0x00, 0x01, // Lost Packets
|
|
20
|
-
0x00, 0x01 // Duplication
|
|
14
|
+
0x00, 0x00, 0x00, 0x01, // Extended highest sequence number
|
|
15
|
+
0x00, 0x00, 0x00, 0x01, // ECT (0) counter
|
|
16
|
+
0x00, 0x00, 0x00, 0x01, // ECT (1) counter
|
|
17
|
+
0x00, 0x01, // ECN-CE counter
|
|
18
|
+
0x00, 0x01, // not-ECT counter
|
|
19
|
+
0x00, 0x01, // Lost Packets counter
|
|
20
|
+
0x00, 0x01 // Duplication counter
|
|
21
21
|
};
|
|
22
22
|
// clang-format on
|
|
23
23
|
|
|
@@ -10,7 +10,7 @@ SCENARIO("RTCP Feedback RTP NACK", "[rtcp][feedback-rtp][nack]")
|
|
|
10
10
|
// clang-format off
|
|
11
11
|
alignas(4) uint8_t buffer[] =
|
|
12
12
|
{
|
|
13
|
-
0x81, 0xcd, 0x00, 0x03, // Type: 205 (Generic RTP
|
|
13
|
+
0x81, 0xcd, 0x00, 0x03, // Type: 205 (Generic RTP feedback), Length: 3
|
|
14
14
|
0x00, 0x00, 0x00, 0x01, // Sender SSRC: 0x00000001
|
|
15
15
|
0x03, 0x30, 0xbd, 0xee, // Media source SSRC: 0x0330bdee
|
|
16
16
|
0x0b, 0x8f, 0x00, 0x03 // NACK PID: 2959, NACK BLP: 0x0003
|
|
@@ -10,7 +10,7 @@ SCENARIO("RTCP Feedback RTP SR-REQ", "[rtcp][feedback-rtp][sr-req]")
|
|
|
10
10
|
// clang-format off
|
|
11
11
|
alignas(4) uint8_t buffer[] =
|
|
12
12
|
{
|
|
13
|
-
0x85, 0xcd, 0x00, 0x02, // Type: 205 (Generic RTP
|
|
13
|
+
0x85, 0xcd, 0x00, 0x02, // Type: 205 (Generic RTP feedback), Count: 5 (SR-REQ) Length: 3
|
|
14
14
|
0x00, 0x00, 0x00, 0x01, // Sender SSRC: 0x00000001
|
|
15
15
|
0x03, 0x30, 0xbd, 0xee, // Media source SSRC: 0x0330bdee
|
|
16
16
|
};
|
|
@@ -10,7 +10,7 @@ SCENARIO("RTCP Feedback RTP TLLEI", "[rtcp][feedback-rtp][tllei]")
|
|
|
10
10
|
// clang-format off
|
|
11
11
|
alignas(4) uint8_t buffer[] =
|
|
12
12
|
{
|
|
13
|
-
0x87, 0xcd, 0x00, 0x03, // Type: 205 (Generic RTP
|
|
13
|
+
0x87, 0xcd, 0x00, 0x03, // Type: 205 (Generic RTP feedback), Count: 7 (TLLEI) Length: 3
|
|
14
14
|
0x00, 0x00, 0x00, 0x01, // Sender SSRC: 0x00000001
|
|
15
15
|
0x03, 0x30, 0xbd, 0xee, // Media source SSRC: 0x0330bdee
|
|
16
16
|
0x00, 0x01, 0xaa, 0x55
|
|
@@ -10,7 +10,7 @@ SCENARIO("RTCP Feedback RTP TMMBR", "[rtcp][feedback-rtp][tmmb]")
|
|
|
10
10
|
// clang-format off
|
|
11
11
|
alignas(4) uint8_t buffer[] =
|
|
12
12
|
{
|
|
13
|
-
0x83, 0xcd, 0x00, 0x04, // Type: 205 (Generic RTP
|
|
13
|
+
0x83, 0xcd, 0x00, 0x04, // Type: 205 (Generic RTP feedback), Count: 8 (TMMBR) Length: 7
|
|
14
14
|
0x00, 0x00, 0x00, 0x01, // Sender SSRC: 0x00000001
|
|
15
15
|
0x03, 0x30, 0xbd, 0xee, // Media source SSRC: 0x0330bdee
|
|
16
16
|
0x02, 0xd0, 0x37, 0x02, // SSRC: 0x02d03702
|
|
@@ -489,7 +489,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
489
489
|
0x90, 0x01, 0x00, 0x08,
|
|
490
490
|
0x00, 0x00, 0x00, 0x04,
|
|
491
491
|
0x00, 0x00, 0x00, 0x05,
|
|
492
|
-
0xbe, 0xde, 0x00, 0x03, // Header
|
|
492
|
+
0xbe, 0xde, 0x00, 0x03, // Header extension
|
|
493
493
|
0x10, 0xaa, 0x21, 0xbb, // - id: 1, len: 1
|
|
494
494
|
0xff, 0x00, 0x00, 0x33, // - id: 2, len: 2
|
|
495
495
|
0xff, 0xff, 0xff, 0xff, // - id: 3, len: 4
|
|
@@ -672,7 +672,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
672
672
|
0x90, 0x01, 0x00, 0x08,
|
|
673
673
|
0x00, 0x00, 0x00, 0x04,
|
|
674
674
|
0x00, 0x00, 0x00, 0x05,
|
|
675
|
-
0x10, 0x00, 0x00, 0x04, // Header
|
|
675
|
+
0x10, 0x00, 0x00, 0x04, // Header extension
|
|
676
676
|
0x00, 0x00, 0x01, 0x00, // - id: 1, len: 0
|
|
677
677
|
0x02, 0x01, 0x42, 0x00, // - id: 2, len: 1
|
|
678
678
|
0x03, 0x02, 0x11, 0x22, // - id: 3, len: 2
|
|
@@ -1016,7 +1016,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1016
1016
|
0x90, 0x01, 0x00, 0x08,
|
|
1017
1017
|
0x00, 0x00, 0x00, 0x04,
|
|
1018
1018
|
0x00, 0x00, 0x00, 0x05,
|
|
1019
|
-
0xbe, 0xde, 0x00, 0x03, // Header
|
|
1019
|
+
0xbe, 0xde, 0x00, 0x03, // Header extension
|
|
1020
1020
|
0x10, 0xaa, 0x21, 0xbb, // - id: 1, len: 1
|
|
1021
1021
|
0xff, 0x00, 0x00, 0x33, // - id: 2, len: 2
|
|
1022
1022
|
0xff, 0xff, 0xff, 0xff, // - id: 3, len: 4
|
|
@@ -1070,13 +1070,13 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1070
1070
|
|
|
1071
1071
|
// Extensions:
|
|
1072
1072
|
//
|
|
1073
|
-
// Using One-Byte
|
|
1074
|
-
// - Header
|
|
1075
|
-
// - Header
|
|
1073
|
+
// Using One-Byte extensions:
|
|
1074
|
+
// - Header extension value length: 1 + 1 + 1 + 2 + 1 + 3 = 9 => 12 (padded)
|
|
1075
|
+
// - Header extension length: 4 + 12 = 16
|
|
1076
1076
|
//
|
|
1077
|
-
// Using Two-Bytes
|
|
1078
|
-
// - Header
|
|
1079
|
-
// - Header
|
|
1077
|
+
// Using Two-Bytes extensions:
|
|
1078
|
+
// - Header extension value length: 2 + 1 + 2 + 2 + 2 + 3 = 12
|
|
1079
|
+
// - Header extension length: 4 + 12 = 16
|
|
1080
1080
|
//
|
|
1081
1081
|
// Extension id 1.
|
|
1082
1082
|
rtpCommon::DataBuffer[0] = 11;
|
|
@@ -1106,7 +1106,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1106
1106
|
/*len*/ 3,
|
|
1107
1107
|
/*value*/ rtpCommon::DataBuffer + 3);
|
|
1108
1108
|
|
|
1109
|
-
// Add One-Byte
|
|
1109
|
+
// Add One-Byte extensions.
|
|
1110
1110
|
packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::OneByte, extensions);
|
|
1111
1111
|
|
|
1112
1112
|
packet->SetPayload(rtpCommon::DataBuffer, 10);
|
|
@@ -1349,7 +1349,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1349
1349
|
packet->GetPayload(), packet->GetPayloadLength(), rtpCommon::DataBuffer, 1) == true);
|
|
1350
1350
|
REQUIRE(packet->IsPaddedTo4Bytes() == true);
|
|
1351
1351
|
|
|
1352
|
-
/* Remove
|
|
1352
|
+
/* Remove header extension. */
|
|
1353
1353
|
|
|
1354
1354
|
packet->RemoveHeaderExtension();
|
|
1355
1355
|
|
|
@@ -1383,7 +1383,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1383
1383
|
packet->GetPayload(), packet->GetPayloadLength(), rtpCommon::DataBuffer, 1) == true);
|
|
1384
1384
|
REQUIRE(packet->IsPaddedTo4Bytes() == true);
|
|
1385
1385
|
|
|
1386
|
-
// Add Two-Bytes
|
|
1386
|
+
// Add Two-Bytes extensions.
|
|
1387
1387
|
packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::TwoBytes, extensions);
|
|
1388
1388
|
|
|
1389
1389
|
CHECK_RTP_PACKET(
|
|
@@ -1439,7 +1439,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1439
1439
|
|
|
1440
1440
|
std::vector<RTC::RTP::Packet::Extension> extensions;
|
|
1441
1441
|
|
|
1442
|
-
// Can fit into One-Byte type
|
|
1442
|
+
// Can fit into One-Byte type extensions.
|
|
1443
1443
|
extensions.assign(
|
|
1444
1444
|
{
|
|
1445
1445
|
{ RTC::RtpHeaderExtensionUri::Type::MID, 1, 1, rtpCommon::DataBuffer },
|
|
@@ -1448,7 +1448,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1448
1448
|
packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::Auto, extensions);
|
|
1449
1449
|
REQUIRE(packet->HasOneByteExtensions());
|
|
1450
1450
|
|
|
1451
|
-
// Requires Two-Bytes type
|
|
1451
|
+
// Requires Two-Bytes type extensions due to id > 14.
|
|
1452
1452
|
extensions.assign(
|
|
1453
1453
|
{
|
|
1454
1454
|
{ RTC::RtpHeaderExtensionUri::Type::ABS_SEND_TIME, 15, 2, rtpCommon::DataBuffer }
|
|
@@ -1456,7 +1456,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1456
1456
|
packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::Auto, extensions);
|
|
1457
1457
|
REQUIRE(packet->HasTwoBytesExtensions());
|
|
1458
1458
|
|
|
1459
|
-
// Requires Two-Bytes type
|
|
1459
|
+
// Requires Two-Bytes type extensions due to length 0.
|
|
1460
1460
|
extensions.assign(
|
|
1461
1461
|
{
|
|
1462
1462
|
{ RTC::RtpHeaderExtensionUri::Type::REPAIRED_RTP_STREAM_ID, 1, 0, rtpCommon::DataBuffer }
|
|
@@ -1464,7 +1464,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1464
1464
|
packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::Auto, extensions);
|
|
1465
1465
|
REQUIRE(packet->HasTwoBytesExtensions());
|
|
1466
1466
|
|
|
1467
|
-
// Requires Two-Bytes type
|
|
1467
|
+
// Requires Two-Bytes type extensions due to length > 16.
|
|
1468
1468
|
extensions.assign(
|
|
1469
1469
|
{
|
|
1470
1470
|
{ RTC::RtpHeaderExtensionUri::Type::TIME_OFFSET, 1, 17, rtpCommon::DataBuffer }
|
|
@@ -1595,7 +1595,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1595
1595
|
std::vector<RTC::RTP::Packet::Extension> extensions;
|
|
1596
1596
|
auto* d = rtpCommon::DataBuffer;
|
|
1597
1597
|
|
|
1598
|
-
// Invalid
|
|
1598
|
+
// Invalid extension id 0.
|
|
1599
1599
|
extensions.assign(
|
|
1600
1600
|
{
|
|
1601
1601
|
{ RTC::RtpHeaderExtensionUri::Type::MID, 0, 4, d },
|
|
@@ -1609,7 +1609,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1609
1609
|
packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::TwoBytes, extensions),
|
|
1610
1610
|
MediaSoupTypeError);
|
|
1611
1611
|
|
|
1612
|
-
// Invalid
|
|
1612
|
+
// Invalid extension id > 14 in One-Byte.
|
|
1613
1613
|
extensions.assign(
|
|
1614
1614
|
{
|
|
1615
1615
|
{ RTC::RtpHeaderExtensionUri::Type::VIDEO_ORIENTATION, 15, 2, d },
|
|
@@ -1622,7 +1622,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1622
1622
|
MediaSoupTypeError);
|
|
1623
1623
|
REQUIRE_NOTHROW(packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::TwoBytes, extensions));
|
|
1624
1624
|
|
|
1625
|
-
// Invalid
|
|
1625
|
+
// Invalid extension length 0 in One-Byte.
|
|
1626
1626
|
extensions.assign(
|
|
1627
1627
|
{
|
|
1628
1628
|
{ RTC::RtpHeaderExtensionUri::Type::MID, 3, 0, d },
|
|
@@ -1636,7 +1636,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1636
1636
|
MediaSoupTypeError);
|
|
1637
1637
|
REQUIRE_NOTHROW(packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::TwoBytes, extensions));
|
|
1638
1638
|
|
|
1639
|
-
// Invalid
|
|
1639
|
+
// Invalid extension length > 16 in One-Byte.
|
|
1640
1640
|
extensions.assign(
|
|
1641
1641
|
{
|
|
1642
1642
|
{ RTC::RtpHeaderExtensionUri::Type::MEDIASOUP_PACKET_ID, 3, 17, d },
|
|
@@ -1828,9 +1828,9 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
1828
1828
|
|
|
1829
1829
|
std::vector<RTC::RTP::Packet::Extension> extensions;
|
|
1830
1830
|
|
|
1831
|
-
// One-Byte
|
|
1832
|
-
// - Header
|
|
1833
|
-
// - Header
|
|
1831
|
+
// One-Byte extensions:
|
|
1832
|
+
// - Header extension value length: 1 + 1 + 1 + 2 + 1 + 3 = 9 => 12 (padded)
|
|
1833
|
+
// - Header extension length: 4 + 12 = 16
|
|
1834
1834
|
//
|
|
1835
1835
|
// clang-format off
|
|
1836
1836
|
uint8_t extension1[] =
|
|
@@ -2180,7 +2180,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
2180
2180
|
|
|
2181
2181
|
packet->SetBufferReleasedListener(std::addressof(packetBufferReleasedListener));
|
|
2182
2182
|
|
|
2183
|
-
// If we destroy the
|
|
2183
|
+
// If we destroy the packet it should invoke the listener.
|
|
2184
2184
|
packet.reset(nullptr);
|
|
2185
2185
|
|
|
2186
2186
|
REQUIRE(packetBufferReleased == true);
|
|
@@ -2206,14 +2206,14 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]")
|
|
|
2206
2206
|
|
|
2207
2207
|
packet->SetBufferReleasedListener(std::addressof(packetBufferReleasedListener));
|
|
2208
2208
|
|
|
2209
|
-
// If we serialize the
|
|
2209
|
+
// If we serialize the packet into another buffer it should invoke the
|
|
2210
2210
|
// listener.
|
|
2211
2211
|
packet->Serialize(rtpCommon::SerializeBuffer, sizeof(rtpCommon::SerializeBuffer));
|
|
2212
2212
|
|
|
2213
2213
|
REQUIRE(packetBufferReleased == true);
|
|
2214
2214
|
|
|
2215
2215
|
// NOTE: We need to unset the buffer released listener because once the
|
|
2216
|
-
// unique_ptr of the
|
|
2216
|
+
// unique_ptr of the packet gets out of the scope, the packet will be
|
|
2217
2217
|
// deallocated and will invoke the buffer released listener, which at
|
|
2218
2218
|
// that time is already out of the scope (it's lifetime ended) so it's
|
|
2219
2219
|
// been destroyed.
|
|
@@ -49,7 +49,7 @@ SCENARIO("RTP SharedPacket", "[rtp][sharedpacket]")
|
|
|
49
49
|
|
|
50
50
|
SECTION("constructor with packet and copy constructor")
|
|
51
51
|
{
|
|
52
|
-
// Create sharedPacket1 using constructor with a
|
|
52
|
+
// Create sharedPacket1 using constructor with a packet.
|
|
53
53
|
RTC::RTP::SharedPacket sharedPacket1(packetA);
|
|
54
54
|
|
|
55
55
|
REQUIRE(sharedPacket1.HasPacket());
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
namespace rtpCommon
|
|
5
5
|
{
|
|
6
|
-
// NOTE: Buffers must be 4-byte aligned since RTP
|
|
6
|
+
// NOTE: Buffers must be 4-byte aligned since RTP packet parsing casts them
|
|
7
7
|
// to structs (e.g. FixedHeader, HeaderExtension) that require 4-byte
|
|
8
8
|
// alignment. Without this, accessing multi-byte fields would be undefined
|
|
9
9
|
// behavior on strict-alignment architectures.
|
|
@@ -79,11 +79,11 @@ SCENARIO("SCTP Negotiated Capabilities", "[sctp][negotiatedcapabilities]")
|
|
|
79
79
|
auto* remoteSupportedExtensionsParameter =
|
|
80
80
|
remoteChunk->BuildParameterInPlace<RTC::SCTP::SupportedExtensionsParameter>();
|
|
81
81
|
|
|
82
|
-
// NOTE: Missing
|
|
83
|
-
// Forward-TSN-Supported
|
|
84
|
-
// NOTE: Missing
|
|
82
|
+
// NOTE: Missing FORWARD-TSN, but peer announced support for it via
|
|
83
|
+
// Forward-TSN-Supported parameter negotiation).
|
|
84
|
+
// NOTE: Missing RE-CONFIG (needed for Partial Reliability Extension
|
|
85
85
|
// negotiation).
|
|
86
|
-
// NOTE: Missing
|
|
86
|
+
// NOTE: Missing I-FORWARD-TSN (needed for Message Interleaving negotiation).
|
|
87
87
|
remoteSupportedExtensionsParameter->AddChunkType(RTC::SCTP::Chunk::ChunkType::I_DATA);
|
|
88
88
|
remoteSupportedExtensionsParameter->Consolidate();
|
|
89
89
|
|
|
@@ -137,8 +137,8 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]")
|
|
|
137
137
|
0xEE, 0b00001100, 0x00, 0x07,
|
|
138
138
|
// Unknown data: 0xAABBCC, 1 byte of padding
|
|
139
139
|
0xAA, 0xBB, 0xCC, 0x00,
|
|
140
|
-
// Chunk 3: Type:5 (
|
|
141
|
-
// NOTE: Chunk
|
|
140
|
+
// Chunk 3: Type:5 (HEARTBEAT-ACK), Flags:0b00000000, Length: 10
|
|
141
|
+
// NOTE: Chunk length field must exclude padding of the last parameter.
|
|
142
142
|
0x05, 0b00000000, 0x00, 0x0A,
|
|
143
143
|
// Parameter 1: Type:1 (HEARBEAT_INFO), Length: 6
|
|
144
144
|
0x00, 0x01, 0x00, 0x06,
|
|
@@ -521,7 +521,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]")
|
|
|
521
521
|
|
|
522
522
|
REQUIRE(packet->GetFirstChunkOfType<RTC::SCTP::InitChunk>() == nullptr);
|
|
523
523
|
|
|
524
|
-
/* Modify the
|
|
524
|
+
/* Modify the packet and add chunks. */
|
|
525
525
|
|
|
526
526
|
packet->SetSourcePort(1000);
|
|
527
527
|
packet->SetDestinationPort(6000);
|
|
@@ -537,7 +537,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]")
|
|
|
537
537
|
chunk1->SetNumberOfInboundStreams(22200);
|
|
538
538
|
chunk1->SetInitialTsn(14141414);
|
|
539
539
|
|
|
540
|
-
// Parameter 1.1:
|
|
540
|
+
// Parameter 1.1: IPV4-ADDRESS, length: 8 bytes.
|
|
541
541
|
// NOLINTNEXTLINE (readability-identifier-naming)
|
|
542
542
|
auto* parameter1_1 = chunk1->BuildParameterInPlace<RTC::SCTP::IPv4AddressParameter>();
|
|
543
543
|
|
|
@@ -549,7 +549,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]")
|
|
|
549
549
|
|
|
550
550
|
REQUIRE(chunk1->GetFirstParameterOfType<RTC::SCTP::IPv4AddressParameter>() == parameter1_1);
|
|
551
551
|
|
|
552
|
-
// Parameter 1.2:
|
|
552
|
+
// Parameter 1.2: COOKIE-PRESERVATIVE, length: 8 bytes.
|
|
553
553
|
// NOLINTNEXTLINE (readability-identifier-naming)
|
|
554
554
|
auto* parameter1_2 = chunk1->BuildParameterInPlace<RTC::SCTP::CookiePreservativeParameter>();
|
|
555
555
|
|
|
@@ -558,7 +558,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]")
|
|
|
558
558
|
|
|
559
559
|
REQUIRE(chunk1->GetFirstParameterOfType<RTC::SCTP::CookiePreservativeParameter>() == parameter1_2);
|
|
560
560
|
|
|
561
|
-
// Consolidate
|
|
561
|
+
// Consolidate chunk 1 after consolidating its parameters 1.1 and 1.2.
|
|
562
562
|
chunk1->Consolidate();
|
|
563
563
|
|
|
564
564
|
REQUIRE(chunk1->GetFirstParameterOfType<RTC::SCTP::IPv4AddressParameter>() == parameter1_1);
|
|
@@ -566,10 +566,10 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]")
|
|
|
566
566
|
|
|
567
567
|
REQUIRE(packet->GetFirstChunkOfType<RTC::SCTP::InitChunk>() == chunk1);
|
|
568
568
|
|
|
569
|
-
// Chunk 2:
|
|
569
|
+
// Chunk 2: HEARTBEAT-REQUEST, length: 4 bytes.
|
|
570
570
|
auto* chunk2 = packet->BuildChunkInPlace<RTC::SCTP::HeartbeatRequestChunk>();
|
|
571
571
|
|
|
572
|
-
// Parameter 2.1:
|
|
572
|
+
// Parameter 2.1: HEARTBEAT-INFO, length: 4 bytes.
|
|
573
573
|
// NOLINTNEXTLINE (readability-identifier-naming)
|
|
574
574
|
auto* parameter2_1 = chunk2->BuildParameterInPlace<RTC::SCTP::HeartbeatInfoParameter>();
|
|
575
575
|
|
|
@@ -581,7 +581,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]")
|
|
|
581
581
|
|
|
582
582
|
std::memset(sctpCommon::DataBuffer, 0xFF, 3);
|
|
583
583
|
|
|
584
|
-
// Consolidate the
|
|
584
|
+
// Consolidate the chunk after consolidating its parameters.
|
|
585
585
|
chunk2->Consolidate();
|
|
586
586
|
|
|
587
587
|
REQUIRE(chunk2->GetFirstParameterOfType<RTC::SCTP::HeartbeatInfoParameter>() == parameter2_1);
|
|
@@ -614,7 +614,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]")
|
|
|
614
614
|
/*hasValidCrc32cChecksum*/ true,
|
|
615
615
|
/*chunksCount*/ 2);
|
|
616
616
|
|
|
617
|
-
/* Serialize the
|
|
617
|
+
/* Serialize the packet. */
|
|
618
618
|
|
|
619
619
|
packet->Serialize(sctpCommon::SerializeBuffer, packet->GetLength());
|
|
620
620
|
|
|
@@ -635,7 +635,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]")
|
|
|
635
635
|
REQUIRE(packet->GetFirstChunkOfType<RTC::SCTP::InitChunk>() == chunk1);
|
|
636
636
|
REQUIRE(packet->GetFirstChunkOfType<RTC::SCTP::HeartbeatRequestChunk>() == chunk2);
|
|
637
637
|
|
|
638
|
-
/* Clone the
|
|
638
|
+
/* Clone the packet. */
|
|
639
639
|
|
|
640
640
|
packet.reset(packet->Clone(sctpCommon::CloneBuffer, packet->GetLength()));
|
|
641
641
|
|
|
@@ -759,7 +759,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]")
|
|
|
759
759
|
packet->SetVerificationTag(3);
|
|
760
760
|
packet->SetChecksum(4);
|
|
761
761
|
|
|
762
|
-
// 4 bytes
|
|
762
|
+
// 4 bytes chunk.
|
|
763
763
|
auto* chunk1 = RTC::SCTP::ShutdownCompleteChunk::Factory(sctpCommon::FactoryBuffer + 1000, 1000);
|
|
764
764
|
|
|
765
765
|
chunk1->SetT(true);
|
|
@@ -767,11 +767,11 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]")
|
|
|
767
767
|
packet->AddChunk(chunk1);
|
|
768
768
|
|
|
769
769
|
REQUIRE(packet->GetFirstChunkOfType<RTC::SCTP::ShutdownCompleteChunk>() != nullptr);
|
|
770
|
-
// NOTE: The stored
|
|
770
|
+
// NOTE: The stored chunk is not the same than the given one since it's
|
|
771
771
|
// internally cloned.
|
|
772
772
|
REQUIRE(packet->GetFirstChunkOfType<RTC::SCTP::ShutdownCompleteChunk>() != chunk1);
|
|
773
773
|
|
|
774
|
-
// Once added, we can delete the
|
|
774
|
+
// Once added, we can delete the chunk.
|
|
775
775
|
delete chunk1;
|
|
776
776
|
|
|
777
777
|
// Packet length must be:
|
|
@@ -19,7 +19,7 @@ SCENARIO("SCTP Abort Association Chunk (6)", "[serializable][sctp][chunk]")
|
|
|
19
19
|
{
|
|
20
20
|
// Type:6 (ABORT), Flags:0b00000000, Length: 12
|
|
21
21
|
0x06, 0b00000001, 0x00, 0x0C,
|
|
22
|
-
// Error Cause 3: Code:1 (
|
|
22
|
+
// Error Cause 3: Code:1 (STALE-COOKIE), Length: 8
|
|
23
23
|
0x00, 0x03, 0x00, 0x08,
|
|
24
24
|
// Measure of Staleness: 0x12345678
|
|
25
25
|
0x12, 0x34, 0x56, 0x78,
|
|
@@ -152,7 +152,7 @@ SCENARIO("SCTP Abort Association Chunk (6)", "[serializable][sctp][chunk]")
|
|
|
152
152
|
|
|
153
153
|
REQUIRE(chunk->GetT() == false);
|
|
154
154
|
|
|
155
|
-
/* Modify it and add
|
|
155
|
+
/* Modify it and add error causes. */
|
|
156
156
|
|
|
157
157
|
chunk->SetT(true);
|
|
158
158
|
|
|
@@ -236,7 +236,7 @@ SCENARIO("SCTP Abort Association Chunk (6)", "[serializable][sctp][chunk]")
|
|
|
236
236
|
|
|
237
237
|
chunk->SetT(true);
|
|
238
238
|
|
|
239
|
-
// 8 bytes
|
|
239
|
+
// 8 bytes error cause.
|
|
240
240
|
auto* errorCause1 = RTC::SCTP::StaleCookieErrorCause::Factory(
|
|
241
241
|
sctpCommon::FactoryBuffer + 1000, sizeof(sctpCommon::FactoryBuffer));
|
|
242
242
|
|
|
@@ -244,7 +244,7 @@ SCENARIO("SCTP Abort Association Chunk (6)", "[serializable][sctp][chunk]")
|
|
|
244
244
|
|
|
245
245
|
chunk->AddErrorCause(errorCause1);
|
|
246
246
|
|
|
247
|
-
// Once added, we can delete the
|
|
247
|
+
// Once added, we can delete the error cause.
|
|
248
248
|
delete errorCause1;
|
|
249
249
|
|
|
250
250
|
// Chunk length must be:
|
|
@@ -15,7 +15,7 @@ SCENARIO("SCTP Cookie Acknowledgement Chunk (11)", "[serializable][sctp][chunk]"
|
|
|
15
15
|
// clang-format off
|
|
16
16
|
alignas(4) uint8_t buffer[] =
|
|
17
17
|
{
|
|
18
|
-
// Type:11 (
|
|
18
|
+
// Type:11 (COOKIE-ACK), Flags:0x00000001, T: 1, Length: 4
|
|
19
19
|
0x0B, 0b00000101, 0x00, 0x04,
|
|
20
20
|
// Extra bytes that should be ignored
|
|
21
21
|
0xAA
|
|
@@ -15,7 +15,7 @@ SCENARIO("SCTP Cookie Echo Chunk (10)", "[serializable][sctp][chunk]")
|
|
|
15
15
|
// clang-format off
|
|
16
16
|
alignas(4) uint8_t buffer[] =
|
|
17
17
|
{
|
|
18
|
-
// Type:A (
|
|
18
|
+
// Type:A (COOKIE-ECHO), Flags: 0b00000000, Length: 9
|
|
19
19
|
0x0A, 0b00000000, 0x00, 0x09,
|
|
20
20
|
// Cookie: 0x1122334455,
|
|
21
21
|
0x11, 0x22, 0x33, 0x44,
|