From Fabrizio Bertocci:
[metze/wireshark/wip.git] / epan / dissectors / packet-rtps.h
1 /* packet-rtps.h
2  * ~~~~~~~~~~~~~
3  *
4  * Routines for Real-Time Publish-Subscribe Protocol (RTPS) dissection
5  *
6  * Copyright 2005, Fabrizio Bertocci <fabrizio@rti.com>
7  * Real-Time Innovations, Inc.
8  * 3975 Freedom Circle
9  * Santa Clara, CA 95054
10  *
11  * Copyright 2003, LUKAS POKORNY <maskis@seznam.cz>
12  *                 PETR SMOLIK   <petr.smolik@wo.cz>
13  *                 ZDENEK SEBEK  <sebek@fel.cvut.cz>
14  * 
15  * Czech Technical University in Prague 
16  *  Faculty of Electrical Engineering <www.fel.cvut.cz>
17  *  Department of Control Engineering <dce.felk.cvut.cz>                
18  *                   
19  * $Id$
20  *
21  * Wireshark - Network traffic analyzer
22  * By Gerald Combs <gerald@ethereal.com>
23  * Copyright 1998 Gerald Combs
24  *
25  * This program is free software; you can redistribute it and/or modify
26  * it under the terms of the GNU General Public License as published by
27  * the Free Software Foundation; either version 2 of the License, or
28  * (at your option) any later version.
29  *  
30  * This program is distributed in the hope that it will be useful,
31  * but WITHOUT ANY WARRANTY; without even the implied warranty of
32  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
33  * GNU General Public License for more details.
34  *  
35  * You should have received a copy of the GNU General Public License
36  * along with this program; if not, write to the Free Software
37  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38  *
39  *                  -------------------------------------
40  *
41  * The following file is part of the RTPS packet dissector for Wireshark.
42  *
43  * RTPS protocol was developed by Real-Time Innovations, Inc. as wire 
44  * protocol for Data Distribution System.
45  * Additional information at:
46  *   Full OMG DDS Standard Specification: 
47  *                             http://www.omg.org/cgi-bin/doc?ptc/2003-07-07
48  *   
49  *   NDDS and RTPS information: http://www.rti.com/resources.html
50  *
51  */
52  
53 #ifndef _TYPEDEFS_DEFINES_RTPS_H
54 #define _TYPEDEFS_DEFINES_RTPS_H
55
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59
60
61 typedef enum {
62     RTI_CDR_TK_NULL,
63     RTI_CDR_TK_SHORT,
64     RTI_CDR_TK_LONG,
65     RTI_CDR_TK_USHORT,
66     RTI_CDR_TK_ULONG,
67     RTI_CDR_TK_FLOAT,
68     RTI_CDR_TK_DOUBLE,
69     RTI_CDR_TK_BOOLEAN,
70     RTI_CDR_TK_CHAR,
71     RTI_CDR_TK_OCTET,
72     RTI_CDR_TK_STRUCT,
73     RTI_CDR_TK_UNION,
74     RTI_CDR_TK_ENUM,
75     RTI_CDR_TK_STRING,
76     RTI_CDR_TK_SEQUENCE,
77     RTI_CDR_TK_ARRAY,
78     RTI_CDR_TK_ALIAS,
79     RTI_CDR_TK_LONGLONG,
80     RTI_CDR_TK_ULONGLONG,
81     RTI_CDR_TK_LONGDOUBLE,
82     RTI_CDR_TK_WCHAR,
83     RTI_CDR_TK_WSTRING,
84     RTI_CDR_TK_VALUE
85 } RTICdrTCKind;
86
87
88 /* Traffic type */
89 #define PORT_BASE                       (7400)
90 #define PORT_METATRAFFIC_UNICAST        (0)
91 #define PORT_USERTRAFFIC_MULTICAST      (1)
92 #define PORT_METATRAFFIC_MULTICAST      (2)
93 #define PORT_USERTRAFFIC_UNICAST        (3)
94
95 /* Flags defined in the 'flag' bitmask of a submessage */
96 #define FLAG_E                  (0x01)  /* Common to all the submessages */
97 #define FLAG_DATA_D             (0x02)
98 #define FLAG_DATA_A             (0x04)
99 #define FLAG_DATA_H             (0x08)
100 #define FLAG_DATA_Q             (0x10)
101 #define FLAG_DATA_U             (0x20)
102 #define FLAG_NOKEY_DATA_Q       (0x02)
103 #define FLAG_NOKEY_DATA_D       (0x04)
104 #define FLAG_ACKNACK_F          (0x02)
105 #define FLAG_HEARTBEAT_F        (0x02)
106 #define FLAG_GAP_F              (0x02)
107 #define FLAG_INFO_TS_T          (0x02)
108 #define FLAG_INFO_REPLY_IP4_M   (0x02)
109 #define FLAG_INFO_REPLY_M       (0x02)
110
111
112
113 /* The following PIDs are defined since RTPS 1.0 */
114 #define PID_PAD                                 (0x00)
115 #define PID_SENTINEL                            (0x01)
116 #define PID_PARTICIPANT_LEASE_DURATION          (0x02)
117 #define PID_TIME_BASED_FILTER                   (0x04)
118 #define PID_TOPIC_NAME                          (0x05)
119 #define PID_OWNERSHIP_STRENGTH                  (0x06)
120 #define PID_TYPE_NAME                           (0x07)
121 #define PID_METATRAFFIC_MULTICAST_IPADDRESS     (0x0b)
122 #define PID_DEFAULT_UNICAST_IPADDRESS           (0x0c)
123 #define PID_METATRAFFIC_UNICAST_PORT            (0x0d)
124 #define PID_DEFAULT_UNICAST_PORT                (0x0e)
125 #define PID_MULTICAST_IPADDRESS                 (0x11)
126 #define PID_PROTOCOL_VERSION                    (0x15)
127 #define PID_VENDOR_ID                           (0x16)
128 #define PID_RELIABILITY                         (0x1a)
129 #define PID_LIVELINESS                          (0x1b)
130 #define PID_DURABILITY                          (0x1d)
131 #define PID_DURABILITY_SERVICE                  (0x1e)
132 #define PID_OWNERSHIP                           (0x1f)
133 #define PID_PRESENTATION                        (0x21)
134 #define PID_DEADLINE                            (0x23)
135 #define PID_DESTINATION_ORDER                   (0x25)
136 #define PID_LATENCY_BUDGET                      (0x27)
137 #define PID_PARTITION                           (0x29)
138 #define PID_LIFESPAN                            (0x2b)
139 #define PID_USER_DATA                           (0x2c)
140 #define PID_GROUP_DATA                          (0x2d)
141 #define PID_TOPIC_DATA                          (0x2e)
142 #define PID_UNICAST_LOCATOR                     (0x2f)
143 #define PID_MULTICAST_LOCATOR                   (0x30)
144 #define PID_DEFAULT_UNICAST_LOCATOR             (0x31)
145 #define PID_METATRAFFIC_UNICAST_LOCATOR         (0x32)
146 #define PID_METATRAFFIC_MULTICAST_LOCATOR       (0x33)
147 #define PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT (0x34)
148 #define PID_CONTENT_FILTER_PROPERTY             (0x35)
149 #define PID_PROPERTY_LIST                       (0x36)
150 #define PID_HISTORY                             (0x40)
151 #define PID_RESOURCE_LIMIT                      (0x41)
152 #define PID_DEFAULT_EXPECTS_INLINE_QOS          (0x43)
153 #define PID_PARTICIPANT_BUILTIN_ENDPOINTS       (0x44)
154 #define PID_METATRAFFIC_UNICAST_IPADDRESS       (0x45)
155 #define PID_METATRAFFIC_MULTICAST_PORT          (0x46)
156 #define PID_TYPECODE                            (0x47)
157 #define PID_PARTICIPANT_GUID                    (0x50)
158 #define PID_PARTICIPANT_ENTITY_ID               (0x51)
159 #define PID_GROUP_GUID                          (0x52)
160 #define PID_GROUP_ENTITY_ID                     (0x53)
161 #define PID_FILTER_SIGNATURE                    (0x55)
162 #define PID_COHERENT_SET                        (0x56)
163
164 /* The following QoS are deprecated */
165 #define PID_RELIABILITY_OFFERED                 (0x19)
166 #define PID_LIVELINESS_OFFERED                  (0x1c)
167 #define PID_OWNERSHIP_OFFERED                   (0x20)
168 #define PID_PRESENTATION_OFFERED                (0x22)
169 #define PID_DEADLINE_OFFERED                    (0x24)
170 #define PID_DESTINATION_ORDER_OFFERED           (0x26)
171 #define PID_LATENCY_BUDGET_OFFERED              (0x28)
172 #define PID_PARTITION_OFFERED                   (0x2a)
173 #define PID_PERSISTENCE                         (0x03)
174 #define PID_TYPE_CHECKSUM                       (0x08)
175 #define PID_TYPE2_NAME                          (0x09)
176 #define PID_TYPE2_CHECKSUM                      (0x0a)
177 #define PID_IS_RELIABLE                         (0x0f)
178 #define PID_EXPECTS_ACK                         (0x10)
179 #define PID_MANAGER_KEY                         (0x12)
180 #define PID_SEND_QUEUE_SIZE                     (0x13)
181 #define PID_RECV_QUEUE_SIZE                     (0x18)
182 #define PID_VARGAPPS_SEQUENCE_NUMBER_LAST       (0x17)
183 #define PID_RELIABILITY_ENABLED                 (0x14)
184
185 /* appId.appKind possible values */
186 #define APPKIND_UNKNOWN                         (0x00)
187 #define APPKIND_MANAGED_APPLICATION             (0x01)
188 #define APPKIND_MANAGER                         (0x02)
189
190
191
192 /* Predefined EntityId */
193 #define ENTITYID_UNKNOWN                        (0x00000000)
194 #define ENTITYID_BUILTIN_TOPIC_WRITER           (0x000002c2)
195 #define ENTITYID_BUILTIN_TOPIC_READER           (0x000002c7)
196 #define ENTITYID_BUILTIN_PUBLICATIONS_WRITER    (0x000003c2)
197 #define ENTITYID_BUILTIN_PUBLICATIONS_READER    (0x000003c7)
198 #define ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER   (0x000004c2)
199 #define ENTITYID_BUILTIN_SUBSCRIPTIONS_READER   (0x000004c7)
200 #define ENTITYID_BUILTIN_SDP_PARTICIPANT_WRITER (0x000100c2)
201 #define ENTITYID_BUILTIN_SDP_PARTICIPANT_READER (0x000100c7)
202
203 /* Deprecated EntityId */
204 #define ENTITYID_APPLICATIONS_WRITER            (0x000001c2)
205 #define ENTITYID_APPLICATIONS_READER            (0x000001c7)
206 #define ENTITYID_CLIENTS_WRITER                 (0x000005c2)
207 #define ENTITYID_CLIENTS_READER                 (0x000005c7)
208 #define ENTITYID_SERVICES_WRITER                (0x000006c2)
209 #define ENTITYID_SERVICES_READER                (0x000006c7)
210 #define ENTITYID_MANAGERS_WRITER                (0x000007c2)
211 #define ENTITYID_MANAGERS_READER                (0x000007c7)
212 #define ENTITYID_APPLICATION_SELF               (0x000008c1)
213 #define ENTITYID_APPLICATION_SELF_WRITER        (0x000008c2)
214 #define ENTITYID_APPLICATION_SELF_READER        (0x000008c7)
215
216 /* Predefined Entity Kind */
217 #define ENTITYKIND_APPDEF_UNKNOWN               (0x00)
218 #define ENTITYKIND_APPDEF_PARTICIPANT           (0x01)
219 #define ENTITYKIND_APPDEF_WRITER_WITH_KEY       (0x02)
220 #define ENTITYKIND_APPDEF_WRITER_NO_KEY         (0x03)
221 #define ENTITYKIND_APPDEF_READER_NO_KEY         (0x04)
222 #define ENTITYKIND_APPDEF_READER_WITH_KEY       (0x07)
223 #define ENTITYKIND_BUILTIN_PARTICIPANT          (0xc1)
224 #define ENTITYKIND_BUILTIN_WRITER_WITH_KEY      (0xc2)
225 #define ENTITYKIND_BUILTIN_WRITER_NO_KEY        (0xc3)
226 #define ENTITYKIND_BUILTIN_READER_NO_KEY        (0xc4)
227 #define ENTITYKIND_BUILTIN_READER_WITH_KEY      (0xc7)
228
229
230 /* Submessage Type */
231 #define PAD                             (0x01)
232 #define DATA                            (0x02)
233 #define NOKEY_DATA                      (0x03)
234 #define ACKNACK                         (0x06)
235 #define HEARTBEAT                       (0x07)
236 #define GAP                             (0x08)
237 #define INFO_TS                         (0x09)
238 #define INFO_SRC                        (0x0c)
239 #define INFO_REPLY_IP4                  (0x0d)
240 #define INFO_DST                        (0x0e)
241 #define INFO_REPLY                      (0x0f)
242
243
244
245 /* An invalid IP Address: 
246  * Make sure the _STRING macro is bigger than a normal IP
247  */
248 #define IPADDRESS_INVALID               (0)
249 #define IPADDRESS_INVALID_STRING        "ADDRESS_INVALID (0x00000000)"
250
251 /* Identifies the value of an invalid port number:
252  * Make sure the _STRING macro is bigger than a normal port
253  */
254 #define PORT_INVALID                    (0)
255 #define PORT_INVALID_STRING             "PORT_INVALID"
256
257 /* Protocol Vendor Information (guint16) */
258 #define RTPS_VENDOR_UNKNOWN             (0x0000)
259 #define RTPS_VENDOR_UNKNOWN_STRING      "VENDOR_ID_UNKNOWN (0x0000)"
260 #define RTPS_VENDOR_RTI                 (0x0101)
261 #define RTPS_VENDOR_RTI_STRING          "Real-Time Innovations, Inc."
262
263 /* Parameter Liveliness */
264 #define LIVELINESS_AUTOMATIC            (0)
265 #define LIVELINESS_BY_PARTICIPANT       (1)
266 #define LIVELINESS_BY_TOPIC             (2)
267
268 /* Parameter Durability */
269 #define DURABILITY_VOLATILE             (0)
270 #define DURABILITY_TRANSIENT_LOCAL      (1)
271 #define DURABILITY_TRANSIENT            (2)
272 #define DURABILITY_PERSISTENT           (3)
273
274 /* Parameter Ownership */
275 #define OWNERSHIP_SHARED                (0)
276 #define OWNERSHIP_EXCLUSIVE             (1)
277
278 /* Parameter Presentation */
279 #define PRESENTATION_INSTANCE           (0)
280 #define PRESENTATION_TOPIC              (1)
281 #define PRESENTATION_GROUP              (2)
282
283
284 #define LOCATOR_KIND_INVALID            (-1)
285 #define LOCATOR_KIND_RESERVED           (0)
286 #define LOCATOR_KIND_UDPV4              (1)
287 #define LOCATOR_KIND_UDPV6              (2)
288
289 /* History Kind */
290 #define HISTORY_KIND_KEEP_LAST          (0)
291 #define HISTORY_KIND_KEEP_ALL           (1)
292
293 /* Reliability Values */
294 #define RELIABILITY_BEST_EFFORT         (1)
295 #define RELIABILITY_RELIABLE            (2)
296
297 /* Destination Order */
298 #define BY_RECEPTION_TIMESTAMP          (0)
299 #define BY_SOURCE_TIMESTAMP             (1)
300
301
302
303
304
305
306
307 #ifdef __cplusplus
308 } /* extern "C"*/
309 #endif
310             
311 #endif /* _TYPEDEFS_DEFINES_RTPS_H */