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
|
@@ -96,7 +96,7 @@ namespace RTC
|
|
|
96
96
|
auto packet = this->tcbContext->CreatePacket();
|
|
97
97
|
auto* heartbeatAckChunk = packet->BuildChunkInPlace<HeartbeatAckChunk>();
|
|
98
98
|
|
|
99
|
-
// Here we have to extract all
|
|
99
|
+
// Here we have to extract all parameters from receivedHeartbeatRequestChunk
|
|
100
100
|
// and add them into heartbeatAckChunk.
|
|
101
101
|
for (auto it = receivedHeartbeatRequestChunk->ParametersBegin();
|
|
102
102
|
it != receivedHeartbeatRequestChunk->ParametersEnd();
|
|
@@ -126,7 +126,7 @@ namespace RTC
|
|
|
126
126
|
{
|
|
127
127
|
this->associationListener.OnAssociationError(
|
|
128
128
|
Types::ErrorKind::PARSE_FAILED,
|
|
129
|
-
"ignoring
|
|
129
|
+
"ignoring HEARTBEAT-ACK chunk without Heartbeat Info parameter");
|
|
130
130
|
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
@@ -156,14 +156,14 @@ namespace RTC
|
|
|
156
156
|
{
|
|
157
157
|
const uint64_t rttMs = nowMs - createdAtMs;
|
|
158
158
|
|
|
159
|
-
MS_DEBUG_DEV("valid
|
|
159
|
+
MS_DEBUG_DEV("valid HEARTBEAT-ACK chunk received, calling ObserveRttMs(%" PRIu64 ")", rttMs);
|
|
160
160
|
|
|
161
161
|
this->tcbContext->ObserveRttMs(rttMs);
|
|
162
162
|
}
|
|
163
163
|
else
|
|
164
164
|
{
|
|
165
165
|
MS_WARN_DEV(
|
|
166
|
-
"ignoring received
|
|
166
|
+
"ignoring received HEARTBEAT-ACK chunk with invalid info content [createdAtMs:%" PRIu64
|
|
167
167
|
", nowMs:%" PRIu64 "]",
|
|
168
168
|
createdAtMs,
|
|
169
169
|
nowMs);
|
|
@@ -182,7 +182,7 @@ namespace RTC
|
|
|
182
182
|
|
|
183
183
|
if (!this->tcbContext->IsAssociationEstablished())
|
|
184
184
|
{
|
|
185
|
-
MS_DEBUG_DEV("won't send
|
|
185
|
+
MS_DEBUG_DEV("won't send HEARTBEAT-REQUEST when SCTP association is not established");
|
|
186
186
|
|
|
187
187
|
return;
|
|
188
188
|
}
|
|
@@ -205,7 +205,7 @@ namespace RTC
|
|
|
205
205
|
heartbeatInfoParameter->Consolidate();
|
|
206
206
|
heartbeatRequestChunk->Consolidate();
|
|
207
207
|
|
|
208
|
-
MS_DEBUG_DEV("sending
|
|
208
|
+
MS_DEBUG_DEV("sending HEARTBEAT-REQUEST chunk with info content [nowMs:%" PRIu64 "]", nowMs);
|
|
209
209
|
|
|
210
210
|
this->tcbContext->SendPacket(packet.get());
|
|
211
211
|
}
|
|
@@ -35,7 +35,7 @@ namespace RTC
|
|
|
35
35
|
|
|
36
36
|
// Partial Reliability Extension is negotiated if we desire it and
|
|
37
37
|
// peer announces support via Forward-TSN-Supported Parameter or via
|
|
38
|
-
// Supported
|
|
38
|
+
// Supported extensions parameter.
|
|
39
39
|
negotiatedCapabilities.partialReliability =
|
|
40
40
|
sctpOptions.enablePartialReliability &&
|
|
41
41
|
(remoteForwardTsnSupportedParameter ||
|
|
@@ -43,14 +43,14 @@ namespace RTC
|
|
|
43
43
|
remoteSupportedExtensionsParameter->IncludesChunkType(Chunk::ChunkType::FORWARD_TSN)));
|
|
44
44
|
|
|
45
45
|
// Message Interleaving is negotiated if we desire it and peer
|
|
46
|
-
// announces support via Supported Extensions
|
|
46
|
+
// announces support via Supported Extensions parameter.
|
|
47
47
|
negotiatedCapabilities.messageInterleaving =
|
|
48
48
|
sctpOptions.enableMessageInterleaving && remoteSupportedExtensionsParameter &&
|
|
49
49
|
remoteSupportedExtensionsParameter->IncludesChunkType(Chunk::ChunkType::I_DATA) &&
|
|
50
50
|
remoteSupportedExtensionsParameter->IncludesChunkType(Chunk::ChunkType::I_FORWARD_TSN);
|
|
51
51
|
|
|
52
52
|
// Stream Re-Configuration is negotiated if peer announces support via
|
|
53
|
-
// Supported
|
|
53
|
+
// Supported extensions parameter.
|
|
54
54
|
negotiatedCapabilities.reConfig =
|
|
55
55
|
remoteSupportedExtensionsParameter &&
|
|
56
56
|
remoteSupportedExtensionsParameter->IncludesChunkType(Chunk::ChunkType::RE_CONFIG);
|
|
@@ -188,7 +188,7 @@ namespace RTC
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
MS_WARN_TAG(sctp, "invalid set of RE-CONFIG
|
|
191
|
+
MS_WARN_TAG(sctp, "invalid set of RE-CONFIG parameters");
|
|
192
192
|
|
|
193
193
|
return false;
|
|
194
194
|
}
|
|
@@ -241,7 +241,7 @@ namespace RTC
|
|
|
241
241
|
}
|
|
242
242
|
else if (reqSeqNbr != this->lastProcessedReqSeqNbr.GetNextValue())
|
|
243
243
|
{
|
|
244
|
-
// Too old, too new, from wrong
|
|
244
|
+
// Too old, too new, from wrong association, etc.
|
|
245
245
|
MS_WARN_TAG(sctp, "bad reqSeqNbr: %" PRIu32, reqSeqNbr.Wrap());
|
|
246
246
|
|
|
247
247
|
return ReqSeqNbrValidationResult::BAD_SEQUENCE_NUMBER;
|
|
@@ -290,13 +290,13 @@ namespace RTC
|
|
|
290
290
|
{
|
|
291
291
|
const auto packet = CreatePacket();
|
|
292
292
|
|
|
293
|
-
// Only add control
|
|
294
|
-
// multiple
|
|
293
|
+
// Only add control chunks to the first packet that is sent, if sending
|
|
294
|
+
// multiple packets in one go (as allowed by the congestion window).
|
|
295
295
|
if (packetIdx == 0)
|
|
296
296
|
{
|
|
297
297
|
if (addCookieAckChunk)
|
|
298
298
|
{
|
|
299
|
-
MS_DEBUG_DEV("adding
|
|
299
|
+
MS_DEBUG_DEV("adding COOKIE-ACK chunk to the packet");
|
|
300
300
|
|
|
301
301
|
const auto* cookieAckChunk = packet->BuildChunkInPlace<CookieAckChunk>();
|
|
302
302
|
|
|
@@ -312,7 +312,7 @@ namespace RTC
|
|
|
312
312
|
if (packet->GetChunksCount() > 0)
|
|
313
313
|
{
|
|
314
314
|
MS_THROW_ERROR(
|
|
315
|
-
"
|
|
315
|
+
"packet must have no chunks [addCookieAckChunk:%s]",
|
|
316
316
|
addCookieAckChunk ? "true" : "no");
|
|
317
317
|
}
|
|
318
318
|
|
|
@@ -411,7 +411,7 @@ namespace RTC
|
|
|
411
411
|
{
|
|
412
412
|
MS_TRACE();
|
|
413
413
|
|
|
414
|
-
// In the
|
|
414
|
+
// In the COOKIE-ECHO state, let the T1-COOKIE timer trigger
|
|
415
415
|
// retransmissions, to avoid having two timers doing that.
|
|
416
416
|
if (this->remoteStateCookie.has_value())
|
|
417
417
|
{
|
|
@@ -44,27 +44,27 @@ namespace RTC
|
|
|
44
44
|
/* Class variables. */
|
|
45
45
|
|
|
46
46
|
// clang-format off
|
|
47
|
-
const
|
|
47
|
+
const ankerl::unordered_dense::map<Chunk::ChunkType, std::string> Chunk::ChunkType2String =
|
|
48
48
|
{
|
|
49
49
|
{ Chunk::ChunkType::DATA, "DATA" },
|
|
50
50
|
{ Chunk::ChunkType::INIT, "INIT" },
|
|
51
|
-
{ Chunk::ChunkType::INIT_ACK, "
|
|
51
|
+
{ Chunk::ChunkType::INIT_ACK, "INIT-ACK" },
|
|
52
52
|
{ Chunk::ChunkType::SACK, "SACK" },
|
|
53
|
-
{ Chunk::ChunkType::HEARTBEAT_REQUEST, "
|
|
54
|
-
{ Chunk::ChunkType::HEARTBEAT_ACK, "
|
|
53
|
+
{ Chunk::ChunkType::HEARTBEAT_REQUEST, "HEARTBEAT-REQUEST" },
|
|
54
|
+
{ Chunk::ChunkType::HEARTBEAT_ACK, "HEARTBEAT-ACK" },
|
|
55
55
|
{ Chunk::ChunkType::ABORT, "ABORT" },
|
|
56
56
|
{ Chunk::ChunkType::SHUTDOWN, "SHUTDOWN" },
|
|
57
|
-
{ Chunk::ChunkType::SHUTDOWN_ACK, "
|
|
58
|
-
{ Chunk::ChunkType::OPERATION_ERROR, "
|
|
59
|
-
{ Chunk::ChunkType::COOKIE_ECHO, "
|
|
60
|
-
{ Chunk::ChunkType::COOKIE_ACK, "
|
|
57
|
+
{ Chunk::ChunkType::SHUTDOWN_ACK, "SHUTDOWN-ACK" },
|
|
58
|
+
{ Chunk::ChunkType::OPERATION_ERROR, "OPERATION-ERROR" },
|
|
59
|
+
{ Chunk::ChunkType::COOKIE_ECHO, "COOKIE-ECHO" },
|
|
60
|
+
{ Chunk::ChunkType::COOKIE_ACK, "COOKIE-ACK" },
|
|
61
61
|
{ Chunk::ChunkType::ECNE, "ECNE" },
|
|
62
62
|
{ Chunk::ChunkType::CWR, "CWR" },
|
|
63
|
-
{ Chunk::ChunkType::SHUTDOWN_COMPLETE, "
|
|
64
|
-
{ Chunk::ChunkType::FORWARD_TSN, "
|
|
65
|
-
{ Chunk::ChunkType::RE_CONFIG, "
|
|
66
|
-
{ Chunk::ChunkType::I_DATA, "
|
|
67
|
-
{ Chunk::ChunkType::I_FORWARD_TSN, "
|
|
63
|
+
{ Chunk::ChunkType::SHUTDOWN_COMPLETE, "SHUTDOWN-COMPLETE" },
|
|
64
|
+
{ Chunk::ChunkType::FORWARD_TSN, "FORWARD-TSN" },
|
|
65
|
+
{ Chunk::ChunkType::RE_CONFIG, "RE-CONFIG" },
|
|
66
|
+
{ Chunk::ChunkType::I_DATA, "I-DATA" },
|
|
67
|
+
{ Chunk::ChunkType::I_FORWARD_TSN, "I-FORWARD-TSN" },
|
|
68
68
|
};
|
|
69
69
|
// clang-format on
|
|
70
70
|
|
|
@@ -117,7 +117,7 @@ namespace RTC
|
|
|
117
117
|
MS_TRACE();
|
|
118
118
|
|
|
119
119
|
// NOTE: Here we cannot check CanHaveParameters() or CanHaveErrorCauses()
|
|
120
|
-
// because this is the destructor of
|
|
120
|
+
// because this is the destructor of chunk so the subclass has been
|
|
121
121
|
// already destroyed (its destructor runs first).
|
|
122
122
|
|
|
123
123
|
for (const auto* parameter : this->parameters)
|
|
@@ -170,15 +170,15 @@ namespace RTC
|
|
|
170
170
|
|
|
171
171
|
const size_t previousLength = GetLength();
|
|
172
172
|
|
|
173
|
-
// This will update the total length and
|
|
173
|
+
// This will update the total length and length field of the chunk.
|
|
174
174
|
// NOTE: It may throw.
|
|
175
175
|
AddItem(parameter);
|
|
176
176
|
|
|
177
|
-
// Let's append the
|
|
177
|
+
// Let's append the parameter at the end of existing parameters.
|
|
178
178
|
auto* clonedParameter =
|
|
179
179
|
parameter->Clone(const_cast<uint8_t*>(GetBuffer()) + previousLength, parameter->GetLength());
|
|
180
180
|
|
|
181
|
-
// Add the
|
|
181
|
+
// Add the parameter to the list.
|
|
182
182
|
this->parameters.push_back(clonedParameter);
|
|
183
183
|
}
|
|
184
184
|
|
|
@@ -191,11 +191,11 @@ namespace RTC
|
|
|
191
191
|
|
|
192
192
|
const size_t previousLength = GetLength();
|
|
193
193
|
|
|
194
|
-
// This will update the total length and
|
|
194
|
+
// This will update the total length and length field of the chunk.
|
|
195
195
|
// NOTE: It may throw.
|
|
196
196
|
AddItem(errorCause);
|
|
197
197
|
|
|
198
|
-
// Let's append the
|
|
198
|
+
// Let's append the error cause at the end of existing error causes.
|
|
199
199
|
auto* clonedErrorCause = errorCause->Clone(
|
|
200
200
|
const_cast<uint8_t*>(GetBuffer()) + previousLength, errorCause->GetLength());
|
|
201
201
|
|
|
@@ -282,7 +282,7 @@ namespace RTC
|
|
|
282
282
|
{
|
|
283
283
|
MS_TRACE();
|
|
284
284
|
|
|
285
|
-
// Soft clone
|
|
285
|
+
// Soft clone parameters into the given chunk.
|
|
286
286
|
if (CanHaveParameters())
|
|
287
287
|
{
|
|
288
288
|
for (auto* parameter : this->parameters)
|
|
@@ -295,7 +295,7 @@ namespace RTC
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
// Soft clone
|
|
298
|
+
// Soft clone error causes into the given chunk.
|
|
299
299
|
if (CanHaveErrorCauses())
|
|
300
300
|
{
|
|
301
301
|
for (auto* errorCause : this->errorCauses)
|
|
@@ -327,16 +327,16 @@ namespace RTC
|
|
|
327
327
|
|
|
328
328
|
AssertCanHaveParameters();
|
|
329
329
|
|
|
330
|
-
// Here we assume that the
|
|
331
|
-
// GetLength() returns the fixed minimum length of the specific
|
|
330
|
+
// Here we assume that the chunk buffer has been validated and
|
|
331
|
+
// GetLength() returns the fixed minimum length of the specific chunk
|
|
332
332
|
// subclass, so GetBuffer() + GetLength() points to the beginning of the
|
|
333
|
-
// potential
|
|
334
|
-
// both
|
|
333
|
+
// potential parameters. And of course we assume that a chunk cannot have
|
|
334
|
+
// both parameters and error causes.
|
|
335
335
|
auto* ptr = const_cast<uint8_t*>(GetBuffer()) + GetLength();
|
|
336
336
|
|
|
337
|
-
// Here we assume that the
|
|
338
|
-
// reliable. We want to be ready for
|
|
339
|
-
// possible padding of the last
|
|
337
|
+
// Here we assume that the chunk has been validated so length field is
|
|
338
|
+
// reliable. We want to be ready for length field to include or not the
|
|
339
|
+
// possible padding of the last parameter (as per RFC recommendation). In
|
|
340
340
|
// fact, we rely on parameter->GetLength() while parsing the buffer so we
|
|
341
341
|
// want to provide each Parameter::StrictParse() call with a 4-bytes
|
|
342
342
|
// padded buffer length.
|
|
@@ -345,10 +345,10 @@ namespace RTC
|
|
|
345
345
|
while (ptr < end)
|
|
346
346
|
{
|
|
347
347
|
// The remaining length in the given length is the potential buffer
|
|
348
|
-
// length of the
|
|
348
|
+
// length of the parameter.
|
|
349
349
|
const size_t parameterMaxBufferLength = end - ptr;
|
|
350
350
|
|
|
351
|
-
// Here we must anticipate the type of each
|
|
351
|
+
// Here we must anticipate the type of each parameter to use its
|
|
352
352
|
// appropriate parser.
|
|
353
353
|
Parameter::ParameterType parameterType;
|
|
354
354
|
uint16_t parameterLength;
|
|
@@ -357,7 +357,7 @@ namespace RTC
|
|
|
357
357
|
if (!Parameter::IsParameter(
|
|
358
358
|
ptr, parameterMaxBufferLength, parameterType, parameterLength, padding))
|
|
359
359
|
{
|
|
360
|
-
MS_WARN_TAG(sctp, "not an SCTP
|
|
360
|
+
MS_WARN_TAG(sctp, "not an SCTP parameter");
|
|
361
361
|
|
|
362
362
|
return false;
|
|
363
363
|
}
|
|
@@ -534,16 +534,16 @@ namespace RTC
|
|
|
534
534
|
|
|
535
535
|
AssertCanHaveErrorCauses();
|
|
536
536
|
|
|
537
|
-
// Here we assume that the
|
|
538
|
-
// returns the fixed minimum length of the specific
|
|
537
|
+
// Here we assume that the chunk buffer has been validated and GetLength()
|
|
538
|
+
// returns the fixed minimum length of the specific chunk subclass, so
|
|
539
539
|
// GetBuffer() + GetLength() points to the beginning of the potential
|
|
540
|
-
//
|
|
541
|
-
//
|
|
540
|
+
// error causes. And of course we assume that a chunk cannot have both
|
|
541
|
+
// parameters and error causes.
|
|
542
542
|
auto* ptr = const_cast<uint8_t*>(GetBuffer()) + GetLength();
|
|
543
543
|
|
|
544
|
-
// Here we assume that the
|
|
545
|
-
// reliable. We want to be ready for
|
|
546
|
-
// possible padding of the last
|
|
544
|
+
// Here we assume that the chunk has been validated so length field is
|
|
545
|
+
// reliable. We want to be ready for length field to include or not the
|
|
546
|
+
// possible padding of the last error cause (as per RFCrecommendation).
|
|
547
547
|
// In fact, we rely on errorCause->GetLength() while parsing the buffer
|
|
548
548
|
// so we want to provide each ErrorCause::StrictParse() call with a
|
|
549
549
|
// 4-bytes padded buffer length.
|
|
@@ -552,10 +552,10 @@ namespace RTC
|
|
|
552
552
|
while (ptr < end)
|
|
553
553
|
{
|
|
554
554
|
// The remaining length in the given length is the potential buffer
|
|
555
|
-
// length of the
|
|
555
|
+
// length of the error cause.
|
|
556
556
|
const size_t errorCauseMaxBufferLength = end - ptr;
|
|
557
557
|
|
|
558
|
-
// Here we must anticipate the type of each
|
|
558
|
+
// Here we must anticipate the type of each error cause to use its
|
|
559
559
|
// appropriate parser.
|
|
560
560
|
ErrorCause::ErrorCauseCode causeCode;
|
|
561
561
|
uint16_t causeLength;
|
|
@@ -563,7 +563,7 @@ namespace RTC
|
|
|
563
563
|
|
|
564
564
|
if (!ErrorCause::IsErrorCause(ptr, errorCauseMaxBufferLength, causeCode, causeLength, padding))
|
|
565
565
|
{
|
|
566
|
-
MS_WARN_TAG(sctp, "not an SCTP
|
|
566
|
+
MS_WARN_TAG(sctp, "not an SCTP error cause");
|
|
567
567
|
|
|
568
568
|
return false;
|
|
569
569
|
}
|
|
@@ -716,22 +716,22 @@ namespace RTC
|
|
|
716
716
|
|
|
717
717
|
this->needsConsolidation = true;
|
|
718
718
|
|
|
719
|
-
// When the application completes the
|
|
719
|
+
// When the application completes the parameter it must call
|
|
720
720
|
// `parameter->Consolidate()` and that will trigger this event.
|
|
721
721
|
parameter->SetConsolidatedListener(
|
|
722
722
|
[this, parameter]()
|
|
723
723
|
{
|
|
724
724
|
try
|
|
725
725
|
{
|
|
726
|
-
// Fix buffer length assigned to the
|
|
726
|
+
// Fix buffer length assigned to the parameter.
|
|
727
727
|
// NOTE: It may throw.
|
|
728
728
|
parameter->SetBufferLength(parameter->GetLength());
|
|
729
729
|
|
|
730
|
-
// This will update the total length and
|
|
730
|
+
// This will update the total length and length field of the chunk.
|
|
731
731
|
// NOTE: It may throw.
|
|
732
732
|
AddItem(parameter);
|
|
733
733
|
|
|
734
|
-
// Add the
|
|
734
|
+
// Add the parameter to the list.
|
|
735
735
|
this->parameters.push_back(parameter);
|
|
736
736
|
|
|
737
737
|
this->needsConsolidation = false;
|
|
@@ -751,21 +751,21 @@ namespace RTC
|
|
|
751
751
|
|
|
752
752
|
this->needsConsolidation = true;
|
|
753
753
|
|
|
754
|
-
// When the application completes the
|
|
754
|
+
// When the application completes the error cause it must call
|
|
755
755
|
// `errorCause->Consolidate()` and that will trigger this event.
|
|
756
756
|
errorCause->SetConsolidatedListener(
|
|
757
757
|
[this, errorCause]()
|
|
758
758
|
{
|
|
759
759
|
try
|
|
760
760
|
{
|
|
761
|
-
// Fix buffer length assigned to the
|
|
761
|
+
// Fix buffer length assigned to the error cause.
|
|
762
762
|
errorCause->SetBufferLength(errorCause->GetLength());
|
|
763
763
|
|
|
764
|
-
// This will update the total length and
|
|
764
|
+
// This will update the total length and length field of the chunk.
|
|
765
765
|
// NOTE: It may throw.
|
|
766
766
|
AddItem(errorCause);
|
|
767
767
|
|
|
768
|
-
// Add the
|
|
768
|
+
// Add the error cause to the list.
|
|
769
769
|
this->errorCauses.push_back(errorCause);
|
|
770
770
|
|
|
771
771
|
this->needsConsolidation = false;
|
|
@@ -785,7 +785,7 @@ namespace RTC
|
|
|
785
785
|
|
|
786
786
|
if (!CanHaveParameters())
|
|
787
787
|
{
|
|
788
|
-
MS_THROW_ERROR("this
|
|
788
|
+
MS_THROW_ERROR("this chunk class cannot have parameters");
|
|
789
789
|
}
|
|
790
790
|
}
|
|
791
791
|
|
|
@@ -795,7 +795,7 @@ namespace RTC
|
|
|
795
795
|
|
|
796
796
|
if (!CanHaveErrorCauses())
|
|
797
797
|
{
|
|
798
|
-
MS_THROW_ERROR("this
|
|
798
|
+
MS_THROW_ERROR("this chunk class cannot have error causes");
|
|
799
799
|
}
|
|
800
800
|
}
|
|
801
801
|
|
|
@@ -805,7 +805,7 @@ namespace RTC
|
|
|
805
805
|
|
|
806
806
|
if (this->needsConsolidation)
|
|
807
807
|
{
|
|
808
|
-
MS_THROW_ERROR("
|
|
808
|
+
MS_THROW_ERROR("chunk needs consolidation of some ongoing parameter or error cause");
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
811
|
} // namespace SCTP
|
|
@@ -12,21 +12,21 @@ namespace RTC
|
|
|
12
12
|
/* Class variables. */
|
|
13
13
|
|
|
14
14
|
// clang-format off
|
|
15
|
-
const
|
|
15
|
+
const ankerl::unordered_dense::map<ErrorCause::ErrorCauseCode, std::string> ErrorCause::ErrorCauseCode2String =
|
|
16
16
|
{
|
|
17
|
-
{ ErrorCause::ErrorCauseCode::INVALID_STREAM_IDENTIFIER, "
|
|
18
|
-
{ ErrorCause::ErrorCauseCode::MISSING_MANDATORY_PARAMETER, "
|
|
19
|
-
{ ErrorCause::ErrorCauseCode::STALE_COOKIE, "
|
|
20
|
-
{ ErrorCause::ErrorCauseCode::OUT_OF_RESOURCE, "
|
|
21
|
-
{ ErrorCause::ErrorCauseCode::UNRESOLVABLE_ADDRESS, "
|
|
22
|
-
{ ErrorCause::ErrorCauseCode::UNRECOGNIZED_CHUNK_TYPE, "
|
|
23
|
-
{ ErrorCause::ErrorCauseCode::INVALID_MANDATORY_PARAMETER, "
|
|
24
|
-
{ ErrorCause::ErrorCauseCode::UNRECOGNIZED_PARAMETERS, "
|
|
25
|
-
{ ErrorCause::ErrorCauseCode::NO_USER_DATA, "
|
|
26
|
-
{ ErrorCause::ErrorCauseCode::COOKIE_RECEIVED_WHILE_SHUTTING_DOWN, "
|
|
27
|
-
{ ErrorCause::ErrorCauseCode::RESTART_OF_AN_ASSOCIATION_WITH_NEW_ADDRESSES, "
|
|
28
|
-
{ ErrorCause::ErrorCauseCode::USER_INITIATED_ABORT, "
|
|
29
|
-
{ ErrorCause::ErrorCauseCode::PROTOCOL_VIOLATION, "
|
|
17
|
+
{ ErrorCause::ErrorCauseCode::INVALID_STREAM_IDENTIFIER, "INVALID-STREAM-IDENTIFIER" },
|
|
18
|
+
{ ErrorCause::ErrorCauseCode::MISSING_MANDATORY_PARAMETER, "MISSING-MANDATORY-PARAMETER" },
|
|
19
|
+
{ ErrorCause::ErrorCauseCode::STALE_COOKIE, "STALE-COOKIE" },
|
|
20
|
+
{ ErrorCause::ErrorCauseCode::OUT_OF_RESOURCE, "OUT-OF-RESOURCE" },
|
|
21
|
+
{ ErrorCause::ErrorCauseCode::UNRESOLVABLE_ADDRESS, "UNRESOLVABLE-ADDRESS" },
|
|
22
|
+
{ ErrorCause::ErrorCauseCode::UNRECOGNIZED_CHUNK_TYPE, "UNRECOGNIZED-CHUNK-TYPE" },
|
|
23
|
+
{ ErrorCause::ErrorCauseCode::INVALID_MANDATORY_PARAMETER, "INVALID-MANDATORY-PARAMETER" },
|
|
24
|
+
{ ErrorCause::ErrorCauseCode::UNRECOGNIZED_PARAMETERS, "UNRECOGNIZED-PARAMETERS" },
|
|
25
|
+
{ ErrorCause::ErrorCauseCode::NO_USER_DATA, "NO-USER-DATA" },
|
|
26
|
+
{ ErrorCause::ErrorCauseCode::COOKIE_RECEIVED_WHILE_SHUTTING_DOWN, "COOKIE-RECEIVED-WHILE-SHUTTING-DOWN" },
|
|
27
|
+
{ ErrorCause::ErrorCauseCode::RESTART_OF_AN_ASSOCIATION_WITH_NEW_ADDRESSES, "RESTART-OF-AN-ASSOCIATION-WITH-NEW-ADDRESSES" },
|
|
28
|
+
{ ErrorCause::ErrorCauseCode::USER_INITIATED_ABORT, "USER-INITIATED-ABORT" },
|
|
29
|
+
{ ErrorCause::ErrorCauseCode::PROTOCOL_VIOLATION, "PROTOCOL-VIOLATION" },
|
|
30
30
|
};
|
|
31
31
|
// clang-format on
|
|
32
32
|
|
|
@@ -42,7 +42,7 @@ namespace RTC
|
|
|
42
42
|
|
|
43
43
|
if (!Packet::IsSctp(buffer, bufferLength))
|
|
44
44
|
{
|
|
45
|
-
MS_WARN_TAG(sctp, "not an SCTP
|
|
45
|
+
MS_WARN_TAG(sctp, "not an SCTP packet");
|
|
46
46
|
|
|
47
47
|
return nullptr;
|
|
48
48
|
}
|
|
@@ -50,7 +50,7 @@ namespace RTC
|
|
|
50
50
|
auto* packet = new Packet(const_cast<uint8_t*>(buffer), bufferLength);
|
|
51
51
|
|
|
52
52
|
// Pointer that initially points to the given data buffer and is later
|
|
53
|
-
// incremented to point to other parts of the
|
|
53
|
+
// incremented to point to other parts of the packet.
|
|
54
54
|
const auto* ptr = buffer;
|
|
55
55
|
|
|
56
56
|
// Move to chunks.
|
|
@@ -59,10 +59,10 @@ namespace RTC
|
|
|
59
59
|
while (ptr < buffer + bufferLength)
|
|
60
60
|
{
|
|
61
61
|
// The remaining length in the buffer is the potential buffer length
|
|
62
|
-
// of the
|
|
62
|
+
// of the chunk.
|
|
63
63
|
const size_t chunkMaxBufferLength = bufferLength - (ptr - buffer);
|
|
64
64
|
|
|
65
|
-
// Here we must anticipate the type of each
|
|
65
|
+
// Here we must anticipate the type of each chunk to use its appropriate
|
|
66
66
|
// parser.
|
|
67
67
|
Chunk::ChunkType chunkType;
|
|
68
68
|
uint16_t chunkLength;
|
|
@@ -70,7 +70,7 @@ namespace RTC
|
|
|
70
70
|
|
|
71
71
|
if (!Chunk::IsChunk(ptr, chunkMaxBufferLength, chunkType, chunkLength, padding))
|
|
72
72
|
{
|
|
73
|
-
MS_WARN_TAG(sctp, "not an SCTP
|
|
73
|
+
MS_WARN_TAG(sctp, "not an SCTP chunk");
|
|
74
74
|
|
|
75
75
|
delete packet;
|
|
76
76
|
return nullptr;
|
|
@@ -78,7 +78,7 @@ namespace RTC
|
|
|
78
78
|
|
|
79
79
|
Chunk* chunk{ nullptr }; // NOLINT(misc-const-correctness)
|
|
80
80
|
|
|
81
|
-
MS_DEBUG_DEV("parsing SCTP
|
|
81
|
+
MS_DEBUG_DEV("parsing SCTP chunk [ptr:%zu, type:%" PRIu8 "]", ptr - buffer, chunkType);
|
|
82
82
|
|
|
83
83
|
switch (chunkType)
|
|
84
84
|
{
|
|
@@ -238,7 +238,7 @@ namespace RTC
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
// It's mandatory to call SetLength() once we are done and we know the
|
|
241
|
-
// exact length of the
|
|
241
|
+
// exact length of the packet.
|
|
242
242
|
packet->SetLength(computedLength);
|
|
243
243
|
|
|
244
244
|
return packet;
|
|
@@ -265,7 +265,7 @@ namespace RTC
|
|
|
265
265
|
packet->SetChecksum(0u);
|
|
266
266
|
|
|
267
267
|
// No need to invoke SetLength() since constructor invoked it with
|
|
268
|
-
// minimum
|
|
268
|
+
// minimum packet length.
|
|
269
269
|
|
|
270
270
|
return packet;
|
|
271
271
|
}
|
|
@@ -334,7 +334,7 @@ namespace RTC
|
|
|
334
334
|
|
|
335
335
|
Serializable::CloneInto(clonedPacket);
|
|
336
336
|
|
|
337
|
-
// Soft clone
|
|
337
|
+
// Soft clone packet chunks into the given cloned packet.
|
|
338
338
|
for (auto* chunk : this->chunks)
|
|
339
339
|
{
|
|
340
340
|
const size_t offset = chunk->GetBuffer() - GetBuffer();
|
|
@@ -383,7 +383,7 @@ namespace RTC
|
|
|
383
383
|
|
|
384
384
|
const size_t length = GetLength() + chunk->GetLength();
|
|
385
385
|
|
|
386
|
-
// Let's append the
|
|
386
|
+
// Let's append the chunk at the end of existing chunks.
|
|
387
387
|
auto* clonedChunk =
|
|
388
388
|
chunk->Clone(const_cast<uint8_t*>(GetBuffer()) + GetLength(), chunk->GetLength());
|
|
389
389
|
|
|
@@ -435,7 +435,7 @@ namespace RTC
|
|
|
435
435
|
|
|
436
436
|
this->needsConsolidation = true;
|
|
437
437
|
|
|
438
|
-
// When the application completes the
|
|
438
|
+
// When the application completes the chunk it must call
|
|
439
439
|
// `chunk->Consolidate()` and that will trigger this event.
|
|
440
440
|
chunk->SetConsolidatedListener(
|
|
441
441
|
[this, chunk]()
|
|
@@ -444,18 +444,18 @@ namespace RTC
|
|
|
444
444
|
{
|
|
445
445
|
if (chunk->NeedsConsolidation())
|
|
446
446
|
{
|
|
447
|
-
MS_THROW_ERROR("ongoing
|
|
447
|
+
MS_THROW_ERROR("ongoing chunk needs consolidation");
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
-
// Fix buffer length assigned to the
|
|
450
|
+
// Fix buffer length assigned to the chunk.
|
|
451
451
|
chunk->SetBufferLength(chunk->GetLength());
|
|
452
452
|
|
|
453
|
-
// Update
|
|
454
|
-
// NOTE: This will throw if there is no enough space in the
|
|
453
|
+
// Update packet length.
|
|
454
|
+
// NOTE: This will throw if there is no enough space in the packet
|
|
455
455
|
// buffer.
|
|
456
456
|
SetLength(GetLength() + chunk->GetLength());
|
|
457
457
|
|
|
458
|
-
// Add the
|
|
458
|
+
// Add the chunk to the list.
|
|
459
459
|
this->chunks.push_back(chunk);
|
|
460
460
|
this->needsConsolidation = false;
|
|
461
461
|
}
|
|
@@ -474,7 +474,7 @@ namespace RTC
|
|
|
474
474
|
|
|
475
475
|
if (this->needsConsolidation)
|
|
476
476
|
{
|
|
477
|
-
MS_THROW_ERROR("
|
|
477
|
+
MS_THROW_ERROR("packet needs consolidation of some ongoing chunk");
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
} // namespace SCTP
|
|
@@ -12,24 +12,24 @@ namespace RTC
|
|
|
12
12
|
/* Class variables. */
|
|
13
13
|
|
|
14
14
|
// clang-format off
|
|
15
|
-
const
|
|
15
|
+
const ankerl::unordered_dense::map<Parameter::ParameterType, std::string> Parameter::ParameterType2String =
|
|
16
16
|
{
|
|
17
|
-
{ Parameter::ParameterType::HEARTBEAT_INFO, "
|
|
18
|
-
{ Parameter::ParameterType::IPV4_ADDRESS, "
|
|
19
|
-
{ Parameter::ParameterType::IPV6_ADDRESS, "
|
|
20
|
-
{ Parameter::ParameterType::STATE_COOKIE, "
|
|
21
|
-
{ Parameter::ParameterType::UNRECOGNIZED_PARAMETER, "
|
|
22
|
-
{ Parameter::ParameterType::COOKIE_PRESERVATIVE, "
|
|
23
|
-
{ Parameter::ParameterType::SUPPORTED_ADDRESS_TYPES, "
|
|
24
|
-
{ Parameter::ParameterType::FORWARD_TSN_SUPPORTED, "
|
|
25
|
-
{ Parameter::ParameterType::SUPPORTED_EXTENSIONS, "
|
|
26
|
-
{ Parameter::ParameterType::OUTGOING_SSN_RESET_REQUEST, "
|
|
27
|
-
{ Parameter::ParameterType::INCOMING_SSN_RESET_REQUEST, "
|
|
28
|
-
{ Parameter::ParameterType::SSN_TSN_RESET_REQUEST, "
|
|
29
|
-
{ Parameter::ParameterType::RECONFIGURATION_RESPONSE, "
|
|
30
|
-
{ Parameter::ParameterType::ADD_OUTGOING_STREAMS_REQUEST, "
|
|
31
|
-
{ Parameter::ParameterType::ADD_INCOMING_STREAMS_REQUEST, "
|
|
32
|
-
{ Parameter::ParameterType::ZERO_CHECKSUM_ACCEPTABLE, "
|
|
17
|
+
{ Parameter::ParameterType::HEARTBEAT_INFO, "HEARTBEAT-INFO" },
|
|
18
|
+
{ Parameter::ParameterType::IPV4_ADDRESS, "IPV4-ADDRESS" },
|
|
19
|
+
{ Parameter::ParameterType::IPV6_ADDRESS, "IPV6-ADDRESS" },
|
|
20
|
+
{ Parameter::ParameterType::STATE_COOKIE, "STATE-COOKIE" },
|
|
21
|
+
{ Parameter::ParameterType::UNRECOGNIZED_PARAMETER, "UNRECOGNIZED-PARAMETER" },
|
|
22
|
+
{ Parameter::ParameterType::COOKIE_PRESERVATIVE, "COOKIE-PRESERVATIVE" },
|
|
23
|
+
{ Parameter::ParameterType::SUPPORTED_ADDRESS_TYPES, "SUPPORTED-ADDRESS-TYPES" },
|
|
24
|
+
{ Parameter::ParameterType::FORWARD_TSN_SUPPORTED, "FORWARD-TSN-SUPPORTED" },
|
|
25
|
+
{ Parameter::ParameterType::SUPPORTED_EXTENSIONS, "SUPPORTED-EXTENSIONS" },
|
|
26
|
+
{ Parameter::ParameterType::OUTGOING_SSN_RESET_REQUEST, "OUTGOING-SSN-RESET-REQUEST" },
|
|
27
|
+
{ Parameter::ParameterType::INCOMING_SSN_RESET_REQUEST, "INCOMING-SSN-RESET-REQUEST" },
|
|
28
|
+
{ Parameter::ParameterType::SSN_TSN_RESET_REQUEST, "SSN-TSN-RESET-REQUEST" },
|
|
29
|
+
{ Parameter::ParameterType::RECONFIGURATION_RESPONSE, "RECONFIGURATION-RESPONSE" },
|
|
30
|
+
{ Parameter::ParameterType::ADD_OUTGOING_STREAMS_REQUEST, "ADD-OUTGOING-STREAMS-REQUEST" },
|
|
31
|
+
{ Parameter::ParameterType::ADD_INCOMING_STREAMS_REQUEST, "ADD-INCOMING-STREAMS-REQUEST" },
|
|
32
|
+
{ Parameter::ParameterType::ZERO_CHECKSUM_ACCEPTABLE, "ZERO-CHECKSUM-ACCEPTABLE" },
|
|
33
33
|
};
|
|
34
34
|
// clang-format on
|
|
35
35
|
|