ROHC compression/decompression library
|
ROHC feedback routines. More...
Go to the source code of this file.
Data Structures | |
struct | d_feedback |
Defines a ROHC feedback. More... | |
Defines | |
#define | OPT_TYPE_CRC 1 |
CRC option for the FEEDBACK-2 packet. | |
#define | OPT_TYPE_REJECT 2 |
Reject option for the FEEDBACK-2 packet. | |
#define | OPT_TYPE_SN_NOT_VALID 3 |
SN-not-valid option for the FEEDBACK-2 packet. | |
#define | OPT_TYPE_SN 4 |
SN option for the FEEDBACK-2 packet. | |
#define | OPT_TYPE_CLOCK 5 |
Clock option for the FEEDBACK-2 packet (not used) | |
#define | OPT_TYPE_JITTER 6 |
Jitter option for the FEEDBACK-2 packet (not used) | |
#define | OPT_TYPE_LOSS 7 |
Loss option for the FEEDBACK-2 packet. | |
#define | ACKTYPE_ACK 0 |
Feedback ACK. | |
#define | ACKTYPE_NACK 1 |
Feedback Negative ACK. | |
#define | ACKTYPE_STATIC_NACK 2 |
Feedback Satic Negative ACK. | |
#define | NO_CRC 0 |
Do not add a CRC option in Feedback packet. | |
#define | WITH_CRC 1 |
Do add a CRC option in Feedback packet. | |
#define | FEEDBACK_DATA_MAX_LEN 30 |
The maximum length (in bytes) of the feedback data. | |
Functions | |
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.
#define ACKTYPE_ACK 0 |
Feedback ACK.
Referenced by d_change_mode_feedback(), and d_optimistic_feedback().
#define ACKTYPE_NACK 1 |
Feedback Negative ACK.
Referenced by d_optimistic_feedback().
#define ACKTYPE_STATIC_NACK 2 |
Feedback Satic Negative ACK.
Referenced by d_optimistic_feedback().
#define FEEDBACK_DATA_MAX_LEN 30 |
The maximum length (in bytes) of the feedback data.
Referenced by f_add_option().
#define NO_CRC 0 |
Do not add a CRC option in Feedback packet.
Referenced by d_optimistic_feedback().
#define OPT_TYPE_CLOCK 5 |
Clock option for the FEEDBACK-2 packet (not used)
#define OPT_TYPE_CRC 1 |
CRC option for the FEEDBACK-2 packet.
Referenced by f_add_option(), and f_wrap_feedback().
#define OPT_TYPE_JITTER 6 |
Jitter option for the FEEDBACK-2 packet (not used)
#define OPT_TYPE_LOSS 7 |
Loss option for the FEEDBACK-2 packet.
#define OPT_TYPE_REJECT 2 |
Reject option for the FEEDBACK-2 packet.
#define OPT_TYPE_SN 4 |
SN option for the FEEDBACK-2 packet.
Referenced by f_feedback2().
#define OPT_TYPE_SN_NOT_VALID 3 |
SN-not-valid option for the FEEDBACK-2 packet.
Referenced by d_optimistic_feedback().
#define WITH_CRC 1 |
Do add a CRC option in Feedback packet.
Referenced by d_change_mode_feedback(), and d_optimistic_feedback().
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_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().