Functions to create ROHC feedback.
More...
#include <rohc/rohc.h>
#include <rohc/rohc_buf.h>
#include <feedback.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
Go to the source code of this file.
|
bool | rohc_decomp_feedback_size (const struct rohc_buf rohc_data, size_t *const feedback_hdr_len, size_t *const feedback_data_len) |
|
void | f_feedback1 (const uint32_t sn_bits, struct d_feedback *const feedback) |
| Build a FEEDBACK-1 packet. More...
|
|
bool | f_feedback2 (const rohc_profile_t profile_id, const enum rohc_feedback_ack_type ack_type, const rohc_mode_t mode, const uint32_t sn_bits, const size_t sn_bits_nr, struct d_feedback *const feedback) |
| Build a FEEDBACK-2 packet. More...
|
|
bool | f_add_option (struct d_feedback *const feedback, const enum rohc_feedback_opt opt_type, const uint8_t *const data, const size_t data_len) |
| Add an option data to the FEEDBACK-2 packet. More...
|
|
uint8_t * | f_wrap_feedback (struct d_feedback *feedback, const uint16_t cid, const rohc_cid_type_t cid_type, const rohc_feedback_crc_t protect_with_crc, const uint8_t *const crc_table, size_t *const final_size) |
| Wrap the feedback packet and add a CRC option if specified. More...
|
|
#define FEEDBACK_DATA_MAX_LEN 30 |
The maximum length (in bytes) of the feedback data.
Whether the feedback is protected by a CRC or not.
Enumerator |
---|
ROHC_FEEDBACK_WITH_NO_CRC |
No CRC protects the feedback
|
ROHC_FEEDBACK_WITH_CRC_OPT |
A CRC option protects the feedback
|
ROHC_FEEDBACK_WITH_CRC_BASE |
A base header CRC protects the feedback
|
bool f_add_option |
( |
struct d_feedback *const |
feedback, |
|
|
const enum rohc_feedback_opt |
opt_type, |
|
|
const uint8_t *const |
data, |
|
|
const size_t |
data_len |
|
) |
| |
Add an option data to the FEEDBACK-2 packet.
- Parameters
-
feedback | The feedback packet to which the option must be added |
opt_type | The type of option to add |
data | The option data |
data_len | The length of option data (in bytes) |
- Returns
- true if the option is successfully added, false otherwise
void f_feedback1 |
( |
const uint32_t |
sn_bits, |
|
|
struct d_feedback *const |
feedback |
|
) |
| |
Build a FEEDBACK-1 packet.
- Parameters
-
sn_bits | The LSB of the Sequence Number (SN) the feedback packet is associated with |
feedback | The feedback packet to build |
Build a FEEDBACK-2 packet.
- Parameters
-
profile_id | The ID of the decompression profile that builds the feedback |
ack_type | The type of acknowledgement:
|
mode | The mode in which ROHC operates:
|
sn_bits | The LSB of the Sequence Number (SN) the feedback packet is associated with |
sn_bits_nr | The number of SN LSB |
feedback | The feedback packet to build |
- Returns
- true if the packet is successfully built, false otherwise
Wrap the feedback packet and add a CRC option if specified.
- Warning
- CID may be greater than MAX_CID if the context was not found and generated a No Context feedback; it must however respect CID type
- Parameters
-
feedback | The feedback packet to which the CID must be appended |
cid | The Context ID (CID) to append |
cid_type | The type of CID used for the feedback |
protect_with_crc | Whether the CRC option must be added or not |
crc_table | The pre-computed table for fast CRC computation |
final_size | OUT: The final size of the feedback packet |
- Returns
- The feedback packet if successful, NULL otherwise
bool rohc_decomp_feedback_size |
( |
const struct rohc_buf |
rohc_data, |
|
|
size_t *const |
feedback_hdr_len, |
|
|
size_t *const |
feedback_data_len |
|
) |
| |