1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//! Multicast object-delivery wire formats: **ALC / LCT / FLUTE / NORM**.
//!
//! This crate parses and serializes the binary headers used to deliver files
//! and streams over IP multicast. Every format here is **IETF RMT** (Reliable
//! Multicast Transport) — RFC 5651, RFC 5775, RFC 6726, RFC 5740. No
//! broadcast-specific standard is implemented by this crate.
//!
//! Several delivery systems are layered *on top* of these formats and are
//! consumers of this crate rather than owners of it: **DVB** (DVB-IPTV and
//! DVB-MABR / ETSI TS 103 769 file delivery), **3GPP** (MBMS/eMBMS download
//! delivery), and **ATSC 3.0** (ROUTE, A/331 Annex A — written as a
//! profile-and-delta on RFC 5651/5775/6726).
//!
//! Renamed from `dvb-flute` at 0.4.0: the old name named one consumer of an
//! IETF standard rather than the standard itself, and read as a layering
//! error once non-DVB consumers needed to depend on it. All `dvb-flute`
//! versions are yanked; there is no shim.
//!
//! Implements:
//!
//! - [`LctHeader`] — the **Layered Coding Transport** header (RFC 5651 §5). The
//! fixed first word carries `V`/`C`/`PSI`/`S`/`O`/`H`/`A`/`B`, `HDR_LEN` and
//! the Codepoint; the `C`, `S`, `O` and `H` flags then drive the byte-widths
//! of the **CCI**, **TSI** and **TOI** fields (`4*(C+1)`, `4*S+2*H`,
//! `4*O+2*H` bytes). The shared `H` half-word feeds both TSI *and* TOI. Flag
//! bits and `HDR_LEN` are recomputed on serialize from the typed field
//! lengths — there is no raw passthrough.
//! - [`HeaderExtension`] — the LCT/NORM header-extension chain (RFC 5651 §5.2):
//! variable-length (`HET` 0..=127, carries `HEL`) and fixed-length (`HET`
//! 128..=255, one word) forms; with [`ExtTime`] (EXT_TIME) and the
//! [`LctExtType`] registry (EXT_NOP/EXT_AUTH/EXT_TIME).
//! - [`AlcPacket`] — an **Asynchronous Layered Coding** packet (RFC 5775):
//! LCT header + an opaque FEC Payload ID + the encoding-symbol payload, plus
//! `EXT_FTI` (HET 64) and the Small-Block-Systematic [`FecPayloadId128`].
//! - [`ExtFdt`] / [`ExtCenc`] — the **FLUTE** (RFC 6726) fixed-length LCT
//! extensions `EXT_FDT` (HET 192) and `EXT_CENC` (HET 193), plus the TOI = 0
//! FDT-Instance convention. The FDT Instance body is XML and is **out of
//! scope** of this binary crate — it rides as the packet payload.
//! - [`NormCommonHeader`] + [`NormData`] / [`NormInfo`] / [`NormCmd`] / [`NormFeedback`] — the
//! **NORM** (RFC 5740) common header and message types (NORM_INFO / NORM_DATA /
//! NORM_CMD / NORM_NACK / NORM_ACK / NORM_REPORT).
//! - [`SourceBlockPartition`] — the FEC Building Block's (RFC 5052 §9.1)
//! scheme-agnostic **Block Partitioning Algorithm**: given a transport
//! object's Transfer-Length, Encoding-Symbol-Length and
//! Maximum-Source-Block-Length, derive the number of source blocks and each
//! block's length in symbols. The common substrate `dvb-mabr` and
//! `atsc3-route` both need (issue #944) without hardcoding any FEC scheme's
//! FEC Payload ID or Scheme-specific OTI layout.
//!
//! ⚠ **FEC Payload ID** bit layouts are FEC-scheme dependent (RFC 5052 / the FEC
//! Scheme document) and are **not** defined by ALC/NORM themselves; this crate
//! exposes them as opaque byte slices (the caller supplies the length), with
//! [`FecPayloadId128`] provided as one concrete illustrative layout.
//!
//! All integer fields are big-endian. `#![no_std]` + `alloc`; depends only on
//! `broadcast-common`.
//!
//! # Examples
//!
//! Build an LCT header from typed fields (flag-driven CCI/TSI/TOI widths) and
//! round-trip it:
//!
//! ```
//! use rmt_flute::{LctHeader, LCT_VERSION};
//!
//! let cci = [0u8; 4]; // C = 0
//! let tsi = [0u8; 4]; // S = 1, H = 0
//! let hdr = LctHeader {
//! version: LCT_VERSION,
//! psi: 0,
//! close_session: false,
//! close_object: false,
//! codepoint: 0,
//! cci: &cci,
//! tsi: &tsi,
//! toi: &[],
//! extensions: vec![],
//! };
//! let mut buf = vec![0u8; hdr.serialized_len()];
//! hdr.serialize_into(&mut buf).unwrap();
//! let (re, used) = LctHeader::parse(&buf).unwrap();
//! assert_eq!(used, buf.len());
//! assert_eq!(re, hdr);
//! ```
// Runnable examples, embedded so they render on docs.rs and stay in sync with
// the actual `examples/*.rs` files (shown, not compiled).
extern crate alloc;
pub use ;
pub use ;
pub use ;
pub use SourceBlockPartition;
pub use ;
pub use ;
pub use ;
pub use ;