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
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
#define MS_RTC_SCTP_STREAM_RESET_HANDLER_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
|
-
#include "
|
|
6
|
-
#include "
|
|
5
|
+
#include "Utils/UnwrappedSequenceNumber.hpp"
|
|
6
|
+
#include "handles/BackoffTimerHandleInterface.hpp"
|
|
7
|
+
#include "RTC/SCTP/association/TransmissionControlBlockContextInterface.hpp"
|
|
7
8
|
#include "RTC/SCTP/packet/Packet.hpp"
|
|
8
9
|
#include "RTC/SCTP/packet/chunks/ReConfigChunk.hpp"
|
|
9
10
|
#include "RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp"
|
|
10
11
|
#include "RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp"
|
|
11
12
|
#include "RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp"
|
|
12
|
-
#include "RTC/SCTP/public/
|
|
13
|
-
#include "
|
|
13
|
+
#include "RTC/SCTP/public/AssociationListenerInterface.hpp"
|
|
14
|
+
#include "RTC/SCTP/rx/DataTracker.hpp"
|
|
15
|
+
#include "RTC/SCTP/rx/ReassemblyQueue.hpp"
|
|
16
|
+
#include "RTC/SCTP/tx/RetransmissionQueue.hpp"
|
|
17
|
+
#include "SharedInterface.hpp"
|
|
14
18
|
#include <span>
|
|
15
19
|
#include <vector>
|
|
16
20
|
|
|
@@ -49,7 +53,7 @@ namespace RTC
|
|
|
49
53
|
* not-yet-sent messages will be discarded, but that may change in the future.
|
|
50
54
|
* RFC8831 allows both behaviors.
|
|
51
55
|
*/
|
|
52
|
-
class StreamResetHandler : public
|
|
56
|
+
class StreamResetHandler : public BackoffTimerHandleInterface::Listener
|
|
53
57
|
{
|
|
54
58
|
private:
|
|
55
59
|
enum class ReqSeqNbrValidationResult : uint8_t
|
|
@@ -160,16 +164,16 @@ namespace RTC
|
|
|
160
164
|
};
|
|
161
165
|
|
|
162
166
|
private:
|
|
163
|
-
using UnwrappedReConfigRequestSn = UnwrappedSequenceNumber<uint32_t>;
|
|
167
|
+
using UnwrappedReConfigRequestSn = Utils::UnwrappedSequenceNumber<uint32_t>;
|
|
164
168
|
|
|
165
169
|
public:
|
|
166
170
|
StreamResetHandler(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
AssociationListenerInterface& associationListener,
|
|
172
|
+
SharedInterface* shared,
|
|
173
|
+
TransmissionControlBlockContextInterface* tcbContext,
|
|
174
|
+
DataTracker* dataTracker,
|
|
175
|
+
ReassemblyQueue* reassemblyQueue,
|
|
176
|
+
RetransmissionQueue* retransmissionQueue);
|
|
173
177
|
|
|
174
178
|
~StreamResetHandler() override;
|
|
175
179
|
|
|
@@ -183,6 +187,23 @@ namespace RTC
|
|
|
183
187
|
*/
|
|
184
188
|
void ResetStreams(std::span<const uint16_t> outgoingStreamIds);
|
|
185
189
|
|
|
190
|
+
/**
|
|
191
|
+
* Whether a Reset Streams request should be send. Will return `false` if
|
|
192
|
+
* there is no need to create a request (no streams to reset) or if there
|
|
193
|
+
* already is an ongoing stream reset request that hasn't completed yet.
|
|
194
|
+
*/
|
|
195
|
+
bool ShouldSendStreamResetRequest() const;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Adds a Reset Streams request to the given Packet. Will start the
|
|
199
|
+
* reconfig timer.
|
|
200
|
+
*
|
|
201
|
+
* @remarks
|
|
202
|
+
* - The caller must check `ShouldCreateStreamResetRequest()` first and
|
|
203
|
+
* only invoke this method if the former returns `true`.
|
|
204
|
+
*/
|
|
205
|
+
void AddStreamResetRequest(Packet* packet);
|
|
206
|
+
|
|
186
207
|
/**
|
|
187
208
|
* Called when handling and incoming RE-CONFIG chunk. Processes a stream
|
|
188
209
|
* reconfiguration chunk and may send a RE-CONFIG back to the peer with
|
|
@@ -197,18 +218,10 @@ namespace RTC
|
|
|
197
218
|
bool ValidateReceivedReConfigChunk(const ReConfigChunk* receivedReConfigChunk);
|
|
198
219
|
|
|
199
220
|
/**
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
* to create a request (no streams to reset) or if there already is an
|
|
203
|
-
* ongoing stream reset request that hasn't completed yet.
|
|
221
|
+
* Adds the actual RE-CONFIG chunk to the given Packet. A request (which
|
|
222
|
+
* set `this->currentRequest`) must have been created prior.
|
|
204
223
|
*/
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Creates the actual RE-CONFIG chunk. A request (which set
|
|
209
|
-
* `currentRequest`) must have been created prior.
|
|
210
|
-
*/
|
|
211
|
-
ReConfigChunk* CreateReconfigChunk();
|
|
224
|
+
void AddReConfigChunk(Packet* packet);
|
|
212
225
|
|
|
213
226
|
/**
|
|
214
227
|
* Called to validate the `reqSeqNbr`, that it's the next in sequence.
|
|
@@ -244,27 +257,28 @@ namespace RTC
|
|
|
244
257
|
|
|
245
258
|
void OnReConfigTimer(uint64_t& baseTimeoutMs, bool& stop);
|
|
246
259
|
|
|
247
|
-
/* Pure virtual methods inherited from
|
|
260
|
+
/* Pure virtual methods inherited from BackoffTimerHandleInterface::Listener. */
|
|
248
261
|
public:
|
|
249
|
-
void
|
|
262
|
+
void OnBackoffTimer(
|
|
263
|
+
BackoffTimerHandleInterface* backoffTimer, uint64_t& baseTimeoutMs, bool& stop) override;
|
|
250
264
|
|
|
251
265
|
private:
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
266
|
+
AssociationListenerInterface& associationListener;
|
|
267
|
+
SharedInterface* shared;
|
|
268
|
+
TransmissionControlBlockContextInterface* tcbContext;
|
|
269
|
+
DataTracker* dataTracker;
|
|
270
|
+
ReassemblyQueue* reassemblyQueue;
|
|
271
|
+
RetransmissionQueue* retransmissionQueue;
|
|
258
272
|
UnwrappedReConfigRequestSn::Unwrapper incomingReConfigRequestSnUnwrapper;
|
|
259
|
-
const std::unique_ptr<
|
|
273
|
+
const std::unique_ptr<BackoffTimerHandleInterface> reConfigTimer;
|
|
260
274
|
// The next sequence number for outgoing stream requests.
|
|
261
|
-
uint32_t nextOutgoingReqSeqNbr
|
|
262
|
-
// The current stream request operation.
|
|
263
|
-
std::optional<CurrentRequest> currentRequest;
|
|
275
|
+
uint32_t nextOutgoingReqSeqNbr;
|
|
264
276
|
// For incoming requests. Last processed request sequence number.
|
|
265
277
|
UnwrappedReConfigRequestSn lastProcessedReqSeqNbr;
|
|
266
278
|
// The result from last processed incoming request.
|
|
267
279
|
ReconfigurationResponseParameter::Result lastProcessedReqResult;
|
|
280
|
+
// The current stream request operation.
|
|
281
|
+
std::optional<CurrentRequest> currentRequest;
|
|
268
282
|
};
|
|
269
283
|
} // namespace SCTP
|
|
270
284
|
} // namespace RTC
|
|
@@ -2,16 +2,22 @@
|
|
|
2
2
|
#define MS_RTC_SCTP_TRANSMISSION_CONTROL_BLOCK_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
|
+
#include "handles/BackoffTimerHandleInterface.hpp"
|
|
5
6
|
#include "RTC/SCTP/association/HeartbeatHandler.hpp"
|
|
6
7
|
#include "RTC/SCTP/association/NegotiatedCapabilities.hpp"
|
|
7
8
|
#include "RTC/SCTP/association/PacketSender.hpp"
|
|
8
|
-
#include "RTC/SCTP/association/
|
|
9
|
+
#include "RTC/SCTP/association/StreamResetHandler.hpp"
|
|
10
|
+
#include "RTC/SCTP/association/TransmissionControlBlockContextInterface.hpp"
|
|
9
11
|
#include "RTC/SCTP/packet/Packet.hpp"
|
|
10
|
-
#include "RTC/SCTP/public/
|
|
12
|
+
#include "RTC/SCTP/public/AssociationListenerInterface.hpp"
|
|
11
13
|
#include "RTC/SCTP/public/SctpOptions.hpp"
|
|
14
|
+
#include "RTC/SCTP/rx/DataTracker.hpp"
|
|
15
|
+
#include "RTC/SCTP/rx/ReassemblyQueue.hpp"
|
|
12
16
|
#include "RTC/SCTP/tx/RetransmissionErrorCounter.hpp"
|
|
17
|
+
#include "RTC/SCTP/tx/RetransmissionQueue.hpp"
|
|
13
18
|
#include "RTC/SCTP/tx/RetransmissionTimeout.hpp"
|
|
14
|
-
#include "
|
|
19
|
+
#include "RTC/SCTP/tx/SendQueueInterface.hpp"
|
|
20
|
+
#include "SharedInterface.hpp"
|
|
15
21
|
#include <string_view>
|
|
16
22
|
#include <vector>
|
|
17
23
|
|
|
@@ -25,12 +31,16 @@ namespace RTC
|
|
|
25
31
|
*
|
|
26
32
|
* @see https://datatracker.ietf.org/doc/html/rfc9260#section-14
|
|
27
33
|
*/
|
|
28
|
-
class TransmissionControlBlock : public
|
|
34
|
+
class TransmissionControlBlock : public TransmissionControlBlockContextInterface,
|
|
35
|
+
public RetransmissionQueue::Listener,
|
|
36
|
+
public BackoffTimerHandleInterface::Listener
|
|
29
37
|
{
|
|
30
38
|
public:
|
|
31
39
|
TransmissionControlBlock(
|
|
32
|
-
|
|
40
|
+
AssociationListenerInterface& associationListener,
|
|
33
41
|
const SctpOptions& sctpOptions,
|
|
42
|
+
SharedInterface* shared,
|
|
43
|
+
SendQueueInterface& sendQueue,
|
|
34
44
|
PacketSender& packetSender,
|
|
35
45
|
uint32_t localVerificationTag,
|
|
36
46
|
uint32_t remoteVerificationTag,
|
|
@@ -39,6 +49,7 @@ namespace RTC
|
|
|
39
49
|
uint32_t remoteAdvertisedReceiverWindowCredit,
|
|
40
50
|
uint64_t tieTag,
|
|
41
51
|
const NegotiatedCapabilities& negotiatedCapabilities,
|
|
52
|
+
size_t maxPacketLength,
|
|
42
53
|
std::function<bool()> isAssociationEstablished);
|
|
43
54
|
|
|
44
55
|
~TransmissionControlBlock() override;
|
|
@@ -48,7 +59,7 @@ namespace RTC
|
|
|
48
59
|
|
|
49
60
|
/**
|
|
50
61
|
* @remarks
|
|
51
|
-
* - Implements
|
|
62
|
+
* - Implements TransmissionControlBlockContextInterface.
|
|
52
63
|
*/
|
|
53
64
|
bool IsAssociationEstablished() const override
|
|
54
65
|
{
|
|
@@ -80,7 +91,7 @@ namespace RTC
|
|
|
80
91
|
* Chunk.
|
|
81
92
|
*
|
|
82
93
|
* @remarks
|
|
83
|
-
* - Implements
|
|
94
|
+
* - Implements TransmissionControlBlockContextInterface.
|
|
84
95
|
*/
|
|
85
96
|
uint32_t GetLocalInitialTsn() const override
|
|
86
97
|
{
|
|
@@ -92,7 +103,7 @@ namespace RTC
|
|
|
92
103
|
* INIT_ACK Chunk.
|
|
93
104
|
*
|
|
94
105
|
* @remarks
|
|
95
|
-
* - Implements
|
|
106
|
+
* - Implements TransmissionControlBlockContextInterface.
|
|
96
107
|
*/
|
|
97
108
|
uint32_t GetRemoteInitialTsn() const override
|
|
98
109
|
{
|
|
@@ -126,13 +137,18 @@ namespace RTC
|
|
|
126
137
|
|
|
127
138
|
/**
|
|
128
139
|
* @remarks
|
|
129
|
-
* - Implements
|
|
140
|
+
* - Implements TransmissionControlBlockContextInterface.
|
|
130
141
|
*/
|
|
131
|
-
void
|
|
142
|
+
void ObserveRttMs(uint64_t rttMs) override;
|
|
143
|
+
|
|
144
|
+
size_t GetCwnd() const
|
|
145
|
+
{
|
|
146
|
+
return this->retransmissionQueue.GetCwnd();
|
|
147
|
+
}
|
|
132
148
|
|
|
133
149
|
/**
|
|
134
150
|
* @remarks
|
|
135
|
-
* - Implements
|
|
151
|
+
* - Implements TransmissionControlBlockContextInterface.
|
|
136
152
|
*/
|
|
137
153
|
uint64_t GetCurrentRtoMs() const override
|
|
138
154
|
{
|
|
@@ -146,7 +162,7 @@ namespace RTC
|
|
|
146
162
|
|
|
147
163
|
/**
|
|
148
164
|
* @remarks
|
|
149
|
-
* - Implements
|
|
165
|
+
* - Implements TransmissionControlBlockContextInterface.
|
|
150
166
|
*/
|
|
151
167
|
std::unique_ptr<Packet> CreatePacket() const override;
|
|
152
168
|
|
|
@@ -154,17 +170,48 @@ namespace RTC
|
|
|
154
170
|
|
|
155
171
|
/**
|
|
156
172
|
* @remarks
|
|
157
|
-
* - Implements
|
|
173
|
+
* - Implements TransmissionControlBlockContextInterface.
|
|
158
174
|
*/
|
|
159
|
-
|
|
175
|
+
bool SendPacket(Packet* packet) override;
|
|
176
|
+
|
|
177
|
+
DataTracker& GetDataTracker()
|
|
178
|
+
{
|
|
179
|
+
return this->dataTracker;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
ReassemblyQueue& GetReassemblyQueue()
|
|
183
|
+
{
|
|
184
|
+
return this->reassemblyQueue;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
RetransmissionQueue& GetRetransmissionQueue()
|
|
188
|
+
{
|
|
189
|
+
return this->retransmissionQueue;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
StreamResetHandler& GetStreamResetHandler()
|
|
193
|
+
{
|
|
194
|
+
return this->streamResetHandler;
|
|
195
|
+
}
|
|
160
196
|
|
|
161
197
|
HeartbeatHandler& GetHeartbeatHandler()
|
|
162
198
|
{
|
|
163
199
|
return this->heartbeatHandler;
|
|
164
200
|
}
|
|
165
201
|
|
|
202
|
+
/**
|
|
203
|
+
* Will be set while the Association is in COOKIE_ECHOED state. In this
|
|
204
|
+
* state, there can only be a single Packet outstanding, and it must
|
|
205
|
+
* contain the COOKIE_ECHO Chunk as the first Chunk in that Packet, until
|
|
206
|
+
* the COOKIE_ACK has been received, which will make the socket call
|
|
207
|
+
* `ClearRemoteStateCookie()`.
|
|
208
|
+
*/
|
|
166
209
|
void SetRemoteStateCookie(std::vector<uint8_t> remoteStateCookie);
|
|
167
210
|
|
|
211
|
+
/**
|
|
212
|
+
* Called when the COOKIE_ACK Chunk has been received, to allow further
|
|
213
|
+
* Packets to be sent.
|
|
214
|
+
*/
|
|
168
215
|
void ClearRemoteStateCookie();
|
|
169
216
|
|
|
170
217
|
bool HasRemoteStateCookie() const
|
|
@@ -172,11 +219,34 @@ namespace RTC
|
|
|
172
219
|
return this->remoteStateCookie.has_value();
|
|
173
220
|
}
|
|
174
221
|
|
|
222
|
+
/**
|
|
223
|
+
* Sends a SACK Chunk, if there is a need to.
|
|
224
|
+
*/
|
|
175
225
|
void MaySendSackChunk();
|
|
176
226
|
|
|
227
|
+
/**
|
|
228
|
+
* May add a FORWARD-TSN or I-FORWARD-TSN Chunk to the given Packet if it
|
|
229
|
+
* is needed and allowed (rate-limited).
|
|
230
|
+
*/
|
|
231
|
+
void MayAddForwardTsnChunk(Packet* packet, uint64_t nowMs);
|
|
232
|
+
|
|
233
|
+
void MaySendFastRetransmit();
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Create and fill Packets with control and DATA/I-DATA Chunks, and sends
|
|
237
|
+
* them as much as can be allowed by the congestion control algorithm.
|
|
238
|
+
*
|
|
239
|
+
* @remarks
|
|
240
|
+
* - If `this->remoteStateCookie` is present, then only one Packet will be
|
|
241
|
+
* sent, with this Chunk as the first Chunk.
|
|
242
|
+
* - Cannot pass `addCookieAckChunk=true` if `this->remoteStateCookie` is
|
|
243
|
+
* present (will throw).
|
|
244
|
+
*/
|
|
245
|
+
void SendBufferedPackets(uint64_t nowMs, bool addCookieAckChunk = false);
|
|
246
|
+
|
|
177
247
|
/**
|
|
178
248
|
* @remarks
|
|
179
|
-
* - Implements
|
|
249
|
+
* - Implements TransmissionControlBlockContextInterface.
|
|
180
250
|
*/
|
|
181
251
|
bool IncrementTxErrorCounter(std::string_view reason) override
|
|
182
252
|
{
|
|
@@ -185,16 +255,16 @@ namespace RTC
|
|
|
185
255
|
|
|
186
256
|
/**
|
|
187
257
|
* @remarks
|
|
188
|
-
* - Implements
|
|
258
|
+
* - Implements TransmissionControlBlockContextInterface.
|
|
189
259
|
*/
|
|
190
260
|
void ClearTxErrorCounter() override
|
|
191
261
|
{
|
|
192
|
-
|
|
262
|
+
this->txErrorCounter.Clear();
|
|
193
263
|
}
|
|
194
264
|
|
|
195
265
|
/**
|
|
196
266
|
* @remarks
|
|
197
|
-
* - Implements
|
|
267
|
+
* - Implements TransmissionControlBlockContextInterface.
|
|
198
268
|
*/
|
|
199
269
|
bool HasTooManyTxErrors() const override
|
|
200
270
|
{
|
|
@@ -206,35 +276,48 @@ namespace RTC
|
|
|
206
276
|
|
|
207
277
|
void OnDelayedAckTimer(uint64_t& baseTimeoutMs, bool& stop);
|
|
208
278
|
|
|
209
|
-
/* Pure virtual methods inherited from
|
|
279
|
+
/* Pure virtual methods inherited from RetransmissionQueue::Listener. */
|
|
280
|
+
public:
|
|
281
|
+
void OnRetransmissionQueueNewRttMs(uint64_t newRttMs) override;
|
|
282
|
+
void OnRetransmissionQueueClearRetransmissionCounter() override;
|
|
283
|
+
;
|
|
284
|
+
|
|
285
|
+
/* Pure virtual methods inherited from BackoffTimerHandleInterface::Listener. */
|
|
210
286
|
public:
|
|
211
|
-
void
|
|
287
|
+
void OnBackoffTimer(
|
|
288
|
+
BackoffTimerHandleInterface* backoffTimer, uint64_t& baseTimeoutMs, bool& stop) override;
|
|
212
289
|
|
|
213
290
|
private:
|
|
214
|
-
|
|
291
|
+
AssociationListenerInterface& associationListener;
|
|
215
292
|
const SctpOptions sctpOptions;
|
|
293
|
+
SharedInterface* shared;
|
|
216
294
|
PacketSender& packetSender;
|
|
217
|
-
uint32_t localVerificationTag
|
|
218
|
-
uint32_t remoteVerificationTag
|
|
219
|
-
uint32_t localInitialTsn
|
|
220
|
-
uint32_t remoteInitialTsn
|
|
221
|
-
uint32_t remoteAdvertisedReceiverWindowCredit
|
|
295
|
+
uint32_t localVerificationTag;
|
|
296
|
+
uint32_t remoteVerificationTag;
|
|
297
|
+
uint32_t localInitialTsn;
|
|
298
|
+
uint32_t remoteInitialTsn;
|
|
299
|
+
uint32_t remoteAdvertisedReceiverWindowCredit;
|
|
222
300
|
// Nonce, used to detect reconnections.
|
|
223
|
-
uint64_t tieTag
|
|
301
|
+
uint64_t tieTag;
|
|
224
302
|
NegotiatedCapabilities negotiatedCapabilities;
|
|
303
|
+
// Max SCTP Packet length.
|
|
304
|
+
const size_t maxPacketLength;
|
|
225
305
|
std::function<bool()> isAssociationEstablished;
|
|
226
306
|
// The data retransmission timer.
|
|
227
|
-
const std::unique_ptr<
|
|
307
|
+
const std::unique_ptr<BackoffTimerHandleInterface> t3RtxTimer;
|
|
228
308
|
// Delayed ack timer, which triggers when acks should be sent (when
|
|
229
309
|
// delayed).
|
|
230
|
-
const std::unique_ptr<
|
|
310
|
+
const std::unique_ptr<BackoffTimerHandleInterface> delayedAckTimer;
|
|
231
311
|
RetransmissionTimeout rto;
|
|
232
312
|
RetransmissionErrorCounter txErrorCounter;
|
|
313
|
+
DataTracker dataTracker;
|
|
314
|
+
ReassemblyQueue reassemblyQueue;
|
|
315
|
+
RetransmissionQueue retransmissionQueue;
|
|
316
|
+
StreamResetHandler streamResetHandler;
|
|
233
317
|
HeartbeatHandler heartbeatHandler;
|
|
234
318
|
// Rate limiting of FORWARD_TSN. Next can be sent at or after this
|
|
235
319
|
// timestamp.
|
|
236
|
-
|
|
237
|
-
// uint64_t limitForwardTsnUntilMs{ 0 };
|
|
320
|
+
uint64_t limitForwardTsnUntilMs{ 0 };
|
|
238
321
|
// Only valid when state is State::COOKIE_ECHOED. In this state, the
|
|
239
322
|
// Association must wait for COOKIE_ACK to continue sending any packets (not
|
|
240
323
|
// including a COOKIE_ECHO). So if this state cookie is present, the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#ifndef
|
|
2
|
-
#define
|
|
1
|
+
#ifndef MS_RTC_SCTP_TRANSMISSION_CONTROL_BLOCK_CONTEXT_INTERFACE_HPP
|
|
2
|
+
#define MS_RTC_SCTP_TRANSMISSION_CONTROL_BLOCK_CONTEXT_INTERFACE_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
5
|
#include "RTC/SCTP/packet/Packet.hpp"
|
|
@@ -9,10 +9,10 @@ namespace RTC
|
|
|
9
9
|
{
|
|
10
10
|
namespace SCTP
|
|
11
11
|
{
|
|
12
|
-
class
|
|
12
|
+
class TransmissionControlBlockContextInterface
|
|
13
13
|
{
|
|
14
14
|
public:
|
|
15
|
-
virtual ~
|
|
15
|
+
virtual ~TransmissionControlBlockContextInterface() = default;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Indicates if the SCTP Association has been established.
|
|
@@ -32,9 +32,10 @@ namespace RTC
|
|
|
32
32
|
virtual uint32_t GetRemoteInitialTsn() const = 0;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* To be called when a RTT has been measured, to update the RTO
|
|
35
|
+
* To be called when a RTT (ms) has been measured, to update the RTO
|
|
36
|
+
* value.
|
|
36
37
|
*/
|
|
37
|
-
virtual void
|
|
38
|
+
virtual void ObserveRttMs(uint64_t rttMs) = 0;
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* Returns the Retransmission Timeout (RTO) value.
|
|
@@ -43,7 +44,8 @@ namespace RTC
|
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
46
|
* Increments the transmission error counter, given a human readable
|
|
46
|
-
* reason.
|
|
47
|
+
* reason. Returns `true` if the maximum error count has been reached,
|
|
48
|
+
* `false` will be returned.
|
|
47
49
|
*/
|
|
48
50
|
virtual bool IncrementTxErrorCounter(std::string_view reason) = 0;
|
|
49
51
|
|
|
@@ -59,7 +61,11 @@ namespace RTC
|
|
|
59
61
|
|
|
60
62
|
virtual std::unique_ptr<Packet> CreatePacket() const = 0;
|
|
61
63
|
|
|
62
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Sends a Packet and returns a boolean indicating whether the Packet was
|
|
66
|
+
* sent or not.
|
|
67
|
+
*/
|
|
68
|
+
virtual bool SendPacket(Packet* packet) = 0;
|
|
63
69
|
};
|
|
64
70
|
} // namespace SCTP
|
|
65
71
|
} // namespace RTC
|
|
@@ -47,7 +47,7 @@ namespace RTC
|
|
|
47
47
|
friend class Packet;
|
|
48
48
|
|
|
49
49
|
public:
|
|
50
|
-
using
|
|
50
|
+
using ParametersIterator = typename std::vector<Parameter*>::const_iterator;
|
|
51
51
|
using ErrorCausesIterator = typename std::vector<ErrorCause*>::const_iterator;
|
|
52
52
|
|
|
53
53
|
public:
|
|
@@ -232,12 +232,12 @@ namespace RTC
|
|
|
232
232
|
return this->parameters.size();
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
virtual
|
|
235
|
+
virtual ParametersIterator ParametersBegin() const final
|
|
236
236
|
{
|
|
237
237
|
return this->parameters.begin();
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
virtual
|
|
240
|
+
virtual ParametersIterator ParametersEnd() const final
|
|
241
241
|
{
|
|
242
242
|
return this->parameters.end();
|
|
243
243
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
#define MS_RTC_SCTP_USER_DATA_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
|
+
#include <ostream>
|
|
5
6
|
#include <vector>
|
|
6
7
|
|
|
7
8
|
namespace RTC
|
|
@@ -25,20 +26,37 @@ namespace RTC
|
|
|
25
26
|
bool isEnd,
|
|
26
27
|
bool isUnordered);
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Move constructor. No need to do anything special since std::vector
|
|
31
|
+
* already implements move.
|
|
32
|
+
*/
|
|
30
33
|
UserData(UserData&& other) = default;
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Move assignment. No need to do anything special since std::vector
|
|
37
|
+
* already implements move.
|
|
38
|
+
*/
|
|
34
39
|
UserData& operator=(UserData&& other) = default;
|
|
35
40
|
|
|
36
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Copy constructor disabled.
|
|
43
|
+
*/
|
|
37
44
|
UserData(const UserData&) = delete;
|
|
38
45
|
|
|
39
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Copy assignment disabled.
|
|
48
|
+
*/
|
|
40
49
|
UserData& operator=(const UserData&) = delete;
|
|
41
50
|
|
|
51
|
+
bool operator==(const UserData& other) const
|
|
52
|
+
{
|
|
53
|
+
return (
|
|
54
|
+
this->streamId == other.streamId && this->ssn == other.ssn && this->mid == other.mid &&
|
|
55
|
+
this->fsn == other.fsn && this->ppid == other.ppid && this->payload == other.payload &&
|
|
56
|
+
this->isBeginning == other.isBeginning && this->isEnd == other.isEnd &&
|
|
57
|
+
this->isUnordered == other.isUnordered);
|
|
58
|
+
}
|
|
59
|
+
|
|
42
60
|
~UserData();
|
|
43
61
|
|
|
44
62
|
public:
|
|
@@ -81,9 +99,9 @@ namespace RTC
|
|
|
81
99
|
return this->ppid;
|
|
82
100
|
}
|
|
83
101
|
|
|
84
|
-
|
|
102
|
+
std::vector<uint8_t>& GetPayload()
|
|
85
103
|
{
|
|
86
|
-
return this->payload
|
|
104
|
+
return this->payload;
|
|
87
105
|
}
|
|
88
106
|
|
|
89
107
|
size_t GetPayloadLength() const
|
|
@@ -93,7 +111,7 @@ namespace RTC
|
|
|
93
111
|
|
|
94
112
|
/**
|
|
95
113
|
* Useful to extract the payload and its ownership when destructing the
|
|
96
|
-
*
|
|
114
|
+
* UserData.
|
|
97
115
|
*
|
|
98
116
|
* @remarks
|
|
99
117
|
* - && at the end means that it can only be called from a rvalue.
|
|
@@ -109,6 +127,20 @@ namespace RTC
|
|
|
109
127
|
return std::move(this->payload);
|
|
110
128
|
}
|
|
111
129
|
|
|
130
|
+
UserData Clone() const
|
|
131
|
+
{
|
|
132
|
+
return UserData(
|
|
133
|
+
this->streamId,
|
|
134
|
+
this->ssn,
|
|
135
|
+
this->mid,
|
|
136
|
+
this->fsn,
|
|
137
|
+
this->ppid,
|
|
138
|
+
this->payload,
|
|
139
|
+
this->isBeginning,
|
|
140
|
+
this->isEnd,
|
|
141
|
+
this->isUnordered);
|
|
142
|
+
}
|
|
143
|
+
|
|
112
144
|
bool IsBeginning() const
|
|
113
145
|
{
|
|
114
146
|
return this->isBeginning;
|
|
@@ -125,16 +157,28 @@ namespace RTC
|
|
|
125
157
|
}
|
|
126
158
|
|
|
127
159
|
private:
|
|
128
|
-
uint16_t streamId
|
|
129
|
-
uint16_t ssn
|
|
130
|
-
uint32_t mid
|
|
131
|
-
uint32_t fsn
|
|
132
|
-
uint32_t ppid
|
|
160
|
+
uint16_t streamId;
|
|
161
|
+
uint16_t ssn;
|
|
162
|
+
uint32_t mid;
|
|
163
|
+
uint32_t fsn;
|
|
164
|
+
uint32_t ppid;
|
|
133
165
|
std::vector<uint8_t> payload;
|
|
134
|
-
bool isBeginning
|
|
135
|
-
bool isEnd
|
|
136
|
-
bool isUnordered
|
|
166
|
+
bool isBeginning;
|
|
167
|
+
bool isEnd;
|
|
168
|
+
bool isUnordered;
|
|
137
169
|
};
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* For Catch2 to print it nicely.
|
|
173
|
+
*/
|
|
174
|
+
inline std::ostream& operator<<(std::ostream& os, const UserData& d)
|
|
175
|
+
{
|
|
176
|
+
return os << "{streamId:" << d.GetStreamId() << ", ssn:" << d.GetStreamSequenceNumber()
|
|
177
|
+
<< ", mid:" << d.GetMessageId() << ", fsn:" << d.GetFragmentSequenceNumber()
|
|
178
|
+
<< ", ppid:" << d.GetPayloadProtocolId() << ", payloadLen:" << d.GetPayloadLength()
|
|
179
|
+
<< ", B:" << d.IsBeginning() << ", E:" << d.IsEnd() << ", U:" << d.IsUnordered()
|
|
180
|
+
<< "}";
|
|
181
|
+
}
|
|
138
182
|
} // namespace SCTP
|
|
139
183
|
} // namespace RTC
|
|
140
184
|
|