pub struct AlcPacket<'a> {
pub lct: LctHeader<'a>,
pub fec_payload_id: &'a [u8],
pub payload: &'a [u8],
}Expand description
A parsed ALC packet (RFC 5775 §4.1): an LctHeader followed by an opaque
FEC Payload ID and the encoding-symbol payload.
Nothing is stored raw beyond the application-opaque FEC Payload ID and
payload regions; the LCT header is fully typed and re-serialized from its
fields. fec_payload_id_len must be supplied to AlcPacket::parse
because RFC 5775 does not define the FEC Payload ID size (it is FEC-scheme
dependent).
Fields§
§lct: LctHeader<'a>The LCT header (RFC 5651).
fec_payload_id: &'a [u8]The opaque FEC Payload ID bytes (FEC-scheme dependent; may be empty for a data-less control packet).
payload: &'a [u8]The encoding-symbol payload bytes (may be empty for a data-less packet).
Implementations§
Source§impl<'a> AlcPacket<'a>
impl<'a> AlcPacket<'a>
Sourcepub fn new(
lct: LctHeader<'a>,
fec_payload_id: &'a [u8],
payload: &'a [u8],
) -> Self
pub fn new( lct: LctHeader<'a>, fec_payload_id: &'a [u8], payload: &'a [u8], ) -> Self
Construct an ALC packet from its parts.
Sourcepub fn serialized_len(&self) -> usize
pub fn serialized_len(&self) -> usize
Total serialized length in bytes.
Sourcepub fn parse(data: &'a [u8], fec_payload_id_len: usize) -> Result<Self>
pub fn parse(data: &'a [u8], fec_payload_id_len: usize) -> Result<Self>
Parse an ALC packet. fec_payload_id_len is the FEC-scheme-defined size
of the FEC Payload ID in bytes (use 0 for a data-less packet that
carries no FEC Payload ID and no payload).
Sourcepub fn serialize_into(&self, out: &mut [u8]) -> Result<usize>
pub fn serialize_into(&self, out: &mut [u8]) -> Result<usize>
Serialize the ALC packet into out. Returns bytes written.