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
00028
00029 #ifndef ROHC_COMP_TCP_OPTS_LIST_H
00030 #define ROHC_COMP_TCP_OPTS_LIST_H
00031
00032 #include "rohc_comp_internals.h"
00033 #include "protocols/tcp.h"
00034
00035 #include <stdint.h>
00036 #include <stddef.h>
00037
00038
00039
00040
00041
00042 struct c_tcp_opt_ctxt
00043 {
00044
00045 bool used;
00046
00047 uint8_t type;
00048
00049 size_t nr_trans;
00050 size_t age;
00051
00052 size_t data_len;
00053
00054 #define MAX_TCP_OPT_SIZE 40U
00055
00056 union
00057 {
00058 uint8_t raw[MAX_TCP_OPT_SIZE];
00059 sack_block_t sack_blocks[4];
00060 struct tcp_option_timestamp timestamp;
00061 } data;
00062 };
00063
00064
00065
00066 struct c_tcp_opts_ctxt_tmp
00067 {
00068
00069
00070 bool do_list_struct_changed;
00071
00072
00073 bool do_list_static_changed;
00074
00075 bool is_list_item_present[MAX_TCP_OPTION_INDEX + 1];
00076
00077
00078 size_t nr;
00079
00080 uint8_t position2index[ROHC_TCP_OPTS_MAX];
00081
00082 uint8_t idx_max;
00083
00084
00085 bool opt_ts_present;
00086
00087 uint32_t ts_req;
00088
00089 uint32_t ts_reply;
00090
00091
00092 size_t nr_opt_ts_req_bits_minus_1;
00093
00094
00095 size_t nr_opt_ts_req_bits_0x40000;
00096
00097
00098 size_t nr_opt_ts_req_bits_0x4000000;
00099
00100
00101 size_t nr_opt_ts_reply_bits_minus_1;
00102
00103
00104 size_t nr_opt_ts_reply_bits_0x40000;
00105
00106
00107 size_t nr_opt_ts_reply_bits_0x4000000;
00108 };
00109
00110
00111
00112 struct c_tcp_opts_ctxt
00113 {
00114
00115
00116 size_t structure_nr_trans;
00117 size_t structure_nr;
00118 uint8_t structure[ROHC_TCP_OPTS_MAX];
00119 struct c_tcp_opt_ctxt list[MAX_TCP_OPTION_INDEX + 1];
00120
00121 bool is_timestamp_init;
00122 struct c_wlsb *ts_req_wlsb;
00123 struct c_wlsb *ts_reply_wlsb;
00124
00125
00126 struct c_tcp_opts_ctxt_tmp tmp;
00127 };
00128
00129
00130 bool rohc_comp_tcp_are_options_acceptable(const struct rohc_comp *const comp,
00131 const uint8_t *const opts,
00132 const size_t data_offset)
00133 __attribute__((warn_unused_result, nonnull(1, 2)));
00134
00135 bool tcp_detect_options_changes(struct rohc_comp_ctxt *const context,
00136 const struct tcphdr *const tcp,
00137 struct c_tcp_opts_ctxt *const opts_ctxt,
00138 size_t *const opts_len)
00139 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
00140
00141 int c_tcp_code_tcp_opts_list_item(const struct rohc_comp_ctxt *const context,
00142 const struct tcphdr *const tcp,
00143 const uint16_t msn,
00144 const bool is_dynamic_chain,
00145 struct c_tcp_opts_ctxt *const opts_ctxt,
00146 uint8_t *const comp_opts,
00147 const size_t comp_opts_max_len)
00148 __attribute__((warn_unused_result, nonnull(1, 2, 5, 6)));
00149
00150 int c_tcp_code_tcp_opts_irreg(const struct rohc_comp_ctxt *const context,
00151 const struct tcphdr *const tcp,
00152 const uint16_t msn,
00153 struct c_tcp_opts_ctxt *const opts_ctxt,
00154 uint8_t *const comp_opts,
00155 const size_t comp_opts_max_len)
00156 __attribute__((warn_unused_result, nonnull(1, 2, 4, 5)));
00157
00158 #endif
00159