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 #ifndef ROHC_FEEDBACK_H
00026 #define ROHC_FEEDBACK_H
00027
00028 #include "rohc.h"
00029
00030 #ifdef __KERNEL__
00031 # include <endian.h>
00032 #else
00033 # include "config.h"
00034 #endif
00035
00036 #include <stdbool.h>
00037 #include <stdint.h>
00038 #include <stddef.h>
00039
00040
00041
00042 enum rohc_feedback_type
00043 {
00044 ROHC_FEEDBACK_1 = 1,
00045 ROHC_FEEDBACK_2 = 2,
00046 };
00047
00048
00049
00050 enum rohc_feedback_ack_type
00051 {
00052 ROHC_FEEDBACK_ACK = 0,
00053 ROHC_FEEDBACK_NACK = 1,
00054 ROHC_FEEDBACK_STATIC_NACK = 2,
00055 ROHC_FEEDBACK_RESERVED = 3,
00056 };
00057
00058
00059
00060 enum rohc_feedback_opt
00061 {
00062 ROHC_FEEDBACK_OPT_CRC = 1,
00063 ROHC_FEEDBACK_OPT_REJECT = 2,
00064 ROHC_FEEDBACK_OPT_SN_NOT_VALID = 3,
00065
00066 #define ROHC_FEEDBACK_OPT_MSN_NOT_VALID ROHC_FEEDBACK_OPT_SN_NOT_VALID
00067 ROHC_FEEDBACK_OPT_SN = 4,
00068
00069 #define ROHC_FEEDBACK_OPT_MSN ROHC_FEEDBACK_OPT_SN
00070 ROHC_FEEDBACK_OPT_CLOCK = 5,
00071 ROHC_FEEDBACK_OPT_JITTER = 6,
00072 ROHC_FEEDBACK_OPT_LOSS = 7,
00073 ROHC_FEEDBACK_OPT_CV_REQUEST = 8,
00074 ROHC_FEEDBACK_OPT_CONTEXT_MEMORY = 9,
00075 ROHC_FEEDBACK_OPT_UNKNOWN_10 = 10,
00076 ROHC_FEEDBACK_OPT_UNKNOWN_11 = 11,
00077 ROHC_FEEDBACK_OPT_UNKNOWN_12 = 12,
00078 ROHC_FEEDBACK_OPT_UNKNOWN_13 = 13,
00079 ROHC_FEEDBACK_OPT_UNKNOWN_14 = 14,
00080 ROHC_FEEDBACK_OPT_UNKNOWN_15 = 15,
00081 ROHC_FEEDBACK_OPT_MAX
00082 };
00083
00084
00085
00086 struct rohc_feedback_2_rfc3095
00087 {
00088 #if WORDS_BIGENDIAN == 1
00089 uint8_t ack_type:2;
00090 uint8_t mode:2;
00091 uint8_t sn1:4;
00092 #else
00093 uint8_t sn1:4;
00094 uint8_t mode:2;
00095 uint8_t ack_type:2;
00096 #endif
00097 uint8_t sn2;
00098 } __attribute__((packed));
00099
00100
00101
00102 struct rohc_feedback_2_rfc6846
00103 {
00104 #if WORDS_BIGENDIAN == 1
00105 uint8_t ack_type:2;
00106 uint8_t sn1:6;
00107 #else
00108 uint8_t sn1:6;
00109 uint8_t ack_type:2;
00110 #endif
00111 uint8_t sn2;
00112 uint8_t crc;
00113 } __attribute__((packed));
00114
00115
00116
00117 struct rohc_feedback_opt_charac
00118 {
00119 const char *const name;
00120 bool unknown;
00121 bool supported;
00122 size_t expected_len;
00123 enum {
00124 ROHC_FEEDBACK_OPT_CRC_REQUIRED,
00125 ROHC_FEEDBACK_OPT_CRC_SUGGESTED,
00126 ROHC_FEEDBACK_OPT_CRC_NOT_REQUIRED,
00127 } crc_req;
00128 size_t max_occurs[ROHC_PROFILE_MAX];
00129 };
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 #define ROHC_FEEDBACK_OPT_MAX_OCCURS 100U
00140
00141
00142
00143 static const struct rohc_feedback_opt_charac
00144 rohc_feedback_opt_charac[ROHC_FEEDBACK_OPT_MAX] =
00145 {
00146 [0] = {
00147 .name = "unknown option with value 0",
00148 .unknown = true,
00149 },
00150 [ROHC_FEEDBACK_OPT_CRC] = {
00151 .name = "CRC",
00152 .unknown = false,
00153 .supported = true,
00154 .expected_len = 2U,
00155 .crc_req = ROHC_FEEDBACK_OPT_CRC_NOT_REQUIRED,
00156 .max_occurs = {
00157 [ROHC_PROFILE_UNCOMPRESSED] = 0,
00158 [ROHC_PROFILE_RTP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00159 [ROHC_PROFILE_UDP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00160 [ROHC_PROFILE_ESP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00161 [ROHC_PROFILE_IP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00162 [ROHC_PROFILE_RTP_LLA] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00163 [ROHC_PROFILE_TCP] = 0,
00164 [ROHC_PROFILE_UDPLITE_RTP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00165 [ROHC_PROFILE_UDPLITE] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00166 }
00167 },
00168 [ROHC_FEEDBACK_OPT_REJECT] = {
00169 .name = "REJECT",
00170 .unknown = false,
00171 .supported = true,
00172 .expected_len = 1U,
00173 .crc_req = ROHC_FEEDBACK_OPT_CRC_REQUIRED,
00174 .max_occurs = {
00175 [ROHC_PROFILE_UNCOMPRESSED] = 0,
00176 [ROHC_PROFILE_RTP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00177 [ROHC_PROFILE_UDP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00178 [ROHC_PROFILE_ESP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00179 [ROHC_PROFILE_IP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00180 [ROHC_PROFILE_RTP_LLA] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00181 [ROHC_PROFILE_TCP] = 1,
00182 [ROHC_PROFILE_UDPLITE_RTP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00183 [ROHC_PROFILE_UDPLITE] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00184 }
00185 },
00186 [ROHC_FEEDBACK_OPT_SN_NOT_VALID] = {
00187 .name = "(M)SN-NOT-VALID",
00188 .unknown = false,
00189 .supported = true,
00190 .expected_len = 1U,
00191 .crc_req = ROHC_FEEDBACK_OPT_CRC_NOT_REQUIRED,
00192 .max_occurs = {
00193 [ROHC_PROFILE_UNCOMPRESSED] = 0,
00194 [ROHC_PROFILE_RTP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00195 [ROHC_PROFILE_UDP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00196 [ROHC_PROFILE_ESP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00197 [ROHC_PROFILE_IP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00198 [ROHC_PROFILE_RTP_LLA] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00199 [ROHC_PROFILE_TCP] = 1,
00200 [ROHC_PROFILE_UDPLITE_RTP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00201 [ROHC_PROFILE_UDPLITE] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00202 }
00203 },
00204 [ROHC_FEEDBACK_OPT_SN] = {
00205 .name = "(M)SN",
00206 .unknown = false,
00207 .supported = true,
00208 .expected_len = 2U,
00209 .crc_req = ROHC_FEEDBACK_OPT_CRC_NOT_REQUIRED,
00210 .max_occurs = {
00211 [ROHC_PROFILE_UNCOMPRESSED] = 0,
00212 [ROHC_PROFILE_RTP] = 1,
00213 [ROHC_PROFILE_UDP] = 1,
00214 [ROHC_PROFILE_ESP] = 3,
00215 [ROHC_PROFILE_IP] = 1,
00216 [ROHC_PROFILE_RTP_LLA] = 1,
00217 [ROHC_PROFILE_TCP] = 1,
00218 [ROHC_PROFILE_UDPLITE_RTP] = 1,
00219 [ROHC_PROFILE_UDPLITE] = 1,
00220 }
00221 },
00222 [ROHC_FEEDBACK_OPT_CLOCK] = {
00223 .name = "CLOCK",
00224 .unknown = false,
00225 .supported = false,
00226 .expected_len = 2U,
00227 .crc_req = ROHC_FEEDBACK_OPT_CRC_SUGGESTED,
00228 .max_occurs = {
00229 [ROHC_PROFILE_UNCOMPRESSED] = 0,
00230 [ROHC_PROFILE_RTP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00231 [ROHC_PROFILE_UDP] = 0,
00232 [ROHC_PROFILE_ESP] = 0,
00233 [ROHC_PROFILE_IP] = 0,
00234 [ROHC_PROFILE_RTP_LLA] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00235 [ROHC_PROFILE_TCP] = 0,
00236 [ROHC_PROFILE_UDPLITE_RTP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00237 [ROHC_PROFILE_UDPLITE] = 0,
00238 }
00239 },
00240 [ROHC_FEEDBACK_OPT_JITTER] = {
00241 .name = "JITTER",
00242 .unknown = false,
00243 .supported = false,
00244 .expected_len = 2U,
00245 .crc_req = ROHC_FEEDBACK_OPT_CRC_SUGGESTED,
00246 .max_occurs = {
00247 [ROHC_PROFILE_UNCOMPRESSED] = 0,
00248 [ROHC_PROFILE_RTP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00249 [ROHC_PROFILE_UDP] = 0,
00250 [ROHC_PROFILE_ESP] = 0,
00251 [ROHC_PROFILE_IP] = 0,
00252 [ROHC_PROFILE_RTP_LLA] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00253 [ROHC_PROFILE_TCP] = 0,
00254 [ROHC_PROFILE_UDPLITE_RTP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00255 [ROHC_PROFILE_UDPLITE] = 0,
00256 }
00257 },
00258 [ROHC_FEEDBACK_OPT_LOSS] = {
00259 .name = "LOSS",
00260 .unknown = false,
00261 .supported = false,
00262 .expected_len = 2U,
00263 .crc_req = ROHC_FEEDBACK_OPT_CRC_SUGGESTED,
00264 .max_occurs = {
00265 [ROHC_PROFILE_UNCOMPRESSED] = 0,
00266 [ROHC_PROFILE_RTP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00267 [ROHC_PROFILE_UDP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00268 [ROHC_PROFILE_ESP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00269 [ROHC_PROFILE_IP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00270 [ROHC_PROFILE_RTP_LLA] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00271 [ROHC_PROFILE_TCP] = 0,
00272 [ROHC_PROFILE_UDPLITE_RTP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00273 [ROHC_PROFILE_UDPLITE] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00274 }
00275 },
00276 [ROHC_FEEDBACK_OPT_CV_REQUEST] = {
00277 .name = "CV-REQUEST",
00278 .unknown = false,
00279 .supported = false,
00280 .expected_len = 1U,
00281 .crc_req = ROHC_FEEDBACK_OPT_CRC_NOT_REQUIRED,
00282 .max_occurs = {
00283 [ROHC_PROFILE_UNCOMPRESSED] = 0,
00284 [ROHC_PROFILE_RTP] = 0,
00285 [ROHC_PROFILE_UDP] = 0,
00286 [ROHC_PROFILE_ESP] = 0,
00287 [ROHC_PROFILE_IP] = 0,
00288 [ROHC_PROFILE_RTP_LLA] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00289 [ROHC_PROFILE_TCP] = 0,
00290 [ROHC_PROFILE_UDPLITE_RTP] = 0,
00291 [ROHC_PROFILE_UDPLITE] = 0,
00292 }
00293 },
00294 [ROHC_FEEDBACK_OPT_CONTEXT_MEMORY] = {
00295 .name = "CONTEXT_MEMORY",
00296 .unknown = false,
00297 .supported = false,
00298 .expected_len = 1U,
00299 .crc_req = ROHC_FEEDBACK_OPT_CRC_NOT_REQUIRED,
00300 .max_occurs = {
00301 [ROHC_PROFILE_UNCOMPRESSED] = 0,
00302 [ROHC_PROFILE_RTP] = 0,
00303 [ROHC_PROFILE_UDP] = 0,
00304 [ROHC_PROFILE_ESP] = 0,
00305 [ROHC_PROFILE_IP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00306 [ROHC_PROFILE_RTP_LLA] = 0,
00307 [ROHC_PROFILE_TCP] = 1,
00308 [ROHC_PROFILE_UDPLITE_RTP] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00309 [ROHC_PROFILE_UDPLITE] = ROHC_FEEDBACK_OPT_MAX_OCCURS,
00310 }
00311 },
00312 [ROHC_FEEDBACK_OPT_UNKNOWN_10] = {
00313 .name = "unknown option with value 10",
00314 .unknown = true,
00315 },
00316 [ROHC_FEEDBACK_OPT_UNKNOWN_11] = {
00317 .name = "unknown option with value 11",
00318 .unknown = true,
00319 },
00320 [ROHC_FEEDBACK_OPT_UNKNOWN_12] = {
00321 .name = "unknown option with value 12",
00322 .unknown = true,
00323 },
00324 [ROHC_FEEDBACK_OPT_UNKNOWN_13] = {
00325 .name = "unknown option with value 13",
00326 .unknown = true,
00327 },
00328 [ROHC_FEEDBACK_OPT_UNKNOWN_14] = {
00329 .name = "unknown option with value 14",
00330 .unknown = true,
00331 },
00332 [ROHC_FEEDBACK_OPT_UNKNOWN_15] = {
00333 .name = "unknown option with value 15",
00334 .unknown = true,
00335 },
00336 };
00337
00338
00339 #endif
00340