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 /**
54  * @brief The different ROHC compression/decompression profiles
55  *
56  * The ROHC profiles numbers are allocated by the IANA:
57  * - see §8 in the RFC 3095 (ROHCv1)
58  * - see §5 in the RFC 3843 (ROHCv1 IP-only)
59  * - see §7 in the RFC 4019 (ROHCv1 UDP-Lite)
60  * - see §11 in the RFC 6846 (ROHCv1 TCP)
61  * - see §8 in the RFC 5252 (ROHCv2)
62  *
63  * If you add a new compression/decompression profile, please also add the
64  * corresponding textual description in \ref rohc_get_profile_descr.
65  *
66  * @ingroup rohc
67  *
68  * @see rohc_get_profile_descr
69  */
70 typedef enum
71 {
72  /** The ROHCv1 Uncompressed profile (RFC 3095, section 5.10) */
74 /** Alias for ROHCv1 Uncompressed profile */
75 #define ROHCv1_PROFILE_UNCOMPRESSED ROHC_PROFILE_UNCOMPRESSED
76  /** The ROHCv1 RTP profile (RFC 3095, section 8) */
77  ROHC_PROFILE_RTP = 0x0001,
78 /** Alias for ROHCv1 IP/UDP/RTP profile */
79 #define ROHCv1_PROFILE_IP_UDP_RTP ROHC_PROFILE_RTP
80  /** The ROHCv1 UDP profile (RFC 3095, section 5.11) */
81  ROHC_PROFILE_UDP = 0x0002,
82 /** Alias for ROHCv1 IP/UDP profile */
83 #define ROHCv1_PROFILE_IP_UDP ROHC_PROFILE_UDP
84  /** The ROHCv1 ESP profile (RFC 3095, section 5.12) */
85  ROHC_PROFILE_ESP = 0x0003,
86 /** Alias for ROHCv1 IP/ESP profile */
87 #define ROHCv1_PROFILE_IP_ESP ROHC_PROFILE_ESP
88  /** The ROHCv1 IP-only profile (RFC 3843, section 5) */
89  ROHC_PROFILE_IP = 0x0004,
90 /** Alias for ROHCv1 IP-only profile */
91 #define ROHCv1_PROFILE_IP ROHC_PROFILE_IP
92  /** The ROHCv1 IP/UDP/RTP Link-Layer Assisted Profile (LLA) profile
93  * (RFC 4362, section 6) */
95 /** Alias for ROHCv1 IP/UDP/RTP LLA profile */
96 #define ROHCv1_PROFILE_IP_UDP_RTP_LLA ROHC_PROFILE_RTP_LLA
97  /** The ROHCv1 TCP profile (RFC 4996) */
98  ROHC_PROFILE_TCP = 0x0006,
99 /** Alias for ROHCv1 IP/TCP profile */
100 #define ROHCv1_PROFILE_IP_TCP ROHC_PROFILE_TCP
101  /** The ROHCv1 UDP-Lite/RTP profile (RFC 4019, section 7) */
103 /** Alias for ROHCv1 IP/UDP-Lite/RTP profile */
104 #define ROHCv1_PROFILE_IP_UDPLITE_RTP ROHC_PROFILE_UDPLITE_RTP
105  /** The ROHCv1 UDP-Lite profile (RFC 4019, section 7) */
107 /** Alias for ROHCv1 IP/UDP-Lite profile */
108 #define ROHCv1_PROFILE_IP_UDPLITE ROHC_PROFILE_UDPLITE
109 
110  /** The ROHCv2 RTP/UDP/IP profile */
112  /** The ROHCv2 UDP/IP profile */
114  /** The ROHCv2 ESP/IP profile */
116  /** The ROHCv2 IP-only profile */
118  /** The ROHCv2 IP/UDP-Lite/RTP profile */
120  /** The ROHCv2 IP/UDP-Lite profile */
122 
124 
126 
127 
128 /*
129  * Prototypes of public functions
130  */
131 
132 const char * ROHC_EXPORT rohc_get_profile_descr(const rohc_profile_t profile)
133  __attribute__((warn_unused_result, const));
134 
136  __attribute__((warn_unused_result, const));
137 
139  __attribute__((warn_unused_result, const));
140 
142  __attribute__((warn_unused_result, const));
143 
144 #undef ROHC_EXPORT /* do not pollute outside this header */
145 
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif /* ROHC_PROFILES_H */
151 
Definition: rohc_profiles.h:98
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:77
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:111
#define ROHC_EXPORT
Definition: rohc_profiles.h:45
Definition: rohc_profiles.h:123
Definition: rohc_profiles.h:113
Definition: rohc_profiles.h:102
Definition: rohc_profiles.h:89
Definition: rohc_profiles.h:106
Definition: rohc_profiles.h:119
Definition: rohc_profiles.h:73
Definition: rohc_profiles.h:121
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:94
Definition: rohc_profiles.h:85
rohc_profile_t
The different ROHC compression/decompression profiles.
Definition: rohc_profiles.h:70
Definition: rohc_profiles.h:115
Definition: rohc_profiles.h:117
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:81