ROHC compression/decompression library
rohc_decomp_detect_packet.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011,2012,2013 Didier Barvaux
3  * Copyright 2007,2009,2010,2013 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 rohc_decomp_detect_packet.h
22  * @brief Functions related to packet detection
23  * @author Didier Barvaux <didier.barvaux@toulouse.viveris.com>
24  * @author Didier Barvaux <didier@barvaux.org>
25  */
26 
27 #ifndef ROHC_DECOMP_DETECT_PACKET_H
28 #define ROHC_DECOMP_DETECT_PACKET_H
29 
30 #include <stddef.h>
31 #include <stdint.h>
32 #ifdef __KERNEL__
33 # include <linux/types.h>
34 #else
35 # include <stdbool.h>
36 #endif
37 
38 
39 /*
40  * Function prototypes.
41  */
42 
43 /* ROHC segment */
44 bool rohc_decomp_packet_is_segment(const uint8_t *const data)
45  __attribute__((warn_unused_result, nonnull(1), pure));
46 bool rohc_decomp_packet_is_padding(const uint8_t *const data)
47  __attribute__((warn_unused_result, nonnull(1), pure));
48 
49 /* IR packet */
50 bool rohc_decomp_packet_is_ir(const uint8_t *const data, const size_t len)
51  __attribute__((warn_unused_result, nonnull(1), pure));
52 
53 /* IR-DYN packet */
54 bool rohc_decomp_packet_is_irdyn(const uint8_t *const data, const size_t len)
55  __attribute__((warn_unused_result, nonnull(1), pure));
56 
57 /* UO-0 packet */
58 bool rohc_decomp_packet_is_uo0(const uint8_t *const data, const size_t len)
59  __attribute__((warn_unused_result, nonnull(1), pure));
60 
61 /* UO-1* packets */
62 bool rohc_decomp_packet_is_uo1(const uint8_t *const data, const size_t len)
63  __attribute__((warn_unused_result, nonnull(1), pure));
64 bool rohc_decomp_packet_is_uo1_ts(const uint8_t *const data, const size_t len)
65  __attribute__((warn_unused_result, nonnull(1), pure));
66 
67 /* UOR-2* packets */
68 bool rohc_decomp_packet_is_uor2(const uint8_t *const data, const size_t len)
69  __attribute__((warn_unused_result, nonnull(1), pure));
70 bool rohc_decomp_packet_is_uor2_ts(const uint8_t *const data,
71  const size_t data_len,
72  const size_t large_cid_len)
73  __attribute__((warn_unused_result, nonnull(1), pure));
74 
75 #endif
76 
bool rohc_decomp_packet_is_uor2(const uint8_t *const data, const size_t len)
Find out whether a ROHC packet is an UOR-2* packet or not.
Definition: rohc_decomp_detect_packet.c:142
bool rohc_decomp_packet_is_uor2_ts(const uint8_t *const data, const size_t data_len, const size_t large_cid_len)
Find out whether a ROHC packet is an UOR-2-TS packet or not.
Definition: rohc_decomp_detect_packet.c:158
bool rohc_decomp_packet_is_uo1_ts(const uint8_t *const data, const size_t len)
Find out whether a ROHC packet is an UO-1-TS packet or not.
Definition: rohc_decomp_detect_packet.c:129
bool rohc_decomp_packet_is_padding(const uint8_t *const data)
Find out whether the field is a padding field or not.
Definition: rohc_decomp_detect_packet.c:62
bool rohc_decomp_packet_is_irdyn(const uint8_t *const data, const size_t len)
Find out whether a ROHC packet is an IR-DYN packet or not.
Definition: rohc_decomp_detect_packet.c:88
bool rohc_decomp_packet_is_ir(const uint8_t *const data, const size_t len)
Find out whether a ROHC packet is an IR packet or not.
Definition: rohc_decomp_detect_packet.c:75
bool rohc_decomp_packet_is_uo0(const uint8_t *const data, const size_t len)
Find out whether a ROHC packet is an UO-0 packet or not.
Definition: rohc_decomp_detect_packet.c:101
bool rohc_decomp_packet_is_uo1(const uint8_t *const data, const size_t len)
Find out whether a ROHC packet is an UO-1* packet or not.
Definition: rohc_decomp_detect_packet.c:114
bool rohc_decomp_packet_is_segment(const uint8_t *const data)
Find out whether the field is a segment field or not.
Definition: rohc_decomp_detect_packet.c:50