mediasoup 3.19.21 → 3.20.0
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/ActiveSpeakerObserver.js +34 -1
- package/node/lib/AudioLevelObserver.js +35 -2
- package/node/lib/Channel.d.ts.map +1 -1
- package/node/lib/Channel.js +37 -5
- package/node/lib/Consumer.js +39 -6
- package/node/lib/DataConsumer.d.ts.map +1 -1
- package/node/lib/DataConsumer.js +39 -5
- package/node/lib/DataConsumerTypes.d.ts +1 -0
- package/node/lib/DataConsumerTypes.d.ts.map +1 -1
- package/node/lib/DataProducer.js +37 -4
- package/node/lib/DirectTransport.js +37 -4
- package/node/lib/DirectTransportTypes.d.ts +7 -2
- package/node/lib/DirectTransportTypes.d.ts.map +1 -1
- package/node/lib/Logger.js +4 -1
- package/node/lib/PipeTransport.d.ts +3 -1
- package/node/lib/PipeTransport.d.ts.map +1 -1
- package/node/lib/PipeTransport.js +56 -5
- package/node/lib/PipeTransportTypes.d.ts +28 -8
- package/node/lib/PipeTransportTypes.d.ts.map +1 -1
- package/node/lib/PlainTransport.d.ts +3 -1
- package/node/lib/PlainTransport.d.ts.map +1 -1
- package/node/lib/PlainTransport.js +54 -3
- package/node/lib/PlainTransportTypes.d.ts +27 -7
- package/node/lib/PlainTransportTypes.d.ts.map +1 -1
- package/node/lib/Producer.js +40 -7
- package/node/lib/Router.d.ts +5 -5
- package/node/lib/Router.d.ts.map +1 -1
- package/node/lib/Router.js +81 -36
- package/node/lib/RouterTypes.d.ts +25 -3
- package/node/lib/RouterTypes.d.ts.map +1 -1
- package/node/lib/RtpObserver.js +36 -3
- package/node/lib/Transport.d.ts +3 -1
- package/node/lib/Transport.d.ts.map +1 -1
- package/node/lib/Transport.js +74 -22
- package/node/lib/TransportTypes.d.ts +2 -1
- package/node/lib/TransportTypes.d.ts.map +1 -1
- package/node/lib/WebRtcServer.js +36 -3
- package/node/lib/WebRtcTransport.d.ts +3 -1
- package/node/lib/WebRtcTransport.d.ts.map +1 -1
- package/node/lib/WebRtcTransport.js +55 -4
- package/node/lib/WebRtcTransportTypes.d.ts +27 -7
- package/node/lib/WebRtcTransportTypes.d.ts.map +1 -1
- package/node/lib/Worker.d.ts +2 -1
- package/node/lib/Worker.d.ts.map +1 -1
- package/node/lib/Worker.js +71 -25
- package/node/lib/WorkerTypes.d.ts +0 -4
- package/node/lib/WorkerTypes.d.ts.map +1 -1
- package/node/lib/enhancedEvents.d.ts +2 -2
- package/node/lib/enhancedEvents.d.ts.map +1 -1
- package/node/lib/enhancedEvents.js +0 -2
- package/node/lib/fbs/active-speaker-observer/active-speaker-observer-options.js +34 -1
- package/node/lib/fbs/active-speaker-observer/dominant-speaker-notification.js +34 -1
- package/node/lib/fbs/audio-level-observer/audio-level-observer-options.js +34 -1
- package/node/lib/fbs/audio-level-observer/volume.js +34 -1
- package/node/lib/fbs/audio-level-observer/volumes-notification.js +34 -1
- package/node/lib/fbs/common/string-string-array.js +34 -1
- package/node/lib/fbs/common/string-string.js +34 -1
- package/node/lib/fbs/common/string-uint8.js +34 -1
- package/node/lib/fbs/common/uint16-string.js +34 -1
- package/node/lib/fbs/common/uint32-string.js +34 -1
- package/node/lib/fbs/consumer/base-consumer-dump.js +34 -1
- package/node/lib/fbs/consumer/consumer-dump.js +34 -1
- package/node/lib/fbs/consumer/consumer-layers.js +34 -1
- package/node/lib/fbs/consumer/consumer-score.js +34 -1
- package/node/lib/fbs/consumer/dump-response.js +34 -1
- package/node/lib/fbs/consumer/enable-trace-event-request.js +34 -1
- package/node/lib/fbs/consumer/fir-trace-info.js +34 -1
- package/node/lib/fbs/consumer/get-stats-response.js +34 -1
- package/node/lib/fbs/consumer/key-frame-trace-info.js +34 -1
- package/node/lib/fbs/consumer/layers-change-notification.js +34 -1
- package/node/lib/fbs/consumer/pli-trace-info.js +34 -1
- package/node/lib/fbs/consumer/rtp-notification.js +34 -1
- package/node/lib/fbs/consumer/rtp-trace-info.js +34 -1
- package/node/lib/fbs/consumer/score-notification.js +34 -1
- package/node/lib/fbs/consumer/set-preferred-layers-request.js +34 -1
- package/node/lib/fbs/consumer/set-preferred-layers-response.js +34 -1
- package/node/lib/fbs/consumer/set-priority-request.js +34 -1
- package/node/lib/fbs/consumer/set-priority-response.js +34 -1
- package/node/lib/fbs/consumer/trace-notification.js +34 -1
- package/node/lib/fbs/data-consumer/add-subchannel-request.js +34 -1
- package/node/lib/fbs/data-consumer/add-subchannel-response.js +34 -1
- package/node/lib/fbs/data-consumer/buffered-amount-low-notification.js +34 -1
- package/node/lib/fbs/data-consumer/dump-response.d.ts +5 -2
- package/node/lib/fbs/data-consumer/dump-response.d.ts.map +1 -1
- package/node/lib/fbs/data-consumer/dump-response.js +60 -16
- package/node/lib/fbs/data-consumer/get-buffered-amount-response.js +34 -1
- package/node/lib/fbs/data-consumer/get-stats-response.js +34 -1
- package/node/lib/fbs/data-consumer/message-notification.js +34 -1
- package/node/lib/fbs/data-consumer/remove-subchannel-request.js +34 -1
- package/node/lib/fbs/data-consumer/remove-subchannel-response.js +34 -1
- package/node/lib/fbs/data-consumer/send-request.js +34 -1
- package/node/lib/fbs/data-consumer/set-buffered-amount-low-threshold-request.js +34 -1
- package/node/lib/fbs/data-consumer/set-subchannels-request.js +34 -1
- package/node/lib/fbs/data-consumer/set-subchannels-response.js +34 -1
- package/node/lib/fbs/data-consumer/type.d.ts +5 -0
- package/node/lib/fbs/data-consumer/type.d.ts.map +1 -0
- package/node/lib/fbs/data-consumer/type.js +10 -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 +3 -1
- package/node/lib/fbs/data-producer/dump-response.js +34 -1
- package/node/lib/fbs/data-producer/get-stats-response.js +34 -1
- package/node/lib/fbs/data-producer/send-notification.js +34 -1
- package/node/lib/fbs/direct-transport/direct-transport-options.js +34 -1
- package/node/lib/fbs/direct-transport/dump-response.js +34 -1
- package/node/lib/fbs/direct-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/direct-transport/rtcp-notification.js +34 -1
- package/node/lib/fbs/lib-uring/dump.js +34 -1
- package/node/lib/fbs/log/log.js +34 -1
- package/node/lib/fbs/message/message.js +34 -1
- package/node/lib/fbs/notification/body.d.ts +24 -22
- package/node/lib/fbs/notification/body.d.ts.map +1 -1
- package/node/lib/fbs/notification/body.js +24 -20
- package/node/lib/fbs/notification/event.d.ts +27 -26
- package/node/lib/fbs/notification/event.d.ts.map +1 -1
- package/node/lib/fbs/notification/event.js +27 -26
- package/node/lib/fbs/notification/notification.d.ts +3 -2
- package/node/lib/fbs/notification/notification.d.ts.map +1 -1
- package/node/lib/fbs/notification/notification.js +34 -1
- package/node/lib/fbs/pipe-transport/connect-request.js +34 -1
- package/node/lib/fbs/pipe-transport/connect-response.js +34 -1
- package/node/lib/fbs/pipe-transport/dump-response.js +34 -1
- package/node/lib/fbs/pipe-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/pipe-transport/pipe-transport-options.js +34 -1
- package/node/lib/fbs/plain-transport/connect-request.js +34 -1
- package/node/lib/fbs/plain-transport/connect-response.js +34 -1
- package/node/lib/fbs/plain-transport/dump-response.js +34 -1
- package/node/lib/fbs/plain-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/plain-transport/plain-transport-options.js +34 -1
- package/node/lib/fbs/plain-transport/rtcp-tuple-notification.js +34 -1
- package/node/lib/fbs/plain-transport/tuple-notification.js +34 -1
- package/node/lib/fbs/producer/dump-response.js +34 -1
- package/node/lib/fbs/producer/enable-trace-event-request.js +34 -1
- package/node/lib/fbs/producer/fir-trace-info.js +34 -1
- package/node/lib/fbs/producer/get-stats-response.js +34 -1
- package/node/lib/fbs/producer/key-frame-trace-info.js +34 -1
- package/node/lib/fbs/producer/pli-trace-info.js +34 -1
- package/node/lib/fbs/producer/rtp-trace-info.js +34 -1
- package/node/lib/fbs/producer/score-notification.js +34 -1
- package/node/lib/fbs/producer/score.js +34 -1
- package/node/lib/fbs/producer/send-notification.js +34 -1
- package/node/lib/fbs/producer/sr-trace-info.js +34 -1
- package/node/lib/fbs/producer/trace-notification.js +34 -1
- package/node/lib/fbs/producer/video-orientation-change-notification.js +34 -1
- package/node/lib/fbs/request/request.js +34 -1
- package/node/lib/fbs/response/response.js +34 -1
- package/node/lib/fbs/router/close-rtp-observer-request.js +34 -1
- package/node/lib/fbs/router/close-transport-request.js +34 -1
- package/node/lib/fbs/router/create-active-speaker-observer-request.js +34 -1
- package/node/lib/fbs/router/create-audio-level-observer-request.js +34 -1
- package/node/lib/fbs/router/create-direct-transport-request.js +34 -1
- package/node/lib/fbs/router/create-pipe-transport-request.js +34 -1
- package/node/lib/fbs/router/create-plain-transport-request.js +34 -1
- package/node/lib/fbs/router/create-web-rtc-transport-request.js +34 -1
- package/node/lib/fbs/router/dump-response.js +34 -1
- package/node/lib/fbs/rtp-observer/add-producer-request.js +34 -1
- package/node/lib/fbs/rtp-observer/remove-producer-request.js +34 -1
- package/node/lib/fbs/rtp-packet/dump.js +34 -1
- package/node/lib/fbs/rtp-parameters/boolean.js +34 -1
- package/node/lib/fbs/rtp-parameters/codec-mapping.js +34 -1
- package/node/lib/fbs/rtp-parameters/double.js +34 -1
- package/node/lib/fbs/rtp-parameters/encoding-mapping.js +34 -1
- package/node/lib/fbs/rtp-parameters/integer32-array.js +34 -1
- package/node/lib/fbs/rtp-parameters/integer32.js +34 -1
- package/node/lib/fbs/rtp-parameters/parameter.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtcp-feedback.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtcp-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-codec-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-encoding-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-header-extension-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-mapping.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtx.js +34 -1
- package/node/lib/fbs/rtp-parameters/string.js +34 -1
- package/node/lib/fbs/rtp-stream/base-stats.js +34 -1
- package/node/lib/fbs/rtp-stream/bitrate-by-layer.js +34 -1
- package/node/lib/fbs/rtp-stream/dump.js +34 -1
- package/node/lib/fbs/rtp-stream/params.js +34 -1
- package/node/lib/fbs/rtp-stream/recv-stats.js +34 -1
- package/node/lib/fbs/rtp-stream/send-stats.js +34 -1
- package/node/lib/fbs/rtp-stream/stats.js +34 -1
- package/node/lib/fbs/rtx-stream/params.js +34 -1
- package/node/lib/fbs/rtx-stream/rtx-dump.js +34 -1
- package/node/lib/fbs/sctp-association/sctp-negotiated-capabilities.d.ts +24 -0
- package/node/lib/fbs/sctp-association/sctp-negotiated-capabilities.d.ts.map +1 -0
- package/node/lib/fbs/sctp-association/sctp-negotiated-capabilities.js +102 -0
- package/node/lib/fbs/sctp-association.d.ts +1 -0
- package/node/lib/fbs/sctp-association.d.ts.map +1 -1
- package/node/lib/fbs/sctp-association.js +4 -1
- package/node/lib/fbs/sctp-parameters/num-sctp-streams.js +34 -1
- package/node/lib/fbs/sctp-parameters/sctp-parameters.d.ts +14 -14
- package/node/lib/fbs/sctp-parameters/sctp-parameters.d.ts.map +1 -1
- package/node/lib/fbs/sctp-parameters/sctp-parameters.js +73 -40
- package/node/lib/fbs/sctp-parameters/sctp-stream-parameters.js +34 -1
- package/node/lib/fbs/sctp-parameters.d.ts +0 -1
- package/node/lib/fbs/sctp-parameters.d.ts.map +1 -1
- package/node/lib/fbs/sctp-parameters.js +1 -4
- package/node/lib/fbs/srtp-parameters/srtp-parameters.js +34 -1
- package/node/lib/fbs/transport/bwe-trace-info.js +34 -1
- package/node/lib/fbs/transport/close-consumer-request.js +34 -1
- package/node/lib/fbs/transport/close-data-consumer-request.js +34 -1
- package/node/lib/fbs/transport/close-data-producer-request.js +34 -1
- package/node/lib/fbs/transport/close-producer-request.js +34 -1
- package/node/lib/fbs/transport/consume-data-request.d.ts +1 -1
- package/node/lib/fbs/transport/consume-data-request.js +35 -2
- package/node/lib/fbs/transport/consume-request.js +34 -1
- package/node/lib/fbs/transport/consume-response.js +34 -1
- package/node/lib/fbs/transport/dump.d.ts +7 -4
- package/node/lib/fbs/transport/dump.d.ts.map +1 -1
- package/node/lib/fbs/transport/dump.js +66 -22
- package/node/lib/fbs/transport/enable-trace-event-request.js +34 -1
- package/node/lib/fbs/transport/listen-info.js +34 -1
- package/node/lib/fbs/transport/options.d.ts +14 -14
- package/node/lib/fbs/transport/options.d.ts.map +1 -1
- package/node/lib/fbs/transport/options.js +92 -51
- package/node/lib/fbs/transport/port-range.js +34 -1
- package/node/lib/fbs/transport/produce-data-request.js +34 -1
- package/node/lib/fbs/transport/produce-request.js +34 -1
- package/node/lib/fbs/transport/produce-response.js +34 -1
- package/node/lib/fbs/transport/recv-rtp-header-extensions.js +34 -1
- package/node/lib/fbs/transport/restart-ice-response.js +34 -1
- package/node/lib/fbs/transport/rtp-listener.js +34 -1
- package/node/lib/fbs/transport/sctp-listener.js +34 -1
- package/node/lib/fbs/transport/sctp-negotiated-capabilities-notification.d.ts +22 -0
- package/node/lib/fbs/transport/sctp-negotiated-capabilities-notification.d.ts.map +1 -0
- package/node/lib/fbs/transport/sctp-negotiated-capabilities-notification.js +93 -0
- package/node/lib/fbs/transport/sctp-state-change-notification.js +34 -1
- package/node/lib/fbs/transport/send-rtcp-notification.js +34 -1
- package/node/lib/fbs/transport/set-max-incoming-bitrate-request.js +34 -1
- package/node/lib/fbs/transport/set-max-outgoing-bitrate-request.js +34 -1
- package/node/lib/fbs/transport/set-min-outgoing-bitrate-request.js +34 -1
- package/node/lib/fbs/transport/socket-flags.js +34 -1
- package/node/lib/fbs/transport/stats.js +34 -1
- package/node/lib/fbs/transport/trace-notification.js +34 -1
- package/node/lib/fbs/transport/tuple.js +34 -1
- package/node/lib/fbs/transport.d.ts +1 -0
- package/node/lib/fbs/transport.d.ts.map +1 -1
- package/node/lib/fbs/transport.js +5 -2
- package/node/lib/fbs/web-rtc-server/dump-response.js +34 -1
- package/node/lib/fbs/web-rtc-server/ice-user-name-fragment.js +34 -1
- package/node/lib/fbs/web-rtc-server/ip-port.js +34 -1
- package/node/lib/fbs/web-rtc-server/tuple-hash.js +34 -1
- package/node/lib/fbs/web-rtc-transport/connect-request.js +34 -1
- package/node/lib/fbs/web-rtc-transport/connect-response.js +34 -1
- package/node/lib/fbs/web-rtc-transport/dtls-parameters.js +34 -1
- package/node/lib/fbs/web-rtc-transport/dtls-state-change-notification.js +34 -1
- package/node/lib/fbs/web-rtc-transport/dump-response.js +34 -1
- package/node/lib/fbs/web-rtc-transport/fingerprint.js +34 -1
- package/node/lib/fbs/web-rtc-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-candidate.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-parameters.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-selected-tuple-change-notification.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-state-change-notification.js +34 -1
- package/node/lib/fbs/web-rtc-transport/listen-individual.js +34 -1
- package/node/lib/fbs/web-rtc-transport/listen-server.js +34 -1
- package/node/lib/fbs/web-rtc-transport/web-rtc-transport-options.js +34 -1
- package/node/lib/fbs/worker/channel-message-handlers.js +34 -1
- package/node/lib/fbs/worker/close-router-request.js +34 -1
- package/node/lib/fbs/worker/close-web-rtc-server-request.js +34 -1
- package/node/lib/fbs/worker/create-router-request.js +34 -1
- package/node/lib/fbs/worker/create-web-rtc-server-request.js +34 -1
- package/node/lib/fbs/worker/dump-response.js +34 -1
- package/node/lib/fbs/worker/resource-usage-response.js +34 -1
- package/node/lib/fbs/worker/update-settings-request.js +34 -1
- package/node/lib/index.d.ts +1 -1
- package/node/lib/index.d.ts.map +1 -1
- package/node/lib/index.js +37 -5
- package/node/lib/ortc.js +36 -3
- package/node/lib/rtpParametersFbsUtils.js +34 -1
- package/node/lib/rtpStreamStatsFbsUtils.js +35 -2
- package/node/lib/sctpParametersFbsUtils.d.ts +2 -2
- package/node/lib/sctpParametersFbsUtils.d.ts.map +1 -1
- package/node/lib/sctpParametersFbsUtils.js +44 -7
- package/node/lib/sctpParametersTypes.d.ts +10 -46
- package/node/lib/sctpParametersTypes.d.ts.map +1 -1
- package/node/lib/srtpParametersFbsUtils.js +34 -1
- package/node/lib/test/test-ActiveSpeakerObserver.js +35 -2
- package/node/lib/test/test-AudioLevelObserver.js +35 -2
- package/node/lib/test/test-Consumer.js +37 -4
- package/node/lib/test/test-DataConsumer.js +35 -2
- package/node/lib/test/test-DataProducer.js +35 -2
- package/node/lib/test/test-DirectTransport.js +36 -8
- package/node/lib/test/test-PipeTransport.js +35 -2
- package/node/lib/test/test-PlainTransport.js +45 -12
- package/node/lib/test/test-Producer.js +37 -4
- package/node/lib/test/test-Router.js +35 -2
- package/node/lib/test/test-WebRtcServer.js +34 -1
- package/node/lib/test/test-WebRtcTransport.js +51 -22
- package/node/lib/test/test-Worker.js +37 -4
- package/node/lib/test/test-mediasoup.js +36 -3
- package/node/lib/test/test-multiopus.js +35 -2
- package/node/lib/test/test-ortc.js +34 -1
- package/node/lib/test/test-werift-sctp.js +39 -5
- package/npm-scripts.mjs +2 -2
- package/package.json +13 -11
- package/worker/deps/libwebrtc/LICENSE +5 -0
- package/worker/deps/libwebrtc/README.md +3 -3
- package/worker/deps/libwebrtc/libwebrtc/mediasoup_helpers.h +13 -10
- package/worker/fbs/dataConsumer.fbs +7 -2
- package/worker/fbs/dataProducer.fbs +1 -0
- package/worker/fbs/notification.fbs +2 -0
- package/worker/fbs/sctpAssociation.fbs +4 -0
- package/worker/fbs/sctpParameters.fbs +5 -12
- package/worker/fbs/transport.fbs +12 -8
- package/worker/fuzzer/src/RTC/FuzzerDtlsTransport.cpp +13 -3
- package/worker/fuzzer/src/RTC/FuzzerRateCalculator.cpp +2 -2
- package/worker/fuzzer/src/RTC/FuzzerSeqManager.cpp +1 -1
- package/worker/fuzzer/src/RTC/FuzzerTrendCalculator.cpp +5 -5
- package/worker/fuzzer/src/RTC/ICE/FuzzerStunPacket.cpp +9 -6
- package/worker/fuzzer/src/RTC/RTP/FuzzerRetransmissionBuffer.cpp +1 -1
- package/worker/fuzzer/src/RTC/RTP/FuzzerRtpStreamSend.cpp +14 -2
- package/worker/fuzzer/src/RTC/SCTP/association/FuzzerStateCookie.cpp +1 -1
- package/worker/fuzzer/src/RTC/SCTP/packet/FuzzerPacket.cpp +5 -2
- package/worker/fuzzer/src/fuzzer.cpp +3 -10
- package/worker/include/Channel/ChannelMessageRegistrator.hpp +39 -0
- package/worker/include/Channel/ChannelMessageRegistratorInterface.hpp +32 -0
- package/worker/include/Channel/ChannelRequest.hpp +1 -1
- package/worker/include/Channel/ChannelSocket.hpp +1 -1
- package/worker/include/DepLibUV.hpp +1 -1
- package/worker/include/DepLibUring.hpp +3 -3
- package/worker/include/Logger.hpp +4 -4
- package/worker/include/MediaSoupErrors.hpp +1 -1
- package/worker/include/RTC/ActiveSpeakerObserver.hpp +11 -9
- package/worker/include/RTC/AudioLevelObserver.hpp +7 -7
- package/worker/include/RTC/Consumer.hpp +3 -3
- package/worker/include/RTC/DataConsumer.hpp +13 -17
- package/worker/include/RTC/DataProducer.hpp +6 -9
- package/worker/include/RTC/DirectTransport.hpp +4 -6
- package/worker/include/RTC/DtlsTransport.hpp +13 -11
- package/worker/include/RTC/ICE/IceServer.hpp +8 -5
- package/worker/include/RTC/ICE/StunPacket.hpp +1 -1
- package/worker/include/RTC/KeyFrameRequestManager.hpp +15 -12
- package/worker/include/RTC/NackGenerator.hpp +8 -6
- package/worker/include/RTC/PipeConsumer.hpp +1 -2
- package/worker/include/RTC/PipeTransport.hpp +4 -6
- package/worker/include/RTC/PlainTransport.hpp +4 -6
- package/worker/include/RTC/PortManager.hpp +1 -1
- package/worker/include/RTC/Producer.hpp +3 -3
- package/worker/include/RTC/RTCP/FeedbackPs.hpp +1 -1
- package/worker/include/RTC/RTCP/FeedbackRtp.hpp +1 -1
- package/worker/include/RTC/RTCP/FeedbackRtpNack.hpp +1 -1
- package/worker/include/RTC/RTCP/ReceiverReport.hpp +1 -1
- package/worker/include/RTC/RTP/Packet.hpp +2 -2
- package/worker/include/RTC/RTP/RtpStream.hpp +17 -12
- package/worker/include/RTC/RTP/RtpStreamRecv.hpp +8 -6
- package/worker/include/RTC/RTP/RtpStreamSend.hpp +4 -1
- package/worker/include/RTC/RTP/RtxStream.hpp +3 -1
- package/worker/include/RTC/RTP/SharedPacket.hpp +1 -1
- package/worker/include/RTC/RateCalculator.hpp +5 -2
- package/worker/include/RTC/Router.hpp +7 -8
- package/worker/include/RTC/RtpObserver.hpp +3 -3
- package/worker/include/RTC/SCTP/association/Association.hpp +53 -19
- package/worker/include/RTC/SCTP/association/AssociationListenerDeferrer.hpp +14 -6
- package/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +18 -14
- package/worker/include/RTC/SCTP/association/PacketSender.hpp +3 -3
- package/worker/include/RTC/SCTP/association/StateCookie.hpp +1 -1
- package/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +49 -35
- package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +114 -31
- package/worker/include/RTC/SCTP/association/{TCBContext.hpp → TransmissionControlBlockContextInterface.hpp} +14 -8
- package/worker/include/RTC/SCTP/packet/Chunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/TLV.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/UserData.hpp +61 -17
- package/worker/include/RTC/SCTP/packet/chunks/AnyDataChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/AnyForwardTsnChunk.hpp +9 -9
- package/worker/include/RTC/SCTP/packet/chunks/AnyInitChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/DataChunk.hpp +4 -2
- package/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/chunks/IDataChunk.hpp +4 -2
- package/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/chunks/InitAckChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/InitChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/SackChunk.hpp +10 -3
- package/worker/include/RTC/SCTP/packet/chunks/ShutdownChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/CookiePreservativeParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/public/AssociationInterface.hpp +22 -2
- package/worker/include/RTC/SCTP/public/{AssociationListener.hpp → AssociationListenerInterface.hpp} +5 -5
- package/worker/include/RTC/SCTP/public/Message.hpp +26 -10
- package/worker/include/RTC/SCTP/public/SctpOptions.hpp +28 -19
- package/worker/include/RTC/SCTP/public/SctpTypes.hpp +21 -0
- package/worker/include/RTC/SCTP/rx/DataTracker.hpp +277 -0
- package/worker/include/RTC/SCTP/rx/InterleavedReassemblyStreams.hpp +116 -0
- package/worker/include/RTC/SCTP/rx/ReassemblyQueue.hpp +202 -0
- package/worker/include/RTC/SCTP/rx/ReassemblyStreamsInterface.hpp +83 -0
- package/worker/include/RTC/SCTP/rx/TraditionalReassemblyStreams.hpp +183 -0
- package/worker/include/RTC/SCTP/tx/OutstandingData.hpp +595 -0
- package/worker/include/RTC/SCTP/tx/RetransmissionErrorCounter.hpp +3 -3
- package/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp +329 -0
- package/worker/include/RTC/SCTP/tx/RetransmissionTimeout.hpp +11 -10
- package/worker/include/RTC/SCTP/tx/RoundRobinSendQueue.hpp +356 -0
- package/worker/include/RTC/SCTP/tx/SendQueueInterface.hpp +180 -0
- package/worker/include/RTC/SCTP/tx/StreamScheduler.hpp +235 -0
- package/worker/include/RTC/SenderBandwidthEstimator.hpp +5 -1
- package/worker/include/RTC/Serializable.hpp +11 -3
- package/worker/include/RTC/SimpleConsumer.hpp +1 -2
- package/worker/include/RTC/SimulcastConsumer.hpp +1 -2
- package/worker/include/RTC/SvcConsumer.hpp +1 -2
- package/worker/include/RTC/TcpServer.hpp +2 -2
- package/worker/include/RTC/Transport.hpp +65 -86
- package/worker/include/RTC/TransportCongestionControlClient.hpp +8 -5
- package/worker/include/RTC/TransportCongestionControlServer.hpp +8 -5
- package/worker/include/RTC/TransportTuple.hpp +1 -1
- package/worker/include/RTC/UdpSocket.hpp +1 -1
- package/worker/include/RTC/WebRtcServer.hpp +3 -3
- package/worker/include/RTC/WebRtcTransport.hpp +5 -7
- package/worker/include/Settings.hpp +2 -3
- package/worker/include/Shared.hpp +64 -0
- package/worker/include/SharedInterface.hpp +77 -0
- package/worker/include/Utils/UnwrappedSequenceNumber.hpp +270 -0
- package/worker/include/Utils.hpp +10 -4
- package/worker/include/Worker.hpp +6 -6
- package/worker/include/common.hpp +12 -12
- package/worker/include/handles/BackoffTimerHandle.hpp +28 -67
- package/worker/include/handles/BackoffTimerHandleInterface.hpp +123 -0
- package/worker/include/handles/TimerHandle.hpp +29 -20
- package/worker/include/handles/TimerHandleInterface.hpp +43 -0
- package/worker/meson.build +45 -29
- package/worker/meson_options.txt +2 -1
- package/worker/mocks/include/Channel/MockChannelMessageRegistrator.hpp +45 -0
- package/worker/mocks/include/MockShared.hpp +90 -0
- package/worker/mocks/include/RTC/SCTP/association/MockAssociationListener.hpp +308 -0
- package/worker/mocks/include/RTC/SCTP/association/MockTransmissionControlBlockContext.hpp +183 -0
- package/worker/mocks/include/RTC/SCTP/tx/MockSendQueue.hpp +262 -0
- package/worker/mocks/include/handles/MockBackoffTimerHandle.hpp +153 -0
- package/worker/mocks/include/handles/MockTimerHandle.hpp +74 -0
- package/worker/mocks/include/mockTypes.hpp +15 -0
- package/worker/mocks/src/Channel/MockChannelMessageRegistrator.cpp +128 -0
- package/worker/mocks/src/MockShared.cpp +46 -0
- package/worker/mocks/src/RTC/SCTP/association/MockTransmissionControlBlockContext.cpp +39 -0
- package/worker/mocks/src/handles/MockBackoffTimerHandle.cpp +127 -0
- package/worker/scripts/clang-scripts.mjs +5 -1
- package/worker/scripts/package-lock.json +6 -7
- package/worker/src/Channel/ChannelMessageRegistrator.cpp +125 -0
- package/worker/src/Channel/ChannelSocket.cpp +3 -4
- package/worker/src/DepLibUV.cpp +1 -1
- package/worker/src/DepLibUring.cpp +3 -1
- package/worker/src/Logger.cpp +1 -1
- package/worker/src/MediaSoupErrors.cpp +2 -0
- package/worker/src/RTC/ActiveSpeakerObserver.cpp +14 -14
- package/worker/src/RTC/AudioLevelObserver.cpp +12 -10
- package/worker/src/RTC/Consumer.cpp +28 -26
- package/worker/src/RTC/DataConsumer.cpp +61 -71
- package/worker/src/RTC/DataProducer.cpp +16 -11
- package/worker/src/RTC/DirectTransport.cpp +21 -20
- package/worker/src/RTC/DtlsTransport.cpp +4 -4
- package/worker/src/RTC/ICE/IceServer.cpp +6 -5
- package/worker/src/RTC/ICE/StunPacket.cpp +1 -1
- package/worker/src/RTC/KeyFrameRequestManager.cpp +15 -15
- package/worker/src/RTC/NackGenerator.cpp +6 -6
- package/worker/src/RTC/PipeConsumer.cpp +6 -5
- package/worker/src/RTC/PipeTransport.cpp +9 -22
- package/worker/src/RTC/PlainTransport.cpp +16 -28
- package/worker/src/RTC/Producer.cpp +40 -39
- package/worker/src/RTC/RTCP/FeedbackPsAfb.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackPsRpsi.cpp +1 -2
- package/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp +1 -1
- package/worker/src/RTC/RTCP/XR.cpp +1 -1
- package/worker/src/RTC/RTP/Packet.cpp +3 -1
- package/worker/src/RTC/RTP/ProbationGenerator.cpp +4 -4
- package/worker/src/RTC/RTP/RetransmissionBuffer.cpp +1 -1
- package/worker/src/RTC/RTP/RtpStream.cpp +17 -10
- package/worker/src/RTC/RTP/RtpStreamRecv.cpp +16 -14
- package/worker/src/RTC/RTP/RtpStreamSend.cpp +12 -9
- package/worker/src/RTC/RTP/RtxStream.cpp +7 -7
- package/worker/src/RTC/RTP/SharedPacket.cpp +3 -3
- package/worker/src/RTC/RateCalculator.cpp +1 -2
- package/worker/src/RTC/Router.cpp +61 -38
- package/worker/src/RTC/RtpDictionaries/RtpCodecMimeType.cpp +1 -1
- package/worker/src/RTC/RtpObserver.cpp +2 -1
- package/worker/src/RTC/SCTP/LICENSE +44 -0
- package/worker/src/RTC/SCTP/association/Association.cpp +417 -411
- package/worker/src/RTC/SCTP/association/AssociationListenerDeferrer.cpp +46 -13
- package/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +47 -43
- package/worker/src/RTC/SCTP/association/PacketSender.cpp +8 -8
- package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +113 -101
- package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +291 -62
- package/worker/src/RTC/SCTP/packet/Chunk.cpp +5 -1
- package/worker/src/RTC/SCTP/packet/Packet.cpp +8 -1
- package/worker/src/RTC/SCTP/packet/chunks/DataChunk.cpp +17 -0
- package/worker/src/RTC/SCTP/packet/chunks/ForwardTsnChunk.cpp +4 -4
- package/worker/src/RTC/SCTP/packet/chunks/IDataChunk.cpp +25 -0
- package/worker/src/RTC/SCTP/packet/chunks/IForwardTsnChunk.cpp +10 -7
- package/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp +21 -4
- package/worker/src/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/public/Message.cpp +8 -0
- package/worker/src/RTC/SCTP/public/SctpOptions.cpp +90 -0
- package/worker/src/RTC/SCTP/rx/DataTracker.cpp +471 -0
- package/worker/src/RTC/SCTP/rx/InterleavedReassemblyStreams.cpp +327 -0
- package/worker/src/RTC/SCTP/rx/ReassemblyQueue.cpp +288 -0
- package/worker/src/RTC/SCTP/rx/TraditionalReassemblyStreams.cpp +453 -0
- package/worker/src/RTC/SCTP/tx/OutstandingData.cpp +912 -0
- package/worker/src/RTC/SCTP/tx/RetransmissionQueue.cpp +786 -0
- package/worker/src/RTC/SCTP/tx/RetransmissionTimeout.cpp +2 -2
- package/worker/src/RTC/SCTP/tx/RoundRobinSendQueue.cpp +752 -0
- package/worker/src/RTC/SCTP/tx/StreamScheduler.cpp +257 -0
- package/worker/src/RTC/SenderBandwidthEstimator.cpp +7 -5
- package/worker/src/RTC/SimpleConsumer.cpp +11 -11
- package/worker/src/RTC/SimulcastConsumer.cpp +16 -16
- package/worker/src/RTC/SrtpSession.cpp +1 -1
- package/worker/src/RTC/SvcConsumer.cpp +16 -16
- package/worker/src/RTC/TcpConnection.cpp +1 -1
- package/worker/src/RTC/Transport.cpp +497 -563
- package/worker/src/RTC/TransportCongestionControlClient.cpp +9 -8
- package/worker/src/RTC/TransportCongestionControlServer.cpp +5 -5
- package/worker/src/RTC/WebRtcServer.cpp +5 -4
- package/worker/src/RTC/WebRtcTransport.cpp +44 -39
- package/worker/src/Settings.cpp +9 -28
- package/worker/src/Shared.cpp +35 -0
- package/worker/src/Utils/Crypto.cpp +1 -1
- package/worker/src/Utils/String.cpp +1 -1
- package/worker/src/Worker.cpp +19 -48
- package/worker/src/handles/BackoffTimerHandle.cpp +34 -21
- package/worker/src/handles/TimerHandle.cpp +5 -4
- package/worker/src/handles/UdpSocketHandle.cpp +1 -1
- package/worker/src/lib.cpp +17 -16
- package/worker/subprojects/catch2.wrap +6 -6
- package/worker/tasks.py +1 -1
- package/worker/test/include/RTC/ICE/iceCommon.hpp +8 -7
- package/worker/test/include/RTC/RTP/rtpCommon.hpp +7 -6
- package/worker/test/include/RTC/SCTP/sctpCommon.hpp +16 -10
- package/worker/test/include/catch2Macros.hpp +31 -0
- package/worker/test/src/RTC/ICE/TestStunPacket.cpp +3 -3
- package/worker/test/src/RTC/ICE/iceCommon.cpp +2 -2
- package/worker/test/src/RTC/RTP/Codecs/TestVP8.cpp +1 -1
- package/worker/test/src/RTC/RTP/Codecs/TestVP9.cpp +1 -1
- package/worker/test/src/RTC/RTP/TestPacket.cpp +3 -3
- package/worker/test/src/RTC/RTP/TestRtpStreamRecv.cpp +16 -9
- package/worker/test/src/RTC/RTP/TestRtpStreamSend.cpp +38 -23
- package/worker/test/src/RTC/RTP/TestSharedPacket.cpp +1 -1
- package/worker/test/src/RTC/RTP/rtpCommon.cpp +2 -2
- package/worker/test/src/RTC/SCTP/association/TestHeartbeatHandler.cpp +292 -0
- package/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp +1 -1
- package/worker/test/src/RTC/SCTP/association/TestStateCookie.cpp +1 -1
- package/worker/test/src/RTC/SCTP/association/TestTransmissionControlBlock.cpp +99 -0
- package/worker/test/src/RTC/SCTP/packet/TestChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/TestPacket.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp +1 -1
- 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/TestDataChunk.cpp +77 -7
- package/worker/test/src/RTC/SCTP/packet/chunks/TestForwardTsnChunk.cpp +35 -26
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestIDataChunk.cpp +77 -7
- package/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp +59 -27
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestOperationErrorChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp +73 -35
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownChunk.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 +1 -1
- 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 +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestMissingMandatoryParameterErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestNoUserDataErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestOutOfResourceErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestProtocolViolationErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestRestartOfAnAssociationWithNewAddressesErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestStaleCookieErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedChunkTypeErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedParametersErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnresolvableAddressErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUserInitiatedAbortErrorCause.cpp +1 -1
- 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 +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestForwardTsnSupportedParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestHeartbeatInfoParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv4AddressParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestReconfigurationResponseParameter.cpp +1 -1
- 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 +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp +1 -1
- 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/rx/TestDataTracker.cpp +1117 -0
- package/worker/test/src/RTC/SCTP/rx/TestInterleavedReassemblyStreams.cpp +565 -0
- package/worker/test/src/RTC/SCTP/rx/TestReassemblyQueue.cpp +557 -0
- package/worker/test/src/RTC/SCTP/rx/TestTraditionalReassemblyStreams.cpp +555 -0
- package/worker/test/src/RTC/SCTP/sctpCommon.cpp +2 -2
- package/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp +1248 -0
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionErrorCounter.cpp +4 -0
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp +2218 -0
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionTimeout.cpp +33 -33
- package/worker/test/src/RTC/SCTP/tx/TestRoundRobinSendQueue.cpp +1130 -0
- package/worker/test/src/RTC/SCTP/tx/TestStreamScheduler.cpp +721 -0
- package/worker/test/src/RTC/TestKeyFrameRequestManager.cpp +20 -30
- package/worker/test/src/RTC/TestNackGenerator.cpp +11 -8
- package/worker/test/src/RTC/TestRateCalculator.cpp +6 -7
- package/worker/test/src/RTC/TestSimpleConsumer.cpp +11 -11
- package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +15 -3
- package/worker/test/src/Utils/TestByte.cpp +98 -0
- package/worker/test/src/{RTC/SCTP/common → Utils}/TestUnwrappedSequenceNumber.cpp +2 -2
- package/worker/test/src/testHelpers.cpp +1 -1
- package/worker/test/src/tests.cpp +0 -12
- package/node/lib/fbs/consumer/degrade-request.d.ts +0 -30
- package/node/lib/fbs/consumer/degrade-request.d.ts.map +0 -1
- package/node/lib/fbs/consumer/degrade-request.js +0 -91
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts +0 -24
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts.map +0 -1
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.js +0 -69
- package/node/lib/fbs/producer/degrade-request.d.ts +0 -30
- package/node/lib/fbs/producer/degrade-request.d.ts.map +0 -1
- package/node/lib/fbs/producer/degrade-request.js +0 -91
- package/node/lib/fbs/worker/close-notification.d.ts +0 -18
- package/node/lib/fbs/worker/close-notification.d.ts.map +0 -1
- package/node/lib/fbs/worker/close-notification.js +0 -45
- package/node/lib/fbs/worker/close-request.d.ts +0 -18
- package/node/lib/fbs/worker/close-request.d.ts.map +0 -1
- package/node/lib/fbs/worker/close-request.js +0 -45
- package/node/lib/fbs/worker/close-worker-notification.d.ts +0 -18
- package/node/lib/fbs/worker/close-worker-notification.d.ts.map +0 -1
- package/node/lib/fbs/worker/close-worker-notification.js +0 -45
- package/worker/include/ChannelMessageRegistrator.hpp +0 -30
- package/worker/include/DepUsrSCTP.hpp +0 -48
- package/worker/include/RTC/SCTP/TODO_SCTP.md +0 -43
- package/worker/include/RTC/SCTP/common/UnwrappedSequenceNumber.hpp +0 -274
- package/worker/include/RTC/SctpAssociation.hpp +0 -147
- package/worker/include/RTC/Shared.hpp +0 -23
- package/worker/src/ChannelMessageRegistrator.cpp +0 -119
- package/worker/src/DepUsrSCTP.cpp +0 -277
- package/worker/src/RTC/SctpAssociation.cpp +0 -1175
- package/worker/src/RTC/Shared.cpp +0 -23
- package/worker/subprojects/usrsctp.wrap +0 -8
|
@@ -148,18 +148,35 @@ namespace RTC
|
|
|
148
148
|
return clonedChunk;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
void SackChunk::SetCumulativeTsnAck(uint32_t
|
|
151
|
+
void SackChunk::SetCumulativeTsnAck(uint32_t tsn)
|
|
152
152
|
{
|
|
153
153
|
MS_TRACE();
|
|
154
154
|
|
|
155
|
-
Utils::Byte::Set4Bytes(const_cast<uint8_t*>(GetBuffer()), 4,
|
|
155
|
+
Utils::Byte::Set4Bytes(const_cast<uint8_t*>(GetBuffer()), 4, tsn);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
void SackChunk::SetAdvertisedReceiverWindowCredit(uint32_t
|
|
158
|
+
void SackChunk::SetAdvertisedReceiverWindowCredit(uint32_t aRwnd)
|
|
159
159
|
{
|
|
160
160
|
MS_TRACE();
|
|
161
161
|
|
|
162
|
-
Utils::Byte::Set4Bytes(const_cast<uint8_t*>(GetBuffer()), 8,
|
|
162
|
+
Utils::Byte::Set4Bytes(const_cast<uint8_t*>(GetBuffer()), 8, aRwnd);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
std::vector<SackChunk::GapAckBlock> SackChunk::GetGapAckBlocks() const
|
|
166
|
+
{
|
|
167
|
+
MS_TRACE();
|
|
168
|
+
|
|
169
|
+
const uint16_t numberOfGapAckBlocks = GetNumberOfGapAckBlocks();
|
|
170
|
+
std::vector<SackChunk::GapAckBlock> gapAckBlocks;
|
|
171
|
+
|
|
172
|
+
gapAckBlocks.reserve(numberOfGapAckBlocks);
|
|
173
|
+
|
|
174
|
+
for (uint16_t idx{ 0 }; idx < numberOfGapAckBlocks; ++idx)
|
|
175
|
+
{
|
|
176
|
+
gapAckBlocks.emplace_back(GetAckBlockStartAt(idx), GetAckBlockEndAt(idx));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return gapAckBlocks;
|
|
163
180
|
}
|
|
164
181
|
|
|
165
182
|
std::vector<SackChunk::GapAckBlock> SackChunk::GetValidatedGapAckBlocks() const
|
|
@@ -141,11 +141,11 @@ namespace RTC
|
|
|
141
141
|
|
|
142
142
|
if (HasAdditionalInformation())
|
|
143
143
|
{
|
|
144
|
-
return "info
|
|
144
|
+
return "info::\"" +
|
|
145
145
|
std::string(
|
|
146
146
|
reinterpret_cast<const char*>(GetAdditionalInformation()),
|
|
147
147
|
GetAdditionalInformationLength()) +
|
|
148
|
-
"
|
|
148
|
+
"\"";
|
|
149
149
|
}
|
|
150
150
|
else
|
|
151
151
|
{
|
|
@@ -29,5 +29,13 @@ namespace RTC
|
|
|
29
29
|
MS_DUMP_CLEAN(indentation, " payload length: %zu", GetPayloadLength());
|
|
30
30
|
MS_DUMP_CLEAN(indentation, "</SCTP::Message>");
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
void Message::SetStreamId(uint16_t streamId)
|
|
34
|
+
{
|
|
35
|
+
MS_TRACE();
|
|
36
|
+
|
|
37
|
+
this->streamId = streamId;
|
|
38
|
+
;
|
|
39
|
+
}
|
|
32
40
|
} // namespace SCTP
|
|
33
41
|
} // namespace RTC
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#define MS_CLASS "RTC::SCTP::SctpOptions"
|
|
2
|
+
// #define MS_LOG_DEV_LEVEL 3
|
|
3
|
+
|
|
4
|
+
#include "RTC/SCTP/public/SctpOptions.hpp"
|
|
5
|
+
#include "Logger.hpp"
|
|
6
|
+
#include "RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp"
|
|
7
|
+
#include <string>
|
|
8
|
+
|
|
9
|
+
namespace RTC
|
|
10
|
+
{
|
|
11
|
+
namespace SCTP
|
|
12
|
+
{
|
|
13
|
+
/* Instance methods. */
|
|
14
|
+
|
|
15
|
+
void SctpOptions::Dump(int indentation) const
|
|
16
|
+
{
|
|
17
|
+
MS_TRACE();
|
|
18
|
+
|
|
19
|
+
MS_DUMP_CLEAN(indentation, "<SCTP::SctpOptions>");
|
|
20
|
+
MS_DUMP_CLEAN(indentation, " source port: %" PRIu16, this->sourcePort);
|
|
21
|
+
MS_DUMP_CLEAN(indentation, " destination port: %" PRIu16, this->destinationPort);
|
|
22
|
+
MS_DUMP_CLEAN(
|
|
23
|
+
indentation, " announced max outbound streams: %" PRIu16, this->announcedMaxOutboundStreams);
|
|
24
|
+
MS_DUMP_CLEAN(
|
|
25
|
+
indentation, " announced max inbound streams: %" PRIu16, this->announcedMaxInboundStreams);
|
|
26
|
+
MS_DUMP_CLEAN(indentation, " mtu: %zu", this->mtu);
|
|
27
|
+
MS_DUMP_CLEAN(indentation, " max send message size: %zu", this->maxSendMessageSize);
|
|
28
|
+
MS_DUMP_CLEAN(indentation, " max send buffer size: %zu", this->maxSendBufferSize);
|
|
29
|
+
MS_DUMP_CLEAN(indentation, " per stream send queue limit: %zu", this->perStreamSendQueueLimit);
|
|
30
|
+
MS_DUMP_CLEAN(indentation, " max receive message size: %zu", this->maxReceiveMessageSize);
|
|
31
|
+
MS_DUMP_CLEAN(indentation, " max receiver window size: %zu", this->maxReceiverWindowBufferSize);
|
|
32
|
+
MS_DUMP_CLEAN(
|
|
33
|
+
indentation,
|
|
34
|
+
" total buffered amount low threshold: %zu",
|
|
35
|
+
this->totalBufferedAmountLowThreshold);
|
|
36
|
+
MS_DUMP_CLEAN(indentation, " default stream priority: %" PRIu16, this->defaultStreamPriority);
|
|
37
|
+
MS_DUMP_CLEAN(indentation, " max rtt (ms): %" PRIu64, this->maxRttMs);
|
|
38
|
+
MS_DUMP_CLEAN(indentation, " initial rto (ms): %" PRIu64, this->initialRtoMs);
|
|
39
|
+
MS_DUMP_CLEAN(indentation, " min rto (ms): %" PRIu64, this->minRtoMs);
|
|
40
|
+
MS_DUMP_CLEAN(indentation, " max rto (ms): %" PRIu64, this->maxRtoMs);
|
|
41
|
+
MS_DUMP_CLEAN(indentation, " t1-init timeout (ms): %" PRIu64, this->t1InitTimeoutMs);
|
|
42
|
+
MS_DUMP_CLEAN(indentation, " t1-cookie timeout (ms): %" PRIu64, this->t1CookieTimeoutMs);
|
|
43
|
+
MS_DUMP_CLEAN(indentation, " t2-shutdown timeout (ms): %" PRIu64, this->t2ShutdownTimeoutMs);
|
|
44
|
+
MS_DUMP_CLEAN(
|
|
45
|
+
indentation,
|
|
46
|
+
" timer max backoff timeout (ms): %s",
|
|
47
|
+
this->timerMaxBackoffTimeoutMs
|
|
48
|
+
? std::to_string(this->timerMaxBackoffTimeoutMs.value()).c_str()
|
|
49
|
+
: "Infinite");
|
|
50
|
+
MS_DUMP_CLEAN(indentation, " heartbeat interval (ms): %" PRIu64, this->heartbeatIntervalMs);
|
|
51
|
+
MS_DUMP_CLEAN(
|
|
52
|
+
indentation, " delayed ack max timeout (ms): %" PRIu64, this->delayedAckMaxTimeoutMs);
|
|
53
|
+
MS_DUMP_CLEAN(indentation, " min rtt variance (ms): %" PRIu64, this->minRttVarianceMs);
|
|
54
|
+
MS_DUMP_CLEAN(indentation, " initial cwnd mtus: %zu", this->initialCwndMtus);
|
|
55
|
+
MS_DUMP_CLEAN(indentation, " min cwnd mtus: %zu", this->minCwndMtus);
|
|
56
|
+
MS_DUMP_CLEAN(
|
|
57
|
+
indentation, " avoid fragmentation cwnd mtus: %zu", this->avoidFragmentationCwndMtus);
|
|
58
|
+
MS_DUMP_CLEAN(
|
|
59
|
+
indentation, " immediate sack under cwnd mtus: %zu", this->immediateSackUnderCwndMtus);
|
|
60
|
+
MS_DUMP_CLEAN(indentation, " max burst: %zu", this->maxBurst);
|
|
61
|
+
MS_DUMP_CLEAN(
|
|
62
|
+
indentation,
|
|
63
|
+
" max retransmissions: %s",
|
|
64
|
+
this->maxRetransmissions ? std::to_string(this->maxRetransmissions.value()).c_str()
|
|
65
|
+
: "Infinite");
|
|
66
|
+
MS_DUMP_CLEAN(
|
|
67
|
+
indentation,
|
|
68
|
+
" max init retransmissions: %s",
|
|
69
|
+
this->maxInitRetransmissions ? std::to_string(this->maxInitRetransmissions.value()).c_str()
|
|
70
|
+
: "Infinite");
|
|
71
|
+
MS_DUMP_CLEAN(
|
|
72
|
+
indentation, " enable partial reliability: %s", this->enablePartialReliability ? "yes" : "no");
|
|
73
|
+
MS_DUMP_CLEAN(
|
|
74
|
+
indentation,
|
|
75
|
+
" enable message interleaving: %s",
|
|
76
|
+
this->enableMessageInterleaving ? "yes" : "no");
|
|
77
|
+
MS_DUMP_CLEAN(
|
|
78
|
+
indentation,
|
|
79
|
+
" heartbeat interval include rtt: %s",
|
|
80
|
+
this->heartbeatIntervalIncludeRtt ? "yes" : "no");
|
|
81
|
+
MS_DUMP_CLEAN(
|
|
82
|
+
indentation,
|
|
83
|
+
" zero checksum alternate error detection method: %s",
|
|
84
|
+
ZeroChecksumAcceptableParameter::AlternateErrorDetectionMethodToString(
|
|
85
|
+
this->zeroChecksumAlternateErrorDetectionMethod)
|
|
86
|
+
.c_str());
|
|
87
|
+
MS_DUMP_CLEAN(indentation, "</SCTP::SctpOptions>");
|
|
88
|
+
}
|
|
89
|
+
} // namespace SCTP
|
|
90
|
+
} // namespace RTC
|
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
#define MS_CLASS "RTC::SCTP::DataTracker"
|
|
2
|
+
// #define MS_LOG_DEV_LEVEL 3
|
|
3
|
+
|
|
4
|
+
#include "RTC/SCTP/rx/DataTracker.hpp"
|
|
5
|
+
#include "Logger.hpp"
|
|
6
|
+
#include "RTC/SCTP/packet/chunks/SackChunk.hpp"
|
|
7
|
+
#include <ranges>
|
|
8
|
+
|
|
9
|
+
namespace RTC
|
|
10
|
+
{
|
|
11
|
+
namespace SCTP
|
|
12
|
+
{
|
|
13
|
+
DataTracker::DataTracker(BackoffTimerHandleInterface* delayedAckTimer, uint32_t remoteInitialTsn)
|
|
14
|
+
: delayedAckTimer(delayedAckTimer),
|
|
15
|
+
lastCumulativeAckedTsn(this->tsnUnwrapper.Unwrap(remoteInitialTsn - 1))
|
|
16
|
+
{
|
|
17
|
+
MS_TRACE();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
bool DataTracker::IsTsnValid(uint32_t tsn) const
|
|
21
|
+
{
|
|
22
|
+
MS_TRACE();
|
|
23
|
+
|
|
24
|
+
// Note that this method doesn't return `false` for old DATA/I-DATA chunks,
|
|
25
|
+
// as those are actually valid, and receiving those may affect the
|
|
26
|
+
// generated SACK response (by setting "duplicate TSNs").
|
|
27
|
+
|
|
28
|
+
const Types::UnwrappedTsn unwrappedTsn = this->tsnUnwrapper.PeekUnwrap(tsn);
|
|
29
|
+
const uint32_t difference =
|
|
30
|
+
Types::UnwrappedTsn::Difference(unwrappedTsn, this->lastCumulativeAckedTsn);
|
|
31
|
+
|
|
32
|
+
if (difference > DataTracker::MaxAcceptedOutstandingFragments)
|
|
33
|
+
{
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
bool DataTracker::Observe(uint32_t tsn, bool immediateAck)
|
|
41
|
+
{
|
|
42
|
+
MS_TRACE();
|
|
43
|
+
|
|
44
|
+
const Types::UnwrappedTsn unwrappedTsn = this->tsnUnwrapper.Unwrap(tsn);
|
|
45
|
+
|
|
46
|
+
// `IsTsnValid()` must be called prior to calling this method.
|
|
47
|
+
MS_ASSERT(
|
|
48
|
+
Types::UnwrappedTsn::Difference(unwrappedTsn, this->lastCumulativeAckedTsn) <=
|
|
49
|
+
DataTracker::MaxAcceptedOutstandingFragments,
|
|
50
|
+
"Types::UnwrappedTsn::Difference(unwrappedTsn, this->lastCumulativeAckedTsn) > DataTracker::MaxAcceptedOutstandingFragments");
|
|
51
|
+
|
|
52
|
+
bool isDuplicate = false;
|
|
53
|
+
|
|
54
|
+
// Old chunk already seen before?
|
|
55
|
+
if (unwrappedTsn <= this->lastCumulativeAckedTsn)
|
|
56
|
+
{
|
|
57
|
+
if (this->duplicateTsns.size() < DataTracker::MaxDuplicateTsnReported)
|
|
58
|
+
{
|
|
59
|
+
this->duplicateTsns.insert(unwrappedTsn.Wrap());
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// https://datatracker.ietf.org/doc/html/rfc9260#section-6.2
|
|
63
|
+
//
|
|
64
|
+
// "When a packet arrives with duplicate DATA chunk(s) and with no new
|
|
65
|
+
// DATA chunk(s), the endpoint MUST immediately send a SACK with no
|
|
66
|
+
// delay. If a packet arrives with duplicate DATA chunk(s) bundled with
|
|
67
|
+
// new DATA chunks, the endpoint MAY immediately send a SACK."
|
|
68
|
+
UpdateAckState(AckState::IMMEDIATE, "duplicate data");
|
|
69
|
+
|
|
70
|
+
isDuplicate = true;
|
|
71
|
+
}
|
|
72
|
+
else
|
|
73
|
+
{
|
|
74
|
+
if (unwrappedTsn == this->lastCumulativeAckedTsn.GetNextValue())
|
|
75
|
+
{
|
|
76
|
+
this->lastCumulativeAckedTsn = unwrappedTsn;
|
|
77
|
+
|
|
78
|
+
// The cumulative acked `tsn` may be moved even further, if a gap was
|
|
79
|
+
// filled.
|
|
80
|
+
if (
|
|
81
|
+
!this->additionalTsnBlocks.IsEmpty() && this->additionalTsnBlocks.Front().firstTsn ==
|
|
82
|
+
this->lastCumulativeAckedTsn.GetNextValue())
|
|
83
|
+
{
|
|
84
|
+
this->lastCumulativeAckedTsn = this->additionalTsnBlocks.Front().lastTsn;
|
|
85
|
+
this->additionalTsnBlocks.PopFront();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else
|
|
89
|
+
{
|
|
90
|
+
const bool inserted = this->additionalTsnBlocks.Add(unwrappedTsn);
|
|
91
|
+
|
|
92
|
+
if (!inserted)
|
|
93
|
+
{
|
|
94
|
+
// Already seen before.
|
|
95
|
+
if (this->duplicateTsns.size() < DataTracker::MaxDuplicateTsnReported)
|
|
96
|
+
{
|
|
97
|
+
this->duplicateTsns.insert(unwrappedTsn.Wrap());
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// https://datatracker.ietf.org/doc/html/rfc9260#section-6.2
|
|
101
|
+
//
|
|
102
|
+
// "When a packet arrives with duplicate DATA chunk(s) and with no
|
|
103
|
+
// new DATA chunk(s), the endpoint MUST immediately send a SACK with
|
|
104
|
+
// no delay. If a packet arrives with duplicate DATA chunk(s)
|
|
105
|
+
// bundled with new DATA chunks, the endpoint MAY immediately send a
|
|
106
|
+
// SACK."
|
|
107
|
+
//
|
|
108
|
+
// No need to do this. SACKs are sent immediately on packet loss below.
|
|
109
|
+
isDuplicate = true;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// https://tools.ietf.org/html/rfc9260#section-6.7
|
|
115
|
+
//
|
|
116
|
+
// "Upon the reception of a new DATA chunk, an endpoint shall examine the
|
|
117
|
+
// continuity of the TSNs received. If the endpoint detects a gap in the
|
|
118
|
+
// received DATA chunk sequence, it SHOULD send a SACK with Gap Ack Blocks
|
|
119
|
+
// immediately. The data receiver continues sending a SACK after receipt
|
|
120
|
+
// of each SCTP packet that doesn't fill the gap."
|
|
121
|
+
if (!this->additionalTsnBlocks.IsEmpty())
|
|
122
|
+
{
|
|
123
|
+
UpdateAckState(AckState::IMMEDIATE, "packet loss");
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// https://tools.ietf.org/html/rfc7053#section-5.2
|
|
127
|
+
//
|
|
128
|
+
// "Upon receipt of an SCTP packet containing a DATA chunk with the I bit
|
|
129
|
+
// set, the receiver SHOULD NOT delay the sending of the corresponding
|
|
130
|
+
// SACK chunk, i.e., the receiver SHOULD immediately respond with the
|
|
131
|
+
// corresponding SACK chunk."
|
|
132
|
+
if (immediateAck)
|
|
133
|
+
{
|
|
134
|
+
UpdateAckState(AckState::IMMEDIATE, "immediate-ack bit set");
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (!this->packetSeen)
|
|
138
|
+
{
|
|
139
|
+
// https://tools.ietf.org/html/rfc9260#section-5.1
|
|
140
|
+
//
|
|
141
|
+
// "After the reception of the first DATA chunk in an association the
|
|
142
|
+
// endpoint MUST immediately respond with a SACK to acknowledge the DATA
|
|
143
|
+
// chunk."
|
|
144
|
+
this->packetSeen = true;
|
|
145
|
+
|
|
146
|
+
UpdateAckState(AckState::IMMEDIATE, "first data chunk");
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// https://tools.ietf.org/html/rfc9260#section-6.2
|
|
150
|
+
//
|
|
151
|
+
// "Specifically, an acknowledgement SHOULD be generated for at least
|
|
152
|
+
// every second packet (not every second DATA chunk) received, and SHOULD
|
|
153
|
+
// be generated within 200 ms of the arrival of any unacknowledged DATA
|
|
154
|
+
// chunk."
|
|
155
|
+
if (this->ackState == AckState::IDLE)
|
|
156
|
+
{
|
|
157
|
+
UpdateAckState(AckState::BECOMING_DELAYED, "received data when idle");
|
|
158
|
+
}
|
|
159
|
+
else if (this->ackState == AckState::DELAYED)
|
|
160
|
+
{
|
|
161
|
+
UpdateAckState(AckState::IMMEDIATE, "received data when already delayed");
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return !isDuplicate;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
void DataTracker::ObservePacketEnd()
|
|
168
|
+
{
|
|
169
|
+
MS_TRACE();
|
|
170
|
+
|
|
171
|
+
if (this->ackState == AckState::BECOMING_DELAYED)
|
|
172
|
+
{
|
|
173
|
+
UpdateAckState(AckState::DELAYED, "packet end");
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
bool DataTracker::HandleForwardTsn(uint32_t newCumulativeTsn)
|
|
178
|
+
{
|
|
179
|
+
// Forward-TSN is sent to make the receiver (this association) "forget"
|
|
180
|
+
// about partly received (or not received at all) data, up until
|
|
181
|
+
// `newCumulativeTsn`.
|
|
182
|
+
|
|
183
|
+
const Types::UnwrappedTsn unwrappedTsn = this->tsnUnwrapper.Unwrap(newCumulativeTsn);
|
|
184
|
+
#if MS_LOG_DEV_LEVEL == 3
|
|
185
|
+
const Types::UnwrappedTsn prevLastCumAckTsn = this->lastCumulativeAckedTsn;
|
|
186
|
+
#endif
|
|
187
|
+
|
|
188
|
+
// Old chunk already seen before?
|
|
189
|
+
if (unwrappedTsn <= this->lastCumulativeAckedTsn)
|
|
190
|
+
{
|
|
191
|
+
// https://tools.ietf.org/html/rfc3758#section-3.6
|
|
192
|
+
//
|
|
193
|
+
// "Note, if the "New Cumulative TSN" value carried in the arrived
|
|
194
|
+
// FORWARD-TSN chunk is found to be behind or at the current cumulative
|
|
195
|
+
// TSN point, the data receiver MUST treat this FORWARD TSN as out-of-date
|
|
196
|
+
// and MUST NOT update its Cumulative TSN. The receiver SHOULD send a
|
|
197
|
+
// SACK to its peer (the sender of the FORWARD TSN) since such a duplicate
|
|
198
|
+
// may indicate the previous SACK was lost in the network."
|
|
199
|
+
UpdateAckState(AckState::IMMEDIATE, "Forward TSN new cumulative tsn was behind");
|
|
200
|
+
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// https://tools.ietf.org/html/rfc3758#section-3.6
|
|
205
|
+
//
|
|
206
|
+
// "When a FORWARD TSN chunk arrives, the data receiver MUST first update
|
|
207
|
+
// its cumulative TSN point to the value carried in the FORWARD TSN chunk,
|
|
208
|
+
// and then MUST further advance its cumulative TSN point locally if
|
|
209
|
+
// possible"
|
|
210
|
+
|
|
211
|
+
// The `newCumulativeTsn` will become the current
|
|
212
|
+
// `this->lastCumulativeAckedTsn`, and if there have been prior "gaps"
|
|
213
|
+
// that are now overlapping with the new value, remove them.
|
|
214
|
+
this->lastCumulativeAckedTsn = unwrappedTsn;
|
|
215
|
+
this->additionalTsnBlocks.EraseTo(unwrappedTsn);
|
|
216
|
+
|
|
217
|
+
// See if the `this->lastCumulativeAckedTsn` can be moved even further.
|
|
218
|
+
if (
|
|
219
|
+
!this->additionalTsnBlocks.IsEmpty() &&
|
|
220
|
+
this->additionalTsnBlocks.Front().firstTsn == this->lastCumulativeAckedTsn.GetNextValue())
|
|
221
|
+
{
|
|
222
|
+
this->lastCumulativeAckedTsn = this->additionalTsnBlocks.Front().lastTsn;
|
|
223
|
+
this->additionalTsnBlocks.PopFront();
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
MS_DEBUG_DEV(
|
|
227
|
+
"Forward TSN [prevLastCumAckTsn:%" PRIu32 ", newCumulativeTsn:%" PRIu32
|
|
228
|
+
", lastCumulativeAckedTsn:%" PRIu32,
|
|
229
|
+
prevLastCumAckTsn.Wrap(),
|
|
230
|
+
newCumulativeTsn,
|
|
231
|
+
this->lastCumulativeAckedTsn.Wrap());
|
|
232
|
+
|
|
233
|
+
// https://tools.ietf.org/html/rfc3758#section-3.6
|
|
234
|
+
//
|
|
235
|
+
// "Any time a FORWARD TSN chunk arrives, for the purposes of sending a
|
|
236
|
+
// SACK, the receiver MUST follow the same rules as if a DATA chunk had
|
|
237
|
+
// been received (i.e., follow the delayed sack rules specified in ...".
|
|
238
|
+
if (this->ackState == AckState::IDLE)
|
|
239
|
+
{
|
|
240
|
+
UpdateAckState(AckState::BECOMING_DELAYED, "received forward TSN when idle");
|
|
241
|
+
}
|
|
242
|
+
else if (this->ackState == AckState::DELAYED)
|
|
243
|
+
{
|
|
244
|
+
UpdateAckState(AckState::IMMEDIATE, "received forward TSN when already delayed");
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
bool DataTracker::ShouldSendAck(bool alsoIfDelayed)
|
|
251
|
+
{
|
|
252
|
+
MS_TRACE();
|
|
253
|
+
|
|
254
|
+
if (
|
|
255
|
+
this->ackState == AckState::IMMEDIATE ||
|
|
256
|
+
(alsoIfDelayed &&
|
|
257
|
+
(this->ackState == AckState::BECOMING_DELAYED || this->ackState == AckState::DELAYED)))
|
|
258
|
+
{
|
|
259
|
+
UpdateAckState(AckState::IDLE, "should send SACK");
|
|
260
|
+
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
return false;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
void DataTracker::ForceImmediateSack()
|
|
268
|
+
{
|
|
269
|
+
MS_TRACE();
|
|
270
|
+
|
|
271
|
+
UpdateAckState(AckState::IMMEDIATE, "force immediate SACK");
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
bool DataTracker::WillIncreaseCumAckTsn(uint32_t tsn) const
|
|
275
|
+
{
|
|
276
|
+
MS_TRACE();
|
|
277
|
+
|
|
278
|
+
const Types::UnwrappedTsn unwrappedTsn = this->tsnUnwrapper.PeekUnwrap(tsn);
|
|
279
|
+
|
|
280
|
+
return unwrappedTsn == this->lastCumulativeAckedTsn.GetNextValue();
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
void DataTracker::AddSackSelectiveAck(Packet* packet, size_t aRwnd)
|
|
284
|
+
{
|
|
285
|
+
MS_TRACE();
|
|
286
|
+
|
|
287
|
+
// Note that in SCTP, the receiver side is allowed to discard received data
|
|
288
|
+
// and signal that to the sender, but only chunks that have previously been
|
|
289
|
+
// reported in the gap-ack-blocks. However, this implementation will never
|
|
290
|
+
// do that. So this SACK produced is more like a NR-SACK as explained in
|
|
291
|
+
// https://ieeexplore.ieee.org/document/4697037 and which there is an RFC
|
|
292
|
+
// draft at https://tools.ietf.org/html/draft-tuexen-tsvwg-sctp-multipath-17.
|
|
293
|
+
|
|
294
|
+
auto* sackChunk = packet->BuildChunkInPlace<SackChunk>();
|
|
295
|
+
|
|
296
|
+
sackChunk->SetCumulativeTsnAck(this->lastCumulativeAckedTsn.Wrap());
|
|
297
|
+
sackChunk->SetAdvertisedReceiverWindowCredit(aRwnd);
|
|
298
|
+
|
|
299
|
+
const auto& tsnBlocks = this->additionalTsnBlocks.GetBlocks();
|
|
300
|
+
|
|
301
|
+
for (size_t i{ 0 }; i < tsnBlocks.size() && i < DataTracker::MaxGapAckBlocksReported; ++i)
|
|
302
|
+
{
|
|
303
|
+
const auto startDiff =
|
|
304
|
+
Types::UnwrappedTsn::Difference(tsnBlocks[i].firstTsn, this->lastCumulativeAckedTsn);
|
|
305
|
+
const auto endDiff =
|
|
306
|
+
Types::UnwrappedTsn::Difference(tsnBlocks[i].lastTsn, this->lastCumulativeAckedTsn);
|
|
307
|
+
|
|
308
|
+
sackChunk->AddAckBlock(startDiff, endDiff);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
std::set<uint32_t> duplicateTsns;
|
|
312
|
+
|
|
313
|
+
this->duplicateTsns.swap(duplicateTsns);
|
|
314
|
+
|
|
315
|
+
for (const uint32_t tsn : duplicateTsns)
|
|
316
|
+
{
|
|
317
|
+
sackChunk->AddDuplicateTsn(tsn);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
sackChunk->Consolidate();
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
void DataTracker::HandleDelayedAckTimerExpiry()
|
|
324
|
+
{
|
|
325
|
+
MS_TRACE();
|
|
326
|
+
|
|
327
|
+
UpdateAckState(AckState::IMMEDIATE, "delayed ack timer expired");
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
#if MS_LOG_DEV_LEVEL == 3
|
|
331
|
+
void DataTracker::UpdateAckState(AckState newAckState, std::string_view reason)
|
|
332
|
+
#else
|
|
333
|
+
void DataTracker::UpdateAckState(AckState newAckState, std::string_view /*reason*/)
|
|
334
|
+
#endif
|
|
335
|
+
{
|
|
336
|
+
MS_TRACE();
|
|
337
|
+
|
|
338
|
+
if (newAckState != this->ackState)
|
|
339
|
+
{
|
|
340
|
+
#if MS_LOG_DEV_LEVEL == 3
|
|
341
|
+
const auto& previousAckStateStrView = DataTracker::AckStateToString(this->ackState);
|
|
342
|
+
const auto& newAckStateStrView = DataTracker::AckStateToString(newAckState);
|
|
343
|
+
|
|
344
|
+
MS_DEBUG_DEV(
|
|
345
|
+
"ack state changed from %.*s to %.*s due to %.*s",
|
|
346
|
+
static_cast<int>(previousAckStateStrView.size()),
|
|
347
|
+
previousAckStateStrView.data(),
|
|
348
|
+
static_cast<int>(newAckStateStrView.size()),
|
|
349
|
+
newAckStateStrView.data(),
|
|
350
|
+
static_cast<int>(reason.size()),
|
|
351
|
+
reason.data());
|
|
352
|
+
#endif
|
|
353
|
+
|
|
354
|
+
if (this->ackState == AckState::DELAYED)
|
|
355
|
+
{
|
|
356
|
+
this->delayedAckTimer->Stop();
|
|
357
|
+
}
|
|
358
|
+
else if (newAckState == AckState::DELAYED)
|
|
359
|
+
{
|
|
360
|
+
this->delayedAckTimer->Start();
|
|
361
|
+
}
|
|
362
|
+
this->ackState = newAckState;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
bool DataTracker::AdditionalTsnBlocks::Add(Types::UnwrappedTsn tsn)
|
|
367
|
+
{
|
|
368
|
+
MS_TRACE();
|
|
369
|
+
|
|
370
|
+
// Find any block to expand. It will look for any block that includes (also
|
|
371
|
+
// when expanded) the provided `tsn`. It will return the block that is greater
|
|
372
|
+
// than, or equal to `tsn`.
|
|
373
|
+
const auto it = std::ranges::lower_bound(
|
|
374
|
+
this->blocks,
|
|
375
|
+
tsn,
|
|
376
|
+
std::less<Types::UnwrappedTsn>{},
|
|
377
|
+
[](const TsnRange& e)
|
|
378
|
+
{
|
|
379
|
+
return e.lastTsn.GetNextValue();
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
// No matching block found. There is no greater than, or equal block,
|
|
383
|
+
// which means that this TSN is greater than any block. It can then be
|
|
384
|
+
// inserted at the end.
|
|
385
|
+
if (it == this->blocks.end())
|
|
386
|
+
{
|
|
387
|
+
this->blocks.emplace_back(tsn, tsn);
|
|
388
|
+
|
|
389
|
+
return true;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// `tsn` is already in this block.
|
|
393
|
+
if (tsn >= it->firstTsn && tsn <= it->lastTsn)
|
|
394
|
+
{
|
|
395
|
+
return false;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// This block can be expanded to the right, or merged with the next.
|
|
399
|
+
if (it->lastTsn.GetNextValue() == tsn)
|
|
400
|
+
{
|
|
401
|
+
const auto nextIt = it + 1;
|
|
402
|
+
|
|
403
|
+
if (nextIt != this->blocks.end() && tsn.GetNextValue() == nextIt->firstTsn)
|
|
404
|
+
{
|
|
405
|
+
// Expanding it would make it adjacent to next block, merge those.
|
|
406
|
+
it->lastTsn = nextIt->lastTsn;
|
|
407
|
+
|
|
408
|
+
this->blocks.erase(nextIt);
|
|
409
|
+
|
|
410
|
+
return true;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// Expand to the right.
|
|
414
|
+
it->lastTsn = tsn;
|
|
415
|
+
|
|
416
|
+
return true;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// This block can be expanded to the left. Merging to the left would've
|
|
420
|
+
// been covered by the above "merge to the right". Both blocks (expand a
|
|
421
|
+
// right-most block to the left and expand a left-most block to the right)
|
|
422
|
+
// would match, but the left-most would be returned by std::lower_bound.
|
|
423
|
+
if (it->firstTsn == tsn.GetNextValue())
|
|
424
|
+
{
|
|
425
|
+
MS_ASSERT(
|
|
426
|
+
it == this->blocks.begin() || (it - 1)->lastTsn.GetNextValue() != tsn,
|
|
427
|
+
"got wrong iterator");
|
|
428
|
+
|
|
429
|
+
it->firstTsn = tsn;
|
|
430
|
+
|
|
431
|
+
return true;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// Need to create a new block in the middle.
|
|
435
|
+
this->blocks.emplace(it, tsn, tsn);
|
|
436
|
+
|
|
437
|
+
return true;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
void DataTracker::AdditionalTsnBlocks::EraseTo(Types::UnwrappedTsn tsn)
|
|
441
|
+
{
|
|
442
|
+
MS_TRACE();
|
|
443
|
+
|
|
444
|
+
// Find the block that is greater than or equals `tsn`.
|
|
445
|
+
const auto it = std::ranges::lower_bound(
|
|
446
|
+
this->blocks, tsn, std::less<Types::UnwrappedTsn>{}, &TsnRange::lastTsn);
|
|
447
|
+
|
|
448
|
+
// The block that is found is greater or equal (or possibly ::end(), when
|
|
449
|
+
// no block is greater or equal). All blocks before this block can be
|
|
450
|
+
// safely removed. The TSN might be within this block, so possibly truncate
|
|
451
|
+
// it.
|
|
452
|
+
const bool tsnIsWithinBlock = it != this->blocks.end() && tsn >= it->firstTsn;
|
|
453
|
+
|
|
454
|
+
this->blocks.erase(this->blocks.begin(), it);
|
|
455
|
+
|
|
456
|
+
if (tsnIsWithinBlock)
|
|
457
|
+
{
|
|
458
|
+
this->blocks.front().firstTsn = tsn.GetNextValue();
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
void DataTracker::AdditionalTsnBlocks::PopFront()
|
|
463
|
+
{
|
|
464
|
+
MS_TRACE();
|
|
465
|
+
|
|
466
|
+
MS_ASSERT(!this->blocks.empty(), "this->blocks is empty");
|
|
467
|
+
|
|
468
|
+
this->blocks.erase(this->blocks.begin());
|
|
469
|
+
}
|
|
470
|
+
} // namespace SCTP
|
|
471
|
+
} // namespace RTC
|