Skip to main content

Module message

Module message 

Source
Expand description

Draft-11 control message encoding and decoding.

Key changes from draft-09/10:

  • Setup IDs: 0x40/0x41 -> 0x20/0x21
  • subscribe_id -> request_id throughout
  • MaxSubscribeId -> MaxRequestId, SubscribesBlocked -> RequestsBlocked
  • Subscribe gains track_alias and forward fields
  • SubscribeOk: no track_alias
  • SubscribeError gains trailing track_alias
  • SubscribeDone gains stream_count
  • SubscribeUpdate uses start_group/start_object (not Location)
  • Announce gains request_id; AnnounceOk/AnnounceError use request_id
  • AnnounceCancel: namespace + error_code + reason_phrase
  • SubscribeAnnounces gains request_id
  • TrackStatusRequest gains request_id and parameters
  • TrackStatus restructured: request_id + status_code + largest_location + parameters
  • Fetch restructured: 3 fetch types (Standalone, RelativeJoining, AbsoluteJoining)
  • FetchOk: group_order + end_of_track + end_location (no track_alias)
  • Uses even/odd KVP encoding (not d07 format)
  • Framing: type_id(vi) + payload_length(16) + payload

Re-exportsΒ§

pub use crate::types::check_group_range;
pub use crate::types::check_location_range;
pub use crate::types::check_open_ended_group_range;

StructsΒ§

Announce
ANNOUNCE message (type 0x06).
AnnounceCancel
ANNOUNCE_CANCEL message (type 0x0C).
AnnounceError
ANNOUNCE_ERROR message (type 0x08).
AnnounceOk
ANNOUNCE_OK message (type 0x07).
ClientSetup
CLIENT_SETUP message (type 0x20).
Fetch
FETCH message (type 0x16).
FetchCancel
FETCH_CANCEL message (type 0x17).
FetchError
FETCH_ERROR message (type 0x19).
FetchOk
FETCH_OK message (type 0x18).
GoAway
GOAWAY message (type 0x10).
MaxRequestId
MAX_REQUEST_ID message (type 0x15).
RequestsBlocked
REQUESTS_BLOCKED message (type 0x1A).
ServerSetup
SERVER_SETUP message (type 0x21).
Subscribe
SUBSCRIBE message (type 0x03).
SubscribeAnnounces
SUBSCRIBE_ANNOUNCES message (type 0x11).
SubscribeAnnouncesError
SUBSCRIBE_ANNOUNCES_ERROR message (type 0x13).
SubscribeAnnouncesOk
SUBSCRIBE_ANNOUNCES_OK message (type 0x12).
SubscribeDone
SUBSCRIBE_DONE message (type 0x0B).
SubscribeError
SUBSCRIBE_ERROR message (type 0x05).
SubscribeOk
SUBSCRIBE_OK message (type 0x04).
SubscribeUpdate
SUBSCRIBE_UPDATE message (type 0x02).
TrackStatus
TRACK_STATUS message (type 0x0E).
TrackStatusRequest
TRACK_STATUS_REQUEST message (type 0x0D).
Unannounce
UNANNOUNCE message (type 0x09).
Unsubscribe
UNSUBSCRIBE message (type 0x0A).
UnsubscribeAnnounces
UNSUBSCRIBE_ANNOUNCES message (type 0x14).

EnumsΒ§

ControlMessage
A parsed MoQT control message (draft-11).
FetchPayload
Fetch-type-specific payload fields.
FetchType
Fetch type discriminant.
MessageType
Control message type IDs (draft-11).

ConstantsΒ§

AUTHORIZATION_TOKEN πŸ”’
AUTHORIZATION TOKEN, the Version Specific Parameter of Section 8.2.1.1.
DELIVERY_TIMEOUT πŸ”’
DELIVERY TIMEOUT, the Version Specific Parameter of Section 8.2.1.2.
KNOWN_PARAMETERS πŸ”’
Every Version Specific Parameter Type Section 8.2.1 names.
KNOWN_SETUP_PARAMETERS πŸ”’
Every Setup Parameter Type Section 8.3.2 names.
MAX_CACHE_DURATION πŸ”’
MAX_CACHE_DURATION, the Version Specific Parameter of Section 8.2.1.3.
REPEATABLE_PARAMETERS πŸ”’
The Version Specific Parameter Types whose own definition allows a repeat.
REPEATABLE_SETUP_PARAMETERS πŸ”’
The Setup Parameter Types whose own definition allows a repeat.
SETUP_MAX_AUTH_TOKEN_CACHE_SIZE πŸ”’
MAX_AUTH_TOKEN_CACHE_SIZE, the Setup Parameter of Section 8.3.2.3.
SETUP_MAX_REQUEST_ID πŸ”’
MAX_REQUEST_ID, the Setup Parameter of Section 8.3.2.2.
SETUP_PATH πŸ”’
PATH, the Setup Parameter of Section 8.3.2.1.

FunctionsΒ§

check_authorization_tokens πŸ”’
Hold every AUTHORIZATION TOKEN parameter to the Token structure it names.
check_content πŸ”’
check_discriminators πŸ”’
Refuse a message whose optional fields disagree with the field that decides whether they are on the wire.
check_filter πŸ”’
Both halves of a Start Location travel together, and only the two absolute filters put one on the wire. The Filter Type is still a raw varint on this draft, so the range check the decoder applies belongs here too.
check_full_track_name πŸ”’
check_group_order πŸ”’
Refuse a Group Order of 0x0 on the messages that forbid it.
check_ranges πŸ”’
Refuse a request whose range ends before it starts.
check_receiver_parameters πŸ”’
Refuse a received parameter list only where Section 8.2 lets a receiver refuse it.
check_sender_parameters πŸ”’
Refuse a parameter list a sender is not allowed to put on the wire.
check_track_status πŸ”’
Hold a TRACK_STATUS Status Code and the fields after it to Section 8.18.
decode_parameters πŸ”’
Decode a Version Specific Parameter list.
decode_setup_parameters πŸ”’
Decode the Setup Parameters of a CLIENT_SETUP or SERVER_SETUP message.
encode_parameters πŸ”’
Encode a Version Specific Parameter list.
encode_setup_parameters πŸ”’
Encode the Setup Parameters of a CLIENT_SETUP or SERVER_SETUP message.
read_content_exists πŸ”’
Read a Content Exists flag, which carries the same sentence as Forward and also decides whether a Largest Location follows.
read_forward πŸ”’
Read a Forward flag: β€œAny other value is a protocol error and MUST terminate the session with a Protocol Violation”
read_group_order πŸ”’
Read a Group Order from a message that lets the publisher choose.
read_group_order_response πŸ”’
Read a Group Order from a message that must name a real order.
read_reason_phrase πŸ”’
Read a Reason Phrase, holding it to the cap this draft states for a receiver.
read_u8 πŸ”’
Take one byte, or report the end of the buffer instead of panicking.