ROHC compression/decompression library
rohc_profiles.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010,2011,2012,2013,2014 Didier Barvaux
3  * Copyright 2007,2009,2010,2012,2017,2018 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_profiles.h
22  * @brief Definition of ROHC profiles
23  * @author Didier Barvaux <didier.barvaux@toulouse.viveris.com>
24  * @author Valentin Boutonné <vboutonne@toulouse.viveris.com>
25  */
26 
27 #ifndef ROHC_PROFILES_H
28 #define ROHC_PROFILES_H
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
34 
35 #ifdef __KERNEL__
36 # include <linux/types.h>
37 #else
38 # include <stdbool.h>
39 #endif
40 
41 /** Macro that handles DLL export declarations gracefully */
42 #ifdef DLL_EXPORT /* passed by autotools on command line */
43 # define ROHC_EXPORT __declspec(dllexport)
44 #else
45 # define ROHC_EXPORT
46 #endif
47 
48 
49 /*
50  * ROHC profiles numbers allocated by the IANA (see 8 in the RFC 3095):
51  */
52 
53 /** The maximum major number for the supported ROHC profile IDs */
54 #define ROHC_PROFILE_ID_MAJOR_MAX 0x01U
55 
56 /** The maximum minor number for the supported ROHC profile IDs */
57 #define ROHC_PROFILE_ID_MINOR_MAX 0x08U
58 
59 /**
60  * @brief The different ROHC compression/decompression profiles
61  *
62  * The ROHC profiles numbers are allocated by the IANA:
63  * - see §8 in the RFC 3095 (ROHCv1)
64  * - see §5 in the RFC 3843 (ROHCv1 IP-only)
65  * - see §7 in the RFC 4019 (ROHCv1 UDP-Lite)
66  * - see §11 in the RFC 6846 (ROHCv1 TCP)
67  * - see §8 in the RFC 5252 (ROHCv2)
68  *
69  * If you add a new compression/decompression profile, please also add the
70  * corresponding textual description in \ref rohc_get_profile_descr.
71  *
72  * @ingroup rohc
73  *
74  * @see rohc_get_profile_descr
75  */
76 typedef enum
77 {
78  /** The ROHCv1 Uncompressed profile (RFC 3095, section 5.10) */
80 /** Alias for ROHCv1 Uncompressed profile */
81 #define ROHCv1_PROFILE_UNCOMPRESSED ROHC_PROFILE_UNCOMPRESSED
82  /** The ROHCv1 RTP profile (RFC 3095, section 8) */
83  ROHC_PROFILE_RTP = 0x0001,
84 /** Alias for ROHCv1 IP/UDP/RTP profile */
85 #define ROHCv1_PROFILE_IP_UDP_RTP ROHC_PROFILE_RTP
86  /** The ROHCv1 UDP profile (RFC 3095, section 5.11) */
87  ROHC_PROFILE_UDP = 0x0002,
88 /** Alias for ROHCv1 IP/UDP profile */
89 #define ROHCv1_PROFILE_IP_UDP ROHC_PROFILE_UDP
90  /** The ROHCv1 ESP profile (RFC 3095, section 5.12) */
91  ROHC_PROFILE_ESP = 0x0003,
92 /** Alias for ROHCv1 IP/ESP profile */
93 #define ROHCv1_PROFILE_IP_ESP ROHC_PROFILE_ESP
94  /** The ROHCv1 IP-only profile (RFC 3843, section 5) */
95  ROHC_PROFILE_IP = 0x0004,
96 /** Alias for ROHCv1 IP-only profile */
97 #define ROHCv1_PROFILE_IP ROHC_PROFILE_IP
98  /** The ROHCv1 IP/UDP/RTP Link-Layer Assisted Profile (LLA) profile
99  * (RFC 4362, section 6) */
101 /** Alias for ROHCv1 IP/UDP/RTP LLA profile */
102 #define ROHCv1_PROFILE_IP_UDP_RTP_LLA ROHC_PROFILE_RTP_LLA
103  /** The ROHCv1 TCP profile (RFC 4996) */
105 /** Alias for ROHCv1 IP/TCP profile */
106 #define ROHCv1_PROFILE_IP_TCP ROHC_PROFILE_TCP
107  /** The ROHCv1 UDP-Lite/RTP profile (RFC 4019, section 7) */
109 /** Alias for ROHCv1 IP/UDP-Lite/RTP profile */
110 #define ROHCv1_PROFILE_IP_UDPLITE_RTP ROHC_PROFILE_UDPLITE_RTP
111  /** The ROHCv1 UDP-Lite profile (RFC 4019, section 7) */
113 /** Alias for ROHCv1 IP/UDP-Lite profile */
114 #define ROHCv1_PROFILE_IP_UDPLITE ROHC_PROFILE_UDPLITE
115 
116  /** The ROHCv2 RTP/UDP/IP profile */
118  /** The ROHCv2 UDP/IP profile */
120  /** The ROHCv2 ESP/IP profile */
122  /** The ROHCv2 IP-only profile */
124  /** The ROHCv2 IP/UDP-Lite/RTP profile */
126  /** The ROHCv2 IP/UDP-Lite profile */
128 
130 
132 
133 
134 /*
135  * Prototypes of public functions
136  */
137 
138 const char * ROHC_EXPORT rohc_get_profile_descr(const rohc_profile_t profile)
139  __attribute__((warn_unused_result, const));
140 
142  __attribute__((warn_unused_result, const));
143 
145  __attribute__((warn_unused_result, const));
146 
148  __attribute__((warn_unused_result, const));
149 
150 #undef ROHC_EXPORT /* do not pollute outside this header */
151 
152 #ifdef __cplusplus
153 }
154 #endif
155 
156 #endif /* ROHC_PROFILES_H */
157 
Definition: rohc_profiles.h:104
bool ROHC_EXPORT rohc_profile_is_rohcv2(const rohc_profile_t profile)
Is the given profile one ROHCv2 profile?
Definition: rohc_profiles.c:112
Definition: rohc_profiles.h:83
bool ROHC_EXPORT rohc_profile_is_rohcv1(const rohc_profile_t profile)
Is the given profile one ROHCv1 profile?
Definition: rohc_profiles.c:97
Definition: rohc_profiles.h:117
#define ROHC_EXPORT
Definition: rohc_profiles.h:45
Definition: rohc_profiles.h:129
Definition: rohc_profiles.h:119
Definition: rohc_profiles.h:108
Definition: rohc_profiles.h:95
Definition: rohc_profiles.h:112
Definition: rohc_profiles.h:125
Definition: rohc_profiles.h:79
Definition: rohc_profiles.h:127
rohc_profile_t rohc_profile_get_other_version(const rohc_profile_t profile)
Get the other version of the given profile.
Definition: rohc_profiles.c:128
Definition: rohc_profiles.h:100
Definition: rohc_profiles.h:91
rohc_profile_t
The different ROHC compression/decompression profiles.
Definition: rohc_profiles.h:76
Definition: rohc_profiles.h:121
Definition: rohc_profiles.h:123
const char *ROHC_EXPORT rohc_get_profile_descr(const rohc_profile_t profile)
Give a description for the given ROHC profile.
Definition: rohc_profiles.c:46
Definition: rohc_profiles.h:87