ROHC compression/decompression library
c_udp.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013 Didier Barvaux
3  * Copyright 2007,2008 Thales Alenia Space
4  * Copyright 2007,2009,2010,2012,2014 Viveris Technologies
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 /**
22  * @file c_udp.h
23  * @brief ROHC compression context for the UDP profile.
24  * @author Didier Barvaux <didier.barvaux@toulouse.viveris.com>
25  */
26 
27 #ifndef ROHC_COMP_UDP_H
28 #define ROHC_COMP_UDP_H
29 
30 #include "rohc_comp_internals.h"
31 
32 #include <stdint.h>
33 #include <stdbool.h>
34 
35 
36 /*
37  * Function prototypes.
38  */
39 
40 bool c_udp_check_profile(const struct rohc_comp *const comp,
41  const struct net_pkt *const packet)
42  __attribute__((warn_unused_result, nonnull(1, 2)));
43 
44 bool c_udp_check_context(const struct rohc_comp_ctxt *context,
45  const struct net_pkt *const packet)
46  __attribute__((warn_unused_result, nonnull(1, 2), pure));
47 
48 size_t udp_code_uo_remainder(const struct rohc_comp_ctxt *context,
49  const uint8_t *next_header,
50  uint8_t *const dest,
51  const size_t counter)
52  __attribute__((warn_unused_result, nonnull(1, 2, 3)));
53 
54 size_t udp_code_static_udp_part(const struct rohc_comp_ctxt *const context,
55  const uint8_t *const next_header,
56  uint8_t *const dest,
57  const size_t counter)
58  __attribute__((warn_unused_result, nonnull(1, 2, 3)));
59 
60 #endif
61 
size_t udp_code_uo_remainder(const struct rohc_comp_ctxt *context, const uint8_t *next_header, uint8_t *const dest, const size_t counter)
Build UDP-related fields in the tail of the UO packets.
Definition: c_udp.c:433
The ROHC compressor.
Definition: rohc_comp_internals.h:121
Internal structures for ROHC compression.
The ROHC compression context.
Definition: rohc_comp_internals.h:306
size_t udp_code_static_udp_part(const struct rohc_comp_ctxt *const context, const uint8_t *const next_header, uint8_t *const dest, const size_t counter)
Build the static part of the UDP header.
Definition: c_udp.c:474
Definition: net_pkt.h:39
bool c_udp_check_context(const struct rohc_comp_ctxt *context, const struct net_pkt *const packet)
Check if the IP/UDP packet belongs to the context.
Definition: c_udp.c:283
bool c_udp_check_profile(const struct rohc_comp *const comp, const struct net_pkt *const packet)
Check if the given packet corresponds to the UDP profile.
Definition: c_udp.c:216