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
|
@@ -25,7 +25,7 @@ namespace RTC
|
|
|
25
25
|
this->listenerDeferrer.TriggerDeferredCallbacks();
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
AssociationListenerDeferrer::AssociationListenerDeferrer(
|
|
28
|
+
AssociationListenerDeferrer::AssociationListenerDeferrer(AssociationListenerInterface* innerListener)
|
|
29
29
|
: innerListener(innerListener)
|
|
30
30
|
{
|
|
31
31
|
MS_TRACE();
|
|
@@ -87,7 +87,7 @@ namespace RTC
|
|
|
87
87
|
MS_ASSERT(this->ready, "not ready");
|
|
88
88
|
|
|
89
89
|
this->deferredCallbacks.emplace_back(
|
|
90
|
-
[](CallbackData /*data*/,
|
|
90
|
+
[](CallbackData /*data*/, AssociationListenerInterface* listener)
|
|
91
91
|
{
|
|
92
92
|
listener->OnAssociationConnecting();
|
|
93
93
|
},
|
|
@@ -101,7 +101,7 @@ namespace RTC
|
|
|
101
101
|
MS_ASSERT(this->ready, "not ready");
|
|
102
102
|
|
|
103
103
|
this->deferredCallbacks.emplace_back(
|
|
104
|
-
[](CallbackData /*data*/,
|
|
104
|
+
[](CallbackData /*data*/, AssociationListenerInterface* listener)
|
|
105
105
|
{
|
|
106
106
|
listener->OnAssociationConnected();
|
|
107
107
|
},
|
|
@@ -116,7 +116,7 @@ namespace RTC
|
|
|
116
116
|
MS_ASSERT(this->ready, "not ready");
|
|
117
117
|
|
|
118
118
|
this->deferredCallbacks.emplace_back(
|
|
119
|
-
[](CallbackData data,
|
|
119
|
+
[](CallbackData data, AssociationListenerInterface* listener)
|
|
120
120
|
{
|
|
121
121
|
const Error error = std::get<Error>(std::move(data));
|
|
122
122
|
listener->OnAssociationFailed(error.errorKind, error.message);
|
|
@@ -132,7 +132,7 @@ namespace RTC
|
|
|
132
132
|
MS_ASSERT(this->ready, "not ready");
|
|
133
133
|
|
|
134
134
|
this->deferredCallbacks.emplace_back(
|
|
135
|
-
[](CallbackData data,
|
|
135
|
+
[](CallbackData data, AssociationListenerInterface* listener)
|
|
136
136
|
{
|
|
137
137
|
const Error error = std::get<Error>(std::move(data));
|
|
138
138
|
listener->OnAssociationClosed(error.errorKind, error.message);
|
|
@@ -147,7 +147,7 @@ namespace RTC
|
|
|
147
147
|
MS_ASSERT(this->ready, "not ready");
|
|
148
148
|
|
|
149
149
|
this->deferredCallbacks.emplace_back(
|
|
150
|
-
[](CallbackData /*data*/,
|
|
150
|
+
[](CallbackData /*data*/, AssociationListenerInterface* listener)
|
|
151
151
|
{
|
|
152
152
|
listener->OnAssociationRestarted();
|
|
153
153
|
},
|
|
@@ -162,7 +162,7 @@ namespace RTC
|
|
|
162
162
|
MS_ASSERT(this->ready, "not ready");
|
|
163
163
|
|
|
164
164
|
this->deferredCallbacks.emplace_back(
|
|
165
|
-
[](CallbackData data,
|
|
165
|
+
[](CallbackData data, AssociationListenerInterface* listener)
|
|
166
166
|
{
|
|
167
167
|
const Error error = std::get<Error>(std::move(data));
|
|
168
168
|
listener->OnAssociationError(error.errorKind, error.message);
|
|
@@ -177,7 +177,7 @@ namespace RTC
|
|
|
177
177
|
MS_ASSERT(this->ready, "not ready");
|
|
178
178
|
|
|
179
179
|
this->deferredCallbacks.emplace_back(
|
|
180
|
-
[](CallbackData data,
|
|
180
|
+
[](CallbackData data, AssociationListenerInterface* listener)
|
|
181
181
|
{
|
|
182
182
|
listener->OnAssociationMessageReceived(std::get<Message>(std::move(data)));
|
|
183
183
|
},
|
|
@@ -192,7 +192,7 @@ namespace RTC
|
|
|
192
192
|
MS_ASSERT(this->ready, "not ready");
|
|
193
193
|
|
|
194
194
|
this->deferredCallbacks.emplace_back(
|
|
195
|
-
[](CallbackData data,
|
|
195
|
+
[](CallbackData data, AssociationListenerInterface* listener)
|
|
196
196
|
{
|
|
197
197
|
StreamReset streamReset = std::get<StreamReset>(std::move(data));
|
|
198
198
|
listener->OnAssociationStreamsResetPerformed(streamReset.streamIds);
|
|
@@ -208,7 +208,7 @@ namespace RTC
|
|
|
208
208
|
MS_ASSERT(this->ready, "not ready");
|
|
209
209
|
|
|
210
210
|
this->deferredCallbacks.emplace_back(
|
|
211
|
-
[](CallbackData data,
|
|
211
|
+
[](CallbackData data, AssociationListenerInterface* listener)
|
|
212
212
|
{
|
|
213
213
|
StreamReset streamReset = std::get<StreamReset>(std::move(data));
|
|
214
214
|
listener->OnAssociationStreamsResetFailed(streamReset.streamIds, streamReset.errorMessage);
|
|
@@ -225,7 +225,7 @@ namespace RTC
|
|
|
225
225
|
MS_ASSERT(this->ready, "not ready");
|
|
226
226
|
|
|
227
227
|
this->deferredCallbacks.emplace_back(
|
|
228
|
-
[](CallbackData data,
|
|
228
|
+
[](CallbackData data, AssociationListenerInterface* listener)
|
|
229
229
|
{
|
|
230
230
|
StreamReset streamReset = std::get<StreamReset>(std::move(data));
|
|
231
231
|
listener->OnAssociationInboundStreamsReset(streamReset.streamIds);
|
|
@@ -241,7 +241,7 @@ namespace RTC
|
|
|
241
241
|
MS_ASSERT(this->ready, "not ready");
|
|
242
242
|
|
|
243
243
|
this->deferredCallbacks.emplace_back(
|
|
244
|
-
[](CallbackData data,
|
|
244
|
+
[](CallbackData data, AssociationListenerInterface* listener)
|
|
245
245
|
{
|
|
246
246
|
listener->OnAssociationStreamBufferedAmountLow(std::get<uint16_t>(std::move(data)));
|
|
247
247
|
},
|
|
@@ -255,7 +255,7 @@ namespace RTC
|
|
|
255
255
|
MS_ASSERT(this->ready, "not ready");
|
|
256
256
|
|
|
257
257
|
this->deferredCallbacks.emplace_back(
|
|
258
|
-
[](CallbackData /*data*/,
|
|
258
|
+
[](CallbackData /*data*/, AssociationListenerInterface* listener)
|
|
259
259
|
{
|
|
260
260
|
listener->OnAssociationTotalBufferedAmountLow();
|
|
261
261
|
},
|
|
@@ -270,5 +270,38 @@ namespace RTC
|
|
|
270
270
|
// Will not be deferred but called directly.
|
|
271
271
|
return this->innerListener->OnAssociationIsTransportReadyForSctp();
|
|
272
272
|
}
|
|
273
|
+
|
|
274
|
+
void AssociationListenerDeferrer::OnAssociationLifecycleMessageFullySent(uint64_t lifecycleId)
|
|
275
|
+
{
|
|
276
|
+
MS_TRACE();
|
|
277
|
+
|
|
278
|
+
// Will not be deferred but called directly.
|
|
279
|
+
this->innerListener->OnAssociationLifecycleMessageFullySent(lifecycleId);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
void AssociationListenerDeferrer::OnAssociationLifecycleMessageExpired(
|
|
283
|
+
uint64_t lifecycleId, bool maybeDelivered)
|
|
284
|
+
{
|
|
285
|
+
MS_TRACE();
|
|
286
|
+
|
|
287
|
+
// Will not be deferred but called directly.
|
|
288
|
+
this->innerListener->OnAssociationLifecycleMessageExpired(lifecycleId, maybeDelivered);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
void AssociationListenerDeferrer::OnAssociationLifecycleMessageDelivered(uint64_t lifecycleId)
|
|
292
|
+
{
|
|
293
|
+
MS_TRACE();
|
|
294
|
+
|
|
295
|
+
// Will not be deferred but called directly.
|
|
296
|
+
this->innerListener->OnAssociationLifecycleMessageDelivered(lifecycleId);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
void AssociationListenerDeferrer::OnAssociationLifecycleMessageEnd(uint64_t lifecycleId)
|
|
300
|
+
{
|
|
301
|
+
MS_TRACE();
|
|
302
|
+
|
|
303
|
+
// Will not be deferred but called directly.
|
|
304
|
+
this->innerListener->OnAssociationLifecycleMessageEnd(lifecycleId);
|
|
305
|
+
}
|
|
273
306
|
} // namespace SCTP
|
|
274
307
|
} // namespace RTC
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
#define MS_CLASS "RTC::SCTP::HeartbeatHandler"
|
|
2
|
-
//
|
|
3
|
-
#define MS_LOG_DEV_LEVEL 3
|
|
2
|
+
// #define MS_LOG_DEV_LEVEL 3
|
|
4
3
|
|
|
5
4
|
#include "RTC/SCTP/association/HeartbeatHandler.hpp"
|
|
6
|
-
#include "DepLibUV.hpp"
|
|
7
5
|
#include "Logger.hpp"
|
|
8
|
-
#include "Utils.hpp"
|
|
9
6
|
#include "RTC/SCTP/packet/parameters/HeartbeatInfoParameter.hpp"
|
|
10
7
|
#include "RTC/SCTP/public/SctpTypes.hpp"
|
|
8
|
+
#include "Utils.hpp"
|
|
11
9
|
#include <string>
|
|
12
10
|
|
|
13
11
|
namespace RTC
|
|
@@ -21,28 +19,39 @@ namespace RTC
|
|
|
21
19
|
/* Instance methods. */
|
|
22
20
|
|
|
23
21
|
HeartbeatHandler::HeartbeatHandler(
|
|
24
|
-
|
|
22
|
+
AssociationListenerInterface& associationListener,
|
|
23
|
+
const SctpOptions& sctpOptions,
|
|
24
|
+
SharedInterface* shared,
|
|
25
|
+
TransmissionControlBlockContextInterface* tcbContext)
|
|
25
26
|
: associationListener(associationListener),
|
|
26
27
|
sctpOptions(sctpOptions),
|
|
28
|
+
shared(shared),
|
|
27
29
|
tcbContext(tcbContext),
|
|
28
30
|
intervalDurationMs(sctpOptions.heartbeatIntervalMs),
|
|
29
31
|
intervalDurationShouldIncludeRtt(sctpOptions.heartbeatIntervalIncludeRtt),
|
|
30
|
-
intervalTimer(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
intervalTimer(this->shared->CreateBackoffTimer(
|
|
33
|
+
BackoffTimerHandleInterface::BackoffTimerHandleOptions{
|
|
34
|
+
.listener = this,
|
|
35
|
+
.label = "sctp-heartbeat-interval",
|
|
36
|
+
.baseTimeoutMs = sctpOptions.initialRtoMs,
|
|
37
|
+
.backoffAlgorithm = BackoffTimerHandleInterface::BackoffAlgorithm::EXPONENTIAL,
|
|
38
|
+
.maxBackoffTimeoutMs = sctpOptions.timerMaxBackoffTimeoutMs,
|
|
39
|
+
.maxRestarts = std::nullopt })),
|
|
40
|
+
timeoutTimer(this->shared->CreateBackoffTimer(
|
|
41
|
+
BackoffTimerHandleInterface::BackoffTimerHandleOptions{
|
|
42
|
+
.listener = this,
|
|
43
|
+
.label = "sctp-heartbeat-timeout",
|
|
44
|
+
.baseTimeoutMs = sctpOptions.initialRtoMs,
|
|
45
|
+
.backoffAlgorithm = BackoffTimerHandleInterface::BackoffAlgorithm::FIXED,
|
|
46
|
+
.maxBackoffTimeoutMs = std::nullopt,
|
|
47
|
+
.maxRestarts = 0 }))
|
|
44
48
|
{
|
|
45
49
|
MS_TRACE();
|
|
50
|
+
|
|
51
|
+
// The interval timer must always be running as long as the association
|
|
52
|
+
// is up (so when the TCB is created, which is the one that creates the
|
|
53
|
+
// HeartbeatHandler.
|
|
54
|
+
RestartTimer();
|
|
46
55
|
}
|
|
47
56
|
|
|
48
57
|
HeartbeatHandler::~HeartbeatHandler()
|
|
@@ -100,7 +109,7 @@ namespace RTC
|
|
|
100
109
|
|
|
101
110
|
heartbeatAckChunk->Consolidate();
|
|
102
111
|
|
|
103
|
-
this->tcbContext->
|
|
112
|
+
this->tcbContext->SendPacket(packet.get());
|
|
104
113
|
}
|
|
105
114
|
|
|
106
115
|
void HeartbeatHandler::HandleReceivedHeartbeatAckChunk(
|
|
@@ -141,15 +150,15 @@ namespace RTC
|
|
|
141
150
|
}
|
|
142
151
|
|
|
143
152
|
const uint64_t createdAtMs = Utils::Byte::Get8Bytes(info, 0);
|
|
144
|
-
const uint64_t nowMs =
|
|
153
|
+
const uint64_t nowMs = this->shared->GetTimeMs();
|
|
145
154
|
|
|
146
155
|
if (createdAtMs > 0 && createdAtMs <= nowMs)
|
|
147
156
|
{
|
|
148
|
-
const uint64_t
|
|
157
|
+
const uint64_t rttMs = nowMs - createdAtMs;
|
|
149
158
|
|
|
150
|
-
MS_DEBUG_DEV("valid HEARTBEAT_ACK Chunk received, calling
|
|
159
|
+
MS_DEBUG_DEV("valid HEARTBEAT_ACK Chunk received, calling ObserveRttMs(%" PRIu64 ")", rttMs);
|
|
151
160
|
|
|
152
|
-
this->tcbContext->
|
|
161
|
+
this->tcbContext->ObserveRttMs(rttMs);
|
|
153
162
|
}
|
|
154
163
|
else
|
|
155
164
|
{
|
|
@@ -178,19 +187,12 @@ namespace RTC
|
|
|
178
187
|
return;
|
|
179
188
|
}
|
|
180
189
|
|
|
181
|
-
const auto maxRestarts = this->intervalTimer->GetMaxRestarts();
|
|
182
|
-
|
|
183
|
-
MS_DEBUG_TAG(
|
|
184
|
-
sctp,
|
|
185
|
-
"interval timer has expired %zu/%s]",
|
|
186
|
-
this->intervalTimer->GetExpirationCount(),
|
|
187
|
-
maxRestarts ? std::to_string(maxRestarts.value()).c_str() : "Infinite");
|
|
188
|
-
|
|
189
190
|
this->timeoutTimer->SetBaseTimeoutMs(this->tcbContext->GetCurrentRtoMs());
|
|
190
191
|
this->timeoutTimer->Start();
|
|
191
192
|
|
|
192
193
|
alignas(8) uint8_t info[HeartbeatInfoLength];
|
|
193
|
-
|
|
194
|
+
|
|
195
|
+
const uint64_t nowMs = this->shared->GetTimeMs();
|
|
194
196
|
|
|
195
197
|
Utils::Byte::Set8Bytes(info, 0, nowMs);
|
|
196
198
|
|
|
@@ -205,21 +207,13 @@ namespace RTC
|
|
|
205
207
|
|
|
206
208
|
MS_DEBUG_DEV("sending HEARTBEAT_REQUEST Chunk with info content [nowMs:%" PRIu64 "]", nowMs);
|
|
207
209
|
|
|
208
|
-
this->tcbContext->
|
|
210
|
+
this->tcbContext->SendPacket(packet.get());
|
|
209
211
|
}
|
|
210
212
|
|
|
211
213
|
void HeartbeatHandler::OnTimeoutTimer(uint64_t& /*baseTimeoutMs*/, bool& /*stop*/)
|
|
212
214
|
{
|
|
213
215
|
MS_TRACE();
|
|
214
216
|
|
|
215
|
-
const auto maxRestarts = this->timeoutTimer->GetMaxRestarts();
|
|
216
|
-
|
|
217
|
-
MS_DEBUG_TAG(
|
|
218
|
-
sctp,
|
|
219
|
-
"timeout timer has expired %zu/%s]",
|
|
220
|
-
this->timeoutTimer->GetExpirationCount(),
|
|
221
|
-
maxRestarts ? std::to_string(maxRestarts.value()).c_str() : "Infinite");
|
|
222
|
-
|
|
223
217
|
// Note that the timeout timer is not restarted. It will be started again when
|
|
224
218
|
// the interval timer expires.
|
|
225
219
|
MS_ASSERT(!this->timeoutTimer->IsRunning(), "timeout timer shouldn't be running");
|
|
@@ -227,10 +221,20 @@ namespace RTC
|
|
|
227
221
|
this->tcbContext->IncrementTxErrorCounter("hearbeat timeout");
|
|
228
222
|
}
|
|
229
223
|
|
|
230
|
-
void HeartbeatHandler::
|
|
224
|
+
void HeartbeatHandler::OnBackoffTimer(
|
|
225
|
+
BackoffTimerHandleInterface* backoffTimer, uint64_t& baseTimeoutMs, bool& stop)
|
|
231
226
|
{
|
|
232
227
|
MS_TRACE();
|
|
233
228
|
|
|
229
|
+
const auto maxRestarts = backoffTimer->GetMaxRestarts();
|
|
230
|
+
|
|
231
|
+
MS_DEBUG_TAG(
|
|
232
|
+
sctp,
|
|
233
|
+
"%s timer has expired [expìrations:%zu/%s]",
|
|
234
|
+
backoffTimer->GetLabel().c_str(),
|
|
235
|
+
backoffTimer->GetExpirationCount(),
|
|
236
|
+
maxRestarts ? std::to_string(maxRestarts.value()).c_str() : "Infinite");
|
|
237
|
+
|
|
234
238
|
if (backoffTimer == this->intervalTimer.get())
|
|
235
239
|
{
|
|
236
240
|
OnIntervalTimer(baseTimeoutMs, stop);
|
|
@@ -8,7 +8,7 @@ namespace RTC
|
|
|
8
8
|
{
|
|
9
9
|
namespace SCTP
|
|
10
10
|
{
|
|
11
|
-
PacketSender::PacketSender(Listener* listener,
|
|
11
|
+
PacketSender::PacketSender(Listener* listener, AssociationListenerInterface& associationListener)
|
|
12
12
|
: listener(listener), associationListener(associationListener)
|
|
13
13
|
{
|
|
14
14
|
MS_TRACE();
|
|
@@ -23,18 +23,18 @@ namespace RTC
|
|
|
23
23
|
{
|
|
24
24
|
MS_TRACE();
|
|
25
25
|
|
|
26
|
-
if (
|
|
26
|
+
if (packet->GetChunksCount() == 0)
|
|
27
27
|
{
|
|
28
|
-
|
|
28
|
+
return false;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
if (writeChecksum)
|
|
32
32
|
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
packet->Dump();
|
|
33
|
+
packet->WriteCRC32cChecksum();
|
|
36
34
|
}
|
|
37
35
|
|
|
36
|
+
MS_ASSERT(!packet->NeedsConsolidation(), "cannot send a SCTP packet that needs consolidation");
|
|
37
|
+
|
|
38
38
|
const bool sent =
|
|
39
39
|
this->associationListener.OnAssociationSendData(packet->GetBuffer(), packet->GetLength());
|
|
40
40
|
|
|
@@ -42,7 +42,7 @@ namespace RTC
|
|
|
42
42
|
|
|
43
43
|
if (!sent)
|
|
44
44
|
{
|
|
45
|
-
MS_WARN_TAG(sctp, "
|
|
45
|
+
MS_WARN_TAG(sctp, "couldn't send SCTP Packet");
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
return sent;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
#define MS_CLASS "RTC::SCTP::StreamResetHandler"
|
|
2
|
-
//
|
|
3
|
-
#define MS_LOG_DEV_LEVEL 3
|
|
2
|
+
// #define MS_LOG_DEV_LEVEL 3
|
|
4
3
|
|
|
5
4
|
#include "RTC/SCTP/association/StreamResetHandler.hpp"
|
|
6
5
|
#include "Logger.hpp"
|
|
7
|
-
#include "RTC/Consts.hpp"
|
|
8
6
|
#include "RTC/SCTP/packet/Parameter.hpp"
|
|
9
7
|
#include "RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp"
|
|
10
8
|
|
|
@@ -12,28 +10,30 @@ namespace RTC
|
|
|
12
10
|
{
|
|
13
11
|
namespace SCTP
|
|
14
12
|
{
|
|
15
|
-
/* Static. */
|
|
16
|
-
|
|
17
|
-
alignas(4) thread_local static uint8_t ChunkFactoryBuffer[RTC::Consts::MaxSafeMtuSizeForSctp];
|
|
18
|
-
|
|
19
13
|
/* Instance methods. */
|
|
20
14
|
|
|
21
15
|
StreamResetHandler::StreamResetHandler(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
16
|
+
AssociationListenerInterface& associationListener,
|
|
17
|
+
SharedInterface* shared,
|
|
18
|
+
TransmissionControlBlockContextInterface* tcbContext,
|
|
19
|
+
DataTracker* dataTracker,
|
|
20
|
+
ReassemblyQueue* reassemblyQueue,
|
|
21
|
+
RetransmissionQueue* retransmissionQueue)
|
|
28
22
|
: associationListener(associationListener),
|
|
23
|
+
shared(shared),
|
|
29
24
|
tcbContext(tcbContext),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
dataTracker(dataTracker),
|
|
26
|
+
reassemblyQueue(reassemblyQueue),
|
|
27
|
+
retransmissionQueue(retransmissionQueue),
|
|
28
|
+
reConfigTimer(this->shared->CreateBackoffTimer(
|
|
29
|
+
BackoffTimerHandleInterface::BackoffTimerHandleOptions{
|
|
30
|
+
.listener = this,
|
|
31
|
+
.label = "sctp-re-config",
|
|
32
|
+
.baseTimeoutMs = 0,
|
|
33
|
+
.backoffAlgorithm = BackoffTimerHandleInterface::BackoffAlgorithm::EXPONENTIAL,
|
|
34
|
+
.maxBackoffTimeoutMs = std::nullopt,
|
|
35
|
+
.maxRestarts = std::nullopt,
|
|
36
|
+
})),
|
|
37
37
|
nextOutgoingReqSeqNbr(tcbContext->GetLocalInitialTsn()),
|
|
38
38
|
lastProcessedReqSeqNbr(
|
|
39
39
|
this->incomingReConfigRequestSnUnwrapper.Unwrap(tcbContext->GetRemoteInitialTsn() - 1)),
|
|
@@ -47,18 +47,42 @@ namespace RTC
|
|
|
47
47
|
MS_TRACE();
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
void StreamResetHandler::ResetStreams(std::span<const uint16_t>
|
|
50
|
+
void StreamResetHandler::ResetStreams(std::span<const uint16_t> outgoingStreamIds)
|
|
51
51
|
{
|
|
52
52
|
MS_TRACE();
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
// for (const auto streamId : outgoingStreamIds)
|
|
54
|
+
for (const auto streamId : outgoingStreamIds)
|
|
56
55
|
{
|
|
57
|
-
|
|
58
|
-
// this->retransmissionQueue->PrepareResetStream(streamId);
|
|
56
|
+
this->retransmissionQueue->PrepareResetStream(streamId);
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
59
|
|
|
60
|
+
bool StreamResetHandler::ShouldSendStreamResetRequest() const
|
|
61
|
+
{
|
|
62
|
+
MS_TRACE();
|
|
63
|
+
|
|
64
|
+
// Only send stream resets if there are streams to reset and no current
|
|
65
|
+
// ongoing request (there can only be one at a time).
|
|
66
|
+
return !this->currentRequest.has_value() &&
|
|
67
|
+
this->retransmissionQueue->HasStreamsReadyToBeReset();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
void StreamResetHandler::AddStreamResetRequest(Packet* packet)
|
|
71
|
+
{
|
|
72
|
+
MS_TRACE();
|
|
73
|
+
|
|
74
|
+
MS_ASSERT(ShouldSendStreamResetRequest(), "should not send a stream reset request");
|
|
75
|
+
|
|
76
|
+
this->currentRequest.emplace(
|
|
77
|
+
this->retransmissionQueue->GetLastAssignedTsn(),
|
|
78
|
+
this->retransmissionQueue->BeginResetStreams());
|
|
79
|
+
|
|
80
|
+
this->reConfigTimer->SetBaseTimeoutMs(this->tcbContext->GetCurrentRtoMs());
|
|
81
|
+
this->reConfigTimer->Start();
|
|
82
|
+
|
|
83
|
+
AddReConfigChunk(packet);
|
|
84
|
+
}
|
|
85
|
+
|
|
62
86
|
void StreamResetHandler::HandleReceivedReConfigChunk(const ReConfigChunk* receivedReConfigChunk)
|
|
63
87
|
{
|
|
64
88
|
MS_TRACE();
|
|
@@ -114,7 +138,7 @@ namespace RTC
|
|
|
114
138
|
|
|
115
139
|
if (reConfigChunk->GetParametersCount() > 0)
|
|
116
140
|
{
|
|
117
|
-
this->tcbContext->
|
|
141
|
+
this->tcbContext->SendPacket(packet.get());
|
|
118
142
|
}
|
|
119
143
|
}
|
|
120
144
|
|
|
@@ -169,32 +193,7 @@ namespace RTC
|
|
|
169
193
|
return false;
|
|
170
194
|
}
|
|
171
195
|
|
|
172
|
-
|
|
173
|
-
{
|
|
174
|
-
MS_TRACE();
|
|
175
|
-
|
|
176
|
-
// Only send stream resets if there are streams to reset, and no current
|
|
177
|
-
// ongoing request (there can only be one at a time), and if the stream
|
|
178
|
-
// can be reset.
|
|
179
|
-
// TODO: SCTP: Implement it.
|
|
180
|
-
// if (this->currentRequest.has_value() ||
|
|
181
|
-
// !this->retransmissionQueue->HasStreamsReadyToBeReset())
|
|
182
|
-
// {
|
|
183
|
-
// return nullptr;
|
|
184
|
-
// }
|
|
185
|
-
|
|
186
|
-
// TODO: SCTP: Implement it.
|
|
187
|
-
// this->currentRequest.emplace(
|
|
188
|
-
// this->retransmissionQueue->GetLastAssignedTsn(),
|
|
189
|
-
// this->retransmissionQueue->BeginResetStreams());
|
|
190
|
-
|
|
191
|
-
this->reConfigTimer->SetBaseTimeoutMs(this->tcbContext->GetCurrentRtoMs());
|
|
192
|
-
this->reConfigTimer->Start();
|
|
193
|
-
|
|
194
|
-
return CreateReconfigChunk();
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
ReConfigChunk* StreamResetHandler::CreateReconfigChunk()
|
|
196
|
+
void StreamResetHandler::AddReConfigChunk(Packet* packet)
|
|
198
197
|
{
|
|
199
198
|
MS_TRACE();
|
|
200
199
|
|
|
@@ -205,13 +204,13 @@ namespace RTC
|
|
|
205
204
|
// `reqSeqNbr` will be used.
|
|
206
205
|
MS_ASSERT(this->currentRequest.has_value(), "currentRequest optional must have value");
|
|
207
206
|
|
|
208
|
-
if (this->currentRequest->HasBeenSent())
|
|
207
|
+
if (!this->currentRequest->HasBeenSent())
|
|
209
208
|
{
|
|
210
209
|
this->currentRequest->PrepareToSend(this->nextOutgoingReqSeqNbr);
|
|
211
210
|
this->nextOutgoingReqSeqNbr = uint32_t{ this->nextOutgoingReqSeqNbr + 1 };
|
|
212
211
|
}
|
|
213
212
|
|
|
214
|
-
auto* reConfigChunk = ReConfigChunk
|
|
213
|
+
auto* reConfigChunk = packet->BuildChunkInPlace<ReConfigChunk>();
|
|
215
214
|
auto* outgoingSsnResetRequestParameter =
|
|
216
215
|
reConfigChunk->BuildParameterInPlace<OutgoingSsnResetRequestParameter>();
|
|
217
216
|
|
|
@@ -228,8 +227,7 @@ namespace RTC
|
|
|
228
227
|
}
|
|
229
228
|
|
|
230
229
|
outgoingSsnResetRequestParameter->Consolidate();
|
|
231
|
-
|
|
232
|
-
return reConfigChunk;
|
|
230
|
+
reConfigChunk->Consolidate();
|
|
233
231
|
}
|
|
234
232
|
|
|
235
233
|
StreamResetHandler::ReqSeqNbrValidationResult StreamResetHandler::ValidateReqSeqNbr(
|
|
@@ -302,44 +300,50 @@ namespace RTC
|
|
|
302
300
|
// "In Progress" request. In all cases, re-evaluate the state.
|
|
303
301
|
this->lastProcessedReqSeqNbr = requestSn;
|
|
304
302
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
303
|
+
if (
|
|
304
|
+
this->dataTracker->IsLaterThanCumulativeAckedTsn(
|
|
305
|
+
receivedOutgoingSsnResetRequestParameter->GetSenderLastAssignedTsn()))
|
|
306
|
+
{
|
|
307
|
+
// https://datatracker.ietf.org/doc/html/rfc6525#section-5.2.2
|
|
308
|
+
//
|
|
309
|
+
// E2) "If the Sender's Last Assigned TSN is greater than the cumulative
|
|
310
|
+
// acknowledgment point, then the endpoint MUST enter 'deferred reset
|
|
311
|
+
// processing'."
|
|
312
|
+
this->reassemblyQueue->EnterDeferredReset(
|
|
313
|
+
receivedOutgoingSsnResetRequestParameter->GetSenderLastAssignedTsn(),
|
|
314
|
+
receivedOutgoingSsnResetRequestParameter->GetStreamIds());
|
|
315
|
+
|
|
316
|
+
// "If the endpoint enters 'deferred reset processing', it MUST put a
|
|
317
|
+
// Re-configuration Response Parameter into a RE-CONFIG chunk indicating
|
|
318
|
+
// 'In progress' and MUST send the RE-CONFIG chunk.
|
|
319
|
+
this->lastProcessedReqResult = ReconfigurationResponseParameter::Result::IN_PROGRESS;
|
|
320
|
+
|
|
321
|
+
MS_DEBUG_DEV(
|
|
322
|
+
"reset outgoing in progress, sender last assigned tsn %" PRIu32 " not yet reached",
|
|
323
|
+
receivedOutgoingSsnResetRequestParameter->GetSenderLastAssignedTsn());
|
|
324
|
+
}
|
|
325
|
+
else
|
|
326
|
+
{
|
|
327
|
+
// https://datatracker.ietf.org/doc/html/rfc6525#section-5.2.2
|
|
328
|
+
//
|
|
329
|
+
// E3) If no stream numbers are listed in the parameter, then all incoming
|
|
330
|
+
// streams MUST be reset to 0 as the next expected SSN. If specific stream
|
|
331
|
+
// numbers are listed, then only these specific streams MUST be reset to
|
|
332
|
+
// 0, and all other non-listed SSNs remain unchanged. E4: Any queued TSNs
|
|
333
|
+
// (queued at step E2) MUST now be released and processed normally.
|
|
334
|
+
this->reassemblyQueue->ResetStreamsAndLeaveDeferredReset(
|
|
335
|
+
receivedOutgoingSsnResetRequestParameter->GetStreamIds());
|
|
336
|
+
|
|
337
|
+
this->associationListener.OnAssociationInboundStreamsReset(
|
|
338
|
+
receivedOutgoingSsnResetRequestParameter->GetStreamIds());
|
|
339
|
+
|
|
340
|
+
this->lastProcessedReqResult = ReconfigurationResponseParameter::Result::SUCCESS_PERFORMED;
|
|
341
|
+
|
|
342
|
+
MS_DEBUG_DEV("reset outgoing performed");
|
|
343
|
+
MS_DEBUG_DEV(
|
|
344
|
+
"reset outgoing performed, sender last assigned tsn %" PRIu32 " reached",
|
|
345
|
+
receivedOutgoingSsnResetRequestParameter->GetSenderLastAssignedTsn());
|
|
346
|
+
}
|
|
343
347
|
|
|
344
348
|
auto* reconfigurationResponseParameter =
|
|
345
349
|
reConfigChunk->BuildParameterInPlace<ReconfigurationResponseParameter>();
|
|
@@ -413,8 +417,7 @@ namespace RTC
|
|
|
413
417
|
|
|
414
418
|
this->currentRequest = std::nullopt;
|
|
415
419
|
|
|
416
|
-
|
|
417
|
-
// this->retransmissionQueue->CommitResetSteam();
|
|
420
|
+
this->retransmissionQueue->CommitResetStreams();
|
|
418
421
|
|
|
419
422
|
break;
|
|
420
423
|
}
|
|
@@ -454,8 +457,7 @@ namespace RTC
|
|
|
454
457
|
|
|
455
458
|
this->currentRequest = std::nullopt;
|
|
456
459
|
|
|
457
|
-
|
|
458
|
-
// this->retransmissionQueue->RollbackResetStreams();
|
|
460
|
+
this->retransmissionQueue->RollbackResetStreams();
|
|
459
461
|
|
|
460
462
|
break;
|
|
461
463
|
}
|
|
@@ -492,17 +494,27 @@ namespace RTC
|
|
|
492
494
|
|
|
493
495
|
auto packet = this->tcbContext->CreatePacket();
|
|
494
496
|
|
|
495
|
-
packet
|
|
497
|
+
AddReConfigChunk(packet.get());
|
|
496
498
|
|
|
497
|
-
this->tcbContext->
|
|
499
|
+
this->tcbContext->SendPacket(packet.get());
|
|
498
500
|
|
|
499
501
|
baseTimeoutMs = this->tcbContext->GetCurrentRtoMs();
|
|
500
502
|
}
|
|
501
503
|
|
|
502
|
-
void StreamResetHandler::
|
|
504
|
+
void StreamResetHandler::OnBackoffTimer(
|
|
505
|
+
BackoffTimerHandleInterface* backoffTimer, uint64_t& baseTimeoutMs, bool& stop)
|
|
503
506
|
{
|
|
504
507
|
MS_TRACE();
|
|
505
508
|
|
|
509
|
+
const auto maxRestarts = backoffTimer->GetMaxRestarts();
|
|
510
|
+
|
|
511
|
+
MS_DEBUG_TAG(
|
|
512
|
+
sctp,
|
|
513
|
+
"%s timer has expired [expìrations:%zu/%s]",
|
|
514
|
+
backoffTimer->GetLabel().c_str(),
|
|
515
|
+
backoffTimer->GetExpirationCount(),
|
|
516
|
+
maxRestarts ? std::to_string(maxRestarts.value()).c_str() : "Infinite");
|
|
517
|
+
|
|
506
518
|
if (backoffTimer == this->reConfigTimer.get())
|
|
507
519
|
{
|
|
508
520
|
OnReConfigTimer(baseTimeoutMs, stop);
|