Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spec links to public items #591

Merged
merged 7 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion dtls/src/alert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ impl From<u8> for AlertDescription {
// preventing the failed session from being used to establish new
// connections. Like other messages, alert messages are encrypted and
// compressed, as specified by the current connection state.
// https://tools.ietf.org/html/rfc5246#section-7.2
/// ## Specifications
///
/// * [RFC 5246 §7.2]
///
/// [RFC 5246 §7.2]: https://tools.ietf.org/html/rfc5246#section-7.2
#[derive(Copy, Clone, PartialEq, Debug)]
pub struct Alert {
pub(crate) alert_level: AlertLevel,
Expand Down
6 changes: 5 additions & 1 deletion dtls/src/application_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ use crate::error::Result;
// fragmented, compressed, and encrypted based on the current connection
// state. The messages are treated as transparent data to the record
// layer.
// https://tools.ietf.org/html/rfc5246#section-10
/// ## Specifications
///
/// * [RFC 5246 §10]
///
/// [RFC 5246 §10]: https://tools.ietf.org/html/rfc5246#section-10
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct ApplicationData {
pub data: Vec<u8>,
Expand Down
6 changes: 5 additions & 1 deletion dtls/src/change_cipher_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ use super::error::*;
// ciphering strategies. The protocol consists of a single message,
// which is encrypted and compressed under the current (not the pending)
// connection state. The message consists of a single byte of value 1.
// https://tools.ietf.org/html/rfc5246#section-7.1
/// ## Specifications
///
/// * [RFC 5246 §7.1]
///
/// [RFC 5246 §7.1]: https://tools.ietf.org/html/rfc5246#section-7.1
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct ChangeCipherSpec;

Expand Down
6 changes: 5 additions & 1 deletion dtls/src/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ use super::change_cipher_spec::*;
use super::handshake::*;
use crate::error::*;

// https://tools.ietf.org/html/rfc4346#section-6.2.1
/// ## Specifications
///
/// * [RFC 4346 §6.2.1]
///
/// [RFC 4346 §6.2.1]: https://tools.ietf.org/html/rfc4346#section-6.2.1
#[derive(Default, Copy, Clone, PartialEq, Eq, Debug)]
pub enum ContentType {
ChangeCipherSpec = 20,
Expand Down
6 changes: 5 additions & 1 deletion dtls/src/extension/extension_supported_elliptic_curves.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ use crate::curve::named_curve::*;

const EXTENSION_SUPPORTED_GROUPS_HEADER_SIZE: usize = 6;

// https://tools.ietf.org/html/rfc8422#section-5.1.1
/// ## Specifications
///
/// * [RFC 8422 §5.1.1]
///
/// [RFC 8422 §5.1.1]: https://tools.ietf.org/html/rfc8422#section-5.1.1
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ExtensionSupportedEllipticCurves {
pub elliptic_curves: Vec<NamedCurve>,
Expand Down
6 changes: 5 additions & 1 deletion dtls/src/extension/extension_supported_point_formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ pub type EllipticCurvePointFormat = u8;

pub const ELLIPTIC_CURVE_POINT_FORMAT_UNCOMPRESSED: EllipticCurvePointFormat = 0;

// https://tools.ietf.org/html/rfc4492#section-5.1.2
/// ## Specifications
///
/// * [RFC 4492 §5.1.2]
///
/// [RFC 4492 §5.1.2]: https://tools.ietf.org/html/rfc4492#section-5.1.2
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ExtensionSupportedPointFormats {
pub(crate) point_formats: Vec<EllipticCurvePointFormat>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ use crate::signature_hash_algorithm::*;

const EXTENSION_SUPPORTED_SIGNATURE_ALGORITHMS_HEADER_SIZE: usize = 6;

// https://tools.ietf.org/html/rfc5246#section-7.4.1.4.1
/// ## Specifications
///
/// * [RFC 5246 §7.4.1.4.1]
///
/// [RFC 5246 §7.4.1.4.1]: https://tools.ietf.org/html/rfc5246#section-7.4.1.4.1
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ExtensionSupportedSignatureAlgorithms {
pub(crate) signature_hash_algorithms: Vec<SignatureHashAlgorithm>,
Expand Down
6 changes: 5 additions & 1 deletion dtls/src/extension/extension_use_extended_master_secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ use super::*;

const EXTENSION_USE_EXTENDED_MASTER_SECRET_HEADER_SIZE: usize = 4;

// https://tools.ietf.org/html/rfc8422
/// ## Specifications
///
/// * [RFC 8422]
///
/// [RFC 8422]: https://tools.ietf.org/html/rfc8422
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ExtensionUseExtendedMasterSecret {
pub(crate) supported: bool,
Expand Down
12 changes: 10 additions & 2 deletions dtls/src/extension/extension_use_srtp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ mod extension_use_srtp_test;
use super::*;

// SRTPProtectionProfile defines the parameters and options that are in effect for the SRTP processing
// https://tools.ietf.org/html/rfc5764#section-4.1.2
/// ## Specifications
///
/// * [RFC 5764 §4.1.2]
///
/// [RFC 5764 §4.1.2]: https://tools.ietf.org/html/rfc5764#section-4.1.2
#[allow(non_camel_case_types)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum SrtpProtectionProfile {
Expand All @@ -29,7 +33,11 @@ impl From<u16> for SrtpProtectionProfile {

const EXTENSION_USE_SRTPHEADER_SIZE: usize = 6;

// https://tools.ietf.org/html/rfc8422
/// ## Specifications
///
/// * [RFC 8422]
///
/// [RFC 8422]: https://tools.ietf.org/html/rfc8422
#[allow(non_camel_case_types)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ExtensionUseSrtp {
Expand Down
7 changes: 6 additions & 1 deletion dtls/src/extension/renegotiation_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ const RENEGOTIATION_INFO_HEADER_SIZE: usize = 5;

/// RenegotiationInfo allows a Client/Server to
/// communicate their renegotiation support
/// https://tools.ietf.org/html/rfc5746
///
/// ## Specifications
///
/// * [RFC 5746]
///
/// [RFC 5746]: https://tools.ietf.org/html/rfc5746
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ExtensionRenegotiationInfo {
pub(crate) renegotiated_connection: u8,
Expand Down
7 changes: 5 additions & 2 deletions dtls/src/handshake/handshake_message_hello_verify_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ use crate::record_layer::record_layer_header::*;
MAY respond with a HelloVerifyRequest message. This message contains
a stateless cookie generated using the technique of [PHOTURIS]. The
client MUST retransmit the ClientHello with the cookie added.

https://tools.ietf.org/html/rfc6347#section-4.2.1
*/
/// ## Specifications
///
/// * [RFC 6347 §4.2.1]
///
/// [RFC 6347 §4.2.1]: https://tools.ietf.org/html/rfc6347#section-4.2.1
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct HandshakeMessageHelloVerifyRequest {
pub(crate) version: ProtocolVersion,
Expand Down
6 changes: 5 additions & 1 deletion dtls/src/handshake/handshake_random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ use rand::Rng;
pub const RANDOM_BYTES_LENGTH: usize = 28;
pub const HANDSHAKE_RANDOM_LENGTH: usize = RANDOM_BYTES_LENGTH + 4;

// https://tools.ietf.org/html/rfc4346#section-7.4.1.2
/// ## Specifications
///
/// * [RFC 4346 §7.4.1.2]
///
/// [RFC 4346 §7.4.1.2]: https://tools.ietf.org/html/rfc4346#section-7.4.1.2
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct HandshakeRandom {
pub gmt_unix_time: SystemTime,
Expand Down
6 changes: 5 additions & 1 deletion dtls/src/handshake/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ use handshake_message_server_key_exchange::*;
use super::content::*;
use super::error::*;

// https://tools.ietf.org/html/rfc5246#section-7.4
/// ## Specifications
///
/// * [RFC 5246 §7.4]
///
/// [RFC 5246 §7.4]: https://tools.ietf.org/html/rfc5246#section-7.4
#[derive(Default, Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub enum HandshakeType {
HelloRequest = 0,
Expand Down
6 changes: 5 additions & 1 deletion dtls/src/record_layer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ use crate::handshake::Handshake;
only change is the inclusion of an explicit sequence number in the
record. This sequence number allows the recipient to correctly
verify the TLS MAC.
https://tools.ietf.org/html/rfc4347#section-4.1
*/
/// ## Specifications
///
/// * [RFC 4347 §4.1]
///
/// [RFC 4347 §4.1]: https://tools.ietf.org/html/rfc4347#section-4.1
#[derive(Debug, Clone, PartialEq)]
pub struct RecordLayer {
pub record_layer_header: RecordLayerHeader,
Expand Down
6 changes: 5 additions & 1 deletion dtls/src/record_layer/record_layer_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ pub const PROTOCOL_VERSION1_2: ProtocolVersion = ProtocolVersion {
minor: DTLS1_2MINOR,
};

// https://tools.ietf.org/html/rfc4346#section-6.2.1
/// ## Specifications
///
/// * [RFC 4346 §6.2.1]
///
/// [RFC 4346 §6.2.1]: https://tools.ietf.org/html/rfc4346#section-6.2.1
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
pub struct ProtocolVersion {
pub major: u8,
Expand Down
9 changes: 7 additions & 2 deletions ice/src/tcp_type/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ mod tcp_type_test;

use std::fmt;

// TCPType is the type of ICE TCP candidate as described in
// ttps://tools.ietf.org/html/rfc6544#section-4.5
/// TCPType is the type of ICE TCP candidate
///
/// ## Specifications
///
/// * [RFC 6544 §4.5]
///
/// [RFC 6544 §4.5]: https://tools.ietf.org/html/rfc6544#section-4.5
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
pub enum TcpType {
/// The default value. For example UDP candidates do not need this field.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ use crate::util::*;
type Result<T> = std::result::Result<T, util::Error>;

/// ReceiverEstimatedMaximumBitrate contains the receiver's estimated maximum bitrate.
/// see: https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03
///
/// ## Specifications
///
/// * [draft-alvestrand-rmcat-remb-03]
///
/// [draft-alvestrand-rmcat-remb-03]: https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03
#[derive(Debug, PartialEq, Default, Clone)]
pub struct ReceiverEstimatedMaximumBitrate {
/// SSRC of sender
Expand Down
8 changes: 6 additions & 2 deletions rtcp/src/transport_feedbacks/transport_layer_cc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use crate::util::*;

type Result<T> = std::result::Result<T, util::Error>;

/// https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01#page-5
/// 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
/// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Expand All @@ -40,9 +39,14 @@ type Result<T> = std::result::Result<T, util::Error>;
/// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/// | recv delta | recv delta | zero padding |
/// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

// for packet status chunk
/// type of packet status chunk
///
/// ## Specifications
///
/// * [draft-holmer-rmcat-transport-wide-cc-extensions-01, page 5]
///
/// [draft-holmer-rmcat-transport-wide-cc-extensions-01, page 5]: https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01#page-5
#[derive(Default, PartialEq, Eq, Debug, Clone)]
#[repr(u16)]
pub enum StatusChunkTypeTcc {
Expand Down
7 changes: 5 additions & 2 deletions rtcp/src/transport_feedbacks/transport_layer_nack/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ const TLN_LENGTH: usize = 2;
const NACK_OFFSET: usize = 8;

// The TransportLayerNack packet informs the encoder about the loss of a transport packet
// IETF RFC 4585, Section 6.2.1
// https://tools.ietf.org/html/rfc4585#section-6.2.1
/// ## Specifications
///
/// * [RFC 4585 §6.2.1]
///
/// [RFC 4585 §6.2.1]: https://tools.ietf.org/html/rfc4585#section-6.2.1
#[derive(Debug, PartialEq, Eq, Default, Clone)]
pub struct TransportLayerNack {
/// SSRC of sender
Expand Down
61 changes: 49 additions & 12 deletions rtp/src/codecs/h265/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,20 @@ const H265NALU_FRAGMENTATION_UNIT_TYPE: u8 = 49;
const H265NALU_PACI_PACKET_TYPE: u8 = 50;

/// H265NALUHeader is a H265 NAL Unit Header
/// <https://datatracker.ietf.org/doc/html/rfc7798#section-1.1.4>
///
/// ```text
/// +---------------+---------------+
/// |0|1|2|3|4|5|6|7|0|1|2|3|4|5|6|7|
/// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/// |F| Type | layer_id | tid |
/// +-------------+-----------------+
/// |0|1|2|3|4|5|6|7|0|1|2|3|4|5|6|7|
/// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/// |F| Type | layer_id | tid|
/// +-------------+-----------------+
/// ```
///
/// ## Specifications
///
/// * [RFC 7798 §1.1.4]
///
/// [RFC 7798 §1.1.4]: https://tools.ietf.org/html/rfc7798#section-1.1.4
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
pub struct H265NALUHeader(pub u16);

Expand Down Expand Up @@ -322,7 +330,11 @@ impl H265NALUHeader {
/// | :...OPTIONAL RTP padding |
/// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
///
/// Reference: <https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.1>
/// ## Specifications
///
/// * [RFC 7798 §4.4.1]
///
/// [RFC 7798 §4.4.1]: https://tools.ietf.org/html/rfc7798#section-4.4.1
#[derive(Default, Debug, Clone, PartialEq, Eq)]
pub struct H265SingleNALUnitPacket {
/// payload_header is the header of the H265 packet.
Expand Down Expand Up @@ -411,7 +423,11 @@ impl H265SingleNALUnitPacket {
/// | :
/// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
///
/// Reference: <https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.2>
/// ## Specifications
///
/// * [RFC 7798 §4.4.2]
///
/// [RFC 7798 §4.4.2]: https://tools.ietf.org/html/rfc7798#section-4.4.2
#[derive(Default, Debug, Clone, PartialEq, Eq)]
pub struct H265AggregationUnitFirst {
donl: Option<u16>,
Expand Down Expand Up @@ -451,7 +467,11 @@ impl H265AggregationUnitFirst {
/// | :
/// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
///
/// Reference: <https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.2>
/// ## Specifications
///
/// * [RFC 7798 §4.4.2]
///
/// [RFC 7798 §4.4.2]: https://tools.ietf.org/html/rfc7798#section-4.4.2
#[derive(Default, Debug, Clone, PartialEq, Eq)]
pub struct H265AggregationUnit {
dond: Option<u8>,
Expand Down Expand Up @@ -491,7 +511,11 @@ impl H265AggregationUnit {
/// | :...OPTIONAL RTP padding |
/// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
///
/// Reference: <https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.2>
/// ## Specifications
///
/// * [RFC 7798 §4.4.2]
///
/// [RFC 7798 §4.4.2]: https://tools.ietf.org/html/rfc7798#section-4.4.2
#[derive(Default, Debug, Clone, PartialEq, Eq)]
pub struct H265AggregationPacket {
first_unit: Option<H265AggregationUnitFirst>,
Expand Down Expand Up @@ -650,7 +674,11 @@ impl H265FragmentationUnitHeader {
/// | :...OPTIONAL RTP padding |
/// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
///
/// Reference: <https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.3>
/// ## Specifications
///
/// * [RFC 7798 §4.4.3]
///
/// [RFC 7798 §4.4.3]: https://tools.ietf.org/html/rfc7798#section-4.4.3
#[derive(Default, Debug, Clone, PartialEq, Eq)]
pub struct H265FragmentationUnitPacket {
/// payload_header is the header of the H265 packet.
Expand Down Expand Up @@ -749,7 +777,11 @@ impl H265FragmentationUnitPacket {
/// | :...OPTIONAL RTP padding |
/// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
///
/// Reference: <https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.4>
/// ## Specifications
///
/// * [RFC 7798 §4.4.4]
///
/// [RFC 7798 §4.4.4]: https://tools.ietf.org/html/rfc7798#section-4.4.4
#[derive(Default, Debug, Clone, PartialEq, Eq)]
pub struct H265PACIPacket {
/// payload_header is the header of the H265 packet.
Expand Down Expand Up @@ -878,7 +910,12 @@ impl H265PACIPacket {
///

/// H265TSCI is a Temporal Scalability Control Information header extension.
/// Reference: <https://datatracker.ietf.org/doc/html/rfc7798#section-4.5>
///
/// ## Specifications
///
/// * [RFC 7798 §4.5]
///
/// [RFC 7798 §4.5]: https://tools.ietf.org/html/rfc7798#section-4.5
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
pub struct H265TSCI(pub u32);

Expand Down
Loading
Loading