ROHC compression/decompression library
decomp/schemes/ip_id_offset.h
Go to the documentation of this file.
1 /*
2  * Copyright 2012,2013 Didier Barvaux
3  * Copyright 2007,2009,2010 Viveris Technologies
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/ip_id_offset.h
22  * @brief Offset IP-ID decoding
23  * @author Didier Barvaux <didier.barvaux@toulouse.viveris.com>
24  * @author Didier Barvaux <didier@barvaux.org>
25  */
26 
27 #ifndef ROHC_DECOMP_IP_ID_OFFSET_H
28 #define ROHC_DECOMP_IP_ID_OFFSET_H
29 
30 #include "decomp_wlsb.h"
31 
32 #include <stdint.h>
33 #include <stdlib.h>
34 #include <stdbool.h>
35 
36 
37 /*
38  * Public structures
39  */
40 
41 /**
42  * @brief Defines a IP-ID object to help computing the IP-ID value
43  * from an IP-ID offset
44  */
46 {
47  /** The LSB context for decoding IP-ID offset */
49 };
50 
51 
52 /*
53  * Function prototypes.
54  */
55 
56 void ip_id_offset_init(struct ip_id_offset_decode *const ipid)
57  __attribute__((nonnull(1)));
58 
59 bool ip_id_offset_decode(const struct ip_id_offset_decode *const ipid,
60  const rohc_lsb_ref_t ref_type,
61  const uint16_t m,
62  const size_t k,
63  const uint32_t sn,
64  uint16_t *const decoded)
65  __attribute__((nonnull(1, 6), warn_unused_result));
66 
67 void ip_id_offset_set_ref(struct ip_id_offset_decode *const ipid,
68  const uint16_t id_ref,
69  const uint32_t sn_ref,
70  const bool keep_ref_minus_1)
71  __attribute__((nonnull(1)));
72 
73 #endif
74 
void ip_id_offset_init(struct ip_id_offset_decode *const ipid)
Create a new Offset IP-ID decoding context.
Definition: decomp/schemes/ip_id_offset.c:45
The Least Significant Bits (LSB) decoding object.
Definition: decomp_wlsb.h:57
struct rohc_lsb_decode lsb
Definition: decomp/schemes/ip_id_offset.h:48
Defines a IP-ID object to help computing the IP-ID value from an IP-ID offset.
Definition: decomp/schemes/ip_id_offset.h:45
void ip_id_offset_set_ref(struct ip_id_offset_decode *const ipid, const uint16_t id_ref, const uint32_t sn_ref, const bool keep_ref_minus_1)
Update the reference values for the IP-ID and the SN.
Definition: decomp/schemes/ip_id_offset.c:94
Window-based Least Significant Bits (W-LSB) decoding.
bool ip_id_offset_decode(const struct ip_id_offset_decode *const ipid, const rohc_lsb_ref_t ref_type, const uint16_t m, const size_t k, const uint32_t sn, uint16_t *const decoded)
Decode the given IP-ID offset.
Definition: decomp/schemes/ip_id_offset.c:63
rohc_lsb_ref_t
Definition: decomp_wlsb.h:43