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 d_static_or_irreg32(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 int variable_length_32_dec(const uint8_t *const rohc_data,
57  const size_t rohc_len,
58  const int indicator,
59  struct rohc_lsb_field32 *const lsb)
60  __attribute__((warn_unused_result, nonnull(1, 4)));
61 
62 // RFC4996 page 71
63 unsigned int rsf_index_dec(const unsigned int rsf_index)
64  __attribute__((warn_unused_result, const));
65 
66 // RFC4996 page 75
67 bool d_ip_id_lsb(const struct rohc_decomp_ctxt *const context,
68  const struct rohc_lsb_decode *const ip_id_lsb_ctxt,
69  const uint16_t msn,
70  const uint32_t ip_id_bits,
71  const size_t ip_id_bits_nr,
72  const rohc_lsb_shift_t p,
73  uint16_t *const ip_id)
74  __attribute__((warn_unused_result, nonnull(1, 2, 7)));
75 
76 // RFC4996 page 76
77 int d_optional_ip_id_lsb(const struct rohc_decomp_ctxt *const context,
78  const uint8_t *const rohc_data,
79  const size_t data_len,
80  const int behavior,
81  const int indicator,
82  struct rohc_lsb_field16 *const lsb)
83  __attribute__((warn_unused_result, nonnull(1, 2, 6)));
84 
85 #endif /* ROHC_DECOMP_RFC4996_DECODING_H */
86 
rohc_lsb_shift_t
the different values of the shift parameter of the LSB algorithm
Definition: interval.h:47
Definition: decomp_wlsb.h:77
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:54
The Least Significant Bits (LSB) decoding object.
Definition: decomp_wlsb.h:57
Definition: decomp_wlsb.h:86
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:89
int d_static_or_irreg32(const uint8_t *const rohc_data, const size_t rohc_len, const int indicator, struct rohc_lsb_field32 *const lsb)
Decompress the 32-bit given value, according to the indicator.
Definition: decomp/schemes/rfc4996.c:134
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:330
unsigned int rsf_index_dec(const unsigned int rsf_index)
Calculate the rsf flags from the rsf index.
Definition: decomp/schemes/rfc4996.c:246
Definition: decomp_wlsb.h:68
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:181
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:281
Compute the interpretation interval for LSB and W-LSB encoding.