00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef ROHC_DECOMP_FEEDBACK_CREATE_H
00028 #define ROHC_DECOMP_FEEDBACK_CREATE_H
00029
00030 #include <rohc/rohc.h>
00031 #include <rohc/rohc_buf.h>
00032 #include <feedback.h>
00033
00034 #include <stdint.h>
00035 #include <stdlib.h>
00036 #include <stdbool.h>
00037
00038
00039
00040
00041
00042 typedef enum
00043 {
00044 ROHC_FEEDBACK_WITH_NO_CRC = 0,
00045 ROHC_FEEDBACK_WITH_CRC_OPT = 1,
00046 ROHC_FEEDBACK_WITH_CRC_BASE = 2,
00047
00048 } rohc_feedback_crc_t;
00049
00050
00051
00052 #define FEEDBACK_DATA_MAX_LEN 30
00053
00054
00055
00056
00057
00058 struct d_feedback
00059 {
00060
00061 enum rohc_feedback_ack_type type;
00062
00063 uint8_t data[FEEDBACK_DATA_MAX_LEN];
00064
00065 int size;
00066 };
00067
00068
00069
00070
00071
00072
00073 bool rohc_decomp_feedback_size(const struct rohc_buf rohc_data,
00074 size_t *const feedback_hdr_len,
00075 size_t *const feedback_data_len)
00076 __attribute__((warn_unused_result, nonnull(2, 3)));
00077
00078 void f_feedback1(const uint32_t sn_bits, struct d_feedback *const feedback)
00079 __attribute__((nonnull(2)));
00080
00081 bool f_feedback2(const rohc_profile_t profile_id,
00082 const enum rohc_feedback_ack_type ack_type,
00083 const rohc_mode_t mode,
00084 const uint32_t sn_bits,
00085 const size_t sn_bits_nr,
00086 struct d_feedback *const feedback)
00087 __attribute__((warn_unused_result, nonnull(6)));
00088
00089 bool f_add_option(struct d_feedback *const feedback,
00090 const enum rohc_feedback_opt opt_type,
00091 const uint8_t *const data,
00092 const size_t data_len)
00093 __attribute__((warn_unused_result, nonnull(1)));
00094
00095 uint8_t * f_wrap_feedback(struct d_feedback *feedback,
00096 const uint16_t cid,
00097 const rohc_cid_type_t cid_type,
00098 const rohc_feedback_crc_t protect_with_crc,
00099 const uint8_t *const crc_table,
00100 size_t *const final_size)
00101 __attribute__((warn_unused_result, nonnull(1, 5, 6)));
00102
00103
00104 #endif
00105