12 #ifndef ROC_FEC_HEADERS_H_
13 #define ROC_FEC_HEADERS_H_
68 memset(
this, 0,
sizeof(*
this));
72 uint16_t
sbn()
const {
82 uint16_t
esi()
const {
146 memset(
this, 0,
sizeof(*
this));
222 memset(
this, 0,
sizeof(*
this));
227 return (uint32_t(sbn_[0]) << 16) | (uint32_t(sbn_[1]) << 8) | uint32_t(sbn_[2]);
233 sbn_[0] = uint8_t((val >> 16) & 0xff);
234 sbn_[1] = uint8_t((val >> 8) & 0xff);
235 sbn_[2] = uint8_t(val & 0xff);
#define ROC_ATTR_PACKED_BEGIN
Pack structure fields. Place these before class or struct keyword.
#define ROC_ATTR_PACKED_END
Pack structure fields. Place these between '}' and ';'.
LDPC-Staircase Repair FEC Payload ID.
uint16_t k() const
Get source block length.
void set_k(uint16_t val)
Set source block length.
uint16_t esi() const
Get encoding symbol ID.
void clear()
Clear header.
void set_esi(uint16_t val)
Set encoding symbol ID.
void set_n(uint16_t val)
Set number encoding symbols.
static packet::FecScheme fec_scheme()
Get FEC scheme to which these packets belong to.
uint16_t n() const
Get number encoding symbols.
uint16_t sbn() const
Get source block number.
void set_sbn(uint16_t val)
Set source block number.
LDPC-Staircase Source FEC Payload ID.
uint16_t esi() const
Get encoding symbol ID.
void clear()
Clear header.
uint16_t k() const
Get source block length.
void set_k(uint16_t val)
Set source block length.
uint16_t sbn() const
Get source block number.
uint16_t n() const
Get number encoding symbols.
void set_sbn(uint16_t val)
Set source block number.
static packet::FecScheme fec_scheme()
Get FEC scheme to which these packets belong to.
void set_n(uint16_t)
Set number encoding symbols.
void set_esi(uint16_t val)
Set encoding symbol ID.
Reed-Solomon Source or Repair Payload ID (for m=8).
static packet::FecScheme fec_scheme()
Get FEC scheme to which these packets belong to.
uint32_t sbn() const
Get source block number.
void set_esi(uint16_t val)
Set encoding symbol ID.
uint16_t n() const
Get number encoding symbols.
void set_k(uint16_t val)
Set source block length.
void clear()
Clear header.
void set_n(uint16_t)
Set number encoding symbols.
uint8_t esi() const
Get encoding symbol ID.
void set_sbn(uint32_t val)
Set source block number.
uint16_t k() const
Get source block length.
Endian conversion functions.
uint16_t hton16u(uint16_t v)
Host to network byte order (unsigned 16-bit).
uint16_t ntoh16u(uint16_t v)
Network to host byte order (unsigned 16-bit).
PayloadID_Pos
FEC Payload ID position.
@ Header
PayloadID comes before payload.
@ Footer
PayloadID comes after payload.
PayloadID_Type
FEC Payload ID type.
@ Source
Source packet header of footer.
@ Repair
Source packet header of footer.
FecScheme
FECFRAME scheme.
@ FEC_ReedSolomon_M8
Reed-Solomon (m=8).
@ FEC_LDPC_Staircase
LDPC-Staircase.
#define roc_panic_if(x)
Panic if condition is true.
Commonly used types and functions.