ROHC compression/decompression library
|
ROHC feedback routines. More...
#include "rohc.h"
#include "feedback.h"
#include "rohc_traces.h"
#include "rohc_debug.h"
#include <assert.h>
Functions | |
int | f_append_cid (struct d_feedback *feedback, const uint16_t cid, const rohc_cid_type_t cid_type) |
Append the CID to the feedback packet. | |
int | f_feedback1 (int sn, struct d_feedback *feedback) |
Build a FEEDBACK-1 packet. | |
int | f_feedback2 (int acktype, int mode, uint32_t sn, struct d_feedback *feedback) |
Build a FEEDBACK-2 packet. | |
int | f_add_option (struct d_feedback *feedback, const uint8_t opt_type, const unsigned char *data, const size_t data_len) |
Add an option data to the FEEDBACK-2 packet. | |
unsigned char * | f_wrap_feedback (struct d_feedback *feedback, const uint16_t cid, const rohc_cid_type_t cid_type, int with_crc, unsigned char *crc_table, int *final_size) |
Wrap the feedback packet and add a CRC option if specified. |
ROHC feedback routines.
int f_add_option | ( | struct d_feedback * | feedback, |
const uint8_t | opt_type, | ||
const unsigned char * | data, | ||
const size_t | data_len | ||
) |
Add an option data to the FEEDBACK-2 packet.
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) |
References d_feedback::data, FEEDBACK_DATA_MAX_LEN, OPT_TYPE_CRC, ROHC_ERROR, ROHC_OK, d_feedback::size, and d_feedback::type.
Referenced by d_optimistic_feedback(), f_feedback2(), and f_wrap_feedback().
int f_append_cid | ( | struct d_feedback * | feedback, |
const uint16_t | cid, | ||
const rohc_cid_type_t | cid_type | ||
) |
Append the CID to the feedback packet.
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 |
References c_bytesSdvl(), c_encodeSdvl(), d_feedback::data, rohc_debugf, ROHC_LARGE_CID, ROHC_LARGE_CID_MAX, ROHC_SMALL_CID_MAX, d_feedback::size, and zfree.
Referenced by f_wrap_feedback().
int f_feedback1 | ( | int | sn, |
struct d_feedback * | feedback | ||
) |
Build a FEEDBACK-1 packet.
sn | The Sequence Number (SN) the feedback packet is associated with |
feedback | The feedback packet to build |
References d_feedback::data, d_feedback::size, and d_feedback::type.
int f_feedback2 | ( | int | acktype, |
int | mode, | ||
uint32_t | sn, | ||
struct d_feedback * | feedback | ||
) |
Build a FEEDBACK-2 packet.
acktype | The type of acknowledgement: ACK, NACK or S-NACK |
mode | The mode in which ROHC operates: U_MODE, O_MODE or R_MODE |
sn | The Sequence Number (SN) the feedback packet is associated with |
feedback | The feedback packet to build |
References d_feedback::data, f_add_option(), OPT_TYPE_SN, rohc_debugf, ROHC_ERROR, ROHC_OK, d_feedback::size, and d_feedback::type.
Referenced by d_change_mode_feedback(), and d_optimistic_feedback().
unsigned char* f_wrap_feedback | ( | struct d_feedback * | feedback, |
const uint16_t | cid, | ||
const rohc_cid_type_t | cid_type, | ||
int | with_crc, | ||
unsigned char * | crc_table, | ||
int * | final_size | ||
) |
Wrap the feedback packet and add a CRC option if specified.
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 |
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 |
References crc_calculate(), CRC_INIT_8, d_feedback::data, f_add_option(), f_append_cid(), OPT_TYPE_CRC, ROHC_CRC_TYPE_8, rohc_debugf, ROHC_OK, and d_feedback::size.
Referenced by d_change_mode_feedback(), and d_optimistic_feedback().