ule
ULE — Unidirectional Lightweight Encapsulation (RFC 4326) with Extension Headers (RFC 5163): IP (and other PDUs) over MPEG-2 Transport Streams.
Implements:
Sndu— the SubNetwork Data Unit wire structure (RFC 4326 §4): theDbit + 15-bitLength+ 16-bitType, an optional 6-byte Destination NPA address (present iffD = 0), the PDU, and the 4-byte CRC-32 trailer.Lengthand the CRC are recomputed on serialize from the typed fields.TypeField— the §4.4 split at0x0600: a Next-Header (H-LEN/H-Type) below, an EtherType at or above.ExtensionHeader/PayloadChain— chained extension headers (RFC 4326 §5, RFC 5163 §3): Optional headers (H-LEN = 1..=5, total2·H-LENbytes) terminated by an EtherType or a Mandatory header (Test-SNDU0x00, Bridged-Frame0x01, TS-Concat0x02, PDU-Concat0x03).UleReceiver— TS-packet de-fragmentation/reassembly (RFC 4326 §6, §7): PUSI + 1-byte Payload Pointer handling, fragmentation across packets, packing of multiple SNDUs per packet, and End-Indicator /0xFFpadding.
The CRC-32 is the MPEG-2 / DSM-CC CRC (poly 0x04C11DB7, init 0xFFFFFFFF,
MSB-first, no reflection, no final XOR — RFC 4326 §4.6), reused from
dvb-common. It is verified byte-exact against RFC 4326 Appendix B's worked
example (CRC 0x7C171763) in the crate's fixture test.
#![no_std] + alloc; depends only on dvb-common.
Quick start
use ;
let pdu = ; // start of an IPv4 header
let sndu = new;
let mut buf = vec!;
sndu.serialize_into.unwrap;
assert_eq!;
Examples
Features
| Feature | Default | Description |
|---|---|---|
std |
yes | Link the standard library. Without it the crate is #![no_std] + alloc. |
serde |
no | serde::Serialize derives on public types. |
Minimum Supported Rust Version
1.81
License
MIT OR Apache-2.0