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_SCHEMES_WLSB_H
00028 #define ROHC_DECOMP_SCHEMES_WLSB_H
00029
00030 #include "interval.h"
00031
00032 #include <stdlib.h>
00033 #include <stdint.h>
00034 #include <stddef.h>
00035 #ifdef __KERNEL__
00036 # include <linux/types.h>
00037 #else
00038 # include <stdbool.h>
00039 #endif
00040
00041
00042
00043 struct rohc_lsb_decode;
00044
00045
00046
00047 typedef enum
00048 {
00049 ROHC_LSB_REF_MINUS_1 = 0,
00050 ROHC_LSB_REF_0 = 1,
00051 ROHC_LSB_REF_MAX
00052
00053 } rohc_lsb_ref_t;
00054
00055
00056
00057 struct rohc_lsb_field32
00058 {
00059 uint32_t bits;
00060 size_t bits_nr;
00061 rohc_lsb_shift_t p;
00062 };
00063
00064
00065
00066 struct rohc_lsb_field16
00067 {
00068 uint16_t bits;
00069 size_t bits_nr;
00070 rohc_lsb_shift_t p;
00071 };
00072
00073
00074
00075 struct rohc_lsb_field8
00076 {
00077 uint8_t bits;
00078 size_t bits_nr;
00079 rohc_lsb_shift_t p;
00080 };
00081
00082
00083
00084
00085
00086
00087 struct rohc_lsb_decode * rohc_lsb_new(const size_t max_len)
00088 __attribute__((warn_unused_result));
00089
00090 void rohc_lsb_free(struct rohc_lsb_decode *const lsb)
00091 __attribute__((nonnull(1)));
00092
00093 bool rohc_lsb_is_ready(const struct rohc_lsb_decode *const lsb)
00094 __attribute__((warn_unused_result, nonnull(1), pure));
00095
00096 bool rohc_lsb_decode(const struct rohc_lsb_decode *const lsb,
00097 const rohc_lsb_ref_t ref_type,
00098 const uint32_t v_ref_d_offset,
00099 const uint32_t m,
00100 const size_t k,
00101 const rohc_lsb_shift_t p,
00102 uint32_t *const decoded)
00103 __attribute__((warn_unused_result, nonnull(1, 7)));
00104
00105 void rohc_lsb_set_ref(struct rohc_lsb_decode *const lsb,
00106 const uint32_t v_ref_d,
00107 const bool keep_ref_minus_1)
00108 __attribute__((nonnull(1)));
00109
00110 uint32_t rohc_lsb_get_ref(const struct rohc_lsb_decode *const lsb,
00111 const rohc_lsb_ref_t ref_type)
00112 __attribute__((nonnull(1), warn_unused_result));
00113
00114 #endif
00115