ROHC compression/decompression library
decomp/schemes/rfc4996.h
Go to the documentation of this file.
1 /*
2  * Copyright 2012,2013,2014 Didier Barvaux
3  * Copyright 2012 WBX
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 /**
21  * @file decomp/schemes/rfc4996.h
22  * @brief Library of decoding methods from RFC4997 and RFC4996
23  * @author FWX <rohc_team@dialine.fr>
24  * @author Didier Barvaux <didier@barvaux.org>
25  */
26 
27 #ifndef ROHC_DECOMP_SCHEMES_RFC4996_H
28 #define ROHC_DECOMP_SCHEMES_RFC4996_H
29 
30 #include "interval.h"
31 #include "decomp_wlsb.h"
32 
33 #include <stdint.h>
34 
35 struct rohc_decomp_ctxt;
36 
37 
38 int d_static_or_irreg8(const uint8_t *const rohc_data,
39  const size_t rohc_len,
40  const int indicator,
41  struct rohc_lsb_field8 *const lsb)
42  __attribute__((warn_unused_result, nonnull(1, 4)));
43 
44 int d_static_or_irreg16(const uint8_t *const rohc_data,
45  const size_t rohc_len,
46  const int indicator,
47  struct rohc_lsb_field16 *const lsb)
48  __attribute__((warn_unused_result, nonnull(1, 4)));
49 
50 int variable_length_32_dec(const uint8_t *const rohc_data,
51  const size_t rohc_len,
52  const int indicator,
53  struct rohc_lsb_field32 *const lsb)
54  __attribute__((warn_unused_result, nonnull(1, 4)));
55 
56 // RFC4996 page 71
57 unsigned int rsf_index_dec(const unsigned int rsf_index)
58  __attribute__((warn_unused_result, const));
59 
60 // RFC4996 page 75
61 bool d_ip_id_lsb(const struct rohc_decomp_ctxt *const context,
62  const struct rohc_lsb_decode *const ip_id_lsb_ctxt,
63  const uint16_t msn,
64  const uint32_t ip_id_bits,
65  const size_t ip_id_bits_nr,
66  const rohc_lsb_shift_t p,
67  uint16_t *const ip_id)
68  __attribute__((warn_unused_result, nonnull(1, 2, 7)));
69 
70 // RFC4996 page 76
71 int d_optional_ip_id_lsb(const struct rohc_decomp_ctxt *const context,
72  const uint8_t *const rohc_data,
73  const size_t data_len,
74  const int behavior,
75  const int indicator,
76  struct rohc_lsb_field16 *const lsb)
77  __attribute__((warn_unused_result, nonnull(1, 2, 6)));
78 
79 #endif /* ROHC_DECOMP_RFC4996_DECODING_H */
80 
rohc_lsb_shift_t
the different values of the shift parameter of the LSB algorithm
Definition: interval.h:42
Definition: decomp_wlsb.h:66
int d_static_or_irreg8(const uint8_t *const rohc_data, const size_t rohc_len, const int indicator, struct rohc_lsb_field8 *const lsb)
Decompress the 8-bit given value, according to the indicator.
Definition: decomp/schemes/rfc4996.c:55
The Least Significant Bits (LSB) decoding object.
Definition: decomp_wlsb.c:45
Definition: decomp_wlsb.h:75
int d_static_or_irreg16(const uint8_t *const rohc_data, const size_t rohc_len, const int indicator, struct rohc_lsb_field16 *const lsb)
Decompress the 16-bit given value, according to the indicator.
Definition: decomp/schemes/rfc4996.c:90
Window-based Least Significant Bits (W-LSB) decoding.
int d_optional_ip_id_lsb(const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_data, const size_t data_len, const int behavior, const int indicator, struct rohc_lsb_field16 *const lsb)
Decompress the IP-ID.
Definition: decomp/schemes/rfc4996.c:290
unsigned int rsf_index_dec(const unsigned int rsf_index)
Calculate the rsf flags from the rsf index.
Definition: decomp/schemes/rfc4996.c:202
Definition: decomp_wlsb.h:57
The ROHC decompression context.
Definition: rohc_decomp_internals.h:274
int variable_length_32_dec(const uint8_t *const rohc_data, const size_t rohc_len, const int indicator, struct rohc_lsb_field32 *const lsb)
Decode the 32 bits value, according to the indicator.
Definition: decomp/schemes/rfc4996.c:137
bool d_ip_id_lsb(const struct rohc_decomp_ctxt *const context, const struct rohc_lsb_decode *const ip_id_lsb_ctxt, const uint16_t msn, const uint32_t ip_id_bits, const size_t ip_id_bits_nr, const rohc_lsb_shift_t p, uint16_t *const ip_id)
Decompress the lower bits of IP-ID.
Definition: decomp/schemes/rfc4996.c:237
Compute the interpretation interval for LSB and W-LSB encoding.