59 uint64_t
tsi()
const {
return _tsi; };
64 uint64_t
toi()
const {
return _toi; };
74 size_t header_length()
const {
return _lct_header.lct_header_len * 4; };
94 char*
data()
const {
return _buffer; };
99 size_t size()
const {
return _len; };
105 uint32_t _fdt_instance_id = 0;
107 uint32_t _source_block_number = 0;
108 uint32_t _encoding_symbol_id = 0;
113 char* _buffer =
nullptr;
117 struct __attribute__((packed)) lct_header_t {
118 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
120 uint8_t source_packet_indicator:1;
121 uint8_t congestion_control_flag:2;
124 uint8_t close_object_flag:1;
125 uint8_t close_session_flag:1;
127 uint8_t half_word_flag:1;
130 #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
132 uint8_t congestion_control_flag:2;
133 uint8_t source_packet_indicator:1;
138 uint8_t half_word_flag:1;
140 uint8_t close_session_flag:1;
141 uint8_t close_object_flag:1;
143 #error "Endianness can not be determined"
145 uint8_t lct_header_len;
148 static_assert(
sizeof(_lct_header) == 4);
150 enum HeaderExtension {
A class for parsing and creating ALC packets.
uint64_t tsi() const
Get the TSI.
AlcPacket(uint16_t tsi, uint16_t toi, FecOti fec_oti, const std::vector< EncodingSymbol > &symbols, size_t max_size, uint32_t fdt_instance_id)
Create an ALC packet from encoding symbols.
char * data() const
Get a pointer to the payload data of the constructed packet.
size_t header_length() const
Get the LCT header length.
uint32_t fdt_instance_id() const
Get the FDT instance ID.
ContentEncoding content_encoding() const
Get the content encoding.
~AlcPacket()
Default destructor.
const FecOti & fec_oti() const
Get the FEC OTI values.
FecScheme fec_scheme() const
Get the FEC scheme.
size_t size() const
Get the payload size.
uint64_t toi() const
Get the TOI.
AlcPacket(char *data, size_t len)
Create an ALC packet from payload data.
FecScheme
Error correction schemes.
ContentEncoding
Content Encodings.