diff --git a/worker/fuzzer/src/RTC/RTP/FuzzerPacket.cpp b/worker/fuzzer/src/RTC/RTP/FuzzerPacket.cpp index a447d08b82..9d9b740de5 100644 --- a/worker/fuzzer/src/RTC/RTP/FuzzerPacket.cpp +++ b/worker/fuzzer/src/RTC/RTP/FuzzerPacket.cpp @@ -19,7 +19,7 @@ void FuzzerRtcRtcPacket::Fuzz(const uint8_t* data, size_t len) return; } - // We need to serialize the Packet into a separate buffer because setters + // We need to serialize the packet into a separate buffer because setters // below will try to write into packet memory. // // NOTE: Let's make the buffer bigger to test API that increases packet size. @@ -180,7 +180,7 @@ void FuzzerRtcRtcPacket::Fuzz(const uint8_t* data, size_t len) value3 // value ); - // NOTE: Cannot use One-Byte Extensions because we are using big ids and + // NOTE: Cannot use One-Byte extensions because we are using big ids and // lengths. // packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::OneByte, extensions); packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::TwoBytes, extensions); diff --git a/worker/include/RTC/ICE/StunPacket.hpp b/worker/include/RTC/ICE/StunPacket.hpp index 5859a63a0f..c1e2e70720 100644 --- a/worker/include/RTC/ICE/StunPacket.hpp +++ b/worker/include/RTC/ICE/StunPacket.hpp @@ -58,10 +58,10 @@ namespace RTC /** * STUN Attributes. * - * After the STUN Message Header are zero or more Attributes. Each - * Attribute MUST be TLV encoded, with a 16-bit type, 16-bit length, and - * value. Each STUN Attribute MUST end on a 32-bit boundary. All fields - * in an Attribute are transmitted most significant bit first. + * After the STUN message header are zero or more attributes. Each + * attribute MUST be TLV encoded, with a 16-bit type, 16-bit length, and + * value. Each STUN attribute MUST end on a 32-bit boundary. All fields + * in an attribute are transmitted most significant bit first. * * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 @@ -145,7 +145,7 @@ namespace RTC */ uint16_t len; /** - * Offset of the Attribute from the start of the Attributes. + * Offset of the attribute from the start of the attributes. */ size_t offset; }; @@ -161,23 +161,23 @@ namespace RTC static const size_t FingerprintAttributeLength{ 4 }; /** - * Whether given buffer could be a valid STUN Packet. + * Whether given buffer could be a valid STUN packet. */ static bool IsStun(const uint8_t* buffer, size_t bufferLength); /** - * Parse a STUN Packet. + * Parse a STUN packet. * * @remarks - * - `bufferLength` must be the exact length of the STUN Packet. + * - `bufferLength` must be the exact length of the STUN packet. */ static StunPacket* Parse(const uint8_t* buffer, size_t bufferLength); /** - * Create a STUN Packet. + * Create a STUN packet. * * @remarks - * - `bufferLength` must be the exact length of the STUN Packet. + * - `bufferLength` must be the exact length of the STUN packet. * - If `transactionId` is not given then a random Transaction ID is * generated. */ @@ -196,7 +196,7 @@ namespace RTC private: /** - * Constructor is private because we only want to create STUN Packet + * Constructor is private because we only want to create STUN packet * instances via Parse() and Factory(). */ StunPacket(uint8_t* buffer, size_t bufferLength); @@ -366,8 +366,8 @@ namespace RTC StunPacket::AuthenticationResult CheckAuthentication(std::string_view password) const; /** - * Whether the STUN Packet is protected, meaning that it has - * MESSAGE-INTEGRITY and/or FINGERPRINT Attributes. + * Whether the STUN packet is protected, meaning that it has + * MESSAGE-INTEGRITY and/or FINGERPRINT attributes. */ bool IsProtected() const { @@ -377,17 +377,17 @@ namespace RTC } /** - * Adds MESSAGE-INTEGRITY and FINGERPRINT to the STUN Packet. + * Adds MESSAGE-INTEGRITY and FINGERPRINT to the STUN packet. * * @remarks * - MESSAGE-INTEGRITY is only added if given `password` is not empty. - * - The application MUST NOT add more Attributes into the STUN Packet - * and MUST NOT modify any field of the STUN Packet after calling + * - The application MUST NOT add more attributes into the STUN packet + * and MUST NOT modify any field of the STUN packet after calling * this method. * * @throw MediaSoupTypeError - If there is no enough space in the buffer. - * @throw MediaSoupError - If the STUN Packet already has MESSAGE-INTEGRITY - * or FINGERPRINT Attributes. + * @throw MediaSoupError - If the STUN packet already has MESSAGE-INTEGRITY + * or FINGERPRINT attributes. */ void Protect(const std::string_view password); @@ -396,15 +396,15 @@ namespace RTC /** * Creates a STUN success response for the current STUN request. * - * @throw MediaSoupError - If the STUN Packet is not a STUN request. + * @throw MediaSoupError - If the STUN packet is not a STUN request. */ StunPacket* CreateSuccessResponse(uint8_t* buffer, size_t bufferLength) const; /** * Creates a STUN error response for the current STUN request. It uses - * given `errorCode` and `reasonPhrase` to add a ERROR-CODE Attribute. + * given `errorCode` and `reasonPhrase` to add a ERROR-CODE attribute. * - * @throw MediaSoupError - If the STUN Packet is not a STUN request. + * @throw MediaSoupError - If the STUN packet is not a STUN request. */ StunPacket* CreateErrorResponse( uint8_t* buffer, @@ -444,8 +444,8 @@ namespace RTC } /** - * Validates whether the STUN Packet is valid. It also stores internal - * offsets pointing to relevant STUN Attributes if `storeAttributes` is + * Validates whether the STUN packet is valid. It also stores internal + * offsets pointing to relevant STUN attributes if `storeAttributes` is * `true`. */ #ifdef MS_TEST @@ -457,26 +457,26 @@ namespace RTC #endif /** - * Parses Attributes. Returns `true` if they are valid. It also stores - * internal containers holding Attributes if `storeAttributes` is `true`. + * Parses attributes. Returns `true` if they are valid. It also stores + * internal containers holding attributes if `storeAttributes` is `true`. */ bool ParseAttributes(bool storeAttributes); /** - * Stores the parsed Attribute data into the map of Attributes. + * Stores the parsed attribute data into the map of attributes. * - * @return `true` if the Attribute was stored and `false` if it couldn't - * be stored because there was already an Attribute with same type in + * @return `true` if the attribute was stored and `false` if it couldn't + * be stored because there was already an attribute with same type in * the map. */ bool StoreParsedAttribute(StunPacket::AttributeType type, uint16_t len, size_t offset); /** - * Stores a new Attribute data into the map of Attributes. + * Stores a new attribute data into the map of attributes. * * @throw MediaSoupError - If there is not enough space in the buffer for - * the new Attribute or if the Attribute couldn't be stored because - * there was already an Attribute with same type in the map. + * the new attribute or if the attribute couldn't be stored because + * there was already an attribute with same type in the map. */ void StoreNewAttribute(StunPacket::AttributeType type, const void* data, uint16_t len); @@ -532,7 +532,7 @@ namespace RTC private: StunPacket::Class klass{ StunPacket::Class::UNSET }; StunPacket::Method method{ StunPacket::Method::UNSET }; - // Map of STUN Attributes indexed by Attribute type. + // Map of STUN attributes indexed by attribute type. std::unordered_map attributes; }; } // namespace ICE diff --git a/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp b/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp index 13e4daa3aa..f1cb25f74f 100644 --- a/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp +++ b/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp @@ -5,7 +5,7 @@ #include "RTC/RTCP/Feedback.hpp" #include -/* RTP Extensions for Transport-wide Congestion Control +/* RTP extensions for Transport-wide Congestion Control * draft-holmer-rmcat-transport-wide-cc-extensions-01 0 1 2 3 diff --git a/worker/include/RTC/RTP/Packet.hpp b/worker/include/RTC/RTP/Packet.hpp index e3a30e811c..cee2e3202b 100644 --- a/worker/include/RTC/RTP/Packet.hpp +++ b/worker/include/RTC/RTP/Packet.hpp @@ -118,7 +118,7 @@ namespace RTC { /** * Auto means that One-Byte or Two-Bytes is choosen based on given - * Extensions. + * extensions. */ Auto = 0, OneByte = 1, @@ -189,7 +189,7 @@ namespace RTC static const size_t FixedHeaderMinLength{ 12 }; /** - * Whether given buffer could be a valid RTP Packet. + * Whether given buffer could be a valid RTP packet. * * @remarks * - Before calling this static method, the caller should verify whether @@ -198,10 +198,10 @@ namespace RTC static bool IsRtp(const uint8_t* buffer, size_t bufferLength); /** - * Parse a RTP Packet. + * Parse a RTP packet. * * @remarks - * - `packetLength` must be the exact length of the Packet. + * - `packetLength` must be the exact length of the packet. * - `bufferLength` must be >= `packetLength`. * * @throw MediaSoupTypeError - If `bufferLength` is lower than @@ -210,21 +210,21 @@ namespace RTC static Packet* Parse(const uint8_t* buffer, size_t packetLength, size_t bufferLength); /** - * Parse a RTP Packet. + * Parse a RTP packet. * * @remarks - * - `bufferLength` must be the exact length of the Packet. + * - `bufferLength` must be the exact length of the packet. */ static Packet* Parse(const uint8_t* buffer, size_t bufferLength); /** - * Create a RTP Packet. + * Create a RTP packet. */ static Packet* Factory(uint8_t* buffer, size_t bufferLength); /** * Generate value for "urn:mediasoup:params:rtp-hdrext:packet-id" - * mediasoup custom Extension. + * mediasoup custom extension. */ static uint32_t GetNextMediasoupPacketId(); @@ -233,7 +233,7 @@ namespace RTC private: /** - * Constructor is private because we only want to create Packet instances + * Constructor is private because we only want to create packet instances * via Parse() and Factory(). */ Packet(uint8_t* buffer, size_t bufferLength); @@ -298,11 +298,11 @@ namespace RTC } /** - * Get the Extension Header id or 0 if there isn't. + * Get the extension header id or 0 if there isn't. * * @remarks * - This method doesn't validate whether there is indeed space for the - * announced Header Extension. + * announced header extension. * - This method is guaranteed to return valid value once @ref Validate() * was succesfully called. */ @@ -317,12 +317,12 @@ namespace RTC } /** - * Pointer to the Header Extension value or `nullptr` if there is no - * Header Extension or its has no value. + * Pointer to the header extension value or `nullptr` if there is no + * header extension or its has no value. * * @remarks * - This method doesn't validate whether there is indeed space for the - * announced Header Extension. + * announced header extension. * - This method is guaranteed to return valid value once @ref Validate() * was succesfully called. */ @@ -339,7 +339,7 @@ namespace RTC } /** - * Length of the Header Extension value (excluding the id & length + * Length of the header extension value (excluding the id & length * four-octet). */ size_t GetHeaderExtensionValueLength() const @@ -353,12 +353,12 @@ namespace RTC } /** - * Remove the Header Extension. + * Remove the header extension. */ void RemoveHeaderExtension(); /** - * Whether the Packet has One-Byte or Two-Bytes Extensions. + * Whether the packet has One-Byte or Two-Bytes extensions. * * @see RFC 8285. */ @@ -368,7 +368,7 @@ namespace RTC } /** - * Whether the Packet has One-Byte Extensions. + * Whether the packet has One-Byte extensions. * * @see RFC 8285. */ @@ -378,7 +378,7 @@ namespace RTC } /** - * Whether the Packet has Two-Bytes Extensions. + * Whether the packet has Two-Bytes extensions. * * @see RFC 8285. */ @@ -388,13 +388,13 @@ namespace RTC } /** - * Whether the One-Byte or Two-Bytes Extension with given `id` exists in - * the Packet. + * Whether the One-Byte or Two-Bytes extension with given `id` exists in + * the packet. * * @see RFC 8285. * * @remarks - * - If the length of the Extension value is 0 this method returns `true`. + * - If the length of the extension value is 0 this method returns `true`. */ bool HasExtension(uint8_t id) const { @@ -426,7 +426,7 @@ namespace RTC } /** - * Get a pointer to the value of the the One-Byte or Two-Bytes Extension + * Get a pointer to the value of the the One-Byte or Two-Bytes extension * with given `id` and set its value length into given `len`. * * @see RFC 8285. @@ -463,7 +463,7 @@ namespace RTC auto* extension = reinterpret_cast(GetHeaderExtensionValue() + offset); - // In One-Byte Extensions value length 0 means 1. + // In One-Byte extensions value length 0 means 1. len = extension->len + 1; return extension->value; @@ -496,17 +496,17 @@ namespace RTC } /** - * Add or replace Extensions. + * Add or replace extensions. * * @see RFC 8285. * * @throw MediaSoupTypeError - If there is no space available for given - * Extensions or if given Extensions are invalid/wrong. + * extensions or if given extensions are invalid/wrong. */ void SetExtensions(ExtensionsType type, const std::vector& extensions); /** - * Assign Extension ids. + * Assign extension ids. * * @see RFC 8285. */ @@ -521,7 +521,7 @@ namespace RTC /** * @remarks * - `absSendTime` is set with the raw 3 bytes unsigned integer stored - * in the Extension value. + * in the extension value. */ bool ReadAbsSendTime(uint32_t& absSendtime) const; @@ -554,11 +554,11 @@ namespace RTC bool ReadMediasoupPacketId(uint32_t& mediasoupPacketId) const; /** - * Whether this Packet has payload. + * Whether this packet has payload. * * @remarks * - This method doesn't validate whether the padding length announced in - * the last byte of the Packet is valid. + * the last byte of the packet is valid. * - This method is guaranteed to return valid value once @ref Validate() * was succesfully called. */ @@ -573,11 +573,11 @@ namespace RTC * * @remarks * - This method doesn't validate whether the padding length announced in - * the last byte of the Packet is valid. + * the last byte of the packet is valid. * - This method is guaranteed to return valid value once @ref Validate() * was succesfully called. * - This method doens't take into account padding, so in a padding-only - * Packet this method returns `nullptr` with `len` 0. + * packet this method returns `nullptr` with `len` 0. */ uint8_t* GetPayload(size_t& len) const { @@ -608,11 +608,11 @@ namespace RTC * * @remarks * - This method doesn't validate whether the padding length announced in - * the last byte of the Packet is valid. + * the last byte of the packet is valid. * - This method is guaranteed to return valid value once @ref Validate() * was succesfully called. * - This method doens't take into account padding, so in a padding-only - * Packet this method returns `nullptr`. + * packet this method returns `nullptr`. */ uint8_t* GetPayload() const { @@ -626,7 +626,7 @@ namespace RTC * * @remarks * - This method doesn't validate whether the padding length announced in - * the last byte of the Packet is valid. + * the last byte of the packet is valid. * - This method is guaranteed to return valid value once @ref Validate() * was succesfully called. */ @@ -651,7 +651,7 @@ namespace RTC } /** - * Set the payload. It copies the given `payload` into the Packet. + * Set the payload. It copies the given `payload` into the packet. * * @remarks * - This method removes existing padding (if any). @@ -696,7 +696,7 @@ namespace RTC void ShiftPayload(size_t payloadOffset, int32_t delta); /** - * Whether this Packet has padding. + * Whether this packet has padding. */ bool HasPadding() const { @@ -708,7 +708,7 @@ namespace RTC * * @remarks * - This method doesn't validate whether the padding length announced in - * the last byte of the Packet is valid. + * the last byte of the packet is valid. * - This method is guaranteed to return valid value once @ref Validate() * was succesfully called. */ @@ -734,7 +734,7 @@ namespace RTC void SetPaddingLength(uint8_t paddingLength); /** - * Whether Packet length is padded to 4 bytes. + * Whether packet length is padded to 4 bytes. */ bool IsPaddedTo4Bytes() const { @@ -742,7 +742,7 @@ namespace RTC } /** - * Pad Packet length to 4 bytes by modifying padding bytes. + * Pad packet length to 4 bytes by modifying padding bytes. * * @remarks * - This method removes existing padding and adds up to 3 bytes of @@ -754,7 +754,7 @@ namespace RTC void PadTo4Bytes(); /** - * Encode the Packet into a RTX Packet. + * Encode the packet into a RTX packet. * * @remarks * - This method removes existing padding (if any). @@ -765,7 +765,7 @@ namespace RTC void RtxEncode(uint8_t payloadType, uint32_t ssrc, uint16_t seq); /** - * Decode the RTX Packet into a regular RTP Packet. + * Decode the RTX packet into a regular RTP packet. * * @return `true` if RTX decoding iwas done. * @@ -872,7 +872,7 @@ namespace RTC } /** - * Pointer to the location where Extension Header is supposed to begin. + * Pointer to the location where extension header is supposed to begin. */ HeaderExtension* GetHeaderExtensionPointer() const { @@ -880,11 +880,11 @@ namespace RTC } /** - * Length of the Header Extension including the id & length four-octet. + * Length of the header extension including the id & length four-octet. * * @remarks * - This method doesn't validate whether there is indeed space for the - * announced Header Extension. + * announced header extension. * - This method is guaranteed to return valid value once @ref Validate() * was succesfully called. */ @@ -907,8 +907,8 @@ namespace RTC } /** - * Validates whether the Packet is valid. It also stores internal - * containers holding Extensions if `storeExtensions` is `true`. + * Validates whether the packet is valid. It also stores internal + * containers holding extensions if `storeExtensions` is `true`. */ #ifdef MS_TEST public: @@ -919,20 +919,20 @@ namespace RTC #endif /** - * Parses Extensions. Returns `true` if they are valid. It also stores - * internal containers holding Extensions if `storeExtensions` is `true`. + * Parses extensions. Returns `true` if they are valid. It also stores + * internal containers holding extensions if `storeExtensions` is `true`. * * @see RFC 8285. */ bool ParseExtensions(bool storeExtensions); /** - * Set the value length of the Extension with given `id`. + * Set the value length of the extension with given `id`. * * @remarks * - The caller is responsible of not setting a length higher than the * available one (taking into account existing padding bytes). - * - If the Extension with `id` doesn't exist this methods terminates + * - If the extension with `id` doesn't exist this methods terminates * the process. */ void SetExtensionLength(uint8_t id, uint8_t len); @@ -947,14 +947,14 @@ namespace RTC #endif private: - // Array of One Byte Extensions. Index is the id - 1 of the Extension, - // each entry is the offset (in bytes) from the beginning of the Header - // Extension value to the beginning of the Extension. + // Array of One Byte Extensions. Index is the id - 1 of the extension, + // each entry is the offset (in bytes) from the beginning of the header + // extension value to the beginning of the extension. std::array oneByteExtensions{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; - // Ordered map of Two Bytes Extensions. Key is the id 1 of the Extension, - // each entry is the offset (in bytes) from the beginning of the Header - // Extension value to the beginning of the Extension. + // Ordered map of Two Bytes Extensions. Key is the id 1 of the extension, + // each entry is the offset (in bytes) from the beginning of the header + // extension value to the beginning of the extension. std::map twoBytesExtensions; // Extension ids. RTP::HeaderExtensionIds headerExtensionIds{}; diff --git a/worker/include/RTC/RTP/ProbationGenerator.hpp b/worker/include/RTC/RTP/ProbationGenerator.hpp index 0867e51b53..c37baf2433 100644 --- a/worker/include/RTC/RTP/ProbationGenerator.hpp +++ b/worker/include/RTC/RTP/ProbationGenerator.hpp @@ -12,7 +12,7 @@ namespace RTC { public: /** - * Maximum length of a probation RTP Packet. + * Maximum length of a probation RTP packet. */ static const size_t ProbationPacketMaxLength{ 1400 }; /** @@ -40,7 +40,7 @@ namespace RTC // Allocated by this. std::unique_ptr probationPacket; // Others. - // The length of the probation RTP Packet without payload or padding. + // The length of the probation RTP packet without payload or padding. size_t probationPacketMinLength{ 0 }; }; } // namespace RTP diff --git a/worker/include/RTC/RTP/SharedPacket.hpp b/worker/include/RTC/RTP/SharedPacket.hpp index dd620c2da0..58baaba8f6 100644 --- a/worker/include/RTC/RTP/SharedPacket.hpp +++ b/worker/include/RTC/RTP/SharedPacket.hpp @@ -22,7 +22,7 @@ namespace RTC SharedPacket(); /** - * Constructor with RTP Packet pointer. If a packet is given it's internally + * Constructor with RTP packet pointer. If a packet is given it's internally * cloned. */ explicit SharedPacket(RTP::Packet* packet); @@ -41,7 +41,7 @@ namespace RTC * @remarks * - No need to declare it but let's be explicit. * - * @throws MediasoupError if the Packet is too big. + * @throws MediasoupError if the packet is too big. */ SharedPacket& operator=(const SharedPacket&) = default; @@ -67,7 +67,7 @@ namespace RTC * Assign given packet (could be nullptr). If packet is given it's internally * cloned. * - * @throws MediasoupError if the Packet is too big. + * @throws MediasoupError if the packet is too big. */ void Assign(RTP::Packet* packet); @@ -80,7 +80,7 @@ namespace RTC void Reset(); /** - * Assert that RTP Packet contained in this SharedPacket is a clone of the + * Assert that RTP packet contained in this SharedPacket is a clone of the * given other packet (or there is no packet inside and no other packet has * been given). */ diff --git a/worker/include/RTC/SCTP/association/Association.hpp b/worker/include/RTC/SCTP/association/Association.hpp index 81140f1f9e..c50b131372 100644 --- a/worker/include/RTC/SCTP/association/Association.hpp +++ b/worker/include/RTC/SCTP/association/Association.hpp @@ -58,7 +58,7 @@ namespace RTC public: /** * Internal SCTP association state. This is different from the public SCTP - * Association state (`SCTP::Types::AssociationState`). + * association state (`SCTP::Types::AssociationState`). */ enum class State : uint8_t { @@ -133,12 +133,12 @@ namespace RTC /** * Struct holding local verification tag and initial TSN between having - * sent the INIT Chunk until the connection is established (there is no + * sent the INIT chunk until the connection is established (there is no * TCB in between). * * @remarks * - This is how dcSCTP does, despite RFC 9260 states that the TCB should - * also be created when an INIT Chunk is sent. + * also be created when an INIT chunk is sent. */ struct PreTransmissionControlBlock { @@ -192,7 +192,7 @@ namespace RTC /** * Initiate the SCTP association with the remote peer. It sends an INIT - * Chunk. + * chunk. * * @remarks * - The SCTP association must be in New state. @@ -202,7 +202,7 @@ namespace RTC void Connect() override; /** - * Gracefully shutdowns the Association and sends all outstanding data. + * Gracefully shutdowns the association and sends all outstanding data. * This is an asynchronous operation and `OnAssociationClosed()` will be * called on success. * @@ -215,7 +215,7 @@ namespace RTC void Shutdown() override; /** - * Closes the Association non-gracefully. Will send ABORT if the connection + * Closes the association non-gracefully. Will send ABORT if the connection * is not already closed. No callbacks will be made after Close() has * returned. However, before Close() returns, it may have called * `OnAssociationClosed()` or `OnAssociationAborted()` callbacks. @@ -223,7 +223,7 @@ namespace RTC void Close() override; /** - * Retrieves the latest metrics. If the Association is not fully connected, + * Retrieves the latest metrics. If the association is not fully connected, * `std::nullopt` will be returned. */ std::optional MakeMetrics() const override; @@ -319,7 +319,7 @@ namespace RTC * message will be queued. * * This has identical semantics to `SendMessage()', except that it may - * coalesce many messages into a single SCTP Packet if they would fit. + * coalesce many messages into a single SCTP packet if they would fit. * * @remarks * - Same as in `SendMessage()`. @@ -328,7 +328,7 @@ namespace RTC std::span messages, const SendMessageOptions& sendMessageOptions) override; /** - * Receives SCTP data (hopefully an SCTP Packet) from the remote peer. + * Receives SCTP data (hopefully an SCTP packet) from the remote peer. */ void ReceiveSctpData(const uint8_t* data, size_t len) override; @@ -376,13 +376,13 @@ namespace RTC void SendShutdownAckChunk(); /** - * Sends SHUTDOWN or SHUTDOWN-ACK if the Association is shutting down and + * Sends SHUTDOWN or SHUTDOWN-ACK if the association is shutting down and * if all outstanding data has been acknowledged. */ void MaySendShutdownOrShutdownAckChunk(); /** - * If the Association is shutting down, responds SHUTDOWN to any incoming + * If the association is shutting down, responds SHUTDOWN to any incoming * DATA. */ void MaySendShutdownOnPacketReceived(const Packet* receivedPacket); @@ -508,7 +508,7 @@ namespace RTC // The actual send queue implementation. As data can be sent before the // connection is established, this component is not in the TCB. RoundRobinSendQueue sendQueue; - // To keep settings between sending of INIT Chunk and establishment of + // To keep settings between sending of INIT chunk and establishment of // the connection. PreTransmissionControlBlock preTcb; // Once the SCTP association is established a Transmission Control Block @@ -522,7 +522,7 @@ namespace RTC const std::unique_ptr t1CookieTimer; // T2-shutdown timer. const std::unique_ptr t2ShutdownTimer; - // Max SCTP Packet length. + // Max SCTP packet length. const size_t maxPacketLength; // Whether this is DataChannel based SCTP. bool isDataChannel; diff --git a/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp b/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp index c6d779a994..0cd7f5f720 100644 --- a/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +++ b/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp @@ -42,13 +42,13 @@ namespace RTC void RestartTimer(); /** - * Called on received HEARTBEAT_REQUEST Chunk. + * Called on received HEARTBEAT-REQUEST chunk. */ void HandleReceivedHeartbeatRequestChunk( const HeartbeatRequestChunk* receivedHeartbeatRequestChunk); /** - * Called on received HEARTBEAT_ACK Chunk. + * Called on received HEARTBEAT-ACK chunk. */ void HandleReceivedHeartbeatAckChunk(const HeartbeatAckChunk* receivedHeartbeatAckChunk); diff --git a/worker/include/RTC/SCTP/association/NegotiatedCapabilities.hpp b/worker/include/RTC/SCTP/association/NegotiatedCapabilities.hpp index 0a5671cc88..eddfb10c20 100644 --- a/worker/include/RTC/SCTP/association/NegotiatedCapabilities.hpp +++ b/worker/include/RTC/SCTP/association/NegotiatedCapabilities.hpp @@ -21,7 +21,7 @@ namespace RTC * the SCTP association handshake flow. * * @remarks - * - Given `remoteChunk` must be an INIT or an INIT_ACK Chunk. + * - Given `remoteChunk` must be an INIT or an INIT-ACK chunk. */ static NegotiatedCapabilities Factory( const SctpOptions& sctpOptions, const AnyInitChunk* remoteChunk); @@ -44,7 +44,7 @@ namespace RTC bool partialReliability{ false }; /** - * Stream Schedulers and User Message Interleaving (I-DATA Chunks). + * Stream Schedulers and User Message Interleaving (I-DATA chunks). * * @see RFC 8260. */ diff --git a/worker/include/RTC/SCTP/association/PacketSender.hpp b/worker/include/RTC/SCTP/association/PacketSender.hpp index 5aa2cb8590..4d04d70f7e 100644 --- a/worker/include/RTC/SCTP/association/PacketSender.hpp +++ b/worker/include/RTC/SCTP/association/PacketSender.hpp @@ -29,10 +29,10 @@ namespace RTC public: /** - * Notifies the parent about a Packet to be sent to the peer and returns a - * boolean indicating whether the Packet was sent or not. + * Notifies the parent about a packet to be sent to the peer and returns a + * boolean indicating whether the packet was sent or not. * - * This method also writes the Packet checksum field depending on the value + * This method also writes the packet checksum field depending on the value * of `writeChecksum`. * * @remarks diff --git a/worker/include/RTC/SCTP/association/StateCookie.hpp b/worker/include/RTC/SCTP/association/StateCookie.hpp index f32d8609e9..590d51ea57 100644 --- a/worker/include/RTC/SCTP/association/StateCookie.hpp +++ b/worker/include/RTC/SCTP/association/StateCookie.hpp @@ -14,7 +14,7 @@ namespace RTC { /** * This is the State Cookie we generate and put into a State Cookie - * Parameter when we send INIT_ACK Chunk to the remote peer. + * parameter when we send INIT-ACK chunk to the remote peer. * * The syntax we use is as follows. Note that we use a fixed length of * StateCookieLength bytes. @@ -115,7 +115,7 @@ namespace RTC * * @remarks * `bufferLength` could be greater than the real length of the State - * Cookie. + * cookie. */ static StateCookie* Factory( uint8_t* buffer, @@ -159,8 +159,8 @@ namespace RTC StateCookie* Clone(uint8_t* buffer, size_t bufferLength) const final; /** - * The value of the Initiate Tag field we put in our INIT or INIT_ACK - * Chunk. Packets sent by the remote peer must include this value in + * The value of the Initiate Tag field we put in our INIT or INIT-ACK + * chunk. Packets sent by the remote peer must include this value in * their Verification Tag field. */ uint32_t GetLocalVerificationTag() const @@ -170,7 +170,7 @@ namespace RTC /** * The value of the Initiate Tag field the peer put in its INIT or - * INIT_ACK Chunk. Packets sent by us to the peer must include this value + * INIT-ACK chunk. Packets sent by us to the peer must include this value * in their Verification Tag field. */ uint32_t GetRemoteVerificationTag() const @@ -179,8 +179,8 @@ namespace RTC } /** - * The value of the Initial TSN field we put in our INIT or INIT_ACK - * Chunk. + * The value of the Initial TSN field we put in our INIT or INIT-ACK + * chunk. */ uint32_t GetLocalInitialTsn() const { @@ -189,7 +189,7 @@ namespace RTC /** * The value of the Initial TSN field the peer put in its INIT or - * INIT_ACK Chunk. + * INIT-ACK chunk. */ uint32_t GetRemoteInitialTsn() const { @@ -198,7 +198,7 @@ namespace RTC /** * The value of the Advertised Receiver Window Credit field we put in our - * INIT or INIT_ACK Chunk. + * INIT or INIT-ACK chunk. */ uint32_t GetRemoteAdvertisedReceiverWindowCredit() const { diff --git a/worker/include/RTC/SCTP/association/StreamResetHandler.hpp b/worker/include/RTC/SCTP/association/StreamResetHandler.hpp index 2f4e6b0006..ad20321f0f 100644 --- a/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +++ b/worker/include/RTC/SCTP/association/StreamResetHandler.hpp @@ -195,7 +195,7 @@ namespace RTC bool ShouldSendStreamResetRequest() const; /** - * Adds a Reset Streams request to the given Packet. Will start the + * Adds a Reset Streams request to the given packet. Will start the * reconfig timer. * * @remarks @@ -218,7 +218,7 @@ namespace RTC bool ValidateReceivedReConfigChunk(const ReConfigChunk* receivedReConfigChunk); /** - * Adds the actual RE-CONFIG chunk to the given Packet. A request (which + * Adds the actual RE-CONFIG chunk to the given packet. A request (which * set `this->currentRequest`) must have been created prior. */ void AddReConfigChunk(Packet* packet); @@ -229,7 +229,7 @@ namespace RTC ReqSeqNbrValidationResult ValidateReqSeqNbr(UnwrappedReConfigRequestSn reqSeqNbr); /** - * Called when this Association receives an outgoing stream reset request. + * Called when this association receives an outgoing stream reset request. * It might either be performed straight away, or have to be deferred, and * the result of that will be put in `responses`. */ @@ -238,7 +238,7 @@ namespace RTC ReConfigChunk* reConfigChunk); /** - * Called when this Association receives an incoming stream reset request. + * Called when this association receives an incoming stream reset request. * This isn't really supported, but a successful response is put in * `responses`. */ diff --git a/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp b/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp index 6a435788e0..88d5633d4f 100644 --- a/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +++ b/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp @@ -67,8 +67,8 @@ namespace RTC } /** - * The value of the Initiate Tag field we put in our INIT or INIT_ACK - * Chunk. Packets sent by the remote peer must include this value in + * The value of the Initiate Tag field we put in our INIT or INIT-ACK + * chunk. Packets sent by the remote peer must include this value in * their Verification Tag field. */ uint32_t GetLocalVerificationTag() const @@ -78,7 +78,7 @@ namespace RTC /** * The value of the Initiate Tag field the peer put in its INIT or - * INIT_ACK Chunk. Packets sent by us to the peer must include this value + * INIT-ACK chunk. Packets sent by us to the peer must include this value * in their Verification Tag field. */ uint32_t GetRemoteVerificationTag() const @@ -87,8 +87,8 @@ namespace RTC } /** - * The value of the Initial TSN field we put in our INIT or INIT_ACK - * Chunk. + * The value of the Initial TSN field we put in our INIT or INIT-ACK + * chunk. * * @remarks * - Implements TransmissionControlBlockContextInterface. @@ -100,7 +100,7 @@ namespace RTC /** * The value of the Initial TSN field the peer put in its INIT or - * INIT_ACK Chunk. + * INIT-ACK chunk. * * @remarks * - Implements TransmissionControlBlockContextInterface. @@ -112,7 +112,7 @@ namespace RTC /** * The value of the Advertised Receiver Window Credit field we put in our - * INIT or INIT_ACK Chunk. + * INIT or INIT-ACK chunk. */ uint32_t GetRemoteAdvertisedReceiverWindowCredit() const { @@ -200,17 +200,17 @@ namespace RTC } /** - * Will be set while the Association is in COOKIE_ECHOED state. In this - * state, there can only be a single Packet outstanding, and it must - * contain the COOKIE_ECHO Chunk as the first Chunk in that Packet, until - * the COOKIE_ACK has been received, which will make the socket call + * Will be set while the association is in COOKIE_ECHOED state. In this + * state, there can only be a single packet outstanding, and it must + * contain the COOKIE-ECHO chunk as the first chunk in that packet, until + * the COOKIE-ACK has been received, which will make the socket call * `ClearRemoteStateCookie()`. */ void SetRemoteStateCookie(std::vector remoteStateCookie); /** - * Called when the COOKIE_ACK Chunk has been received, to allow further - * Packets to be sent. + * Called when the COOKIE-ACK chunk has been received, to allow further + * packets to be sent. */ void ClearRemoteStateCookie(); @@ -220,12 +220,12 @@ namespace RTC } /** - * Sends a SACK Chunk, if there is a need to. + * Sends a SACK chunk, if there is a need to. */ void MaySendSackChunk(); /** - * May add a FORWARD-TSN or I-FORWARD-TSN Chunk to the given Packet if it + * May add a FORWARD-TSN or I-FORWARD-TSN chunk to the given packet if it * is needed and allowed (rate-limited). */ void MayAddForwardTsnChunk(Packet* packet, uint64_t nowMs); @@ -233,12 +233,12 @@ namespace RTC void MaySendFastRetransmit(); /** - * Create and fill Packets with control and DATA/I-DATA Chunks, and sends + * Create and fill packets with control and DATA/I-DATA chunks, and sends * them as much as can be allowed by the congestion control algorithm. * * @remarks - * - If `this->remoteStateCookie` is present, then only one Packet will be - * sent, with this Chunk as the first Chunk. + * - If `this->remoteStateCookie` is present, then only one packet will be + * sent, with this chunk as the first chunk. * - Cannot pass `addCookieAckChunk=true` if `this->remoteStateCookie` is * present (will throw). */ @@ -300,7 +300,7 @@ namespace RTC // Nonce, used to detect reconnections. uint64_t tieTag; NegotiatedCapabilities negotiatedCapabilities; - // Max SCTP Packet length. + // Max SCTP packet length. const size_t maxPacketLength; std::function isAssociationEstablished; // The data retransmission timer. @@ -315,14 +315,14 @@ namespace RTC RetransmissionQueue retransmissionQueue; StreamResetHandler streamResetHandler; HeartbeatHandler heartbeatHandler; - // Rate limiting of FORWARD_TSN. Next can be sent at or after this + // Rate limiting of FORWARD-TSN. Next can be sent at or after this // timestamp. uint64_t limitForwardTsnUntilMs{ 0 }; // Only valid when state is State::COOKIE_ECHOED. In this state, the - // Association must wait for COOKIE_ACK to continue sending any packets (not - // including a COOKIE_ECHO). So if this state cookie is present, the - // `SendBufferedChunks()` method will always only send one Packet, with - // a CookieEchoChunk containing this cookie as the first Chunk in the Packet. + // association must wait for COOKIE-ACK to continue sending any packets (not + // including a COOKIE-ECHO). So if this state cookie is present, the + // `SendBufferedChunks()` method will always only send one packet, with + // a CookieEchoChunk containing this cookie as the first chunk in the packet. std::optional> remoteStateCookie; }; } // namespace SCTP diff --git a/worker/include/RTC/SCTP/association/TransmissionControlBlockContextInterface.hpp b/worker/include/RTC/SCTP/association/TransmissionControlBlockContextInterface.hpp index 4e1ea0928d..4f4d83de1f 100644 --- a/worker/include/RTC/SCTP/association/TransmissionControlBlockContextInterface.hpp +++ b/worker/include/RTC/SCTP/association/TransmissionControlBlockContextInterface.hpp @@ -15,19 +15,19 @@ namespace RTC virtual ~TransmissionControlBlockContextInterface() = default; /** - * Indicates if the SCTP Association has been established. + * Indicates if the SCTP association has been established. */ virtual bool IsAssociationEstablished() const = 0; /** * The value of the Initiate Tag field the peer put in its INIT or - * INIT_ACK Chunk. + * INIT-ACK chunk. */ virtual uint32_t GetLocalInitialTsn() const = 0; /** * The value of the Initial TSN field the peer put in its INIT or - * INIT_ACK Chunk. + * INIT-ACK chunk. */ virtual uint32_t GetRemoteInitialTsn() const = 0; @@ -62,7 +62,7 @@ namespace RTC virtual std::unique_ptr CreatePacket() const = 0; /** - * Sends a Packet and returns a boolean indicating whether the Packet was + * Sends a packet and returns a boolean indicating whether the packet was * sent or not. */ virtual bool SendPacket(Packet* packet) = 0; diff --git a/worker/include/RTC/SCTP/packet/Chunk.hpp b/worker/include/RTC/SCTP/packet/Chunk.hpp index 8e0d9a32cf..f2f8ed5e97 100644 --- a/worker/include/RTC/SCTP/packet/Chunk.hpp +++ b/worker/include/RTC/SCTP/packet/Chunk.hpp @@ -28,13 +28,13 @@ namespace RTC * \ \ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits). - * - Chunk Flags (8 bits). - * - Chunk Length (16 bits): Total length of the Chunk - * excluding padding bytes. Minimum value is 4 (if Chunk Value is 0 + * - Chunk type (8 bits). + * - Chunk flags (8 bits). + * - Chunk length (16 bits): Total length of the chunk + * excluding padding bytes. Minimum value is 4 (if chunk value is 0 * bytes). Maximum value is 65535, which means 1 byte of padding. - * - Chunk Value (variable length). - * - Padding: Bytes of padding to make the Chunk total length be + * - Chunk value (variable length). + * - Padding: Bytes of padding to make the chunk total length be * multiple of 4 bytes. */ @@ -43,7 +43,7 @@ namespace RTC class Chunk : public TLV { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -79,7 +79,7 @@ namespace RTC /** * Action that is taken if the processing endpoint does not recognize the - * Chunk Type. + * chunk type. */ enum class ActionForUnknownChunkType : uint8_t { @@ -100,10 +100,10 @@ namespace RTC ChunkType type; uint8_t flags; /** - * The value of the Chunk Length field, which represents the total - * length of the Chunk in bytes, including the Chunk Type, Chunk Flags, - * Chunk Length and Chunk Value fields. So if the Chunk Value field is - * zero-length, the Length field must be 4. The Chunk Length field does + * The value of the chunk length field, which represents the total + * length of the chunk in bytes, including the chunk type, chunk flags, + * chunk length and chunk value fields. So if the chunk value field is + * zero-length, the length field must be 4. The chunk length field does * not count any padding. */ uint16_t length; @@ -149,16 +149,16 @@ namespace RTC public: /** - * Whether given buffer could be a a valid Chunk. + * Whether given buffer could be a a valid chunk. * * @param buffer - * @param bufferLength - Can be greater than real Chunk length. - * @param chunkType - If given buffer is a valid Chunk then `chunkType` + * @param bufferLength - Can be greater than real chunk length. + * @param chunkType - If given buffer is a valid chunk then `chunkType` * is rewritten to parsed ChunkType. - * @param chunkLength - If given buffer is a valid Chunk then - * `chunkLength` is rewritten to the value of the Chunk Length field. - * @param padding - If given buffer is a valid Chunk then `padding` is - * rewritten to the number of padding bytes in the Chunk (only the + * @param chunkLength - If given buffer is a valid chunk then + * `chunkLength` is rewritten to the value of the chunk length field. + * @param padding - If given buffer is a valid chunk then `padding` is + * rewritten to the number of padding bytes in the chunk (only the * necessary ones to make total length multiple of 4). */ static bool IsChunk( @@ -175,7 +175,7 @@ namespace RTC protected: /** - * Constructor is protected because we only want to create Chunk + * Constructor is protected because we only want to create chunk * instances via Parse() and Factory() in subclasses. */ Chunk(uint8_t* buffer, size_t bufferLength); @@ -217,7 +217,7 @@ namespace RTC } /** - * Whether this type of Chunk can have Parameters. Subclasses must + * Whether this type of chunk can have parameters. Subclasses must * override this method. */ virtual bool CanHaveParameters() const = 0; @@ -267,42 +267,42 @@ namespace RTC } /** - * Clone given Parameter into Chunk's buffer. + * Clone given parameter into chunk's buffer. * * @remarks * - Once this method is called, the caller may want to free the original - * given Parameter (otherwise it will leak since the Chunk manages a clone + * given parameter (otherwise it will leak since the chunk manages a clone * of it). * * @throw - * - MediaSoupError - If the Chunk subclass cannot have Parameters. + * - MediaSoupError - If the chunk subclass cannot have parameters. * - MediaSoupError - If `BuildParameterInPlace()` or * `BuildErrorCauseInPlace()` was called before and the caller didn't - * invoke `Consolidate()` on the returned Parameter or Error Cause yet. + * invoke `Consolidate()` on the returned parameter or error cause yet. */ virtual void AddParameter(const Parameter* parameter) final; /** - * Build a Parameter within the Chunk's buffer and append it to the list - * of Parameters. The caller can perform modifications in that Parameter - * and those will affect the Chunk body where the Parameter is serialized. - * The desired Parameter class type is given via template argument. + * Build a parameter within the chunk's buffer and append it to the list + * of parameters. The caller can perform modifications in that parameter + * and those will affect the chunk body where the parameter is serialized. + * The desired parameter class type is given via template argument. * - * @returns Pointer of the created Parameter specific class. + * @returns Pointer of the created parameter specific class. * * @throw - * - MediaSoupError - If the Chunk subclass cannot have Parameters. + * - MediaSoupError - If the chunk subclass cannot have parameters. * - MediaSoupError - If `BuildParameterInPlace()` or * `BuildErrorCauseInPlace()` was called before and the caller didn't - * invoke `Consolidate()` on the returned Parameter or Error Cause yet. + * invoke `Consolidate()` on the returned parameter or error cause yet. * * @remarks - * - The caller MUST invoke `Consolidate()` once the Parameter is + * - The caller MUST invoke `Consolidate()` once the parameter is * completed. - * - The caller MUST NOT free the obtained Parameter pointer since it's - * now part of the Chunk. - * - The caller MUST free the obtained Parameter only in case the - * `Consolidate()` method on the Parameter throws. + * - The caller MUST NOT free the obtained parameter pointer since it's + * now part of the chunk. + * - The caller MUST free the obtained parameter only in case the + * `Consolidate()` method on the parameter throws. * - Method implemented in header file due to C++ template usage. * * @example @@ -317,18 +317,18 @@ namespace RTC AssertCanHaveParameters(); AssertDoesNotNeedConsolidation(); - // The new Parameter will be added after other Parameters in the Chunk, - // this is, at the end of the Chunk, whose length we know it's padded to - // 4 bytes, and each Parameter total length is also multiple of 4 bytes. + // The new parameter will be added after other parameters in the chunk, + // this is, at the end of the chunk, whose length we know it's padded to + // 4 bytes, and each parameter total length is also multiple of 4 bytes. auto* ptr = const_cast(GetBuffer()) + GetLength(); // The remaining length in the buffer is the potential buffer length - // of the Parameter. + // of the parameter. size_t parameterMaxBufferLength = GetBufferLength() - (ptr - GetBuffer()); auto* parameter = T::Factory(ptr, parameterMaxBufferLength); - // NOTE: Do not fix/update the Parameter buffer length since the caller - // probably wants to modify the Parameter. + // NOTE: Do not fix/update the parameter buffer length since the caller + // probably wants to modify the parameter. HandleInPlaceParameter(parameter); @@ -336,7 +336,7 @@ namespace RTC } /** - * Whether this type of Chunk can have Error Causes. Subclasses must + * Whether this type of chunk can have error causes. Subclasses must * override this method. */ virtual bool CanHaveErrorCauses() const = 0; @@ -386,43 +386,43 @@ namespace RTC } /** - * Clone given Error Cause into Chunk's buffer. + * Clone given error cause into chunk's buffer. * * @remarks * - Once this method is called, the caller may want to free the original - * given Error Cause (otherwise it will leak since the Chunk manages a + * given error cause (otherwise it will leak since the chunk manages a * clone of it). * * @throw - * - MediaSoupError - If the Chunk subclass cannot have Error Causes. + * - MediaSoupError - If the chunk subclass cannot have error causes. * - MediaSoupError - If `BuildParameterInPlace()` or * `BuildErrorCauseInPlace()` was called before and the caller didn't - * invoke `Consolidate()` on the returned Parameter or Error Cause yet. + * invoke `Consolidate()` on the returned parameter or error cause yet. */ virtual void AddErrorCause(const ErrorCause* errorCause) final; /** - * Build a Error Cause within the Chunk's buffer and append it to the - * list of Error Causes. The caller can perform modifications in that - * Error Cause and those will affect the Chunk body where the Error Cause - * is serialzed. The desired Error Cause class type is given via template + * Build a error cause within the chunk's buffer and append it to the + * list of error causes. The caller can perform modifications in that + * error cause and those will affect the chunk body where the error cause + * is serialzed. The desired error cause class type is given via template * argument. * - * @returns Pointer of the created Error Cause specific class. + * @returns Pointer of the created error cause specific class. * * @throw - * - MediaSoupError - If the Chunk subclass cannot have Error Causes. + * - MediaSoupError - If the chunk subclass cannot have error causes. * - MediaSoupError - If `BuildParameterInPlace()` or * `BuildErrorCauseInPlace()` was called before and the caller didn't - * invoke `Consolidate()` on the returned Parameter or Error Cause yet. + * invoke `Consolidate()` on the returned parameter or error cause yet. * * @remarks - * - The caller MUST invoke `Consolidate()` once the Error Cause is + * - The caller MUST invoke `Consolidate()` once the error cause is * completed. - * - The caller MUST NOT free the obtained Error Cause pointer since it's - * now part of the Chunk. - * - The caller MUST free the obtained Error Cause only in case the - * `Consolidate()` method on the Error Cause throws. + * - The caller MUST NOT free the obtained error cause pointer since it's + * now part of the chunk. + * - The caller MUST free the obtained error cause only in case the + * `Consolidate()` method on the error cause throws. * - Method implemented in header file due to C++ template usage. * * @example @@ -437,19 +437,19 @@ namespace RTC AssertCanHaveErrorCauses(); AssertDoesNotNeedConsolidation(); - // The new Error Cause will be added after other Error Causes in the - // Chunk, this is, at the end of the Chunk, whose length we know it's - // padded to 4 bytes, and each Error Cause total length is also + // The new error cause will be added after other error causes in the + // chunk, this is, at the end of the chunk, whose length we know it's + // padded to 4 bytes, and each error cause total length is also // multiple of 4 bytes. auto* ptr = const_cast(GetBuffer()) + GetLength(); // The remaining length in the buffer is the potential buffer length - // of the Error Cause. + // of the error cause. size_t errorCauseMaxBufferLength = GetBufferLength() - (ptr - GetBuffer()); auto* errorCause = T::Factory(ptr, errorCauseMaxBufferLength); - // NOTE: Do not fix/update the Error Cause buffer length since the - // caller probably wants to modify the Error Cause. + // NOTE: Do not fix/update the error cause buffer length since the + // caller probably wants to modify the error cause. HandleInPlaceErrorCause(errorCause); @@ -459,7 +459,7 @@ namespace RTC /** * Whether `BuildParameterInPlace()` or `BuildErrorCauseInPlace()` was * called before and the caller didn't invoke `Consolidate()` on the - * returned Parameter or Error Cause yet. + * returned parameter or error cause yet. */ virtual bool NeedsConsolidation() const final { @@ -576,8 +576,8 @@ namespace RTC /** * Chunk subclasses with header bigger than default one (4 bytes) must * override this method and return their header length (excluding - * variable-length field considered "value", Optional/Variable-Length - * Parameters and Error Causes). + * variable-length field considered "value", Optional/variable-length + * parameters and error causes). */ size_t GetHeaderLength() const override { @@ -585,34 +585,34 @@ namespace RTC } /** - * To be called by each subclass of Chunk if Parameters parsing is - * needed. It creates Parameter subclasses and adds them to the Chunk. + * To be called by each subclass of chunk if parameters parsing is + * needed. It creates parameter subclasses and adds them to the chunk. * * @remarks - * - This method assumes that the Chunk basic parsing has been made - * already so current length of the Chunk is the fixed length of the - * specific Chunk class. + * - This method assumes that the chunk basic parsing has been made + * already so current length of the chunk is the fixed length of the + * specific chunk class. * - * @return True if no error happened while parsing Parameters. + * @return True if no error happened while parsing parameters. * * @throw - * - MediaSoupError - If the Chunk subclass cannot have Chunk Parameters. + * - MediaSoupError - If the chunk subclass cannot have chunk parameters. */ virtual bool ParseParameters() final; /** - * To be called by each subclass of Chunk if Error Causes parsing is - * needed. It creates ErrorCause subclasses and adds them to the Chunk. + * To be called by each subclass of chunk if error causes parsing is + * needed. It creates ErrorCause subclasses and adds them to the chunk. * * @remarks - * - This method assumes that the Chunk basic parsing has been made - * already so current length of the Chunk is the fixed length of the - * specific Chunk class. + * - This method assumes that the chunk basic parsing has been made + * already so current length of the chunk is the fixed length of the + * specific chunk class. * - * @return True if no error happened while parsing Error Causes. + * @return True if no error happened while parsing error causes. * * @throw - * - MediaSoupError - If the Chunk subclass cannot have Chunk Parameters. + * - MediaSoupError - If the chunk subclass cannot have chunk parameters. */ virtual bool ParseErrorCauses() final; @@ -658,7 +658,7 @@ namespace RTC std::vector errorCauses; // Whether `BuildParameterInPlace()` or `BuildErrorCauseInPlace()` was // called and the caller didn't invoke `Consolidate()` on the returned - // Parameter or Error Cause yet. + // parameter or error cause yet. bool needsConsolidation{ false }; }; } // namespace SCTP diff --git a/worker/include/RTC/SCTP/packet/ErrorCause.hpp b/worker/include/RTC/SCTP/packet/ErrorCause.hpp index 9bf87def24..606cca9d74 100644 --- a/worker/include/RTC/SCTP/packet/ErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/ErrorCause.hpp @@ -25,12 +25,12 @@ namespace RTC * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * - Cause Code (16 bits). - * - Cause Length (16 bits): Set to the size of the Error Cause in bytes, - * including the Cause Code, Cause Length, and Cause-Specific Information + * - Cause length (16 bits): Set to the size of the error cause in bytes, + * including the Cause Code, Cause length, and Cause-Specific Information * fields (padding excluded). * - Cause-Specific Information (variable length): This field carries the * details of the error condition. - * - Padding: Bytes of padding to make the Error Cause total length be + * - Padding: Bytes of padding to make the error cause total length be * multiple of 4 bytes. */ @@ -39,7 +39,7 @@ namespace RTC class ErrorCause : public TLV { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -75,11 +75,11 @@ namespace RTC { ErrorCauseCode code; /** - * The value of the Error Cause Length field, which represents the - * total length of the Error Cause in bytes, including the Cause Code, - * Cause Length and Cause-Specific Information fields. So if the - * Cause-Specific Information field is zero-length, the Length field - * must be 4. The Cause Length field does not count any padding. + * The value of the error cause length field, which represents the + * total length of the error cause in bytes, including the Cause Code, + * Cause length and Cause-Specific Information fields. So if the + * Cause-Specific Information field is zero-length, the length field + * must be 4. The Cause length field does not count any padding. */ uint16_t length; }; @@ -89,16 +89,16 @@ namespace RTC public: /** - * Whether given buffer could be a a valid Error Cause. + * Whether given buffer could be a a valid error cause. * * @param buffer - * @param bufferLength - Can be greater than real Error Cause length. - * @param causeCode - If given buffer is a valid Error Cause then + * @param bufferLength - Can be greater than real error cause length. + * @param causeCode - If given buffer is a valid error cause then * `causeCode` is rewritten to parsed ErrorCauseCode. - * @param causeLength - If given buffer is a valid Error Cause then - * `causeLength` is rewritten to the value of the Cause Length field. - * @param padding - If given buffer is a valid Error Cause then `padding` - * is rewritten to the number of padding bytes in the Error Cause (only + * @param causeLength - If given buffer is a valid error cause then + * `causeLength` is rewritten to the value of the Cause length field. + * @param padding - If given buffer is a valid error cause then `padding` + * is rewritten to the number of padding bytes in the error cause (only * the necessary ones to make total length multiple of 4). */ static bool IsErrorCause( diff --git a/worker/include/RTC/SCTP/packet/Packet.hpp b/worker/include/RTC/SCTP/packet/Packet.hpp index 35ff992aed..e6e70f2d6f 100644 --- a/worker/include/RTC/SCTP/packet/Packet.hpp +++ b/worker/include/RTC/SCTP/packet/Packet.hpp @@ -27,7 +27,7 @@ namespace RTC * | Chunk #n | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * It's mandatory that the Packet total length is multiple of 4 bytes. + * It's mandatory that the packet total length is multiple of 4 bytes. */ /** @@ -73,28 +73,28 @@ namespace RTC static const size_t CommonHeaderLength{ 12 }; /** - * Whether given buffer could be a valid SCTP Packet. + * Whether given buffer could be a valid SCTP packet. * * @remarks - * - `bufferLength` must be the exact length of the Packet. + * - `bufferLength` must be the exact length of the packet. * - This check is very lazy. It should NEVER be done before checking if * given buffer is an RTP or RTCP packet. */ static bool IsSctp(const uint8_t* buffer, size_t bufferLength); /** - * Parse an SCTP Packet. + * Parse an SCTP packet. * * @remarks - * - `bufferLength` must be the exact length of the Packet. + * - `bufferLength` must be the exact length of the packet. */ static Packet* Parse(const uint8_t* buffer, size_t bufferLength); /** - * Create an SCTP Packet. + * Create an SCTP packet. * * @remarks - * - `bufferLength` must be the exact length of the STUN Packet. + * - `bufferLength` must be the exact length of the STUN packet. * - If `transactionId` is not given then a random Transaction ID is * generated. */ @@ -102,8 +102,8 @@ namespace RTC private: /** - * Constructor is private because we only want to create Packet instances - * via Parse() and Factory(). + * Constructor is private because we only want to create packet instances + * via `Parse()` and `Factory()`. */ Packet(uint8_t* buffer, size_t bufferLength); @@ -189,39 +189,39 @@ namespace RTC } /** - * Clone given Chunk into Packet's buffer. + * Clone given chunk into packet's buffer. * * @remarks * - Once this method is called, the caller may want to free the original - * given Chunk (otherwise it will leak since the Packet manages a clone + * given chunk (otherwise it will leak since the packet manages a clone * of it). * * @throw * - MediaSoupError - If `BuildChunkInPlace()` was called before and the - * caller didn't invoke `Consolidate()` on the returned Chunk yet. + * caller didn't invoke `Consolidate()` on the returned chunk yet. */ void AddChunk(const Chunk* chunk); /** - * Build a Chunk within the Packet's buffer and append it to the list of - * Chunks. The caller can perform modifications in that Chunk and those - * will affect the Packet body where the Chunk is serialzed. The desired - * Chunk class type is given via template argument. + * Build a chunk within the packet's buffer and append it to the list of + * chunks. The caller can perform modifications in that chunk and those + * will affect the packet body where the chunk is serialzed. The desired + * chunk class type is given via template argument. * - * @returns Pointer of the created Chunk specific class. + * @returns Pointer of the created chunk specific class. * * @throw * - MediaSoupError - If `BuildChunkInPlace()` was called before and the - * caller didn't invoke `Consolidate()` on the returned Chunk yet. + * caller didn't invoke `Consolidate()` on the returned chunk yet. * * @remarks - * - The caller MUST invoke `Consolidate()` once the Chunk is completed. - * - The caller MUST NOT call `BuildChunkInPlace()` while other Chunk is + * - The caller MUST invoke `Consolidate()` once the chunk is completed. + * - The caller MUST NOT call `BuildChunkInPlace()` while other chunk is * in progress. - * - The caller MUST NOT free the obtained Chunk pointer since it's now - * part of the Packet. - * - The caller MUST free the obtained Chunk only in case the - * `Consolidate()` method on the Chunk throws. + * - The caller MUST NOT free the obtained chunk pointer since it's now + * part of the packet. + * - The caller MUST free the obtained chunk only in case the + * `Consolidate()` method on the chunk throws. * - Method implemented in header file due to C++ template usage. * * @example @@ -234,18 +234,18 @@ namespace RTC { AssertDoesNotNeedConsolidation(); - // The new Chunk will be added after other Chunks in the Packet, this is, - // at the end of the Packet, whose length we know it's padded to 4 - // bytes, and each Parameter total length is also multiple of 4 bytes. + // The new chunk will be added after other chunks in the packet, this is, + // at the end of the packet, whose length we know it's padded to 4 bytes, + // and each parameter total length is also multiple of 4 bytes. auto* ptr = const_cast(GetBuffer()) + GetLength(); // The remaining length in the buffer is the potential buffer length - // of the Chunk. + // of the chunk. size_t chunkMaxBufferLength = GetBufferLength() - (ptr - GetBuffer()); auto* chunk = T::Factory(ptr, chunkMaxBufferLength); - // NOTE: Do not fix/update the Chunk buffer length since the caller - // probably wants to modify the Chunk. + // NOTE: Do not fix/update the chunk buffer length since the caller + // probably wants to modify the chunk. HandleInPlaceChunk(chunk); @@ -254,7 +254,7 @@ namespace RTC /** * Whether `BuildChunkInPlace()` was called and the caller didn't invoke - * `Consolidate()` on the returned Chunk yet. + * `Consolidate()` on the returned chunk yet. */ bool NeedsConsolidation() const { @@ -262,7 +262,7 @@ namespace RTC } /** - * Calculate CRC32C value of the whole Packet and insert it into the + * Calculate CRC32C value of the whole packet and insert it into the * Checksum field. */ void WriteCRC32cChecksum(); @@ -295,7 +295,7 @@ namespace RTC // Chunks. std::vector chunks; // Whether `BuildChunkInPlace()` was called and the caller didn't invoke - // `Consolidate()` on the returned Chunk yet. + // `Consolidate()` on the returned chunk yet. bool needsConsolidation{ false }; }; } // namespace SCTP diff --git a/worker/include/RTC/SCTP/packet/Parameter.hpp b/worker/include/RTC/SCTP/packet/Parameter.hpp index 127b18cdbf..c67e6a32ec 100644 --- a/worker/include/RTC/SCTP/packet/Parameter.hpp +++ b/worker/include/RTC/SCTP/packet/Parameter.hpp @@ -25,13 +25,13 @@ namespace RTC * \ \ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Parameter Type (16 bits). - * - Parameter Length (16 bits): Total length of the Parameter, including - * the Parameter Type, Parameter Length and Parameter Value fields - * (padding is excluded). Thus, a Parameter with a zero-length Parameter - * Value field would have a Parameter Length field of 4. - * - Parameter Value (variable length). - * - Padding: Bytes of padding to make the Parameter total length be + * - Parameter type (16 bits). + * - Parameter length (16 bits): Total length of the parameter, including + * the parameter type, parameter length and parameter value fields + * (padding is excluded). Thus, a parameter with a zero-length parameter + * value field would have a parameter length field of 4. + * - Parameter value (variable length). + * - Padding: Bytes of padding to make the parameter total length be * multiple of 4 bytes. */ @@ -40,7 +40,7 @@ namespace RTC class Parameter : public TLV { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -69,7 +69,7 @@ namespace RTC /** * Action that is taken if the processing endpoint does not recognize the - * Parameter. + * parameter. */ enum class ActionForUnknownParameterType : uint8_t { @@ -89,11 +89,11 @@ namespace RTC { ParameterType type; /** - * The value of the Parameter Length field, which represents the total - * length of the Parameter in bytes, including the Parameter Type, - * Parameter Length and Parameter Value fields. So if the Parameter - * Value field is zero-length, the Length field must be 4. The - * Parameter Length field does not count any padding. + * The value of the parameter length field, which represents the total + * length of the parameter in bytes, including the parameter type, + * parameter length and parameter value fields. So if the parameter + * value field is zero-length, the length field must be 4. The + * parameter length field does not count any padding. */ uint16_t length; }; @@ -103,17 +103,17 @@ namespace RTC public: /** - * Whether given buffer could be a a valid Parameter. + * Whether given buffer could be a a valid parameter. * * @param buffer - * @param bufferLength - Can be greater than real Parameter length. - * @param parameterType - If given buffer is a valid Parameter then + * @param bufferLength - Can be greater than real parameter length. + * @param parameterType - If given buffer is a valid parameter then * `parameterType` is rewritten to parsed ParameterType. - * @param parameterLength - If given buffer is a valid Parameter then - * `parameterLength` is rewritten to the value of the Parameter Length + * @param parameterLength - If given buffer is a valid parameter then + * `parameterLength` is rewritten to the value of the parameter length * field. - * @param padding - If given buffer is a valid Parameter then `padding` - * is rewritten to the number of padding bytes in the Parameter (only + * @param padding - If given buffer is a valid parameter then `padding` + * is rewritten to the number of padding bytes in the parameter (only * the necessary ones to make total length multiple of 4). */ static bool IsParameter( @@ -130,7 +130,7 @@ namespace RTC protected: /** - * Constructor is protected because we only want to create Parameter + * Constructor is protected because we only want to create parameter * instances via Parse() and Factory() in subclasses. */ Parameter(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/TLV.hpp b/worker/include/RTC/SCTP/packet/TLV.hpp index 5ec7e35475..d92114241c 100644 --- a/worker/include/RTC/SCTP/packet/TLV.hpp +++ b/worker/include/RTC/SCTP/packet/TLV.hpp @@ -12,12 +12,12 @@ namespace RTC /** * SCTP TLV (Type-Length-Value). * - * This is the base class of all items in an SCTP Packet, this is: - * - SCTP Chunk, - * - SCTP Parameter, and - * - SCTP Error Cause. + * This is the base class of all items in an SCTP packet, this is: + * - SCTP chunk, + * - SCTP parameter, and + * - SCTP error cause. * - * All those items have the same Length field and 4-byte padded length. + * All those items have the same length field and 4-byte padded length. * * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 @@ -59,8 +59,8 @@ namespace RTC /** * Subclasses with header bigger than default one (4 bytes) must override * this method and return their header length (excluding variable-length - * field considered "value", Optional/Variable-Length - * Parameters and Error Causes). + * field considered "value", Optional/variable-length + * parameters and error causes). */ virtual size_t GetHeaderLength() const { @@ -68,7 +68,7 @@ namespace RTC } /** - * The value of the Length field, which includes the length of the header + * The value of the length field, which includes the length of the header * and content (padding excluded). */ virtual uint16_t GetLengthField() const final @@ -101,9 +101,9 @@ namespace RTC * @remarks * - The variable-length value starts after the fixed header, which can be * different and have different length in each item definition. - * - In the case of SCTP Chunk class and subclasses (which implements this - * class) we assume that a Chunk having variable-length value does not - * have Parameters or Error Causes. + * - In the case of SCTP chunk class and subclasses (which implements this + * class) we assume that a chunk having variable-length value does not + * have parameters or error causes. */ virtual const uint8_t* GetVariableLengthValue() const final { @@ -118,7 +118,7 @@ namespace RTC /** * Set the variable-length value. It copies the given value into the * the variable-length value of the item and updates both the length of - * the Serializable and the Length field. + * the Serializable and the length field. * * @throw MediaSoupTypeError - If given `valueLength` is higher than * available length. @@ -153,7 +153,7 @@ namespace RTC /** * This method doesn't really add an item into the item (that must be done * by each subcass) but updates the length of the Serializable and the - * value of the Length field by incrementing it with the length of the + * value of the length field by incrementing it with the length of the * given item. */ virtual void AddItem(const TLV* item) final; diff --git a/worker/include/RTC/SCTP/packet/UserData.hpp b/worker/include/RTC/SCTP/packet/UserData.hpp index 5153433f98..f0fac0c637 100644 --- a/worker/include/RTC/SCTP/packet/UserData.hpp +++ b/worker/include/RTC/SCTP/packet/UserData.hpp @@ -10,7 +10,7 @@ namespace RTC namespace SCTP { /** - * Represents user data extracted from a DATA or I_DATA Chunk. + * Represents user data extracted from a DATA or I-DATA Chunk. */ class UserData { @@ -63,7 +63,7 @@ namespace RTC void Dump(int indentation = 0) const; /** - * Stream Identifier (in DATA and I_DATA chunks). + * Stream Identifier (in DATA and I-DATA chunks). */ uint16_t GetStreamId() const { @@ -79,7 +79,7 @@ namespace RTC } /** - * Message Identifier (MID) (only in I_DATA chunks). + * Message Identifier (MID) (only in I-DATA chunks). */ uint32_t GetMessageId() const { @@ -87,7 +87,7 @@ namespace RTC } /** - * Fragment Sequence Number (FSN) (only in I_DATA chunks). + * Fragment Sequence Number (FSN) (only in I-DATA chunks). */ uint32_t GetFragmentSequenceNumber() const { diff --git a/worker/include/RTC/SCTP/packet/chunks/AbortAssociationChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/AbortAssociationChunk.hpp index 2c751d2da0..1ec576256d 100644 --- a/worker/include/RTC/SCTP/packet/chunks/AbortAssociationChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/AbortAssociationChunk.hpp @@ -23,14 +23,14 @@ namespace RTC * \ \ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 6. + * - Chunk type (8 bits): 6. * - T bit (1 bit): The T bit is set to 0 if the sender filled in the * Verification Tag expected by the peer. If the Verification Tag is * reflected, the T bit MUST be set to 1. Reflecting means that the sent * Verification Tag is the same as the received one. * - Length (16 bits). * - * Optional Variable-Length Error Causes (anyone). + * Optional variable-length error causes (anyone). */ // Forward declaration. @@ -38,7 +38,7 @@ namespace RTC class AbortAssociationChunk : public Chunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -46,7 +46,7 @@ namespace RTC * Parse a AbortAssociationChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static AbortAssociationChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -54,7 +54,7 @@ namespace RTC * Create a AbortAssociationChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static AbortAssociationChunk* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/chunks/AnyDataChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/AnyDataChunk.hpp index 52171768e3..0550bc9aba 100644 --- a/worker/include/RTC/SCTP/packet/chunks/AnyDataChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/AnyDataChunk.hpp @@ -22,32 +22,32 @@ namespace RTC public: /** - * The (I)mmediate bit (in DATA and I_DATA chunks). + * The (I)mmediate bit (in DATA and I-DATA chunks). */ virtual bool GetI() const = 0; /** - * The (U)nordered bit (in DATA and I_DATA chunks). + * The (U)nordered bit (in DATA and I-DATA chunks). */ virtual bool GetU() const = 0; /** - * The (B)eginning fragment bit (in DATA and I_DATA chunks). + * The (B)eginning fragment bit (in DATA and I-DATA chunks). */ virtual bool GetB() const = 0; /** - * The (E)nding fragment bit (in DATA and I_DATA chunks). + * The (E)nding fragment bit (in DATA and I-DATA chunks). */ virtual bool GetE() const = 0; /** - * TSN (in DATA and I_DATA chunks). + * TSN (in DATA and I-DATA chunks). */ virtual uint32_t GetTsn() const = 0; /** - * Stream Identifier (in DATA and I_DATA chunks). + * Stream Identifier (in DATA and I-DATA chunks). */ virtual uint16_t GetStreamId() const = 0; @@ -57,17 +57,17 @@ namespace RTC virtual uint16_t GetStreamSequenceNumber() const = 0; /** - * Message Identifier (MID) (only in I_DATA chunks). + * Message Identifier (MID) (only in I-DATA chunks). */ virtual uint32_t GetMessageId() const = 0; /** - * Fragment Sequence Number (FSN) (only in I_DATA chunks). + * Fragment Sequence Number (FSN) (only in I-DATA chunks). */ virtual uint32_t GetFragmentSequenceNumber() const = 0; /** - * Payload Protocol Identifier (PPID) (in DATA and I_DATA chunks). + * Payload Protocol Identifier (PPID) (in DATA and I-DATA chunks). */ virtual uint32_t GetPayloadProtocolId() const = 0; diff --git a/worker/include/RTC/SCTP/packet/chunks/AnyForwardTsnChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/AnyForwardTsnChunk.hpp index 58b88768ba..27d270e2ca 100644 --- a/worker/include/RTC/SCTP/packet/chunks/AnyForwardTsnChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/AnyForwardTsnChunk.hpp @@ -32,17 +32,17 @@ namespace RTC uint16_t streamId; /** - * Only set for FORWARD_TSN. + * Only set for FORWARD-TSN. */ uint16_t ssn; /** - * Only set for I_FORWARD_TSN. + * Only set for I-FORWARD-TSN. */ uint32_t mid; /** - * Only set for I_FORWARD_TSN. + * Only set for I-FORWARD-TSN. */ bool unordered; diff --git a/worker/include/RTC/SCTP/packet/chunks/CookieAckChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/CookieAckChunk.hpp index 20678ddfc5..781e0921fa 100644 --- a/worker/include/RTC/SCTP/packet/chunks/CookieAckChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/CookieAckChunk.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Cookie Acknowledgement Chunk (COOKIE_ACK) (11). + * SCTP Cookie Acknowledgement Chunk (COOKIE-ACK) (11). * * @see RFC 9260. * @@ -19,7 +19,7 @@ namespace RTC * | Type = 11 | Chunk Flags | Length = 4 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 11. + * - Chunk type (8 bits): 11. * - Flags (8 bits): All set to 0. * - Length (16 bits): 4. */ @@ -29,7 +29,7 @@ namespace RTC class CookieAckChunk : public Chunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -37,7 +37,7 @@ namespace RTC * Parse a CookieAckChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static CookieAckChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -45,7 +45,7 @@ namespace RTC * Create a CookieAckChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static CookieAckChunk* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/chunks/CookieEchoChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/CookieEchoChunk.hpp index 4050ab5ac1..3a3e5299c8 100644 --- a/worker/include/RTC/SCTP/packet/chunks/CookieEchoChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/CookieEchoChunk.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Cookie Echo Chunk (COOKIE_ECHO) (10). + * SCTP Cookie Echo Chunk (COOKIE-ECHO) (10). * * @see RFC 9260. * @@ -22,7 +22,7 @@ namespace RTC * \ \ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 10. + * - Chunk type (8 bits): 10. * - Flags (8 bits): All set to 0. * - Length (16 bits). * - Cookie (variable length). @@ -33,7 +33,7 @@ namespace RTC class CookieEchoChunk : public Chunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -41,7 +41,7 @@ namespace RTC * Parse a CookieEchoChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static CookieEchoChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -49,7 +49,7 @@ namespace RTC * Create a CookieEchoChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static CookieEchoChunk* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/chunks/DataChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/DataChunk.hpp index 7415bf8608..4f260ca8da 100644 --- a/worker/include/RTC/SCTP/packet/chunks/DataChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/DataChunk.hpp @@ -32,7 +32,7 @@ namespace RTC * \ \ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 0. + * - Chunk type (8 bits): 0. * - Res (4 bits): All set to 0. * - I bit (1 bit): The (I)mmediate bit MAY be set by the sender whenever * the sender of a DATA chunk can benefit from the corresponding SACK @@ -47,8 +47,8 @@ namespace RTC * - Length (16 bits): This field indicates the length of the DATA chunk in * bytes from the beginning of the type field to the end of the User Data * field excluding any padding. A DATA chunk with one byte of user data - * will have the Length field set to 17 (indicating 17 bytes). A DATA - * chunk with a User Data field of length L will have the Length field + * will have the length field set to 17 (indicating 17 bytes). A DATA + * chunk with a User Data field of length L will have the length field * set to (16 + L) (indicating 16 + L bytes) where L MUST be greater than * 0. * - TSN (32 bits): This value represents the TSN for this DATA chunk. The @@ -56,7 +56,7 @@ namespace RTC * to 0 after reaching 4294967295. * - Stream Identifier S (16 bits): Identifies the stream to which the * following user data belongs. - * - Stream Sequence Number n (16 bits): This value represents the Stream + * - Stream Sequence Number n (16 bits): This value represents the stream * Sequence Number of the following user data within the stream S. Valid * range is 0 to 65535. When a user message is fragmented by SCTP for * transport, the same Stream Sequence Number MUST be carried in each of @@ -65,7 +65,7 @@ namespace RTC * application (or upper layer) specified protocol identifier. * - User Data (variable length): This is the payload user data. The * implementation MUST pad the end of the data to a 4-byte boundary with - * all zero bytes. Any padding MUST NOT be included in the Length field. + * all zero bytes. Any padding MUST NOT be included in the length field. */ // Forward declaration. @@ -73,7 +73,7 @@ namespace RTC class DataChunk : public AnyDataChunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -84,7 +84,7 @@ namespace RTC * Parse a DataChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static DataChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -92,7 +92,7 @@ namespace RTC * Create a DataChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static DataChunk* Factory(uint8_t* buffer, size_t bufferLength); @@ -179,7 +179,7 @@ namespace RTC void SetStreamSequenceNumber(uint16_t value); /** - * @remarks Only in I_DATA chunks. + * @remarks Only in I-DATA chunks. */ uint32_t GetMessageId() const final { @@ -192,7 +192,7 @@ namespace RTC } /** - * @remarks Only in I_DATA chunks. + * @remarks Only in I-DATA chunks. */ uint32_t GetFragmentSequenceNumber() const final { @@ -243,7 +243,7 @@ namespace RTC DataChunk* SoftClone(const uint8_t* buffer) const final; /** - * We need to override this method since this Chunk has a variable-length + * We need to override this method since this chunk has a variable-length * value and the fixed header doesn't have default length. */ size_t GetHeaderLength() const final diff --git a/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp index e021c2b4ec..d554c7c40f 100644 --- a/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp @@ -10,7 +10,7 @@ namespace RTC namespace SCTP { /** - * SCTP Forward Cumulative TSN Chunk (FORWARD_TSN) (192) + * SCTP Forward Cumulative TSN Chunk (FORWARD-TSN) (192) * * @see RFC 3758. * @@ -29,7 +29,7 @@ namespace RTC * | Stream-N | Stream Sequence-N | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 192. + * - Chunk type (8 bits): 192. * - Flags: All set to 0. * - Length (16 bits). * - New Cumulative TSN (32 bits): This indicates the new cumulative TSN to @@ -44,7 +44,7 @@ namespace RTC class ForwardTsnChunk : public AnyForwardTsnChunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -55,7 +55,7 @@ namespace RTC * Parse a ForwardTsnChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static ForwardTsnChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -63,7 +63,7 @@ namespace RTC * Create a ForwardTsnChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static ForwardTsnChunk* Factory(uint8_t* buffer, size_t bufferLength); @@ -120,7 +120,7 @@ namespace RTC ForwardTsnChunk* SoftClone(const uint8_t* buffer) const final; /** - * We need to override this method since this Chunk has a variable-length + * We need to override this method since this chunk has a variable-length * value and the fixed header doesn't have default length. */ size_t GetHeaderLength() const final diff --git a/worker/include/RTC/SCTP/packet/chunks/HeartbeatAckChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/HeartbeatAckChunk.hpp index 9658f4df1c..441995dde2 100644 --- a/worker/include/RTC/SCTP/packet/chunks/HeartbeatAckChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/HeartbeatAckChunk.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Heartbeat Acknowledgement Chunk (HEARTBEAT_ACK) (5) + * SCTP Heartbeat Acknowledgement Chunk (HEARTBEAT-ACK) (5) * * @see RFC 9260. * @@ -23,12 +23,12 @@ namespace RTC * \ \ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 5. + * - Chunk type (8 bits): 5. * - Flags (8 bits): All set to 0. * - Length (16 bits). * - Heartbeat Information (variable length). * - * Mandatory Variable-Length Parameters: + * Mandatory variable-length Parameters: * - Heartbeat Info (1), mandatory. */ @@ -37,7 +37,7 @@ namespace RTC class HeartbeatAckChunk : public Chunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -45,7 +45,7 @@ namespace RTC * Parse a HeartbeatAckChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static HeartbeatAckChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -53,7 +53,7 @@ namespace RTC * Create a HeartbeatAckChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static HeartbeatAckChunk* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.hpp index 09ebc36cee..c1c2386fee 100644 --- a/worker/include/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Heartbeat Request Chunk (HEARTBEAT_REQUEST) (4). + * SCTP Heartbeat Request Chunk (HEARTBEAT-REQUEST) (4). * * @see RFC 9260. * @@ -23,12 +23,12 @@ namespace RTC * \ \ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 4. + * - Chunk type (8 bits): 4. * - Flags (8 bits): All set to 0. * - Length (16 bits). * - Heartbeat Information (variable length). * - * Mandatory Variable-Length Parameters: + * Mandatory variable-length Parameters: * - Heartbeat Info (1), mandatory. */ @@ -37,7 +37,7 @@ namespace RTC class HeartbeatRequestChunk : public Chunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -45,7 +45,7 @@ namespace RTC * Parse a HeartbeatRequestChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static HeartbeatRequestChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -53,7 +53,7 @@ namespace RTC * Create a HeartbeatRequestChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static HeartbeatRequestChunk* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/chunks/IDataChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/IDataChunk.hpp index 30c375bc3a..72748cd931 100644 --- a/worker/include/RTC/SCTP/packet/chunks/IDataChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/IDataChunk.hpp @@ -12,7 +12,7 @@ namespace RTC namespace SCTP { /** - * SCTP I-Data Chunk (I_DATA) (64). + * SCTP I-Data Chunk (I-DATA) (64). * * @see RFC 8260. * @@ -34,7 +34,7 @@ namespace RTC * \ \ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 64. + * - Chunk type (8 bits): 64. * - Res (4 bits): All set to 0. * - I bit (1 bit): The (I)mmediate bit, if set, indicates that the * receiver SHOULD NOT delay the sending of the corresponding SACK chunk. @@ -70,7 +70,7 @@ namespace RTC class IDataChunk : public AnyDataChunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -81,7 +81,7 @@ namespace RTC * Parse a IDataChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static IDataChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -89,7 +89,7 @@ namespace RTC * Create a IDataChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static IDataChunk* Factory(uint8_t* buffer, size_t bufferLength); @@ -259,7 +259,7 @@ namespace RTC IDataChunk* SoftClone(const uint8_t* buffer) const final; /** - * We need to override this method since this Chunk has a variable-length + * We need to override this method since this chunk has a variable-length * value and the fixed header doesn't have default length. */ size_t GetHeaderLength() const final diff --git a/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp index 029c0dbf85..bfcef950a5 100644 --- a/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp @@ -10,7 +10,7 @@ namespace RTC namespace SCTP { /** - * SCTP I-Forward Cumulative TSN Chunk (I_FORWARD_TSN) (194) + * SCTP I-Forward Cumulative TSN Chunk (I-FORWARD-TSN) (194) * * @see RFC 8260. * @@ -33,7 +33,7 @@ namespace RTC * | Message Identifier | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 194. + * - Chunk type (8 bits): 194. * - Flags: All set to 0. * - Length (16 bits). * - New Cumulative TSN (32 bits): This indicates the new cumulative TSN to @@ -46,7 +46,7 @@ namespace RTC * (U bit is not set). * - Message Identifier (MID) (32 bits): This field holds the largest * Message Identifier for ordered or unordered messages indicated by the - * U bit that was skipped for the stream specified by the Stream + * U bit that was skipped for the stream specified by the stream * Identifier. For ordered messages, this is similar to the FORWARD-TSN * chunk, just replacing the 16-bit SSN by the 32-bit MID. */ @@ -56,7 +56,7 @@ namespace RTC class IForwardTsnChunk : public AnyForwardTsnChunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -67,7 +67,7 @@ namespace RTC * Parse a IForwardTsnChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static IForwardTsnChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -75,7 +75,7 @@ namespace RTC * Create a IForwardTsnChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static IForwardTsnChunk* Factory(uint8_t* buffer, size_t bufferLength); @@ -132,7 +132,7 @@ namespace RTC IForwardTsnChunk* SoftClone(const uint8_t* buffer) const final; /** - * We need to override this method since this Chunk has a variable-length + * We need to override this method since this chunk has a variable-length * value and the fixed header doesn't have default length. */ size_t GetHeaderLength() const final diff --git a/worker/include/RTC/SCTP/packet/chunks/InitAckChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/InitAckChunk.hpp index dfbc09fc46..e7cef56bbf 100644 --- a/worker/include/RTC/SCTP/packet/chunks/InitAckChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/InitAckChunk.hpp @@ -10,7 +10,7 @@ namespace RTC namespace SCTP { /** - * SCTP Initiation Acknowledgement Chunk (INIT_ACK) (2). + * SCTP Initiation Acknowledgement Chunk (INIT-ACK) (2). * * @see RFC 9260. * @@ -32,7 +32,7 @@ namespace RTC * \ \ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 2. + * - Chunk type (8 bits): 2. * - Flags (8 bits): All set to 0. * - Initiate Tag (32 bits): The receiver of the INIT ACK chunk records the * value of the Initiate Tag parameter. This value MUST be placed into @@ -51,11 +51,11 @@ namespace RTC * - Initial TSN (I-TSN) (32 bits): Defines the TSN that the sender of the * INIT ACK chunk will use initially. * - * Variable-Length Parameters: + * Variable-length Parameters: * - State Cookie (7), mandatory. * - IPv4 Address (5), optional. * - IPv6 Address (6), optional. - * - Unrecognized Parameter (8), optional. + * - Unrecognized parameter (8), optional. * - Reserved for ECN Capable (32768, 0x8000), optional. * - Host Name Address (11), deprecated: The receiver of an INIT chunk or an * INIT ACK containing a Host Name Address parameter MUST send an ABORT @@ -67,7 +67,7 @@ namespace RTC class InitAckChunk : public AnyInitChunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -78,7 +78,7 @@ namespace RTC * Parse a InitAckChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static InitAckChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -86,7 +86,7 @@ namespace RTC * Create a InitAckChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static InitAckChunk* Factory(uint8_t* buffer, size_t bufferLength); @@ -162,10 +162,10 @@ namespace RTC InitAckChunk* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Chunk doesn't + * We don't really need to override this method since this chunk doesn't * have variable-length value (despite the fixed header doesn't have - * default length). Optional/Variable-Length Parameters and/or Error - * Causes don't account here. + * default length). Optional/variable-length parameters and/or error + * causes don't account here. */ size_t GetHeaderLength() const final { diff --git a/worker/include/RTC/SCTP/packet/chunks/InitChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/InitChunk.hpp index 827d74bdd5..03cb6262b9 100644 --- a/worker/include/RTC/SCTP/packet/chunks/InitChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/InitChunk.hpp @@ -32,7 +32,7 @@ namespace RTC * \ \ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 1. + * - Chunk type (8 bits): 1. * - Flags (8 bits): All set to 0. * - Initiate Tag (32 bits): The receiver of the INIT chunk (the responding * end) records the value of the Initiate Tag parameter. This value MUST @@ -51,7 +51,7 @@ namespace RTC * - Initial TSN (I-TSN) (32 bits): Defines the TSN that the sender of the * INIT chunk will use initially. * - * Variable-Length Parameters: + * Variable-length Parameters: * - IPv4 Address (5), optional. * - IPv6 Address (6), optional. * - Cookie Preservative (9), optional. @@ -67,7 +67,7 @@ namespace RTC class InitChunk : public AnyInitChunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -78,7 +78,7 @@ namespace RTC * Parse a InitChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static InitChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -86,7 +86,7 @@ namespace RTC * Create a InitChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static InitChunk* Factory(uint8_t* buffer, size_t bufferLength); @@ -162,10 +162,10 @@ namespace RTC InitChunk* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Chunk doesn't + * We don't really need to override this method since this chunk doesn't * have variable-length value (despite the fixed header doesn't have - * default length). Optional/Variable-Length Parameters and/or Error - * Causes don't account here. + * default length). Optional/variable-length parameters and/or error + * causes don't account here. */ size_t GetHeaderLength() const final { diff --git a/worker/include/RTC/SCTP/packet/chunks/OperationErrorChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/OperationErrorChunk.hpp index 4c511c1350..b73c6eed6c 100644 --- a/worker/include/RTC/SCTP/packet/chunks/OperationErrorChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/OperationErrorChunk.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Operation Error Chunk (OPERATION_ERROR) (9). + * SCTP Operation Error Chunk (OPERATION-ERROR) (9). * * @see RFC 9260. * @@ -23,11 +23,11 @@ namespace RTC * \ \ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 9. + * - Chunk type (8 bits): 9. * - Flags (8 bits): All set to 0. * - Length (16 bits). * - * Optional Variable-Length Error Causes (anyone). + * Optional variable-length error causes (anyone). */ // Forward declaration. @@ -35,7 +35,7 @@ namespace RTC class OperationErrorChunk : public Chunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -43,7 +43,7 @@ namespace RTC * Parse a OperationErrorChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static OperationErrorChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -51,7 +51,7 @@ namespace RTC * Create a OperationErrorChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static OperationErrorChunk* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/chunks/ReConfigChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/ReConfigChunk.hpp index d25225e8e5..4c2fbe4f3d 100644 --- a/worker/include/RTC/SCTP/packet/chunks/ReConfigChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/ReConfigChunk.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Re-Config Chunk (RE_CONFIG) (130). + * SCTP Re-Config Chunk (RE-CONFIG) (130). * * @see RFC 6525. * @@ -27,17 +27,17 @@ namespace RTC * \ \ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 130. + * - Chunk type (8 bits): 130. * - Flags (8 bits): All set to 0. * - Length (16 bits). - * - Re-configuration Parameter (variable Length): This field holds a + * - Re-configuration parameter (variable length): This field holds a * Re-configuration Request Parameter or a Re-configuration Response - * Parameter. + * parameter. * - * Variable-Length Parameters: + * Variable-length Parameters: * - Re-configuration Request Parameter or a Re-configuration Response - * Parameter, mandatory. - * - Another Parameter, optional. + * parameter, mandatory. + * - Another parameter, optional. */ // Forward declaration. @@ -45,7 +45,7 @@ namespace RTC class ReConfigChunk : public Chunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -53,7 +53,7 @@ namespace RTC * Parse a ReConfigChunk. * * @remarks - * - `bufferLength` may exceed the exact length of the Chunk. + * - `bufferLength` may exceed the exact length of the chunk. */ static ReConfigChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -61,7 +61,7 @@ namespace RTC * Create a ReConfigChunk. * * @remarks - * - `bufferLength` could be greater than the Chunk real length. + * - `bufferLength` could be greater than the chunk real length. */ static ReConfigChunk* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/chunks/SackChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/SackChunk.hpp index bba7164092..3357fa09ff 100644 --- a/worker/include/RTC/SCTP/packet/chunks/SackChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/SackChunk.hpp @@ -44,7 +44,7 @@ namespace RTC * | Duplicate TSN M | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 3. + * - Chunk type (8 bits): 3. * - Res (4 bits): All set to 0. * - Length (16 bits). * - Cumulative TSN Ack (32 bits): The largest TSN, such that all TSNs @@ -75,7 +75,7 @@ namespace RTC class SackChunk : public Chunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -104,7 +104,7 @@ namespace RTC * Parse a SackChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static SackChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -112,7 +112,7 @@ namespace RTC * Create a SackChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static SackChunk* Factory(uint8_t* buffer, size_t bufferLength); @@ -182,7 +182,7 @@ namespace RTC SackChunk* SoftClone(const uint8_t* buffer) const final; /** - * We need to override this method since this Chunk has a variable-length + * We need to override this method since this chunk has a variable-length * value and the fixed header doesn't have default length. */ size_t GetHeaderLength() const final diff --git a/worker/include/RTC/SCTP/packet/chunks/ShutdownAckChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/ShutdownAckChunk.hpp index 182083b9c8..1436027346 100644 --- a/worker/include/RTC/SCTP/packet/chunks/ShutdownAckChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/ShutdownAckChunk.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Shutdown Acknowledgement Chunk (SHUTDOWN_ACK) (8). + * SCTP Shutdown Acknowledgement Chunk (SHUTDOWN-ACK) (8). * * @see RFC 9260. * @@ -19,7 +19,7 @@ namespace RTC * | Type = 8 | Chunk Flags | Length = 4 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 8. + * - Chunk type (8 bits): 8. * - Flags (8 bits): All set to 0. * - Length (16 bits): 4. */ @@ -29,7 +29,7 @@ namespace RTC class ShutdownAckChunk : public Chunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -37,7 +37,7 @@ namespace RTC * Parse a ShutdownAckChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static ShutdownAckChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -45,7 +45,7 @@ namespace RTC * Create a ShutdownAckChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static ShutdownAckChunk* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/chunks/ShutdownChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/ShutdownChunk.hpp index bfc96e3a97..fbef098ad7 100644 --- a/worker/include/RTC/SCTP/packet/chunks/ShutdownChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/ShutdownChunk.hpp @@ -22,7 +22,7 @@ namespace RTC * | Cumulative TSN Ack | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 7. + * - Chunk type (8 bits): 7. * - Flags (8 bits): All set to 0. * - Length (16 bits): 8. * - Cumulative TSN Ack (32 bits): The largest TSN, such that all TSNs @@ -35,7 +35,7 @@ namespace RTC class ShutdownChunk : public Chunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -46,7 +46,7 @@ namespace RTC * Parse a ShutdownChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static ShutdownChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -54,7 +54,7 @@ namespace RTC * Create a ShutdownChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static ShutdownChunk* Factory(uint8_t* buffer, size_t bufferLength); @@ -102,7 +102,7 @@ namespace RTC ShutdownChunk* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Chunk doesn't + * We don't really need to override this method since this chunk doesn't * have variable-length value (despite the fixed header doesn't have * default length). */ diff --git a/worker/include/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.hpp index 3701496f5f..d405028c71 100644 --- a/worker/include/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Shutdown Complete Chunk (SHUTDOWN_COMPLETE) (14). + * SCTP Shutdown Complete Chunk (SHUTDOWN-COMPLETE) (14). * * @see RFC 9260. * @@ -19,7 +19,7 @@ namespace RTC * | Type = 14 | Reserved |T| Length = 4 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * - Chunk Type (8 bits): 14 + * - Chunk type (8 bits): 14 * - T bit (1 bit): The T bit is set to 0 if the sender filled in the * Verification Tag expected by the peer. If the Verification Tag is * reflected, the T bit MUST be set to 1. Reflecting means that the sent @@ -32,7 +32,7 @@ namespace RTC class ShutdownCompleteChunk : public Chunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -40,7 +40,7 @@ namespace RTC * Parse a ShutdownCompleteChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static ShutdownCompleteChunk* Parse(const uint8_t* buffer, size_t bufferLength); @@ -48,7 +48,7 @@ namespace RTC * Create a ShutdownCompleteChunk. * * @remarks - * `bufferLength` could be greater than the Chunk real length. + * `bufferLength` could be greater than the chunk real length. */ static ShutdownCompleteChunk* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/chunks/UnknownChunk.hpp b/worker/include/RTC/SCTP/packet/chunks/UnknownChunk.hpp index 08d827296b..e918cc5b7b 100644 --- a/worker/include/RTC/SCTP/packet/chunks/UnknownChunk.hpp +++ b/worker/include/RTC/SCTP/packet/chunks/UnknownChunk.hpp @@ -27,7 +27,7 @@ namespace RTC class UnknownChunk : public Chunk { - // We need that Packet calls protected and private methods in this class. + // We need that packet calls protected and private methods in this class. friend class Packet; public: @@ -35,7 +35,7 @@ namespace RTC * Parse a UnknownChunk. * * @remarks - * `bufferLength` may exceed the exact length of the Chunk. + * `bufferLength` may exceed the exact length of the chunk. */ static UnknownChunk* Parse(const uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.hpp index 9411830ef6..e8cf00da3f 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.hpp @@ -10,7 +10,7 @@ namespace RTC { /** * SCTP Cookie Received While Shutting Down Error Cause - * (COOKIE_RECEIVED_WHILE_SHUTTING_DOWN) (10) + * (COOKIE-RECEIVED-WHILE-SHUTTING-DOWN) (10) * * @see RFC 9260. * @@ -26,7 +26,7 @@ namespace RTC class CookieReceivedWhileShuttingDownErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -34,7 +34,7 @@ namespace RTC * Parse a CookieReceivedWhileShuttingDownErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static CookieReceivedWhileShuttingDownErrorCause* Parse(const uint8_t* buffer, size_t bufferLength); @@ -42,7 +42,7 @@ namespace RTC * Create a CookieReceivedWhileShuttingDownErrorCause. * * @remarks - * `bufferLength` could be greater than the Error Cause real length. + * `bufferLength` could be greater than the error cause real length. */ static CookieReceivedWhileShuttingDownErrorCause* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.hpp index 7514559d46..cb557a46cd 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.hpp @@ -10,7 +10,7 @@ namespace RTC { /** * SCTP Invalid Mandatory Parameter Error Cause - * (INVALID_MANDATORY_PARAMETER) (7) + * (INVALID-MANDATORY-PARAMETER) (7) * * @see RFC 9260. * @@ -26,7 +26,7 @@ namespace RTC class InvalidMandatoryParameterErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -34,7 +34,7 @@ namespace RTC * Parse a InvalidMandatoryParameterErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static InvalidMandatoryParameterErrorCause* Parse(const uint8_t* buffer, size_t bufferLength); @@ -42,7 +42,7 @@ namespace RTC * Create a InvalidMandatoryParameterErrorCause. * * @remarks - * `bufferLength` could be greater than the Error Cause real length. + * `bufferLength` could be greater than the error cause real length. */ static InvalidMandatoryParameterErrorCause* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.hpp index e577a6ac97..3b9c3f9e57 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.hpp @@ -10,7 +10,7 @@ namespace RTC namespace SCTP { /** - * SCTP Invalid Stream Identifier Error Cause (INVALID_STREAM_IDENTIFIER) + * SCTP Invalid Stream Identifier Error Cause (INVALID-STREAM-IDENTIFIER) * (1) * * @see RFC 9260. @@ -29,7 +29,7 @@ namespace RTC class InvalidStreamIdentifierErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -40,7 +40,7 @@ namespace RTC * Parse a InvalidStreamIdentifierErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static InvalidStreamIdentifierErrorCause* Parse(const uint8_t* buffer, size_t bufferLength); @@ -48,7 +48,7 @@ namespace RTC * Create a InvalidStreamIdentifierErrorCause. * * @remarks - * `bufferLength` could be greater than the Error Cause real length. + * `bufferLength` could be greater than the error cause real length. */ static InvalidStreamIdentifierErrorCause* Factory(uint8_t* buffer, size_t bufferLength); @@ -86,7 +86,7 @@ namespace RTC InvalidStreamIdentifierErrorCause* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Error Cause + * We don't really need to override this method since this error cause * doesn't have variable-length value (despite the fixed header doesn't * have default length). */ diff --git a/worker/include/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.hpp index 61c207a9a3..615f2eb64b 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.hpp @@ -12,7 +12,7 @@ namespace RTC { /** * SCTP Missing Mandatory Parameter Error Cause - * (MISSING_MANDATORY_PARAMETER) (2) + * (MISSING-MANDATORY-PARAMETER) (2) * * @see RFC 9260. * @@ -34,7 +34,7 @@ namespace RTC class MissingMandatoryParameterErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -45,7 +45,7 @@ namespace RTC * Parse a MissingMandatoryParameterErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static MissingMandatoryParameterErrorCause* Parse(const uint8_t* buffer, size_t bufferLength); @@ -53,7 +53,7 @@ namespace RTC * Create a MissingMandatoryParameterErrorCause. * * @remarks - * `bufferLength` could be greater than the Error Cause real length. + * `bufferLength` could be greater than the error cause real length. */ static MissingMandatoryParameterErrorCause* Factory(uint8_t* buffer, size_t bufferLength); @@ -97,7 +97,7 @@ namespace RTC MissingMandatoryParameterErrorCause* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Error Cause + * We don't really need to override this method since this error cause * doesn't have variable-length value (despite the fixed header doesn't * have default length). */ diff --git a/worker/include/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.hpp index 53388efba7..2b3a47cf2b 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.hpp @@ -10,7 +10,7 @@ namespace RTC namespace SCTP { /** - * SCTP No User Data Error Cause (NO_USER_DATA) (9) + * SCTP No User Data Error Cause (NO-USER-DATA) (9) * * @see RFC 9260. * @@ -28,7 +28,7 @@ namespace RTC class NoUserDataErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -39,7 +39,7 @@ namespace RTC * Parse a NoUserDataErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static NoUserDataErrorCause* Parse(const uint8_t* buffer, size_t bufferLength); @@ -47,7 +47,7 @@ namespace RTC * Create a NoUserDataErrorCause. * * @remarks - * `bufferLength` could be greater than the Error Cause real length. + * `bufferLength` could be greater than the error cause real length. */ static NoUserDataErrorCause* Factory(uint8_t* buffer, size_t bufferLength); @@ -85,7 +85,7 @@ namespace RTC NoUserDataErrorCause* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Error Cause + * We don't really need to override this method since this error cause * doesn't have variable-length value (despite the fixed header doesn't * have default length). */ diff --git a/worker/include/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.hpp index 6918efb304..ff94765892 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Out of Resource Error Cause (OUT_OF_RESOURCE) (4) + * SCTP Out of Resource Error Cause (OUT-OF-RESOURCE) (4) * * @see RFC 9260. * @@ -25,7 +25,7 @@ namespace RTC class OutOfResourceErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -33,7 +33,7 @@ namespace RTC * Parse a OutOfResourceErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static OutOfResourceErrorCause* Parse(const uint8_t* buffer, size_t bufferLength); @@ -41,7 +41,7 @@ namespace RTC * Create a OutOfResourceErrorCause. * * @remarks - * `bufferLength` could be greater than the Error Cause real length. + * `bufferLength` could be greater than the error cause real length. */ static OutOfResourceErrorCause* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.hpp index f1767dbcb8..6086b9a49b 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Protocol Violation Error Cause (PROTOCOL_VIOLATION) (13) + * SCTP Protocol Violation Error Cause (PROTOCOL-VIOLATION) (13) * * @see RFC 9260. * @@ -28,7 +28,7 @@ namespace RTC class ProtocolViolationErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -36,7 +36,7 @@ namespace RTC * Parse a ProtocolViolationErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static ProtocolViolationErrorCause* Parse(const uint8_t* buffer, size_t bufferLength); @@ -44,7 +44,7 @@ namespace RTC * Create a ProtocolViolationErrorCause. * * @remarks - * `bufferLength` could be greater than the Error Cause real length. + * `bufferLength` could be greater than the error cause real length. */ static ProtocolViolationErrorCause* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.hpp index 7b5c04d17d..5f1cb5219b 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.hpp @@ -10,7 +10,7 @@ namespace RTC { /** * SCTP Restart of an Association with New Addresses Error Cause - * (RESTART_OF_AN_ASSOCIATION_WITH_NEW_ADDRESSES) (11) + * (RESTART-OF-AN-ASSOCIATION-WITH-NEW-ADDRESSES) (11) * * @see RFC 9260. * @@ -29,7 +29,7 @@ namespace RTC class RestartOfAnAssociationWithNewAddressesErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -37,7 +37,7 @@ namespace RTC * Parse a RestartOfAnAssociationWithNewAddressesErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static RestartOfAnAssociationWithNewAddressesErrorCause* Parse( const uint8_t* buffer, size_t bufferLength); @@ -46,7 +46,7 @@ namespace RTC * Create a RestartOfAnAssociationWithNewAddressesErrorCause. * * @remarks - * `bufferLength` could be greater than the Error Cause real length. + * `bufferLength` could be greater than the error cause real length. */ static RestartOfAnAssociationWithNewAddressesErrorCause* Factory( uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.hpp index c37ae3b55d..51f9812505 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.hpp @@ -10,7 +10,7 @@ namespace RTC namespace SCTP { /** - * SCTP Stale Cookie Error Cause (STALE_COOKIE) (3) + * SCTP Stale Cookie Error Cause (STALE-COOKIE) (3) * * @see RFC 9260. * @@ -28,7 +28,7 @@ namespace RTC class StaleCookieErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -39,7 +39,7 @@ namespace RTC * Parse a StaleCookieErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static StaleCookieErrorCause* Parse(const uint8_t* buffer, size_t bufferLength); @@ -47,7 +47,7 @@ namespace RTC * Create a StaleCookieErrorCause. * * @remarks - * `bufferLength` could be greater than the Error Cause real length. + * `bufferLength` could be greater than the error cause real length. */ static StaleCookieErrorCause* Factory(uint8_t* buffer, size_t bufferLength); @@ -85,7 +85,7 @@ namespace RTC StaleCookieErrorCause* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Error Cause + * We don't really need to override this method since this error cause * doesn't have variable-length value (despite the fixed header doesn't * have default length). */ diff --git a/worker/include/RTC/SCTP/packet/errorCauses/UnknownErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/UnknownErrorCause.hpp index 9d8acd28cc..b076476384 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/UnknownErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/UnknownErrorCause.hpp @@ -26,7 +26,7 @@ namespace RTC class UnknownErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -34,7 +34,7 @@ namespace RTC * Parse a UnknownErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static UnknownErrorCause* Parse(const uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.hpp index 41c45583af..4adafb8d76 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Unrecognized Chunk Type Error Cause (UNRECOGNIZED_CHUNK_TYPE) (6) + * SCTP Unrecognized Chunk Type Error Cause (UNRECOGNIZED-CHUNK-TYPE) (6) * * @see RFC 9260. * @@ -28,7 +28,7 @@ namespace RTC class UnrecognizedChunkTypeErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -36,7 +36,7 @@ namespace RTC * Parse a UnrecognizedChunkTypeErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static UnrecognizedChunkTypeErrorCause* Parse(const uint8_t* buffer, size_t bufferLength); @@ -44,7 +44,7 @@ namespace RTC * Create a UnrecognizedChunkTypeErrorCause. * * @remarks - * `bufferLength` could be greater than the Error Cause real length. + * `bufferLength` could be greater than the error cause real length. */ static UnrecognizedChunkTypeErrorCause* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.hpp index 1d47af99ce..65f0a8100f 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Unrecognized Parameters Error Cause (UNRECOGNIZED_PARAMETERS) (8) + * SCTP Unrecognized Parameters Error Cause (UNRECOGNIZED-PARAMETERS) (8) * * @see RFC 9260. * @@ -28,7 +28,7 @@ namespace RTC class UnrecognizedParametersErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -36,7 +36,7 @@ namespace RTC * Parse a UnrecognizedParametersErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static UnrecognizedParametersErrorCause* Parse(const uint8_t* buffer, size_t bufferLength); @@ -44,7 +44,7 @@ namespace RTC * Create a UnrecognizedParametersErrorCause. * * @remarks - * `bufferLength` could be greater than the Error Cause real length. + * `bufferLength` could be greater than the error cause real length. */ static UnrecognizedParametersErrorCause* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.hpp index 7c1b478369..834480fdd2 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Unresolvable Address Error Cause (UNRESOLVABLE_ADDRESS) (5) + * SCTP Unresolvable Address Error Cause (UNRESOLVABLE-ADDRESS) (5) * * @see RFC 9260. * @@ -28,7 +28,7 @@ namespace RTC class UnresolvableAddressErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -36,7 +36,7 @@ namespace RTC * Parse a UnresolvableAddressErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static UnresolvableAddressErrorCause* Parse(const uint8_t* buffer, size_t bufferLength); @@ -44,7 +44,7 @@ namespace RTC * Create a UnresolvableAddressErrorCause. * * @remarks - * `bufferLength` could be greater than the Error Cause real length. + * `bufferLength` could be greater than the error cause real length. */ static UnresolvableAddressErrorCause* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.hpp b/worker/include/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.hpp index 2d18e4f488..99f7d6c7ac 100644 --- a/worker/include/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.hpp +++ b/worker/include/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.hpp @@ -10,7 +10,7 @@ namespace RTC namespace SCTP { /** - * SCTP User-Initiated Abort Error Cause (USER_INITIATED_ABORT) (12) + * SCTP User-Initiated Abort Error Cause (USER-INITIATED-ABORT) (12) * * @see RFC 9260. * @@ -29,7 +29,7 @@ namespace RTC class UserInitiatedAbortErrorCause : public ErrorCause { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -37,7 +37,7 @@ namespace RTC * Parse a UserInitiatedAbortErrorCause. * * @remarks - * `bufferLength` may exceed the exact length of the Error Cause. + * `bufferLength` may exceed the exact length of the error cause. */ static UserInitiatedAbortErrorCause* Parse(const uint8_t* buffer, size_t bufferLength); @@ -45,7 +45,7 @@ namespace RTC * Create a UserInitiatedAbortErrorCause. * * @remarks - * `bufferLength` could be greater than the Error Cause real length. + * `bufferLength` could be greater than the error cause real length. */ static UserInitiatedAbortErrorCause* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.hpp index 52cff8f4c7..b82b23cba3 100644 --- a/worker/include/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.hpp @@ -11,7 +11,7 @@ namespace RTC { /** * SCTP Add Incoming Streams Request Parameter - * (ADD_INCOMING_STREAMS_REQUEST) (18). + * (ADD-INCOMING-STREAMS-REQUEST) (18). * * @see RFC 6525. * @@ -31,7 +31,7 @@ namespace RTC class AddIncomingStreamsRequestParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -42,7 +42,7 @@ namespace RTC * Parse a AddIncomingStreamsRequestParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static AddIncomingStreamsRequestParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -50,7 +50,7 @@ namespace RTC * Create a AddIncomingStreamsRequestParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static AddIncomingStreamsRequestParameter* Factory(uint8_t* buffer, size_t bufferLength); @@ -95,7 +95,7 @@ namespace RTC AddIncomingStreamsRequestParameter* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Parameter + * We don't really need to override this method since this parameter * doesn't have variable-length value (despite the fixed header doesn't * have default length). */ diff --git a/worker/include/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.hpp index 8d8be88548..5c52ba8ce2 100644 --- a/worker/include/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.hpp @@ -11,7 +11,7 @@ namespace RTC { /** * SCTP Add Outgoing Streams Request Parameter - * (ADD_OUTGOING_STREAMS_REQUEST) (17). + * (ADD-OUTGOING-STREAMS-REQUEST) (17). * * @see RFC 6525. * @@ -31,7 +31,7 @@ namespace RTC class AddOutgoingStreamsRequestParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -42,7 +42,7 @@ namespace RTC * Parse a AddOutgoingStreamsRequestParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static AddOutgoingStreamsRequestParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -50,7 +50,7 @@ namespace RTC * Create a AddOutgoingStreamsRequestParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static AddOutgoingStreamsRequestParameter* Factory(uint8_t* buffer, size_t bufferLength); @@ -95,7 +95,7 @@ namespace RTC AddOutgoingStreamsRequestParameter* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Parameter + * We don't really need to override this method since this parameter * doesn't have variable-length value (despite the fixed header doesn't * have default length). */ diff --git a/worker/include/RTC/SCTP/packet/parameters/CookiePreservativeParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/CookiePreservativeParameter.hpp index 429cf9c929..cd44ddc604 100644 --- a/worker/include/RTC/SCTP/packet/parameters/CookiePreservativeParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/CookiePreservativeParameter.hpp @@ -10,7 +10,7 @@ namespace RTC namespace SCTP { /** - * SCTP Cookie Preservative Parameter (COOKIE_PRESERVATIVE) (9). + * SCTP Cookie Preservative Parameter (COOKIE-PRESERVATIVE) (9). * * @see RFC 9260. * @@ -28,7 +28,7 @@ namespace RTC class CookiePreservativeParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -39,7 +39,7 @@ namespace RTC * Parse a CookiePreservativeParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static CookiePreservativeParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -47,7 +47,7 @@ namespace RTC * Create a CookiePreservativeParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static CookiePreservativeParameter* Factory(uint8_t* buffer, size_t bufferLength); @@ -85,7 +85,7 @@ namespace RTC CookiePreservativeParameter* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Parameter + * We don't really need to override this method since this parameter * doesn't have variable-length value (despite the fixed header doesn't * have default length). */ diff --git a/worker/include/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.hpp index 5c42db44d4..29ce8de7f7 100644 --- a/worker/include/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Forward-TSN-Supported Parameter (FORWARD_TSN_SUPPORTED) (49152). + * SCTP Forward-TSN-Supported Parameter (FORWARD-TSN-SUPPORTED) (49152). * * @see RFC 3758. * @@ -25,7 +25,7 @@ namespace RTC class ForwardTsnSupportedParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -33,7 +33,7 @@ namespace RTC * Parse a ForwardTsnSupportedParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static ForwardTsnSupportedParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -41,7 +41,7 @@ namespace RTC * Create a ForwardTsnSupportedParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static ForwardTsnSupportedParameter* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.hpp index 567d9f0a20..8055f80d1f 100644 --- a/worker/include/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.hpp @@ -28,7 +28,7 @@ namespace RTC class HeartbeatInfoParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -36,7 +36,7 @@ namespace RTC * Parse a HeartbeatInfoParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static HeartbeatInfoParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -44,7 +44,7 @@ namespace RTC * Create a HeartbeatInfoParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static HeartbeatInfoParameter* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/parameters/IPv4AddressParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/IPv4AddressParameter.hpp index b3315eec18..04cfd62618 100644 --- a/worker/include/RTC/SCTP/packet/parameters/IPv4AddressParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/IPv4AddressParameter.hpp @@ -27,7 +27,7 @@ namespace RTC class IPv4AddressParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -38,7 +38,7 @@ namespace RTC * Parse a IPv4AddressParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static IPv4AddressParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -46,7 +46,7 @@ namespace RTC * Create a IPv4AddressParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static IPv4AddressParameter* Factory(uint8_t* buffer, size_t bufferLength); @@ -92,7 +92,7 @@ namespace RTC IPv4AddressParameter* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Parameter + * We don't really need to override this method since this parameter * doesn't have variable-length value (despite the fixed header doesn't * have default length). */ diff --git a/worker/include/RTC/SCTP/packet/parameters/IPv6AddressParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/IPv6AddressParameter.hpp index 55e3d99630..e22e73e601 100644 --- a/worker/include/RTC/SCTP/packet/parameters/IPv6AddressParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/IPv6AddressParameter.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP IPv6 Adress Parameter (IPV6_ADDRESS) (6). + * SCTP IPv6 Adress Parameter (IPV6-ADDRESS) (6). * * @see RFC 9260. * @@ -30,7 +30,7 @@ namespace RTC class IPv6AddressParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -41,7 +41,7 @@ namespace RTC * Parse a IPv6AddressParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static IPv6AddressParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -49,7 +49,7 @@ namespace RTC * Create a IPv6AddressParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static IPv6AddressParameter* Factory(uint8_t* buffer, size_t bufferLength); @@ -95,7 +95,7 @@ namespace RTC IPv6AddressParameter* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Parameter + * We don't really need to override this method since this parameter * doesn't have variable-length value (despite the fixed header doesn't * have default length). */ diff --git a/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp index b7d7b63893..0ad4972f77 100644 --- a/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp @@ -11,7 +11,7 @@ namespace RTC namespace SCTP { /** - * SCTP Incoming SSN Reset Request Parameter (INCOMING_SSN_RESET_REQUEST) + * SCTP Incoming SSN Reset Request Parameter (INCOMING-SSN-RESET-REQUEST) * (14). * * @see RFC 6525. @@ -36,7 +36,7 @@ namespace RTC class IncomingSsnResetRequestParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -47,7 +47,7 @@ namespace RTC * Parse a IncomingSsnResetRequestParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static IncomingSsnResetRequestParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -55,7 +55,7 @@ namespace RTC * Create a IncomingSsnResetRequestParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static IncomingSsnResetRequestParameter* Factory(uint8_t* buffer, size_t bufferLength); @@ -97,7 +97,7 @@ namespace RTC IncomingSsnResetRequestParameter* SoftClone(const uint8_t* buffer) const final; /** - * We need to override this method since this Chunk has a variable-length + * We need to override this method since this chunk has a variable-length * value and the fixed header doesn't have default length. */ size_t GetHeaderLength() const final diff --git a/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp index 6539a3b419..bae7ef9af7 100644 --- a/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp @@ -11,7 +11,7 @@ namespace RTC namespace SCTP { /** - * SCTP Outgoing SSN Reset Request Parameter (OUTGOING_SSN_RESET_REQUEST) + * SCTP Outgoing SSN Reset Request Parameter (OUTGOING-SSN-RESET-REQUEST) * (13). * * @see RFC 6525. @@ -40,7 +40,7 @@ namespace RTC class OutgoingSsnResetRequestParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -51,7 +51,7 @@ namespace RTC * Parse a OutgoingSsnResetRequestParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static OutgoingSsnResetRequestParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -59,7 +59,7 @@ namespace RTC * Create a OutgoingSsnResetRequestParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static OutgoingSsnResetRequestParameter* Factory(uint8_t* buffer, size_t bufferLength); @@ -115,7 +115,7 @@ namespace RTC OutgoingSsnResetRequestParameter* SoftClone(const uint8_t* buffer) const final; /** - * We need to override this method since this Chunk has a variable-length + * We need to override this method since this chunk has a variable-length * value and the fixed header doesn't have default length. */ size_t GetHeaderLength() const final diff --git a/worker/include/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp index b60f11b2c9..bc271a8189 100644 --- a/worker/include/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp @@ -12,7 +12,7 @@ namespace RTC namespace SCTP { /** - * SCTP Re-configuration Response Parameter (RECONFIGURATION_RESPONSE) + * SCTP Re-configuration Response Parameter (RECONFIGURATION-RESPONSE) * (16). * * @see RFC 6525. @@ -37,7 +37,7 @@ namespace RTC class ReconfigurationResponseParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -62,7 +62,7 @@ namespace RTC * Parse a ReconfigurationResponseParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static ReconfigurationResponseParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -70,7 +70,7 @@ namespace RTC * Create a ReconfigurationResponseParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static ReconfigurationResponseParameter* Factory(uint8_t* buffer, size_t bufferLength); @@ -149,7 +149,7 @@ namespace RTC ReconfigurationResponseParameter* SoftClone(const uint8_t* buffer) const final; /** - * We need to override this method since this Chunk has a variable-length + * We need to override this method since this chunk has a variable-length * value and the fixed header doesn't have default length. */ size_t GetHeaderLength() const final diff --git a/worker/include/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.hpp index 9e74af680d..a21ab71b58 100644 --- a/worker/include/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.hpp @@ -10,7 +10,7 @@ namespace RTC namespace SCTP { /** - * SCTP Zero Checksum Acceptable Parameter (SSN_TSN_RESET_REQUEST) + * SCTP Zero Checksum Acceptable Parameter (SSN-TSN-RESET-REQUEST) * (15). * * @see RFC 6525. @@ -29,7 +29,7 @@ namespace RTC class SsnTsnResetRequestParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -40,7 +40,7 @@ namespace RTC * Parse a SsnTsnResetRequestParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static SsnTsnResetRequestParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -48,7 +48,7 @@ namespace RTC * Create a SsnTsnResetRequestParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static SsnTsnResetRequestParameter* Factory(uint8_t* buffer, size_t bufferLength); @@ -86,7 +86,7 @@ namespace RTC SsnTsnResetRequestParameter* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Parameter + * We don't really need to override this method since this parameter * doesn't have variable-length value (despite the fixed header doesn't * have default length). */ diff --git a/worker/include/RTC/SCTP/packet/parameters/StateCookieParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/StateCookieParameter.hpp index 63c90a77e3..77531f728c 100644 --- a/worker/include/RTC/SCTP/packet/parameters/StateCookieParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/StateCookieParameter.hpp @@ -10,7 +10,7 @@ namespace RTC namespace SCTP { /** - * SCTP State Cookie Parameter (STATE_COOKIE) (7). + * SCTP State Cookie Parameter (STATE-COOKIE) (7). * * @see RFC 9260. * @@ -29,7 +29,7 @@ namespace RTC class StateCookieParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -37,7 +37,7 @@ namespace RTC * Parse a StateCookieParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static StateCookieParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -45,7 +45,7 @@ namespace RTC * Create a StateCookieParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static StateCookieParameter* Factory(uint8_t* buffer, size_t bufferLength); @@ -90,7 +90,7 @@ namespace RTC void SetCookie(const uint8_t* cookie, uint16_t cookieLength); /** - * Write a locally generated StateCookie in place within the Cookie + * Write a locally generated StateCookie in place within the cookie * field. * * This method is more performant than SetCookie() since it doesn't diff --git a/worker/include/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.hpp index 8a59e2f9aa..0c294b9015 100644 --- a/worker/include/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.hpp @@ -10,7 +10,7 @@ namespace RTC namespace SCTP { /** - * SCTP Supported Address Types Parameter (SUPPORTED_ADDRESS_TYPES) (12). + * SCTP Supported Address Types Parameter (SUPPORTED-ADDRESS-TYPES) (12). * * @see RFC 9260. * @@ -30,7 +30,7 @@ namespace RTC class SupportedAddressTypesParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -38,7 +38,7 @@ namespace RTC * Parse a SupportedAddressTypesParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static SupportedAddressTypesParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -46,7 +46,7 @@ namespace RTC * Create a SupportedAddressTypesParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static SupportedAddressTypesParameter* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.hpp index c2335f8464..d51b00b9a0 100644 --- a/worker/include/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.hpp @@ -11,7 +11,7 @@ namespace RTC namespace SCTP { /** - * SCTP Supported Extensions Parameter (SUPPORTED_EXTENSIONS) (32776). + * SCTP Supported Extensions Parameter (SUPPORTED-EXTENSIONS) (32776). * * @see RFC 5061. * @@ -33,7 +33,7 @@ namespace RTC class SupportedExtensionsParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -41,7 +41,7 @@ namespace RTC * Parse a SupportedExtensionsParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static SupportedExtensionsParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -49,7 +49,7 @@ namespace RTC * Create a SupportedExtensionsParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static SupportedExtensionsParameter* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/parameters/UnknownParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/UnknownParameter.hpp index 2587eff6c8..e1a2e3819d 100644 --- a/worker/include/RTC/SCTP/packet/parameters/UnknownParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/UnknownParameter.hpp @@ -27,7 +27,7 @@ namespace RTC class UnknownParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -35,7 +35,7 @@ namespace RTC * Parse a UnknownParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static UnknownParameter* Parse(const uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.hpp index e5e295235e..89c45694b8 100644 --- a/worker/include/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.hpp @@ -9,7 +9,7 @@ namespace RTC namespace SCTP { /** - * SCTP Unrecognized Parameter Parameter (UNRECOGNIZED_PARAMETER) (7). + * SCTP Unrecognized Parameter Parameter (UNRECOGNIZED-PARAMETER) (7). * * @see RFC 9260. * @@ -28,7 +28,7 @@ namespace RTC class UnrecognizedParameterParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -36,7 +36,7 @@ namespace RTC * Parse a UnrecognizedParameterParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static UnrecognizedParameterParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -44,7 +44,7 @@ namespace RTC * Create a UnrecognizedParameterParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static UnrecognizedParameterParameter* Factory(uint8_t* buffer, size_t bufferLength); diff --git a/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp b/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp index 24062f6e06..5b779cc150 100644 --- a/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp +++ b/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp @@ -12,7 +12,7 @@ namespace RTC namespace SCTP { /** - * SCTP Zero Checksum Acceptable Parameter (ZERO_CHECKSUM_ACCEPTABLE) + * SCTP Zero Checksum Acceptable Parameter (ZERO-CHECKSUM-ACCEPTABLE) * (32769). * * @see RFC 9653. @@ -31,7 +31,7 @@ namespace RTC class ZeroChecksumAcceptableParameter : public Parameter { - // We need that Chunk calls protected and private methods in this class. + // We need that chunk calls protected and private methods in this class. friend class Chunk; public: @@ -53,7 +53,7 @@ namespace RTC * Parse a ZeroChecksumAcceptableParameter. * * @remarks - * `bufferLength` may exceed the exact length of the Parameter. + * `bufferLength` may exceed the exact length of the parameter. */ static ZeroChecksumAcceptableParameter* Parse(const uint8_t* buffer, size_t bufferLength); @@ -61,7 +61,7 @@ namespace RTC * Create a ZeroChecksumAcceptableParameter. * * @remarks - * `bufferLength` could be greater than the Parameter real length. + * `bufferLength` could be greater than the parameter real length. */ static ZeroChecksumAcceptableParameter* Factory(uint8_t* buffer, size_t bufferLength); @@ -116,7 +116,7 @@ namespace RTC ZeroChecksumAcceptableParameter* SoftClone(const uint8_t* buffer) const final; /** - * We don't really need to override this method since this Parameter + * We don't really need to override this method since this parameter * doesn't have variable-length value (despite the fixed header doesn't * have default length). */ diff --git a/worker/include/RTC/SCTP/public/AssociationInterface.hpp b/worker/include/RTC/SCTP/public/AssociationInterface.hpp index e84b3a8cdc..983ce2e4f4 100644 --- a/worker/include/RTC/SCTP/public/AssociationInterface.hpp +++ b/worker/include/RTC/SCTP/public/AssociationInterface.hpp @@ -18,7 +18,7 @@ namespace RTC * The SCTP Association class represents the mediasoup side of an SCTP * association with a remote peer. * - * It manages all Packet and Chunk dispatching and the connection flow. + * It manages all packet and chunk dispatching and the connection flow. */ class AssociationInterface { @@ -40,7 +40,7 @@ namespace RTC /** * Initiate the SCTP association with the remote peer. It sends an INIT - * Chunk. + * chunk. * * @remarks * - The SCTP association must be in New state. @@ -48,7 +48,7 @@ namespace RTC virtual void Connect() = 0; /** - * Gracefully shutdowns the Association and sends all outstanding data. + * Gracefully shutdowns the association and sends all outstanding data. * This is an asynchronous operation and `OnAssociationClosed()` will be * called on success. * @@ -61,7 +61,7 @@ namespace RTC virtual void Shutdown() = 0; /** - * Closes the Association non-gracefully. Will send ABORT if the connection + * Closes the association non-gracefully. Will send ABORT if the connection * is not already closed. No callbacks will be made after Close() has * returned. However, before Close() returns, it may have called * `OnAssociationClosed()` or `OnAssociationAborted()` callbacks. @@ -69,7 +69,7 @@ namespace RTC virtual void Close() = 0; /** - * Retrieves the latest metrics. If the Association is not fully connected, + * Retrieves the latest metrics. If the association is not fully connected, * `std::nullopt` will be returned. */ virtual std::optional MakeMetrics() const = 0; @@ -165,7 +165,7 @@ namespace RTC * message will be queued. * * This has identical semantics to `SendMessage()', except that it may - * coalesce many messages into a single SCTP Packet if they would fit. + * coalesce many messages into a single SCTP packet if they would fit. * * @remarks * - Same as in `SendMessage()`. @@ -174,7 +174,7 @@ namespace RTC std::span messages, const SendMessageOptions& sendMessageOptions) = 0; /** - * Receives SCTP data (hopefully an SCTP Packet) from the remote peer. + * Receives SCTP data (hopefully an SCTP packet) from the remote peer. */ virtual void ReceiveSctpData(const uint8_t* data, size_t len) = 0; diff --git a/worker/include/RTC/SCTP/public/AssociationListenerInterface.hpp b/worker/include/RTC/SCTP/public/AssociationListenerInterface.hpp index 89a0ecc048..a5c3206d2d 100644 --- a/worker/include/RTC/SCTP/public/AssociationListenerInterface.hpp +++ b/worker/include/RTC/SCTP/public/AssociationListenerInterface.hpp @@ -18,16 +18,16 @@ namespace RTC public: /** - * Called when an SCTP Packet must be sent to the remote endpoint. + * Called when an SCTP packet must be sent to the remote endpoint. * * @return * - `true` if the packet was successfully sent. However, since - * sending is unreliable, there are no guarantees that the Packet was + * sending is unreliable, there are no guarantees that the packet was * actually delivered. - * - `false` if the Packet failed to be sent. + * - `false` if the packet failed to be sent. * * @remarks - * - It is NOT allowed to call methods in Association within this callback. + * - It is NOT allowed to call methods in association within this callback. */ virtual bool OnAssociationSendData(const uint8_t* data, size_t len) = 0; @@ -35,7 +35,7 @@ namespace RTC * Called when calling Connect(). * * @remarks - * - It is allowed to call methods in Association within this callback. + * - It is allowed to call methods in association within this callback. */ virtual void OnAssociationConnecting() = 0; @@ -44,7 +44,7 @@ namespace RTC * connection attempts. * * @remarks - * - It is allowed to call methods in Association within this callback. + * - It is allowed to call methods in association within this callback. */ virtual void OnAssociationConnected() = 0; @@ -53,19 +53,19 @@ namespace RTC * in case the association fails. * * @remarks - * - It is allowed to call methods in Association within this callback. + * - It is allowed to call methods in association within this callback. */ virtual void OnAssociationFailed(Types::ErrorKind errorKind, std::string_view errorMessage) = 0; /** - * Called when the Association is closed in a controlled way or when the - * Association has aborted - either as decided by this Association due to + * Called when the association is closed in a controlled way or when the + * association has aborted - either as decided by this association due to * e.g. too many retransmission attempts or by the peer when receiving an * ABORT command. No other callbacks will be done after this callback, * unless reconnecting. * * @remarks - * - It is allowed to call methods in Association within this callback. + * - It is allowed to call methods in association within this callback. */ virtual void OnAssociationClosed(Types::ErrorKind errorKind, std::string_view errorMessage) = 0; @@ -75,7 +75,7 @@ namespace RTC * could have been packet loss as a result of restarting the association. * * @remarks - * - It is allowed to call methods in Association within this callback. + * - It is allowed to call methods in association within this callback. */ virtual void OnAssociationRestarted() = 0; @@ -86,7 +86,7 @@ namespace RTC * viable. * * @remarks - * - It is allowed to call methods in Association within this callback. + * - It is allowed to call methods in association within this callback. */ virtual void OnAssociationError(Types::ErrorKind errorKind, std::string_view errorMessage) = 0; @@ -94,7 +94,7 @@ namespace RTC * Called when an SCTP message in full has been received. * * @remarks - * - It is allowed to call methods in Association within this callback. + * - It is allowed to call methods in association within this callback. */ virtual void OnAssociationMessageReceived(Message message) = 0; @@ -102,7 +102,7 @@ namespace RTC * Indicates that a stream reset request has been performed. * * @remarks - * - It is allowed to call methods in Association within this callback. + * - It is allowed to call methods in association within this callback. */ virtual void OnAssociationStreamsResetPerformed(std::span outboundStreamIds) = 0; @@ -110,7 +110,7 @@ namespace RTC * Indicates that a stream reset request has failed. * * @remarks - * - It is allowed to call methods in Association within this callback. + * - It is allowed to call methods in association within this callback. */ virtual void OnAssociationStreamsResetFailed( std::span outboundStreamIds, std::string_view errorMessage) = 0; @@ -120,7 +120,7 @@ namespace RTC * called. An empty list indicates that all streams have been reset. * * @remarks - * - It is allowed to call methods in Association within this callback. + * - It is allowed to call methods in association within this callback. */ virtual void OnAssociationInboundStreamsReset(std::span inboundStreamIds) = 0; @@ -129,7 +129,7 @@ namespace RTC * the threshold set when calling SetStreamBufferedAmountLowThreshold(). * * @remarks - * - It is allowed to call methods in Association within this callback. + * - It is allowed to call methods in association within this callback. */ virtual void OnAssociationStreamBufferedAmountLow(uint16_t streamId) = 0; @@ -139,18 +139,18 @@ namespace RTC * `SctpOptions::totalBufferedAmountLowThreshold`. * * @remarks - * - It is allowed to call methods in Association within this callback. + * - It is allowed to call methods in association within this callback. */ virtual void OnAssociationTotalBufferedAmountLow() = 0; /** - * Called when the Association needs to know if the parent transport is + * Called when the association needs to know if the parent transport is * ready for SCTP traffic (e.g. whether the WebRtcTransport has ICE and * DTLS connected and at least a DataProducer or DataConsumer has been * created). Returned boolean indicates it. * * @remarks - * - It is NOT allowed to call methods in Association within this callback. + * - It is NOT allowed to call methods in association within this callback. */ virtual bool OnAssociationIsTransportReadyForSctp() = 0; @@ -181,7 +181,7 @@ namespace RTC * * @remarks * - This is a message lifecycle event. - * - It is NOT allowed to call methods in Association within this callback. + * - It is NOT allowed to call methods in association within this callback. */ virtual void OnAssociationLifecycleMessageFullySent(uint64_t lifecycleId) {}; @@ -199,7 +199,7 @@ namespace RTC * - This is a message lifecycle event. * - It's guaranteed that OnAssociationLifecycleMessageDelivered() is not called * if this callback has triggered. - * - It is NOT allowed to call methods in Association within this callback. + * - It is NOT allowed to call methods in association within this callback. */ virtual void OnAssociationLifecycleMessageExpired(uint64_t lifecycleId, bool maybeDelivered) { @@ -220,7 +220,7 @@ namespace RTC * - This is a message lifecycle event. * - It's guaranteed that OnAssociationLifecycleMessageEnd() is not called if * this callback has triggered. - * - It is NOT allowed to call methods in Association within this callback. + * - It is NOT allowed to call methods in association within this callback. */ virtual void OnAssociationLifecycleMessageDelivered(uint64_t lifecycleId) { @@ -238,12 +238,12 @@ namespace RTC * * @remarks: * - This is a message lifecycle event. - * - When the Association is deallocated, there will be no + * - When the association is deallocated, there will be no * OnAssociationLifecycleMessageEnd() callbacks sent for messages that were - * enqueued. But as long as the Association is alive, these callbacks are + * enqueued. But as long as the association is alive, these callbacks are * guaranteed to be sent as messages are either expired or successfully * acknowledged. - * - It is NOT allowed to call methods in Association within this callback. + * - It is NOT allowed to call methods in association within this callback. */ virtual void OnAssociationLifecycleMessageEnd(uint64_t lifecycleId) { diff --git a/worker/include/RTC/SCTP/public/AssociationMetrics.hpp b/worker/include/RTC/SCTP/public/AssociationMetrics.hpp index d9203bd4a5..d9f1ef2734 100644 --- a/worker/include/RTC/SCTP/public/AssociationMetrics.hpp +++ b/worker/include/RTC/SCTP/public/AssociationMetrics.hpp @@ -15,7 +15,7 @@ namespace RTC struct AssociationMetrics { /** - * Number of SCTP Packets sent. + * Number of SCTP packets sent. */ uint64_t txPacketsCount{ 0 }; @@ -25,7 +25,7 @@ namespace RTC uint64_t txMessagesCount{ 0 }; /** - * Number of SCTP Packets received. + * Number of SCTP packets received. */ uint64_t rxPacketsCount{ 0 }; @@ -35,10 +35,10 @@ namespace RTC uint64_t rxMessagesCount{ 0 }; /** - * Number of Packets retransmitted. Since SCTP Packets can contain both - * retransmitted DATA or I-DATA Chunks and Chunks that are transmitted for + * Number of packets retransmitted. Since SCTP packets can contain both + * retransmitted DATA or I-DATA chunks and chunks that are transmitted for * the first time, this represents an upper bound as it's incremented - * every time a Packet contains a retransmitted DATA or I-DATA chunk. + * every time a packet contains a retransmitted DATA or I-DATA chunk. */ uint64_t rtxPacketsCount{ 0 }; @@ -76,7 +76,7 @@ namespace RTC /** * SCTP implementation of the peer. Only detected when the peer sends an - * INIT_ACK Chunk to us with a State Cookie. + * INIT-ACK chunk to us with a State Cookie. */ Types::SctpImplementation peerImplementation{ Types::SctpImplementation::UNKNOWN }; @@ -102,7 +102,7 @@ namespace RTC bool usesPartialReliability{ false }; /** - * Whether Stream Schedulers and User Message Interleaving (I-DATA Chunks) + * Whether Stream Schedulers and User Message Interleaving (I-DATA chunks) * have been negotiated. * * @see RFC 8260. diff --git a/worker/include/RTC/SCTP/public/Message.hpp b/worker/include/RTC/SCTP/public/Message.hpp index 260141ab69..284e1a2724 100644 --- a/worker/include/RTC/SCTP/public/Message.hpp +++ b/worker/include/RTC/SCTP/public/Message.hpp @@ -70,7 +70,7 @@ namespace RTC /** * Useful to extract the payload and its ownership when destructing the - * Message. + * message. * * @remarks * - && at the end means that it can only be called from a rvalue. diff --git a/worker/include/RTC/SCTP/public/SctpOptions.hpp b/worker/include/RTC/SCTP/public/SctpOptions.hpp index 310da32019..269cf0a0af 100644 --- a/worker/include/RTC/SCTP/public/SctpOptions.hpp +++ b/worker/include/RTC/SCTP/public/SctpOptions.hpp @@ -41,7 +41,7 @@ namespace RTC uint16_t announcedMaxInboundStreams{ 65535 }; /** - * Maximum size of an SCTP Packet. It doesn't include any overhead of + * Maximum size of an SCTP packet. It doesn't include any overhead of * DTLS, TURN, UDP or IP headers. */ size_t mtu{ RTC::Consts::MaxSafeMtuSizeForSctp }; @@ -147,7 +147,7 @@ namespace RTC /** * The maximum time when a SACK will be sent from the arrival of an - * unacknowledged Packet. Whatever is smallest of RTO/2 and this will be + * unacknowledged packet. Whatever is smallest of RTO/2 and this will be * used. */ uint64_t delayedAckMaxTimeoutMs{ 200 }; @@ -220,7 +220,7 @@ namespace RTC size_t maxBurst{ 4 }; /** - * Maximum data retransmit attempts (for DATA, I_DATA and other Chunks). + * Maximum data retransmit attempts (for DATA, I-DATA and other chunks). * Set to std::nullopt for no limit. */ std::optional maxRetransmissions{ 10 }; @@ -240,7 +240,7 @@ namespace RTC bool enablePartialReliability{ true }; /** - * Enable Stream Schedulers and User Message Interleaving (I-DATA Chunks). + * Enable Stream Schedulers and User Message Interleaving (I-DATA chunks). * * @see RFC 8260. */ diff --git a/worker/include/RTC/SCTP/public/SctpTypes.hpp b/worker/include/RTC/SCTP/public/SctpTypes.hpp index fe5c355ccb..26ab9720c6 100644 --- a/worker/include/RTC/SCTP/public/SctpTypes.hpp +++ b/worker/include/RTC/SCTP/public/SctpTypes.hpp @@ -25,25 +25,25 @@ namespace RTC */ NEW, /** - * The Association is closed. + * The association is closed. */ CLOSED, /** - * The Association has initiated a connection, which is not yet + * The association has initiated a connection, which is not yet * established. * * @remarks - * - For incoming connections and for reconnections when the Association - * is already connected, the Association will not transition to this + * - For incoming connections and for reconnections when the association + * is already connected, the association will not transition to this * state. */ CONNECTING, /** - * The Association is connected and the connection is established. + * The association is connected and the connection is established. */ CONNECTED, /** - * The Association is shutting down, and the connection is not yet closed. + * The association is shutting down, and the connection is not yet closed. */ SHUTTING_DOWN }; @@ -98,7 +98,7 @@ namespace RTC TOO_MANY_RETRIES, /** * A command was received that is only possible to execute when the - * Association is connected, which it is not. + * association is connected, which it is not. */ NOT_CONNECTED, /** @@ -166,7 +166,7 @@ namespace RTC case ErrorKind::PROTOCOL_VIOLATION: { - return "PROTOCOL_VIOLATION"; + return "PROTOCOL-VIOLATION"; } case ErrorKind::RESOURCE_EXHAUSTION: @@ -292,13 +292,13 @@ namespace RTC ERROR_MESSAGE_TOO_LARGE, /** - * The message could not be enqueued as the Association is out of + * The message could not be enqueued as the association is out of * resources. This mainly indicates that the send queue is full. */ ERROR_RESOURCE_EXHAUSTION, /** - * The message could not be sent as the Association is shutting down. + * The message could not be sent as the association is shutting down. */ ERROR_SHUTTING_DOWN }; diff --git a/worker/include/RTC/SCTP/rx/DataTracker.hpp b/worker/include/RTC/SCTP/rx/DataTracker.hpp index 318ab3d599..f74006ed3a 100644 --- a/worker/include/RTC/SCTP/rx/DataTracker.hpp +++ b/worker/include/RTC/SCTP/rx/DataTracker.hpp @@ -246,7 +246,7 @@ namespace RTC bool WillIncreaseCumAckTsn(uint32_t tsn) const; /** - * Adds a SACK chunk with selective ack to the given Packet. + * Adds a SACK chunk with selective ack to the given packet. * * @remarks * - It will clear `this->duplicates`, so every SACK chunk that is diff --git a/worker/include/RTC/SCTP/rx/ReassemblyStreamsInterface.hpp b/worker/include/RTC/SCTP/rx/ReassemblyStreamsInterface.hpp index 2ad3f294e0..4a28e1b479 100644 --- a/worker/include/RTC/SCTP/rx/ReassemblyStreamsInterface.hpp +++ b/worker/include/RTC/SCTP/rx/ReassemblyStreamsInterface.hpp @@ -73,7 +73,7 @@ namespace RTC /** * Called for incoming (possibly deferred) RE-CONFIG chunks asking for * either a few streams, or all streams (when the list is empty) to be - * reset - to have their next SSN or Message ID to be zero. + * reset - to have their next SSN or message ID to be zero. */ virtual void ResetStreams(std::span streamIds) = 0; }; diff --git a/worker/include/RTC/SCTP/tx/OutstandingData.hpp b/worker/include/RTC/SCTP/tx/OutstandingData.hpp index 392e1f4720..444a222f83 100644 --- a/worker/include/RTC/SCTP/tx/OutstandingData.hpp +++ b/worker/include/RTC/SCTP/tx/OutstandingData.hpp @@ -38,26 +38,26 @@ namespace RTC enum class State : uint8_t { /** - * The Chunk has been sent but not received yet (from the sender's point - * of view, as no SACK has been received yet that reference this Chunk). + * The chunk has been sent but not received yet (from the sender's point + * of view, as no SACK has been received yet that reference this chunk). */ IN_FLIGHT, /** - * A SACK has been received which explicitly marked this Chunk as missing. + * A SACK has been received which explicitly marked this chunk as missing. * It's now NACKED and may be retransmitted if NACKED enough times. */ NACKED, /** - * A Chunk that will be retransmitted when possible. + * A chunk that will be retransmitted when possible. */ TO_BE_RETRANSMITTED, /** - * A SACK has been received which explicitly marked this Chunk as + * A SACK has been received which explicitly marked this chunk as * received. */ ACKED, /** - * A Chunk whose message has expired or has been retransmitted too many + * A chunk whose message has expired or has been retransmitted too many * times (RFC3758). It will not be retransmitted anymore. */ ABANDONED, @@ -128,16 +128,16 @@ namespace RTC enum class Lifecycle : uint8_t { /** - * The Chunk is alive (sent, received, etc). + * The chunk is alive (sent, received, etc). */ ACTIVE, /** - * The Chunk is scheduled to be retransmitted, and will then + * The chunk is scheduled to be retransmitted, and will then * transition to become active. */ TO_BE_RETRANSMITTED, /** - * The Chunk has been abandoned. This is a terminal state. + * The chunk has been abandoned. This is a terminal state. */ ABANDONED }; @@ -145,15 +145,15 @@ namespace RTC enum class AckState : uint8_t { /** - * The Chunk is in-flight. + * The chunk is in-flight. */ UNACKED, /** - * The Chunk has been received and acknowledged. + * The chunk has been received and acknowledged. */ ACKED, /** - * The Chunk has been nacked and is possibly lost. + * The chunk has been nacked and is possibly lost. */ NACKED }; @@ -232,7 +232,7 @@ namespace RTC } /** - * Indicates if this Chunk should be retransmitted. + * Indicates if this chunk should be retransmitted. */ bool ShouldBeRetransmitted() const { @@ -240,7 +240,7 @@ namespace RTC } /** - * Indicates if this Chunk has ever been retransmitted. + * Indicates if this chunk has ever been retransmitted. */ bool HasBeenRetransmitted() const { @@ -248,7 +248,7 @@ namespace RTC } /** - * Given the current time, and the current state of this DATA Chunk, it + * Given the current time, and the current state of this DATA chunk, it * will indicate if it has expired (SCTP Partial Reliability Extension). */ bool HasExpired(uint64_t nowMs) const @@ -277,16 +277,16 @@ namespace RTC // An optional lifecycle id, which may only be set for the last // fragment. const std::optional lifecycleId; - // Indicates the life cycle status of this Chunk. + // Indicates the life cycle status of this chunk. Lifecycle lifecycle{ Lifecycle::ACTIVE }; - // Indicates the presence of this Chunk, if it's in flight (UNACKED), + // Indicates the presence of this chunk, if it's in flight (UNACKED), // has been received (ACKED) or is possibly lost (NACKED). AckState ackState{ AckState::UNACKED }; - // The number of times the DATA Chunk has been nacked (by having + // The number of times the DATA chunk has been nacked (by having // received a SACK which doesn't include it). Will be cleared on // retransmissions. uint8_t nackCount{ 0 }; - // The number of times the DATA Chunk has been retransmitted. + // The number of times the DATA chunk has been retransmitted. uint16_t numRetransmissions{ 0 }; }; @@ -303,15 +303,15 @@ namespace RTC bool isInFastRecovery); /** - * Returns as many of the Chunks that are eligible for fast retransmissions + * Returns as many of the chunks that are eligible for fast retransmissions * and that would fit in a single packet of `maxLength`. The eligible - * Chunks that didn't fit will be marked for (normal) retransmission and + * chunks that didn't fit will be marked for (normal) retransmission and * will not be returned if this method is called again. */ std::vector> GetChunksToBeFastRetransmitted(size_t maxLength); /** - * Given `maxLength` of space left in a packet, which Chunks can be added + * Given `maxLength` of space left in a packet, which chunks can be added * to it? */ std::vector> GetChunksToBeRetransmitted(size_t maxLength); @@ -333,7 +333,7 @@ namespace RTC } /** - * Returns the number of DATA Chunks that are in-flight (not acked or + * Returns the number of DATA chunks that are in-flight (not acked or * nacked). */ size_t GetUnackedItems() const @@ -343,7 +343,7 @@ namespace RTC /** * Given the current time `nowMs`, expire and abandon outstanding (sent - * at least once) Chunks that have a limited lifetime. + * at least once) chunks that have a limited lifetime. */ void ExpireOutstandingChunks(uint64_t nowMs); @@ -393,25 +393,25 @@ namespace RTC void NackAll(); /** - * Adds a FORWARD-TSN Chunk to the given Packet and returns it. + * Adds a FORWARD-TSN chunk to the given packet and returns it. */ const ForwardTsnChunk* AddForwardTsn(Packet* packet) const; /** - * Adds an I-FORWARD-TSN Chunk to the given Packet and returns it. + * Adds an I-FORWARD-TSN chunk to the given packet and returns it. */ const IForwardTsnChunk* AddIForwardTsn(Packet* packet) const; /** * Given the current time and a TSN, it returns the measured RTT between - * when the Chunk was sent and now. It takes into acccount Karn's - * algorithm, so if the Chunk has ever been retransmitted, it will return + * when the chunk was sent and now. It takes into acccount Karn's + * algorithm, so if the chunk has ever been retransmitted, it will return * `std::nullopt`. */ std::optional MeasureRtt(uint64_t nowMs, Types::UnwrappedTsn tsn) const; /** - * Returns true if the next Chunk that is not acked by the peer has been + * Returns true if the next chunk that is not acked by the peer has been * abandoned, which means that a FORWARD-TSN should be sent. */ bool ShouldSendForwardTsn() const; @@ -424,7 +424,7 @@ namespace RTC #ifdef MS_TEST /** - * Returns the internal state of all queued Chunks. + * Returns the internal state of all queued chunks. * * @remarks * - Used in tests. @@ -434,7 +434,7 @@ namespace RTC private: /** - * Returns how large a Chunk will be, serialized, carrying the data. + * Returns how large a chunk will be, serialized, carrying the data. */ size_t GetSerializedChunkLength(const UserData& data) const; @@ -450,7 +450,7 @@ namespace RTC void RemoveAcked(Types::UnwrappedTsn cumulativeTsnAck, AckInfo& ackInfo); /** - * Will mark the Chunks covered by the `gapAckBlocks` from an incoming + * Will mark the chunks covered by the `gapAckBlocks` from an incoming * SACK as "acked" and update `ackInfo` by adding new TSNs to * `this->cumulativeTsnAck`. */ @@ -460,7 +460,7 @@ namespace RTC AckInfo& ackInfo); /** - * Mark Chunks reported as "missing", as "nacked" or "to be retransmitted" + * Mark chunks reported as "missing", as "nacked" or "to be retransmitted" * depending how many times this has happened. Only packets up until * `ackInfo.highestTsnAcked` (highest TSN newly acknowledged) are * nacked/retransmitted. The method will set `ackInfo.hasPacketLoss`. @@ -473,7 +473,7 @@ namespace RTC AckInfo& ackInfo); /** - * Process the acknowledgement of the Chunk referenced by `item` and + * Process the acknowledgement of the chunk referenced by `item` and * updates state in `ackInfo` and the object's state. */ void AckChunk(AckInfo& ackInfo, Types::UnwrappedTsn tsn, Item& item); @@ -498,7 +498,7 @@ namespace RTC /** * Given that a message fragment, `item` has been abandoned, abandon all * other fragments that share the same message - both never-before-sent - * fragments that are still in the SendQueue and outstanding Chunks. + * fragments that are still in the SendQueue and outstanding chunks. */ void AbandonAllFor(const OutstandingData::Item& item); @@ -508,7 +508,7 @@ namespace RTC void AssertIsConsistent() const; private: - // The size of the data Chunk (DATA/I-DATA) header that is used. + // The size of the data chunk (DATA/I-DATA) header that is used. const size_t dataChunkHeaderLength; // The last cumulative TSN ack number. Types::UnwrappedTsn lastCumulativeTsnAck; @@ -524,12 +524,12 @@ namespace RTC // The number of bytes that are in-flight, as sent on the wire (as // packets). size_t unackedPacketBytes{ 0 }; - // The number of DATA Chunks that are in-flight (sent but not yet acked + // The number of DATA chunks that are in-flight (sent but not yet acked // or nacked). size_t unackedItems{ 0 }; - // Data Chunks that are eligible for fast retransmission. + // Data chunks that are eligible for fast retransmission. std::set toBeFastRetransmitted; - // Data Chunks that are to be retransmitted. + // Data chunks that are to be retransmitted. std::set toBeRetransmitted; // Wben a stream reset has begun, the "next TSN to assign" is added to // this set, and removed when the cum-ack TSN reaches it. This is used diff --git a/worker/include/RTC/SCTP/tx/RetransmissionErrorCounter.hpp b/worker/include/RTC/SCTP/tx/RetransmissionErrorCounter.hpp index 5c9517b842..6cfb4bd2a5 100644 --- a/worker/include/RTC/SCTP/tx/RetransmissionErrorCounter.hpp +++ b/worker/include/RTC/SCTP/tx/RetransmissionErrorCounter.hpp @@ -11,7 +11,7 @@ namespace RTC { /** * The RetransmissionErrorCounter is a simple counter with a limit, and when - * the limit is exceeded, the counter is exhausted and the Association will + * the limit is exceeded, the counter is exhausted and the association will * be closed. It's incremented on retransmission errors, such as the T3-RTX * timer expiring, but also missing heartbeats and stream reset requests. */ diff --git a/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp b/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp index 997faddfc2..4b57bc536a 100644 --- a/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp +++ b/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp @@ -90,23 +90,23 @@ namespace RTC } /** - * Returns a list of Chunks to "fast retransmit" that would fit in + * Returns a list of chunks to "fast retransmit" that would fit in * `maxLength` (bytes). The current value of `cwnd` is ignored. */ std::vector> GetChunksForFastRetransmit(size_t maxLength); /** - * Returns a list of Chunks to send that would fit in `maxLength` + * Returns a list of chunks to send that would fit in `maxLength` * (bytes). This may be further limited by the congestion control windows. * Note that `ShouldSendForwardTsn()` must be called prior to this method, - * to abandon expired Chunks, as this method will not expire any Chunks. + * to abandon expired chunks, as this method will not expire any chunks. */ std::vector> GetChunksToSend( uint64_t nowMs, size_t maxLength); #ifdef MS_TEST /** - * Returns the internal state of all queued Chunks. + * Returns the internal state of all queued chunks. * * @remarks * - Used in tests. @@ -118,7 +118,7 @@ namespace RTC #endif /** - * Returns the next TSN that will be allocated for sent DATA Chunks. + * Returns the next TSN that will be allocated for sent DATA chunks. */ uint32_t GetNextTsn() const { @@ -182,14 +182,14 @@ namespace RTC } /** - * Given the current time `nowMs`, it will evaluate if there are Chunks + * Given the current time `nowMs`, it will evaluate if there are chunks * that have expired and that need to be discarded. It returns true if a * FORWARD-TSN should be sent. */ bool ShouldSendForwardTsn(uint64_t nowMs); /** - * Adds a FORWARD-TSN Chunk to the given Packet and returns it. + * Adds a FORWARD-TSN chunk to the given packet and returns it. */ const ForwardTsnChunk* AddForwardTsn(Packet* packet) const { @@ -197,7 +197,7 @@ namespace RTC } /** - * Adds an I-FORWARD-TSN Chunk to the given Packet and returns it. + * Adds an I-FORWARD-TSN chunk to the given packet and returns it. */ const IForwardTsnChunk* AddIForwardTsn(Packet* packet) const { @@ -229,7 +229,7 @@ namespace RTC } /** - * Indicates if the provided SACK Chunk is valid given what has previously + * Indicates if the provided SACK chunk is valid given what has previously * been received. If it returns false, the SACK is most likely a duplicate * of something already seen, so this returning false doesn't necessarily * mean that the SACK is illegal. @@ -237,7 +237,7 @@ namespace RTC bool IsSackChunkValid(const SackChunk* sackChunk) const; /** - * When a SACK Chunk is received, this method will be called which may + * When a SACK chunk is received, this method will be called which may * call into the `RetransmissionTimeout` to update the RTO. */ void UpdateRttMs(uint64_t nowMs, Types::UnwrappedTsn cumulativeTsnAck); @@ -249,7 +249,7 @@ namespace RTC void MayExitFastRecovery(Types::UnwrappedTsn cumulativeTsnAck); /** - * If Chunks have been ACKed, stop the retransmission timer. + * If chunks have been ACKed, stop the retransmission timer. * * @remarks * - This method is NOT defined in dcsctp! See bug report: @@ -259,13 +259,13 @@ namespace RTC /** * Update the congestion control algorithm given as the cumulative ack TSN - * value has increased, as reported in an incoming SACK Chunk. + * value has increased, as reported in an incoming SACK chunk. */ void HandleIncreasedCumulativeTsnAck(size_t unackedPacketBytes, size_t totalBytesAcked); /** * Update the congestion control algorithm, given as packet loss has been - * detected, as reported in an incoming SACK Chunk. + * detected, as reported in an incoming SACK chunk. */ void HandlePacketLoss(Types::UnwrappedTsn highestTsnAcked); @@ -318,7 +318,7 @@ namespace RTC std::optional fastRecoveryExitTsn{ std::nullopt }; // The send queue. SendQueueInterface& sendQueue; - // All the outstanding data Chunks that are in-flight and that have not + // All the outstanding data chunks that are in-flight and that have not // been cumulative acked. Note that it also contains chunks that have been // acked in gap-ack-blocks. OutstandingData outstandingData; diff --git a/worker/include/RTC/SCTP/tx/RoundRobinSendQueue.hpp b/worker/include/RTC/SCTP/tx/RoundRobinSendQueue.hpp index aa90beafa2..dc21b28e87 100644 --- a/worker/include/RTC/SCTP/tx/RoundRobinSendQueue.hpp +++ b/worker/include/RTC/SCTP/tx/RoundRobinSendQueue.hpp @@ -243,7 +243,7 @@ namespace RTC // been fragmented. size_t remainingOffset{ 0 }; size_t remainingLength; - // If set, an allocated Message ID and SSN. Will be allocated when the + // If set, an allocated message ID and SSN. Will be allocated when the // first fragment is sent. std::optional mid{ std::nullopt }; std::optional ssn{ std::nullopt }; diff --git a/worker/src/RTC/DataConsumer.cpp b/worker/src/RTC/DataConsumer.cpp index 07adb8e38e..b4f0d9b460 100644 --- a/worker/src/RTC/DataConsumer.cpp +++ b/worker/src/RTC/DataConsumer.cpp @@ -296,7 +296,7 @@ namespace RTC this->type == DataConsumer::Type::SCTP ? this->sctpStreamParameters.streamId : 0; // NOTE: We are creating a copy of the data here, otherwise we cannot - // move the Message and pass its ownership to the SCTP stack. + // move the message and pass its ownership to the SCTP stack. RTC::SCTP::Message message(streamId, body->ppid(), std::vector(data, data + len)); SendMessage(std::move(message), emptySubchannels, std::nullopt, cb); diff --git a/worker/src/RTC/DataProducer.cpp b/worker/src/RTC/DataProducer.cpp index 7967f9501b..652fcf0d63 100644 --- a/worker/src/RTC/DataProducer.cpp +++ b/worker/src/RTC/DataProducer.cpp @@ -233,7 +233,7 @@ namespace RTC this->type == DataProducer::Type::SCTP ? this->sctpStreamParameters.streamId : 0; // NOTE: We are creating a copy of the data here, otherwise we cannot - // move the Message and pass its ownership to the SCTP stack. + // move the message and pass its ownership to the SCTP stack. RTC::SCTP::Message message(streamId, body->ppid(), std::vector(data, data + len)); ReceiveMessage(std::move(message), subchannels, requiredSubchannel); diff --git a/worker/src/RTC/ICE/StunPacket.cpp b/worker/src/RTC/ICE/StunPacket.cpp index 7d02b5122d..7f22add0bc 100644 --- a/worker/src/RTC/ICE/StunPacket.cpp +++ b/worker/src/RTC/ICE/StunPacket.cpp @@ -30,7 +30,7 @@ namespace RTC (bufferLength >= StunPacket::FixedHeaderLength) && // @see RFC 7983. (buffer[0] < 3) && - // Magic Cookie must match. + // Magic cookie must match. (buffer[4] == StunPacket::MagicCookie[0]) && (buffer[5] == StunPacket::MagicCookie[1]) && (buffer[6] == StunPacket::MagicCookie[2]) && (buffer[7] == StunPacket::MagicCookie[3])); } @@ -41,18 +41,18 @@ namespace RTC if (!StunPacket::IsStun(buffer, bufferLength)) { - MS_WARN_TAG(ice, "not a STUN Packet"); + MS_WARN_TAG(ice, "not a STUN packet"); return nullptr; } auto* packet = new StunPacket(const_cast(buffer), bufferLength); - // `bufferLength` must be the exact length of the STUN Packet, so let's + // `bufferLength` must be the exact length of the STUN packet, so let's // assign it immediately. packet->SetLength(bufferLength); - // Get STUN Message Type field. + // Get STUN message type field. const uint16_t typeField = Utils::Byte::Get2Bytes(buffer, 0); // Get STUN class. @@ -109,7 +109,7 @@ namespace RTC // NOTE: No need to write message length since it's already 0. - // Set magic Cookie. + // Set magic cookie. std::memcpy(packet->GetFixedHeaderPointer() + 4, StunPacket::MagicCookie, 4); if (transactionId) @@ -123,7 +123,7 @@ namespace RTC } // No need to invoke SetLength() since constructor invoked it with - // minimum STUN Packet length. + // minimum STUN packet length. return packet; } @@ -344,7 +344,7 @@ namespace RTC if (username.length() > StunPacket::UsernameAttributeMaxLength) { MS_THROW_TYPE_ERROR( - "Attribute USERNAME must be at most %zu bytes", StunPacket::UsernameAttributeMaxLength); + "attribute USERNAME must be at most %zu bytes", StunPacket::UsernameAttributeMaxLength); } StoreNewAttribute(StunPacket::AttributeType::USERNAME, username.data(), username.length()); @@ -415,7 +415,7 @@ namespace RTC if (software.length() > StunPacket::SoftwareAttributeMaxLength) { MS_THROW_TYPE_ERROR( - "Attribute SOFTWARE must be at most %zu bytes", StunPacket::SoftwareAttributeMaxLength); + "attribute SOFTWARE must be at most %zu bytes", StunPacket::SoftwareAttributeMaxLength); } StoreNewAttribute(StunPacket::AttributeType::SOFTWARE, software.data(), software.length()); @@ -450,7 +450,7 @@ namespace RTC { MS_WARN_TAG( ice, - "cannot get XOR_MAPPED_ADDRESS Attribute value, length of the Attribute is not %zu", + "cannot get XOR_MAPPED_ADDRESS attribute value, length of the attribute is not %zu", StunPacket::XorMappedAddressIPv4Length); return false; @@ -483,7 +483,7 @@ namespace RTC { MS_WARN_TAG( ice, - "cannot get XOR_MAPPED_ADDRESS Attribute value, length of the Attribute is not %zu", + "cannot get XOR_MAPPED_ADDRESS attribute value, length of the attribute is not %zu", StunPacket::XorMappedAddressIPv6Length); return false; @@ -516,7 +516,7 @@ namespace RTC // Unknown family. else { - MS_WARN_TAG(ice, "cannot get XOR_MAPPED_ADDRESS Attribute value, unknown family"); + MS_WARN_TAG(ice, "cannot get XOR_MAPPED_ADDRESS attribute value, unknown family"); return false; } @@ -654,24 +654,24 @@ namespace RTC return StunPacket::AuthenticationResult::BAD_MESSAGE; } - // USERNAME Attribute must be present. + // USERNAME attribute must be present. if (!HasAttribute(StunPacket::AttributeType::USERNAME)) { - MS_WARN_TAG(ice, "cannot authenticate request or indication, missing USERNAME Attribute"); + MS_WARN_TAG(ice, "cannot authenticate request or indication, missing USERNAME attribute"); return StunPacket::AuthenticationResult::BAD_MESSAGE; } - // MESSAGE-INTEGRITY Attribute must be present. + // MESSAGE-INTEGRITY attribute must be present. if (!messageIntegrity) { MS_WARN_TAG( - ice, "cannot authenticate request or indication, missing MESSAGE-INTEGRITY Attribute"); + ice, "cannot authenticate request or indication, missing MESSAGE-INTEGRITY attribute"); return StunPacket::AuthenticationResult::BAD_MESSAGE; } - // Check that the USERNAME Attribute begins with the first username + // Check that the USERNAME attribute begins with the first username // fragment plus ":". const auto username = GetUsername(); @@ -689,12 +689,12 @@ namespace RTC case StunPacket::Class::SUCCESS_RESPONSE: case StunPacket::Class::ERROR_RESPONSE: { - // MESSAGE-INTEGRITY Attribute must be present. + // MESSAGE-INTEGRITY attribute must be present. if (!messageIntegrity) { MS_WARN_TAG( ice, - "cannot authenticate success response or error response, missing MESSAGE-INTEGRITY Attribute"); + "cannot authenticate success response or error response, missing MESSAGE-INTEGRITY attribute"); return StunPacket::AuthenticationResult::BAD_MESSAGE; } @@ -706,7 +706,7 @@ namespace RTC { MS_WARN_TAG( ice, - "cannot authenticate STUN Packet, unknown STUN class %" PRIu16, + "cannot authenticate STUN packet, unknown STUN class %" PRIu16, static_cast(this->klass)); return StunPacket::AuthenticationResult::BAD_MESSAGE; @@ -721,7 +721,7 @@ namespace RTC if (hasFingerprint) { // Set the message length field by removing the length of the - // FINGERPRINT Attribute (4 + 4). + // FINGERPRINT attribute (4 + 4). // NOTE: We cannot use SetMessageLength() because CheckAuthentication() // is marked as a `const` method. Utils::Byte::Set2Bytes(fixedHeader, 2, static_cast(GetAttributesLength() - 4 - 4)); @@ -729,14 +729,14 @@ namespace RTC // Calculate the HMAC-SHA1 of the message according to MESSAGE-INTEGRITY // rules, this is, by checking the bytes from 0 to the beginning of the - // MESSAGE-INTEGRITY Attribute. + // MESSAGE-INTEGRITY attribute. const uint8_t* computedMessageIntegrity = Utils::Crypto::GetHmacSha1( password.data(), password.length(), fixedHeader, (messageIntegrity - 4) - fixedHeader); StunPacket::AuthenticationResult result; // Compare the computed HMAC-SHA1 with the MESSAGE-INTEGRITY in the STUN - // Packet. + // packet. if (std::memcmp(messageIntegrity, computedMessageIntegrity, StunPacket::FixedHeaderLength) == 0) { result = StunPacket::AuthenticationResult::OK; @@ -773,22 +773,22 @@ namespace RTC const auto currentLength = GetLength(); const size_t addedLength = 4 + StunPacket::MessageIntegrityAttributeLength + 4 + 4; - // We need to add Attribute(s) so we must increase the length of the - // STUN Packet. + // We need to add attribute(s) so we must increase the length of the STUN + // packet. // NOTE: This may throw. SetLength(GetLength() + addedLength); // Once we know it doesn't throw (so there is space in the buffer), let's // revert it because code below will do it when needed. SetLength(currentLength); - // Add MESSAGE-INTEGRITY Attribute (only if password was given). + // Add MESSAGE-INTEGRITY attribute (only if password was given). if (!password.empty()) { - // When must include the length of MESSAGE-INTEGRITY Attribute in - // message length field of the STUN Packet. + // When must include the length of MESSAGE-INTEGRITY attribute in + // message length field of the STUN packet. SetMessageLength(GetMessageLength() + 4 + StunPacket::MessageIntegrityAttributeLength); - // Calculate the HMAC-SHA1 of the STUN Packet according to + // Calculate the HMAC-SHA1 of the STUN packet according to // MESSAGE-INTEGRITY rules. const uint8_t* computedMessageIntegrity = Utils::Crypto::GetHmacSha1(password.data(), password.length(), GetBuffer(), currentLength); @@ -799,14 +799,14 @@ namespace RTC StunPacket::MessageIntegrityAttributeLength); } - // Add FINGERPRINT Attribute. + // Add FINGERPRINT attribute. - // When must include the length of FINGERPRINT Attribute in - // message length field of the STUN Packet. + // When must include the length of FINGERPRINT attribute in + // message length field of the STUN packet. SetMessageLength(GetMessageLength() + 4 + 4); - // Compute the CRC32 of the STUN Packet up to (but excluding) the - // FINGERPRINT Attribute and XOR it with 0x5354554e. + // Compute the CRC32 of the STUN packet up to (but excluding) the + // FINGERPRINT attribute and XOR it with 0x5354554e. const uint32_t computedFingerprint = Utils::Crypto::GetCRC32(GetBuffer(), GetLength()) ^ 0x5354554e; @@ -828,7 +828,7 @@ namespace RTC if (this->klass != StunPacket::Class::REQUEST) { - MS_THROW_ERROR("cannot create a success response, original STUN Packet is not a request"); + MS_THROW_ERROR("cannot create a success response, original STUN packet is not a request"); } auto* successResponse = Factory( @@ -844,7 +844,7 @@ namespace RTC if (this->klass != StunPacket::Class::REQUEST) { - MS_THROW_ERROR("cannot create an error response, original STUN Packet is not a request"); + MS_THROW_ERROR("cannot create an error response, original STUN packet is not a request"); } auto* errorResponse = Factory( @@ -866,13 +866,13 @@ namespace RTC // Message length field must be total length minus header's 20 bytes, and // must be multiple of 4 Bytes. - // NOTE: Message length is effectively the total length of the Attributes + // NOTE: Message length is effectively the total length of the attributes // (with all paddings). if (static_cast(msgLength) != GetAttributesLength() || !Utils::Byte::IsPaddedTo4Bytes(msgLength)) { MS_WARN_TAG( ice, - "invalid STUN Packet, message length field (%" PRIu16 + "invalid STUN packet, message length field (%" PRIu16 ") does not match given buffer length or it's not multiple of 4 bytes", msgLength); @@ -881,29 +881,29 @@ namespace RTC if (!ParseAttributes(storeAttributes)) { - MS_WARN_TAG(rtp, "invalid STUN Packet, invalid Attributes"); + MS_WARN_TAG(rtp, "invalid STUN packet, invalid attributes"); return false; } - // If it has FINGERPRINT Attribute then verify it. + // If it has FINGERPRINT attribute then verify it. const auto* fingerprintAttr = GetAttribute(StunPacket::AttributeType::FINGERPRINT); if (fingerprintAttr) { - // Compute the CRC32 of the received STUN Packet up to (but excluding) - // the FINGERPRINT Attribute and XOR it with 0x5354554e. + // Compute the CRC32 of the received STUN packet up to (but excluding) + // the FINGERPRINT attribute and XOR it with 0x5354554e. const auto computedFingerprint = Utils::Crypto::GetCRC32( fixedHeader, StunPacket::FixedHeaderLength + fingerprintAttr->offset) ^ 0x5354554e; - // Compare with the FINGERPRINT value in the STUN Packet. + // Compare with the FINGERPRINT value in the STUN packet. if (GetFingerprint() != computedFingerprint) { MS_WARN_TAG( ice, - "invalid STUN Packet, computed fingerprint value does not match the value in the FINGERPRINT Attribute"); + "invalid STUN packet, computed fingerprint value does not match the value in the FINGERPRINT attribute"); return false; } @@ -920,7 +920,7 @@ namespace RTC const uint8_t* attributesEnd = attributesStart + GetAttributesLength(); auto* ptr = const_cast(attributesStart); - // Ensure there are at least 4 remaining bytes (Attribute with 0 length). + // Ensure there are at least 4 remaining bytes (attribute with 0 length). while (ptr + 4 <= attributesEnd) { // NOTE: We cannot cast `ptr` to `StunPacket::Attribute*` here because @@ -928,40 +928,40 @@ namespace RTC // member) but `ptr` points into a network buffer with no guaranteed // alignment, making the cast undefined behavior. - // Read Attribute type and length. + // Read attribute type and length. const auto attrType = static_cast(Utils::Byte::Get2Bytes(ptr, 0)); const uint16_t attrLen = Utils::Byte::Get2Bytes(ptr, 2); - // Offset of the Attribute from the start of the attributes. + // Offset of the attribute from the start of the attributes. const auto attrOffset = static_cast((ptr - attributesStart)); - // Ensure the Attribute length is not greater than the remaining length. + // Ensure the attribute length is not greater than the remaining length. if (ptr + 4 + attrLen > attributesEnd) { MS_WARN_TAG( ice, - "invalid STUN Packet, not enough space for the announced value of the Attribute with type %" PRIu16, + "invalid STUN packet, not enough space for the announced value of the attribute with type %" PRIu16, static_cast(attrType)); return false; } - // FINGERPRINT must be the last Attribute. + // FINGERPRINT must be the last attribute. if (storeAttributes && HasAttribute(StunPacket::AttributeType::FINGERPRINT)) { - MS_WARN_TAG(ice, "invalid STUN Packet, Attribute after FINGERPRINT is not allowed"); + MS_WARN_TAG(ice, "invalid STUN packet, attribute after FINGERPRINT is not allowed"); return false; } - // After a MESSAGE-INTEGRITY Attribute only FINGERPRINT is allowed. + // After a MESSAGE-INTEGRITY attribute only FINGERPRINT is allowed. if ( storeAttributes && HasAttribute(StunPacket::AttributeType::MESSAGE_INTEGRITY) && attrType != StunPacket::AttributeType::FINGERPRINT) { MS_WARN_TAG( ice, - "invalid STUN Packet, Attribute after MESSAGE-INTEGRITY other than FINGERPRINT is not allowed"); + "invalid STUN packet, attribute after MESSAGE-INTEGRITY other than FINGERPRINT is not allowed"); return false; } @@ -974,7 +974,7 @@ namespace RTC { MS_WARN_TAG( ice, - "invalid STUN Packet, Attribute USERNAME must be at most %zu bytes", + "invalid STUN packet, attribute USERNAME must be at most %zu bytes", StunPacket::UsernameAttributeMaxLength); return false; @@ -992,7 +992,7 @@ namespace RTC { if (attrLen != 4) { - MS_WARN_TAG(ice, "invalid STUN Packet, Attribute PRIORITY must be 4 bytes length"); + MS_WARN_TAG(ice, "invalid STUN packet, attribute PRIORITY must be 4 bytes length"); return false; } @@ -1010,7 +1010,7 @@ namespace RTC if (attrLen != 8) { MS_WARN_TAG( - ice, "invalid STUN Packet, Attribute ICE-CONTROLLING must be 8 bytes length"); + ice, "invalid STUN packet, attribute ICE-CONTROLLING must be 8 bytes length"); return false; } @@ -1027,7 +1027,7 @@ namespace RTC { if (attrLen != 8) { - MS_WARN_TAG(ice, "invalid STUN Packet, Attribute ICE-CONTROLLED must be 8 bytes length"); + MS_WARN_TAG(ice, "invalid STUN packet, attribute ICE-CONTROLLED must be 8 bytes length"); return false; } @@ -1044,7 +1044,7 @@ namespace RTC { if (attrLen != 0) { - MS_WARN_TAG(ice, "invalid STUN Packet, Attribute USE-CANDIDATE must be 0 bytes length"); + MS_WARN_TAG(ice, "invalid STUN packet, attribute USE-CANDIDATE must be 0 bytes length"); return false; } @@ -1061,7 +1061,7 @@ namespace RTC { if (attrLen != 4) { - MS_WARN_TAG(ice, "invalid STUN Packet, Attribute NOMINATION must be 4 bytes length"); + MS_WARN_TAG(ice, "invalid STUN packet, attribute NOMINATION must be 4 bytes length"); return false; } @@ -1080,7 +1080,7 @@ namespace RTC { MS_WARN_TAG( ice, - "invalid STUN Packet, Attribute SOFTWARE must be at most %zu bytes length", + "invalid STUN packet, attribute SOFTWARE must be at most %zu bytes length", StunPacket::SoftwareAttributeMaxLength); return false; @@ -1100,7 +1100,7 @@ namespace RTC { MS_WARN_TAG( ice, - "invalid STUN Packet, Attribute XOR_MAPPED_ADDRESS-CODE must be %zu or %zu bytes length", + "invalid STUN packet, attribute XOR_MAPPED_ADDRESS-CODE must be %zu or %zu bytes length", StunPacket::XorMappedAddressIPv4Length, StunPacket::XorMappedAddressIPv6Length); @@ -1119,7 +1119,7 @@ namespace RTC { if (attrLen < 4) { - MS_WARN_TAG(ice, "invalid STUN Packet, Attribute ERROR-CODE must be >= 4 bytes length"); + MS_WARN_TAG(ice, "invalid STUN packet, attribute ERROR-CODE must be >= 4 bytes length"); return false; } @@ -1138,7 +1138,7 @@ namespace RTC { MS_WARN_TAG( ice, - "invalid STUN Packet, Attribute MESSAGE-INTEGRITY must be %zu bytes length", + "invalid STUN packet, attribute MESSAGE-INTEGRITY must be %zu bytes length", StunPacket::MessageIntegrityAttributeLength); return false; @@ -1156,7 +1156,7 @@ namespace RTC { if (attrLen != 4) { - MS_WARN_TAG(ice, "invalid STUN Packet, Attribute FINGERPRINT must be 4 bytes length"); + MS_WARN_TAG(ice, "invalid STUN packet, attribute FINGERPRINT must be 4 bytes length"); return false; } @@ -1171,20 +1171,20 @@ namespace RTC default: { - MS_DEBUG_DEV("unknown Attribute with type %" PRIu16, attrType); + MS_DEBUG_DEV("unknown attribute with type %" PRIu16, attrType); } } - // Move to next Attribute. + // Move to next attribute. ptr += Utils::Byte::PadTo4Bytes(static_cast(4 + attrLen)); } - // Ensure we read the Attributes length entirely. + // Ensure we read the attributes length entirely. if (ptr != attributesStart + GetAttributesLength()) { MS_WARN_TAG( ice, - "invalid STUN Packet, computed length of Attributes (%zu) does not match announced length (%zu)", + "invalid STUN packet, computed length of attributes (%zu) does not match announced length (%zu)", static_cast(ptr - attributesStart), GetAttributesLength()); @@ -1202,8 +1202,8 @@ namespace RTC { MS_WARN_TAG( ice, - "cannot store parsed Attribute with type %" PRIu16 - ", there is an Attribute with same type already in the map", + "cannot store parsed attribute with type %" PRIu16 + ", there is an attribute with same type already in the map", static_cast(type)); return false; @@ -1223,20 +1223,20 @@ namespace RTC if (this->attributes.find(type) != this->attributes.end()) { MS_THROW_ERROR( - "cannot store new Attribute with type %" PRIu16 - ", there is an Attribute with same type already in the map", + "cannot store new attribute with type %" PRIu16 + ", there is an attribute with same type already in the map", static_cast(type)); } - // Add the Attribute at the end of the STUN Packet. + // Add the attribute at the end of the STUN packet. const auto attrTotalPaddedLength = Utils::Byte::PadTo4Bytes(static_cast(4 + len)); - // Get the pointer in which the new Attribute must be written. + // Get the pointer in which the new attribute must be written. // NOTE: Do this before updating lengths. auto* attrPtr = GetAttributesPointer() + GetAttributesLength(); - // First update STUN Packet length (it may throw). + // First update STUN packet length (it may throw). SetLength(GetLength() + attrTotalPaddedLength); // Also update the message length field. @@ -1255,10 +1255,10 @@ namespace RTC const auto [it, inserted] = this->attributes.try_emplace(type, type, len, 0); auto& attribute = it->second; - // Update stored Attribute's offset. + // Update stored attribute's offset. attribute.offset = attrPtr - GetAttributesPointer(); - MS_ASSERT(inserted, "Attribute not inserted in the map (this shouldn't happen)"); + MS_ASSERT(inserted, "attribute not inserted in the map (this shouldn't happen)"); } void StunPacket::AssertNotProtected() const @@ -1267,7 +1267,7 @@ namespace RTC if (IsProtected()) { - MS_THROW_ERROR("STUN Packet is protected"); + MS_THROW_ERROR("STUN packet is protected"); } } } // namespace ICE diff --git a/worker/src/RTC/RTCP/Feedback.cpp b/worker/src/RTC/RTCP/Feedback.cpp index a011647003..f7e7a709ba 100644 --- a/worker/src/RTC/RTCP/Feedback.cpp +++ b/worker/src/RTC/RTCP/Feedback.cpp @@ -122,7 +122,7 @@ namespace RTC if (len < Packet::CommonHeaderSize + FeedbackPacket::HeaderSize) { - MS_WARN_TAG(rtcp, "not enough space for Feedback packet, discarded"); + MS_WARN_TAG(rtcp, "not enough space for feedback packet, discarded"); return nullptr; } @@ -176,7 +176,7 @@ namespace RTC default: MS_WARN_TAG( - rtcp, "unknown RTCP PS Feedback message type [packetType:%" PRIu8 "]", commonHeader->count); + rtcp, "unknown RTCP PS feedback message type [packetType:%" PRIu8 "]", commonHeader->count); } return packet; @@ -213,7 +213,7 @@ namespace RTC if (len < Packet::CommonHeaderSize + FeedbackPacket::HeaderSize) { - MS_WARN_TAG(rtcp, "not enough space for Feedback packet, discarded"); + MS_WARN_TAG(rtcp, "not enough space for feedback packet, discarded"); return nullptr; } @@ -262,7 +262,7 @@ namespace RTC default: MS_WARN_TAG( rtcp, - "unknown RTCP RTP Feedback message type [packetType:%" PRIu8 "]", + "unknown RTCP RTP feedback message type [packetType:%" PRIu8 "]", commonHeader->count); } diff --git a/worker/src/RTC/RTCP/FeedbackPs.cpp b/worker/src/RTC/RTCP/FeedbackPs.cpp index ed4f97ab02..f4153a7c1c 100644 --- a/worker/src/RTC/RTCP/FeedbackPs.cpp +++ b/worker/src/RTC/RTCP/FeedbackPs.cpp @@ -24,7 +24,7 @@ namespace RTC if (len < Packet::CommonHeaderSize + FeedbackPacket::HeaderSize) { - MS_WARN_TAG(rtcp, "not enough space for Feedback packet, discarded"); + MS_WARN_TAG(rtcp, "not enough space for feedback packet, discarded"); return nullptr; } diff --git a/worker/src/RTC/RTCP/FeedbackPsAfb.cpp b/worker/src/RTC/RTCP/FeedbackPsAfb.cpp index 667d2a6b3c..c279c1d129 100644 --- a/worker/src/RTC/RTCP/FeedbackPsAfb.cpp +++ b/worker/src/RTC/RTCP/FeedbackPsAfb.cpp @@ -19,7 +19,7 @@ namespace RTC if (len < Packet::CommonHeaderSize + FeedbackPacket::HeaderSize) { - MS_WARN_TAG(rtcp, "not enough space for Feedback packet, discarded"); + MS_WARN_TAG(rtcp, "not enough space for feedback packet, discarded"); return nullptr; } diff --git a/worker/src/RTC/RTCP/FeedbackPsPli.cpp b/worker/src/RTC/RTCP/FeedbackPsPli.cpp index 06bc1a790a..80c2b13672 100644 --- a/worker/src/RTC/RTCP/FeedbackPsPli.cpp +++ b/worker/src/RTC/RTCP/FeedbackPsPli.cpp @@ -16,7 +16,7 @@ namespace RTC if (len < Packet::CommonHeaderSize + FeedbackPacket::HeaderSize) { - MS_WARN_TAG(rtcp, "not enough space for Feedback packet, discarded"); + MS_WARN_TAG(rtcp, "not enough space for feedback packet, discarded"); return nullptr; } diff --git a/worker/src/RTC/RTCP/FeedbackPsRemb.cpp b/worker/src/RTC/RTCP/FeedbackPsRemb.cpp index b4a470b95d..67a5a39658 100644 --- a/worker/src/RTC/RTCP/FeedbackPsRemb.cpp +++ b/worker/src/RTC/RTCP/FeedbackPsRemb.cpp @@ -18,10 +18,10 @@ namespace RTC // Check that there is space for the REMB unique identifier and basic fields. // NOTE: Feedback.cpp already checked that there is space for CommonHeader and - // Feedback Header. + // feedback header. if (len < Packet::CommonHeaderSize + FeedbackPacket::HeaderSize + 8u) { - MS_WARN_TAG(rtcp, "not enough space for Feedback packet, discarded"); + MS_WARN_TAG(rtcp, "not enough space for feedback packet, discarded"); return nullptr; } diff --git a/worker/src/RTC/RTCP/FeedbackRtp.cpp b/worker/src/RTC/RTCP/FeedbackRtp.cpp index 01b7c7fa9c..32af1a8fd8 100644 --- a/worker/src/RTC/RTCP/FeedbackRtp.cpp +++ b/worker/src/RTC/RTCP/FeedbackRtp.cpp @@ -21,7 +21,7 @@ namespace RTC if (len < Packet::CommonHeaderSize + FeedbackPacket::HeaderSize) { - MS_WARN_TAG(rtcp, "not enough space for Feedback packet, discarded"); + MS_WARN_TAG(rtcp, "not enough space for feedback packet, discarded"); return nullptr; } diff --git a/worker/src/RTC/RTCP/FeedbackRtpSrReq.cpp b/worker/src/RTC/RTCP/FeedbackRtpSrReq.cpp index f750e8293f..3c9085d47e 100644 --- a/worker/src/RTC/RTCP/FeedbackRtpSrReq.cpp +++ b/worker/src/RTC/RTCP/FeedbackRtpSrReq.cpp @@ -16,7 +16,7 @@ namespace RTC if (len < Packet::CommonHeaderSize + FeedbackPacket::HeaderSize) { - MS_WARN_TAG(rtcp, "not enough space for Feedback packet, discarded"); + MS_WARN_TAG(rtcp, "not enough space for feedback packet, discarded"); return nullptr; } diff --git a/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp b/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp index d81d7b6468..ae3c2db57b 100644 --- a/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp +++ b/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp @@ -35,7 +35,7 @@ namespace RTC if (len < Packet::CommonHeaderSize + FeedbackPacket::HeaderSize + FeedbackRtpTransportPacket::fixedHeaderSize) { - MS_WARN_TAG(rtcp, "not enough space for Feedback packet, discarded"); + MS_WARN_TAG(rtcp, "not enough space for feedback packet, discarded"); return nullptr; } diff --git a/worker/src/RTC/RTCP/Packet.cpp b/worker/src/RTC/RTCP/Packet.cpp index af5eba6963..77af32de5a 100644 --- a/worker/src/RTC/RTCP/Packet.cpp +++ b/worker/src/RTC/RTCP/Packet.cpp @@ -167,7 +167,7 @@ namespace RTC " " + FeedbackRtpPacket::MessageTypeToString(FeedbackRtp::MessageType(header->count)); } - MS_WARN_TAG(rtcp, "error parsing %s Packet", packetType.c_str()); + MS_WARN_TAG(rtcp, "error parsing %s packet", packetType.c_str()); return first; } diff --git a/worker/src/RTC/RTP/Packet.cpp b/worker/src/RTC/RTP/Packet.cpp index 78fd9bc034..2c6ae6fbce 100644 --- a/worker/src/RTC/RTP/Packet.cpp +++ b/worker/src/RTC/RTP/Packet.cpp @@ -49,7 +49,7 @@ namespace RTC if (!Packet::IsRtp(buffer, packetLength)) { - MS_WARN_TAG(rtp, "not a RTP Packet"); + MS_WARN_TAG(rtp, "not a RTP packet"); return nullptr; } @@ -73,7 +73,7 @@ namespace RTC if (!Packet::IsRtp(buffer, bufferLength)) { - MS_WARN_TAG(rtp, "not a RTP Packet"); + MS_WARN_TAG(rtp, "not a RTP packet"); return nullptr; } @@ -114,7 +114,7 @@ namespace RTC fixedHeader->ssrc = 0; // No need to invoke SetLength() since constructor invoked it with - // minimum Packet length. + // minimum packet length. return packet; } @@ -417,11 +417,11 @@ namespace RTC Serializable::CloneInto(clonedPacket); - // Clone Extension containers. + // Clone extension containers. clonedPacket->oneByteExtensions = this->oneByteExtensions; clonedPacket->twoBytesExtensions = this->twoBytesExtensions; - // Clone Extension ids. + // Clone extension ids. clonedPacket->headerExtensionIds = this->headerExtensionIds; // Assign the payload descriptor handler. @@ -527,7 +527,7 @@ namespace RTC return; } - // Clear One-Byte and Two-Bytes Extensions. + // Clear One-Byte and Two-Bytes extensions. std::fill(std::begin(this->oneByteExtensions), std::end(this->oneByteExtensions), -1); this->twoBytesExtensions.clear(); @@ -537,11 +537,11 @@ namespace RTC const auto payloadLength = GetPayloadLength(); const auto paddingLength = GetPaddingLength(); - // Update Packet length. + // Update packet length. // NOTE: This throws if given length is higher than buffer length. SetLength(GetLength() - headerExtensionLength); - // Unset the Header Extension flag. + // Unset the header extension flag. GetFixedHeaderPointer()->extension = 0; // Shift the payload. @@ -552,18 +552,18 @@ namespace RTC { MS_TRACE(); - // Clear One-Byte and Two-Bytes Extensions. + // Clear One-Byte and Two-Bytes extensions. std::fill(std::begin(this->oneByteExtensions), std::end(this->oneByteExtensions), -1); this->twoBytesExtensions.clear(); - // Reset Extension ids. + // Reset extension ids. this->headerExtensionIds = {}; const auto hadHeaderExtension = HasHeaderExtension(); const auto previousHeaderExtensionValueLength = GetHeaderExtensionValueLength(); // If no explicit ExtensionType is given then select the best one based - // on given Extensions. + // on given extensions. if (type == ExtensionsType::Auto) { uint8_t highestId{ 0 }; @@ -585,19 +585,19 @@ namespace RTC highestLen); } - // If One-Byte is requested and the Packet already has One-Byte Extensions, - // keep the Header Extension id. + // If One-Byte is requested and the packet already has One-Byte extensions, + // keep the header extension id. if (type == ExtensionsType::OneByte && HasOneByteExtensions()) { // Nothing to do. } - // If Two-Bytes is requested and the Packet already has Two-Bytes Extensions, - // keep the Header Extension id. + // If Two-Bytes is requested and the packet already has Two-Bytes extensions, + // keep the header extension id. else if (type == ExtensionsType::TwoBytes && HasTwoBytesExtensions()) { // Nothing to do. } - // Otherwise, if there is Header Extension of non matching type, modify its id. + // Otherwise, if there is header extension of non matching type, modify its id. else if (hadHeaderExtension) { if (type == ExtensionsType::OneByte) @@ -610,7 +610,7 @@ namespace RTC } } - // Calculate total length required for all Extensions (with padding if needed). + // Calculate total length required for all extensions (with padding if needed). size_t extensionsLength{ 0 }; if (type == ExtensionsType::OneByte) @@ -619,25 +619,25 @@ namespace RTC { if (extension.id == 0) { - MS_THROW_TYPE_ERROR("invalid Extension with id 0"); + MS_THROW_TYPE_ERROR("invalid extension with id 0"); } else if (extension.id > 14) { MS_THROW_TYPE_ERROR( - "invalid Extension with id %" PRIu8 " > 14 when using One-Byte Extensions", + "invalid extension with id %" PRIu8 " > 14 when using One-Byte extensions", extension.id); } else if (extension.len == 0) { MS_THROW_TYPE_ERROR( - "invalid Extension with id %" PRIu8 " and length 0 when using One-Byte Extensions", + "invalid extension with id %" PRIu8 " and length 0 when using One-Byte extensions", extension.id); } else if (extension.len > 16) { MS_THROW_TYPE_ERROR( - "invalid Extension with id %" PRIu8 " and length %" PRIu8 - " when using One-Byte Extensions", + "invalid extension with id %" PRIu8 " and length %" PRIu8 + " when using One-Byte extensions", extension.id, extension.len); } @@ -651,7 +651,7 @@ namespace RTC { if (extension.id == 0) { - MS_THROW_TYPE_ERROR("invalid Extension with id 0"); + MS_THROW_TYPE_ERROR("invalid extension with id 0"); } extensionsLength += (2 + extension.len); @@ -661,8 +661,8 @@ namespace RTC auto paddedExtensionsLength = Utils::Byte::PadTo4Bytes(extensionsLength); const size_t extensionsPaddingLength = paddedExtensionsLength - extensionsLength; - // Calculate the number of bytes to shift (may be negative if the Packet - // already had Header Extension). + // Calculate the number of bytes to shift (may be negative if the packet + // already had header extension). int16_t shift{ 0 }; if (hadHeaderExtension) @@ -680,11 +680,11 @@ namespace RTC if (hadHeaderExtension && shift != 0) { - // Update Packet length. + // Update packet length. // NOTE: This throws if given length is higher than buffer length. SetLength(GetLength() + shift); - // Update the Header Extension length. + // Update the header extension length. GetHeaderExtensionPointer()->len = htons(paddedExtensionsLength / 4); // Shift the payload. @@ -692,11 +692,11 @@ namespace RTC } else if (!hadHeaderExtension) { - // Update Packet length. + // Update packet length. // NOTE: This throws if given length is higher than buffer length. SetLength(GetLength() + shift); - // Set the Header Extension flag. + // Set the header extension flag. GetFixedHeaderPointer()->extension = 1; auto* headerExtension = GetHeaderExtensionPointer(); @@ -706,7 +706,7 @@ namespace RTC // override written bytes later. std::memmove(payload + shift, payload, payloadLength + paddingLength); - // Set the Header Extension id. + // Set the header extension id. if (type == ExtensionsType::OneByte) { headerExtension->id = htons(0xBEDE); @@ -716,7 +716,7 @@ namespace RTC headerExtension->id = htons(0b0001000000000000); } - // Set the Header Extension length. + // Set the header extension length. headerExtension->len = htons(paddedExtensionsLength / 4); } @@ -727,7 +727,7 @@ namespace RTC { for (const auto& extension : extensions) { - // Store the One-Byte Extension offset in the array. + // Store the One-Byte extension offset in the array. // `-1` because we have 14 elements total 0..13 and `id` is in the // range 1..14. this->oneByteExtensions[extension.id - 1] = ptr - extensionsStart; @@ -742,7 +742,7 @@ namespace RTC { for (const auto& extension : extensions) { - // Store the Two-Bytes Extension offset in the map. + // Store the Two-Bytes extension offset in the map. this->twoBytesExtensions[extension.id] = ptr - extensionsStart; *ptr = extension.id; @@ -760,7 +760,7 @@ namespace RTC ++ptr; } - // Assign Extension ids. + // Assign extension ids. for (const auto& extension : extensions) { switch (extension.type) @@ -844,7 +844,7 @@ namespace RTC { MS_TRACE(); - // Reset Extension ids. + // Reset extension ids. this->headerExtensionIds = headerExtensionIds; } @@ -1247,7 +1247,7 @@ namespace RTC const auto newLength = previousLength - previousPayloadLength - previousPaddingLength + payloadLength; - // Set the new Packet total length. + // Set the new packet total length. // NOTE: This throws if given length is higher than buffer length. SetLength(newLength); @@ -1270,7 +1270,7 @@ namespace RTC const auto newLength = previousLength - previousPayloadLength - previousPaddingLength + payloadLength; - // Set the new Packet total length. + // Set the new packet total length. // NOTE: This throws if given length is higher than buffer length. SetLength(newLength); @@ -1310,7 +1310,7 @@ namespace RTC if (delta > 0) { - // Update Packet length. + // Update packet length. // NOTE: This throws if given length is higher than buffer length. SetLength(GetLength() + delta); @@ -1319,7 +1319,7 @@ namespace RTC } else { - // Update Packet length. + // Update packet length. // NOTE: This throws if given length is higher than buffer length. SetLength(GetLength() - absDelta); @@ -1338,7 +1338,7 @@ namespace RTC const auto previousPaddingLength = GetPaddingLength(); const auto newLength = previousLength - previousPaddingLength + paddingLength; - // Set the new Packet total length. + // Set the new packet total length. // NOTE: This throws if given length is higher than buffer length. SetLength(newLength); @@ -1368,7 +1368,7 @@ namespace RTC return; } - // Set the new Packet total length. + // Set the new packet total length. // NOTE: This throws if given length is higher than buffer length. SetLength(newPaddedLength); @@ -1397,7 +1397,7 @@ namespace RTC SetPaddingLength(0); } - // Update Packet length. + // Update packet length. // NOTE: This throws if given length is higher than buffer length. SetLength(GetLength() + 2); @@ -1451,7 +1451,7 @@ namespace RTC SetPaddingLength(0); } - // Update Packet length. + // Update packet length. SetLength(GetLength() - 2); return true; @@ -1516,12 +1516,12 @@ namespace RTC { MS_TRACE(); - // Here we are at the beginning of the Packet. + // Here we are at the beginning of the packet. const auto* ptr = const_cast(GetBuffer()); if (GetVersion() != 2) { - MS_WARN_TAG(rtp, "invalid Packet, version must be 2"); + MS_WARN_TAG(rtp, "invalid packet, version must be 2"); return false; } @@ -1535,7 +1535,7 @@ namespace RTC if (GetLength() < static_cast(ptr - GetBuffer()) + csrcsLength) { - MS_WARN_TAG(rtp, "invalid Packet, not enough space for the announced CSRC list"); + MS_WARN_TAG(rtp, "invalid packet, not enough space for the announced CSRC list"); return false; } @@ -1543,13 +1543,13 @@ namespace RTC ptr += csrcsLength; } - // Here we are at the beginning of the optional Header Extension. + // Here we are at the beginning of the optional header extension. if (HasHeaderExtension()) { - // The Header Extension is at least 4 bytes. + // The header extension is at least 4 bytes. if (GetLength() < static_cast(ptr - GetBuffer()) + 4) { - MS_WARN_TAG(rtp, "invalid Packet, not enough space for the announced Header Extension"); + MS_WARN_TAG(rtp, "invalid packet, not enough space for the announced header extension"); return false; } @@ -1559,14 +1559,14 @@ namespace RTC if (GetLength() < static_cast(ptr - GetBuffer()) + headerExtensionLength) { MS_WARN_TAG( - rtp, "invalid Packet, not enough space for the announced Header Extension value"); + rtp, "invalid packet, not enough space for the announced header extension value"); return false; } if (!ParseExtensions(storeExtensions)) { - MS_WARN_TAG(rtp, "invalid Packet, invalid Extensions"); + MS_WARN_TAG(rtp, "invalid packet, invalid extensions"); return false; } @@ -1581,24 +1581,24 @@ namespace RTC if (payloadLength + paddingLength != availablePayloadAndPaddingLength) { - MS_WARN_TAG(rtp, "invalid Packet, not enough space for announced padding"); + MS_WARN_TAG(rtp, "invalid packet, not enough space for announced padding"); return false; } if (HasPadding() && paddingLength == 0) { - MS_WARN_TAG(rtp, "invalid Packet, padding byte cannot be 0"); + MS_WARN_TAG(rtp, "invalid packet, padding byte cannot be 0"); return false; } ptr += availablePayloadAndPaddingLength; - // Here we are at the end of the Packet. + // Here we are at the end of the packet. MS_ASSERT( static_cast(ptr - GetBuffer()) == GetLength(), - "Packet computed length does not match its assigned length"); + "packet computed length does not match its assigned length"); return true; } @@ -1613,12 +1613,12 @@ namespace RTC const uint8_t* extensionsEnd = extensionsStart + GetHeaderExtensionValueLength(); auto* ptr = const_cast(extensionsStart); - // One-Byte Extensions cannot have length 0. + // One-Byte extensions cannot have length 0. while (ptr < extensionsEnd) { const auto* extension = reinterpret_cast(ptr); const uint8_t id = extension->id; - // NOTE: In One-Byte Extensions, announced value must be incremented + // NOTE: In One-Byte extensions, announced value must be incremented // by 1. const size_t len = extension->len + 1; @@ -1632,14 +1632,14 @@ namespace RTC { break; } - // Valid Extension id. + // Valid extension id. else { if (ptr + 1 + len > extensionsEnd) { MS_WARN_TAG( rtp, - "not enough space for the announced value of the One-Byte Extension with id %" PRIu8, + "not enough space for the announced value of the One-Byte extension with id %" PRIu8, id); return false; @@ -1647,7 +1647,7 @@ namespace RTC if (storeExtensions) { - // Store the One-Byte Extension offset in the array. + // Store the One-Byte extension offset in the array. // `-1` because we have 14 elements total 0..13 and `id` is in the // range 1..14. this->oneByteExtensions[id - 1] = ptr - extensionsStart; @@ -1669,11 +1669,11 @@ namespace RTC { const uint8_t* extensionsStart = GetHeaderExtensionValue(); const uint8_t* extensionsEnd = extensionsStart + GetHeaderExtensionValueLength(); - // ptr points to the Extension id field (1 byte). + // ptr points to the extension id field (1 byte). // ptr+1 points to the length field (1 byte, can have value 0). auto* ptr = const_cast(extensionsStart); - // Two-Byte Extensions can have length 0. + // Two-Byte extensions can have length 0. while (ptr + 1 < extensionsEnd) { const auto* extension = reinterpret_cast(ptr); @@ -1685,14 +1685,14 @@ namespace RTC { ++ptr; } - // Valid Extension id. + // Valid extension id. else { if (ptr + 2 + len > extensionsEnd) { MS_WARN_TAG( rtp, - "not enough space for the announced value of the Two-Bytes Extension with id %" PRIu8, + "not enough space for the announced value of the Two-Bytes extension with id %" PRIu8, id); return false; @@ -1700,7 +1700,7 @@ namespace RTC if (storeExtensions) { - // Store the Two-Bytes Extension offset in the map. + // Store the Two-Bytes extension offset in the map. this->twoBytesExtensions[id] = ptr - extensionsStart; } @@ -1716,8 +1716,8 @@ namespace RTC return true; } - // If there is no Header Extension of if there is but it doesn't conform - // to RFC 8285 Extensions, then this is ok. + // If there is no header extension of if there is but it doesn't conform + // to RFC 8285 extensions, then this is ok. else { return true; @@ -1740,7 +1740,7 @@ namespace RTC auto* extension = reinterpret_cast(GetHeaderExtensionValue() + offset); - // In One-Byte Extensions value length 0 means 1. + // In One-Byte extensions value length 0 means 1. const auto currentLen = extension->len + 1; // Fill with 0's if new length is minor. diff --git a/worker/src/RTC/RTP/ProbationGenerator.cpp b/worker/src/RTC/RTP/ProbationGenerator.cpp index 7aaeb4ee90..6264975efa 100644 --- a/worker/src/RTC/RTP/ProbationGenerator.cpp +++ b/worker/src/RTC/RTP/ProbationGenerator.cpp @@ -37,7 +37,7 @@ namespace RTC mustInitializePayload = false; } - // Create the probation RTP Packet. + // Create the probation RTP packet. this->probationPacket.reset( RTP::Packet::Factory(ProbationPacketBuffer, sizeof(ProbationPacketBuffer))); @@ -102,7 +102,7 @@ namespace RTC // bufferPtr += extenLen; } - // Set the extensions into the Packet using One-Byte format. + // Set the extensions into the packet using One-Byte format. this->probationPacket->SetExtensions(RTP::Packet::ExtensionsType::OneByte, extensions); this->probationPacketMinLength = this->probationPacket->GetLength(); @@ -125,7 +125,7 @@ namespace RTC // Pad given length to 4 bytes. len = Utils::Byte::PadTo4Bytes(len); - // Make the Packet length fit into our available limits. + // Make the packet length fit into our available limits. if (len > ProbationGenerator::ProbationPacketMaxLength) { len = ProbationGenerator::ProbationPacketMaxLength; diff --git a/worker/src/RTC/RTP/RtpStreamRecv.cpp b/worker/src/RTC/RTP/RtpStreamRecv.cpp index b3ffe7b9f0..df3f233dd2 100644 --- a/worker/src/RTC/RTP/RtpStreamRecv.cpp +++ b/worker/src/RTC/RTP/RtpStreamRecv.cpp @@ -296,7 +296,7 @@ namespace RTC } } - // Calculate Jitter. + // Calculate jitter. CalculateJitter(packet->GetTimestamp()); // Increase transmission counter. @@ -472,7 +472,7 @@ namespace RTC const int32_t prevPacketsLost = this->packetsLost; - // Calculate Packets Expected and Lost. + // Calculate packets expected and lost. auto expected = GetExpectedPackets(); if (expected > this->mediaTransmissionCounter.GetPacketCount()) @@ -484,7 +484,7 @@ namespace RTC this->packetsLost = 0; } - // Calculate Fraction Lost. + // Calculate fraction lost. const uint32_t expectedInterval = expected - this->expectedPrior; this->expectedPrior = expected; diff --git a/worker/src/RTC/RTP/RtxStream.cpp b/worker/src/RTC/RTP/RtxStream.cpp index fe617fb078..be09b884ef 100644 --- a/worker/src/RTC/RTP/RtxStream.cpp +++ b/worker/src/RTC/RTP/RtxStream.cpp @@ -95,7 +95,7 @@ namespace RTC const int32_t prevPacketsLost = this->packetsLost; - // Calculate Packets Expected and Lost. + // Calculate packets xxpected and lost. auto expected = GetExpectedPackets(); if (expected > this->packetsCount) @@ -107,7 +107,7 @@ namespace RTC this->packetsLost = 0u; } - // Calculate Fraction Lost. + // Calculate fraction lost. const uint32_t expectedInterval = expected - this->expectedPrior; this->expectedPrior = expected; diff --git a/worker/src/RTC/RTP/SharedPacket.cpp b/worker/src/RTC/RTP/SharedPacket.cpp index ed3ed7c32b..6b3960362a 100644 --- a/worker/src/RTC/RTP/SharedPacket.cpp +++ b/worker/src/RTC/RTP/SharedPacket.cpp @@ -13,10 +13,10 @@ namespace RTC /* Static. */ // When cloning a RTP packet, a buffer is allocated for it and its length is - // the length of the Packet plus this value (in bytes). + // the length of the packet plus this value (in bytes). static constexpr size_t PacketBufferLengthIncrement{ 100 }; - // Callback to pass to every cloned RTP Packet to deallocate its buffer once - // the Packet releases its buffer (for example when the Packet is destroyed). + // Callback to pass to every cloned RTP packet to deallocate its buffer once + // the packet releases its buffer (for example when the packet is destroyed). static thread_local Serializable::BufferReleasedListener PacketBufferReleasedListener = // NOLINTNEXTLINE(misc-unused-parameters, readability-non-const-parameter) [](const Serializable* packet, uint8_t* buffer) @@ -156,7 +156,7 @@ namespace RTC auto* buffer = static_cast(::operator new[](bufferLength, std::align_val_t{ 4 })); auto* clonedPacket = packet->Clone(buffer, bufferLength); - // Set a listener in the Packet to deallocate its buffer once the Packet + // Set a listener in the packet to deallocate its buffer once the packet // is destroyed or releases its internal buffer. clonedPacket->SetBufferReleasedListener(std::addressof(PacketBufferReleasedListener)); diff --git a/worker/src/RTC/Router.cpp b/worker/src/RTC/Router.cpp index ca9b3ce207..a45ddae550 100644 --- a/worker/src/RTC/Router.cpp +++ b/worker/src/RTC/Router.cpp @@ -955,7 +955,7 @@ namespace RTC if (numDataConsumers == 1) { - // We must update the Message`s `streamId` for each destination + // We must update the message`s `streamId` for each destination // DataConsumer. // NOTE: clang-tidy doesn't understand that we are only doing this // once in the original `message`. @@ -964,14 +964,14 @@ namespace RTC dataConsumer->SendMessage(std::move(message), subchannels, requiredSubchannel); } - // NOTE: Here we are cloning the Message before passing it to each + // NOTE: Here we are cloning the message before passing it to each // DataConsumer because each DataConsumer will pass std::move(message) - // internally to its SCTP Association. + // internally to its SCTP association. else { auto clonedMessage = message.Clone(); - // We must update the Message`s `streamId` for each destination + // We must update the message`s `streamId` for each destination // DataConsumer. clonedMessage.SetStreamId(streamId); diff --git a/worker/src/RTC/SCTP/association/Association.cpp b/worker/src/RTC/SCTP/association/Association.cpp index 7901c7adc6..d2453fee63 100644 --- a/worker/src/RTC/SCTP/association/Association.cpp +++ b/worker/src/RTC/SCTP/association/Association.cpp @@ -186,7 +186,7 @@ namespace RTC // SCTP state will no longer be "NEW". if (this->state != State::NEW) { - MS_DEBUG_DEV("internal Association state is not NEW, ignoring"); + MS_DEBUG_DEV("internal association state is not NEW, ignoring"); return; } @@ -210,7 +210,7 @@ namespace RTC { MS_TRACE(); - // NOTE: We only accept NEW state here so once the Association is closed + // NOTE: We only accept NEW state here so once the association is closed // it cannot be reused. However there is no real technical reason for it. if (this->state != State::NEW) { @@ -218,7 +218,7 @@ namespace RTC MS_WARN_TAG( sctp, - "cannot initiate the Association since internal state is not NEW but %.*s", + "cannot initiate the association since internal state is not NEW but %.*s", static_cast(stateStringView.size()), stateStringView.data()); @@ -264,7 +264,7 @@ namespace RTC if (this->tcb) { // TODO: dcsctp: Remove this check, as it just hides the problem that the - // Association can transition from ShutdownSent to ShutdownPending, or + // association can transition from ShutdownSent to ShutdownPending, or // from ShutdownAckSent to ShutdownPending, which is illegal. // // @see https://issues.webrtc.org/issues/42222897 @@ -282,7 +282,7 @@ namespace RTC } // Association closed before even starting to connect, or during the // initial connection phase. There is no outstanding data, so the - // Association can just be closed (stopping any timers, if any), as this + // association can just be closed (stopping any timers, if any), as this // is the application's intention when calling Shutdown(). else { @@ -311,7 +311,7 @@ namespace RTC auto* abortAssociationChunk = packet->BuildChunkInPlace(); // NOTE: Don't set bit T in the ABORT chunk since TCB knows the - // Verification Tag expected by the remote. + // verification tag expected by the remote. auto* userInitiatedAbortErrorCause = abortAssociationChunk->BuildErrorCauseInPlace(); @@ -565,7 +565,7 @@ namespace RTC if (!ValidateReceivedPacket(receivedPacket.get())) { - MS_WARN_TAG(sctp, "Packet verification failed, discarded"); + MS_WARN_TAG(sctp, "packet verification failed, discarded"); return; } @@ -670,7 +670,7 @@ namespace RTC if (state == this->state) { MS_WARN_DEV( - "SCTP Association internal state is already %.*s (message:\"%.*s\")", + "SCTP association internal state is already %.*s (message:\"%.*s\")", static_cast(stateStringView.size()), stateStringView.data(), static_cast(message.size()), @@ -683,7 +683,7 @@ namespace RTC MS_DEBUG_TAG( sctp, - "SCTP Association internal state changed from %.*s to %.*s (message:\"%.*s\")", + "SCTP association internal state changed from %.*s to %.*s (message:\"%.*s\")", static_cast(previousStateStringView.size()), previousStateStringView.data(), static_cast(stateStringView.size()), @@ -804,7 +804,7 @@ namespace RTC auto packet = CreatePacket(); - // Insert an INIT Chunk in the Packet. + // Insert an INIT chunk in the packet. auto* initChunk = packet->BuildChunkInPlace(); initChunk->SetInitiateTag(this->preTcb.localVerificationTag); @@ -813,7 +813,7 @@ namespace RTC initChunk->SetNumberOfInboundStreams(this->sctpOptions.announcedMaxInboundStreams); initChunk->SetInitialTsn(this->preTcb.localInitialTsn); - // Insert capabilities related Parameters in the INIT Chunk. + // Insert capabilities related parameters in the INIT chunk. AddCapabilitiesParametersToInitOrInitAckChunk(initChunk); initChunk->Consolidate(); @@ -1065,11 +1065,11 @@ namespace RTC { MS_WARN_TAG( sctp, - "Packet with Verification Tag 0 must have a single Chunk and it must be an INIT Chunk, packet discarded"); + "packet with verification tag 0 must have a single chunk and it must be an INIT chunk, packet discarded"); this->associationListenerDeferrer.OnAssociationError( Types::ErrorKind::PARSE_FAILED, - "packet with Verification Tag 0 must have a single chunk and it must be an INIT chunk"); + "packet with verification tag 0 must have a single chunk and it must be an INIT chunk"); return false; } @@ -1087,7 +1087,7 @@ namespace RTC const auto* abortAssociationChunk = static_cast(receivedPacket->GetChunkAt(0)); - // We cannot verify the Verification Tag so assume it's okey. + // We cannot verify the verification tag so assume it's okey. if (abortAssociationChunk->GetT() && !this->tcb) { return true; @@ -1104,11 +1104,11 @@ namespace RTC { MS_WARN_TAG( sctp, - "ABORT Chunk Verification Tag %" PRIu32 " is wrong, packet discarded", + "ABORT chunk verification tag %" PRIu32 " is wrong, packet discarded", receivedPacket->GetVerificationTag()); this->associationListenerDeferrer.OnAssociationError( - Types::ErrorKind::PARSE_FAILED, "packet with ABORT chunk has invalid Verification Tag"); + Types::ErrorKind::PARSE_FAILED, "packet with ABORT chunk has invalid verification tag"); return false; } @@ -1124,13 +1124,13 @@ namespace RTC { MS_WARN_TAG( sctp, - "INIT_ACK Chunk Verification Tag %" PRIu32 " (should be %" PRIu32 ")", + "INIT-ACK chunk verification tag %" PRIu32 " (should be %" PRIu32 ")", receivedPacket->GetVerificationTag(), this->preTcb.localVerificationTag); this->associationListenerDeferrer.OnAssociationError( Types::ErrorKind::PARSE_FAILED, - "packet with INIT_ACK chunk has invalid Verification Tag"); + "packet with INIT-ACK chunk has invalid verification tag"); return false; } @@ -1156,7 +1156,7 @@ namespace RTC const auto* shutdownCompleteChunk = static_cast(receivedPacket->GetChunkAt(0)); - // We cannot verify the Verification Tag so assume it's okey. + // We cannot verify the verification tag so assume it's okey. if (shutdownCompleteChunk->GetT() && !this->tcb) { return true; @@ -1173,12 +1173,12 @@ namespace RTC { MS_WARN_TAG( sctp, - "SHUTDOWN_COMPLETE Chunk Verification Tag %" PRIu32 " is wrong, packet discarded", + "SHUTDOWN-COMPLETE chunk verification tag %" PRIu32 " is wrong, packet discarded", receivedPacket->GetVerificationTag()); this->associationListenerDeferrer.OnAssociationError( Types::ErrorKind::PARSE_FAILED, - "packet with SHUTDOWN_COMPLETE chunk has invalid Verification Tag"); + "packet with SHUTDOWN-COMPLETE chunk has invalid verification tag"); return false; } @@ -1200,12 +1200,12 @@ namespace RTC { MS_WARN_TAG( sctp, - "invalid Verification Tag %" PRIu32 " (should be %" PRIu32 ")", + "invalid verification tag %" PRIu32 " (should be %" PRIu32 ")", receivedPacket->GetVerificationTag(), localVerificationTag); this->associationListenerDeferrer.OnAssociationError( - Types::ErrorKind::PARSE_FAILED, "packet has invalid Verification Tag"); + Types::ErrorKind::PARSE_FAILED, "packet has invalid verification tag"); return false; } @@ -1369,7 +1369,7 @@ namespace RTC // be 0, the receiver MUST silently discard the packet." if (receivedInitChunk->GetInitiateTag() == 0) { - MS_WARN_TAG(sctp, "invalid value 0 in Initiate Tagin received INIT Chunk, discarded"); + MS_WARN_TAG(sctp, "invalid value 0 in Initiate Tagin received INIT chunk, discarded"); return; } @@ -1388,12 +1388,12 @@ namespace RTC { MS_WARN_TAG( sctp, - "invalidNumber of Outbound Streams or Number of Inbound Streams in received INIT Chunk, aborting Association"); + "invalid number of outbound streams or Number of inbound streams in received INIT chunk, aborting association"); auto packet = CreatePacketWithVerificationTag(0); auto* abortAssociationChunk = packet->BuildChunkInPlace(); - // NOTE: We are not setting the Verification Tag expected by the peer + // NOTE: We are not setting the verification tag expected by the peer // so must set be T to 1. abortAssociationChunk->SetT(true); @@ -1401,7 +1401,7 @@ namespace RTC abortAssociationChunk->BuildErrorCauseInPlace(); protocolViolationErrorCause->SetAdditionalInformation( - "invalid value 0 in Number of Outbound Streams or Number of Inbound Streams in received INIT chunk"); + "invalid value 0 in number of outbound streams or number of inbound streams in received INIT chunk"); protocolViolationErrorCause->Consolidate(); abortAssociationChunk->Consolidate(); @@ -1423,7 +1423,7 @@ namespace RTC if (this->state == State::SHUTDOWN_ACK_SENT) { MS_DEBUG_TAG( - sctp, "INIT Chunk received in SHUTDOWN_ACK_SENT state, retransmitting SHUTDOWN_ACK Chunk"); + sctp, "INIT chunk received in SHUTDOWN_ACK_SENT state, retransmitting SHUTDOWN-ACK chunk"); SendShutdownAckChunk(); @@ -1438,7 +1438,7 @@ namespace RTC { case State::NEW: { - MS_DEBUG_TAG(sctp, "INIT Chunk received in NEW state (normal scenario)"); + MS_DEBUG_TAG(sctp, "INIT chunk received in NEW state (normal scenario)"); localVerificationTag = Utils::Crypto::GetRandomUInt(MinVerificationTag, MaxVerificationTag); @@ -1449,7 +1449,7 @@ namespace RTC case State::CLOSED: { - MS_WARN_TAG(sctp, "ignoring INIT Chunk received in CLOSED state)"); + MS_WARN_TAG(sctp, "ignoring INIT chunk received in CLOSED state)"); } // https://datatracker.ietf.org/doc/html/rfc9260#section-5.2.1 @@ -1463,7 +1463,7 @@ namespace RTC case State::COOKIE_WAIT: case State::COOKIE_ECHOED: { - MS_DEBUG_TAG(sctp, "INIT Chunk received after sending INIT Chunk (collision, no problem)"); + MS_DEBUG_TAG(sctp, "INIT chunk received after sending INIT chunk (collision, no problem)"); localVerificationTag = this->preTcb.localVerificationTag; localInitialTsn = this->preTcb.localInitialTsn; @@ -1484,7 +1484,7 @@ namespace RTC { AssertHasTcb(); - MS_DEBUG_TAG(sctp, "INIT Chunk received (probably peer restarted)"); + MS_DEBUG_TAG(sctp, "INIT chunk received (probably peer restarted)"); localVerificationTag = Utils::Crypto::GetRandomUInt(MinVerificationTag, MaxVerificationTag); @@ -1496,18 +1496,18 @@ namespace RTC MS_DEBUG_TAG( sctp, - "initiating Association [localVerificationTag:%" PRIu32 ", localInitialTsn:%" PRIu32 + "initiating association [localVerificationTag:%" PRIu32 ", localInitialTsn:%" PRIu32 ", remoteVerificationTag:%" PRIu32 ", remoteInitialTsn:%" PRIu32 "]", localVerificationTag, localInitialTsn, receivedInitChunk->GetInitiateTag(), receivedInitChunk->GetInitialTsn()); - /* Send a Packet with an INIT_ACK Chunk. */ + /* Send a packet with an INIT-ACK chunk. */ auto packet = CreatePacketWithVerificationTag(receivedInitChunk->GetInitiateTag()); - // Insert an INIT_ACK Chunk in the Packet. + // Insert an INIT-ACK chunk in the packet. auto* initAckChunk = packet->BuildChunkInPlace(); initAckChunk->SetInitiateTag(localVerificationTag); @@ -1516,13 +1516,13 @@ namespace RTC initAckChunk->SetNumberOfInboundStreams(this->sctpOptions.announcedMaxInboundStreams); initAckChunk->SetInitialTsn(localInitialTsn); - // Insert a StateCookieParameter in the INIT_ACK Chunk. + // Insert a StateCookieParameter in the INIT-ACK chunk. auto* stateCookieParameter = initAckChunk->BuildParameterInPlace(); const auto negotiatedCapabilities = NegotiatedCapabilities::Factory(this->sctpOptions, receivedInitChunk); - // Write the StateCookie in place in the Parameter. + // Write the StateCookie in place in the parameter. stateCookieParameter->WriteStateCookieInPlace( localVerificationTag, receivedInitChunk->GetInitiateTag(), @@ -1534,7 +1534,7 @@ namespace RTC stateCookieParameter->Consolidate(); - // Insert capabilities related Parameters in the INIT_ACK Chunk. + // Insert capabilities related parameters in the INIT-ACK chunk. AddCapabilitiesParametersToInitOrInitAckChunk(initAckChunk); initAckChunk->Consolidate(); @@ -1557,7 +1557,7 @@ namespace RTC // INIT ACK chunk." if (this->state != State::COOKIE_WAIT) { - MS_DEBUG_TAG(sctp, "ignoring received INIT_ACK Chunk when not in COOKIE_WAIT state"); + MS_DEBUG_TAG(sctp, "ignoring received INIT-ACK chunk when not in COOKIE_WAIT state"); return; } @@ -1568,12 +1568,12 @@ namespace RTC if (!stateCookieParameter || !stateCookieParameter->GetCookie()) { MS_WARN_TAG( - sctp, "ignoring received INIT_ACK Chunk without StateCookieParameter or without Cookie"); + sctp, "ignoring received INIT-ACK chunk without StateCookieParameter or without cookie"); auto packet = CreatePacketWithVerificationTag(this->preTcb.localVerificationTag); auto* abortAssociationChunk = packet->BuildChunkInPlace(); - // NOTE: We are not setting the Verification Tag expected by the peer + // NOTE: We are not setting the verification tag expected by the peer // so must set be T to 1. abortAssociationChunk->SetT(true); @@ -1581,7 +1581,7 @@ namespace RTC abortAssociationChunk->BuildErrorCauseInPlace(); protocolViolationErrorCause->SetAdditionalInformation( - "INIT_ACK without State Cookie Parameter or without Cookie"); + "INIT-ACK without State Cookie parameter or without cookie"); protocolViolationErrorCause->Consolidate(); abortAssociationChunk->Consolidate(); @@ -1589,7 +1589,7 @@ namespace RTC this->packetSender.SendPacket(packet.get()); InternalClose( - Types::ErrorKind::PROTOCOL_VIOLATION, "received INIT_ACK chunk doesn't contain a Cookie"); + Types::ErrorKind::PROTOCOL_VIOLATION, "received INIT-ACK chunk doesn't contain a cookie"); return; } @@ -1602,10 +1602,10 @@ namespace RTC const auto negotiatedCapabilities = NegotiatedCapabilities::Factory(this->sctpOptions, receivedInitAckChunk); - // If the Association is re-established (peer restarted, but re-used old - // Association), make sure that all message identifiers are reset and any + // If the association is re-established (peer restarted, but re-used old + // association), make sure that all message identifiers are reset and any // partly sent message is re-sent in full. The same is true when the - // Association is closed and later re-opened, which never happens in + // association is closed and later re-opened, which never happens in // WebRTC, but is a valid operation on the SCTP level. this->sendQueue.Reset(); @@ -1618,9 +1618,9 @@ namespace RTC /*tieTag*/ Utils::Crypto::GetRandomUInt(0, MaxTieTag), negotiatedCapabilities); - SetState(State::COOKIE_ECHOED, "INIT_ACK received"); + SetState(State::COOKIE_ECHOED, "INIT-ACK received"); - // The Association isn't fully established just yet. Store the stat + // The association isn't fully established just yet. Store the stat // cookie in the TCB. std::vector remoteStateCookie( stateCookieParameter->GetCookie(), @@ -1643,10 +1643,10 @@ namespace RTC if (!receivedCookieEchoChunk->HasCookie()) { - MS_WARN_TAG(sctp, "ignoring received COOKIE_ECHO Chunk without Cookie"); + MS_WARN_TAG(sctp, "ignoring received COOKIE-ECHO chunk without cookie"); this->associationListenerDeferrer.OnAssociationError( - Types::ErrorKind::PARSE_FAILED, "received COOKIE_ECHO Chunk without Cookie"); + Types::ErrorKind::PARSE_FAILED, "received COOKIE-ECHO chunk without cookie"); return; } @@ -1656,10 +1656,10 @@ namespace RTC if (!cookie) { - MS_WARN_TAG(sctp, "failed to parse Cookie in received COOKIE_ECHO Chunk"); + MS_WARN_TAG(sctp, "failed to parse cookie in received COOKIE-ECHO chunk"); this->associationListenerDeferrer.OnAssociationError( - Types::ErrorKind::PARSE_FAILED, "received COOKIE_ECHO Chunk with invalid Cookie"); + Types::ErrorKind::PARSE_FAILED, "received COOKIE-ECHO chunk with invalid cookie"); return; } @@ -1675,11 +1675,11 @@ namespace RTC { if (receivedPacket->GetVerificationTag() != cookie->GetLocalVerificationTag()) { - MS_WARN_TAG(sctp, "received COOKIE_ECHO Chunk with invalid Verification Tag"); + MS_WARN_TAG(sctp, "received COOKIE-ECHO chunk with invalid verification tag"); this->associationListenerDeferrer.OnAssociationError( Types::ErrorKind::PARSE_FAILED, - "received COOKIE_ECHO Chunk with invalid Verification Tag"); + "received COOKIE-ECHO chunk with invalid verification tag"); return; } @@ -1695,17 +1695,17 @@ namespace RTC this->tcb->ClearRemoteStateCookie(); } - SetState(State::ESTABLISHED, "COOKIE_ECHO received"); + SetState(State::ESTABLISHED, "COOKIE-ECHO received"); this->associationListenerDeferrer.OnAssociationConnected(); } if (!this->tcb) { - // If the Association is re-established (peer restarted, but re-used old - // Association), make sure that all message identifiers are reset and any + // If the association is re-established (peer restarted, but re-used old + // association), make sure that all message identifiers are reset and any // partly sent message is re-sent in full. The same is true when the - // Association is closed and later re-opened, which never happens in + // association is closed and later re-opened, which never happens in // WebRTC, but is a valid operation on the SCTP level. this->sendQueue.Reset(); @@ -1734,7 +1734,7 @@ namespace RTC { MS_TRACE(); - MS_DEBUG_DEV("handling COOKIE_ECHO with TCB"); + MS_DEBUG_DEV("handling COOKIE-ECHO with TCB"); AssertHasTcb(); @@ -1769,12 +1769,12 @@ namespace RTC this->packetSender.SendPacket(packet.get()); this->associationListenerDeferrer.OnAssociationError( - Types::ErrorKind::WRONG_SEQUENCE, "received COOKIE_ECHO while shutting down"); + Types::ErrorKind::WRONG_SEQUENCE, "received COOKIE-ECHO while shutting down"); return false; } - MS_DEBUG_DEV("received COOKIE_ECHO indicating a restarted peer"); + MS_DEBUG_DEV("received COOKIE-ECHO indicating a restarted peer"); this->tcb = nullptr; this->associationListenerDeferrer.OnAssociationRestarted(); @@ -1786,9 +1786,9 @@ namespace RTC receivedPacket->GetVerificationTag() == this->tcb->GetLocalVerificationTag() && cookie->GetRemoteVerificationTag() != this->tcb->GetRemoteVerificationTag()) { - // TODO: dcsctp: Handle the case in which remote Verification Tag is 0? + // TODO: dcsctp: Handle the case in which remote verification tag is 0? - MS_DEBUG_DEV("received COOKIE_ECHO indicating simultaneous associations"); + MS_DEBUG_DEV("received COOKIE-ECHO indicating simultaneous associations"); this->tcb = nullptr; } @@ -1802,7 +1802,7 @@ namespace RTC cookie->GetRemoteVerificationTag() == this->tcb->GetRemoteVerificationTag() && cookie->GetTieTag() == this->tcb->GetTieTag()) { - MS_DEBUG_DEV("received COOKIE_ECHO indicating a late COOKIE_ECHO, discarding"); + MS_DEBUG_DEV("received COOKIE-ECHO indicating a late COOKIE-ECHO, discarding"); return false; } @@ -1814,7 +1814,7 @@ namespace RTC cookie->GetRemoteVerificationTag() == this->tcb->GetRemoteVerificationTag()) { MS_DEBUG_DEV( - "received duplicate COOKIE_ECHO, probably because of peer not receiving COOKIE_ACK and retransmitting COOKIE_ECHO"); + "received duplicate COOKIE-ECHO, probably because of peer not receiving COOKIE-ACK and retransmitting COOKIE-ECHO"); } return true; @@ -1831,7 +1831,7 @@ namespace RTC // discard a received COOKIE ACK chunk." if (this->state != State::COOKIE_ECHOED) { - MS_DEBUG_DEV("received COOKIE_ACK not in COOKIE_ECHOED state, discarding"); + MS_DEBUG_DEV("received COOKIE-ACK not in COOKIE_ECHOED state, discarding"); return; } @@ -1841,7 +1841,7 @@ namespace RTC this->t1CookieTimer->Stop(); this->tcb->ClearRemoteStateCookie(); - SetState(State::ESTABLISHED, "COOKIE_ACK received"); + SetState(State::ESTABLISHED, "COOKIE-ACK received"); const uint64_t nowMs = this->shared->GetTimeMs(); @@ -1910,7 +1910,7 @@ namespace RTC // SHUTDOWN chunk sender." default: { - MS_DEBUG_DEV("received SHUTDOWN, shutting down the Association"); + MS_DEBUG_DEV("received SHUTDOWN, shutting down the association"); SetState(State::SHUTDOWN_RECEIVED, "SHUTDOWN received"); MaySendShutdownOrShutdownAckChunk(); @@ -1937,8 +1937,8 @@ namespace RTC auto packet = this->tcb->CreatePacket(); const auto* shutdownCompleteChunk = packet->BuildChunkInPlace(); - // NOTE: Don't set bit T in the SHUTDOWN_COMPLETE chunk since TCB - // knows the Verification Tag expected by the remote. + // NOTE: Don't set bit T in the SHUTDOWN-COMPLETE chunk since TCB + // knows the verification tag expected by the remote. shutdownCompleteChunk->Consolidate(); @@ -2024,13 +2024,13 @@ namespace RTC { MS_DEBUG_TAG( sctp, - "received OPERATION_ERROR Chunk on a Association with no TCB, ignoring: %s", + "received OPERATION-ERROR chunk on a association with no TCB, ignoring: %s", errorCausesStr.c_str()); return; } - MS_WARN_TAG(sctp, "received OPERATION_ERROR Chunk: %s", errorCausesStr.c_str()); + MS_WARN_TAG(sctp, "received OPERATION-ERROR chunk: %s", errorCausesStr.c_str()); this->associationListenerDeferrer.OnAssociationError( Types::ErrorKind::PEER_REPORTED, errorCausesStr); @@ -2063,13 +2063,13 @@ namespace RTC { MS_DEBUG_TAG( sctp, - "received ABORT Chunk on a Association with no TCB, ignoring: %s", + "received ABORT chunk on a association with no TCB, ignoring: %s", errorCausesStr.c_str()); return; } - MS_WARN_TAG(sctp, "received ABORT Chunk, closing Association: %s", errorCausesStr.c_str()); + MS_WARN_TAG(sctp, "received ABORT chunk, closing association: %s", errorCausesStr.c_str()); InternalClose(Types::ErrorKind::PEER_REPORTED, errorCausesStr); } @@ -2120,7 +2120,7 @@ namespace RTC MaySendResetStreamsRequest(); // If a response was processed, pending to-be-reset streams may now have - // become unpaused. Try to send more DATA/I_DATA chunks. + // become unpaused. Try to send more DATA/I-DATA chunks. const uint64_t nowMs = this->shared->GetTimeMs(); this->tcb->SendBufferedPackets(nowMs); @@ -2162,7 +2162,7 @@ namespace RTC auto* abortAssociationChunk = packet->BuildChunkInPlace(); // NOTE: Don't set bit T in the ABORT chunk since TCB knows the - // Verification Tag expected by the remote. + // verification tag expected by the remote. auto* protocolViolationErrorCause = abortAssociationChunk->BuildErrorCauseInPlace(); @@ -2263,7 +2263,7 @@ namespace RTC // If the reassembly queue is full and there's no messages waiting, // there is nothing that can be done. The specification only allows // dropping gap-ack-blocks, and that's not likely to help as the - // Association has been trying to fill gaps since the watermark was + // association has been trying to fill gaps since the watermark was // reached. else { @@ -2271,7 +2271,7 @@ namespace RTC auto* abortAssociationChunk = packet->BuildChunkInPlace(); // NOTE: Don't set bit T in the ABORT chunk since TCB knows the - // Verification Tag expected by the remote. + // verification tag expected by the remote. auto* outOfResourceErrorCause = abortAssociationChunk->BuildErrorCauseInPlace(); @@ -2338,7 +2338,7 @@ namespace RTC { MaySendShutdownOrShutdownAckChunk(); - // Receiving an ACK may make the Association go into fast recovery mode. + // Receiving an ACK may make the association go into fast recovery mode. // // https://datatracker.ietf.org/doc/html/rfc9260#section-7.2.4 // @@ -2379,15 +2379,15 @@ namespace RTC { MS_WARN_TAG( sctp, - "Chunk with unknown type %" PRIu8 - " received, skipping further processing of Chunks in the Packet", + "chunk with unknown type %" PRIu8 + " received, skipping further processing of chunks in the packet", static_cast(receivedUnknownChunk->GetType())); } else { MS_DEBUG_TAG( sctp, - "ignoring received Chunk with unknown type %" PRIu8, + "ignoring received chunk with unknown type %" PRIu8, static_cast(receivedUnknownChunk->GetType())); } @@ -2397,7 +2397,7 @@ namespace RTC Types::ErrorKind::PARSE_FAILED, "unknown chunk with type indicating it should be reported"); // If there is TCB (we need correct remote verification tag) send an - // OPERATION_ERROR Chunk with a Unrecognized Chunk Type Error Cause. + // OPERATION-ERROR chunk with a Unrecognized Chunk type error cause. if (this->tcb) { auto packet = this->tcb->CreatePacket(); @@ -2432,7 +2432,7 @@ namespace RTC } else { - InternalClose(Types::ErrorKind::TOO_MANY_RETRIES, "no INIT_ACK chunk received"); + InternalClose(Types::ErrorKind::TOO_MANY_RETRIES, "no INIT-ACK chunk received"); } AssertIsConsistent(); @@ -2454,7 +2454,7 @@ namespace RTC } else { - InternalClose(Types::ErrorKind::TOO_MANY_RETRIES, "no COOKIE_ACK chunk received"); + InternalClose(Types::ErrorKind::TOO_MANY_RETRIES, "no COOKIE-ACK chunk received"); } AssertIsConsistent(); @@ -2482,7 +2482,7 @@ namespace RTC auto* abortAssociationChunk = packet->BuildChunkInPlace(); // NOTE: Don't set bit T in the ABORT chunk since TCB knows the - // Verification Tag expected by the remote. + // verification tag expected by the remote. auto* userInitiatedAbortErrorCause = abortAssociationChunk->BuildErrorCauseInPlace(); @@ -2495,7 +2495,7 @@ namespace RTC this->packetSender.SendPacket(packet.get()); - InternalClose(Types::ErrorKind::TOO_MANY_RETRIES, "no SHUTDOWN_ACK chunk received"); + InternalClose(Types::ErrorKind::TOO_MANY_RETRIES, "no SHUTDOWN-ACK chunk received"); AssertIsConsistent(); @@ -2640,7 +2640,7 @@ namespace RTC !this->t1InitTimer->IsRunning(), "internal state is NEW but T1 Init timer is running"); MS_ASSERT( !this->t1CookieTimer->IsRunning(), - "internal state is NEW but T1 Cookie timer is running"); + "internal state is NEW but T1 cookie timer is running"); MS_ASSERT( !this->t2ShutdownTimer->IsRunning(), "internal state is NEW but T2 Shutdown timer is running"); @@ -2655,7 +2655,7 @@ namespace RTC !this->t1InitTimer->IsRunning(), "internal state is CLOSED but T1 Init timer is running"); MS_ASSERT( !this->t1CookieTimer->IsRunning(), - "internal state is CLOSED but T1 Cookie timer is running"); + "internal state is CLOSED but T1 cookie timer is running"); MS_ASSERT( !this->t2ShutdownTimer->IsRunning(), "internal state is CLOSED but T2 Shutdown timer is running"); @@ -2671,7 +2671,7 @@ namespace RTC "internal state is COOKIE_WAIT but T1 Init timer is not running"); MS_ASSERT( !this->t1CookieTimer->IsRunning(), - "internal state is COOKIE_WAIT but T1 Cookie timer is running"); + "internal state is COOKIE_WAIT but T1 cookie timer is running"); MS_ASSERT( !this->t2ShutdownTimer->IsRunning(), "internal state is COOKIE_WAIT but T2 Shutdown timer is running"); @@ -2687,7 +2687,7 @@ namespace RTC "internal state is COOKIE_ECHOED but T1 Init timer is not running"); MS_ASSERT( this->t1CookieTimer->IsRunning(), - "internal state is COOKIE_ECHOED but T1 Cookie timer is not running"); + "internal state is COOKIE_ECHOED but T1 cookie timer is not running"); MS_ASSERT( !this->t2ShutdownTimer->IsRunning(), "internal state is COOKIE_ECHOED but T2 Shutdown timer is running"); @@ -2706,7 +2706,7 @@ namespace RTC "internal state is ESTABLISHED but T1 Init timer is running"); MS_ASSERT( !this->t1CookieTimer->IsRunning(), - "internal state is ESTABLISHED but T1 Cookie timer is running"); + "internal state is ESTABLISHED but T1 cookie timer is running"); MS_ASSERT( !this->t2ShutdownTimer->IsRunning(), "internal state is ESTABLISHED but T2 Shutdown timer is running"); @@ -2722,7 +2722,7 @@ namespace RTC "internal state is SHUTDOWN_PENDING but T1 Init timer is running"); MS_ASSERT( !this->t1CookieTimer->IsRunning(), - "internal state is SHUTDOWN_PENDING but T1 Cookie timer is running"); + "internal state is SHUTDOWN_PENDING but T1 cookie timer is running"); MS_ASSERT( !this->t2ShutdownTimer->IsRunning(), "internal state is SHUTDOWN_PENDING but T2 Shutdown timer is running"); @@ -2738,7 +2738,7 @@ namespace RTC "internal state is SHUTDOWN_SENT but T1 Init timer is running"); MS_ASSERT( !this->t1CookieTimer->IsRunning(), - "internal state is SHUTDOWN_SENT but T1 Cookie timer is running"); + "internal state is SHUTDOWN_SENT but T1 cookie timer is running"); MS_ASSERT( this->t2ShutdownTimer->IsRunning(), "internal state is SHUTDOWN_SENT but T2 Shutdown timer is not running"); @@ -2754,7 +2754,7 @@ namespace RTC "internal state is SHUTDOWN_RECEIVED but T1 Init timer is running"); MS_ASSERT( !this->t1CookieTimer->IsRunning(), - "internal state is SHUTDOWN_RECEIVED but T1 Cookie timer is running"); + "internal state is SHUTDOWN_RECEIVED but T1 cookie timer is running"); MS_ASSERT( !this->t2ShutdownTimer->IsRunning(), "internal state is SHUTDOWN_RECEIVED but T2 Shutdown timer is running"); @@ -2770,7 +2770,7 @@ namespace RTC "internal state is SHUTDOWN_ACK_SENT but T1 Init timer is running"); MS_ASSERT( !this->t1CookieTimer->IsRunning(), - "internal state is SHUTDOWN_ACK_SENT but T1 Cookie timer is running"); + "internal state is SHUTDOWN_ACK_SENT but T1 cookie timer is running"); MS_ASSERT( this->t2ShutdownTimer->IsRunning(), "internal state is SHUTDOWN_ACK_SENT but T2 Shutdown timer is not running"); diff --git a/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp b/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp index 245580dae8..c606d0564a 100644 --- a/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +++ b/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp @@ -96,7 +96,7 @@ namespace RTC auto packet = this->tcbContext->CreatePacket(); auto* heartbeatAckChunk = packet->BuildChunkInPlace(); - // Here we have to extract all Parameters from receivedHeartbeatRequestChunk + // Here we have to extract all parameters from receivedHeartbeatRequestChunk // and add them into heartbeatAckChunk. for (auto it = receivedHeartbeatRequestChunk->ParametersBegin(); it != receivedHeartbeatRequestChunk->ParametersEnd(); @@ -126,7 +126,7 @@ namespace RTC { this->associationListener.OnAssociationError( Types::ErrorKind::PARSE_FAILED, - "ignoring HEARTBEAT_ACK chunk without Heartbeat Info parameter"); + "ignoring HEARTBEAT-ACK chunk without Heartbeat Info parameter"); return; } @@ -156,14 +156,14 @@ namespace RTC { const uint64_t rttMs = nowMs - createdAtMs; - MS_DEBUG_DEV("valid HEARTBEAT_ACK Chunk received, calling ObserveRttMs(%" PRIu64 ")", rttMs); + MS_DEBUG_DEV("valid HEARTBEAT-ACK chunk received, calling ObserveRttMs(%" PRIu64 ")", rttMs); this->tcbContext->ObserveRttMs(rttMs); } else { MS_WARN_DEV( - "ignoring received HEARTBEAT_ACK Chunk with invalid info content [createdAtMs:%" PRIu64 + "ignoring received HEARTBEAT-ACK chunk with invalid info content [createdAtMs:%" PRIu64 ", nowMs:%" PRIu64 "]", createdAtMs, nowMs); @@ -182,7 +182,7 @@ namespace RTC if (!this->tcbContext->IsAssociationEstablished()) { - MS_DEBUG_DEV("won't send HEARTBEAT_REQUEST when SCTP Association is not established"); + MS_DEBUG_DEV("won't send HEARTBEAT-REQUEST when SCTP association is not established"); return; } @@ -205,7 +205,7 @@ namespace RTC heartbeatInfoParameter->Consolidate(); heartbeatRequestChunk->Consolidate(); - MS_DEBUG_DEV("sending HEARTBEAT_REQUEST Chunk with info content [nowMs:%" PRIu64 "]", nowMs); + MS_DEBUG_DEV("sending HEARTBEAT-REQUEST chunk with info content [nowMs:%" PRIu64 "]", nowMs); this->tcbContext->SendPacket(packet.get()); } diff --git a/worker/src/RTC/SCTP/association/NegotiatedCapabilities.cpp b/worker/src/RTC/SCTP/association/NegotiatedCapabilities.cpp index d70b6f5499..97bc6b101a 100644 --- a/worker/src/RTC/SCTP/association/NegotiatedCapabilities.cpp +++ b/worker/src/RTC/SCTP/association/NegotiatedCapabilities.cpp @@ -35,7 +35,7 @@ namespace RTC // Partial Reliability Extension is negotiated if we desire it and // peer announces support via Forward-TSN-Supported Parameter or via - // Supported Extensions Parameter. + // Supported extensions parameter. negotiatedCapabilities.partialReliability = sctpOptions.enablePartialReliability && (remoteForwardTsnSupportedParameter || @@ -43,14 +43,14 @@ namespace RTC remoteSupportedExtensionsParameter->IncludesChunkType(Chunk::ChunkType::FORWARD_TSN))); // Message Interleaving is negotiated if we desire it and peer - // announces support via Supported Extensions Parameter. + // announces support via Supported Extensions parameter. negotiatedCapabilities.messageInterleaving = sctpOptions.enableMessageInterleaving && remoteSupportedExtensionsParameter && remoteSupportedExtensionsParameter->IncludesChunkType(Chunk::ChunkType::I_DATA) && remoteSupportedExtensionsParameter->IncludesChunkType(Chunk::ChunkType::I_FORWARD_TSN); // Stream Re-Configuration is negotiated if peer announces support via - // Supported Extensions Parameter. + // Supported extensions parameter. negotiatedCapabilities.reConfig = remoteSupportedExtensionsParameter && remoteSupportedExtensionsParameter->IncludesChunkType(Chunk::ChunkType::RE_CONFIG); diff --git a/worker/src/RTC/SCTP/association/PacketSender.cpp b/worker/src/RTC/SCTP/association/PacketSender.cpp index 68d7a5e358..fcf3664ef7 100644 --- a/worker/src/RTC/SCTP/association/PacketSender.cpp +++ b/worker/src/RTC/SCTP/association/PacketSender.cpp @@ -42,7 +42,7 @@ namespace RTC if (!sent) { - MS_WARN_TAG(sctp, "couldn't send SCTP Packet"); + MS_WARN_TAG(sctp, "couldn't send SCTP packet"); } return sent; diff --git a/worker/src/RTC/SCTP/association/StreamResetHandler.cpp b/worker/src/RTC/SCTP/association/StreamResetHandler.cpp index 4d8eb62398..590f806b5f 100644 --- a/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +++ b/worker/src/RTC/SCTP/association/StreamResetHandler.cpp @@ -188,7 +188,7 @@ namespace RTC } } - MS_WARN_TAG(sctp, "invalid set of RE-CONFIG Parameters"); + MS_WARN_TAG(sctp, "invalid set of RE-CONFIG parameters"); return false; } @@ -241,7 +241,7 @@ namespace RTC } else if (reqSeqNbr != this->lastProcessedReqSeqNbr.GetNextValue()) { - // Too old, too new, from wrong Association, etc. + // Too old, too new, from wrong association, etc. MS_WARN_TAG(sctp, "bad reqSeqNbr: %" PRIu32, reqSeqNbr.Wrap()); return ReqSeqNbrValidationResult::BAD_SEQUENCE_NUMBER; diff --git a/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp b/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp index 24a7f0c44d..aca1aad3a1 100644 --- a/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +++ b/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp @@ -290,13 +290,13 @@ namespace RTC { const auto packet = CreatePacket(); - // Only add control Chunks to the first Packet that is sent, if sending - // multiple Packets in one go (as allowed by the congestion window). + // Only add control chunks to the first packet that is sent, if sending + // multiple packets in one go (as allowed by the congestion window). if (packetIdx == 0) { if (addCookieAckChunk) { - MS_DEBUG_DEV("adding COOKIE_ACK Chunk to the Packet"); + MS_DEBUG_DEV("adding COOKIE-ACK chunk to the packet"); const auto* cookieAckChunk = packet->BuildChunkInPlace(); @@ -312,7 +312,7 @@ namespace RTC if (packet->GetChunksCount() > 0) { MS_THROW_ERROR( - "Packet must have no Chunks [addCookieAckChunk:%s]", + "packet must have no chunks [addCookieAckChunk:%s]", addCookieAckChunk ? "true" : "no"); } @@ -411,7 +411,7 @@ namespace RTC { MS_TRACE(); - // In the COOKIE_ECHO state, let the T1-COOKIE timer trigger + // In the COOKIE-ECHO state, let the T1-COOKIE timer trigger // retransmissions, to avoid having two timers doing that. if (this->remoteStateCookie.has_value()) { diff --git a/worker/src/RTC/SCTP/packet/Chunk.cpp b/worker/src/RTC/SCTP/packet/Chunk.cpp index d4f90288fa..740269bf41 100644 --- a/worker/src/RTC/SCTP/packet/Chunk.cpp +++ b/worker/src/RTC/SCTP/packet/Chunk.cpp @@ -48,23 +48,23 @@ namespace RTC { { Chunk::ChunkType::DATA, "DATA" }, { Chunk::ChunkType::INIT, "INIT" }, - { Chunk::ChunkType::INIT_ACK, "INIT_ACK" }, + { Chunk::ChunkType::INIT_ACK, "INIT-ACK" }, { Chunk::ChunkType::SACK, "SACK" }, - { Chunk::ChunkType::HEARTBEAT_REQUEST, "HEARTBEAT_REQUEST" }, - { Chunk::ChunkType::HEARTBEAT_ACK, "HEARTBEAT_ACK" }, + { Chunk::ChunkType::HEARTBEAT_REQUEST, "HEARTBEAT-REQUEST" }, + { Chunk::ChunkType::HEARTBEAT_ACK, "HEARTBEAT-ACK" }, { Chunk::ChunkType::ABORT, "ABORT" }, { Chunk::ChunkType::SHUTDOWN, "SHUTDOWN" }, - { Chunk::ChunkType::SHUTDOWN_ACK, "SHUTDOWN_ACK" }, - { Chunk::ChunkType::OPERATION_ERROR, "OPERATION_ERROR" }, - { Chunk::ChunkType::COOKIE_ECHO, "COOKIE_ECHO" }, - { Chunk::ChunkType::COOKIE_ACK, "COOKIE_ACK" }, + { Chunk::ChunkType::SHUTDOWN_ACK, "SHUTDOWN-ACK" }, + { Chunk::ChunkType::OPERATION_ERROR, "OPERATION-ERROR" }, + { Chunk::ChunkType::COOKIE_ECHO, "COOKIE-ECHO" }, + { Chunk::ChunkType::COOKIE_ACK, "COOKIE-ACK" }, { Chunk::ChunkType::ECNE, "ECNE" }, { Chunk::ChunkType::CWR, "CWR" }, - { Chunk::ChunkType::SHUTDOWN_COMPLETE, "SHUTDOWN_COMPLETE" }, - { Chunk::ChunkType::FORWARD_TSN, "FORWARD_TSN" }, - { Chunk::ChunkType::RE_CONFIG, "RE_CONFIG" }, - { Chunk::ChunkType::I_DATA, "I_DATA" }, - { Chunk::ChunkType::I_FORWARD_TSN, "I_FORWARD_TSN" }, + { Chunk::ChunkType::SHUTDOWN_COMPLETE, "SHUTDOWN-COMPLETE" }, + { Chunk::ChunkType::FORWARD_TSN, "FORWARD-TSN" }, + { Chunk::ChunkType::RE_CONFIG, "RE-CONFIG" }, + { Chunk::ChunkType::I_DATA, "I-DATA" }, + { Chunk::ChunkType::I_FORWARD_TSN, "I-FORWARD-TSN" }, }; // clang-format on @@ -117,7 +117,7 @@ namespace RTC MS_TRACE(); // NOTE: Here we cannot check CanHaveParameters() or CanHaveErrorCauses() - // because this is the destructor of Chunk so the subclass has been + // because this is the destructor of chunk so the subclass has been // already destroyed (its destructor runs first). for (const auto* parameter : this->parameters) @@ -170,15 +170,15 @@ namespace RTC const size_t previousLength = GetLength(); - // This will update the total length and Length field of the Chunk. + // This will update the total length and length field of the chunk. // NOTE: It may throw. AddItem(parameter); - // Let's append the Parameter at the end of existing Parameters. + // Let's append the parameter at the end of existing parameters. auto* clonedParameter = parameter->Clone(const_cast(GetBuffer()) + previousLength, parameter->GetLength()); - // Add the Parameter to the list. + // Add the parameter to the list. this->parameters.push_back(clonedParameter); } @@ -191,11 +191,11 @@ namespace RTC const size_t previousLength = GetLength(); - // This will update the total length and Length field of the Chunk. + // This will update the total length and length field of the chunk. // NOTE: It may throw. AddItem(errorCause); - // Let's append the Error Cause at the end of existing Error Causes. + // Let's append the error cause at the end of existing error causes. auto* clonedErrorCause = errorCause->Clone( const_cast(GetBuffer()) + previousLength, errorCause->GetLength()); @@ -282,7 +282,7 @@ namespace RTC { MS_TRACE(); - // Soft clone Parameters into the given Chunk. + // Soft clone parameters into the given chunk. if (CanHaveParameters()) { for (auto* parameter : this->parameters) @@ -295,7 +295,7 @@ namespace RTC } } - // Soft clone Error Causes into the given Chunk. + // Soft clone error causes into the given chunk. if (CanHaveErrorCauses()) { for (auto* errorCause : this->errorCauses) @@ -327,16 +327,16 @@ namespace RTC AssertCanHaveParameters(); - // Here we assume that the Chunk buffer has been validated and - // GetLength() returns the fixed minimum length of the specific Chunk + // Here we assume that the chunk buffer has been validated and + // GetLength() returns the fixed minimum length of the specific chunk // subclass, so GetBuffer() + GetLength() points to the beginning of the - // potential Parameters. And of course we assume that a Chunk cannot have - // both Parameters and Error Causes. + // potential parameters. And of course we assume that a chunk cannot have + // both parameters and error causes. auto* ptr = const_cast(GetBuffer()) + GetLength(); - // Here we assume that the Chunk has been validated so Length field is - // reliable. We want to be ready for Length field to include or not the - // possible padding of the last Parameter (as per RFC recommendation). In + // Here we assume that the chunk has been validated so length field is + // reliable. We want to be ready for length field to include or not the + // possible padding of the last parameter (as per RFC recommendation). In // fact, we rely on parameter->GetLength() while parsing the buffer so we // want to provide each Parameter::StrictParse() call with a 4-bytes // padded buffer length. @@ -345,10 +345,10 @@ namespace RTC while (ptr < end) { // The remaining length in the given length is the potential buffer - // length of the Parameter. + // length of the parameter. const size_t parameterMaxBufferLength = end - ptr; - // Here we must anticipate the type of each Parameter to use its + // Here we must anticipate the type of each parameter to use its // appropriate parser. Parameter::ParameterType parameterType; uint16_t parameterLength; @@ -357,7 +357,7 @@ namespace RTC if (!Parameter::IsParameter( ptr, parameterMaxBufferLength, parameterType, parameterLength, padding)) { - MS_WARN_TAG(sctp, "not an SCTP Parameter"); + MS_WARN_TAG(sctp, "not an SCTP parameter"); return false; } @@ -534,16 +534,16 @@ namespace RTC AssertCanHaveErrorCauses(); - // Here we assume that the Chunk buffer has been validated and GetLength() - // returns the fixed minimum length of the specific Chunk subclass, so + // Here we assume that the chunk buffer has been validated and GetLength() + // returns the fixed minimum length of the specific chunk subclass, so // GetBuffer() + GetLength() points to the beginning of the potential - // Error Causes. And of course we assume that a Chunk cannot have both - // Parameters and Error Causes. + // error causes. And of course we assume that a chunk cannot have both + // parameters and error causes. auto* ptr = const_cast(GetBuffer()) + GetLength(); - // Here we assume that the Chunk has been validated so Length field is - // reliable. We want to be ready for Length field to include or not the - // possible padding of the last Error Cause (as per RFCrecommendation). + // Here we assume that the chunk has been validated so length field is + // reliable. We want to be ready for length field to include or not the + // possible padding of the last error cause (as per RFCrecommendation). // In fact, we rely on errorCause->GetLength() while parsing the buffer // so we want to provide each ErrorCause::StrictParse() call with a // 4-bytes padded buffer length. @@ -552,10 +552,10 @@ namespace RTC while (ptr < end) { // The remaining length in the given length is the potential buffer - // length of the Error Cause. + // length of the error cause. const size_t errorCauseMaxBufferLength = end - ptr; - // Here we must anticipate the type of each Error Cause to use its + // Here we must anticipate the type of each error cause to use its // appropriate parser. ErrorCause::ErrorCauseCode causeCode; uint16_t causeLength; @@ -563,7 +563,7 @@ namespace RTC if (!ErrorCause::IsErrorCause(ptr, errorCauseMaxBufferLength, causeCode, causeLength, padding)) { - MS_WARN_TAG(sctp, "not an SCTP Error Cause"); + MS_WARN_TAG(sctp, "not an SCTP error cause"); return false; } @@ -716,22 +716,22 @@ namespace RTC this->needsConsolidation = true; - // When the application completes the Parameter it must call + // When the application completes the parameter it must call // `parameter->Consolidate()` and that will trigger this event. parameter->SetConsolidatedListener( [this, parameter]() { try { - // Fix buffer length assigned to the Parameter. + // Fix buffer length assigned to the parameter. // NOTE: It may throw. parameter->SetBufferLength(parameter->GetLength()); - // This will update the total length and Length field of the Chunk. + // This will update the total length and length field of the chunk. // NOTE: It may throw. AddItem(parameter); - // Add the Parameter to the list. + // Add the parameter to the list. this->parameters.push_back(parameter); this->needsConsolidation = false; @@ -751,21 +751,21 @@ namespace RTC this->needsConsolidation = true; - // When the application completes the Error Cause it must call + // When the application completes the error cause it must call // `errorCause->Consolidate()` and that will trigger this event. errorCause->SetConsolidatedListener( [this, errorCause]() { try { - // Fix buffer length assigned to the Error Cause. + // Fix buffer length assigned to the error cause. errorCause->SetBufferLength(errorCause->GetLength()); - // This will update the total length and Length field of the Chunk. + // This will update the total length and length field of the chunk. // NOTE: It may throw. AddItem(errorCause); - // Add the Error Cause to the list. + // Add the error cause to the list. this->errorCauses.push_back(errorCause); this->needsConsolidation = false; @@ -785,7 +785,7 @@ namespace RTC if (!CanHaveParameters()) { - MS_THROW_ERROR("this Chunk class cannot have Parameters"); + MS_THROW_ERROR("this chunk class cannot have parameters"); } } @@ -795,7 +795,7 @@ namespace RTC if (!CanHaveErrorCauses()) { - MS_THROW_ERROR("this Chunk class cannot have Error Causes"); + MS_THROW_ERROR("this chunk class cannot have error causes"); } } @@ -805,7 +805,7 @@ namespace RTC if (this->needsConsolidation) { - MS_THROW_ERROR("Chunk needs consolidation of some ongoing Parameter or Error Cause"); + MS_THROW_ERROR("chunk needs consolidation of some ongoing parameter or error cause"); } } } // namespace SCTP diff --git a/worker/src/RTC/SCTP/packet/ErrorCause.cpp b/worker/src/RTC/SCTP/packet/ErrorCause.cpp index 45407697c1..674bbb5605 100644 --- a/worker/src/RTC/SCTP/packet/ErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/ErrorCause.cpp @@ -14,19 +14,19 @@ namespace RTC // clang-format off const std::unordered_map ErrorCause::ErrorCauseCode2String = { - { ErrorCause::ErrorCauseCode::INVALID_STREAM_IDENTIFIER, "INVALID_STREAM_IDENTIFIER" }, - { ErrorCause::ErrorCauseCode::MISSING_MANDATORY_PARAMETER, "MISSING_MANDATORY_PARAMETER" }, - { ErrorCause::ErrorCauseCode::STALE_COOKIE, "STALE_COOKIE" }, - { ErrorCause::ErrorCauseCode::OUT_OF_RESOURCE, "OUT_OF_RESOURCE" }, - { ErrorCause::ErrorCauseCode::UNRESOLVABLE_ADDRESS, "UNRESOLVABLE_ADDRESS" }, - { ErrorCause::ErrorCauseCode::UNRECOGNIZED_CHUNK_TYPE, "UNRECOGNIZED_CHUNK_TYPE" }, - { ErrorCause::ErrorCauseCode::INVALID_MANDATORY_PARAMETER, "INVALID_MANDATORY_PARAMETER" }, - { ErrorCause::ErrorCauseCode::UNRECOGNIZED_PARAMETERS, "UNRECOGNIZED_PARAMETERS" }, - { ErrorCause::ErrorCauseCode::NO_USER_DATA, "NO_USER_DATA" }, - { ErrorCause::ErrorCauseCode::COOKIE_RECEIVED_WHILE_SHUTTING_DOWN, "COOKIE_RECEIVED_WHILE_SHUTTING_DOWN" }, - { ErrorCause::ErrorCauseCode::RESTART_OF_AN_ASSOCIATION_WITH_NEW_ADDRESSES, "RESTART_OF_AN_ASSOCIATION_WITH_NEW_ADDRESSES" }, - { ErrorCause::ErrorCauseCode::USER_INITIATED_ABORT, "USER_INITIATED_ABORT" }, - { ErrorCause::ErrorCauseCode::PROTOCOL_VIOLATION, "PROTOCOL_VIOLATION" }, + { ErrorCause::ErrorCauseCode::INVALID_STREAM_IDENTIFIER, "INVALID-STREAM-IDENTIFIER" }, + { ErrorCause::ErrorCauseCode::MISSING_MANDATORY_PARAMETER, "MISSING-MANDATORY-PARAMETER" }, + { ErrorCause::ErrorCauseCode::STALE_COOKIE, "STALE-COOKIE" }, + { ErrorCause::ErrorCauseCode::OUT_OF_RESOURCE, "OUT-OF-RESOURCE" }, + { ErrorCause::ErrorCauseCode::UNRESOLVABLE_ADDRESS, "UNRESOLVABLE-ADDRESS" }, + { ErrorCause::ErrorCauseCode::UNRECOGNIZED_CHUNK_TYPE, "UNRECOGNIZED-CHUNK-TYPE" }, + { ErrorCause::ErrorCauseCode::INVALID_MANDATORY_PARAMETER, "INVALID-MANDATORY-PARAMETER" }, + { ErrorCause::ErrorCauseCode::UNRECOGNIZED_PARAMETERS, "UNRECOGNIZED-PARAMETERS" }, + { ErrorCause::ErrorCauseCode::NO_USER_DATA, "NO-USER-DATA" }, + { ErrorCause::ErrorCauseCode::COOKIE_RECEIVED_WHILE_SHUTTING_DOWN, "COOKIE-RECEIVED-WHILE-SHUTTING-DOWN" }, + { ErrorCause::ErrorCauseCode::RESTART_OF_AN_ASSOCIATION_WITH_NEW_ADDRESSES, "RESTART-OF-AN-ASSOCIATION-WITH-NEW-ADDRESSES" }, + { ErrorCause::ErrorCauseCode::USER_INITIATED_ABORT, "USER-INITIATED-ABORT" }, + { ErrorCause::ErrorCauseCode::PROTOCOL_VIOLATION, "PROTOCOL-VIOLATION" }, }; // clang-format on diff --git a/worker/src/RTC/SCTP/packet/Packet.cpp b/worker/src/RTC/SCTP/packet/Packet.cpp index 4c48dda05d..f880a2304a 100644 --- a/worker/src/RTC/SCTP/packet/Packet.cpp +++ b/worker/src/RTC/SCTP/packet/Packet.cpp @@ -42,7 +42,7 @@ namespace RTC if (!Packet::IsSctp(buffer, bufferLength)) { - MS_WARN_TAG(sctp, "not an SCTP Packet"); + MS_WARN_TAG(sctp, "not an SCTP packet"); return nullptr; } @@ -50,7 +50,7 @@ namespace RTC auto* packet = new Packet(const_cast(buffer), bufferLength); // Pointer that initially points to the given data buffer and is later - // incremented to point to other parts of the Packet. + // incremented to point to other parts of the packet. const auto* ptr = buffer; // Move to chunks. @@ -59,10 +59,10 @@ namespace RTC while (ptr < buffer + bufferLength) { // The remaining length in the buffer is the potential buffer length - // of the Chunk. + // of the chunk. const size_t chunkMaxBufferLength = bufferLength - (ptr - buffer); - // Here we must anticipate the type of each Chunk to use its appropriate + // Here we must anticipate the type of each chunk to use its appropriate // parser. Chunk::ChunkType chunkType; uint16_t chunkLength; @@ -70,7 +70,7 @@ namespace RTC if (!Chunk::IsChunk(ptr, chunkMaxBufferLength, chunkType, chunkLength, padding)) { - MS_WARN_TAG(sctp, "not an SCTP Chunk"); + MS_WARN_TAG(sctp, "not an SCTP chunk"); delete packet; return nullptr; @@ -78,7 +78,7 @@ namespace RTC Chunk* chunk{ nullptr }; // NOLINT(misc-const-correctness) - MS_DEBUG_DEV("parsing SCTP Chunk [ptr:%zu, type:%" PRIu8 "]", ptr - buffer, chunkType); + MS_DEBUG_DEV("parsing SCTP chunk [ptr:%zu, type:%" PRIu8 "]", ptr - buffer, chunkType); switch (chunkType) { @@ -238,7 +238,7 @@ namespace RTC } // It's mandatory to call SetLength() once we are done and we know the - // exact length of the Packet. + // exact length of the packet. packet->SetLength(computedLength); return packet; @@ -265,7 +265,7 @@ namespace RTC packet->SetChecksum(0u); // No need to invoke SetLength() since constructor invoked it with - // minimum Packet length. + // minimum packet length. return packet; } @@ -334,7 +334,7 @@ namespace RTC Serializable::CloneInto(clonedPacket); - // Soft clone Packet Chunks into the given cloned Packet. + // Soft clone packet chunks into the given cloned packet. for (auto* chunk : this->chunks) { const size_t offset = chunk->GetBuffer() - GetBuffer(); @@ -383,7 +383,7 @@ namespace RTC const size_t length = GetLength() + chunk->GetLength(); - // Let's append the Chunk at the end of existing Chunks. + // Let's append the chunk at the end of existing chunks. auto* clonedChunk = chunk->Clone(const_cast(GetBuffer()) + GetLength(), chunk->GetLength()); @@ -435,7 +435,7 @@ namespace RTC this->needsConsolidation = true; - // When the application completes the Chunk it must call + // When the application completes the chunk it must call // `chunk->Consolidate()` and that will trigger this event. chunk->SetConsolidatedListener( [this, chunk]() @@ -444,18 +444,18 @@ namespace RTC { if (chunk->NeedsConsolidation()) { - MS_THROW_ERROR("ongoing Chunk needs consolidation"); + MS_THROW_ERROR("ongoing chunk needs consolidation"); } - // Fix buffer length assigned to the Chunk. + // Fix buffer length assigned to the chunk. chunk->SetBufferLength(chunk->GetLength()); - // Update Packet length. - // NOTE: This will throw if there is no enough space in the Packet + // Update packet length. + // NOTE: This will throw if there is no enough space in the packet // buffer. SetLength(GetLength() + chunk->GetLength()); - // Add the Chunk to the list. + // Add the chunk to the list. this->chunks.push_back(chunk); this->needsConsolidation = false; } @@ -474,7 +474,7 @@ namespace RTC if (this->needsConsolidation) { - MS_THROW_ERROR("Packet needs consolidation of some ongoing Chunk"); + MS_THROW_ERROR("packet needs consolidation of some ongoing chunk"); } } } // namespace SCTP diff --git a/worker/src/RTC/SCTP/packet/Parameter.cpp b/worker/src/RTC/SCTP/packet/Parameter.cpp index e8b76b5d49..7ca1548df0 100644 --- a/worker/src/RTC/SCTP/packet/Parameter.cpp +++ b/worker/src/RTC/SCTP/packet/Parameter.cpp @@ -14,22 +14,22 @@ namespace RTC // clang-format off const std::unordered_map Parameter::ParameterType2String = { - { Parameter::ParameterType::HEARTBEAT_INFO, "HEARTBEAT_INFO" }, - { Parameter::ParameterType::IPV4_ADDRESS, "IPV4_ADDRESS" }, - { Parameter::ParameterType::IPV6_ADDRESS, "IPV6_ADDRESS" }, - { Parameter::ParameterType::STATE_COOKIE, "STATE_COOKIE" }, - { Parameter::ParameterType::UNRECOGNIZED_PARAMETER, "UNRECOGNIZED_PARAMETER" }, - { Parameter::ParameterType::COOKIE_PRESERVATIVE, "COOKIE_PRESERVATIVE" }, - { Parameter::ParameterType::SUPPORTED_ADDRESS_TYPES, "SUPPORTED_ADDRESS_TYPES" }, - { Parameter::ParameterType::FORWARD_TSN_SUPPORTED, "FORWARD_TSN_SUPPORTED" }, - { Parameter::ParameterType::SUPPORTED_EXTENSIONS, "SUPPORTED_EXTENSIONS" }, - { Parameter::ParameterType::OUTGOING_SSN_RESET_REQUEST, "OUTGOING_SSN_RESET_REQUEST" }, - { Parameter::ParameterType::INCOMING_SSN_RESET_REQUEST, "INCOMING_SSN_RESET_REQUEST" }, - { Parameter::ParameterType::SSN_TSN_RESET_REQUEST, "SSN_TSN_RESET_REQUEST" }, - { Parameter::ParameterType::RECONFIGURATION_RESPONSE, "RECONFIGURATION_RESPONSE" }, - { Parameter::ParameterType::ADD_OUTGOING_STREAMS_REQUEST, "ADD_OUTGOING_STREAMS_REQUEST" }, - { Parameter::ParameterType::ADD_INCOMING_STREAMS_REQUEST, "ADD_INCOMING_STREAMS_REQUEST" }, - { Parameter::ParameterType::ZERO_CHECKSUM_ACCEPTABLE, "ZERO_CHECKSUM_ACCEPTABLE" }, + { Parameter::ParameterType::HEARTBEAT_INFO, "HEARTBEAT-INFO" }, + { Parameter::ParameterType::IPV4_ADDRESS, "IPV4-ADDRESS" }, + { Parameter::ParameterType::IPV6_ADDRESS, "IPV6-ADDRESS" }, + { Parameter::ParameterType::STATE_COOKIE, "STATE-COOKIE" }, + { Parameter::ParameterType::UNRECOGNIZED_PARAMETER, "UNRECOGNIZED-PARAMETER" }, + { Parameter::ParameterType::COOKIE_PRESERVATIVE, "COOKIE-PRESERVATIVE" }, + { Parameter::ParameterType::SUPPORTED_ADDRESS_TYPES, "SUPPORTED-ADDRESS-TYPES" }, + { Parameter::ParameterType::FORWARD_TSN_SUPPORTED, "FORWARD-TSN-SUPPORTED" }, + { Parameter::ParameterType::SUPPORTED_EXTENSIONS, "SUPPORTED-EXTENSIONS" }, + { Parameter::ParameterType::OUTGOING_SSN_RESET_REQUEST, "OUTGOING-SSN-RESET-REQUEST" }, + { Parameter::ParameterType::INCOMING_SSN_RESET_REQUEST, "INCOMING-SSN-RESET-REQUEST" }, + { Parameter::ParameterType::SSN_TSN_RESET_REQUEST, "SSN-TSN-RESET-REQUEST" }, + { Parameter::ParameterType::RECONFIGURATION_RESPONSE, "RECONFIGURATION-RESPONSE" }, + { Parameter::ParameterType::ADD_OUTGOING_STREAMS_REQUEST, "ADD-OUTGOING-STREAMS-REQUEST" }, + { Parameter::ParameterType::ADD_INCOMING_STREAMS_REQUEST, "ADD-INCOMING-STREAMS-REQUEST" }, + { Parameter::ParameterType::ZERO_CHECKSUM_ACCEPTABLE, "ZERO-CHECKSUM-ACCEPTABLE" }, }; // clang-format on diff --git a/worker/src/RTC/SCTP/packet/TLV.cpp b/worker/src/RTC/SCTP/packet/TLV.cpp index 079e8090a1..7e550cd58e 100644 --- a/worker/src/RTC/SCTP/packet/TLV.cpp +++ b/worker/src/RTC/SCTP/packet/TLV.cpp @@ -19,7 +19,7 @@ namespace RTC if (bufferLength < TLV::TLVHeaderLength) { - MS_WARN_TAG(sctp, "no space for Header [bufferLength:%zu]", bufferLength); + MS_WARN_TAG(sctp, "no space for header [bufferLength:%zu]", bufferLength); return false; } @@ -29,14 +29,14 @@ namespace RTC if (itemLength < TLV::TLVHeaderLength) { MS_WARN_TAG( - sctp, "Length field must have value greater or equal than %zu", TLV::TLVHeaderLength); + sctp, "length field must have value greater or equal than %zu", TLV::TLVHeaderLength); return false; } // Item total length must be multiple of 4 bytes and must include padding - // bytes despite item Length field does not include padding. - // NOTE: We must cast to size_t, otherwise a maximum item Length value of + // bytes despite item length field does not include padding. + // NOTE: We must cast to size_t, otherwise a maximum item length value of // 65535 would generate a padded length of 0 bytes! const size_t paddedItemLength = Utils::Byte::PadTo4Bytes(size_t{ itemLength }); @@ -44,7 +44,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "no space for 4-byte padded announced Length [paddedItemLength:%zu, bufferLength:%zu]", + "no space for 4-byte padded announced length [paddedItemLength:%zu, bufferLength:%zu]", paddedItemLength, bufferLength); @@ -131,7 +131,7 @@ namespace RTC // NOTE: If there is no space in the buffer for it, it will throw. SetLength(newPaddedLength); - // Update Length field. + // Update length field. // NOTE: This will throw if computed value is too big. SetLengthField(newNotPaddedLength); } @@ -161,8 +161,8 @@ namespace RTC // NOTE: This will throw if there is no enough space in the buffer. SetLength(previousLength + item->GetLength()); - // Update Length field. - // NOTE: This will throw if computed Length field value is too big. + // Update length field. + // NOTE: This will throw if computed length field value is too big. SetLengthField(previousLength + item->GetLengthField()); } catch (const MediaSoupError& error) diff --git a/worker/src/RTC/SCTP/packet/chunks/AbortAssociationChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/AbortAssociationChunk.cpp index 1cc8abbe5e..07259595b9 100644 --- a/worker/src/RTC/SCTP/packet/chunks/AbortAssociationChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/AbortAssociationChunk.cpp @@ -26,7 +26,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::ABORT) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -60,10 +60,10 @@ namespace RTC auto* chunk = new AbortAssociationChunk(const_cast(buffer), bufferLength); - // Parse Error Causes. + // Parse error causes. if (!chunk->ParseErrorCauses()) { - MS_WARN_DEV("failed to parse Error Causes"); + MS_WARN_DEV("failed to parse error causes"); delete chunk; return nullptr; diff --git a/worker/src/RTC/SCTP/packet/chunks/CookieAckChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/CookieAckChunk.cpp index 4d6097a867..25da145556 100644 --- a/worker/src/RTC/SCTP/packet/chunks/CookieAckChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/CookieAckChunk.cpp @@ -26,7 +26,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::COOKIE_ACK) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -60,7 +60,7 @@ namespace RTC if (chunkLength != Chunk::ChunkHeaderLength) { - MS_WARN_TAG(sctp, "CookieAckChunk Length field must be %zu", Chunk::ChunkHeaderLength); + MS_WARN_TAG(sctp, "CookieAckChunk length field must be %zu", Chunk::ChunkHeaderLength); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/chunks/CookieEchoChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/CookieEchoChunk.cpp index 274419f41f..001d263799 100644 --- a/worker/src/RTC/SCTP/packet/chunks/CookieEchoChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/CookieEchoChunk.cpp @@ -26,7 +26,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::COOKIE_ECHO) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/chunks/DataChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/DataChunk.cpp index 8542a0f26a..6c13a73270 100644 --- a/worker/src/RTC/SCTP/packet/chunks/DataChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/DataChunk.cpp @@ -27,7 +27,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::DATA) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -69,7 +69,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "DataChunk Length field must be equal or greater than %zu", + "DataChunk length field must be equal or greater than %zu", DataChunk::DataChunkHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/chunks/ForwardTsnChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/ForwardTsnChunk.cpp index 901649fbf3..520f1db64b 100644 --- a/worker/src/RTC/SCTP/packet/chunks/ForwardTsnChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/ForwardTsnChunk.cpp @@ -27,7 +27,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::FORWARD_TSN) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -67,7 +67,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "ForwardTsnChunk Length field must be equal or greater than %zu", + "ForwardTsnChunk length field must be equal or greater than %zu", ForwardTsnChunk::ForwardTsnChunkHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/chunks/HeartbeatAckChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/HeartbeatAckChunk.cpp index fd9950318c..232f18d91c 100644 --- a/worker/src/RTC/SCTP/packet/chunks/HeartbeatAckChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/HeartbeatAckChunk.cpp @@ -26,7 +26,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::HEARTBEAT_ACK) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -60,10 +60,10 @@ namespace RTC auto* chunk = new HeartbeatAckChunk(const_cast(buffer), bufferLength); - // Parse Parameters. + // Parse parameters. if (!chunk->ParseParameters()) { - MS_WARN_DEV("failed to parse Parameters"); + MS_WARN_DEV("failed to parse parameters"); delete chunk; return nullptr; diff --git a/worker/src/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.cpp index 87f1e258c2..c60e9dd5df 100644 --- a/worker/src/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.cpp @@ -26,7 +26,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::HEARTBEAT_REQUEST) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -60,10 +60,10 @@ namespace RTC auto* chunk = new HeartbeatRequestChunk(const_cast(buffer), bufferLength); - // Parse Parameters. + // Parse parameters. if (!chunk->ParseParameters()) { - MS_WARN_DEV("failed to parse Parameters"); + MS_WARN_DEV("failed to parse parameters"); delete chunk; return nullptr; diff --git a/worker/src/RTC/SCTP/packet/chunks/IDataChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/IDataChunk.cpp index f429e8cc49..6124d666d2 100644 --- a/worker/src/RTC/SCTP/packet/chunks/IDataChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/IDataChunk.cpp @@ -27,7 +27,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::I_DATA) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -71,7 +71,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "IDataChunk Length field must be equal or greater than %zu", + "IDataChunk length field must be equal or greater than %zu", IDataChunk::IDataChunkHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/chunks/IForwardTsnChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/IForwardTsnChunk.cpp index 8243e4a119..3b7d091909 100644 --- a/worker/src/RTC/SCTP/packet/chunks/IForwardTsnChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/IForwardTsnChunk.cpp @@ -27,7 +27,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::I_FORWARD_TSN) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -67,7 +67,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "IForwardTsnChunk Length field must be equal or greater than %zu", + "IForwardTsnChunk length field must be equal or greater than %zu", IForwardTsnChunk::IForwardTsnChunkHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/chunks/InitAckChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/InitAckChunk.cpp index 724bbd3c45..da6b2246cb 100644 --- a/worker/src/RTC/SCTP/packet/chunks/InitAckChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/InitAckChunk.cpp @@ -27,7 +27,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::INIT_ACK) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -70,7 +70,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "InitAckChunk Length field must be equal or greater than %zu", + "InitAckChunk length field must be equal or greater than %zu", InitAckChunk::InitAckChunkHeaderLength); return nullptr; @@ -78,10 +78,10 @@ namespace RTC auto* chunk = new InitAckChunk(const_cast(buffer), bufferLength); - // Parse Parameters. + // Parse parameters. if (!chunk->ParseParameters()) { - MS_WARN_DEV("failed to parse Parameters"); + MS_WARN_DEV("failed to parse parameters"); delete chunk; return nullptr; diff --git a/worker/src/RTC/SCTP/packet/chunks/InitChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/InitChunk.cpp index b9ce8f2b2a..06d5c8fffe 100644 --- a/worker/src/RTC/SCTP/packet/chunks/InitChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/InitChunk.cpp @@ -27,7 +27,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::INIT) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -70,7 +70,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "InitChunk Length field must be equal or greater than %zu", + "InitChunk length field must be equal or greater than %zu", InitChunk::InitChunkHeaderLength); return nullptr; @@ -78,10 +78,10 @@ namespace RTC auto* chunk = new InitChunk(const_cast(buffer), bufferLength); - // Parse Parameters. + // Parse parameters. if (!chunk->ParseParameters()) { - MS_WARN_DEV("failed to parse Parameters"); + MS_WARN_DEV("failed to parse parameters"); delete chunk; return nullptr; diff --git a/worker/src/RTC/SCTP/packet/chunks/OperationErrorChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/OperationErrorChunk.cpp index 4eb6271f7b..d675d35628 100644 --- a/worker/src/RTC/SCTP/packet/chunks/OperationErrorChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/OperationErrorChunk.cpp @@ -26,7 +26,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::OPERATION_ERROR) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -60,10 +60,10 @@ namespace RTC auto* chunk = new OperationErrorChunk(const_cast(buffer), bufferLength); - // Parse Error Causes. + // Parse error causes. if (!chunk->ParseErrorCauses()) { - MS_WARN_DEV("failed to parse Error Causes"); + MS_WARN_DEV("failed to parse error causes"); delete chunk; return nullptr; diff --git a/worker/src/RTC/SCTP/packet/chunks/ReConfigChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/ReConfigChunk.cpp index 60cd7c3198..75dafcd368 100644 --- a/worker/src/RTC/SCTP/packet/chunks/ReConfigChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/ReConfigChunk.cpp @@ -26,7 +26,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::RE_CONFIG) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -60,10 +60,10 @@ namespace RTC auto* chunk = new ReConfigChunk(const_cast(buffer), bufferLength); - // Parse Parameters. + // Parse parameters. if (!chunk->ParseParameters()) { - MS_WARN_DEV("failed to parse Parameters"); + MS_WARN_DEV("failed to parse parameters"); delete chunk; return nullptr; diff --git a/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp index 88d166bb46..401403dc86 100644 --- a/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp @@ -28,7 +28,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::SACK) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -70,7 +70,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "SackChunk Length field must be equal or greater than %zu", + "SackChunk length field must be equal or greater than %zu", SackChunk::SackChunkHeaderLength); return nullptr; @@ -78,7 +78,7 @@ namespace RTC auto* chunk = new SackChunk(const_cast(buffer), bufferLength); - // In this Chunk we must validate that some fields have correct values. + // In this chunk we must validate that some fields have correct values. if ( (chunk->GetNumberOfGapAckBlocks() * 4) + (chunk->GetNumberOfDuplicateTsns() * 4) != chunkLength - SackChunk::SackChunkHeaderLength) diff --git a/worker/src/RTC/SCTP/packet/chunks/ShutdownAckChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/ShutdownAckChunk.cpp index 1b1f784f58..3c38a4c43b 100644 --- a/worker/src/RTC/SCTP/packet/chunks/ShutdownAckChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/ShutdownAckChunk.cpp @@ -26,7 +26,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::SHUTDOWN_ACK) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -60,7 +60,7 @@ namespace RTC if (chunkLength != Chunk::ChunkHeaderLength) { - MS_WARN_TAG(sctp, "ShutdownAckChunk Length field must be %zu", Chunk::ChunkHeaderLength); + MS_WARN_TAG(sctp, "ShutdownAckChunk length field must be %zu", Chunk::ChunkHeaderLength); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/chunks/ShutdownChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/ShutdownChunk.cpp index 300d0e992e..daa918b844 100644 --- a/worker/src/RTC/SCTP/packet/chunks/ShutdownChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/ShutdownChunk.cpp @@ -26,7 +26,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::SHUTDOWN) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -64,7 +64,7 @@ namespace RTC if (chunkLength != ShutdownChunk::ShutdownChunkHeaderLength) { MS_WARN_TAG( - sctp, "ShutdownChunk Length field must be %zu", ShutdownChunk::ShutdownChunkHeaderLength); + sctp, "ShutdownChunk length field must be %zu", ShutdownChunk::ShutdownChunkHeaderLength); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.cpp b/worker/src/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.cpp index 2c55d799b7..5f58e4480f 100644 --- a/worker/src/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.cpp +++ b/worker/src/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.cpp @@ -26,7 +26,7 @@ namespace RTC if (chunkType != Chunk::ChunkType::SHUTDOWN_COMPLETE) { - MS_WARN_DEV("invalid Chunk type"); + MS_WARN_DEV("invalid chunk type"); return nullptr; } @@ -60,7 +60,7 @@ namespace RTC if (chunkLength != Chunk::ChunkHeaderLength) { - MS_WARN_TAG(sctp, "ShutdownCompleteChunk Length field must be %zu", Chunk::ChunkHeaderLength); + MS_WARN_TAG(sctp, "ShutdownCompleteChunk length field must be %zu", Chunk::ChunkHeaderLength); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.cpp b/worker/src/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.cpp index 4eb39f4215..92a043571e 100644 --- a/worker/src/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.cpp @@ -27,7 +27,7 @@ namespace RTC if (causeCode != ErrorCause::ErrorCauseCode::COOKIE_RECEIVED_WHILE_SHUTTING_DOWN) { - MS_WARN_DEV("invalid Error Cause code"); + MS_WARN_DEV("invalid error cause code"); return nullptr; } @@ -66,7 +66,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "CookieReceivedWhileShuttingDownErrorCause Length field must be %zu", + "CookieReceivedWhileShuttingDownErrorCause length field must be %zu", ErrorCause::ErrorCauseHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.cpp b/worker/src/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.cpp index 6f698e9b82..3756e82a1c 100644 --- a/worker/src/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.cpp @@ -27,7 +27,7 @@ namespace RTC if (causeCode != ErrorCause::ErrorCauseCode::INVALID_MANDATORY_PARAMETER) { - MS_WARN_DEV("invalid Error Cause code"); + MS_WARN_DEV("invalid error cause code"); return nullptr; } @@ -65,7 +65,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "InvalidMandatoryParameterErrorCause Length field must be %zu", + "InvalidMandatoryParameterErrorCause length field must be %zu", ErrorCause::ErrorCauseHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.cpp b/worker/src/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.cpp index 43fca95930..415a2f7ff8 100644 --- a/worker/src/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.cpp @@ -28,7 +28,7 @@ namespace RTC if (causeCode != ErrorCause::ErrorCauseCode::INVALID_STREAM_IDENTIFIER) { - MS_WARN_DEV("invalid Error Cause code"); + MS_WARN_DEV("invalid error cause code"); return nullptr; } @@ -71,7 +71,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "InvalidStreamIdentifierErrorCause Length field must be %zu", + "InvalidStreamIdentifierErrorCause length field must be %zu", InvalidStreamIdentifierErrorCause::InvalidStreamIdentifierErrorCauseHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.cpp b/worker/src/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.cpp index 2b03f15298..0c3429b4be 100644 --- a/worker/src/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.cpp @@ -29,7 +29,7 @@ namespace RTC if (causeCode != ErrorCause::ErrorCauseCode::MISSING_MANDATORY_PARAMETER) { - MS_WARN_DEV("invalid Error Cause code"); + MS_WARN_DEV("invalid error cause code"); return nullptr; } @@ -71,7 +71,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "MissingMandatoryParameterErrorCause Length field must be equal or greater than %zu", + "MissingMandatoryParameterErrorCause length field must be equal or greater than %zu", MissingMandatoryParameterErrorCause::MissingMandatoryParameterErrorCauseHeaderLength); return nullptr; @@ -80,13 +80,13 @@ namespace RTC auto* errorCause = new MissingMandatoryParameterErrorCause(const_cast(buffer), bufferLength); - // In this Chunk we must validate that some fields have correct values. + // In this chunk we must validate that some fields have correct values. if ( (errorCause->GetNumberOfMissingParameters() * 2) != causeLength - MissingMandatoryParameterErrorCause::MissingMandatoryParameterErrorCauseHeaderLength) { - MS_WARN_TAG(sctp, "wrong values in Number of Missing Parameters field"); + MS_WARN_TAG(sctp, "wrong values in Number of Missing parameters field"); delete errorCause; return nullptr; diff --git a/worker/src/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.cpp b/worker/src/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.cpp index c43662ec94..2affe7e52e 100644 --- a/worker/src/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.cpp @@ -27,7 +27,7 @@ namespace RTC if (causeCode != ErrorCause::ErrorCauseCode::NO_USER_DATA) { - MS_WARN_DEV("invalid Error Cause code"); + MS_WARN_DEV("invalid error cause code"); return nullptr; } @@ -67,7 +67,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "NoUserDataErrorCause Length field must be %zu", + "NoUserDataErrorCause length field must be %zu", NoUserDataErrorCause::NoUserDataErrorCauseHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.cpp b/worker/src/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.cpp index b56f8ffb9a..fb17002f33 100644 --- a/worker/src/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.cpp @@ -26,7 +26,7 @@ namespace RTC if (causeCode != ErrorCause::ErrorCauseCode::OUT_OF_RESOURCE) { - MS_WARN_DEV("invalid Error Cause code"); + MS_WARN_DEV("invalid error cause code"); return nullptr; } @@ -61,7 +61,7 @@ namespace RTC if (causeLength != ErrorCause::ErrorCauseHeaderLength) { MS_WARN_TAG( - sctp, "OutOfResourceErrorCause Length field must be %zu", ErrorCause::ErrorCauseHeaderLength); + sctp, "OutOfResourceErrorCause length field must be %zu", ErrorCause::ErrorCauseHeaderLength); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.cpp b/worker/src/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.cpp index 79f2258f22..ae65140208 100644 --- a/worker/src/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.cpp @@ -27,7 +27,7 @@ namespace RTC if (causeCode != ErrorCause::ErrorCauseCode::PROTOCOL_VIOLATION) { - MS_WARN_DEV("invalid Error Cause code"); + MS_WARN_DEV("invalid error cause code"); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.cpp b/worker/src/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.cpp index 21e66deff1..9e3b0c64ac 100644 --- a/worker/src/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.cpp @@ -27,7 +27,7 @@ namespace RTC if (causeCode != ErrorCause::ErrorCauseCode::RESTART_OF_AN_ASSOCIATION_WITH_NEW_ADDRESSES) { - MS_WARN_DEV("invalid Error Cause code"); + MS_WARN_DEV("invalid error cause code"); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.cpp b/worker/src/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.cpp index c2cda9389c..5e2aa02360 100644 --- a/worker/src/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.cpp @@ -27,7 +27,7 @@ namespace RTC if (causeCode != ErrorCause::ErrorCauseCode::STALE_COOKIE) { - MS_WARN_DEV("invalid Error Cause code"); + MS_WARN_DEV("invalid error cause code"); return nullptr; } @@ -67,7 +67,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "StaleCookieErrorCause Length field must be %zu", + "StaleCookieErrorCause length field must be %zu", StaleCookieErrorCause::StaleCookieErrorCauseHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.cpp b/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.cpp index 07d5cc8c95..761ba20be8 100644 --- a/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.cpp @@ -27,7 +27,7 @@ namespace RTC if (causeCode != ErrorCause::ErrorCauseCode::UNRECOGNIZED_CHUNK_TYPE) { - MS_WARN_DEV("invalid Error Cause code"); + MS_WARN_DEV("invalid error cause code"); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.cpp b/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.cpp index 908bf1c204..ce31be8e06 100644 --- a/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.cpp @@ -27,7 +27,7 @@ namespace RTC if (causeCode != ErrorCause::ErrorCauseCode::UNRECOGNIZED_PARAMETERS) { - MS_WARN_DEV("invalid Error Cause code"); + MS_WARN_DEV("invalid error cause code"); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.cpp b/worker/src/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.cpp index 42a2b2ae15..7779c94d4f 100644 --- a/worker/src/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.cpp @@ -27,7 +27,7 @@ namespace RTC if (causeCode != ErrorCause::ErrorCauseCode::UNRESOLVABLE_ADDRESS) { - MS_WARN_DEV("invalid Error Cause code"); + MS_WARN_DEV("invalid error cause code"); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp b/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp index 53d53c340a..64cf6d4809 100644 --- a/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp +++ b/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp @@ -27,7 +27,7 @@ namespace RTC if (causeCode != ErrorCause::ErrorCauseCode::USER_INITIATED_ABORT) { - MS_WARN_DEV("invalid Error Cause code"); + MS_WARN_DEV("invalid error cause code"); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.cpp index 68c8ebf605..a1432ee5d6 100644 --- a/worker/src/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.cpp @@ -27,7 +27,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::ADD_INCOMING_STREAMS_REQUEST) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } @@ -71,7 +71,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "AddIncomingStreamsRequestParameter Length field must be %zu", + "AddIncomingStreamsRequestParameter length field must be %zu", AddIncomingStreamsRequestParameter::AddIncomingStreamsRequestParameterHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.cpp index 08f8b3e560..93aa96130d 100644 --- a/worker/src/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.cpp @@ -27,7 +27,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::ADD_OUTGOING_STREAMS_REQUEST) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } @@ -71,7 +71,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "AddOutgoingStreamsRequestParameter Length field must be %zu", + "AddOutgoingStreamsRequestParameter length field must be %zu", AddOutgoingStreamsRequestParameter::AddOutgoingStreamsRequestParameterHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/parameters/CookiePreservativeParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/CookiePreservativeParameter.cpp index c8590a1b53..992ebb76cc 100644 --- a/worker/src/RTC/SCTP/packet/parameters/CookiePreservativeParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/CookiePreservativeParameter.cpp @@ -27,7 +27,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::COOKIE_PRESERVATIVE) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } @@ -67,7 +67,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "CookiePreservativeParameter Length field must be %zu", + "CookiePreservativeParameter length field must be %zu", CookiePreservativeParameter::CookiePreservativeParameterHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.cpp index 5cf796804e..8c491b706b 100644 --- a/worker/src/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.cpp @@ -27,7 +27,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::FORWARD_TSN_SUPPORTED) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } @@ -64,7 +64,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "ForwardTsnSupportedParameter Length field must be %zu", + "ForwardTsnSupportedParameter length field must be %zu", Parameter::ParameterHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.cpp index 2c213f115e..1041c15ffe 100644 --- a/worker/src/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.cpp @@ -26,7 +26,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::HEARTBEAT_INFO) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/parameters/IPv4AddressParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/IPv4AddressParameter.cpp index c7fba21605..05b57e3626 100644 --- a/worker/src/RTC/SCTP/packet/parameters/IPv4AddressParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/IPv4AddressParameter.cpp @@ -28,7 +28,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::IPV4_ADDRESS) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } @@ -68,7 +68,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "IPv4AddressParameter Length field must be %zu", + "IPv4AddressParameter length field must be %zu", IPv4AddressParameter::IPv4AddressParameterHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/parameters/IPv6AddressParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/IPv6AddressParameter.cpp index fc2e390f64..b41a39bd7a 100644 --- a/worker/src/RTC/SCTP/packet/parameters/IPv6AddressParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/IPv6AddressParameter.cpp @@ -28,7 +28,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::IPV6_ADDRESS) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } @@ -68,7 +68,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "IPv6AddressParameter Length field must be %zu", + "IPv6AddressParameter length field must be %zu", IPv6AddressParameter::IPv6AddressParameterHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.cpp index d31b129eb5..b5d4c08f5d 100644 --- a/worker/src/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.cpp @@ -27,7 +27,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::INCOMING_SSN_RESET_REQUEST) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } @@ -69,7 +69,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "IncomingSsnResetRequestParameter Length field must be equal or greater than %zu", + "IncomingSsnResetRequestParameter length field must be equal or greater than %zu", IncomingSsnResetRequestParameter::IncomingSsnResetRequestParameterHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.cpp index 017c24aae6..3aef932dbf 100644 --- a/worker/src/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.cpp @@ -27,7 +27,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::OUTGOING_SSN_RESET_REQUEST) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } @@ -71,7 +71,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "OutgoingSsnResetRequestParameter Length field must be equal or greater than %zu", + "OutgoingSsnResetRequestParameter length field must be equal or greater than %zu", OutgoingSsnResetRequestParameter::OutgoingSsnResetRequestParameterHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.cpp index fee681b435..0ca4184c64 100644 --- a/worker/src/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.cpp @@ -42,7 +42,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::RECONFIGURATION_RESPONSE) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } @@ -106,7 +106,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "ReconfigurationResponseParameter Length field must be %zu or %zu", + "ReconfigurationResponseParameter length field must be %zu or %zu", ReconfigurationResponseParameter::ReconfigurationResponseParameterHeaderLength, ReconfigurationResponseParameter::ReconfigurationResponseParameterHeaderLengthWithOptionalFields); diff --git a/worker/src/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.cpp index a1a64aa228..01293c162c 100644 --- a/worker/src/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.cpp @@ -27,7 +27,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::SSN_TSN_RESET_REQUEST) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } @@ -67,7 +67,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "SsnTsnResetRequestParameter Length field must be %zu", + "SsnTsnResetRequestParameter length field must be %zu", SsnTsnResetRequestParameter::SsnTsnResetRequestParameterHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/packet/parameters/StateCookieParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/StateCookieParameter.cpp index a79e64066d..ad8fe88004 100644 --- a/worker/src/RTC/SCTP/packet/parameters/StateCookieParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/StateCookieParameter.cpp @@ -27,7 +27,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::STATE_COOKIE) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } @@ -127,11 +127,11 @@ namespace RTC MS_TRACE(); // The buffer in which the StateCookie will be written starts at the - // position of the Cookie field in the StateCookieParameter. + // position of the cookie field in the StateCookieParameter. auto* buffer = GetVariableLengthValuePointer(); // The available buffer length is the total buffer length of the // StateCookieParameter minus its fixed header length (no matter there - // was a Cookie already in the Parameter since we are overriding it + // was a cookie already in the parameter since we are overriding it // anyway). const size_t bufferLength = GetBufferLength() - Parameter::ParameterHeaderLength; diff --git a/worker/src/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.cpp index 13825dbbd5..fce8ac8c58 100644 --- a/worker/src/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.cpp @@ -27,7 +27,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::SUPPORTED_ADDRESS_TYPES) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } @@ -64,10 +64,10 @@ namespace RTC auto* parameter = new SupportedAddressTypesParameter(const_cast(buffer), bufferLength); - // Here we must validate that Length field is even. + // Here we must validate that length field is even. if (parameter->GetLengthField() % 2 != 0) { - MS_WARN_TAG(sctp, "wrong Length value (not even)"); + MS_WARN_TAG(sctp, "wrong length value (not even)"); delete parameter; return nullptr; diff --git a/worker/src/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.cpp index 735fd969c9..1983839201 100644 --- a/worker/src/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.cpp @@ -27,7 +27,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::SUPPORTED_EXTENSIONS) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.cpp index 91e499621f..e173ecad21 100644 --- a/worker/src/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.cpp @@ -27,7 +27,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::UNRECOGNIZED_PARAMETER) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } diff --git a/worker/src/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.cpp b/worker/src/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.cpp index 728bf58278..d2a7453ff2 100644 --- a/worker/src/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.cpp +++ b/worker/src/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.cpp @@ -37,7 +37,7 @@ namespace RTC if (parameterType != Parameter::ParameterType::ZERO_CHECKSUM_ACCEPTABLE) { - MS_WARN_DEV("invalid Parameter type"); + MS_WARN_DEV("invalid parameter type"); return nullptr; } @@ -79,7 +79,7 @@ namespace RTC { MS_WARN_TAG( sctp, - "ZeroChecksumAcceptableParameter Length field must be %zu", + "ZeroChecksumAcceptableParameter length field must be %zu", ZeroChecksumAcceptableParameter::ZeroChecksumAcceptableParameterHeaderLength); return nullptr; diff --git a/worker/src/RTC/SCTP/tx/OutstandingData.cpp b/worker/src/RTC/SCTP/tx/OutstandingData.cpp index 20ccc21342..55fb06bd66 100644 --- a/worker/src/RTC/SCTP/tx/OutstandingData.cpp +++ b/worker/src/RTC/SCTP/tx/OutstandingData.cpp @@ -125,7 +125,7 @@ namespace RTC // ACK packets reported in the gap ack blocks. AckGapBlocks(cumulativeTsnAck, gapAckBlocks, ackInfo); - // NACK and possibly mark for retransmit Chunks that weren't acked. + // NACK and possibly mark for retransmit chunks that weren't acked. NackBetweenAckBlocks( cumulativeTsnAck, gapAckBlocks, isInFastRecovery, cumulativeTsnAckAdvanced, ackInfo); @@ -185,7 +185,7 @@ namespace RTC tsn.Increment(); // Chunks that are nacked can be expired. Care should be taken not to - // expire unacked (in-flight) Chunks as they might have been received, + // expire unacked (in-flight) chunks as they might have been received, // but the SACK is either delayed or in-flight and may be received // later. if (item.IsAbandoned()) @@ -198,7 +198,7 @@ namespace RTC } else { - // A non-expired Chunk. No need to iterate any further. + // A non-expired chunk. No need to iterate any further. break; } } @@ -212,7 +212,7 @@ namespace RTC MS_WARN_TAG( sctp, - "marking nacked Chunk %" PRIu32 " and message %" PRIu32 " as expired", + "marking nacked chunk %" PRIu32 " and message %" PRIu32 " as expired", tsnToExpire.Wrap(), item.GetData().GetMessageId()); @@ -239,7 +239,7 @@ namespace RTC { MS_TRACE(); - // All Chunks are always padded to be even divisible by 4. + // All chunks are always padded to be even divisible by 4. const size_t chunkLength = GetSerializedChunkLength(data); this->unackedPayloadBytes += data.GetPayloadLength(); @@ -255,7 +255,7 @@ namespace RTC // No need to send it, it was expired when it was in the send queue. MS_WARN_TAG( sctp, - "marking freshly produced Chunk %" PRIu32 " and message %" PRIu32 " as expired", + "marking freshly produced chunk %" PRIu32 " and message %" PRIu32 " as expired", tsn.Wrap(), item.GetData().GetMessageId()); @@ -777,7 +777,7 @@ namespace RTC /*expiresAtMs*/ Types::ExpiresAtMsInfinite, /*lifecycleId*/ std::nullopt); - // The added Chunk shouldn't be included in `this->unackedPacketBytes`, + // The added chunk shouldn't be included in `this->unackedPacketBytes`, // so set it as acked. addedItem.Ack(); @@ -794,7 +794,7 @@ namespace RTC !other.IsAbandoned() && other.GetData().GetStreamId() == item.GetData().GetStreamId() && other.GetOutgoingMessageId() == item.GetOutgoingMessageId()) { - MS_WARN_TAG(sctp, "marking Chunk %" PRIu32 " as abandoned", tsn.Wrap()); + MS_WARN_TAG(sctp, "marking chunk %" PRIu32 " as abandoned", tsn.Wrap()); if (other.ShouldBeRetransmitted()) { diff --git a/worker/src/RTC/SCTP/tx/RoundRobinSendQueue.cpp b/worker/src/RTC/SCTP/tx/RoundRobinSendQueue.cpp index 71b28c8384..0b87d56c0f 100644 --- a/worker/src/RTC/SCTP/tx/RoundRobinSendQueue.cpp +++ b/worker/src/RTC/SCTP/tx/RoundRobinSendQueue.cpp @@ -423,7 +423,7 @@ namespace RTC Item& item = this->items.front(); Message& message = item.message; - // Allocate Message ID and SSN when the first fragment is sent. + // Allocate message ID and SSN when the first fragment is sent. if (!item.mid.has_value()) { // This entire message has already expired. Try the next one. diff --git a/worker/src/RTC/Transport.cpp b/worker/src/RTC/Transport.cpp index 7f901b2f43..13b128ed57 100644 --- a/worker/src/RTC/Transport.cpp +++ b/worker/src/RTC/Transport.cpp @@ -145,7 +145,7 @@ namespace RTC // NOTE: We don't close `this->sctpAssociation` here since the // `SetDestroying()` method has already been called by the Transport - // subclass and it closed the SCTP Association. + // subclass and it closed the SCTP association. // // NOTE: We cannot do it here in the destructor because here we are no longer // the Transport subclass but Transport parent (this is how the destruction @@ -1483,7 +1483,7 @@ namespace RTC if (this->sctpAssociation) { - // NOTE: We don't invoke `Shutdown()` but `Close()` in the SCTP Association + // NOTE: We don't invoke `Shutdown()` but `Close()` in the SCTP association // because at this point we are closing everything and we won't have any // chance to complete the SCTP SHUTDOWN + SHUTDOWN_ACK + SHUTDOWN_COMPLETE // dance, so we invoke `Close()` which just sends a SCTP ABORT. @@ -1999,7 +1999,7 @@ namespace RTC { MS_DEBUG_TAG( rtcp, - "no Consumer found for received PLI Feedback packet " + "no Consumer found for received PLI feedback packet " "[sender ssrc:%" PRIu32 ", media ssrc:%" PRIu32 "]", feedback->GetSenderSsrc(), feedback->GetMediaSsrc()); @@ -2038,7 +2038,7 @@ namespace RTC { MS_DEBUG_TAG( rtcp, - "no Consumer found for received FIR Feedback packet " + "no Consumer found for received FIR feedback packet " "[sender ssrc:%" PRIu32 ", media ssrc:%" PRIu32 ", item ssrc:%" PRIu32 "]", feedback->GetSenderSsrc(), feedback->GetMediaSsrc(), @@ -2082,7 +2082,7 @@ namespace RTC { MS_DEBUG_TAG( rtcp, - "ignoring unsupported %s Feedback PS AFB packet " + "ignoring unsupported %s feedback PS AFB packet " "[sender ssrc:%" PRIu32 ", media ssrc:%" PRIu32 "]", RTC::RTCP::FeedbackPsPacket::MessageTypeToString(feedback->GetMessageType()).c_str(), feedback->GetSenderSsrc(), @@ -2096,7 +2096,7 @@ namespace RTC { MS_DEBUG_TAG( rtcp, - "ignoring unsupported %s Feedback packet " + "ignoring unsupported %s feedback packet " "[sender ssrc:%" PRIu32 ", media ssrc:%" PRIu32 "]", RTC::RTCP::FeedbackPsPacket::MessageTypeToString(feedback->GetMessageType()).c_str(), feedback->GetSenderSsrc(), @@ -2121,7 +2121,7 @@ namespace RTC { MS_DEBUG_TAG( rtcp, - "no Consumer found for received Feedback packet " + "no Consumer found for received feedback packet " "[sender ssrc:%" PRIu32 ", media ssrc:%" PRIu32 "]", feedback->GetSenderSsrc(), feedback->GetMediaSsrc()); @@ -2137,7 +2137,7 @@ namespace RTC { MS_DEBUG_TAG( rtcp, - "no Consumer found for received NACK Feedback packet " + "no Consumer found for received NACK feedback packet " "[sender ssrc:%" PRIu32 ", media ssrc:%" PRIu32 "]", feedback->GetSenderSsrc(), feedback->GetMediaSsrc()); @@ -2176,7 +2176,7 @@ namespace RTC { MS_DEBUG_TAG( rtcp, - "ignoring unsupported %s Feedback packet " + "ignoring unsupported %s feedback packet " "[sender ssrc:%" PRIu32 ", media ssrc:%" PRIu32 "]", RTC::RTCP::FeedbackRtpPacket::MessageTypeToString(feedback->GetMessageType()).c_str(), feedback->GetSenderSsrc(), diff --git a/worker/test/src/RTC/ICE/TestStunPacket.cpp b/worker/test/src/RTC/ICE/TestStunPacket.cpp index a30aa32aea..ff5fc9088f 100644 --- a/worker/test/src/RTC/ICE/TestStunPacket.cpp +++ b/worker/test/src/RTC/ICE/TestStunPacket.cpp @@ -98,7 +98,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") request->CheckAuthentication(usernameFragment1, password) == RTC::ICE::StunPacket::AuthenticationResult::OK); - // Trying to modify a STUN Packet once protected must throw. + // Trying to modify a STUN packet once protected must throw. REQUIRE_THROWS_AS(request->Protect("qweqwe"), MediaSoupError); REQUIRE_THROWS_AS(request->Protect(), MediaSoupError); @@ -138,7 +138,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") request->CheckAuthentication(usernameFragment1, password) == RTC::ICE::StunPacket::AuthenticationResult::OK); - // Trying to modify a STUN Packet once protected must throw. + // Trying to modify a STUN packet once protected must throw. REQUIRE_THROWS_AS(request->Protect("qweqwe"), MediaSoupError); REQUIRE_THROWS_AS(request->Protect(), MediaSoupError); @@ -178,7 +178,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") request->CheckAuthentication(usernameFragment1, password) == RTC::ICE::StunPacket::AuthenticationResult::OK); - // Trying to modify a STUN Packet once protected must throw. + // Trying to modify a STUN packet once protected must throw. REQUIRE_THROWS_AS(request->Protect("qweqwe"), MediaSoupError); REQUIRE_THROWS_AS(request->Protect(), MediaSoupError); } @@ -516,7 +516,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") uint16_t errorCode = 666; std::string errorReasonPhrase = "UPPS UNKNOWN ERROR 😊"; - // Total length of the Attributes. + // Total length of the attributes. size_t attributesLen = (4 + 27 + 1) + (4 + 4) + (4 + 8) + (4) + (4 + 4) + (4 + 18 + 2) + (4 + 4 + 23 + 1); @@ -528,7 +528,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") request->AddSoftware(software); request->AddErrorCode(errorCode, errorReasonPhrase); - // It should fail if we try to add a duplicated Attribute. + // It should fail if we try to add a duplicated attribute. REQUIRE_THROWS_AS(request->AddUsername(username), MediaSoupError); REQUIRE_THROWS_AS(request->AddPriority(priority), MediaSoupError); REQUIRE_THROWS_AS(request->AddIceControlling(iceControlling), MediaSoupError); @@ -646,7 +646,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") transactionId, RTC::ICE::StunPacket::TransactionIdLength)); - /* Protect the STUN Packet. */ + /* Protect the STUN packet. */ std::string password = "asjhdkjhkasd"; @@ -683,7 +683,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") request->CheckAuthentication(usernameFragment1, password) == RTC::ICE::StunPacket::AuthenticationResult::OK); - // Trying to modify a STUN Packet once protected must throw. + // Trying to modify a STUN packet once protected must throw. REQUIRE_THROWS_AS(request->Protect("qweqwe"), MediaSoupError); REQUIRE_THROWS_AS(request->Protect(), MediaSoupError); } @@ -732,7 +732,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") uv_ip4_addr("22.33.0.125", 5678, xorMappedAddressIn); - // Total length of the Attributes. + // Total length of the attributes. size_t attributesLen = (4 + 8); successResponse->AddXorMappedAddress(xorMappedAddress); @@ -797,7 +797,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") uv_ip6_addr("2001:db8::1234", 20002, xorMappedAddressIn6); - // Total length of the Attributes. + // Total length of the attributes. attributesLen = (4 + 20); successResponse->AddXorMappedAddress(xorMappedAddress); @@ -838,7 +838,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") REQUIRE(ip == Utils::IP::NormalizeIp(expectedIp)); REQUIRE(port == 20002); - /* Protect the STUN Packet. */ + /* Protect the STUN packet. */ std::string password = "asjhdkjhkasd"; @@ -875,7 +875,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") successResponse->CheckAuthentication(password) == RTC::ICE::StunPacket::AuthenticationResult::OK); - // Trying to modify a STUN Packet once protected must throw. + // Trying to modify a STUN packet once protected must throw. REQUIRE_THROWS_AS(successResponse->Protect("qweqwe"), MediaSoupError); REQUIRE_THROWS_AS(successResponse->Protect(), MediaSoupError); } @@ -918,7 +918,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") uint16_t errorCode = 666; std::string errorReasonPhrase = "UPPS UNKNOWN ERROR 😊"; - // Total length of the Attributes. + // Total length of the attributes. size_t attributesLen = (4 + 4 + 23 + 1); errorResponse->AddErrorCode(errorCode, errorReasonPhrase); @@ -949,7 +949,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") /*hasMessageIntegrity*/ false, /*hasFingerprint*/ false); - /* Protect the STUN Packet. */ + /* Protect the STUN packet. */ std::string password = "23786asdas123"; @@ -985,7 +985,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") REQUIRE( errorResponse->CheckAuthentication(password) == RTC::ICE::StunPacket::AuthenticationResult::OK); - // Trying to modify a STUN Packet once protected must throw. + // Trying to modify a STUN packet once protected must throw. REQUIRE_THROWS_AS(errorResponse->Protect("qweqwe"), MediaSoupError); REQUIRE_THROWS_AS(errorResponse->Protect(), MediaSoupError); @@ -1002,7 +1002,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") errorCode = 400; errorReasonPhrase = "Bad Request"; - // Total length of the Attributes. + // Total length of the attributes. attributesLen = (4 + 4 + 11 + 1); errorResponse->AddErrorCode(errorCode, errorReasonPhrase); @@ -1033,9 +1033,9 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") /*hasMessageIntegrity*/ false, /*hasFingerprint*/ false); - /* Protect the STUN Packet (without password). */ + /* Protect the STUN packet (without password). */ - // Protect() without password only adds FINGERPRINT Attribute. + // Protect() without password only adds FINGERPRINT attribute. errorResponse->Protect(); CHECK_STUN_PACKET(/*packet*/ errorResponse.get(), @@ -1064,12 +1064,12 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") /*hasMessageIntegrity*/ false, /*hasFingerprint*/ true); - // Cannot check authentication in a STUN Packet without MESSAGE-INTEGRITY. + // Cannot check authentication in a STUN packet without MESSAGE-INTEGRITY. REQUIRE( errorResponse->CheckAuthentication(password) == RTC::ICE::StunPacket::AuthenticationResult::BAD_MESSAGE); - // Trying to modify a STUN Packet once protected must throw. + // Trying to modify a STUN packet once protected must throw. REQUIRE_THROWS_AS(errorResponse->Protect("qweqwe"), MediaSoupError); REQUIRE_THROWS_AS(errorResponse->Protect(), MediaSoupError); } @@ -1151,7 +1151,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") successResponse->CheckAuthentication("qwekqjhwekjahsd") == RTC::ICE::StunPacket::AuthenticationResult::OK); - // Trying to modify a STUN Packet once protected must throw. + // Trying to modify a STUN packet once protected must throw. REQUIRE_THROWS_AS(successResponse->Protect("qweqwe"), MediaSoupError); REQUIRE_THROWS_AS(successResponse->Protect(), MediaSoupError); } @@ -1167,7 +1167,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") std::unique_ptr errorResponse{ request->CreateErrorResponse( iceCommon::ResponseFactoryBuffer, sizeof(iceCommon::ResponseFactoryBuffer), 666, "BAD STUFF") }; - // Total length of the Attributes (ERROR-CODE). + // Total length of the attributes (ERROR-CODE). const size_t attributesLen = (4 + 4 + 9 + 3); CHECK_STUN_PACKET(/*packet*/ errorResponse.get(), @@ -1236,7 +1236,7 @@ SCENARIO("ICE StunPacket", "[serializable][ice][stunpacket]") errorResponse->CheckAuthentication("qwekqjhwekjahsd") == RTC::ICE::StunPacket::AuthenticationResult::OK); - // Trying to modify a STUN Packet once protected must throw. + // Trying to modify a STUN packet once protected must throw. REQUIRE_THROWS_AS(errorResponse->Protect("qweqwe"), MediaSoupError); REQUIRE_THROWS_AS(errorResponse->Protect(), MediaSoupError); } diff --git a/worker/test/src/RTC/ICE/iceCommon.cpp b/worker/test/src/RTC/ICE/iceCommon.cpp index ed6f581a06..1bff2c0d58 100644 --- a/worker/test/src/RTC/ICE/iceCommon.cpp +++ b/worker/test/src/RTC/ICE/iceCommon.cpp @@ -3,7 +3,7 @@ namespace iceCommon { - // NOTE: We don't need `alignas(4)` for STUN Packet parsing. However we do it + // NOTE: We don't need `alignas(4)` for STUN packet parsing. However we do it // for consistency with rtpCommon.cpp and sctpCommon.cpp. alignas(4) thread_local uint8_t FactoryBuffer[]; alignas(4) thread_local uint8_t ResponseFactoryBuffer[]; diff --git a/worker/test/src/RTC/RTCP/TestFeedbackRtpEcn.cpp b/worker/test/src/RTC/RTCP/TestFeedbackRtpEcn.cpp index aef91bc4ed..110f6b8d8e 100644 --- a/worker/test/src/RTC/RTCP/TestFeedbackRtpEcn.cpp +++ b/worker/test/src/RTC/RTCP/TestFeedbackRtpEcn.cpp @@ -8,16 +8,16 @@ SCENARIO("RTCP Feedback RTP ECN", "[rtcp][feedback-rtp][ecn]") // clang-format off alignas(4) uint8_t buffer[] = { - 0x88, 0xcd, 0x00, 0x07, // Type: 205 (Generic RTP Feedback), Count: 8 (ECN) Length: 7 + 0x88, 0xcd, 0x00, 0x07, // Type: 205 (Generic RTP feedback), Count: 8 (ECN) Length: 7 0x00, 0x00, 0x00, 0x01, // Sender SSRC: 0x00000001 0x03, 0x30, 0xbd, 0xee, // Media source SSRC: 0x0330bdee - 0x00, 0x00, 0x00, 0x01, // Extended Highest Sequence Number - 0x00, 0x00, 0x00, 0x01, // ECT (0) Counter - 0x00, 0x00, 0x00, 0x01, // ECT (1) Counter - 0x00, 0x01, // ECN-CE Counter - 0x00, 0x01, // not-ECT Counter - 0x00, 0x01, // Lost Packets Counter - 0x00, 0x01 // Duplication Counter + 0x00, 0x00, 0x00, 0x01, // Extended highest sequence number + 0x00, 0x00, 0x00, 0x01, // ECT (0) counter + 0x00, 0x00, 0x00, 0x01, // ECT (1) counter + 0x00, 0x01, // ECN-CE counter + 0x00, 0x01, // not-ECT counter + 0x00, 0x01, // Lost Packets counter + 0x00, 0x01 // Duplication counter }; // clang-format on diff --git a/worker/test/src/RTC/RTCP/TestFeedbackRtpNack.cpp b/worker/test/src/RTC/RTCP/TestFeedbackRtpNack.cpp index abacc4a091..edff36007f 100644 --- a/worker/test/src/RTC/RTCP/TestFeedbackRtpNack.cpp +++ b/worker/test/src/RTC/RTCP/TestFeedbackRtpNack.cpp @@ -10,7 +10,7 @@ SCENARIO("RTCP Feedback RTP NACK", "[rtcp][feedback-rtp][nack]") // clang-format off alignas(4) uint8_t buffer[] = { - 0x81, 0xcd, 0x00, 0x03, // Type: 205 (Generic RTP Feedback), Length: 3 + 0x81, 0xcd, 0x00, 0x03, // Type: 205 (Generic RTP feedback), Length: 3 0x00, 0x00, 0x00, 0x01, // Sender SSRC: 0x00000001 0x03, 0x30, 0xbd, 0xee, // Media source SSRC: 0x0330bdee 0x0b, 0x8f, 0x00, 0x03 // NACK PID: 2959, NACK BLP: 0x0003 diff --git a/worker/test/src/RTC/RTCP/TestFeedbackRtpSrReq.cpp b/worker/test/src/RTC/RTCP/TestFeedbackRtpSrReq.cpp index e829e093f3..e175c838c4 100644 --- a/worker/test/src/RTC/RTCP/TestFeedbackRtpSrReq.cpp +++ b/worker/test/src/RTC/RTCP/TestFeedbackRtpSrReq.cpp @@ -10,7 +10,7 @@ SCENARIO("RTCP Feedback RTP SR-REQ", "[rtcp][feedback-rtp][sr-req]") // clang-format off alignas(4) uint8_t buffer[] = { - 0x85, 0xcd, 0x00, 0x02, // Type: 205 (Generic RTP Feedback), Count: 5 (SR-REQ) Length: 3 + 0x85, 0xcd, 0x00, 0x02, // Type: 205 (Generic RTP feedback), Count: 5 (SR-REQ) Length: 3 0x00, 0x00, 0x00, 0x01, // Sender SSRC: 0x00000001 0x03, 0x30, 0xbd, 0xee, // Media source SSRC: 0x0330bdee }; diff --git a/worker/test/src/RTC/RTCP/TestFeedbackRtpTllei.cpp b/worker/test/src/RTC/RTCP/TestFeedbackRtpTllei.cpp index 5d13bbad9f..5736801205 100644 --- a/worker/test/src/RTC/RTCP/TestFeedbackRtpTllei.cpp +++ b/worker/test/src/RTC/RTCP/TestFeedbackRtpTllei.cpp @@ -10,7 +10,7 @@ SCENARIO("RTCP Feedback RTP TLLEI", "[rtcp][feedback-rtp][tllei]") // clang-format off alignas(4) uint8_t buffer[] = { - 0x87, 0xcd, 0x00, 0x03, // Type: 205 (Generic RTP Feedback), Count: 7 (TLLEI) Length: 3 + 0x87, 0xcd, 0x00, 0x03, // Type: 205 (Generic RTP feedback), Count: 7 (TLLEI) Length: 3 0x00, 0x00, 0x00, 0x01, // Sender SSRC: 0x00000001 0x03, 0x30, 0xbd, 0xee, // Media source SSRC: 0x0330bdee 0x00, 0x01, 0xaa, 0x55 diff --git a/worker/test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp b/worker/test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp index 479fe2fc0e..9490ffc726 100644 --- a/worker/test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp +++ b/worker/test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp @@ -10,7 +10,7 @@ SCENARIO("RTCP Feedback RTP TMMBR", "[rtcp][feedback-rtp][tmmb]") // clang-format off alignas(4) uint8_t buffer[] = { - 0x83, 0xcd, 0x00, 0x04, // Type: 205 (Generic RTP Feedback), Count: 8 (TMMBR) Length: 7 + 0x83, 0xcd, 0x00, 0x04, // Type: 205 (Generic RTP feedback), Count: 8 (TMMBR) Length: 7 0x00, 0x00, 0x00, 0x01, // Sender SSRC: 0x00000001 0x03, 0x30, 0xbd, 0xee, // Media source SSRC: 0x0330bdee 0x02, 0xd0, 0x37, 0x02, // SSRC: 0x02d03702 diff --git a/worker/test/src/RTC/RTCP/TestSenderReport.cpp b/worker/test/src/RTC/RTCP/TestSenderReport.cpp index d4d8e15b9b..e84ebd243a 100644 --- a/worker/test/src/RTC/RTCP/TestSenderReport.cpp +++ b/worker/test/src/RTC/RTCP/TestSenderReport.cpp @@ -5,7 +5,7 @@ SCENARIO("RTCP SenderReport", "[rtcp][sender-report]") { - // RTCP Packet. Sender Report and Receiver Report. + // RTCP packet. Sender Report and Receiver Report. // clang-format off alignas(4) uint8_t buffer[] = diff --git a/worker/test/src/RTC/RTP/TestPacket.cpp b/worker/test/src/RTC/RTP/TestPacket.cpp index 2a25b17687..8f35587373 100644 --- a/worker/test/src/RTC/RTP/TestPacket.cpp +++ b/worker/test/src/RTC/RTP/TestPacket.cpp @@ -489,7 +489,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") 0x90, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, - 0xbe, 0xde, 0x00, 0x03, // Header Extension + 0xbe, 0xde, 0x00, 0x03, // Header extension 0x10, 0xaa, 0x21, 0xbb, // - id: 1, len: 1 0xff, 0x00, 0x00, 0x33, // - id: 2, len: 2 0xff, 0xff, 0xff, 0xff, // - id: 3, len: 4 @@ -672,7 +672,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") 0x90, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, - 0x10, 0x00, 0x00, 0x04, // Header Extension + 0x10, 0x00, 0x00, 0x04, // Header extension 0x00, 0x00, 0x01, 0x00, // - id: 1, len: 0 0x02, 0x01, 0x42, 0x00, // - id: 2, len: 1 0x03, 0x02, 0x11, 0x22, // - id: 3, len: 2 @@ -1016,7 +1016,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") 0x90, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, - 0xbe, 0xde, 0x00, 0x03, // Header Extension + 0xbe, 0xde, 0x00, 0x03, // Header extension 0x10, 0xaa, 0x21, 0xbb, // - id: 1, len: 1 0xff, 0x00, 0x00, 0x33, // - id: 2, len: 2 0xff, 0xff, 0xff, 0xff, // - id: 3, len: 4 @@ -1070,13 +1070,13 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") // Extensions: // - // Using One-Byte Extensions: - // - Header Extension value length: 1 + 1 + 1 + 2 + 1 + 3 = 9 => 12 (padded) - // - Header Extension length: 4 + 12 = 16 + // Using One-Byte extensions: + // - Header extension value length: 1 + 1 + 1 + 2 + 1 + 3 = 9 => 12 (padded) + // - Header extension length: 4 + 12 = 16 // - // Using Two-Bytes Extensions: - // - Header Extension value length: 2 + 1 + 2 + 2 + 2 + 3 = 12 - // - Header Extension length: 4 + 12 = 16 + // Using Two-Bytes extensions: + // - Header extension value length: 2 + 1 + 2 + 2 + 2 + 3 = 12 + // - Header extension length: 4 + 12 = 16 // // Extension id 1. rtpCommon::DataBuffer[0] = 11; @@ -1106,7 +1106,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") /*len*/ 3, /*value*/ rtpCommon::DataBuffer + 3); - // Add One-Byte Extensions. + // Add One-Byte extensions. packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::OneByte, extensions); packet->SetPayload(rtpCommon::DataBuffer, 10); @@ -1349,7 +1349,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") packet->GetPayload(), packet->GetPayloadLength(), rtpCommon::DataBuffer, 1) == true); REQUIRE(packet->IsPaddedTo4Bytes() == true); - /* Remove Header Extension. */ + /* Remove header extension. */ packet->RemoveHeaderExtension(); @@ -1383,7 +1383,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") packet->GetPayload(), packet->GetPayloadLength(), rtpCommon::DataBuffer, 1) == true); REQUIRE(packet->IsPaddedTo4Bytes() == true); - // Add Two-Bytes Extensions. + // Add Two-Bytes extensions. packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::TwoBytes, extensions); CHECK_RTP_PACKET( @@ -1439,7 +1439,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") std::vector extensions; - // Can fit into One-Byte type Extensions. + // Can fit into One-Byte type extensions. extensions.assign( { { RTC::RtpHeaderExtensionUri::Type::MID, 1, 1, rtpCommon::DataBuffer }, @@ -1448,7 +1448,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::Auto, extensions); REQUIRE(packet->HasOneByteExtensions()); - // Requires Two-Bytes type Extensions due to id > 14. + // Requires Two-Bytes type extensions due to id > 14. extensions.assign( { { RTC::RtpHeaderExtensionUri::Type::ABS_SEND_TIME, 15, 2, rtpCommon::DataBuffer } @@ -1456,7 +1456,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::Auto, extensions); REQUIRE(packet->HasTwoBytesExtensions()); - // Requires Two-Bytes type Extensions due to length 0. + // Requires Two-Bytes type extensions due to length 0. extensions.assign( { { RTC::RtpHeaderExtensionUri::Type::REPAIRED_RTP_STREAM_ID, 1, 0, rtpCommon::DataBuffer } @@ -1464,7 +1464,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::Auto, extensions); REQUIRE(packet->HasTwoBytesExtensions()); - // Requires Two-Bytes type Extensions due to length > 16. + // Requires Two-Bytes type extensions due to length > 16. extensions.assign( { { RTC::RtpHeaderExtensionUri::Type::TIME_OFFSET, 1, 17, rtpCommon::DataBuffer } @@ -1595,7 +1595,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") std::vector extensions; auto* d = rtpCommon::DataBuffer; - // Invalid Extension id 0. + // Invalid extension id 0. extensions.assign( { { RTC::RtpHeaderExtensionUri::Type::MID, 0, 4, d }, @@ -1609,7 +1609,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::TwoBytes, extensions), MediaSoupTypeError); - // Invalid Extension id > 14 in One-Byte. + // Invalid extension id > 14 in One-Byte. extensions.assign( { { RTC::RtpHeaderExtensionUri::Type::VIDEO_ORIENTATION, 15, 2, d }, @@ -1622,7 +1622,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") MediaSoupTypeError); REQUIRE_NOTHROW(packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::TwoBytes, extensions)); - // Invalid Extension length 0 in One-Byte. + // Invalid extension length 0 in One-Byte. extensions.assign( { { RTC::RtpHeaderExtensionUri::Type::MID, 3, 0, d }, @@ -1636,7 +1636,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") MediaSoupTypeError); REQUIRE_NOTHROW(packet->SetExtensions(RTC::RTP::Packet::ExtensionsType::TwoBytes, extensions)); - // Invalid Extension length > 16 in One-Byte. + // Invalid extension length > 16 in One-Byte. extensions.assign( { { RTC::RtpHeaderExtensionUri::Type::MEDIASOUP_PACKET_ID, 3, 17, d }, @@ -1828,9 +1828,9 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") std::vector extensions; - // One-Byte Extensions: - // - Header Extension value length: 1 + 1 + 1 + 2 + 1 + 3 = 9 => 12 (padded) - // - Header Extension length: 4 + 12 = 16 + // One-Byte extensions: + // - Header extension value length: 1 + 1 + 1 + 2 + 1 + 3 = 9 => 12 (padded) + // - Header extension length: 4 + 12 = 16 // // clang-format off uint8_t extension1[] = @@ -2180,7 +2180,7 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") packet->SetBufferReleasedListener(std::addressof(packetBufferReleasedListener)); - // If we destroy the Packet it should invoke the listener. + // If we destroy the packet it should invoke the listener. packet.reset(nullptr); REQUIRE(packetBufferReleased == true); @@ -2206,14 +2206,14 @@ SCENARIO("RTP Packet", "[serializable][rtp][packet]") packet->SetBufferReleasedListener(std::addressof(packetBufferReleasedListener)); - // If we serialize the Packet into another buffer it should invoke the + // If we serialize the packet into another buffer it should invoke the // listener. packet->Serialize(rtpCommon::SerializeBuffer, sizeof(rtpCommon::SerializeBuffer)); REQUIRE(packetBufferReleased == true); // NOTE: We need to unset the buffer released listener because once the - // unique_ptr of the Packet gets out of the scope, the Packet will be + // unique_ptr of the packet gets out of the scope, the packet will be // deallocated and will invoke the buffer released listener, which at // that time is already out of the scope (it's lifetime ended) so it's // been destroyed. diff --git a/worker/test/src/RTC/RTP/TestSharedPacket.cpp b/worker/test/src/RTC/RTP/TestSharedPacket.cpp index ced108a184..d3443a5ef1 100644 --- a/worker/test/src/RTC/RTP/TestSharedPacket.cpp +++ b/worker/test/src/RTC/RTP/TestSharedPacket.cpp @@ -49,7 +49,7 @@ SCENARIO("RTP SharedPacket", "[rtp][sharedpacket]") SECTION("constructor with packet and copy constructor") { - // Create sharedPacket1 using constructor with a Packet. + // Create sharedPacket1 using constructor with a packet. RTC::RTP::SharedPacket sharedPacket1(packetA); REQUIRE(sharedPacket1.HasPacket()); diff --git a/worker/test/src/RTC/RTP/rtpCommon.cpp b/worker/test/src/RTC/RTP/rtpCommon.cpp index 98ea09c61d..4df5d01b36 100644 --- a/worker/test/src/RTC/RTP/rtpCommon.cpp +++ b/worker/test/src/RTC/RTP/rtpCommon.cpp @@ -3,7 +3,7 @@ namespace rtpCommon { - // NOTE: Buffers must be 4-byte aligned since RTP Packet parsing casts them + // NOTE: Buffers must be 4-byte aligned since RTP packet parsing casts them // to structs (e.g. FixedHeader, HeaderExtension) that require 4-byte // alignment. Without this, accessing multi-byte fields would be undefined // behavior on strict-alignment architectures. diff --git a/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp b/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp index 4c348d3220..2e0ae938b0 100644 --- a/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp +++ b/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp @@ -79,11 +79,11 @@ SCENARIO("SCTP Negotiated Capabilities", "[sctp][negotiatedcapabilities]") auto* remoteSupportedExtensionsParameter = remoteChunk->BuildParameterInPlace(); - // NOTE: Missing FORWARD_TSN, but peer announced support for it via - // Forward-TSN-Supported Parameter negotiation). - // NOTE: Missing RE_CONFIG (needed for Partial Reliability Extension + // NOTE: Missing FORWARD-TSN, but peer announced support for it via + // Forward-TSN-Supported parameter negotiation). + // NOTE: Missing RE-CONFIG (needed for Partial Reliability Extension // negotiation). - // NOTE: Missing I_FORWARD_TSN (needed for Message Interleaving negotiation). + // NOTE: Missing I-FORWARD-TSN (needed for Message Interleaving negotiation). remoteSupportedExtensionsParameter->AddChunkType(RTC::SCTP::Chunk::ChunkType::I_DATA); remoteSupportedExtensionsParameter->Consolidate(); diff --git a/worker/test/src/RTC/SCTP/packet/TestPacket.cpp b/worker/test/src/RTC/SCTP/packet/TestPacket.cpp index 3930d8b544..b0f4e5c8d7 100644 --- a/worker/test/src/RTC/SCTP/packet/TestPacket.cpp +++ b/worker/test/src/RTC/SCTP/packet/TestPacket.cpp @@ -137,8 +137,8 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]") 0xEE, 0b00001100, 0x00, 0x07, // Unknown data: 0xAABBCC, 1 byte of padding 0xAA, 0xBB, 0xCC, 0x00, - // Chunk 3: Type:5 (HEARTBEAT_ACK), Flags:0b00000000, Length: 10 - // NOTE: Chunk Length field must exclude padding of the last Parameter. + // Chunk 3: Type:5 (HEARTBEAT-ACK), Flags:0b00000000, Length: 10 + // NOTE: Chunk length field must exclude padding of the last parameter. 0x05, 0b00000000, 0x00, 0x0A, // Parameter 1: Type:1 (HEARBEAT_INFO), Length: 6 0x00, 0x01, 0x00, 0x06, @@ -521,7 +521,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]") REQUIRE(packet->GetFirstChunkOfType() == nullptr); - /* Modify the Packet and add Chunks. */ + /* Modify the packet and add chunks. */ packet->SetSourcePort(1000); packet->SetDestinationPort(6000); @@ -537,7 +537,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]") chunk1->SetNumberOfInboundStreams(22200); chunk1->SetInitialTsn(14141414); - // Parameter 1.1: IPV4_ADDRESS, length: 8 bytes. + // Parameter 1.1: IPV4-ADDRESS, length: 8 bytes. // NOLINTNEXTLINE (readability-identifier-naming) auto* parameter1_1 = chunk1->BuildParameterInPlace(); @@ -549,7 +549,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]") REQUIRE(chunk1->GetFirstParameterOfType() == parameter1_1); - // Parameter 1.2: COOKIE_PRESERVATIVE, length: 8 bytes. + // Parameter 1.2: COOKIE-PRESERVATIVE, length: 8 bytes. // NOLINTNEXTLINE (readability-identifier-naming) auto* parameter1_2 = chunk1->BuildParameterInPlace(); @@ -558,7 +558,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]") REQUIRE(chunk1->GetFirstParameterOfType() == parameter1_2); - // Consolidate Chunk 1 after consolidating its Parameters 1.1 and 1.2. + // Consolidate chunk 1 after consolidating its parameters 1.1 and 1.2. chunk1->Consolidate(); REQUIRE(chunk1->GetFirstParameterOfType() == parameter1_1); @@ -566,10 +566,10 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]") REQUIRE(packet->GetFirstChunkOfType() == chunk1); - // Chunk 2: HEARTBEAT_REQUEST, length: 4 bytes. + // Chunk 2: HEARTBEAT-REQUEST, length: 4 bytes. auto* chunk2 = packet->BuildChunkInPlace(); - // Parameter 2.1: HEARTBEAT_INFO, length: 4 bytes. + // Parameter 2.1: HEARTBEAT-INFO, length: 4 bytes. // NOLINTNEXTLINE (readability-identifier-naming) auto* parameter2_1 = chunk2->BuildParameterInPlace(); @@ -581,7 +581,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]") std::memset(sctpCommon::DataBuffer, 0xFF, 3); - // Consolidate the Chunk after consolidating its Parameters. + // Consolidate the chunk after consolidating its parameters. chunk2->Consolidate(); REQUIRE(chunk2->GetFirstParameterOfType() == parameter2_1); @@ -614,7 +614,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]") /*hasValidCrc32cChecksum*/ true, /*chunksCount*/ 2); - /* Serialize the Packet. */ + /* Serialize the packet. */ packet->Serialize(sctpCommon::SerializeBuffer, packet->GetLength()); @@ -635,7 +635,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]") REQUIRE(packet->GetFirstChunkOfType() == chunk1); REQUIRE(packet->GetFirstChunkOfType() == chunk2); - /* Clone the Packet. */ + /* Clone the packet. */ packet.reset(packet->Clone(sctpCommon::CloneBuffer, packet->GetLength())); @@ -759,7 +759,7 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]") packet->SetVerificationTag(3); packet->SetChecksum(4); - // 4 bytes Chunk. + // 4 bytes chunk. auto* chunk1 = RTC::SCTP::ShutdownCompleteChunk::Factory(sctpCommon::FactoryBuffer + 1000, 1000); chunk1->SetT(true); @@ -767,11 +767,11 @@ SCENARIO("SCTP Packet", "[serializable][sctp][packet]") packet->AddChunk(chunk1); REQUIRE(packet->GetFirstChunkOfType() != nullptr); - // NOTE: The stored Chunk is not the same than the given one since it's + // NOTE: The stored chunk is not the same than the given one since it's // internally cloned. REQUIRE(packet->GetFirstChunkOfType() != chunk1); - // Once added, we can delete the Chunk. + // Once added, we can delete the chunk. delete chunk1; // Packet length must be: diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp index 2ae44f9c14..034a1f5406 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp @@ -19,7 +19,7 @@ SCENARIO("SCTP Abort Association Chunk (6)", "[serializable][sctp][chunk]") { // Type:6 (ABORT), Flags:0b00000000, Length: 12 0x06, 0b00000001, 0x00, 0x0C, - // Error Cause 3: Code:1 (STALE_COOKIE), Length: 8 + // Error Cause 3: Code:1 (STALE-COOKIE), Length: 8 0x00, 0x03, 0x00, 0x08, // Measure of Staleness: 0x12345678 0x12, 0x34, 0x56, 0x78, @@ -152,7 +152,7 @@ SCENARIO("SCTP Abort Association Chunk (6)", "[serializable][sctp][chunk]") REQUIRE(chunk->GetT() == false); - /* Modify it and add Error Causes. */ + /* Modify it and add error causes. */ chunk->SetT(true); @@ -236,7 +236,7 @@ SCENARIO("SCTP Abort Association Chunk (6)", "[serializable][sctp][chunk]") chunk->SetT(true); - // 8 bytes Error Cause. + // 8 bytes error cause. auto* errorCause1 = RTC::SCTP::StaleCookieErrorCause::Factory( sctpCommon::FactoryBuffer + 1000, sizeof(sctpCommon::FactoryBuffer)); @@ -244,7 +244,7 @@ SCENARIO("SCTP Abort Association Chunk (6)", "[serializable][sctp][chunk]") chunk->AddErrorCause(errorCause1); - // Once added, we can delete the Error Cause. + // Once added, we can delete the error cause. delete errorCause1; // Chunk length must be: diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestCookieAckChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestCookieAckChunk.cpp index 7ce57d9d90..a69d7a031a 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestCookieAckChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestCookieAckChunk.cpp @@ -15,7 +15,7 @@ SCENARIO("SCTP Cookie Acknowledgement Chunk (11)", "[serializable][sctp][chunk]" // clang-format off alignas(4) uint8_t buffer[] = { - // Type:11 (COOKIE_ACK), Flags:0x00000001, T: 1, Length: 4 + // Type:11 (COOKIE-ACK), Flags:0x00000001, T: 1, Length: 4 0x0B, 0b00000101, 0x00, 0x04, // Extra bytes that should be ignored 0xAA diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestCookieEchoChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestCookieEchoChunk.cpp index 0ff0e80180..4fca9eda31 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestCookieEchoChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestCookieEchoChunk.cpp @@ -15,7 +15,7 @@ SCENARIO("SCTP Cookie Echo Chunk (10)", "[serializable][sctp][chunk]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:A (COOKIE_ECHO), Flags: 0b00000000, Length: 9 + // Type:A (COOKIE-ECHO), Flags: 0b00000000, Length: 9 0x0A, 0b00000000, 0x00, 0x09, // Cookie: 0x1122334455, 0x11, 0x22, 0x33, 0x44, diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestForwardTsnChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestForwardTsnChunk.cpp index 1886472306..84613d80a2 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestForwardTsnChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestForwardTsnChunk.cpp @@ -17,7 +17,7 @@ SCENARIO("Forward Cumulative TSN Chunk (192)", "[serializable][sctp][chunk]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:192 (FORWARD_TSN), Flags: 0b00000000, Length: 16 + // Type:192 (FORWARD-TSN), Flags: 0b00000000, Length: 16 0xC0, 0b00000000, 0x00, 0x10, // New Cumulative TSN: 287454020, 0x11, 0x22, 0x33, 0x44, @@ -122,13 +122,13 @@ SCENARIO("Forward Cumulative TSN Chunk (192)", "[serializable][sctp][chunk]") // clang-format off alignas(4) uint8_t buffer1[] = { - // Type:192 (FORWARD_TSN), Flags: 0b00000000, Length: 14 (should be 16) + // Type:192 (FORWARD-TSN), Flags: 0b00000000, Length: 14 (should be 16) 0xC0, 0b00000000, 0x00, 0x0E, // New Cumulative TSN: 287454020, 0x11, 0x22, 0x33, 0x44, // Stream 1: 4660, Stream Sequence 1: 17185 0x12, 0x34, 0x43, 0x21, - // Stream 2: 22136, Stream Sequence 2 (missing in Length field) + // Stream 2: 22136, Stream Sequence 2 (missing in length field) 0x56, 0x78, 0x87, 0x65, }; // clang-format on diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp index de21205a0d..8d3a5c2faa 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp @@ -18,8 +18,8 @@ SCENARIO("SCTP Hearbeat Acknowledgement Chunk (5)", "[serializable][sctp][chunk] // clang-format off alignas(4) uint8_t buffer[] = { - // Type: 5 (HEARTBEAT_ACK), Flags:0b00000000, Length: 22 - // NOTE: Chunk Length field must exclude padding of the last Parameter. + // Type: 5 (HEARTBEAT-ACK), Flags:0b00000000, Length: 22 + // NOTE: Chunk length field must exclude padding of the last parameter. 0x05, 0b00000000, 0x00, 0x16, // Parameter 1: Type:1 (HEARBEAT_INFO), Length: 11 0x00, 0x01, 0x00, 0x0B, @@ -243,7 +243,7 @@ SCENARIO("SCTP Hearbeat Acknowledgement Chunk (5)", "[serializable][sctp][chunk] /*canHaveErrorCauses*/ false, /*errorCausesCount*/ 0); - /* Modify it by adding Parameters. */ + /* Modify it by adding parameters. */ auto* parameter1 = chunk->BuildParameterInPlace(); diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp index d94c75d9e0..0eba4ea013 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp @@ -18,8 +18,8 @@ SCENARIO("SCTP Hearbeat Request Chunk (4)", "[serializable][sctp][chunk]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:4 (HEARTBEAT_REQUEST), Flags:0b00000000, Length: 22 - // NOTE: Length field must exclude the padding of the last Parameter. + // Type:4 (HEARTBEAT-REQUEST), Flags:0b00000000, Length: 22 + // NOTE: Length field must exclude the padding of the last parameter. 0x04, 0b00000000, 0x00, 0x16, // Parameter 1: Type:1 (HEARBEAT_INFO), Length: 11 0x00, 0x01, 0x00, 0x0B, @@ -233,21 +233,21 @@ SCENARIO("SCTP Hearbeat Request Chunk (4)", "[serializable][sctp][chunk]") SECTION("HeartbeatRequestChunk::Parse() with incorrect but valid Chunk Length field succeeds") { - // Here the chunk has incorrect Chunk Length field with value 24 instead of + // Here the chunk has incorrect chunk length field with value 24 instead of // 22. It's incorrect because, as per RFC 9260: // - // > The Chunk Length field does not count any chunk padding. However, it + // > The chunk length field does not count any chunk padding. However, it // > does include any padding of variable-length parameters other than the // > last parameter in the chunk. A robust implementation is expected to // > accept the chunk whether or not the final padding has been included in - // > the Chunk Length. + // > the chunk length. // clang-format off alignas(4) uint8_t buffer[] = { - // Type:4 (HEARTBEAT_REQUEST), Flags:0b00000000, Length: 24 - // NOTE: Length field must exclude the padding of the last Parameter so - // Length field should be 22 rather than 24. But anyway it's ok. + // Type:4 (HEARTBEAT-REQUEST), Flags:0b00000000, Length: 24 + // NOTE: Length field must exclude the padding of the last parameter so + // length field should be 22 rather than 24. But anyway it's ok. 0x04, 0b00000000, 0x00, 0x18, // Parameter 1: Type:1 (HEARBEAT_INFO), Length: 11 0x00, 0x01, 0x00, 0x0B, @@ -413,7 +413,7 @@ SCENARIO("SCTP Hearbeat Request Chunk (4)", "[serializable][sctp][chunk]") /*canHaveErrorCauses*/ false, /*errorCausesCount*/ 0); - /* Modify it by adding Parameters. */ + /* Modify it by adding parameters. */ auto* parameter1 = chunk->BuildParameterInPlace(); diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestIDataChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestIDataChunk.cpp index 8bf3c01b62..817ecf18d2 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestIDataChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestIDataChunk.cpp @@ -16,7 +16,7 @@ SCENARIO("SCTP I-Data Chunk (64)", "[serializable][sctp][chunk]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:64 (I_DATA), I:1, U:0, B:1, E:0, Length: 23 + // Type:64 (I-DATA), I:1, U:0, B:1, E:0, Length: 23 0x40, 0b00001010, 0x00, 0x17, // TSN: 0x11223344, 0x11, 0x22, 0x33, 0x44, @@ -433,7 +433,7 @@ SCENARIO("SCTP I-Data Chunk (64)", "[serializable][sctp][chunk]") REQUIRE(gotUserData.GetStreamId() == 123); REQUIRE(gotUserData.GetStreamSequenceNumber() == 0); REQUIRE(gotUserData.GetMessageId() == 5555); - // Bit B is set in the I_DATA Chunk so this must be 0. + // Bit B is set in the I-DATA chunk so this must be 0. REQUIRE(gotUserData.GetFragmentSequenceNumber() == 0); REQUIRE(gotUserData.GetPayloadProtocolId() == 56789); REQUIRE(gotUserData.GetPayloadLength() == 4); diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp index cdf2d8d1f3..f36f3734ae 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp @@ -17,7 +17,7 @@ SCENARIO("I-Forward Cumulative TSN Chunk (194)", "[serializable][sctp][chunk]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:194 (I_FORWARD_TSN), Flags: 0b00000000, Length: 32 + // Type:194 (I-FORWARD-TSN), Flags: 0b00000000, Length: 32 0xC2, 0b00000000, 0x00, 0x20, // New Cumulative TSN: 287454020, 0x11, 0x22, 0x33, 0x44, @@ -151,7 +151,7 @@ SCENARIO("I-Forward Cumulative TSN Chunk (194)", "[serializable][sctp][chunk]") // clang-format off alignas(4) uint8_t buffer1[] = { - // Type:194 (I_FORWARD_TSN), Flags: 0b00000000, Length: 20 (should be 24) + // Type:194 (I-FORWARD-TSN), Flags: 0b00000000, Length: 20 (should be 24) 0xC2, 0b00000000, 0x00, 0x14, // New Cumulative TSN: 287454020, 0x11, 0x22, 0x33, 0x44, @@ -161,7 +161,7 @@ SCENARIO("I-Forward Cumulative TSN Chunk (194)", "[serializable][sctp][chunk]") 0x11, 0x00, 0x00, 0x11, // Stream 2: 8194, U: 0 0x20, 0x02, 0x00, 0x00, - // Message Identifier (missing in Length field) + // Message Identifier (missing in length field) 0x22, 0x00, 0x00, 0x22, }; // clang-format on diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp index aa820b8006..30184ac723 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp @@ -18,7 +18,7 @@ SCENARIO("SCTP Init Acknowledgement (2)", "[serializable][sctp][chunk]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:2 (INIT_ACK), Flags: 0b00000000, Length: 28 + // Type:2 (INIT-ACK), Flags: 0b00000000, Length: 28 0x02, 0b00000000, 0x00, 0x1C, // Initiate Tag: 287454020, 0x11, 0x22, 0x33, 0x44, @@ -28,7 +28,7 @@ SCENARIO("SCTP Init Acknowledgement (2)", "[serializable][sctp][chunk]") 0x12, 0x34, 0x56, 0x78, // Initial TSN: 2882339074 0xAB, 0xCD, 0x01, 0x02, - // Parameter 1: Type:5 (IPV4_ADDRESS), Length: 8 + // Parameter 1: Type:5 (IPV4-ADDRESS), Length: 8 0x00, 0x05, 0x00, 0x08, // IPv4 Address: "2.3.4.5" 0x02, 0x03, 0x04, 0x05, @@ -106,7 +106,7 @@ SCENARIO("SCTP Init Acknowledgement (2)", "[serializable][sctp][chunk]") REQUIRE(chunk->GetNumberOfInboundStreams() == 0); REQUIRE(chunk->GetInitialTsn() == 0); - /* Modify it and add Parameters. */ + /* Modify it and add parameters. */ chunk->SetInitiateTag(1111111110); chunk->SetAdvertisedReceiverWindowCredit(2222222220); diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp index bf28b494e0..d1e15591a4 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp @@ -30,18 +30,18 @@ SCENARIO("SCTP Init Chunk (1)", "[serializable][sctp][chunk]") 0x12, 0x34, 0x56, 0x78, // Initial TSN: 2882339074 0xAB, 0xCD, 0x01, 0x02, - // Parameter 1: Type:5 (IPV4_ADDRESS), Length: 8 + // Parameter 1: Type:5 (IPV4-ADDRESS), Length: 8 0x00, 0x05, 0x00, 0x08, // IPv4 Address: "2.3.4.5" 0x02, 0x03, 0x04, 0x05, - // Type:6 (IPV6_ADDRESS), Length: 20 + // Type:6 (IPV6-ADDRESS), Length: 20 0x00, 0x06, 0x00, 0x14, // Parameter 2: IPv6 Address: "2001:0db8:85a3:0000:0000:8a2e:0370:7334" 0x20, 0x01, 0x0D, 0xB8, 0x85, 0xA3, 0x00, 0x00, 0x00, 0x00, 0x8A, 0x2E, 0x03, 0x70, 0x73, 0x34, - // Parameter 3: Type:9 (COOKIE_PRESERVATIVE), Length: 8 + // Parameter 3: Type:9 (COOKIE-PRESERVATIVE), Length: 8 0x00, 0x09, 0x00, 0x08, // Suggested Cookie Life-Span Increment: 556942164 0x21, 0x32, 0x43, 0x54, @@ -299,7 +299,7 @@ SCENARIO("SCTP Init Chunk (1)", "[serializable][sctp][chunk]") REQUIRE(chunk->GetNumberOfInboundStreams() == 0); REQUIRE(chunk->GetInitialTsn() == 0); - /* Modify it and add Parameters. */ + /* Modify it and add parameters. */ chunk->SetInitiateTag(1111111110); chunk->SetAdvertisedReceiverWindowCredit(2222222220); @@ -490,12 +490,12 @@ SCENARIO("SCTP Init Chunk (1)", "[serializable][sctp][chunk]") auto* parameter1 = RTC::SCTP::CookiePreservativeParameter::Factory( sctpCommon::FactoryBuffer + 1000, sizeof(sctpCommon::FactoryBuffer)); - // 8 bytes Parameter. + // 8 bytes parameter. parameter1->SetLifeSpanIncrement(123456); chunk->AddParameter(parameter1); - // Once added, we can delete the Parameter. + // Once added, we can delete the parameter. delete parameter1; // Chunk length must be: @@ -531,7 +531,7 @@ SCENARIO("SCTP Init Chunk (1)", "[serializable][sctp][chunk]") REQUIRE(obtainedParameter1->GetLifeSpanIncrement() == 123456); - // 4 bytes Parameter. + // 4 bytes parameter. auto* parameter2 = RTC::SCTP::SupportedAddressTypesParameter::Factory( sctpCommon::FactoryBuffer + 1000, sizeof(sctpCommon::FactoryBuffer)); @@ -542,7 +542,7 @@ SCENARIO("SCTP Init Chunk (1)", "[serializable][sctp][chunk]") chunk->AddParameter(parameter2); - // Once added, we can delete the Parameter. + // Once added, we can delete the parameter. delete parameter2; // Chunk length must be: diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestOperationErrorChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestOperationErrorChunk.cpp index fb7aafc564..ad48a558e3 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestOperationErrorChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestOperationErrorChunk.cpp @@ -20,13 +20,13 @@ SCENARIO("SCTP Operation Error Chunk (9)", "[serializable][sctp][chunk]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:9 (OPERATION_ERROR), Flags:0b00000000, Length: 21 + // Type:9 (OPERATION-ERROR), Flags:0b00000000, Length: 21 0x09, 0b00000000, 0x00, 0x15, - // Error Cause 1: Code:1 (INVALID_STREAM_IDENTIFIER), Length: 8 + // Error Cause 1: Code:1 (INVALID-STREAM-IDENTIFIER), Length: 8 0x00, 0x01, 0x00, 0x08, // Stream Identifier: 0x1234 0x12, 0x34, 0x00, 0x00, - // Error Cause 2: Code:4 (OUT_OF_RESOURCE), Length: 4 + // Error Cause 2: Code:4 (OUT-OF-RESOURCE), Length: 4 0x00, 0x04, 0x00, 0x04, // Error Cause 3: Type:49159 (UNKNOWN), Length: 5 0xC0, 0x07, 0x00, 0x05, @@ -272,11 +272,11 @@ SCENARIO("SCTP Operation Error Chunk (9)", "[serializable][sctp][chunk]") REQUIRE(chunk->GetFirstErrorCauseOfCode() == nullptr); REQUIRE(chunk->GetFirstErrorCauseOfCode() == nullptr); - /* Modify it by adding Error Causes. */ + /* Modify it by adding error causes. */ auto* errorCause1 = chunk->BuildErrorCauseInPlace(); - // Unrecognized Chunk length is 5 so 3 bytes of padding will be added. + // Unrecognized chunk length is 5 so 3 bytes of padding will be added. errorCause1->SetUnrecognizedChunk(sctpCommon::DataBuffer, 5); errorCause1->Consolidate(); @@ -286,11 +286,11 @@ SCENARIO("SCTP Operation Error Chunk (9)", "[serializable][sctp][chunk]") // // Let's add another UnrecognizedChunkTypeErrorCause. auto* errorCause2 = chunk->BuildErrorCauseInPlace(); - // Unrecognized Chunk is 2 so 2 bytes of padding will be added. + // Unrecognized chunk is 2 so 2 bytes of padding will be added. errorCause2->SetUnrecognizedChunk(sctpCommon::DataBuffer, 2); errorCause2->Consolidate(); - // Still must return the first Error Cause. + // Still must return the first error cause. REQUIRE( chunk->GetFirstErrorCauseOfCode() == errorCause1); diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp index a74cb1621d..d6fa986228 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp @@ -20,10 +20,10 @@ SCENARIO("SCTP Re-Config Chunk (130)", "[serializable][sctp][chunk]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:130 (RE_CONFIG), Flags:0b00000000, Length: 38 - // NOTE: Length field must exclude the padding of the last Parameter. + // Type:130 (RE-CONFIG), Flags:0b00000000, Length: 38 + // NOTE: Length field must exclude the padding of the last parameter. 0x82, 0b00000000, 0x00, 0x26, - // Parameter 1: Type:13 (OUTGOING_SSN_RESET_REQUEST), Length: 22 + // Parameter 1: Type:13 (OUTGOING-SSN-RESET-REQUEST), Length: 22 0x00, 0x0D, 0x00, 0x16, // Re-configuration Request Sequence Number: 0x11223344 0x11, 0x22, 0x33, 0x44, @@ -31,11 +31,11 @@ SCENARIO("SCTP Re-Config Chunk (130)", "[serializable][sctp][chunk]") 0x55, 0x66, 0x77, 0x88, // Sender's Last Assigned TSN: 0xAABBCCDD 0xAA, 0xBB, 0xCC, 0xDD, - // Stream 1: 0x5001, Stream 2: 0x5002 + // Stream 1: 0x5001, stream 2: 0x5002 0x50, 0x01, 0x50, 0x02, // Stream 3: 0x5003, 2 bytes of padding 0x50, 0x03, 0x00, 0x00, - // Parameter 2: Type:14 (INCOMING_SSN_RESET_REQUEST), Length: 10 + // Parameter 2: Type:14 (INCOMING-SSN-RESET-REQUEST), Length: 10 0x00, 0x0E, 0x00, 0x0A, // Re-configuration Request Sequence Number: 0x44332211 0x44, 0x33, 0x22, 0x11, @@ -236,7 +236,7 @@ SCENARIO("SCTP Re-Config Chunk (130)", "[serializable][sctp][chunk]") /*canHaveErrorCauses*/ false, /*errorCausesCount*/ 0); - /* Modify it by adding Parameters. */ + /* Modify it by adding parameters. */ auto* parameter1 = chunk->BuildParameterInPlace(); diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp index 9d5a163d5b..1cadfd1e0a 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp @@ -209,7 +209,7 @@ SCENARIO("Selective Acknowledgement Chunk (3)", "[serializable][sctp][chunk]") REQUIRE(!RTC::SCTP::SackChunk::Parse(buffer2, sizeof(buffer2))); - // Wrong Length field (smaller than buffer). + // Wrong length field (smaller than buffer). // clang-format off alignas(4) uint8_t buffer3[] = { @@ -260,7 +260,7 @@ SCENARIO("Selective Acknowledgement Chunk (3)", "[serializable][sctp][chunk]") chunk->SetAdvertisedReceiverWindowCredit(5678); chunk->AddDuplicateTsn(10000000); chunk->AddAckBlock(10000, 19999); - // Notice that here we are creating a semig-wrong SACK Chunk since these + // Notice that here we are creating a semig-wrong SACK chunk since these // two ranges shoyuld be merged into one. chunk->AddAckBlock(RTC::SCTP::SackChunk::GapAckBlock(20000, 20999)); chunk->AddDuplicateTsn(20000000); diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownAckChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownAckChunk.cpp index 1bb7d618e0..b246b6683d 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownAckChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownAckChunk.cpp @@ -15,7 +15,7 @@ SCENARIO("SCTP Shutdown Ack Chunk (8)", "[serializable][sctp][chunk]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:8 (SHUTDOWN_ACK), Flags:0x00000000, Length: 4 + // Type:8 (SHUTDOWN-ACK), Flags:0x00000000, Length: 4 0x08, 0b01000000, 0x00, 0x04, // Extra bytes that should be ignored 0xAA, 0xBB, 0xCC, 0xDD, diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownCompleteChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownCompleteChunk.cpp index f6b51f93bf..3df5033b1d 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownCompleteChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownCompleteChunk.cpp @@ -15,7 +15,7 @@ SCENARIO("SCTP Shutdown Complete Chunk (14)", "[serializable][sctp][chunk]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:8 (SHUTDOWN_COMPLETE), Flags:0x00000001, T: 1, Length: 4 + // Type:8 (SHUTDOWN-COMPLETE), Flags:0x00000001, T: 1, Length: 4 0x0E, 0b00000001, 0x00, 0x04, // Extra bytes that should be ignored 0xAA, 0xBB, 0xCC, 0xDD diff --git a/worker/test/src/RTC/SCTP/packet/chunks/TestUnknownChunk.cpp b/worker/test/src/RTC/SCTP/packet/chunks/TestUnknownChunk.cpp index b55e62b75a..7f07148b66 100644 --- a/worker/test/src/RTC/SCTP/packet/chunks/TestUnknownChunk.cpp +++ b/worker/test/src/RTC/SCTP/packet/chunks/TestUnknownChunk.cpp @@ -25,8 +25,8 @@ SCENARIO("SCTP Unknown Chunk", "[serializable][sctp][chunk]") auto* chunk = RTC::SCTP::UnknownChunk::Parse(buffer, sizeof(buffer)); - // NOTE: Chunk Type is 0xEE (0b11101110) so first 2 bits are 11, meaning - // that the action to take if we receive this Chunk Type is SKIP_AND_REPORT. + // NOTE: Chunk type is 0xEE (0b11101110) so first 2 bits are 11, meaning + // that the action to take if we receive this chunk type is SKIP_AND_REPORT. CHECK_SCTP_CHUNK( /*chunk*/ chunk, diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestCookieReceivedWhileShuttingDownErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestCookieReceivedWhileShuttingDownErrorCause.cpp index 1e71e6bbea..86e6fcb49c 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestCookieReceivedWhileShuttingDownErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestCookieReceivedWhileShuttingDownErrorCause.cpp @@ -14,7 +14,7 @@ SCENARIO("Cookie Received While Shutting Down Error Cause (10)", "[serializable] // clang-format off alignas(4) uint8_t buffer[] = { - // Code:10 (COOKIE_RECEIVED_WHILE_SHUTTING_DOWN), Length: 4 + // Code:10 (COOKIE-RECEIVED-WHILE-SHUTTING-DOWN), Length: 4 0x00, 0x0A, 0x00, 0x04, // Extra bytes that should be ignored 0xAA, 0xBB, 0xCC, 0xDD, diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidMandatoryParameterErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidMandatoryParameterErrorCause.cpp index 2299e6f7f8..f05388383a 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidMandatoryParameterErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidMandatoryParameterErrorCause.cpp @@ -14,7 +14,7 @@ SCENARIO("Invalid Mandatory Parameter Error Cause (7)", "[serializable][sctp][er // clang-format off alignas(4) uint8_t buffer[] = { - // Code:7 (INVALID_MANDATORY_PARAMETER), Length: 4 + // Code:7 (INVALID-MANDATORY-PARAMETER), Length: 4 0x00, 0x07, 0x00, 0x04, // Extra bytes that should be ignored 0xAA, 0xBB, 0xCC, 0xDD, diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidStreamIdentifierErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidStreamIdentifierErrorCause.cpp index 3acfdb71d7..a530e537eb 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidStreamIdentifierErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidStreamIdentifierErrorCause.cpp @@ -15,7 +15,7 @@ SCENARIO("Invalid Stream Identifier Error Cause (1)", "[serializable][sctp][erro // clang-format off alignas(4) uint8_t buffer[] = { - // Code:1 (INVALID_STREAM_IDENTIFIER), Length: 8 + // Code:1 (INVALID-STREAM-IDENTIFIER), Length: 8 0x00, 0x01, 0x00, 0x08, // Stream Identifier: 12345 0x30, 0x39, 0x00, 0x00, @@ -100,11 +100,11 @@ SCENARIO("Invalid Stream Identifier Error Cause (1)", "[serializable][sctp][erro REQUIRE(!RTC::SCTP::InvalidStreamIdentifierErrorCause::Parse(buffer1, sizeof(buffer1))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer2[] = { - // Code:1 (INVALID_STREAM_IDENTIFIER), Length: 7 + // Code:1 (INVALID-STREAM-IDENTIFIER), Length: 7 0x00, 0x01, 0x00, 0x07, // Stream Identifier: 12345 0x30, 0x39, 0x00 @@ -113,11 +113,11 @@ SCENARIO("Invalid Stream Identifier Error Cause (1)", "[serializable][sctp][erro REQUIRE(!RTC::SCTP::InvalidStreamIdentifierErrorCause::Parse(buffer2, sizeof(buffer2))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer3[] = { - // Code:1 (INVALID_STREAM_IDENTIFIER), Length: 9 + // Code:1 (INVALID-STREAM-IDENTIFIER), Length: 9 0x00, 0x01, 0x00, 0x09, // Stream Identifier: 12345 0x30, 0x39, 0x00, 0x00, @@ -131,7 +131,7 @@ SCENARIO("Invalid Stream Identifier Error Cause (1)", "[serializable][sctp][erro // clang-format off alignas(4) uint8_t buffer4[] = { - // Code:1 (INVALID_STREAM_IDENTIFIER), Length: 8 + // Code:1 (INVALID-STREAM-IDENTIFIER), Length: 8 0x00, 0x01, 0x00, 0x08, // Stream Identifier: 12345 0x30, 0x39, 0x00 diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestMissingMandatoryParameterErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestMissingMandatoryParameterErrorCause.cpp index 4f67d176a3..6a8c61b47d 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestMissingMandatoryParameterErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestMissingMandatoryParameterErrorCause.cpp @@ -16,13 +16,13 @@ SCENARIO("Invalid Stream Identifier Error Cause (2)", "[serializable][sctp][erro // clang-format off alignas(4) uint8_t buffer[] = { - // Code:2 (MISSING_MANDATORY_PARAMETER), Length: 14 + // Code:2 (MISSING-MANDATORY-PARAMETER), Length: 14 0x00, 0x02, 0x00, 0x0E, // Number of missing params: 3 0x00, 0x00, 0x00, 0x03, - // Missing Param 1: 5 (IPV4_ADDRESS), Missing Param 2: 6 (IPV6_ADDRESS) + // Missing Param 1: 5 (IPV4-ADDRESS), Missing Param 2: 6 (IPV6-ADDRESS) 0x00, 0x05, 0x00, 0x06, - // Missing Param 3: 9 (COOKIE_PRESERVATIVE), 2 bytes of padding + // Missing Param 3: 9 (COOKIE-PRESERVATIVE), 2 bytes of padding 0x00, 0x09, 0x00, 0x00, // Extra bytes that should be ignored 0xAA, 0xBB, 0xCC, 0xDD, @@ -123,9 +123,9 @@ SCENARIO("Invalid Stream Identifier Error Cause (2)", "[serializable][sctp][erro 0x03, 0xE7, 0x00, 0x0E, // Number of missing params: 3 0x00, 0x00, 0x00, 0x03, - // Missing Param 1: 5 (IPV4_ADDRESS), Missing Param 2: 6 (IPV6_ADDRESS) + // Missing Param 1: 5 (IPV4-ADDRESS), Missing Param 2: 6 (IPV6-ADDRESS) 0x00, 0x05, 0x00, 0x06, - // Missing Param 3: 9 (COOKIE_PRESERVATIVE), 2 bytes of padding + // Missing Param 3: 9 (COOKIE-PRESERVATIVE), 2 bytes of padding 0x00, 0x09, 0x00, 0x00, }; // clang-format on @@ -136,13 +136,13 @@ SCENARIO("Invalid Stream Identifier Error Cause (2)", "[serializable][sctp][erro // clang-format off alignas(4) uint8_t buffer2[] = { - // Code:2 (MISSING_MANDATORY_PARAMETER), Length: 14 + // Code:2 (MISSING-MANDATORY-PARAMETER), Length: 14 0x00, 0x02, 0x00, 0x0E, // Number of missing params: 2 0x00, 0x00, 0x00, 0x02, - // Missing Param 1: 5 (IPV4_ADDRESS), Missing Param 2: 6 (IPV6_ADDRESS) + // Missing Param 1: 5 (IPV4-ADDRESS), Missing Param 2: 6 (IPV6-ADDRESS) 0x00, 0x05, 0x00, 0x06, - // Missing Param 3: 9 (COOKIE_PRESERVATIVE) (exceeds number of missing + // Missing Param 3: 9 (COOKIE-PRESERVATIVE) (exceeds number of missing // parameters), 2 bytes of padding 0x00, 0x09, 0x00, 0x00, }; @@ -150,15 +150,15 @@ SCENARIO("Invalid Stream Identifier Error Cause (2)", "[serializable][sctp][erro REQUIRE(!RTC::SCTP::MissingMandatoryParameterErrorCause::Parse(buffer2, sizeof(buffer2))); - // Wrong Length field (smaller than buffer). + // Wrong length field (smaller than buffer). // clang-format off alignas(4) uint8_t buffer3[] = { - // Code:2 (MISSING_MANDATORY_PARAMETER), Length: 8 (buffer is 12) + // Code:2 (MISSING-MANDATORY-PARAMETER), Length: 8 (buffer is 12) 0x00, 0x02, 0x00, 0x08, // Number of missing params: 4 0x00, 0x00, 0x00, 0x02, - // Missing Param 1: 5 (IPV4_ADDRESS), Missing Param 2: 6 (IPV6_ADDRESS) + // Missing Param 1: 5 (IPV4-ADDRESS), Missing Param 2: 6 (IPV6-ADDRESS) 0x00, 0x05, 0x00, 0x06, }; // clang-format on diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestNoUserDataErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestNoUserDataErrorCause.cpp index 7357a10340..05997e5ee5 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestNoUserDataErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestNoUserDataErrorCause.cpp @@ -15,7 +15,7 @@ SCENARIO("No User Data Error Cause (9)", "[serializable][sctp][errorcause]") // clang-format off alignas(4) uint8_t buffer[] = { - // Code:9 (NO_USER_DATA), Length: 8 + // Code:9 (NO-USER-DATA), Length: 8 0x00, 0x09, 0x00, 0x08, // TSN: 987654321 0x3A, 0xDE, 0x68, 0xB1, @@ -91,11 +91,11 @@ SCENARIO("No User Data Error Cause (9)", "[serializable][sctp][errorcause]") REQUIRE(!RTC::SCTP::NoUserDataErrorCause::Parse(buffer1, sizeof(buffer1))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer2[] = { - // Code:9 (NO_USER_DATA), Length: 7 + // Code:9 (NO-USER-DATA), Length: 7 0x00, 0x09, 0x00, 0x07, // TSN: 987654321 0x3A, 0xDE, 0x68, @@ -104,11 +104,11 @@ SCENARIO("No User Data Error Cause (9)", "[serializable][sctp][errorcause]") REQUIRE(!RTC::SCTP::NoUserDataErrorCause::Parse(buffer2, sizeof(buffer2))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer3[] = { - // Code:9 (NO_USER_DATA), Length: 9 + // Code:9 (NO-USER-DATA), Length: 9 0x00, 0x09, 0x00, 0x09, // TSN: 987654321 0x3A, 0xDE, 0x68, 0xB1, @@ -122,7 +122,7 @@ SCENARIO("No User Data Error Cause (9)", "[serializable][sctp][errorcause]") // clang-format off alignas(4) uint8_t buffer4[] = { - // Code:9 (NO_USER_DATA), Length: 8 + // Code:9 (NO-USER-DATA), Length: 8 0x00, 0x09, 0x00, 0x08, // TSN (last byte missing) 0x3A, 0xDE, 0x68 diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestOutOfResourceErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestOutOfResourceErrorCause.cpp index 980f235eaf..fb41b9d184 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestOutOfResourceErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestOutOfResourceErrorCause.cpp @@ -14,7 +14,7 @@ SCENARIO("Out of Resource Error Cause (4)", "[serializable][sctp][errorcause]") // clang-format off alignas(4) uint8_t buffer[] = { - // Code:4 (OUT_OF_RESOURCE), Length: 4 + // Code:4 (OUT-OF-RESOURCE), Length: 4 0x00, 0x04, 0x00, 0x04, // Extra bytes that should be ignored 0xAA, 0xBB, 0xCC, 0xDD, @@ -79,11 +79,11 @@ SCENARIO("Out of Resource Error Cause (4)", "[serializable][sctp][errorcause]") REQUIRE(!RTC::SCTP::OutOfResourceErrorCause::Parse(buffer1, sizeof(buffer1))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer2[] = { - // Code:4 (OUT_OF_RESOURCE), Length: 5 + // Code:4 (OUT-OF-RESOURCE), Length: 5 0x00, 0x04, 0x00, 0x07, 0x3A, }; @@ -91,11 +91,11 @@ SCENARIO("Out of Resource Error Cause (4)", "[serializable][sctp][errorcause]") REQUIRE(!RTC::SCTP::OutOfResourceErrorCause::Parse(buffer2, sizeof(buffer2))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer3[] = { - // Code:4 (OUT_OF_RESOURCE), Length (broken) + // Code:4 (OUT-OF-RESOURCE), length (broken) 0x00, 0x04, 0x00, }; // clang-format on diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestProtocolViolationErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestProtocolViolationErrorCause.cpp index 00d0b692ab..2433c7c39f 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestProtocolViolationErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestProtocolViolationErrorCause.cpp @@ -15,7 +15,7 @@ SCENARIO("Protocol Violation Error Cause (13)", "[serializable][sctp][errorcause // clang-format off alignas(4) uint8_t buffer[] = { - // Code:13 (PROTOCOL_VIOLATION), Length: 10 + // Code:13 (PROTOCOL-VIOLATION), Length: 10 0x00, 0x0D, 0x00, 0x0A, // Additional Information: "error1" 0x65, 0x72, 0x72, 0x6F, @@ -144,7 +144,7 @@ SCENARIO("Protocol Violation Error Cause (13)", "[serializable][sctp][errorcause // clang-format off alignas(4) uint8_t buffer2[] = { - // Code:13 (PROTOCOL_VIOLATION), Length: 7 + // Code:13 (PROTOCOL-VIOLATION), Length: 7 0x00, 0x0D, 0x00, 0x07, // Additional Information: 0x123456 (missing padding byte) 0x12, 0x34, 0x56, diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestRestartOfAnAssociationWithNewAddressesErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestRestartOfAnAssociationWithNewAddressesErrorCause.cpp index 94deb226b1..d5f260cb13 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestRestartOfAnAssociationWithNewAddressesErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestRestartOfAnAssociationWithNewAddressesErrorCause.cpp @@ -15,7 +15,7 @@ SCENARIO("Restart of an Association with New Addresses Error Cause (11)", "[seri // clang-format off alignas(4) uint8_t buffer[] = { - // Code:11 (RESTART_OF_AN_ASSOCIATION_WITH_NEW_ADDRESSES), Length: 11 + // Code:11 (RESTART-OF-AN-ASSOCIATION-WITH-NEW-ADDRESSES), Length: 11 0x00, 0x0B, 0x00, 0x0B, // New Address TLVs: 0x1234567890AB 0x12, 0x34, 0x56, 0x78, @@ -128,7 +128,7 @@ SCENARIO("Restart of an Association with New Addresses Error Cause (11)", "[seri // clang-format off alignas(4) uint8_t buffer2[] = { - // Code:11 (RESTART_OF_AN_ASSOCIATION_WITH_NEW_ADDRESSES), Length: 7 + // Code:11 (RESTART-OF-AN-ASSOCIATION-WITH-NEW-ADDRESSES), Length: 7 0x00, 0x0B, 0x00, 0x07, // NewAddressTlvs: 0x123456 (missing padding byte) 0x12, 0x34, 0x56, diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestStaleCookieErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestStaleCookieErrorCause.cpp index 00d9088f0e..88b418fe32 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestStaleCookieErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestStaleCookieErrorCause.cpp @@ -15,7 +15,7 @@ SCENARIO("Stale Cookie Error Cause (3)", "[serializable][sctp][errorcause]") // clang-format off alignas(4) uint8_t buffer[] = { - // Code:3 (STALE_COOKIE), Length: 8 + // Code:3 (STALE-COOKIE), Length: 8 0x00, 0x03, 0x00, 0x08, // Measure of Staleness: 987654321 0x3A, 0xDE, 0x68, 0xB1, @@ -91,11 +91,11 @@ SCENARIO("Stale Cookie Error Cause (3)", "[serializable][sctp][errorcause]") REQUIRE(!RTC::SCTP::StaleCookieErrorCause::Parse(buffer1, sizeof(buffer1))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer2[] = { - // Code:3 (STALE_COOKIE), Length: 7 + // Code:3 (STALE-COOKIE), Length: 7 0x00, 0x03, 0x00, 0x07, // Measure of Staleness: 987654321 0x3A, 0xDE, 0x68, @@ -104,11 +104,11 @@ SCENARIO("Stale Cookie Error Cause (3)", "[serializable][sctp][errorcause]") REQUIRE(!RTC::SCTP::StaleCookieErrorCause::Parse(buffer2, sizeof(buffer2))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer3[] = { - // Code:3 (STALE_COOKIE), Length: 9 + // Code:3 (STALE-COOKIE), Length: 9 0x00, 0x03, 0x00, 0x09, // Measure of Staleness: 987654321 0x3A, 0xDE, 0x68, 0xB1, @@ -122,7 +122,7 @@ SCENARIO("Stale Cookie Error Cause (3)", "[serializable][sctp][errorcause]") // clang-format off alignas(4) uint8_t buffer4[] = { - // Code:3 (STALE_COOKIE), Length: 8 + // Code:3 (STALE-COOKIE), Length: 8 0x00, 0x03, 0x00, 0x08, // Measure of Staleness (last byte missing) 0x3A, 0xDE, 0x68 diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp index 9285bc39ef..a103bf0d82 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp @@ -114,7 +114,7 @@ SCENARIO("Unknown Error Cause", "[serializable][sctp][errorcause]") SECTION("UnknownErrorCause::Parse() fails") { - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer1[] = { diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedChunkTypeErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedChunkTypeErrorCause.cpp index 6f2007c33d..24ae156f44 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedChunkTypeErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedChunkTypeErrorCause.cpp @@ -15,7 +15,7 @@ SCENARIO("Unrecognized Chunk Type Error Cause (6)", "[serializable][sctp][errorc // clang-format off alignas(4) uint8_t buffer[] = { - // Code:6 (UNRECOGNIZED_CHUNK_TYPE), Length: 10 + // Code:6 (UNRECOGNIZED-CHUNK-TYPE), Length: 10 0x00, 0x06, 0x00, 0x0A, // Unrecognized Chunk: 0x1234567890AB 0x12, 0x34, 0x56, 0x78, @@ -126,7 +126,7 @@ SCENARIO("Unrecognized Chunk Type Error Cause (6)", "[serializable][sctp][errorc // clang-format off alignas(4) uint8_t buffer2[] = { - // Code:6 (UNRECOGNIZED_CHUNK_TYPE), Length: 7 + // Code:6 (UNRECOGNIZED-CHUNK-TYPE), Length: 7 0x00, 0x06, 0x00, 0x07, // Unrecognized Chunk: 0x123456 (missing padding byte) 0x12, 0x34, 0x56, diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedParametersErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedParametersErrorCause.cpp index bc9fdd4ee0..dd960f8a4d 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedParametersErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedParametersErrorCause.cpp @@ -15,7 +15,7 @@ SCENARIO("Unrecognized Parameters Error Cause (8)", "[serializable][sctp][errorc // clang-format off alignas(4) uint8_t buffer[] = { - // Code:8 (UNRECOGNIZED_PARAMETERS), Length: 11 + // Code:8 (UNRECOGNIZED-PARAMETERS), Length: 11 0x00, 0x08, 0x00, 0x0B, // Unrecognized Parameters: 0x1234567890ABCD 0x12, 0x34, 0x56, 0x78, diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnresolvableAddressErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnresolvableAddressErrorCause.cpp index 03a6a56ab3..0e05082a9f 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnresolvableAddressErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnresolvableAddressErrorCause.cpp @@ -15,7 +15,7 @@ SCENARIO("Unresolvable Address Error Cause (5)", "[serializable][sctp][errorcaus // clang-format off alignas(4) uint8_t buffer[] = { - // Code:5 (UNRESOLVABLE_ADDRESS), Length: 9 + // Code:5 (UNRESOLVABLE-ADDRESS), Length: 9 0x00, 0x05, 0x00, 0x09, // Unresolvable Address: 0x1234567890 0x12, 0x34, 0x56, 0x78, @@ -126,7 +126,7 @@ SCENARIO("Unresolvable Address Error Cause (5)", "[serializable][sctp][errorcaus // clang-format off alignas(4) uint8_t buffer2[] = { - // Code:5 (UNRESOLVABLE_ADDRESS), Length: 7 + // Code:5 (UNRESOLVABLE-ADDRESS), Length: 7 0x00, 0x05, 0x00, 0x07, // Unresolvable Address: 0x123456 (missing padding byte) 0x12, 0x34, 0x56, diff --git a/worker/test/src/RTC/SCTP/packet/errorCauses/TestUserInitiatedAbortErrorCause.cpp b/worker/test/src/RTC/SCTP/packet/errorCauses/TestUserInitiatedAbortErrorCause.cpp index c87565d380..bd79b8d211 100644 --- a/worker/test/src/RTC/SCTP/packet/errorCauses/TestUserInitiatedAbortErrorCause.cpp +++ b/worker/test/src/RTC/SCTP/packet/errorCauses/TestUserInitiatedAbortErrorCause.cpp @@ -15,7 +15,7 @@ SCENARIO("User-Initiated Abort Error Cause (12)", "[serializable][sctp][errorcau // clang-format off alignas(4) uint8_t buffer[] = { - // Code:12 (USER_INITIATED_ABORT), Length: 10 + // Code:12 (USER-INITIATED-ABORT), Length: 10 0x00, 0x0C, 0x00, 0x0A, // Upper Layer Abort Reason: "I DIE!" 0x49, 0x20, 0x44, 0x49, @@ -99,7 +99,7 @@ SCENARIO("User-Initiated Abort Error Cause (12)", "[serializable][sctp][errorcau // clang-format off alignas(4) uint8_t buffer2[] = { - // Code:12 (USER_INITIATED_ABORT), Length: 7 + // Code:12 (USER-INITIATED-ABORT), Length: 7 0x00, 0x0C, 0x00, 0x07, // Upper Layer Abort Reason: 0x123456 (missing padding byte) 0x12, 0x34, 0x56, diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestAddIncomingStreamsRequestParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestAddIncomingStreamsRequestParameter.cpp index 0b70c968f2..5c2d531194 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestAddIncomingStreamsRequestParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestAddIncomingStreamsRequestParameter.cpp @@ -15,7 +15,7 @@ SCENARIO("Add Incoming Streams Request Parameter (18)", "[serializable][sctp][pa // clang-format off alignas(4) uint8_t buffer[] = { - // Type:18 (ADD_INCOMING_STREAMS_REQUEST), Length: 12 + // Type:18 (ADD-INCOMING-STREAMS-REQUEST), Length: 12 0x00, 0x12, 0x00, 0x0C, // Re-configuration Request Sequence Number: 666777888 0x27, 0xBE, 0x39, 0x20, diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestAddOutgoingStreamsRequestParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestAddOutgoingStreamsRequestParameter.cpp index 7051454e39..462aded51c 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestAddOutgoingStreamsRequestParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestAddOutgoingStreamsRequestParameter.cpp @@ -15,7 +15,7 @@ SCENARIO("Add Outgoing Streams Request Parameter (17)", "[serializable][sctp][pa // clang-format off alignas(4) uint8_t buffer[] = { - // Type:17 (ADD_OUTGOING_STREAMS_REQUEST), Length: 12 + // Type:17 (ADD-OUTGOING-STREAMS-REQUEST), Length: 12 0x00, 0x11, 0x00, 0x0C, // Re-configuration Request Sequence Number: 666777888 0x27, 0xBE, 0x39, 0x20, diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestCookiePreservativeParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestCookiePreservativeParameter.cpp index e184ca2c50..7c813b676c 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestCookiePreservativeParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestCookiePreservativeParameter.cpp @@ -15,7 +15,7 @@ SCENARIO("Cookie Preservative Parameter (9)", "[serializable][sctp][parameter]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:9 (COOKIE_PRESERVATIVE), Length: 8 + // Type:9 (COOKIE-PRESERVATIVE), Length: 8 0x00, 0x09, 0x00, 0x08, // Suggested Cookie Life-Span Increment: 4278194466 0xFF, 0x00, 0x11, 0x22, @@ -83,7 +83,7 @@ SCENARIO("Cookie Preservative Parameter (9)", "[serializable][sctp][parameter]") // clang-format off alignas(4) uint8_t buffer1[] = { - // Type:9 (IPV6_ADDRESS), Length: 8 + // Type:9 (IPV6-ADDRESS), Length: 8 0x00, 0x06, 0x00, 0x08, // Suggested Cookie Life-Span Increment: 4278194466 0xFF, 0x00, 0x11, 0x22, @@ -92,11 +92,11 @@ SCENARIO("Cookie Preservative Parameter (9)", "[serializable][sctp][parameter]") REQUIRE(!RTC::SCTP::CookiePreservativeParameter::Parse(buffer1, sizeof(buffer1))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer2[] = { - // Type:9 (COOKIE_PRESERVATIVE), Length: 7 + // Type:9 (COOKIE-PRESERVATIVE), Length: 7 0x00, 0x09, 0x00, 0x07, // Suggested Cookie Life-Span Increment: 4278194466 0xFF, 0x00, 0x11, 0x22, @@ -105,11 +105,11 @@ SCENARIO("Cookie Preservative Parameter (9)", "[serializable][sctp][parameter]") REQUIRE(!RTC::SCTP::CookiePreservativeParameter::Parse(buffer2, sizeof(buffer2))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer3[] = { - // Type:9 (COOKIE_PRESERVATIVE), Length: 9 + // Type:9 (COOKIE-PRESERVATIVE), Length: 9 0x00, 0x09, 0x00, 0x09, // Suggested Cookie Life-Span Increment: 4278194466 0xFF, 0x00, 0x11, 0x22, @@ -123,7 +123,7 @@ SCENARIO("Cookie Preservative Parameter (9)", "[serializable][sctp][parameter]") // clang-format off alignas(4) uint8_t buffer4[] = { - // Type:5 (IPV4_ADDRESS), Length: 8 + // Type:5 (IPV4-ADDRESS), Length: 8 0x00, 0x05, 0x00, 0x08, // Suggested Cookie Life-Span Increment (wrong length) 0xAA, 0xBB, 0xCC diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestForwardTsnSupportedParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestForwardTsnSupportedParameter.cpp index a263d2aff4..3f4c759a48 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestForwardTsnSupportedParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestForwardTsnSupportedParameter.cpp @@ -14,7 +14,7 @@ SCENARIO("Forward-TSN-Supported Parameter (32769)", "[serializable][sctp][parame // clang-format off alignas(4) uint8_t buffer[] = { - // Type:49152 (FORWARD_TSN_SUPPORTED), Length: 4 + // Type:49152 (FORWARD-TSN-SUPPORTED), Length: 4 0xC0, 0x00, 0x00, 0x04, // Extra bytes that should be ignored 0xAA, 0xBB, 0xCC, 0xDD, diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestHeartbeatInfoParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestHeartbeatInfoParameter.cpp index afd0232462..f6121f0f5f 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestHeartbeatInfoParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestHeartbeatInfoParameter.cpp @@ -118,7 +118,7 @@ SCENARIO("Heartbeat Info Parameter (1)", "[serializable][sctp][parameter]") // clang-format off alignas(4) uint8_t buffer1[] = { - // Type:6 (IPV6_ADDRESS), Length: 8 + // Type:6 (IPV6-ADDRESS), Length: 8 0x00, 0x06, 0x00, 0x0B, // Heartbeat Information (7 bytes): 0x11223344556677 0x11, 0x22, 0x33, 0x44, @@ -129,7 +129,7 @@ SCENARIO("Heartbeat Info Parameter (1)", "[serializable][sctp][parameter]") REQUIRE(!RTC::SCTP::HeartbeatInfoParameter::Parse(buffer1, sizeof(buffer1))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer2[] = { diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestIPv4AddressParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestIPv4AddressParameter.cpp index d3ccc67bb4..222e1c4712 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestIPv4AddressParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestIPv4AddressParameter.cpp @@ -15,7 +15,7 @@ SCENARIO("IPv4 Adress Parameter (5)", "[serializable][sctp][parameter]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:5 (IPV4_ADDRESS), Length: 8 + // Type:5 (IPV4-ADDRESS), Length: 8 0x00, 0x05, 0x00, 0x08, // IPv4 Address: "1.2.3.4" 0x01, 0x02, 0x03, 0x04, @@ -94,7 +94,7 @@ SCENARIO("IPv4 Adress Parameter (5)", "[serializable][sctp][parameter]") // clang-format off alignas(4) uint8_t buffer1[] = { - // Type:6 (IPV6_ADDRESS), Length: 8 + // Type:6 (IPV6-ADDRESS), Length: 8 0x00, 0x06, 0x00, 0x08, // IPv4 Address: 0xAABBCCDD 0xAA, 0xBB, 0xCC, 0xDD @@ -103,11 +103,11 @@ SCENARIO("IPv4 Adress Parameter (5)", "[serializable][sctp][parameter]") REQUIRE(!RTC::SCTP::IPv4AddressParameter::Parse(buffer1, sizeof(buffer1))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer2[] = { - // Type:5 (IPV4_ADDRESS), Length: 7 + // Type:5 (IPV4-ADDRESS), Length: 7 0x00, 0x05, 0x00, 0x07, // IPv4 Address: 0xAABBCC 0xAA, 0xBB, 0xCC @@ -116,11 +116,11 @@ SCENARIO("IPv4 Adress Parameter (5)", "[serializable][sctp][parameter]") REQUIRE(!RTC::SCTP::IPv4AddressParameter::Parse(buffer2, sizeof(buffer2))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer3[] = { - // Type:5 (IPV4_ADDRESS), Length: 9 + // Type:5 (IPV4-ADDRESS), Length: 9 0x00, 0x05, 0x00, 0x09, // IPv4 Address: 0xAABBCCDD 0xAA, 0xBB, 0xCC, 0xDD, @@ -134,7 +134,7 @@ SCENARIO("IPv4 Adress Parameter (5)", "[serializable][sctp][parameter]") // clang-format off alignas(4) uint8_t buffer4[] = { - // Type:5 (IPV4_ADDRESS), Length: 8 + // Type:5 (IPV4-ADDRESS), Length: 8 0x00, 0x05, 0x00, 0x08, // IPv4 Address (wrong length) 0xAA, 0xBB, 0xCC diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp index 0078460af6..e52bae785f 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp @@ -15,7 +15,7 @@ SCENARIO("IPv6 Adress Parameter (6)", "[serializable][sctp][parameter]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:6 (IPV6_ADDRESS), Length: 20 + // Type:6 (IPV6-ADDRESS), Length: 20 0x00, 0x06, 0x00, 0x14, // IPv6 Address: "2001:0db8:85a3:0000:0000:8a2e:0370:7334" 0x20, 0x01, 0x0D, 0xB8, @@ -98,7 +98,7 @@ SCENARIO("IPv6 Adress Parameter (6)", "[serializable][sctp][parameter]") // clang-format off alignas(4) uint8_t buffer1[] = { - // Type:5 (IPV4_ADDRESS), Length: 20 + // Type:5 (IPV4-ADDRESS), Length: 20 0x00, 0x05, 0x00, 0x14, // IPv6 Address: "2001:0db8:85a3:0000:0000:8a2e:0370:7334" 0x20, 0x01, 0x0D, 0xB8, @@ -110,11 +110,11 @@ SCENARIO("IPv6 Adress Parameter (6)", "[serializable][sctp][parameter]") REQUIRE(!RTC::SCTP::IPv6AddressParameter::Parse(buffer1, sizeof(buffer1))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer2[] = { - // Type:6 (IPV6_ADDRESS), Length: 19 + // Type:6 (IPV6-ADDRESS), Length: 19 0x00, 0x06, 0x00, 0x14, // IPv6 Address: "2001:0db8:85a3:0000:0000:8a2e:0370:7334" 0x20, 0x01, 0x0D, 0xB8, @@ -126,11 +126,11 @@ SCENARIO("IPv6 Adress Parameter (6)", "[serializable][sctp][parameter]") REQUIRE(!RTC::SCTP::IPv6AddressParameter::Parse(buffer2, sizeof(buffer2))); - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer3[] = { - // Type:6 (IPV6_ADDRESS), Length: 21 + // Type:6 (IPV6-ADDRESS), Length: 21 0x00, 0x06, 0x00, 0x15, // IPv6 Address: "2001:0db8:85a3:0000:0000:8a2e:0370:7334" 0x20, 0x01, 0x0D, 0xB8, @@ -147,7 +147,7 @@ SCENARIO("IPv6 Adress Parameter (6)", "[serializable][sctp][parameter]") // clang-format off alignas(4) uint8_t buffer4[] = { - // Type:6 (IPV6_ADDRESS), Length: 20 + // Type:6 (IPV6-ADDRESS), Length: 20 0x00, 0x06, 0x00, 0x14, // IPv6 Address (wrong length) 0x20, 0x01, 0x0D, 0xB8, diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp index 78a14f54b5..fc32b99686 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp @@ -16,11 +16,11 @@ SCENARIO("Incoming SSN Reset Request Parameter (14)", "[serializable][sctp][para // clang-format off alignas(4) uint8_t buffer[] = { - // Type:14 (INCOMING_SSN_RESET_REQUEST), Length: 14 + // Type:14 (INCOMING-SSN-RESET-REQUEST), Length: 14 0x00, 0x0E, 0x00, 0x0E, // Re-configuration Request Sequence Number: 0x11223344 0x11, 0x22, 0x33, 0x44, - // Stream 1: 0x5001, Stream 2: 0x5002 + // Stream 1: 0x5001, stream 2: 0x5002 0x50, 0x01, 0x50, 0x02, // Stream 3: 0x5003, 2 bytes of padding 0x50, 0x03, 0x00, 0x00, diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp index 8aae4a712a..c7a75be7dd 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp @@ -16,7 +16,7 @@ SCENARIO("Outgoing SSN Reset Request Parameter (13)", "[serializable][sctp][para // clang-format off alignas(4) uint8_t buffer[] = { - // Type:13 (OUTGOING_SSN_RESET_REQUEST), Length: 22 + // Type:13 (OUTGOING-SSN-RESET-REQUEST), Length: 22 0x00, 0x0D, 0x00, 0x16, // Re-configuration Request Sequence Number: 0x11223344 0x11, 0x22, 0x33, 0x44, @@ -24,7 +24,7 @@ SCENARIO("Outgoing SSN Reset Request Parameter (13)", "[serializable][sctp][para 0x55, 0x66, 0x77, 0x88, // Sender's Last Assigned TSN: 0xAABBCCDD 0xAA, 0xBB, 0xCC, 0xDD, - // Stream 1: 0x5001, Stream 2: 0x5002 + // Stream 1: 0x5001, stream 2: 0x5002 0x50, 0x01, 0x50, 0x02, // Stream 3: 0x5003, 2 bytes of padding 0x50, 0x03, 0x00, 0x00, diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestReconfigurationResponseParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestReconfigurationResponseParameter.cpp index 8aaab240af..2e4ea82f74 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestReconfigurationResponseParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestReconfigurationResponseParameter.cpp @@ -15,7 +15,7 @@ SCENARIO("Re-configuration Response Parameter (16)", "[serializable][sctp][param // clang-format off alignas(4) uint8_t buffer[] = { - // Type:16 (RECONFIGURATION_RESPONSE), Length: 20 + // Type:16 (RECONFIGURATION-RESPONSE), Length: 20 0x00, 0x10, 0x00, 0x14, // Re-configuration Request Sequence Number: 287454020 0x11, 0x22, 0x33, 0x44, @@ -106,7 +106,7 @@ SCENARIO("Re-configuration Response Parameter (16)", "[serializable][sctp][param // clang-format off alignas(4) uint8_t buffer[] = { - // Type:16 (RECONFIGURATION_RESPONSE), Length: 12 + // Type:16 (RECONFIGURATION-RESPONSE), Length: 12 0x00, 0x10, 0x00, 0x0C, // Re-configuration Request Sequence Number: 3333333333 0xC6, 0xAE, 0xA1, 0x55, @@ -186,11 +186,11 @@ SCENARIO("Re-configuration Response Parameter (16)", "[serializable][sctp][param SECTION("ReconfigurationResponseParameter::Parse() fails") { - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer1[] = { - // Type:16 (RECONFIGURATION_RESPONSE), Length: 16 (should be 12 or 20) + // Type:16 (RECONFIGURATION-RESPONSE), Length: 16 (should be 12 or 20) 0x00, 0x10, 0x00, 0x10, // Re-configuration Request Sequence Number: 287454020 0x11, 0x22, 0x33, 0x44, @@ -209,7 +209,7 @@ SCENARIO("Re-configuration Response Parameter (16)", "[serializable][sctp][param // clang-format off alignas(4) uint8_t buffer2[] = { - // Type:16 (RECONFIGURATION_RESPONSE), Length: 20 + // Type:16 (RECONFIGURATION-RESPONSE), Length: 20 0x00, 0x10, 0x00, 0x14, // Re-configuration Request Sequence Number: 287454020 0x11, 0x22, 0x33, 0x44, diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestSsnTsnResetRequestParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestSsnTsnResetRequestParameter.cpp index 2abf76d4e8..1caf826a87 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestSsnTsnResetRequestParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestSsnTsnResetRequestParameter.cpp @@ -15,7 +15,7 @@ SCENARIO("SSN/TSN Reset Request Parameter (15)", "[serializable][sctp][parameter // clang-format off alignas(4) uint8_t buffer[] = { - // Type:15 (SSN_TSN_RESET_REQUEST), Length: 8 + // Type:15 (SSN-TSN-RESET-REQUEST), Length: 8 0x00, 0x0F, 0x00, 0x08, // Re-configuration Request Sequence Number: 666777888 0x27, 0xBE, 0x39, 0x20, diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestStateCookieParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestStateCookieParameter.cpp index a141a4e9bb..a8d0140611 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestStateCookieParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestStateCookieParameter.cpp @@ -17,7 +17,7 @@ SCENARIO("State Cookie Parameter (7)", "[serializable][sctp][parameter]") // clang-format off alignas(4) uint8_t buffer[] = { - // Type:7 (STATE_COOKIE), Length: 7 + // Type:7 (STATE-COOKIE), Length: 7 0x00, 0x07, 0x00, 0x07, // Cookie: 0xDDCCEE, 1 byte of padding 0xDD, 0xCC, 0xEE, 0x00, diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedAddressTypesParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedAddressTypesParameter.cpp index f48f8c6bec..bc1e15e6b7 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedAddressTypesParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedAddressTypesParameter.cpp @@ -15,11 +15,11 @@ SCENARIO("Supported Address Types Parameter (12)", "[serializable][sctp][paramet // clang-format off alignas(4) uint8_t buffer[] = { - // Type:12 (SUPPORTED_ADDRESS_TYPES), Length: 10 + // Type:12 (SUPPORTED-ADDRESS-TYPES), Length: 10 0x00, 0x0C, 0x00, 0x0A, - // Address Type 1: 0x1001, Address Type 2: 0x2002 + // Address type 1: 0x1001, Address Type 2: 0x2002 0x10, 0x01, 0x20, 0x02, - // Address Type 3: 0x3003, 2 bytes of padding + // Address type 3: 0x3003, 2 bytes of padding 0x30, 0x03, 0x00, 0x00, // Extra bytes that should be ignored 0xAA, 0xBB, 0xCC @@ -90,13 +90,13 @@ SCENARIO("Supported Address Types Parameter (12)", "[serializable][sctp][paramet SECTION("SupportedAddressTypesParameter::Parse() fails") { - // Wrong Length field (not even). + // Wrong length field (not even). // clang-format off alignas(4) uint8_t buffer1[] = { - // Type:12 (SUPPORTED_ADDRESS_TYPES), Length: 7 + // Type:12 (SUPPORTED-ADDRESS-TYPES), Length: 7 0x00, 0x0C, 0x00, 0x0A, - // Address Type 1: 0x1001, Address Type 2: 0x2002 + // Address type 1: 0x1001, Address Type 2: 0x2002 0x10, 0x01, 0x20, 0x02, }; // clang-format on diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp index 2f6ec47f0d..117dbe298b 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp @@ -16,10 +16,10 @@ SCENARIO("Supported Extensions Parameter (32776)", "[serializable][sctp][paramet // clang-format off alignas(4) uint8_t buffer[] = { - // Type:32776 (SUPPORTED_EXTENSIONS), Length: 7 + // Type:32776 (SUPPORTED-EXTENSIONS), Length: 7 0x80, 0x08, 0x00, 0x07, - // Chunk Type 1: RE_CONFIG (0x82), Chunk Type 2: ECNE (0x0C), - // Chunk Type 3: UNKNOWN (0x42), 1 byte of padding + // Chunk type 1: RE-CONFIG (0x82), chunk type 2: ECNE (0x0C), + // chunk type 3: UNKNOWN (0x42), 1 byte of padding 0x82, 0x0C, 0x42, 0x00, // Extra bytes that should be ignored 0xAA, 0xBB, 0xCC diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestUnknownParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestUnknownParameter.cpp index dce497aa34..95edb7c666 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestUnknownParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestUnknownParameter.cpp @@ -114,7 +114,7 @@ SCENARIO("Unknown Parameter", "[serializable][sctp][parameter]") SECTION("UnknownParameter::Parse() fails") { - // Wrong Length field. + // Wrong length field. // clang-format off alignas(4) uint8_t buffer1[] = { diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestUnrecognizedParameterParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestUnrecognizedParameterParameter.cpp index c1332a7196..a0780f1f88 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestUnrecognizedParameterParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestUnrecognizedParameterParameter.cpp @@ -15,7 +15,7 @@ SCENARIO("Unrecognized Parameter Parameter (7)", "[serializable][sctp][parameter // clang-format off alignas(4) uint8_t buffer[] = { - // Type:8 (UNRECOGNIZED_PARAMETER), Length: 7 + // Type:8 (UNRECOGNIZED-PARAMETER), Length: 7 0x00, 0x08, 0x00, 0x07, // Unrecognized Parameter: 0xDDCCEE, 1 byte of padding 0xDD, 0xCC, 0xEE, 0x00, diff --git a/worker/test/src/RTC/SCTP/packet/parameters/TestZeroChecksumAcceptableParameter.cpp b/worker/test/src/RTC/SCTP/packet/parameters/TestZeroChecksumAcceptableParameter.cpp index 7ba0e772be..e0d55a20b1 100644 --- a/worker/test/src/RTC/SCTP/packet/parameters/TestZeroChecksumAcceptableParameter.cpp +++ b/worker/test/src/RTC/SCTP/packet/parameters/TestZeroChecksumAcceptableParameter.cpp @@ -15,7 +15,7 @@ SCENARIO("Zero Checksum Acceptable Parameter (32769)", "[serializable][sctp][par // clang-format off alignas(4) uint8_t buffer[] = { - // Type:32769 (ZERO_CHECKSUM_ACCEPTABLE), Length: 8 + // Type:32769 (ZERO-CHECKSUM-ACCEPTABLE), Length: 8 0x80, 0x01, 0x00, 0x08, // Alternate Error Detection Method (EDMID) : 0x0001 0x00, 0x00, 0x00, 0x01, diff --git a/worker/test/src/RTC/SCTP/sctpCommon.cpp b/worker/test/src/RTC/SCTP/sctpCommon.cpp index f1aaf64ca8..36a6d41de5 100644 --- a/worker/test/src/RTC/SCTP/sctpCommon.cpp +++ b/worker/test/src/RTC/SCTP/sctpCommon.cpp @@ -3,7 +3,7 @@ namespace sctpCommon { - // NOTE: Buffers must be 4-byte aligned since SCTP Packet parsing casts them + // NOTE: Buffers must be 4-byte aligned since SCTP packet parsing casts them // to structs that require 4-byte alignment. Without this, accessing multi-byte // fields would be undefined behavior on strict-alignment architectures. alignas(4) thread_local uint8_t FactoryBuffer[]; diff --git a/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp b/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp index e98e1723de..ad622e0d36 100644 --- a/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp +++ b/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp @@ -966,9 +966,9 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]") SECTION("generates Forward-TSN until next stream reset TSN") { // This test generates: - // * Stream 1: TSN 10, 11, 12 - // * Stream 2: TSN 13, 14 - // * Stream 3: TSN 15, 16 + // * stream 1: TSN 10, 11, 12 + // * stream 2: TSN 13, 14 + // * stream 3: TSN 15, 16 // // Then it expires chunk 12-15, and ensures that the generated FORWARD-TSN // only includes up till TSN 12 until the cum ack TSN has reached 12, and diff --git a/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp b/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp index e926732a5a..1368cb575c 100644 --- a/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp +++ b/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp @@ -1290,7 +1290,7 @@ SCENARIO("SCTP RetransmissionQueue", "[sctp][retransmissionqueue]") getSentPacketTSNs(retransmissionQueue) == std::vector{ 10, 11, 12, 13, 14, 15, 16, 17 }); - // Ack 9, 20-25. This is an invalid SACK Chunk, but should still be handled. + // Ack 9, 20-25. This is an invalid SACK chunk, but should still be handled. retransmissionQueue.HandleReceivedSackChunk( nowMs, createSackChunk( diff --git a/worker/test/src/RTC/TestTransportCongestionControlServer.cpp b/worker/test/src/RTC/TestTransportCongestionControlServer.cpp index f0b6fd8c47..6ccc332860 100644 --- a/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +++ b/worker/test/src/RTC/TestTransportCongestionControlServer.cpp @@ -91,8 +91,8 @@ SCENARIO("TransportCongestionControlServer", "[rtp]") 0x90, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, - 0xbe, 0xde, 0x00, 0x01, // Header Extensions - 0x51, 0x60, 0xee, 0x00 // TCC Feedback + 0xbe, 0xde, 0x00, 0x01, // Header extensions + 0x51, 0x60, 0xee, 0x00 // TCC feedback }; // clang-format on diff --git a/worker/test/src/Utils/TestString.cpp b/worker/test/src/Utils/TestString.cpp index 03d7d77a04..5fd1bb49b4 100644 --- a/worker/test/src/Utils/TestString.cpp +++ b/worker/test/src/Utils/TestString.cpp @@ -64,7 +64,7 @@ SCENARIO("Utils::String", "[utils][string]") // clang-format off uint8_t rtpPacket[] = { - 0xBE, 0xDE, 0, 3, // Header Extension + 0xBE, 0xDE, 0, 3, // Header extension 0b00010000, 0xFF, 0b00100001, 0xFF, 0xFF, 0, 0, 0b00110011, 0xFF, 0xFF, 0xFF, 0xFF