ROHC compression/decompression library
rohc_packets.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010,2012,2013,2014 Didier Barvaux
3  * Copyright 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_packets.h
22  * @brief Definition of ROHC packets and extensions
23  * @author Didier Barvaux <didier.barvaux@toulouse.viveris.com>
24  */
25 
26 #ifndef ROHC_PACKETS_H
27 #define ROHC_PACKETS_H
28 
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33 
34 /** Macro that handles DLL export declarations gracefully */
35 #ifdef DLL_EXPORT /* passed by autotools on command line */
36 # define ROHC_EXPORT __declspec(dllexport)
37 #else
38 # define ROHC_EXPORT
39 #endif
40 
41 
42 
43 /**
44  * @brief The different types of ROHC packets
45  *
46  * If you add a new packet type, please also add the corresponding textual
47  * description in \ref rohc_get_packet_descr.
48  */
49 typedef enum
50 {
51  /* IR and IR-DYN packets */
52  ROHC_PACKET_IR = 0, /**< ROHC IR packet */
53  ROHC_PACKET_IR_DYN = 1, /**< ROHC IR-DYN packet */
54 
55  /* UO-0 packets */
56  ROHC_PACKET_UO_0 = 2, /**< ROHC UO-0 packet */
57 
58  /* UO-1 packets */
59  ROHC_PACKET_UO_1 = 3, /**< ROHC UO-1 packet (for all non-RTP profiles) */
60  ROHC_PACKET_UO_1_ID = 4, /**< ROHC UO-1-ID packet (RTP profile only) */
61  ROHC_PACKET_UO_1_TS = 5, /**< ROHC UO-1-TS packet (RTP profile only) */
62  ROHC_PACKET_UO_1_RTP = 6, /**< ROHC UO-1-RTP packet (RTP profile only) */
63 
64  /* UOR-2 packets */
65  ROHC_PACKET_UOR_2 = 7, /**< ROHC UOR-2 packet (for all non-RTP profiles) */
66  ROHC_PACKET_UOR_2_RTP = 8, /**< ROHC UO-2 packet (RTP profile only) */
67  ROHC_PACKET_UOR_2_ID = 9, /**< ROHC UO-2-ID packet (RTP profile only) */
68  ROHC_PACKET_UOR_2_TS = 10, /**< ROHC UO-2-TS packet (RTP profile only) */
69 
70  /* values 11 and 12 were used by CCE packets of the UDP-Lite profile */
71 
72  /* Normal packet (Uncompressed profile only) */
73  ROHC_PACKET_NORMAL = 13, /**< ROHC Normal packet (Uncompressed profile only) */
74 
75  ROHC_PACKET_UNKNOWN = 14, /**< Unknown packet type */
76 
77  /* packets for TCP profile */
78  ROHC_PACKET_TCP_CO_COMMON = 15, /**< TCP co_common packet */
79  ROHC_PACKET_TCP_RND_1 = 16, /**< TCP rnd_1 packet */
80  ROHC_PACKET_TCP_RND_2 = 17, /**< TCP rnd_2 packet */
81  ROHC_PACKET_TCP_RND_3 = 18, /**< TCP rnd_3 packet */
82  ROHC_PACKET_TCP_RND_4 = 19, /**< TCP rnd_4 packet */
83  ROHC_PACKET_TCP_RND_5 = 20, /**< TCP rnd_5 packet */
84  ROHC_PACKET_TCP_RND_6 = 21, /**< TCP rnd_6 packet */
85  ROHC_PACKET_TCP_RND_7 = 22, /**< TCP rnd_7 packet */
86  ROHC_PACKET_TCP_RND_8 = 23, /**< TCP rnd_8 packet */
87  ROHC_PACKET_TCP_SEQ_1 = 24, /**< TCP seq_1 packet */
88  ROHC_PACKET_TCP_SEQ_2 = 25, /**< TCP seq_2 packet */
89  ROHC_PACKET_TCP_SEQ_3 = 26, /**< TCP seq_3 packet */
90  ROHC_PACKET_TCP_SEQ_4 = 27, /**< TCP seq_4 packet */
91  ROHC_PACKET_TCP_SEQ_5 = 28, /**< TCP seq_5 packet */
92  ROHC_PACKET_TCP_SEQ_6 = 29, /**< TCP seq_6 packet */
93  ROHC_PACKET_TCP_SEQ_7 = 30, /**< TCP seq_7 packet */
94  ROHC_PACKET_TCP_SEQ_8 = 31, /**< TCP seq_8 packet */
95 
96  ROHC_PACKET_MAX /**< The number of packet types */
98 
99 
100 /**
101  * @brief The different types of extensions for UO-1-ID and UOR-2* packets
102  *
103  * If you add a new extension type, please also add the corresponding textual
104  * description in \ref rohc_get_ext_descr.
105  */
106 typedef enum
107 {
108  ROHC_EXT_0 = 0, /**< The EXT-0 extension for UO-1-ID/UOR-2* packets */
109  ROHC_EXT_1 = 1, /**< The EXT-1 extension for UO-1-ID/UOR-2* packets */
110  ROHC_EXT_2 = 2, /**< The EXT-2 extension for UO-1-ID/UOR-2* packets */
111  ROHC_EXT_3 = 3, /**< The EXT-3 extension for UO-1-ID/UOR-2* packets */
112  ROHC_EXT_NONE = 4, /**< No extension for UO-1-ID/UOR-2* packets */
113  ROHC_EXT_UNKNOWN = 5, /**< Unknown packet extension type */
114 } rohc_ext_t;
115 
116 
117 /*
118  * Prototypes of public functions
119  */
120 
121 const char * ROHC_EXPORT rohc_get_packet_descr(const rohc_packet_t packet_type)
122  __attribute__((warn_unused_result, const));
123 
124 const char * ROHC_EXPORT rohc_get_ext_descr(const rohc_ext_t ext_type)
125  __attribute__((warn_unused_result, const));
126 
127 rohc_packet_t ROHC_EXPORT rohc_get_packet_type(const char *const packet_id)
128  __attribute__((warn_unused_result, nonnull(1)));
129 
130 
131 #undef ROHC_EXPORT /* do not pollute outside this header */
132 
133 #ifdef __cplusplus
134 }
135 #endif
136 
137 #endif /* ROHC_PACKETS_H */
138 
Definition: rohc_packets.h:53
Definition: rohc_packets.h:110
Definition: rohc_packets.h:68
Definition: rohc_packets.h:87
Definition: rohc_packets.h:65
Definition: rohc_packets.h:59
Definition: rohc_packets.h:86
Definition: rohc_packets.h:109
Definition: rohc_packets.h:82
Definition: rohc_packets.h:91
rohc_packet_t ROHC_EXPORT rohc_get_packet_type(const char *const packet_id)
Get the packet type from a packet identifier.
Definition: rohc_packets.c:170
Definition: rohc_packets.h:80
Definition: rohc_packets.h:113
#define ROHC_EXPORT
Definition: rohc_packets.h:38
Definition: rohc_packets.h:108
Definition: rohc_packets.h:84
rohc_ext_t
The different types of extensions for UO-1-ID and UOR-2* packets.
Definition: rohc_packets.h:106
Definition: rohc_packets.h:88
Definition: rohc_packets.h:85
Definition: rohc_packets.h:61
Definition: rohc_packets.h:94
Definition: rohc_packets.h:60
Definition: rohc_packets.h:112
Definition: rohc_packets.h:62
const char *ROHC_EXPORT rohc_get_packet_descr(const rohc_packet_t packet_type)
Give a description for the given type of ROHC packet.
Definition: rohc_packets.c:48
Definition: rohc_packets.h:93
Definition: rohc_packets.h:92
Definition: rohc_packets.h:67
Definition: rohc_packets.h:79
Definition: rohc_packets.h:56
const char *ROHC_EXPORT rohc_get_ext_descr(const rohc_ext_t ext_type)
Give a description for the given type of ROHC extension.
Definition: rohc_packets.c:141
Definition: rohc_packets.h:78
Definition: rohc_packets.h:83
Definition: rohc_packets.h:111
Definition: rohc_packets.h:90
Definition: rohc_packets.h:81
Definition: rohc_packets.h:52
Definition: rohc_packets.h:73
Definition: rohc_packets.h:96
Definition: rohc_packets.h:75
rohc_packet_t
The different types of ROHC packets.
Definition: rohc_packets.h:49
Definition: rohc_packets.h:89
Definition: rohc_packets.h:66