Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-rtps.c
blob9cb097e67b7a98451fc338dcacd5d3ac7f4b27b0
1 /* packet-rtps.c
2 * ~~~~~~~~~~~~~
4 * Routines for Real-Time Publish-Subscribe Protocol (RTPS) dissection
6 * (c) 2005-2014 Copyright, Real-Time Innovations, Inc.
7 * Real-Time Innovations, Inc.
8 * 232 East Java Drive
9 * Sunnyvale, CA 94089
11 * Copyright 2003, LUKAS POKORNY <maskis@seznam.cz>
12 * PETR SMOLIK <petr.smolik@wo.cz>
13 * ZDENEK SEBEK <sebek@fel.cvut.cz>
15 * Czech Technical University in Prague
16 * Faculty of Electrical Engineering <www.fel.cvut.cz>
17 * Department of Control Engineering <dce.felk.cvut.cz>
19 * Wireshark - Network traffic analyzer
20 * By Gerald Combs <gerald@wireshark.org>
21 * Copyright 1998 Gerald Combs
23 * SPDX-License-Identifier: GPL-2.0-or-later
25 * -------------------------------------
27 * The following file is part of the RTPS packet dissector for Wireshark.
29 * RTPS protocol was developed by Real-Time Innovations, Inc. as wire
30 * protocol for Data Distribution System.
31 * Additional information at:
33 * OMG DDS standards: http://portals.omg.org/dds/omg-dds-standard/
35 * Older OMG DDS specification:
36 * http://www.omg.org/cgi-bin/doc?ptc/2003-07-07
38 * NDDS and RTPS information: http://www.rti.com/resources.html
40 * Vendor ID listing can be found at:
41 * https://www.dds-foundation.org/dds-rtps-vendor-and-product-ids/
44 #define WS_LOG_DOMAIN "packet-rtps"
46 #include "config.h"
47 #include <wireshark.h>
49 #include <epan/packet.h>
50 #include <epan/expert.h>
51 #include <epan/prefs.h>
52 #include "packet-rtps.h"
53 #include <epan/addr_resolv.h>
54 #include <epan/exceptions.h>
55 #include <epan/proto_data.h>
56 #include <epan/reassemble.h>
57 #include <epan/tfs.h>
58 #include <epan/unit_strings.h>
60 #include <wsutil/array.h>
61 #if defined(HAVE_ZLIB) && !defined(HAVE_ZLIBNG)
62 #define ZLIB_CONST
63 #define ZLIB_PREFIX(x) x
64 #include <zlib.h>
65 typedef z_stream zlib_stream;
66 #endif /* HAVE_ZLIB */
68 #ifdef HAVE_ZLIBNG
69 #define ZLIB_PREFIX(x) zng_ ## x
70 #include <zlib-ng.h>
71 typedef zng_stream zlib_stream;
72 #endif /* HAVE_ZLIBNG */
74 #include <epan/crc32-tvb.h>
75 #include <wsutil/crc32.h>
76 #include <wsutil/str_util.h>
77 #include <gcrypt.h>
78 #include <uat.h>
80 void proto_register_rtps(void);
81 void proto_reg_handoff_rtps(void);
83 #define MAX_GUID_PREFIX_SIZE (128)
84 #define MAX_GUID_SIZE (160)
85 #define GUID_SIZE (16)
86 #define MAX_VENDOR_ID_SIZE (128)
87 #define MAX_PARAM_SIZE (256)
88 #define MAX_TIMESTAMP_SIZE (128)
90 #define LONG_ALIGN(x) (x = (x+3)&0xfffffffc)
91 #define SHORT_ALIGN(x) (x = (x+1)&0xfffffffe)
92 #define MAX_ARRAY_DIMENSION 10
93 #define ALIGN_ME(offset, alignment) \
94 offset = (((offset) + ((alignment) - 1)) & ~((alignment) - 1))
95 #define ALIGN_ZERO(offset, alignment, zero) (offset -= zero, ALIGN_ME(offset, alignment), offset += zero)
97 #define KEY_COMMENT (" //@key")
99 #define LONG_ALIGN_ZERO(x,zero) (x -= zero, LONG_ALIGN(x), x += zero)
100 #define SHORT_ALIGN_ZERO(x,zero) (x -= zero, SHORT_ALIGN(x), x += zero)
102 #define DISSECTION_INFO_MAX_ELEMENTS_DEFAULT_VALUE (100)
103 #define DISSECTION_INFO_ARRAY_MAX_ELEMENTS_DEFAULT_VALUE (100)
104 #define DISSECTION_INFO_REMAINING_ELEMENTS_STR_d "... %d items(s) remaining. The number of items shown is configurable through RTPS properties under Preferences/Protocols."
105 #define MAX_MEMBER_NAME (256)
106 #define HASHMAP_DISCRIMINATOR_CONSTANT (-2)
107 #define UUID_SIZE (9)
108 #define LONG_ADDRESS_SIZE (16)
110 #define INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS 7
111 #define SEQUENCE_100_IINSTANCE_TRANSITION_DATA_BOUND 100
112 #define INSTANCE_TRANSITION_DATA_NUM_ELEMENTS 4
113 #define GUID_T_NUM_ELEMENTS 1
114 #define VALUE_NUM_ELEMENTS 16
115 #define KEY_HAS_VALUE_NUM_ELEMENTS 16
116 #define NTPTIME_T_NUM_ELEMENTS 2
117 #define SEQUENCE_NUMBER_T_NUM_ELEMENTS 2
118 #define SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH 16 /* bytes. */
120 typedef struct _union_member_mapping {
121 uint64_t union_type_id;
122 uint64_t member_type_id;
123 int32_t discriminator;
124 char member_name[MAX_MEMBER_NAME];
125 } union_member_mapping;
127 typedef struct _mutable_member_mapping {
128 int64_t key;
129 uint64_t struct_type_id;
130 uint64_t member_type_id;
131 uint32_t member_id;
132 char member_name[MAX_MEMBER_NAME];
133 } mutable_member_mapping;
135 typedef struct _dissection_element {
136 uint64_t type_id;
137 uint16_t flags;
138 uint32_t member_id;
139 char member_name[MAX_MEMBER_NAME];
140 } dissection_element;
142 typedef enum {
143 EXTENSIBILITY_INVALID = 1,
144 EXTENSIBILITY_FINAL,
145 EXTENSIBILITY_EXTENSIBLE,
146 EXTENSIBILITY_MUTABLE
147 } RTICdrTypeObjectExtensibility;
149 typedef struct _dissection_info {
150 uint64_t type_id;
151 int member_kind;
152 uint64_t base_type_id;
153 uint32_t member_length;
154 char member_name[MAX_MEMBER_NAME];
156 RTICdrTypeObjectExtensibility extensibility;
158 int32_t bound;
159 uint32_t num_elements;
160 dissection_element* elements;
162 } dissection_info;
165 typedef struct _submessage_col_info {
166 const char* status_info;
167 const char* topic_name;
168 const char* data_session_kind;
169 } submessage_col_info;
171 typedef enum {
172 RTI_CDR_TK_NULL = 0,
173 RTI_CDR_TK_SHORT,
174 RTI_CDR_TK_LONG,
175 RTI_CDR_TK_USHORT,
176 RTI_CDR_TK_ULONG,
177 RTI_CDR_TK_FLOAT,
178 RTI_CDR_TK_DOUBLE,
179 RTI_CDR_TK_BOOLEAN,
180 RTI_CDR_TK_CHAR,
181 RTI_CDR_TK_OCTET,
182 RTI_CDR_TK_STRUCT,
183 RTI_CDR_TK_UNION,
184 RTI_CDR_TK_ENUM,
185 RTI_CDR_TK_STRING,
186 RTI_CDR_TK_SEQUENCE,
187 RTI_CDR_TK_ARRAY,
188 RTI_CDR_TK_ALIAS,
189 RTI_CDR_TK_LONGLONG,
190 RTI_CDR_TK_ULONGLONG,
191 RTI_CDR_TK_LONGDOUBLE,
192 RTI_CDR_TK_WCHAR,
193 RTI_CDR_TK_WSTRING,
194 RTI_CDR_TK_VALUE,
195 RTI_CDR_TK_VALUE_PARAM
196 } RTICdrTCKind;
198 typedef enum {
199 RTI_CDR_TYPE_OBJECT_TYPE_KIND_NO_TYPE=0,
200 RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE=1,
201 RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE=2,
202 RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE=3,
203 RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE=4,
204 RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE=5,
205 RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE=6,
206 RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE=7,
207 RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE=8,
208 RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE=9,
209 RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE=10,
210 RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE=11,
211 RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE=12,
212 RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_32_TYPE=13,
213 RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE=14,
214 RTI_CDR_TYPE_OBJECT_TYPE_KIND_BITSET_TYPE=15,
215 RTI_CDR_TYPE_OBJECT_TYPE_KIND_ALIAS_TYPE=16,
216 RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE=17,
217 RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE=18,
218 RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRING_TYPE=19,
219 RTI_CDR_TYPE_OBJECT_TYPE_KIND_MAP_TYPE=20,
220 RTI_CDR_TYPE_OBJECT_TYPE_KIND_UNION_TYPE=21,
221 RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE=22,
222 RTI_CDR_TYPE_OBJECT_TYPE_KIND_ANNOTATION_TYPE=23,
223 RTI_CDR_TYPE_OBJECT_TYPE_KIND_MODULE=24
224 } RTICdrTypeObjectTypeKind;
226 typedef struct _rtps_dissector_data {
227 uint16_t encapsulation_id;
228 /* Represents the position of a sample within a batch. Since the
229 position can be 0, we use -1 as not valid (not a batch) */
230 int position_in_batch;
231 } rtps_dissector_data;
233 typedef struct _rtps_tvb_field {
234 tvbuff_t *tvb;
235 int tvb_offset;
236 int tvb_len;
237 } rtps_tvb_field;
239 static const value_string type_object_kind [] = {
240 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_NO_TYPE, "NO_TYPE" },
241 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE, "BOOLEAN_TYPE" },
242 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE, "BYTE_TYPE" },
243 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE, "INT_16_TYPE" },
244 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE, "UINT_16_TYPE" },
245 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE, "INT_32_TYPE" },
246 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE, "UINT_32_TYPE" },
247 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE, "INT_64_TYPE" },
248 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE, "UINT_64_TYPE" },
249 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE, "FLOAT_32_TYPE" },
250 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE, "FLOAT_64_TYPE" },
251 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE, "FLOAT_128_TYPE" },
252 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE, "CHAR_8_TYPE" },
253 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_32_TYPE, "CHAR_32_TYPE" },
254 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE, "ENUMERATION_TYPE" },
255 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_BITSET_TYPE, "BITSET_TYPE" },
256 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_ALIAS_TYPE, "ALIAS_TYPE" },
257 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE, "ARRAY_TYPE" },
258 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE, "SEQUENCE_TYPE" },
259 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRING_TYPE, "STRING_TYPE" },
260 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_MAP_TYPE, "MAP_TYPE" },
261 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_UNION_TYPE, "UNION_TYPE" },
262 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE, "STRUCTURE_TYPE" },
263 { RTI_CDR_TYPE_OBJECT_TYPE_KIND_ANNOTATION_TYPE, "ANNOTATION_TYPE" },
264 { 0, NULL }
267 static wmem_map_t * dissection_infos;
268 static wmem_map_t * builtin_dissection_infos;
269 static wmem_map_t * union_member_mappings;
270 static wmem_map_t * mutable_member_mappings;
272 /***************************************************************************/
273 /* Preferences */
274 /***************************************************************************/
275 static unsigned rtps_max_batch_samples_dissected = 16;
276 static unsigned rtps_max_data_type_elements = DISSECTION_INFO_MAX_ELEMENTS_DEFAULT_VALUE;
277 static unsigned rtps_max_array_data_type_elements = DISSECTION_INFO_ARRAY_MAX_ELEMENTS_DEFAULT_VALUE;
278 static bool enable_topic_info = true;
279 static bool enable_rtps_reassembly = false;
280 static bool enable_user_data_dissection = false;
281 static bool enable_max_array_data_type_elements = true;
282 static bool enable_max_data_type_elements = true;
283 static bool enable_rtps_crc_check = false;
284 static bool enable_rtps_psk_decryption = false;
285 static dissector_table_t rtps_type_name_table;
287 /***************************************************************************/
288 /* Variable definitions */
289 /***************************************************************************/
290 #define RTPS_MAGIC_NUMBER 0x52545053 /* RTPS */
291 #define RTPX_MAGIC_NUMBER 0x52545058 /* RTPX */
292 #define RTPS_SEQUENCENUMBER_UNKNOWN 0xffffffff00000000 /* {-1,0} as uint64 */
294 #define RTPS_TOPIC_QUERY_SELECTION_KIND_HISTORY_SNAPSHOT 0
295 #define RTPS_TOPIC_QUERY_SELECTION_KIND_CONTINUOUS 1
297 /* Traffic type */
298 #define PORT_BASE (7400)
299 #define DOMAIN_GAIN (250)
300 #define PORT_METATRAFFIC_UNICAST (0)
301 #define PORT_USERTRAFFIC_MULTICAST (1)
302 #define PORT_METATRAFFIC_MULTICAST (2)
303 #define PORT_USERTRAFFIC_UNICAST (3)
305 /* Flags defined in the 'flag' bitmask of a submessage */
306 #define FLAG_E (0x01) /* Common to all the submessages */
307 #define FLAG_DATA_D (0x02)
308 #define FLAG_DATA_D_v2 (0x04)
309 #define FLAG_DATA_A (0x04)
310 #define FLAG_DATA_H (0x08)
311 #define FLAG_DATA_Q (0x10)
312 #define FLAG_DATA_Q_v2 (0x02)
313 #define FLAG_DATA_FRAG_Q (0x02)
314 #define FLAG_DATA_FRAG_H (0x04)
315 #define FLAG_DATA_I (0x10)
316 #define FLAG_DATA_U (0x20)
317 #define FLAG_NOKEY_DATA_Q (0x02)
318 #define FLAG_NOKEY_DATA_D (0x04)
319 #define FLAG_ACKNACK_F (0x02)
320 #define FLAG_HEARTBEAT_F (0x02)
321 #define FLAG_GAP_F (0x02)
322 #define FLAG_INFO_TS_T (0x02)
323 #define FLAG_INFO_REPLY_IP4_M (0x02)
324 #define FLAG_INFO_REPLY_M (0x02)
325 #define FLAG_RTPS_DATA_Q (0x02)
326 #define FLAG_RTPS_DATA_D (0x04)
327 #define FLAG_RTPS_DATA_K (0x08)
328 #define FLAG_RTPS_DATA_FRAG_Q (0x02)
329 #define FLAG_RTPS_DATA_FRAG_K (0x04)
330 #define FLAG_RTPS_DATA_BATCH_Q (0x02)
331 #define FLAG_SAMPLE_INFO_T (0x01)
332 #define FLAG_SAMPLE_INFO_Q (0x02)
333 #define FLAG_SAMPLE_INFO_O (0x04)
334 #define FLAG_SAMPLE_INFO_D (0x08)
335 #define FLAG_SAMPLE_INFO_I (0x10)
336 #define FLAG_SAMPLE_INFO_K (0x20)
338 #define FLAG_VIRTUAL_HEARTBEAT_V (0x02)
339 #define FLAG_VIRTUAL_HEARTBEAT_W (0x04)
340 #define FLAG_VIRTUAL_HEARTBEAT_N (0x08)
342 /* UDPv4 WAN Transport locator flags */
343 #define FLAG_UDPV4_WAN_LOCATOR_U (0x01)
344 #define FLAG_UDPV4_WAN_LOCATOR_P (0x02)
345 #define FLAG_UDPV4_WAN_LOCATOR_B (0x04)
346 #define FLAG_UDPV4_WAN_LOCATOR_R (0x08)
348 /* UDP WAN BINDING_PING submessage flags */
349 #define FLAG_UDPV4_WAN_BINDING_PING_FLAG_E (0x01)
350 #define FLAG_UDPV4_WAN_BINDING_PING_FLAG_L (0x02)
351 #define FLAG_UDPV4_WAN_BINDING_PING_FLAG_B (0x04)
354 /* The following PIDs are defined since RTPS 1.0 */
355 #define PID_PAD (0x00)
356 #define PID_SENTINEL (0x01)
357 #define PID_PARTICIPANT_LEASE_DURATION (0x02)
358 #define PID_TIME_BASED_FILTER (0x04)
359 #define PID_TOPIC_NAME (0x05)
360 #define PID_OWNERSHIP_STRENGTH (0x06)
361 #define PID_TYPE_NAME (0x07)
362 #define PID_METATRAFFIC_MULTICAST_IPADDRESS (0x0b)
363 #define PID_DEFAULT_UNICAST_IPADDRESS (0x0c)
364 #define PID_METATRAFFIC_UNICAST_PORT (0x0d)
365 #define PID_DEFAULT_UNICAST_PORT (0x0e)
366 #define PID_MULTICAST_IPADDRESS (0x11)
367 #define PID_PROTOCOL_VERSION (0x15)
368 #define PID_VENDOR_ID (0x16)
369 #define PID_RELIABILITY (0x1a)
370 #define PID_LIVELINESS (0x1b)
371 #define PID_DURABILITY (0x1d)
372 #define PID_DURABILITY_SERVICE (0x1e)
373 #define PID_OWNERSHIP (0x1f)
374 #define PID_PRESENTATION (0x21)
375 #define PID_DEADLINE (0x23)
376 #define PID_DESTINATION_ORDER (0x25)
377 #define PID_LATENCY_BUDGET (0x27)
378 #define PID_PARTITION (0x29)
379 #define PID_LIFESPAN (0x2b)
380 #define PID_USER_DATA (0x2c)
381 #define PID_GROUP_DATA (0x2d)
382 #define PID_TOPIC_DATA (0x2e)
383 #define PID_UNICAST_LOCATOR (0x2f)
384 #define PID_MULTICAST_LOCATOR (0x30)
385 #define PID_DEFAULT_UNICAST_LOCATOR (0x31)
386 #define PID_METATRAFFIC_UNICAST_LOCATOR (0x32)
387 #define PID_METATRAFFIC_MULTICAST_LOCATOR (0x33)
388 #define PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT (0x34)
389 #define PID_CONTENT_FILTER_PROPERTY (0x35)
390 #define PID_PROPERTY_LIST_OLD (0x36) /* For compatibility between 4.2d and 4.2e */
391 #define PID_HISTORY (0x40)
392 #define PID_RESOURCE_LIMIT (0x41)
393 #define PID_EXPECTS_INLINE_QOS (0x43)
394 #define PID_PARTICIPANT_BUILTIN_ENDPOINTS (0x44)
395 #define PID_METATRAFFIC_UNICAST_IPADDRESS (0x45)
396 #define PID_METATRAFFIC_MULTICAST_PORT (0x46)
397 #define PID_TYPECODE (0x47)
398 #define PID_PARTICIPANT_GUID (0x50)
399 #define PID_PARTICIPANT_ENTITY_ID (0x51)
400 #define PID_GROUP_GUID (0x52)
401 #define PID_GROUP_ENTITY_ID (0x53)
402 #define PID_FILTER_SIGNATURE (0x55)
403 #define PID_COHERENT_SET (0x56)
404 #define PID_GROUP_COHERENT_SET (0x0063)
405 #define PID_END_COHERENT_SET (0x8022)
406 #define PID_END_GROUP_COHERENT_SET (0x8023)
407 #define MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT (0x8024)
409 /* The following QoS are deprecated */
410 #define PID_PERSISTENCE (0x03)
411 #define PID_TYPE_CHECKSUM (0x08)
412 #define PID_TYPE2_NAME (0x09)
413 #define PID_TYPE2_CHECKSUM (0x0a)
414 #define PID_EXPECTS_ACK (0x10)
415 #define PID_MANAGER_KEY (0x12)
416 #define PID_SEND_QUEUE_SIZE (0x13)
417 #define PID_RELIABILITY_ENABLED (0x14)
418 #define PID_RECV_QUEUE_SIZE (0x18)
419 #define PID_VARGAPPS_SEQUENCE_NUMBER_LAST (0x17)
420 #define PID_RELIABILITY_OFFERED (0x19)
421 #define PID_LIVELINESS_OFFERED (0x1c)
422 #define PID_OWNERSHIP_OFFERED (0x20)
423 #define PID_PRESENTATION_OFFERED (0x22)
424 #define PID_DEADLINE_OFFERED (0x24)
425 #define PID_DESTINATION_ORDER_OFFERED (0x26)
426 #define PID_LATENCY_BUDGET_OFFERED (0x28)
427 #define PID_PARTITION_OFFERED (0x2a)
429 /* The following PIDs are defined since RTPS 2.0 */
430 #define PID_DEFAULT_MULTICAST_LOCATOR (0x0048)
431 #define PID_TRANSPORT_PRIORITY (0x0049)
432 #define PID_CONTENT_FILTER_INFO (0x0055)
433 #define PID_DIRECTED_WRITE (0x0057)
434 #define PID_BUILTIN_ENDPOINT_SET (0x0058)
435 #define PID_PROPERTY_LIST (0x0059) /* RTI DDS 4.2e and newer */
436 #define PID_ENDPOINT_GUID (0x005a)
437 #define PID_TYPE_MAX_SIZE_SERIALIZED (0x0060)
438 #define PID_ORIGINAL_WRITER_INFO (0x0061)
439 #define PID_ENTITY_NAME (0x0062)
440 #define PID_KEY_HASH (0x0070)
441 #define PID_STATUS_INFO (0x0071)
442 #define PID_TYPE_OBJECT (0x0072)
443 #define PID_DATA_REPRESENTATION (0x0073)
444 #define PID_TYPE_CONSISTENCY (0x0074)
445 #define PID_EQUIVALENT_TYPE_NAME (0x0075)
446 #define PID_BASE_TYPE_NAME (0x0076)
447 #define PID_BUILTIN_ENDPOINT_QOS (0x0077)
448 #define PID_ENABLE_AUTHENTICATION (0x0078)
449 #define PID_RELATED_ENTITY_GUID (0x0081)
450 #define PID_RELATED_ORIGINAL_WRITER_INFO (0x0083)/* inline QoS */
451 #define PID_DOMAIN_ID (0x000f)
452 #define PID_DOMAIN_TAG (0x4014)
454 /* Vendor-specific: RTI */
455 #define PID_PRODUCT_VERSION (0x8000)
456 #define PID_PLUGIN_PROMISCUITY_KIND (0x8001)
457 #define PID_ENTITY_VIRTUAL_GUID (0x8002)
458 #define PID_SERVICE_KIND (0x8003)
459 #define PID_TYPECODE_RTPS2 (0x8004) /* Was: 0x47 in RTPS 1.2 */
460 #define PID_DISABLE_POSITIVE_ACKS (0x8005)
461 #define PID_LOCATOR_FILTER_LIST (0x8006)
462 #define PID_EXPECTS_VIRTUAL_HB (0x8009)
463 #define PID_ROLE_NAME (0x800a)
464 #define PID_ACK_KIND (0x800b)
465 #define PID_PEER_HOST_EPOCH (0x800e)
466 #define PID_RELATED_ORIGINAL_WRITER_INFO_LEGACY (0x800f)/* inline QoS */
467 #define PID_RTI_DOMAIN_ID (0x800f)
468 #define PID_RELATED_READER_GUID (0x8010)/* inline QoS */
469 #define PID_TRANSPORT_INFO_LIST (0x8010)
470 #define PID_SOURCE_GUID (0x8011)/* inline QoS */
471 #define PID_DIRECT_COMMUNICATION (0x8011)
472 #define PID_RELATED_SOURCE_GUID (0x8012)/* inline QoS */
473 #define PID_TOPIC_QUERY_GUID (0x8013)/* inline QoS */
474 #define PID_TOPIC_QUERY_PUBLICATION (0x8014)
475 #define PID_ENDPOINT_PROPERTY_CHANGE_EPOCH (0x8015)
476 #define PID_REACHABILITY_LEASE_DURATION (0x8016)
477 #define PID_VENDOR_BUILTIN_ENDPOINT_SET (0x8017)
478 #define PID_ENDPOINT_SECURITY_ATTRIBUTES (0x8018)
479 #define PID_SAMPLE_SIGNATURE (0x8019)/* inline QoS */
480 #define PID_EXTENDED (0x3f01)
481 #define PID_LIST_END (0x3f02)
482 #define PID_UNICAST_LOCATOR_EX (0x8007)
483 #define PID_TOPIC_NAME_ALIASES (0x8028)
485 #define PID_IDENTITY_TOKEN (0x1001)
486 #define PID_PERMISSIONS_TOKEN (0x1002)
487 #define PID_DATA_TAGS (0x1003)
488 #define PID_ENDPOINT_SECURITY_INFO (0x1004)
489 #define PID_PARTICIPANT_SECURITY_INFO (0x1005)
490 #define PID_IDENTITY_STATUS_TOKEN (0x1006)
491 #define PID_PARTICIPANT_SECURITY_DIGITAL_SIGNATURE_ALGO (0x1010)
492 #define PID_PARTICIPANT_SECURITY_KEY_ESTABLISHMENT_ALGO (0x1011)
493 #define PID_PARTICIPANT_SECURITY_SYMMETRIC_CIPHER_ALGO (0x1012)
494 #define PID_ENDPOINT_SECURITY_SYMMETRIC_CIPHER_ALGO (0x1013)
496 #define PID_TYPE_OBJECT_LB (0x8021)
498 /* Vendor-specific: ADLink */
499 #define PID_ADLINK_WRITER_INFO (0x8001)
500 #define PID_ADLINK_READER_DATA_LIFECYCLE (0x8002)
501 #define PID_ADLINK_WRITER_DATA_LIFECYCLE (0x8003)
502 #define PID_ADLINK_ENDPOINT_GUID (0x8004)
503 #define PID_ADLINK_SYNCHRONOUS_ENDPOINT (0x8005)
504 #define PID_ADLINK_RELAXED_QOS_MATCHING (0x8006)
505 #define PID_ADLINK_PARTICIPANT_VERSION_INFO (0x8007)
506 #define PID_ADLINK_NODE_NAME (0x8008)
507 #define PID_ADLINK_EXEC_NAME (0x8009)
508 #define PID_ADLINK_PROCESS_ID (0x800a)
509 #define PID_ADLINK_SERVICE_TYPE (0x800b)
510 #define PID_ADLINK_ENTITY_FACTORY (0x800c)
511 #define PID_ADLINK_WATCHDOG_SCHEDULING (0x800d)
512 #define PID_ADLINK_LISTENER_SCHEDULING (0x800e)
513 #define PID_ADLINK_SUBSCRIPTION_KEYS (0x800f)
514 #define PID_ADLINK_READER_LIFESPAN (0x8010)
515 #define PID_ADLINK_SHARE (0x8011)
516 #define PID_ADLINK_TYPE_DESCRIPTION (0x8012)
517 #define PID_ADLINK_LAN_ID (0x8013)
518 #define PID_ADLINK_ENDPOINT_GID (0x8014)
519 #define PID_ADLINK_GROUP_GID (0x8015)
520 #define PID_ADLINK_EOTINFO (0x8016)
521 #define PID_ADLINK_PART_CERT_NAME (0x8017)
522 #define PID_ADLINK_LAN_CERT_NAME (0x8018)
524 /* appId.appKind possible values */
525 #define APPKIND_UNKNOWN (0x00)
526 #define APPKIND_MANAGED_APPLICATION (0x01)
527 #define APPKIND_MANAGER (0x02)
529 #define RTI_SERVICE_REQUEST_ID_UNKNOWN 0
530 #define RTI_SERVICE_REQUEST_ID_TOPIC_QUERY 1
531 #define RTI_SERVICE_REQUEST_ID_LOCATOR_REACHABILITY 2
532 #define RTI_SERVICE_REQUEST_ID_INSTANCE_STATE 3
534 /* Predefined EntityId */
535 #define ENTITYID_UNKNOWN (0x00000000)
536 #define ENTITYID_PARTICIPANT (0x000001c1)
537 #define ENTITYID_BUILTIN_TOPIC_WRITER (0x000002c2)
538 #define ENTITYID_BUILTIN_TOPIC_READER (0x000002c7)
539 #define ENTITYID_BUILTIN_PUBLICATIONS_WRITER (0x000003c2)
540 #define ENTITYID_BUILTIN_PUBLICATIONS_READER (0x000003c7)
541 #define ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER (0x000004c2)
542 #define ENTITYID_BUILTIN_SUBSCRIPTIONS_READER (0x000004c7)
543 #define ENTITYID_BUILTIN_PARTICIPANT_WRITER (0x000100c2)
544 #define ENTITYID_BUILTIN_PARTICIPANT_READER (0x000100c7)
545 #define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER (0x000200c2)
546 #define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER (0x000200c7)
547 #define ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER (0x00010082)
548 #define ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER (0x00010087)
549 #define ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER (0x00010182)
550 #define ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER (0x00010187)
551 #define ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER (0xff010182)
552 #define ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER (0xff010187)
555 #define ENTITYID_RESERVED_META_CST_GROUP_WRITER (0xcb)
556 #define ENTITYID_RESERVED_META_GROUP_WRITER (0xcc)
557 #define ENTITYID_RESERVED_META_GROUP_READER (0xcd)
558 #define ENTITYID_RESERVED_META_CST_GROUP_READER (0xce)
559 #define ENTITYID_OBJECT_NORMAL_META_WRITER_GROUP (0x88)
560 #define ENTITYID_OBJECT_NORMAL_META_READER_GROUP (0x89)
561 #define ENTITYID_OBJECT_NORMAL_META_TOPIC (0x8a)
562 #define ENTITYID_NORMAL_META_CST_GROUP_WRITER (0x8b)
563 #define ENTITYID_NORMAL_META_GROUP_WRITER (0x8c)
564 #define ENTITYID_NORMAL_META_GROUP_READER (0x8d)
565 #define ENTITYID_NORMAL_META_CST_GROUP_READER (0x8e)
566 #define ENTITYID_RESERVED_USER_CST_GROUP_WRITER (0x4b)
567 #define ENTITYID_RESERVED_USER_GROUP_WRITER (0x4c)
568 #define ENTITYID_RESERVED_USER_GROUP_READER (0x4d)
569 #define ENTITYID_RESERVED_USER_CST_GROUP_READER (0x4e)
570 #define ENTITYID_NORMAL_USER_CST_GROUP_WRITER (0x0b)
571 #define ENTITYID_NORMAL_USER_GROUP_WRITER (0x0c)
572 #define ENTITYID_NORMAL_USER_GROUP_READER (0x0d)
573 #define ENTITYID_NORMAL_USER_CST_GROUP_READER (0x0e)
576 /* Secure DDS */
577 #define ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER (0x000201c3)
578 #define ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER (0x000201c4)
579 #define ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER (0xff0003c2)
580 #define ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER (0xff0003c7)
581 #define ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER (0xff0004c2)
582 #define ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER (0xff0004c7)
583 #define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER (0xff0200c2)
584 #define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER (0xff0200c7)
585 #define ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER (0xff0202c3)
586 #define ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER (0xff0202c4)
587 #define ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER (0xff0101c2)
588 #define ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER (0xff0101c7)
590 /* Vendor-specific: RTI */
591 #define ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER (0x00020082)
592 #define ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER (0x00020087)
593 #define ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER (0x00020182)
594 #define ENTITYID_RTI_BUILTIN_LOCATOR_PING_READER (0x00020187)
596 /* Deprecated EntityId */
597 #define ENTITYID_APPLICATIONS_WRITER (0x000001c2)
598 #define ENTITYID_APPLICATIONS_READER (0x000001c7)
599 #define ENTITYID_CLIENTS_WRITER (0x000005c2)
600 #define ENTITYID_CLIENTS_READER (0x000005c7)
601 #define ENTITYID_SERVICES_WRITER (0x000006c2)
602 #define ENTITYID_SERVICES_READER (0x000006c7)
603 #define ENTITYID_MANAGERS_WRITER (0x000007c2)
604 #define ENTITYID_MANAGERS_READER (0x000007c7)
605 #define ENTITYID_APPLICATION_SELF (0x000008c1)
606 #define ENTITYID_APPLICATION_SELF_WRITER (0x000008c2)
607 #define ENTITYID_APPLICATION_SELF_READER (0x000008c7)
609 /* Predefined Entity Kind */
610 #define ENTITYKIND_APPDEF_UNKNOWN (0x00)
611 #define ENTITYKIND_APPDEF_PARTICIPANT (0x01)
612 #define ENTITYKIND_APPDEF_WRITER_WITH_KEY (0x02)
613 #define ENTITYKIND_APPDEF_WRITER_NO_KEY (0x03)
614 #define ENTITYKIND_APPDEF_READER_NO_KEY (0x04)
615 #define ENTITYKIND_APPDEF_READER_WITH_KEY (0x07)
616 #define ENTITYKIND_BUILTIN_PARTICIPANT (0xc1)
617 #define ENTITYKIND_BUILTIN_WRITER_WITH_KEY (0xc2)
618 #define ENTITYKIND_BUILTIN_WRITER_NO_KEY (0xc3)
619 #define ENTITYKIND_BUILTIN_READER_NO_KEY (0xc4)
620 #define ENTITYKIND_BUILTIN_READER_WITH_KEY (0xc7)
622 /* vendor specific RTI */
623 #define ENTITYKIND_RTI_BUILTIN_WRITER_WITH_KEY (0x82)
624 #define ENTITYKIND_RTI_BUILTIN_WRITER_NO_KEY (0x83)
625 #define ENTITYKIND_RTI_BUILTIN_READER_NO_KEY (0x84)
626 #define ENTITYKIND_RTI_BUILTIN_READER_WITH_KEY (0x87)
628 /* Submessage Type */
629 #define SUBMESSAGE_HEADER_EXTENSION (0x0)
630 #define SUBMESSAGE_PAD (0x01)
631 #define SUBMESSAGE_DATA (0x02)
632 #define SUBMESSAGE_NOKEY_DATA (0x03)
633 #define SUBMESSAGE_ACKNACK (0x06)
634 #define SUBMESSAGE_HEARTBEAT (0x07)
635 #define SUBMESSAGE_GAP (0x08)
636 #define SUBMESSAGE_INFO_TS (0x09)
637 #define SUBMESSAGE_INFO_SRC (0x0c)
638 #define SUBMESSAGE_INFO_REPLY_IP4 (0x0d)
639 #define SUBMESSAGE_INFO_DST (0x0e)
640 #define SUBMESSAGE_INFO_REPLY (0x0f)
642 #define SUBMESSAGE_DATA_FRAG (0x10) /* RTPS 2.0 Only */
643 #define SUBMESSAGE_NOKEY_DATA_FRAG (0x11) /* RTPS 2.0 Only */
644 #define SUBMESSAGE_NACK_FRAG (0x12) /* RTPS 2.0 Only */
645 #define SUBMESSAGE_HEARTBEAT_FRAG (0x13) /* RTPS 2.0 Only */
647 #define SUBMESSAGE_RTPS_DATA_SESSION (0x14) /* RTPS 2.1 only */
648 #define SUBMESSAGE_RTPS_DATA (0x15) /* RTPS 2.1 only */
649 #define SUBMESSAGE_RTPS_DATA_FRAG (0x16) /* RTPS 2.1 only */
650 #define SUBMESSAGE_ACKNACK_BATCH (0x17) /* RTPS 2.1 only */
651 #define SUBMESSAGE_RTPS_DATA_BATCH (0x18) /* RTPS 2.1 Only */
652 #define SUBMESSAGE_HEARTBEAT_BATCH (0x19) /* RTPS 2.1 only */
653 #define SUBMESSAGE_ACKNACK_SESSION (0x1a) /* RTPS 2.1 only */
654 #define SUBMESSAGE_HEARTBEAT_SESSION (0x1b) /* RTPS 2.1 only */
655 #define SUBMESSAGE_APP_ACK (0x1c)
656 #define SUBMESSAGE_APP_ACK_CONF (0x1d)
657 #define SUBMESSAGE_HEARTBEAT_VIRTUAL (0x1e)
658 #define SUBMESSAGE_SEC_BODY (0x30)
659 #define SUBMESSAGE_SEC_PREFIX (0x31)
660 #define SUBMESSAGE_SEC_POSTFIX (0x32)
661 #define SUBMESSAGE_SRTPS_PREFIX (0x33)
662 #define SUBMESSAGE_SRTPS_POSTFIX (0x34)
663 #define SUBMESSAGE_RTI_CRC (0x80)
664 #define SUBMESSAGE_RTI_DATA_FRAG_SESSION (0x81) /* Vendor Specific */
665 #define SUBMESSAGE_RTI_UDP_WAN_BINDING_PING (0x82)
668 /* An invalid IP Address:
669 * Make sure the _STRING macro is bigger than a normal IP
671 #define IPADDRESS_INVALID (0)
672 #define IPADDRESS_INVALID_STRING "ADDRESS_INVALID"
674 /* Identifies the value of an invalid port number:
675 * Make sure the _STRING macro is bigger than a normal port
677 #define PORT_INVALID (0)
678 #define PORT_INVALID_STRING "PORT_INVALID"
680 /* Protocol Vendor Information (uint16_t) as per July 2020 */
681 #define RTPS_VENDOR_UNKNOWN (0x0000)
682 #define RTPS_VENDOR_UNKNOWN_STRING "VENDOR_ID_UNKNOWN (0x0000)"
683 #define RTPS_VENDOR_RTI_DDS (0x0101)
684 #define RTPS_VENDOR_RTI_DDS_STRING "Real-Time Innovations, Inc. - Connext DDS"
685 #define RTPS_VENDOR_ADL_DDS (0x0102)
686 #define RTPS_VENDOR_ADL_DDS_STRING "ADLink Ltd. - OpenSplice DDS"
687 #define RTPS_VENDOR_OCI (0x0103)
688 #define RTPS_VENDOR_OCI_STRING "Object Computing, Inc. (OCI) - OpenDDS"
689 #define RTPS_VENDOR_MILSOFT (0x0104)
690 #define RTPS_VENDOR_MILSOFT_STRING "MilSoft"
691 #define RTPS_VENDOR_KONGSBERG (0x0105)
692 #define RTPS_VENDOR_KONGSBERG_STRING "Kongsberg - InterCOM DDS"
693 #define RTPS_VENDOR_TOC (0x0106)
694 #define RTPS_VENDOR_TOC_STRING "TwinOaks Computing, Inc. - CoreDX DDS"
695 #define RTPS_VENDOR_LAKOTA_TSI (0x0107)
696 #define RTPS_VENDOR_LAKOTA_TSI_STRING "Lakota Technical Solutions, Inc."
697 #define RTPS_VENDOR_ICOUP (0x0108)
698 #define RTPS_VENDOR_ICOUP_STRING "ICOUP Consulting"
699 #define RTPS_VENDOR_ETRI (0x0109)
700 #define RTPS_VENDOR_ETRI_STRING "Electronics and Telecommunication Research Institute (ETRI) - Diamond DDS"
701 #define RTPS_VENDOR_RTI_DDS_MICRO (0x010A)
702 #define RTPS_VENDOR_RTI_DDS_MICRO_STRING "Real-Time Innovations, Inc. (RTI) - Connext DDS Micro"
703 #define RTPS_VENDOR_ADL_CAFE (0x010B)
704 #define RTPS_VENDOR_ADL_CAFE_STRING "ADLink Ltd. - Vortex Cafe"
705 #define RTPS_VENDOR_PT (0x010C)
706 #define RTPS_VENDOR_PT_STRING "PrismTech"
707 #define RTPS_VENDOR_ADL_LITE (0x010D)
708 #define RTPS_VENDOR_ADL_LITE_STRING "ADLink Ltd. - Vortex Lite"
709 #define RTPS_VENDOR_TECHNICOLOR (0x010E)
710 #define RTPS_VENDOR_TECHNICOLOR_STRING "Technicolor Inc. - Qeo"
711 #define RTPS_VENDOR_EPROSIMA (0x010F)
712 #define RTPS_VENDOR_EPROSIMA_STRING "eProsima - Fast-RTPS"
713 #define RTPS_VENDOR_ECLIPSE (0x0110)
714 #define RTPS_VENDOR_ECLIPSE_STRING "Eclipse Foundation - Cyclone DDS"
715 #define RTPS_VENDOR_GURUM (0x0111)
716 #define RTPS_VENDOR_GURUM_STRING "GurumNetworks Ltd. - GurumDDS"
717 #define RTPS_VENDOR_RUST (0x0112)
718 #define RTPS_VENDOR_RUST_STRING "Atostek - RustDDS"
719 #define RTPS_VENDOR_ZRDDS (0x0113)
720 #define RTPS_VENDOR_ZRDDS_STRING "Nanjing Zhenrong Software Technology Co. - ZRDDS"
721 #define RTPS_VENDOR_DUST (0x0114)
722 #define RTPS_VENDOR_DUST_STRING "S2E Software Systems B.V. - Dust DDS"
725 /* Data encapsulation */
726 #define ENCAPSULATION_CDR_BE (0x0000)
727 #define ENCAPSULATION_CDR_LE (0x0001)
728 #define ENCAPSULATION_PL_CDR_BE (0x0002)
729 #define ENCAPSULATION_PL_CDR_LE (0x0003)
730 #define ENCAPSULATION_CDR2_BE (0x0006)
731 #define ENCAPSULATION_CDR2_LE (0x0007)
732 #define ENCAPSULATION_D_CDR2_BE (0x0008)
733 #define ENCAPSULATION_D_CDR2_LE (0x0009)
734 #define ENCAPSULATION_PL_CDR2_BE (0x000a)
735 #define ENCAPSULATION_PL_CDR2_LE (0x000b)
736 #define ENCAPSULATION_SHMEM_REF_PLAIN (0xC000)
737 #define ENCAPSULATION_SHMEM_REF_FLAT_DATA (0xC001)
739 /* Data encapsulation options */
740 #define ENCAPSULATION_OPTIONS_COMPRESSION_BYTES_MASK (0x1C)
741 #define GET_ENCAPSULATION_COMPRESSION_OPTIONS(encapsulation_options_in, compression_options_out) \
742 (compression_options_out = (((encapsulation_options_in) & (ENCAPSULATION_OPTIONS_COMPRESSION_BYTES_MASK)) >> 2))
743 #define ENCAPSULATION_OPTIONS_COMPRESSION_EXTENDED_HEADER_VALUE ENCAPSULATION_OPTIONS_COMPRESSION_BYTES_MASK
744 #define ENCAPSULATION_OPTIONS_COMPRESSION_PADDING_BYTES_MASK (0x3)
747 /* Parameter Liveliness */
748 #define LIVELINESS_AUTOMATIC (0)
749 #define LIVELINESS_BY_PARTICIPANT (1)
750 #define LIVELINESS_BY_TOPIC (2)
752 /* Parameter Durability */
753 #define DURABILITY_VOLATILE (0)
754 #define DURABILITY_TRANSIENT_LOCAL (1)
755 #define DURABILITY_TRANSIENT (2)
756 #define DURABILITY_PERSISTENT (3)
758 /* Parameter Ownership */
759 #define OWNERSHIP_SHARED (0)
760 #define OWNERSHIP_EXCLUSIVE (1)
762 /* Parameter Presentation */
763 #define PRESENTATION_INSTANCE (0)
764 #define PRESENTATION_TOPIC (1)
765 #define PRESENTATION_GROUP (2)
767 #define LOCATOR_KIND_INVALID (-1)
768 #define LOCATOR_KIND_RESERVED (0)
769 #define LOCATOR_KIND_UDPV4 (1)
770 #define LOCATOR_KIND_UDPV6 (2)
771 /* Vendor specific - rti */
772 #define LOCATOR_KIND_DTLS (6)
773 #define LOCATOR_KIND_TCPV4_LAN (8)
774 #define LOCATOR_KIND_TCPV4_WAN (9)
775 #define LOCATOR_KIND_TLSV4_LAN (10)
776 #define LOCATOR_KIND_TLSV4_WAN (11)
777 #define LOCATOR_KIND_SHMEM (0x01000000)
778 #define LOCATOR_KIND_TUDPV4 (0x01001001)
779 #define LOCATOR_KIND_UDPV4_WAN (0x01000001)
781 /* History Kind */
782 #define HISTORY_KIND_KEEP_LAST (0)
783 #define HISTORY_KIND_KEEP_ALL (1)
785 /* Reliability Values */
786 #define RELIABILITY_BEST_EFFORT (1)
787 #define RELIABILITY_RELIABLE (2)
789 /* Destination Order */
790 #define BY_RECEPTION_TIMESTAMP (0)
791 #define BY_SOURCE_TIMESTAMP (1)
793 /* Member flags */
794 #define MEMBER_IS_KEY (1)
795 #define MEMBER_OPTIONAL (2)
796 #define MEMBER_SHAREABLE (4)
797 #define MEMBER_UNION_DEFAULT (8)
798 /* Participant message data kind */
799 #define PARTICIPANT_MESSAGE_DATA_KIND_UNKNOWN (0x00000000)
800 #define PARTICIPANT_MESSAGE_DATA_KIND_AUTOMATIC_LIVELINESS_UPDATE (0x00000001)
801 #define PARTICIPANT_MESSAGE_DATA_KIND_MANUAL_LIVELINESS_UPDATE (0x00000002)
803 /* Type Consistency Kinds */
804 #define DISALLOW_TYPE_COERCION (0)
805 #define ALLOW_TYPE_COERCION (1)
807 /* Ack kind */
808 #define PROTOCOL_ACKNOWLEDGMENT (0)
809 #define APPLICATION_AUTO_ACKNOWLEDGMENT (1)
810 #define APPLICATION_ORDERED_ACKNOWLEDGMENT (2)
811 #define APPLICATION_EXPLICIT_ACKNOWLEDGMENT (3)
813 #define CRYPTO_TRANSFORMATION_KIND_NONE (0)
814 #define CRYPTO_TRANSFORMATION_KIND_AES128_GMAC (1)
815 #define CRYPTO_TRANSFORMATION_KIND_AES128_GCM (2)
816 #define CRYPTO_TRANSFORMATION_KIND_AES256_GMAC (3)
817 #define CRYPTO_TRANSFORMATION_KIND_AES256_GCM (4)
819 #define SECURITY_SYMMETRIC_CIPHER_BIT_AES128_GCM 0x00000001
820 #define SECURITY_SYMMETRIC_CIPHER_BIT_AES256_GCM 0x00000002
821 #define SECURITY_SYMMETRIC_CIPHER_BIT_CUSTOM_ALGORITHM 0x40000000
823 #define SECURITY_DIGITAL_SIGNATURE_BIT_RSASSAPSSMGF1SHA256_2048_SHA256 0x00000001
824 #define SECURITY_DIGITAL_SIGNATURE_BIT_RSASSAPKCS1V15_2048_SHA256 0x00000002
825 #define SECURITY_DIGITAL_SIGNATURE_BIT_ECDSA_P256_SHA256 0x00000004
826 #define SECURITY_DIGITAL_SIGNATURE_BIT_ECDSA_P384_SHA384 0x00000008
827 #define SECURITY_DIGITAL_SIGNATURE_BIT_CUSTOM_ALGORITHM 0x40000000
829 #define SECURITY_KEY_ESTABLISHMENT_BIT_DHE_MODP2048256 0x00000001
830 #define SECURITY_KEY_ESTABLISHMENT_BIT_ECDHECEUM_P256 0x00000002
831 #define SECURITY_KEY_ESTABLISHMENT_BIT_ECDHECEUM_P384 0x00000004
832 #define SECURITY_KEY_ESTABLISHMENT_BIT_CUSTOM_ALGORITHM 0x40000000
834 #define SECURITY_ALGORITHM_BIT_COMPATIBILITY_MODE 0x80000000
836 #define TOPIC_INFO_ADD_GUID (0x01)
837 #define TOPIC_INFO_ADD_TYPE_NAME (0x02)
838 #define TOPIC_INFO_ADD_TOPIC_NAME (0x04)
839 #define TOPIC_INFO_ALL_SET (0x07)
841 #define NOT_A_FRAGMENT (-1)
843 /* */
844 #define RTI_OSAPI_COMPRESSION_CLASS_ID_NONE (0)
845 #define RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB (1)
846 #define RTI_OSAPI_COMPRESSION_CLASS_ID_BZIP2 (2)
847 #define RTI_OSAPI_COMPRESSION_CLASS_ID_LZ4 (4)
848 #define RTI_OSAPI_COMPRESSION_CLASS_ID_AUTO (UINT32_MAX)
850 /* VENDOR_BUILTIN_ENDPOINT_SET FLAGS */
851 #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_WRITER (0x00000001U << 7)
852 #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_READER (0x00000001U << 8)
853 #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_SECURE_WRITER (0x00000001U << 9)
854 #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_SECURE_READER (0x00000001U << 10)
855 #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_PERIODIC_WRITER (0x00000001U << 11)
856 #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_PERIODIC_READER (0x00000001U << 12)
857 #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_EVENT_WRITER (0x00000001U << 13)
858 #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_EVENT_READER (0x00000001U << 14)
859 #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_LOGGING_WRITER (0x00000001U << 15)
860 #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_LOGGING_READER (0x00000001U << 16)
861 #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_BOOTSTRAP_WRITER (0x00000001U << 17)
862 #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_BOOTSTRAP_READER (0x00000001U << 18)
864 static int hf_rtps_dissection_boolean;
865 static int hf_rtps_dissection_byte;
866 static int hf_rtps_dissection_int16;
867 static int hf_rtps_dissection_uint16;
868 static int hf_rtps_dissection_int32;
869 static int hf_rtps_dissection_uint32;
870 static int hf_rtps_dissection_int64;
871 static int hf_rtps_dissection_uint64;
872 static int hf_rtps_dissection_float;
873 static int hf_rtps_dissection_double;
874 static int hf_rtps_dissection_int128;
875 static int hf_rtps_dissection_string;
877 static const char *const SM_EXTRA_RPLUS = "(r+)";
878 static const char *const SM_EXTRA_RMINUS = "(r-)";
879 static const char *const SM_EXTRA_WPLUS = "(w+)";
880 static const char *const SM_EXTRA_WMINUS = "(w-)";
881 static const char *const SM_EXTRA_PPLUS = "(p+)";
882 static const char *const SM_EXTRA_PMINUS = "(p-)";
883 static const char *const SM_EXTRA_TPLUS = "(t+)";
884 static const char *const SM_EXTRA_TMINUS = "(t-)";
886 /***************************************************************************/
887 /* Protocol Fields Identifiers */
888 static int proto_rtps;
889 static int hf_rtps_magic;
890 static int hf_rtps_ping;
891 static int hf_rtps_protocol_version;
892 static int hf_rtps_protocol_version_major;
893 static int hf_rtps_protocol_version_minor;
894 static int hf_rtps_vendor_id;
896 static int hf_rtps_domain_id;
897 static int hf_rtps_domain_tag;
898 static int hf_rtps_participant_idx;
899 static int hf_rtps_nature_type;
901 static int hf_rtps_guid_prefix_v1;
902 static int hf_rtps_guid_prefix;
903 static int hf_rtps_guid_prefix_src;
904 static int hf_rtps_guid_prefix_dst;
905 static int hf_rtps_host_id;
906 static int hf_rtps_app_id;
907 static int hf_rtps_app_id_instance_id;
908 static int hf_rtps_app_id_app_kind;
910 static int hf_rtps_sm_id;
911 static int hf_rtps_sm_idv2;
912 static int hf_rtps_sm_flags;
913 static int hf_rtps_sm_flags2;
914 static int hf_rtps_sm_octets_to_next_header;
915 static int hf_rtps_sm_guid_prefix_v1;
916 static int hf_rtps_sm_guid_prefix;
917 static int hf_rtps_sm_host_id;
918 static int hf_rtps_sm_app_id;
919 static int hf_rtps_sm_instance_id_v1;
920 static int hf_rtps_sm_app_kind;
921 static int hf_rtps_sm_instance_id;
922 static int hf_rtps_sm_entity_id;
923 static int hf_rtps_sm_entity_id_key;
924 static int hf_rtps_sm_entity_id_kind;
925 static int hf_rtps_sm_rdentity_id;
926 static int hf_rtps_sm_rdentity_id_key;
927 static int hf_rtps_sm_rdentity_id_kind;
928 static int hf_rtps_sm_wrentity_id;
929 static int hf_rtps_sm_wrentity_id_key;
930 static int hf_rtps_sm_wrentity_id_kind;
931 static int hf_rtps_sm_seq_number;
933 static int hf_rtps_info_src_ip;
934 static int hf_rtps_info_src_unused;
936 static int hf_rtps_parameter_id;
937 static int hf_rtps_parameter_id_v2;
938 static int hf_rtps_parameter_id_inline_rti;
939 static int hf_rtps_parameter_id_toc;
940 static int hf_rtps_parameter_id_rti;
941 static int hf_rtps_parameter_id_adl;
942 static int hf_rtps_parameter_length;
943 static int hf_rtps_string_length;
944 static int hf_rtps_coherent_set_start;
945 static int hf_rtps_coherent_set_end;
946 static int hf_rtps_param_topic_name;
947 static int hf_rtps_param_strength;
948 static int hf_rtps_param_type_name;
949 static int hf_rtps_param_user_data;
950 static int hf_rtps_param_group_data;
951 static int hf_rtps_param_topic_data;
952 static int hf_rtps_param_content_filter_topic_name;
953 static int hf_rtps_param_related_topic_name;
954 static int hf_rtps_param_filter_class_name;
955 static int hf_rtps_issue_data;
956 static int hf_rtps_durability_service_cleanup_delay;
957 static int hf_rtps_liveliness_lease_duration;
958 static int hf_rtps_participant_lease_duration;
959 static int hf_rtps_time_based_filter_minimum_separation;
960 static int hf_rtps_reliability_max_blocking_time;
961 static int hf_rtps_deadline_period;
962 static int hf_rtps_latency_budget_duration;
963 static int hf_rtps_lifespan_duration;
964 static int hf_rtps_persistence;
965 static int hf_rtps_info_ts_timestamp;
966 static int hf_rtps_timestamp;
967 static int hf_rtps_locator_kind;
968 static int hf_rtps_locator_port;
969 /* static int hf_rtps_logical_port; */
970 static int hf_rtps_locator_public_address_port;
971 static int hf_rtps_locator_ipv4;
972 static int hf_rtps_locator_ipv6;
973 static int hf_rtps_participant_builtin_endpoints;
974 static int hf_rtps_participant_manual_liveliness_count;
975 static int hf_rtps_history_depth;
976 static int hf_rtps_resource_limit_max_samples;
977 static int hf_rtps_resource_limit_max_instances;
978 static int hf_rtps_resource_limit_max_samples_per_instances;
979 static int hf_rtps_filter_bitmap;
980 static int hf_rtps_type_checksum;
981 static int hf_rtps_queue_size;
982 static int hf_rtps_acknack_count;
983 static int hf_rtps_durability_service_history_kind;
984 static int hf_rtps_durability_service_history_depth;
985 static int hf_rtps_durability_service_max_samples;
986 static int hf_rtps_durability_service_max_instances;
987 static int hf_rtps_durability_service_max_samples_per_instances;
988 static int hf_rtps_liveliness_kind;
989 static int hf_rtps_manager_key;
990 static int hf_rtps_locator_udp_v4;
991 static int hf_rtps_locator_udp_v4_port;
992 static int hf_param_ip_address;
993 static int hf_rtps_param_port;
994 static int hf_rtps_expects_inline_qos;
995 static int hf_rtps_presentation_coherent_access;
996 static int hf_rtps_presentation_ordered_access;
997 static int hf_rtps_expects_ack;
998 static int hf_rtps_reliability_kind;
999 static int hf_rtps_durability;
1000 static int hf_rtps_ownership;
1001 static int hf_rtps_presentation_access_scope;
1002 static int hf_rtps_destination_order;
1003 static int hf_rtps_history_kind;
1004 static int hf_rtps_data_status_info;
1005 static int hf_rtps_param_serialize_encap_kind;
1006 static int hf_rtps_param_serialize_encap_len;
1007 static int hf_rtps_param_transport_priority;
1008 static int hf_rtps_param_type_max_size_serialized;
1009 static int hf_rtps_param_entity_name;
1010 static int hf_rtps_param_role_name;
1011 static int hf_rtps_disable_positive_ack;
1012 static int hf_rtps_participant_guid_v1;
1013 static int hf_rtps_participant_guid;
1014 static int hf_rtps_group_guid_v1;
1015 static int hf_rtps_group_guid;
1016 static int hf_rtps_endpoint_guid;
1017 static int hf_rtps_param_host_id;
1018 static int hf_rtps_param_app_id;
1019 static int hf_rtps_param_instance_id;
1020 static int hf_rtps_param_instance_id_v1;
1021 static int hf_rtps_param_app_kind;
1022 static int hf_rtps_param_entity;
1023 static int hf_rtps_param_entity_key;
1024 static int hf_rtps_param_entity_kind;
1025 static int hf_rtps_data_frag_number;
1026 static int hf_rtps_data_frag_num_fragments;
1027 static int hf_rtps_data_frag_size;
1028 static int hf_rtps_data_frag_sample_size;
1029 static int hf_rtps_nokey_data_frag_number;
1030 static int hf_rtps_nokey_data_frag_num_fragments;
1031 static int hf_rtps_nokey_data_frag_size;
1032 static int hf_rtps_nack_frag_count;
1033 static int hf_rtps_heartbeat_frag_number;
1034 static int hf_rtps_heartbeat_frag_count;
1035 static int hf_rtps_heartbeat_batch_count;
1036 static int hf_rtps_data_serialize_data;
1037 static int hf_rtps_data_batch_timestamp;
1038 static int hf_rtps_data_batch_offset_to_last_sample_sn;
1039 static int hf_rtps_data_batch_sample_count;
1040 static int hf_rtps_data_batch_offset_sn;
1041 static int hf_rtps_data_batch_octets_to_sl_encap_id;
1042 static int hf_rtps_data_batch_serialized_data_length;
1043 static int hf_rtps_data_batch_octets_to_inline_qos;
1044 static int hf_rtps_fragment_number_base64;
1045 static int hf_rtps_fragment_number_base;
1046 static int hf_rtps_fragment_number_num_bits;
1047 static int hf_rtps_bitmap_num_bits;
1048 static int hf_rtps_param_partition_num;
1049 static int hf_rtps_param_partition;
1050 static int hf_rtps_param_topic_alias_num;
1051 static int hf_rtps_param_topic_alias;
1052 static int hf_rtps_param_filter_expression;
1053 static int hf_rtps_param_expression_parameters_num;
1054 static int hf_rtps_param_expression_parameters;
1055 static int hf_rtps_locator_filter_list_num_channels;
1056 static int hf_rtps_locator_filter_list_filter_name;
1057 static int hf_rtps_locator_filter_list_filter_exp;
1058 static int hf_rtps_extra_flags;
1059 static int hf_rtps_param_builtin_endpoint_set_flags;
1060 static int hf_rtps_param_vendor_builtin_endpoint_set_flags;
1061 static int hf_rtps_param_endpoint_security_attributes;
1062 static int hf_rtps_param_plugin_promiscuity_kind;
1063 static int hf_rtps_param_service_kind;
1065 static int hf_rtps_param_sample_signature_epoch;
1066 static int hf_rtps_param_sample_signature_nonce;
1067 static int hf_rtps_param_sample_signature_length;
1068 static int hf_rtps_param_sample_signature_signature;
1069 static int hf_rtps_secure_secure_data_length;
1070 static int hf_rtps_secure_secure_data;
1071 static int hf_rtps_param_enable_authentication;
1072 static int hf_rtps_param_builtin_endpoint_qos;
1073 static int hf_rtps_secure_dataheader_transformation_kind;
1074 static int hf_rtps_secure_dataheader_transformation_key_revision_id;
1075 static int hf_rtps_secure_dataheader_transformation_key_id;
1076 static int hf_rtps_secure_dataheader_passphrase_id;
1077 static int hf_rtps_secure_dataheader_passphrase_key_id;
1078 static int hf_rtps_secure_dataheader_init_vector_suffix;
1079 static int hf_rtps_secure_dataheader_session_id;
1080 static int hf_rtps_secure_datatag_plugin_sec_tag;
1081 static int hf_rtps_secure_datatag_plugin_sec_tag_key;
1082 static int hf_rtps_secure_datatag_plugin_sec_tag_common_mac;
1083 static int hf_rtps_secure_datatag_plugin_specific_macs_len;
1084 static int hf_rtps_pgm;
1085 static int hf_rtps_pgm_dst_participant_guid;
1086 static int hf_rtps_pgm_dst_endpoint_guid;
1087 static int hf_rtps_pgm_src_endpoint_guid;
1088 static int hf_rtps_source_participant_guid;
1089 static int hf_rtps_message_identity_source_guid;
1090 static int hf_rtps_pgm_message_class_id;
1091 static int hf_rtps_pgm_data_holder_class_id;
1092 static int hf_rtps_secure_session_key;
1093 /* static int hf_rtps_pgm_data_holder_stringseq_size; */
1094 /* static int hf_rtps_pgm_data_holder_stringseq_name; */
1095 /* static int hf_rtps_pgm_data_holder_long_long; */
1097 static int hf_rtps_param_timestamp_sec;
1098 static int hf_rtps_param_timestamp_fraction;
1099 static int hf_rtps_transportInfo_classId;
1100 static int hf_rtps_transportInfo_messageSizeMax;
1101 static int hf_rtps_param_app_ack_count;
1102 static int hf_rtps_param_app_ack_virtual_writer_count;
1103 static int hf_rtps_param_app_ack_conf_virtual_writer_count;
1104 static int hf_rtps_param_app_ack_conf_count;
1105 static int hf_rtps_param_app_ack_interval_payload_length;
1106 static int hf_rtps_param_app_ack_interval_flags;
1107 static int hf_rtps_param_app_ack_interval_count;
1108 static int hf_rtps_param_app_ack_octets_to_next_virtual_writer;
1109 static int hf_rtps_expects_virtual_heartbeat;
1110 static int hf_rtps_direct_communication;
1111 static int hf_rtps_param_peer_host_epoch;
1112 static int hf_rtps_param_endpoint_property_change_epoch;
1113 static int hf_rtps_virtual_heartbeat_count;
1114 static int hf_rtps_virtual_heartbeat_num_virtual_guids;
1115 static int hf_rtps_virtual_heartbeat_num_writers;
1116 static int hf_rtps_param_extended_parameter;
1117 static int hf_rtps_param_extended_pid_length;
1118 static int hf_rtps_param_type_consistency_kind;
1119 static int hf_rtps_param_data_representation;
1120 static int hf_rtps_param_ignore_sequence_bounds;
1121 static int hf_rtps_param_ignore_string_bounds;
1122 static int hf_rtps_param_ignore_member_names;
1123 static int hf_rtps_param_prevent_type_widening;
1124 static int hf_rtps_param_force_type_validation;
1125 static int hf_rtps_param_ignore_enum_literal_names;
1126 static int hf_rtps_parameter_data;
1127 static int hf_rtps_param_product_version_major;
1128 static int hf_rtps_param_product_version_minor;
1129 static int hf_rtps_param_product_version_release;
1130 static int hf_rtps_param_product_version_release_as_char;
1131 static int hf_rtps_param_product_version_revision;
1132 static int hf_rtps_param_acknowledgment_kind;
1133 static int hf_rtps_param_topic_query_publication_enable;
1134 static int hf_rtps_param_topic_query_publication_sessions;
1136 static int hf_rtps_srm;
1137 static int hf_rtps_srm_service_id;
1138 static int hf_rtps_srm_request_body;
1139 static int hf_rtps_srm_instance_id;
1140 static int hf_rtps_topic_query_selection_filter_class_name;
1141 static int hf_rtps_topic_query_selection_filter_expression;
1142 static int hf_rtps_topic_query_selection_num_parameters;
1143 static int hf_rtps_topic_query_selection_filter_parameter;
1144 static int hf_rtps_topic_query_topic_name;
1145 static int hf_rtps_topic_query_original_related_reader_guid;
1147 static int hf_rtps_encapsulation_id;
1148 static int hf_rtps_encapsulation_kind;
1149 static int hf_rtps_octets_to_inline_qos;
1150 static int hf_rtps_filter_signature;
1151 static int hf_rtps_bitmap;
1152 static int hf_rtps_acknack_analysis;
1153 static int hf_rtps_property_name;
1154 static int hf_rtps_property_value;
1155 static int hf_rtps_union;
1156 static int hf_rtps_union_case;
1157 static int hf_rtps_struct;
1158 static int hf_rtps_member_name;
1159 static int hf_rtps_sequence;
1160 static int hf_rtps_array;
1161 static int hf_rtps_bitfield;
1162 static int hf_rtps_datatype;
1163 static int hf_rtps_sequence_size;
1164 static int hf_rtps_guid;
1165 static int hf_rtps_heartbeat_count;
1166 static int hf_rtps_encapsulation_options;
1167 static int hf_rtps_serialized_key;
1168 static int hf_rtps_serialized_data;
1169 static int hf_rtps_type_object_type_id_disc;
1170 static int hf_rtps_type_object_type_id;
1171 static int hf_rtps_type_object_primitive_type_id;
1172 static int hf_rtps_type_object_base_type;
1173 static int hf_rtps_type_object_base_primitive_type_id;
1174 static int hf_rtps_type_object_element_raw;
1175 static int hf_rtps_type_object_type_property_name;
1176 static int hf_rtps_type_object_flags;
1177 static int hf_rtps_type_object_member_id;
1178 static int hf_rtps_type_object_annotation_value_d;
1179 static int hf_rtps_type_object_annotation_value_16;
1180 static int hf_rtps_type_object_union_label;
1181 static int hf_rtps_type_object_bound;
1182 static int hf_rtps_type_object_enum_constant_name;
1183 static int hf_rtps_type_object_enum_constant_value;
1184 static int hf_rtps_type_object_element_shared;
1185 static int hf_rtps_type_object_name;
1186 static int hf_rtps_type_object_element_module_name;
1187 static int hf_rtps_uncompressed_serialized_length;
1188 static int hf_rtps_compression_plugin_class_id;
1189 static int hf_rtps_compressed_serialized_type_object;
1190 static int hf_rtps_pl_cdr_member;
1191 static int hf_rtps_pl_cdr_member_id;
1192 static int hf_rtps_pl_cdr_member_length;
1193 static int hf_rtps_pl_cdr_member_id_ext;
1194 static int hf_rtps_pl_cdr_member_length_ext;
1195 static int hf_rtps_dcps_publication_data_frame_number;
1196 static int hf_rtps_udpv4_wan_locator_flags;
1197 static int hf_rtps_uuid;
1198 static int hf_rtps_udpv4_wan_locator_public_ip;
1199 static int hf_rtps_udpv4_wan_locator_public_port;
1200 static int hf_rtps_udpv4_wan_locator_local_ip;
1201 static int hf_rtps_udpv4_wan_locator_local_port;
1202 static int hf_rtps_udpv4_wan_binding_ping_port;
1203 static int hf_rtps_udpv4_wan_binding_ping_flags;
1204 static int hf_rtps_long_address;
1205 static int hf_rtps_param_group_coherent_set;
1206 static int hf_rtps_param_end_group_coherent_set;
1207 static int hf_rtps_param_mig_end_coherent_set_sample_count;
1208 static int hf_rtps_encapsulation_options_compression_plugin_class_id;
1209 static int hf_rtps_padding_bytes;
1210 static int hf_rtps_topic_query_selection_kind;
1211 static int hf_rtps_data_session_intermediate;
1213 /* Flag bits */
1214 static int hf_rtps_flag_reserved80;
1215 static int hf_rtps_flag_reserved40;
1216 static int hf_rtps_flag_reserved20;
1217 static int hf_rtps_flag_reserved10;
1218 static int hf_rtps_flag_reserved08;
1219 static int hf_rtps_flag_reserved04;
1220 static int hf_rtps_flag_reserved02;
1221 static int hf_rtps_flag_reserved8000;
1222 static int hf_rtps_flag_reserved4000;
1223 static int hf_rtps_flag_reserved2000;
1224 static int hf_rtps_flag_reserved1000;
1225 static int hf_rtps_flag_reserved0800;
1226 static int hf_rtps_flag_reserved0400;
1227 static int hf_rtps_flag_reserved0200;
1228 static int hf_rtps_flag_reserved0100;
1229 static int hf_rtps_flag_reserved0080;
1230 static int hf_rtps_flag_reserved0040;
1232 static int hf_rtps_flag_builtin_endpoint_set_reserved;
1233 static int hf_rtps_flag_unregister;
1234 static int hf_rtps_flag_inline_qos_v1;
1235 static int hf_rtps_flag_hash_key;
1236 static int hf_rtps_flag_alive;
1237 static int hf_rtps_flag_data_present_v1;
1238 static int hf_rtps_flag_multisubmessage;
1239 static int hf_rtps_flag_endianness;
1240 static int hf_rtps_flag_additional_authenticated_data;
1241 static int hf_rtps_flag_protected_with_psk;
1242 static int hf_rtps_flag_vendor_specific_content;
1243 static int hf_rtps_flag_status_info;
1244 static int hf_rtps_flag_data_present_v2;
1245 static int hf_rtps_flag_inline_qos_v2;
1246 static int hf_rtps_flag_final;
1247 static int hf_rtps_flag_hash_key_rti;
1248 static int hf_rtps_flag_liveliness;
1249 static int hf_rtps_flag_multicast;
1250 static int hf_rtps_flag_data_serialized_key;
1251 static int hf_rtps_flag_data_frag_serialized_key;
1252 static int hf_rtps_flag_timestamp;
1253 static int hf_rtps_flag_no_virtual_guids;
1254 static int hf_rtps_flag_multiple_writers;
1255 static int hf_rtps_flag_multiple_virtual_guids;
1256 static int hf_rtps_flag_serialize_key16;
1257 static int hf_rtps_flag_invalid_sample;
1258 static int hf_rtps_flag_data_present16;
1259 static int hf_rtps_flag_offsetsn_present;
1260 static int hf_rtps_flag_inline_qos16_v2;
1261 static int hf_rtps_flag_timestamp_present;
1262 static int hf_rtps_flag_unregistered;
1263 static int hf_rtps_flag_disposed;
1264 static int hf_rtps_param_status_info_flags;
1266 static int hf_rtps_flag_participant_announcer;
1267 static int hf_rtps_flag_participant_detector;
1268 static int hf_rtps_flag_publication_announcer;
1269 static int hf_rtps_flag_publication_detector;
1270 static int hf_rtps_flag_subscription_announcer;
1271 static int hf_rtps_flag_subscription_detector;
1272 static int hf_rtps_flag_participant_proxy_announcer;
1273 static int hf_rtps_flag_participant_proxy_detector;
1274 static int hf_rtps_flag_participant_state_announcer;
1275 static int hf_rtps_flag_participant_state_detector;
1276 static int hf_rtps_flag_participant_message_datawriter;
1277 static int hf_rtps_flag_participant_message_datareader;
1278 static int hf_rtps_flag_secure_publication_writer;
1279 static int hf_rtps_flag_secure_publication_reader;
1280 static int hf_rtps_flag_secure_subscription_writer;
1281 static int hf_rtps_flag_secure_subscription_reader;
1282 static int hf_rtps_flag_secure_participant_message_writer;
1283 static int hf_rtps_flag_secure_participant_message_reader;
1284 static int hf_rtps_flag_participant_stateless_message_writer;
1285 static int hf_rtps_flag_participant_stateless_message_reader;
1286 static int hf_rtps_flag_secure_participant_volatile_message_writer;
1287 static int hf_rtps_flag_secure_participant_volatile_message_reader;
1288 static int hf_rtps_flag_participant_secure_writer;
1289 static int hf_rtps_flag_participant_secure_reader;
1290 static int hf_rtps_flag_typeflag_final;
1291 static int hf_rtps_flag_typeflag_mutable;
1292 static int hf_rtps_flag_typeflag_nested;
1293 static int hf_rtps_flag_memberflag_key;
1294 static int hf_rtps_flag_memberflag_optional;
1295 static int hf_rtps_flag_memberflag_shareable;
1296 static int hf_rtps_flag_memberflag_union_default;
1297 static int hf_rtps_flag_service_request_writer;
1298 static int hf_rtps_flag_service_request_reader;
1299 static int hf_rtps_flag_locator_ping_writer;
1300 static int hf_rtps_flag_locator_ping_reader;
1301 static int hf_rtps_flag_secure_service_request_writer;
1302 static int hf_rtps_flag_cloud_discovery_service_announcer;
1303 static int hf_rtps_flag_participant_config_writer;
1304 static int hf_rtps_flag_participant_config_reader;
1305 static int hf_rtps_flag_participant_config_secure_writer;
1306 static int hf_rtps_flag_participant_config_secure_reader;
1307 static int hf_rtps_flag_participant_bootstrap_writer;
1308 static int hf_rtps_flag_participant_bootstrap_reader;
1309 static int hf_rtps_flag_monitoring_periodic_writer;
1310 static int hf_rtps_flag_monitoring_periodic_reader;
1311 static int hf_rtps_flag_monitoring_event_writer;
1312 static int hf_rtps_flag_monitoring_event_reader;
1313 static int hf_rtps_flag_monitoring_logging_writer;
1314 static int hf_rtps_flag_monitoring_logging_reader;
1315 static int hf_rtps_flag_secure_service_request_reader;
1316 static int hf_rtps_flag_security_access_protected;
1317 static int hf_rtps_flag_security_discovery_protected;
1318 static int hf_rtps_flag_security_submessage_protected;
1319 static int hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_required_mask;
1320 static int hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_key_exchange_used_bit;
1321 static int hf_rtps_param_participant_security_symmetric_cipher_algorithms_supported_mask;
1322 static int hf_rtps_flag_security_symmetric_cipher_mask_aes128_gcm;
1323 static int hf_rtps_flag_security_symmetric_cipher_mask_aes256_gcm;
1324 static int hf_rtps_flag_security_symmetric_cipher_mask_custom_algorithm;
1325 static int hf_rtps_param_compression_id_mask;
1326 static int hf_rtps_flag_compression_id_zlib;
1327 static int hf_rtps_flag_compression_id_bzip2;
1328 static int hf_rtps_flag_compression_id_lz4;
1329 static int hf_rtps_param_crypto_algorithm_requirements_trust_chain;
1330 static int hf_rtps_param_crypto_algorithm_requirements_message_auth;
1331 static int hf_rtps_flag_security_digital_signature_mask_rsassapssmgf1sha256_2048_sha256;
1332 static int hf_rtps_flag_security_digital_signature_mask_rsassapkcs1v15_2048_sha256;
1333 static int hf_rtps_flag_security_digital_signature_mask_ecdsa_p256_sha256;
1334 static int hf_rtps_flag_security_digital_signature_mask_ecdsa_p384_sha384;
1335 static int hf_rtps_flag_security_digital_signature_mask_custom_algorithm;
1336 static int hf_rtps_flag_security_key_establishment_mask_dhe_modp2048256;
1337 static int hf_rtps_flag_security_key_establishment_mask_ecdheceum_p256;
1338 static int hf_rtps_flag_security_key_establishment_mask_ecdheceum_p384;
1339 static int hf_rtps_flag_security_key_establishment_mask_custom_algorithm;
1340 static int hf_rtps_flag_security_algorithm_compatibility_mode;
1341 static int hf_rtps_flag_security_payload_protected;
1342 static int hf_rtps_flag_endpoint_security_attribute_flag_is_read_protected;
1343 static int hf_rtps_flag_endpoint_security_attribute_flag_is_write_protected;
1344 static int hf_rtps_flag_endpoint_security_attribute_flag_is_discovery_protected;
1345 static int hf_rtps_flag_endpoint_security_attribute_flag_is_submessage_protected;
1346 static int hf_rtps_flag_endpoint_security_attribute_flag_is_payload_protected;
1347 static int hf_rtps_flag_endpoint_security_attribute_flag_is_key_protected;
1348 static int hf_rtps_flag_endpoint_security_attribute_flag_is_liveliness_protected;
1349 static int hf_rtps_flag_endpoint_security_attribute_flag_is_valid;
1350 static int hf_rtps_param_endpoint_security_attributes_mask;
1351 static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_payload_encrypted;
1352 static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_key_encrypted;
1353 static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_liveliness_encrypted;
1354 static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_valid;
1355 static int hf_rtps_param_plugin_endpoint_security_attributes_mask;
1356 static int hf_rtps_flag_participant_security_attribute_flag_key_psk_protected;
1357 static int hf_rtps_flag_participant_security_attribute_flag_is_rtps_protected;
1358 static int hf_rtps_flag_participant_security_attribute_flag_is_discovery_protected;
1359 static int hf_rtps_flag_participant_security_attribute_flag_is_liveliness_protected;
1360 static int hf_rtps_flag_participant_security_attribute_flag_key_revisions_enabled;
1361 static int hf_rtps_flag_participant_security_attribute_flag_is_valid;
1362 static int hf_rtps_param_participant_security_attributes_mask;
1363 static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_psk_encrypted;
1364 static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_encrypted;
1365 static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_encrypted;
1366 static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_encrypted;
1367 static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_origin_encrypted;
1368 static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_origin_encrypted;
1369 static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_origin_encrypted;
1370 static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_valid;
1371 static int hf_rtps_param_plugin_participant_security_attributes_mask;
1372 static int hf_rtps_sm_rti_crc_number;
1373 static int hf_rtps_sm_rti_crc_result;
1374 static int hf_rtps_data_tag_name;
1375 static int hf_rtps_data_tag_value;
1376 static int hf_rtps_flag_udpv4_wan_locator_u;
1377 static int hf_rtps_flag_udpv4_wan_locator_p;
1378 static int hf_rtps_flag_udpv4_wan_locator_b;
1379 static int hf_rtps_flag_udpv4_wan_locator_r;
1380 static int hf_rtps_flag_udpv4_wan_binding_ping_e;
1381 static int hf_rtps_flag_udpv4_wan_binding_ping_l;
1382 static int hf_rtps_flag_udpv4_wan_binding_ping_b;
1383 static int hf_rtps_header_extension_flags;
1384 static int hf_rtps_flag_header_extension_message_length;
1385 static int hf_rtps_flag_header_extension_uextension;
1386 static int hf_rtps_flag_header_extension_wextension;
1387 static int hf_rtps_flag_header_extension_checksum1;
1388 static int hf_rtps_flag_header_extension_checksum2;
1389 static int hf_rtps_flag_header_extension_parameters;
1390 static int hf_rtps_flag_header_extension_timestamp;
1392 static int hf_rtps_fragments;
1393 static int hf_rtps_fragment;
1394 static int hf_rtps_fragment_overlap;
1395 static int hf_rtps_fragment_overlap_conflict;
1396 static int hf_rtps_fragment_multiple_tails;
1397 static int hf_rtps_fragment_too_long_fragment;
1398 static int hf_rtps_fragment_error;
1399 static int hf_rtps_fragment_count;
1400 static int hf_rtps_reassembled_in;
1401 static int hf_rtps_reassembled_length;
1402 static int hf_rtps_reassembled_data;
1403 static int hf_rtps_encapsulation_extended_compression_options;
1404 static int hf_rtps_message_length;
1405 static int hf_rtps_header_extension_checksum_crc32c;
1406 static int hf_rtps_header_extension_checksum_crc64;
1407 static int hf_rtps_header_extension_checksum_md5;
1408 static int hf_rtps_uextension;
1409 static int hf_rtps_wextension;
1410 static int hf_rtps_writer_group_oid;
1411 static int hf_rtps_reader_group_oid;
1412 static int hf_rtps_writer_session_id;
1414 /* Subtree identifiers */
1415 static int ett_rtps_dissection_tree;
1416 static int ett_rtps;
1417 static int ett_rtps_default_mapping;
1418 static int ett_rtps_proto_version;
1419 static int ett_rtps_submessage;
1420 static int ett_rtps_parameter_sequence;
1421 static int ett_rtps_parameter;
1422 static int ett_rtps_flags;
1423 static int ett_rtps_entity;
1424 static int ett_rtps_generic_guid;
1425 static int ett_rtps_rdentity;
1426 static int ett_rtps_wrentity;
1427 static int ett_rtps_guid_prefix;
1428 static int ett_rtps_app_id;
1429 static int ett_rtps_locator_udp_v4;
1430 static int ett_rtps_locator;
1431 static int ett_rtps_locator_list;
1432 static int ett_rtps_timestamp;
1433 static int ett_rtps_bitmap;
1434 static int ett_rtps_seq_string;
1435 static int ett_rtps_seq_ulong;
1436 static int ett_rtps_resource_limit;
1437 static int ett_rtps_durability_service;
1438 static int ett_rtps_liveliness;
1439 static int ett_rtps_manager_key;
1440 static int ett_rtps_serialized_data;
1441 static int ett_rtps_locator_filter_channel;
1442 static int ett_rtps_part_message_data;
1443 static int ett_rtps_sample_info_list;
1444 static int ett_rtps_sample_info;
1445 static int ett_rtps_sample_batch_list;
1446 static int ett_rtps_locator_filter_locator;
1447 static int ett_rtps_writer_heartbeat_virtual_list;
1448 static int ett_rtps_writer_heartbeat_virtual;
1449 static int ett_rtps_virtual_guid_heartbeat_virtual_list;
1450 static int ett_rtps_virtual_guid_heartbeat_virtual;
1451 static int ett_rtps_app_ack_virtual_writer_interval_list;
1452 static int ett_rtps_app_ack_virtual_writer_interval;
1453 static int ett_rtps_transport_info;
1454 static int ett_rtps_app_ack_virtual_writer_list;
1455 static int ett_rtps_app_ack_virtual_writer;
1456 static int ett_rtps_product_version;
1457 static int ett_rtps_property_list;
1458 static int ett_rtps_property;
1459 static int ett_rtps_topic_info;
1460 static int ett_rtps_topic_info_dw_qos;
1461 static int ett_rtps_type_object;
1462 static int ett_rtps_type_library;
1463 static int ett_rtps_type_element;
1464 static int ett_rtps_type_annotation_usage_list;
1465 static int ett_rtps_type_enum_constant;
1466 static int ett_rtps_type_bound_list;
1467 static int ett_rtps_secure_payload_tree;
1468 static int ett_rtps_secure_dataheader_tree;
1469 static int ett_rtps_secure_transformation_kind;
1470 static int ett_rtps_pgm_data;
1471 static int ett_rtps_message_identity;
1472 static int ett_rtps_related_message_identity;
1473 static int ett_rtps_data_holder_seq;
1474 static int ett_rtps_data_holder;
1475 static int ett_rtps_data_holder_properties;
1476 static int ett_rtps_property_tree;
1477 static int ett_rtps_param_header_tree;
1478 static int ett_rtps_service_request_tree;
1479 static int ett_rtps_locator_ping_tree;
1480 static int ett_rtps_locator_reachability_tree;
1481 static int ett_rtps_custom_dissection_info;
1482 static int ett_rtps_locator_list_tree;
1483 static int ett_rtps_topic_query_tree;
1484 static int ett_rtps_topic_query_selection_tree;
1485 static int ett_rtps_topic_query_filter_params_tree;
1486 static int ett_rtps_data_member;
1487 static int ett_rtps_data_tag_seq;
1488 static int ett_rtps_data_tag_item;
1489 static int ett_rtps_fragment;
1490 static int ett_rtps_fragments;
1491 static int ett_rtps_data_representation;
1492 static int ett_rtps_decompressed_type_object;
1493 static int ett_rtps_info_remaining_items;
1494 static int ett_rtps_data_encapsulation_options;
1495 static int ett_rtps_decompressed_serialized_data;
1496 static int ett_rtps_instance_transition_data;
1497 static int ett_rtps_crypto_algorithm_requirements;
1498 static int ett_rtps_decrypted_payload;
1499 static int ett_rtps_secure_postfix_tag_list_item;
1501 static expert_field ei_rtps_sm_octets_to_next_header_error;
1502 static expert_field ei_rtps_checksum_check_error;
1503 static expert_field ei_rtps_port_invalid;
1504 static expert_field ei_rtps_ip_invalid;
1505 static expert_field ei_rtps_parameter_value_invalid;
1506 static expert_field ei_rtps_extra_bytes;
1507 static expert_field ei_rtps_missing_bytes;
1508 static expert_field ei_rtps_locator_port;
1509 static expert_field ei_rtps_more_samples_available;
1510 static expert_field ei_rtps_parameter_not_decoded;
1511 static expert_field ei_rtps_sm_octets_to_next_header_not_zero;
1512 static expert_field ei_rtps_pid_type_csonsistency_invalid_size;
1513 static expert_field ei_rtps_uncompression_error;
1514 static expert_field ei_rtps_value_too_large;
1515 static expert_field ei_rtps_invalid_psk;
1516 static expert_field ei_rtps_invalid_fragment_size;
1518 /***************************************************************************/
1519 /* Value-to-String Tables */
1520 static const value_string vendor_vals[] = {
1521 { RTPS_VENDOR_UNKNOWN, RTPS_VENDOR_UNKNOWN_STRING},
1522 { RTPS_VENDOR_RTI_DDS, RTPS_VENDOR_RTI_DDS_STRING},
1523 { RTPS_VENDOR_ADL_DDS, RTPS_VENDOR_ADL_DDS_STRING},
1524 { RTPS_VENDOR_OCI, RTPS_VENDOR_OCI_STRING},
1525 { RTPS_VENDOR_MILSOFT, RTPS_VENDOR_MILSOFT_STRING},
1526 { RTPS_VENDOR_KONGSBERG, RTPS_VENDOR_KONGSBERG_STRING},
1527 { RTPS_VENDOR_TOC, RTPS_VENDOR_TOC_STRING},
1528 { RTPS_VENDOR_LAKOTA_TSI, RTPS_VENDOR_LAKOTA_TSI_STRING},
1529 { RTPS_VENDOR_ICOUP, RTPS_VENDOR_ICOUP_STRING},
1530 { RTPS_VENDOR_ETRI, RTPS_VENDOR_ETRI_STRING},
1531 { RTPS_VENDOR_RTI_DDS_MICRO, RTPS_VENDOR_RTI_DDS_MICRO_STRING},
1532 { RTPS_VENDOR_ADL_CAFE, RTPS_VENDOR_ADL_CAFE_STRING},
1533 { RTPS_VENDOR_PT, RTPS_VENDOR_PT_STRING},
1534 { RTPS_VENDOR_ADL_LITE, RTPS_VENDOR_ADL_LITE_STRING},
1535 { RTPS_VENDOR_TECHNICOLOR, RTPS_VENDOR_TECHNICOLOR_STRING},
1536 { RTPS_VENDOR_EPROSIMA, RTPS_VENDOR_EPROSIMA_STRING},
1537 { RTPS_VENDOR_ECLIPSE, RTPS_VENDOR_ECLIPSE_STRING},
1538 { RTPS_VENDOR_GURUM, RTPS_VENDOR_GURUM_STRING},
1539 { RTPS_VENDOR_RUST, RTPS_VENDOR_RUST_STRING},
1540 { RTPS_VENDOR_ZRDDS, RTPS_VENDOR_ZRDDS_STRING},
1541 { RTPS_VENDOR_DUST, RTPS_VENDOR_DUST_STRING},
1542 { 0, NULL }
1545 static const value_string entity_id_vals[] = {
1546 { ENTITYID_UNKNOWN, "ENTITYID_UNKNOWN" },
1547 { ENTITYID_PARTICIPANT, "ENTITYID_PARTICIPANT" },
1548 { ENTITYID_BUILTIN_TOPIC_WRITER, "ENTITYID_BUILTIN_TOPIC_WRITER" },
1549 { ENTITYID_BUILTIN_TOPIC_READER, "ENTITYID_BUILTIN_TOPIC_READER" },
1550 { ENTITYID_BUILTIN_PUBLICATIONS_WRITER, "ENTITYID_BUILTIN_PUBLICATIONS_WRITER" },
1551 { ENTITYID_BUILTIN_PUBLICATIONS_READER, "ENTITYID_BUILTIN_PUBLICATIONS_READER" },
1552 { ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER, "ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER" },
1553 { ENTITYID_BUILTIN_SUBSCRIPTIONS_READER, "ENTITYID_BUILTIN_SUBSCRIPTIONS_READER" },
1554 { ENTITYID_BUILTIN_PARTICIPANT_WRITER, "ENTITYID_BUILTIN_PARTICIPANT_WRITER" },
1555 { ENTITYID_BUILTIN_PARTICIPANT_READER, "ENTITYID_BUILTIN_PARTICIPANT_READER" },
1556 { ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER" },
1557 { ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER" },
1558 { ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER, "ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER" },
1559 { ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER, "ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER" },
1560 { ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER, "ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER" },
1561 { ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER, "ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER" },
1562 { ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER" },
1563 { ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER" },
1564 { ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER" },
1565 { ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER" },
1566 { ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER" },
1567 { ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER" },
1568 { ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER, "ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER"},
1569 { ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER, "ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER"},
1571 /* vendor specific - RTI */
1572 { ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER, "ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER" },
1573 { ENTITYID_RTI_BUILTIN_LOCATOR_PING_READER, "ENTITYID_RTI_BUILTIN_LOCATOR_PING_READER" },
1574 { ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER, "ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER" },
1575 { ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER, "ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER" },
1576 { ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER" },
1577 { ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER" },
1578 { ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER" },
1579 { ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER" },
1580 { ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER"},
1581 { ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER"},
1583 /* Deprecated Items */
1584 { ENTITYID_APPLICATIONS_WRITER, "writerApplications [DEPRECATED]" },
1585 { ENTITYID_APPLICATIONS_READER, "readerApplications [DEPRECATED]" },
1586 { ENTITYID_CLIENTS_WRITER, "writerClients [DEPRECATED]" },
1587 { ENTITYID_CLIENTS_READER, "readerClients [DEPRECATED]" },
1588 { ENTITYID_SERVICES_WRITER, "writerServices [DEPRECATED]" },
1589 { ENTITYID_SERVICES_READER, "readerServices [DEPRECATED]" },
1590 { ENTITYID_MANAGERS_WRITER, "writerManagers [DEPRECATED]" },
1591 { ENTITYID_MANAGERS_READER, "readerManagers [DEPRECATED]" },
1592 { ENTITYID_APPLICATION_SELF, "applicationSelf [DEPRECATED]" },
1593 { ENTITYID_APPLICATION_SELF_WRITER, "writerApplicationSelf [DEPRECATED]" },
1594 { ENTITYID_APPLICATION_SELF_READER, "readerApplicationSelf [DEPRECATED]" },
1595 { 0, NULL }
1598 static const value_string entity_kind_vals [] = {
1599 { ENTITYKIND_APPDEF_UNKNOWN, "Application-defined unknown kind" },
1600 { ENTITYKIND_APPDEF_PARTICIPANT, "Application-defined participant" },
1601 { ENTITYKIND_APPDEF_WRITER_WITH_KEY, "Application-defined writer (with key)" },
1602 { ENTITYKIND_APPDEF_WRITER_NO_KEY, "Application-defined writer (no key)" },
1603 { ENTITYKIND_APPDEF_READER_WITH_KEY, "Application-defined reader (with key)" },
1604 { ENTITYKIND_APPDEF_READER_NO_KEY, "Application-defined reader (no key)" },
1605 { ENTITYKIND_BUILTIN_PARTICIPANT, "Built-in participant" },
1606 { ENTITYKIND_BUILTIN_WRITER_WITH_KEY, "Built-in writer (with key)" },
1607 { ENTITYKIND_BUILTIN_WRITER_NO_KEY, "Built-in writer (no key)" },
1608 { ENTITYKIND_BUILTIN_READER_WITH_KEY, "Built-in reader (with key)" },
1609 { ENTITYKIND_BUILTIN_READER_NO_KEY, "Built-in reader (no key)" },
1610 { ENTITYKIND_RTI_BUILTIN_WRITER_WITH_KEY, "RTI Built-in writer (with key)" },
1611 { ENTITYKIND_RTI_BUILTIN_WRITER_NO_KEY, "RTI Built-in writer (no key)" },
1612 { ENTITYKIND_RTI_BUILTIN_READER_WITH_KEY, "RTI Built-in reader (with key)" },
1613 { ENTITYKIND_RTI_BUILTIN_READER_NO_KEY, "RTI Built-in reader (no key)" },
1614 { ENTITYID_OBJECT_NORMAL_META_WRITER_GROUP, "Object normal meta writer group" },
1615 { ENTITYID_OBJECT_NORMAL_META_READER_GROUP, "Object normal meta reader group" },
1616 { ENTITYID_OBJECT_NORMAL_META_TOPIC, "Object normal meta topic" },
1618 { ENTITYID_RESERVED_META_CST_GROUP_WRITER, "Reserved meta CST group writer" },
1619 { ENTITYID_RESERVED_META_GROUP_WRITER, "Reserved meta group writer" },
1620 { ENTITYID_RESERVED_META_GROUP_READER, "Reserved meta group reader" },
1621 { ENTITYID_RESERVED_META_CST_GROUP_READER, "Reserved meta CST group reader" },
1622 { ENTITYID_NORMAL_META_CST_GROUP_WRITER, "Normal meta CST group writer" },
1623 { ENTITYID_NORMAL_META_GROUP_WRITER, "Normal meta group writer" },
1624 { ENTITYID_NORMAL_META_GROUP_READER, "Normal meta group reader" },
1625 { ENTITYID_NORMAL_META_CST_GROUP_READER, "Normal meta CST group reader" },
1626 { ENTITYID_RESERVED_USER_CST_GROUP_WRITER, "Reserved user CST group writer" },
1627 { ENTITYID_RESERVED_USER_GROUP_WRITER, "Reserved user group writer" },
1628 { ENTITYID_RESERVED_USER_GROUP_READER, "Reserved user group reader" },
1629 { ENTITYID_RESERVED_USER_CST_GROUP_READER, "Reserved user CST group reader" },
1630 { ENTITYID_NORMAL_USER_CST_GROUP_WRITER, "Normal user CST group writer" },
1631 { ENTITYID_NORMAL_USER_GROUP_WRITER, "Normal user writer" },
1632 { ENTITYID_NORMAL_USER_GROUP_READER, "Normal user reader" },
1633 { ENTITYID_NORMAL_USER_CST_GROUP_READER, "Normal user CST group reader" },
1634 { 0, NULL }
1638 static const value_string nature_type_vals[] = {
1639 { PORT_METATRAFFIC_UNICAST, "UNICAST_METATRAFFIC"},
1640 { PORT_METATRAFFIC_MULTICAST, "MULTICAST_METATRAFFIC"},
1641 { PORT_USERTRAFFIC_UNICAST, "UNICAST_USERTRAFFIC"},
1642 { PORT_USERTRAFFIC_MULTICAST, "MULTICAST_USERTRAFFIC"},
1643 { 0, NULL }
1647 static const value_string app_kind_vals[] = {
1648 { APPKIND_UNKNOWN, "APPKIND_UNKNOWN" },
1649 { APPKIND_MANAGED_APPLICATION, "ManagedApplication" },
1650 { APPKIND_MANAGER, "Manager" },
1651 { 0, NULL }
1654 static const value_string rtps_locator_kind_vals[] = {
1655 { LOCATOR_KIND_UDPV4, "LOCATOR_KIND_UDPV4" },
1656 { LOCATOR_KIND_UDPV6, "LOCATOR_KIND_UDPV6" },
1657 { LOCATOR_KIND_INVALID, "LOCATOR_KIND_INVALID" },
1658 { LOCATOR_KIND_DTLS, "LOCATOR_KIND_DTLS" },
1659 { LOCATOR_KIND_TCPV4_LAN, "LOCATOR_KIND_TCPV4_LAN" },
1660 { LOCATOR_KIND_TCPV4_WAN, "LOCATOR_KIND_TCPV4_WAN" },
1661 { LOCATOR_KIND_TLSV4_LAN, "LOCATOR_KIND_TLSV4_LAN" },
1662 { LOCATOR_KIND_TLSV4_WAN, "LOCATOR_KIND_TLSV4_WAN" },
1663 { LOCATOR_KIND_SHMEM, "LOCATOR_KIND_SHMEM" },
1664 { LOCATOR_KIND_TUDPV4, "LOCATOR_KIND_TUDPV4" },
1665 { LOCATOR_KIND_RESERVED, "LOCATOR_KIND_RESERVED" },
1666 { LOCATOR_KIND_UDPV4_WAN, "LOCATOR_KIND_UDPV4_WAN" },
1667 { 0, NULL }
1670 static const value_string submessage_id_vals[] = {
1671 { SUBMESSAGE_PAD, "PAD" },
1672 { SUBMESSAGE_DATA, "DATA" },
1673 { SUBMESSAGE_NOKEY_DATA, "NOKEY_DATA" },
1674 { SUBMESSAGE_ACKNACK, "ACKNACK" },
1675 { SUBMESSAGE_HEARTBEAT, "HEARTBEAT" },
1676 { SUBMESSAGE_GAP, "GAP" },
1677 { SUBMESSAGE_INFO_TS, "INFO_TS" },
1678 { SUBMESSAGE_INFO_SRC, "INFO_SRC" },
1679 { SUBMESSAGE_INFO_REPLY_IP4, "INFO_REPLY_IP4" },
1680 { SUBMESSAGE_INFO_DST, "INFO_DST" },
1681 { SUBMESSAGE_INFO_REPLY, "INFO_REPLY" },
1682 { 0, NULL }
1685 static const value_string submessage_id_valsv2[] = {
1686 { SUBMESSAGE_HEADER_EXTENSION, "HEADER_EXTENSION" },
1687 { SUBMESSAGE_PAD, "PAD" },
1688 { SUBMESSAGE_RTPS_DATA, "DATA" },
1689 { SUBMESSAGE_RTPS_DATA_FRAG, "DATA_FRAG" },
1690 { SUBMESSAGE_RTI_DATA_FRAG_SESSION, "DATA_FRAG_SESSION" },
1691 { SUBMESSAGE_RTPS_DATA_BATCH, "DATA_BATCH" },
1692 { SUBMESSAGE_ACKNACK, "ACKNACK" },
1693 { SUBMESSAGE_HEARTBEAT, "HEARTBEAT" },
1694 { SUBMESSAGE_GAP, "GAP" },
1695 { SUBMESSAGE_INFO_TS, "INFO_TS" },
1696 { SUBMESSAGE_INFO_SRC, "INFO_SRC" },
1697 { SUBMESSAGE_INFO_REPLY_IP4, "INFO_REPLY_IP4" },
1698 { SUBMESSAGE_INFO_DST, "INFO_DST" },
1699 { SUBMESSAGE_INFO_REPLY, "INFO_REPLY" },
1700 { SUBMESSAGE_NACK_FRAG, "NACK_FRAG" },
1701 { SUBMESSAGE_HEARTBEAT_FRAG, "HEARTBEAT_FRAG" },
1702 { SUBMESSAGE_ACKNACK_BATCH, "ACKNACK_BATCH" },
1703 { SUBMESSAGE_HEARTBEAT_BATCH, "HEARTBEAT_BATCH" },
1704 { SUBMESSAGE_ACKNACK_SESSION, "ACKNACK_SESSION" },
1705 { SUBMESSAGE_HEARTBEAT_SESSION, "HEARTBEAT_SESSION" },
1706 { SUBMESSAGE_RTPS_DATA_SESSION, "DATA_SESSION" },
1707 { SUBMESSAGE_APP_ACK, "APP_ACK" },
1708 { SUBMESSAGE_APP_ACK_CONF, "APP_ACK_CONF" },
1709 { SUBMESSAGE_HEARTBEAT_VIRTUAL, "HEARTBEAT_VIRTUAL" },
1710 { SUBMESSAGE_SEC_BODY, "SEC_BODY" },
1711 { SUBMESSAGE_SEC_PREFIX, "SEC_PREFIX" },
1712 { SUBMESSAGE_SEC_POSTFIX, "SEC_POSTFIX" },
1713 { SUBMESSAGE_SRTPS_PREFIX, "SRTPS_PREFIX" },
1714 { SUBMESSAGE_SRTPS_POSTFIX, "SRTPS_POSTFIX" },
1715 /* Deprecated submessages */
1716 { SUBMESSAGE_DATA, "DATA_deprecated" },
1717 { SUBMESSAGE_NOKEY_DATA, "NOKEY_DATA_deprecated" },
1718 { SUBMESSAGE_DATA_FRAG, "DATA_FRAG_deprecated" },
1719 { SUBMESSAGE_NOKEY_DATA_FRAG, "NOKEY_DATA_FRAG_deprecated" },
1720 { 0, NULL }
1723 static const value_string submessage_id_rti[] = {
1724 { SUBMESSAGE_RTI_CRC, "RTI_CRC" },
1725 { SUBMESSAGE_RTI_UDP_WAN_BINDING_PING, "RTI_BINDING_PING" },
1726 { SUBMESSAGE_RTI_DATA_FRAG_SESSION, "DATA_FRAG_SESSION" },
1727 { 0, NULL }
1730 #if 0
1731 static const value_string typecode_kind_vals[] = {
1732 { RTI_CDR_TK_NULL, "(unknown)" },
1733 { RTI_CDR_TK_SHORT, "short" },
1734 { RTI_CDR_TK_LONG, "long" },
1735 { RTI_CDR_TK_USHORT, "unsigned short" },
1736 { RTI_CDR_TK_ULONG, "unsigned long" },
1737 { RTI_CDR_TK_FLOAT, "float" },
1738 { RTI_CDR_TK_DOUBLE, "double" },
1739 { RTI_CDR_TK_BOOLEAN, "boolean" },
1740 { RTI_CDR_TK_CHAR, "char" },
1741 { RTI_CDR_TK_OCTET, "octet" },
1742 { RTI_CDR_TK_STRUCT, "struct" },
1743 { RTI_CDR_TK_UNION, "union" },
1744 { RTI_CDR_TK_ENUM, "enum" },
1745 { RTI_CDR_TK_STRING, "string" },
1746 { RTI_CDR_TK_SEQUENCE, "sequence" },
1747 { RTI_CDR_TK_ARRAY, "array" },
1748 { RTI_CDR_TK_ALIAS, "alias" },
1749 { RTI_CDR_TK_LONGLONG, "long long" },
1750 { RTI_CDR_TK_ULONGLONG, "unsigned long long" },
1751 { RTI_CDR_TK_LONGDOUBLE, "long double" },
1752 { RTI_CDR_TK_WCHAR, "wchar" },
1753 { RTI_CDR_TK_WSTRING, "wstring" },
1754 { 0, NULL }
1756 #endif
1758 static const value_string parameter_id_vals[] = {
1759 { PID_PAD, "PID_PAD" },
1760 { PID_SENTINEL, "PID_SENTINEL" },
1761 { PID_USER_DATA, "PID_USER_DATA" },
1762 { PID_TOPIC_NAME, "PID_TOPIC_NAME" },
1763 { PID_TYPE_NAME, "PID_TYPE_NAME" },
1764 { PID_GROUP_DATA, "PID_GROUP_DATA" },
1765 { PID_DEADLINE, "PID_DEADLINE" },
1766 { PID_DEADLINE_OFFERED, "PID_DEADLINE_OFFERED [deprecated]" },
1767 { PID_PARTICIPANT_LEASE_DURATION, "PID_PARTICIPANT_LEASE_DURATION" },
1768 { PID_PERSISTENCE, "PID_PERSISTENCE" },
1769 { PID_TIME_BASED_FILTER, "PID_TIME_BASED_FILTER" },
1770 { PID_OWNERSHIP_STRENGTH, "PID_OWNERSHIP_STRENGTH" },
1771 { PID_TYPE_CHECKSUM, "PID_TYPE_CHECKSUM [deprecated]" },
1772 { PID_TYPE2_NAME, "PID_TYPE2_NAME [deprecated]" },
1773 { PID_TYPE2_CHECKSUM, "PID_TYPE2_CHECKSUM [deprecated]" },
1774 { PID_METATRAFFIC_MULTICAST_IPADDRESS,"PID_METATRAFFIC_MULTICAST_IPADDRESS"},
1775 { PID_DEFAULT_UNICAST_IPADDRESS, "PID_DEFAULT_UNICAST_IPADDRESS" },
1776 { PID_METATRAFFIC_UNICAST_PORT, "PID_METATRAFFIC_UNICAST_PORT" },
1777 { PID_DEFAULT_UNICAST_PORT, "PID_DEFAULT_UNICAST_PORT" },
1778 { PID_EXPECTS_ACK, "PID_EXPECTS_ACK" },
1779 { PID_MULTICAST_IPADDRESS, "PID_MULTICAST_IPADDRESS" },
1780 { PID_MANAGER_KEY, "PID_MANAGER_KEY [deprecated]" },
1781 { PID_SEND_QUEUE_SIZE, "PID_SEND_QUEUE_SIZE" },
1782 { PID_RELIABILITY_ENABLED, "PID_RELIABILITY_ENABLED" },
1783 { PID_PROTOCOL_VERSION, "PID_PROTOCOL_VERSION" },
1784 { PID_VENDOR_ID, "PID_VENDOR_ID" },
1785 { PID_VARGAPPS_SEQUENCE_NUMBER_LAST, "PID_VARGAPPS_SEQUENCE_NUMBER_LAST [deprecated]" },
1786 { PID_RECV_QUEUE_SIZE, "PID_RECV_QUEUE_SIZE [deprecated]" },
1787 { PID_RELIABILITY_OFFERED, "PID_RELIABILITY_OFFERED [deprecated]" },
1788 { PID_RELIABILITY, "PID_RELIABILITY" },
1789 { PID_LIVELINESS, "PID_LIVELINESS" },
1790 { PID_LIVELINESS_OFFERED, "PID_LIVELINESS_OFFERED [deprecated]" },
1791 { PID_DURABILITY, "PID_DURABILITY" },
1792 { PID_DURABILITY_SERVICE, "PID_DURABILITY_SERVICE" },
1793 { PID_PRESENTATION_OFFERED, "PID_PRESENTATION_OFFERED [deprecated]" },
1794 { PID_OWNERSHIP, "PID_OWNERSHIP" },
1795 { PID_OWNERSHIP_OFFERED, "PID_OWNERSHIP_OFFERED [deprecated]" },
1796 { PID_PRESENTATION, "PID_PRESENTATION" },
1797 { PID_DESTINATION_ORDER, "PID_DESTINATION_ORDER" },
1798 { PID_DESTINATION_ORDER_OFFERED, "PID_DESTINATION_ORDER_OFFERED [deprecated]" },
1799 { PID_LATENCY_BUDGET, "PID_LATENCY_BUDGET" },
1800 { PID_LATENCY_BUDGET_OFFERED, "PID_LATENCY_BUDGET_OFFERED [deprecated]" },
1801 { PID_PARTITION, "PID_PARTITION" },
1802 { PID_PARTITION_OFFERED, "PID_PARTITION_OFFERED [deprecated]" },
1803 { PID_LIFESPAN, "PID_LIFESPAN" },
1804 { PID_TOPIC_DATA, "PID_TOPIC_DATA" },
1805 { PID_UNICAST_LOCATOR, "PID_UNICAST_LOCATOR" },
1806 { PID_MULTICAST_LOCATOR, "PID_MULTICAST_LOCATOR" },
1807 { PID_DEFAULT_UNICAST_LOCATOR, "PID_DEFAULT_UNICAST_LOCATOR" },
1808 { PID_METATRAFFIC_UNICAST_LOCATOR, "PID_METATRAFFIC_UNICAST_LOCATOR" },
1809 { PID_METATRAFFIC_MULTICAST_LOCATOR, "PID_METATRAFFIC_MULTICAST_LOCATOR" },
1810 { PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT, "PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT" },
1811 { PID_HISTORY, "PID_HISTORY" },
1812 { PID_RESOURCE_LIMIT, "PID_RESOURCE_LIMIT" },
1813 { PID_METATRAFFIC_MULTICAST_PORT, "PID_METATRAFFIC_MULTICAST_PORT" },
1814 { PID_EXPECTS_INLINE_QOS, "PID_EXPECTS_INLINE_QOS" },
1815 { PID_METATRAFFIC_UNICAST_IPADDRESS, "PID_METATRAFFIC_UNICAST_IPADDRESS" },
1816 { PID_PARTICIPANT_BUILTIN_ENDPOINTS, "PID_PARTICIPANT_BUILTIN_ENDPOINTS" },
1817 { PID_CONTENT_FILTER_PROPERTY, "PID_CONTENT_FILTER_PROPERTY" },
1818 { PID_PROPERTY_LIST_OLD, "PID_PROPERTY_LIST" },
1819 { PID_FILTER_SIGNATURE, "PID_FILTER_SIGNATURE" },
1820 { PID_COHERENT_SET, "PID_COHERENT_SET" },
1821 { PID_TYPECODE, "PID_TYPECODE" },
1822 { PID_PARTICIPANT_GUID, "PID_PARTICIPANT_GUID" },
1823 { PID_PARTICIPANT_ENTITY_ID, "PID_PARTICIPANT_ENTITY_ID" },
1824 { PID_GROUP_GUID, "PID_GROUP_GUID" },
1825 { PID_GROUP_ENTITY_ID, "PID_GROUP_ENTITY_ID" },
1826 { 0, NULL }
1829 static const value_string parameter_id_inline_qos_rti[] = {
1830 { PID_RELATED_ORIGINAL_WRITER_INFO, "PID_RELATED_ORIGINAL_WRITER_INFO" },
1831 { PID_RELATED_ORIGINAL_WRITER_INFO_LEGACY, "PID_RELATED_ORIGINAL_WRITER_INFO_LEGACY" },
1832 { PID_RELATED_SOURCE_GUID, "PID_RELATED_SOURCE_GUID" },
1833 { PID_RELATED_READER_GUID, "PID_RELATED_READER_GUID" },
1834 { PID_SOURCE_GUID, "PID_SOURCE_GUID" },
1835 { PID_TOPIC_QUERY_GUID, "PID_TOPIC_QUERY_GUID" },
1836 { PID_SAMPLE_SIGNATURE, "PID_SAMPLE_SIGNATURE" },
1837 { 0, NULL }
1840 static const value_string parameter_id_v2_vals[] = {
1841 { PID_PAD, "PID_PAD" },
1842 { PID_SENTINEL, "PID_SENTINEL" },
1843 { PID_PARTICIPANT_LEASE_DURATION, "PID_PARTICIPANT_LEASE_DURATION" },
1844 { PID_TIME_BASED_FILTER, "PID_TIME_BASED_FILTER" },
1845 { PID_TOPIC_NAME, "PID_TOPIC_NAME" },
1846 { PID_OWNERSHIP_STRENGTH, "PID_OWNERSHIP_STRENGTH" },
1847 { PID_TYPE_NAME, "PID_TYPE_NAME" },
1848 { PID_METATRAFFIC_MULTICAST_IPADDRESS,"PID_METATRAFFIC_MULTICAST_IPADDRESS"},
1849 { PID_DEFAULT_UNICAST_IPADDRESS, "PID_DEFAULT_UNICAST_IPADDRESS" },
1850 { PID_METATRAFFIC_UNICAST_PORT, "PID_METATRAFFIC_UNICAST_PORT" },
1851 { PID_DEFAULT_UNICAST_PORT, "PID_DEFAULT_UNICAST_PORT" },
1852 { PID_MULTICAST_IPADDRESS, "PID_MULTICAST_IPADDRESS" },
1853 { PID_PROTOCOL_VERSION, "PID_PROTOCOL_VERSION" },
1854 { PID_VENDOR_ID, "PID_VENDOR_ID" },
1855 { PID_RELIABILITY, "PID_RELIABILITY" },
1856 { PID_LIVELINESS, "PID_LIVELINESS" },
1857 { PID_DURABILITY, "PID_DURABILITY" },
1858 { PID_DURABILITY_SERVICE, "PID_DURABILITY_SERVICE" },
1859 { PID_OWNERSHIP, "PID_OWNERSHIP" },
1860 { PID_PRESENTATION, "PID_PRESENTATION" },
1861 { PID_DEADLINE, "PID_DEADLINE" },
1862 { PID_DESTINATION_ORDER, "PID_DESTINATION_ORDER" },
1863 { PID_LATENCY_BUDGET, "PID_LATENCY_BUDGET" },
1864 { PID_PARTITION, "PID_PARTITION" },
1865 { PID_LIFESPAN, "PID_LIFESPAN" },
1866 { PID_USER_DATA, "PID_USER_DATA" },
1867 { PID_GROUP_DATA, "PID_GROUP_DATA" },
1868 { PID_TOPIC_DATA, "PID_TOPIC_DATA" },
1869 { PID_UNICAST_LOCATOR, "PID_UNICAST_LOCATOR" },
1870 { PID_MULTICAST_LOCATOR, "PID_MULTICAST_LOCATOR" },
1871 { PID_DEFAULT_UNICAST_LOCATOR, "PID_DEFAULT_UNICAST_LOCATOR" },
1872 { PID_METATRAFFIC_UNICAST_LOCATOR, "PID_METATRAFFIC_UNICAST_LOCATOR" },
1873 { PID_METATRAFFIC_MULTICAST_LOCATOR, "PID_METATRAFFIC_MULTICAST_LOCATOR" },
1874 { PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT, "PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT" },
1875 { PID_CONTENT_FILTER_PROPERTY, "PID_CONTENT_FILTER_PROPERTY" },
1876 { PID_PROPERTY_LIST, "PID_PROPERTY_LIST" },
1877 { PID_HISTORY, "PID_HISTORY" },
1878 { PID_RESOURCE_LIMIT, "PID_RESOURCE_LIMIT" },
1879 { PID_EXPECTS_INLINE_QOS, "PID_EXPECTS_INLINE_QOS" },
1880 { PID_PARTICIPANT_BUILTIN_ENDPOINTS, "PID_PARTICIPANT_BUILTIN_ENDPOINTS" },
1881 { PID_METATRAFFIC_UNICAST_IPADDRESS, "PID_METATRAFFIC_UNICAST_IPADDRESS" },
1882 { PID_METATRAFFIC_MULTICAST_PORT, "PID_METATRAFFIC_MULTICAST_PORT" },
1883 { PID_DEFAULT_MULTICAST_LOCATOR, "PID_DEFAULT_MULTICAST_LOCATOR" },
1884 { PID_TRANSPORT_PRIORITY, "PID_TRANSPORT_PRIORITY" },
1885 { PID_PARTICIPANT_GUID, "PID_PARTICIPANT_GUID" },
1886 { PID_PARTICIPANT_ENTITY_ID, "PID_PARTICIPANT_ENTITY_ID" },
1887 { PID_GROUP_GUID, "PID_GROUP_GUID" },
1888 { PID_GROUP_ENTITY_ID, "PID_GROUP_ENTITY_ID" },
1889 { PID_CONTENT_FILTER_INFO, "PID_CONTENT_FILTER_INFO" },
1890 { PID_COHERENT_SET, "PID_COHERENT_SET" },
1891 { PID_DIRECTED_WRITE, "PID_DIRECTED_WRITE" },
1892 { PID_BUILTIN_ENDPOINT_SET, "PID_BUILTIN_ENDPOINT_SET" },
1893 { PID_PROPERTY_LIST_OLD, "PID_PROPERTY_LIST" },
1894 { PID_ENDPOINT_GUID, "PID_ENDPOINT_GUID" },
1895 { PID_TYPE_MAX_SIZE_SERIALIZED, "PID_TYPE_MAX_SIZE_SERIALIZED" },
1896 { PID_ORIGINAL_WRITER_INFO, "PID_ORIGINAL_WRITER_INFO" },
1897 { PID_ENTITY_NAME, "PID_ENTITY_NAME" },
1898 { PID_KEY_HASH, "PID_KEY_HASH" },
1899 { PID_STATUS_INFO, "PID_STATUS_INFO" },
1900 { PID_DATA_REPRESENTATION, "PID_DATA_REPRESENTATION" },
1901 { PID_TYPE_CONSISTENCY, "PID_TYPE_CONSISTENCY" },
1902 { PID_BUILTIN_ENDPOINT_QOS, "PID_BUILTIN_ENDPOINT_QOS" },
1903 { PID_ENABLE_AUTHENTICATION, "PID_ENABLE_AUTHENTICATION" },
1904 { PID_RELATED_ENTITY_GUID, "PID_RELATED_ENTITY_GUID" },
1905 { PID_IDENTITY_TOKEN, "PID_IDENTITY_TOKEN" },
1906 { PID_PERMISSIONS_TOKEN, "PID_PERMISSIONS_TOKEN" },
1907 { PID_DATA_TAGS, "PID_DATA_TAGS" },
1908 { PID_ENDPOINT_SECURITY_INFO, "PID_ENDPOINT_SECURITY_INFO" },
1909 { PID_PARTICIPANT_SECURITY_INFO, "PID_PARTICIPANT_SECURITY_INFO" },
1910 { PID_PARTICIPANT_SECURITY_DIGITAL_SIGNATURE_ALGO, "PID_PARTICIPANT_SECURITY_DIGITAL_SIGNATURE_ALGO" },
1911 { PID_PARTICIPANT_SECURITY_KEY_ESTABLISHMENT_ALGO, "PID_PARTICIPANT_SECURITY_KEY_ESTABLISHMENT_ALGO" },
1912 { PID_PARTICIPANT_SECURITY_SYMMETRIC_CIPHER_ALGO, "PID_PARTICIPANT_SECURITY_SYMMETRIC_CIPHER_ALGO" },
1913 { PID_ENDPOINT_SECURITY_SYMMETRIC_CIPHER_ALGO, "PID_ENDPOINT_SECURITY_SYMMETRIC_CIPHER_ALGO" },
1914 { PID_IDENTITY_STATUS_TOKEN, "PID_IDENTITY_STATUS_TOKEN"},
1915 { PID_DOMAIN_ID, "PID_DOMAIN_ID" },
1916 { PID_DOMAIN_TAG, "PID_DOMAIN_TAG" },
1917 { PID_GROUP_COHERENT_SET, "PID_GROUP_COHERENT_SET" },
1918 { PID_END_COHERENT_SET, "PID_END_COHERENT_SET" },
1919 { PID_END_GROUP_COHERENT_SET, "PID_END_GROUP_COHERENT_SET" },
1920 { MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT, "MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT" },
1922 /* The following PID are deprecated */
1923 { PID_DEADLINE_OFFERED, "PID_DEADLINE_OFFERED [deprecated]" },
1924 { PID_PERSISTENCE, "PID_PERSISTENCE [deprecated]" },
1925 { PID_TYPE_CHECKSUM, "PID_TYPE_CHECKSUM [deprecated]" },
1926 { PID_TYPE2_NAME, "PID_TYPE2_NAME [deprecated]" },
1927 { PID_TYPE2_CHECKSUM, "PID_TYPE2_CHECKSUM [deprecated]" },
1928 { PID_EXPECTS_ACK, "PID_EXPECTS_ACK [deprecated]" },
1929 { PID_MANAGER_KEY, "PID_MANAGER_KEY [deprecated]" },
1930 { PID_SEND_QUEUE_SIZE, "PID_SEND_QUEUE_SIZE [deprecated]" },
1931 { PID_RELIABILITY_ENABLED, "PID_RELIABILITY_ENABLED [deprecated]" },
1932 { PID_VARGAPPS_SEQUENCE_NUMBER_LAST, "PID_VARGAPPS_SEQUENCE_NUMBER_LAST [deprecated]" },
1933 { PID_RECV_QUEUE_SIZE, "PID_RECV_QUEUE_SIZE [deprecated]" },
1934 { PID_RELIABILITY_OFFERED, "PID_RELIABILITY_OFFERED [deprecated]" },
1935 { PID_LIVELINESS_OFFERED, "PID_LIVELINESS_OFFERED [deprecated]" },
1936 { PID_PRESENTATION_OFFERED, "PID_PRESENTATION_OFFERED [deprecated]" },
1937 { PID_OWNERSHIP_OFFERED, "PID_OWNERSHIP_OFFERED [deprecated]" },
1938 { PID_DESTINATION_ORDER_OFFERED, "PID_DESTINATION_ORDER_OFFERED [deprecated]" },
1939 { PID_LATENCY_BUDGET_OFFERED, "PID_LATENCY_BUDGET_OFFERED [deprecated]" },
1940 { PID_PARTITION_OFFERED, "PID_PARTITION_OFFERED [deprecated]" },
1941 { PID_EXTENDED, "PID_EXTENDED" },
1942 { 0, NULL }
1945 static const value_string parameter_id_rti_vals[] = {
1946 /* Vendor specific: RTI */
1947 { PID_PRODUCT_VERSION, "PID_PRODUCT_VERSION" },
1948 { PID_PLUGIN_PROMISCUITY_KIND, "PID_PLUGIN_PROMISCUITY_KIND" },
1949 { PID_ENTITY_VIRTUAL_GUID, "PID_ENTITY_VIRTUAL_GUID" },
1950 { PID_SERVICE_KIND, "PID_SERVICE_KIND" },
1951 { PID_TYPECODE_RTPS2, "PID_TYPECODE" },
1952 { PID_DISABLE_POSITIVE_ACKS, "PID_DISABLE_POSITIVE_ACKS" },
1953 { PID_LOCATOR_FILTER_LIST, "PID_LOCATOR_FILTER_LIST" },
1954 { PID_ROLE_NAME, "PID_ROLE_NAME"},
1955 { PID_ACK_KIND, "PID_ACK_KIND" },
1956 { PID_PEER_HOST_EPOCH, "PID_PEER_HOST_EPOCH" },
1957 { PID_TRANSPORT_INFO_LIST, "PID_TRANSPORT_INFO_LIST" },
1958 { PID_DIRECT_COMMUNICATION, "PID_DIRECT_COMMUNICATION" },
1959 { PID_TYPE_OBJECT, "PID_TYPE_OBJECT" },
1960 { PID_EXPECTS_VIRTUAL_HB, "PID_EXPECTS_VIRTUAL_HB" },
1961 { PID_RTI_DOMAIN_ID, "PID_RTI_DOMAIN_ID" },
1962 { PID_TOPIC_QUERY_PUBLICATION, "PID_TOPIC_QUERY_PUBLICATION" },
1963 { PID_ENDPOINT_PROPERTY_CHANGE_EPOCH, "PID_ENDPOINT_PROPERTY_CHANGE_EPOCH" },
1964 { PID_REACHABILITY_LEASE_DURATION, "PID_REACHABILITY_LEASE_DURATION" },
1965 { PID_VENDOR_BUILTIN_ENDPOINT_SET, "PID_VENDOR_BUILTIN_ENDPOINT_SET" },
1966 { PID_ENDPOINT_SECURITY_ATTRIBUTES, "PID_ENDPOINT_SECURITY_ATTRIBUTES" },
1967 { PID_TYPE_OBJECT_LB, "PID_TYPE_OBJECT_LB" },
1968 { PID_UNICAST_LOCATOR_EX, "PID_UNICAST_LOCATOR_EX"},
1969 { PID_TOPIC_NAME_ALIASES, "PID_TOPIC_NAME_ALIASES" },
1970 { 0, NULL }
1972 static const value_string parameter_id_toc_vals[] = {
1973 /* Vendor specific: Twin Oaks Computing */
1974 { PID_TYPECODE_RTPS2, "PID_TYPECODE_RTPS2" },
1975 { 0, NULL }
1978 static const value_string parameter_id_adl_vals[] = {
1979 /* Vendor specific: ADLink Ltd. */
1980 { PID_ADLINK_WRITER_INFO, "PID_ADLINK_WRITER_INFO" },
1981 { PID_ADLINK_READER_DATA_LIFECYCLE, "PID_ADLINK_READER_DATA_LIFECYCLE" },
1982 { PID_ADLINK_WRITER_DATA_LIFECYCLE, "PID_ADLINK_WRITER_DATA_LIFECYCLE" },
1983 { PID_ADLINK_ENDPOINT_GUID, "PID_ADLINK_ENDPOINT_GUID" },
1984 { PID_ADLINK_SYNCHRONOUS_ENDPOINT, "PID_ADLINK_SYNCHRONOUS_ENDPOINT" },
1985 { PID_ADLINK_RELAXED_QOS_MATCHING, "PID_ADLINK_RELAXED_QOS_MATCHING" },
1986 { PID_ADLINK_PARTICIPANT_VERSION_INFO, "PID_ADLINK_PARTICIPANT_VERSION_INFO" },
1987 { PID_ADLINK_NODE_NAME, "PID_ADLINK_NODE_NAME" },
1988 { PID_ADLINK_EXEC_NAME, "PID_ADLINK_EXEC_NAME" },
1989 { PID_ADLINK_PROCESS_ID, "PID_ADLINK_PROCESS_ID" },
1990 { PID_ADLINK_SERVICE_TYPE, "PID_ADLINK_SERVICE_TYPE" },
1991 { PID_ADLINK_ENTITY_FACTORY, "PID_ADLINK_ENTITY_FACTORY" },
1992 { PID_ADLINK_WATCHDOG_SCHEDULING, "PID_ADLINK_WATCHDOG_SCHEDULING" },
1993 { PID_ADLINK_LISTENER_SCHEDULING, "PID_ADLINK_LISTENER_SCHEDULING" },
1994 { PID_ADLINK_SUBSCRIPTION_KEYS, "PID_ADLINK_SUBSCRIPTION_KEYS" },
1995 { PID_ADLINK_READER_LIFESPAN, "PID_ADLINK_READER_LIFESPAN" },
1996 { PID_ADLINK_SHARE, "PID_ADLINK_SHARE" },
1997 { PID_ADLINK_TYPE_DESCRIPTION, "PID_ADLINK_TYPE_DESCRIPTION" },
1998 { PID_ADLINK_LAN_ID, "PID_ADLINK_LAN_ID" },
1999 { PID_ADLINK_ENDPOINT_GID, "PID_ADLINK_ENDPOINT_GID" },
2000 { PID_ADLINK_GROUP_GID, "PID_ADLINK_GROUP_GID" },
2001 { PID_ADLINK_EOTINFO, "PID_ADLINK_EOTINFO" },
2002 { PID_ADLINK_PART_CERT_NAME, "PID_ADLINK_PART_CERT_NAME" },
2003 { PID_ADLINK_LAN_CERT_NAME, "PID_ADLINK_LAN_CERT_NAME" },
2004 { 0, NULL }
2007 static const value_string liveliness_qos_vals[] = {
2008 { LIVELINESS_AUTOMATIC, "AUTOMATIC_LIVELINESS_QOS" },
2009 { LIVELINESS_BY_PARTICIPANT, "MANUAL_BY_PARTICIPANT_LIVELINESS_QOS" },
2010 { LIVELINESS_BY_TOPIC, "MANUAL_BY_TOPIC_LIVELINESS_QOS" },
2011 { 0, NULL }
2014 static const value_string durability_qos_vals[] = {
2015 { DURABILITY_VOLATILE, "VOLATILE_DURABILITY_QOS" },
2016 { DURABILITY_TRANSIENT_LOCAL, "TRANSIENT_LOCAL_DURABILITY_QOS" },
2017 { DURABILITY_TRANSIENT, "TRANSIENT_DURABILITY_QOS" },
2018 { DURABILITY_PERSISTENT, "PERSISTENT_DURABILITY_QOS" },
2019 { 0, NULL }
2022 static const value_string ownership_qos_vals[] = {
2023 { OWNERSHIP_SHARED, "SHARED_OWNERSHIP_QOS" },
2024 { OWNERSHIP_EXCLUSIVE, "EXCLUSIVE_OWNERSHIP_QOS" },
2025 { 0, NULL }
2028 static const value_string presentation_qos_vals[] = {
2029 { PRESENTATION_INSTANCE, "INSTANCE_PRESENTATION_QOS" },
2030 { PRESENTATION_TOPIC, "TOPIC_PRESENTATION_QOS" },
2031 { PRESENTATION_GROUP, "GROUP_PRESENTATION_QOS" },
2032 { 0, NULL }
2035 static const value_string history_qos_vals[] = {
2036 { HISTORY_KIND_KEEP_LAST, "KEEP_LAST_HISTORY_QOS" },
2037 { HISTORY_KIND_KEEP_ALL, "KEEP_ALL_HISTORY_QOS" },
2038 { 0, NULL }
2041 static const value_string reliability_qos_vals[] = {
2042 { RELIABILITY_BEST_EFFORT, "BEST_EFFORT_RELIABILITY_QOS" },
2043 { RELIABILITY_RELIABLE, "RELIABLE_RELIABILITY_QOS" },
2044 { 0, NULL }
2047 static const value_string destination_order_qos_vals[] = {
2048 { BY_RECEPTION_TIMESTAMP, "BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS" },
2049 { BY_SOURCE_TIMESTAMP, "BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS" },
2050 { 0, NULL }
2053 static const value_string encapsulation_id_vals[] = {
2054 { ENCAPSULATION_CDR_BE, "CDR_BE" },
2055 { ENCAPSULATION_CDR_LE, "CDR_LE" },
2056 { ENCAPSULATION_PL_CDR_BE, "PL_CDR_BE" },
2057 { ENCAPSULATION_PL_CDR_LE, "PL_CDR_LE" },
2058 { ENCAPSULATION_CDR2_BE, "CDR2_BE" },
2059 { ENCAPSULATION_CDR2_LE, "CDR2_LE" },
2060 { ENCAPSULATION_D_CDR2_BE, "D_CDR2_BE" },
2061 { ENCAPSULATION_D_CDR2_LE, "D_CDR2_LE" },
2062 { ENCAPSULATION_PL_CDR2_BE, "PL_CDR2_BE" },
2063 { ENCAPSULATION_PL_CDR2_LE, "PL_CDR2_LE" },
2064 { ENCAPSULATION_SHMEM_REF_PLAIN, "SHMEM_REF_PLAIN" },
2065 { ENCAPSULATION_SHMEM_REF_FLAT_DATA, "SHMEM_REF_PLAIN" },
2066 { 0, NULL }
2069 static const value_string data_representation_kind_vals[] = {
2070 { 0, "XCDR_DATA_REPRESENTATION" },
2071 { 1, "XML_DATA_REPRESENTATION" },
2072 { 2, "XCDR2_DATA_REPRESENTATION" },
2073 { 0, NULL }
2076 static const value_string plugin_promiscuity_kind_vals[] = {
2077 { 0x0001, "MATCHING_REMOTE_ENTITIES_PROMISCUITY" },
2078 { 0xffff, "ALL_REMOTE_ENTITIES_PROMISCUITY" },
2079 { 0, NULL }
2082 static const value_string service_kind_vals[] = {
2083 { 0x00000000, "NO_SERVICE_QOS" },
2084 { 0x00000001, "PERSISTENCE_SERVICE_QOS" },
2085 { 0, NULL }
2088 static const value_string secure_transformation_kind[] = {
2089 { CRYPTO_TRANSFORMATION_KIND_NONE, "NONE" },
2090 { CRYPTO_TRANSFORMATION_KIND_AES128_GMAC, "AES128_GMAC" },
2091 { CRYPTO_TRANSFORMATION_KIND_AES128_GCM, "AES128_GCM" },
2092 { CRYPTO_TRANSFORMATION_KIND_AES256_GMAC, "AES256_GMAC" },
2093 { CRYPTO_TRANSFORMATION_KIND_AES256_GCM, "AES256_GCM" },
2094 { 0, NULL }
2097 static const value_string participant_message_data_kind [] = {
2098 { PARTICIPANT_MESSAGE_DATA_KIND_UNKNOWN, "PARTICIPANT_MESSAGE_DATA_KIND_UNKNOWN" },
2099 { PARTICIPANT_MESSAGE_DATA_KIND_AUTOMATIC_LIVELINESS_UPDATE, "PARTICIPANT_MESSAGE_DATA_KIND_AUTOMATIC_LIVELINESS_UPDATE" },
2100 { PARTICIPANT_MESSAGE_DATA_KIND_MANUAL_LIVELINESS_UPDATE, "PARTICIPANT_MESSAGE_DATA_KIND_MANUAL_LIVELINESS_UPDATE" },
2101 { 0, NULL }
2104 /* Vendor specific: RTI */
2105 static const value_string type_consistency_kind_vals[] = {
2106 { DISALLOW_TYPE_COERCION, "DISALLOW_TYPE_COERCION" },
2107 { ALLOW_TYPE_COERCION, "ALLOW_TYPE_COERCION" },
2108 { 0, NULL }
2111 static const value_string service_request_kind[] = {
2112 { RTI_SERVICE_REQUEST_ID_UNKNOWN, "RTI_SERVICE_REQUEST_ID_UNKNOWN" },
2113 { RTI_SERVICE_REQUEST_ID_TOPIC_QUERY, "RTI_SERVICE_REQUEST_ID_TOPIC_QUERY" },
2114 { RTI_SERVICE_REQUEST_ID_INSTANCE_STATE, "RTI_SERVICE_REQUEST_ID_INSTANCE_STATE" },
2115 { 0, NULL }
2117 /* Vendor specific: RTI */
2118 static const value_string acknowledgement_kind_vals[] = {
2119 { PROTOCOL_ACKNOWLEDGMENT, "PROTOCOL_ACKNOWLEDGMENT" },
2120 { APPLICATION_AUTO_ACKNOWLEDGMENT, "APPLICATION_AUTO_ACKNOWLEDGMENT" },
2121 { APPLICATION_ORDERED_ACKNOWLEDGMENT, "APPLICATION_ORDERED_ACKNOWLEDGMENT" },
2122 { APPLICATION_EXPLICIT_ACKNOWLEDGMENT, "APPLICATION_EXPLICIT_ACKNOWLEDGMENT" },
2123 { 0, NULL }
2126 static int* const TYPE_FLAG_FLAGS[] = {
2127 &hf_rtps_flag_typeflag_nested, /* Bit 2 */
2128 &hf_rtps_flag_typeflag_mutable, /* Bit 1 */
2129 &hf_rtps_flag_typeflag_final, /* Bit 0 */
2130 NULL
2133 static int* const MEMBER_FLAGS[] = {
2134 &hf_rtps_flag_memberflag_union_default, /* Bit 3 */
2135 &hf_rtps_flag_memberflag_shareable, /* Bit 2 */
2136 &hf_rtps_flag_memberflag_optional, /* Bit 1 */
2137 &hf_rtps_flag_memberflag_key, /* Bit 0 */
2138 NULL
2141 static int* const UDPV4_WAN_LOCATOR_FLAGS[] = {
2142 &hf_rtps_flag_reserved80, /* Bit 7 */
2143 &hf_rtps_flag_reserved40, /* Bit 6 */
2144 &hf_rtps_flag_reserved20, /* Bit 5 */
2145 &hf_rtps_flag_reserved10, /* Bit 4 */
2146 &hf_rtps_flag_udpv4_wan_locator_r, /* Bit 3 */
2147 &hf_rtps_flag_udpv4_wan_locator_b, /* Bit 2 */
2148 &hf_rtps_flag_udpv4_wan_locator_p, /* Bit 1 */
2149 &hf_rtps_flag_udpv4_wan_locator_u, /* Bit 0 */
2150 NULL
2153 static int* const UDPV4_WAN_BINDING_PING_FLAGS[] = {
2154 &hf_rtps_flag_reserved80, /* Bit 7 */
2155 &hf_rtps_flag_reserved40, /* Bit 6 */
2156 &hf_rtps_flag_reserved20, /* Bit 5 */
2157 &hf_rtps_flag_reserved10, /* Bit 4 */
2158 &hf_rtps_flag_reserved08, /* Bit 3 */
2159 &hf_rtps_flag_udpv4_wan_binding_ping_b, /* Bit 2 */
2160 &hf_rtps_flag_udpv4_wan_binding_ping_l, /* Bit 1 */
2161 &hf_rtps_flag_udpv4_wan_binding_ping_e, /* Bit 0 */
2162 NULL
2165 /* Vendor specific: RTI */
2166 static const value_string ndds_transport_class_id_vals[] = {
2167 { NDDS_TRANSPORT_CLASSID_ANY, "ANY" },
2168 { NDDS_TRANSPORT_CLASSID_UDPv4, "UDPv4" },
2169 { NDDS_TRANSPORT_CLASSID_SHMEM, "SHMEM" },
2170 { NDDS_TRANSPORT_CLASSID_INTRA, "INTRA" },
2171 { NDDS_TRANSPORT_CLASSID_UDPv6, "UDPv6" },
2172 { NDDS_TRANSPORT_CLASSID_DTLS, "DTLS" },
2173 { NDDS_TRANSPORT_CLASSID_WAN, "WAN" },
2174 { NDDS_TRANSPORT_CLASSID_TCPV4_LAN, "TCPv4_LAN" },
2175 { NDDS_TRANSPORT_CLASSID_TCPV4_WAN, "TCPv4_WAN" },
2176 { NDDS_TRANSPORT_CLASSID_TLSV4_LAN, "TLSv4_LAN" },
2177 { NDDS_TRANSPORT_CLASSID_TLSV4_WAN, "TLSv4_WAN" },
2178 { NDDS_TRANSPORT_CLASSID_PCIE, "PCIE" },
2179 { NDDS_TRANSPORT_CLASSID_ITP, "ITP" },
2180 { NDDS_TRANSPORT_CLASSID_UDPv4_WAN, "UDPv4_WAN" },
2181 { 0, NULL }
2184 static const value_string class_id_enum_names[] = {
2185 { RTI_OSAPI_COMPRESSION_CLASS_ID_NONE, "NONE" },
2186 { RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB, "ZLIB" },
2187 { RTI_OSAPI_COMPRESSION_CLASS_ID_BZIP2, "BZIP2" },
2188 { RTI_OSAPI_COMPRESSION_CLASS_ID_AUTO, "AUTO"},
2189 { 0, NULL}
2192 static const value_string topic_query_selection_kind[] = {
2193 { RTPS_TOPIC_QUERY_SELECTION_KIND_HISTORY_SNAPSHOT, "HISTORY_SNAPSHOT" },
2194 { RTPS_TOPIC_QUERY_SELECTION_KIND_CONTINUOUS, "CONTINUOUS" },
2195 { 0, NULL}
2198 static int* const PAD_FLAGS[] = {
2199 &hf_rtps_flag_reserved80, /* Bit 7 */
2200 &hf_rtps_flag_reserved40, /* Bit 6 */
2201 &hf_rtps_flag_reserved20, /* Bit 5 */
2202 &hf_rtps_flag_reserved10, /* Bit 4 */
2203 &hf_rtps_flag_reserved08, /* Bit 3 */
2204 &hf_rtps_flag_reserved04, /* Bit 2 */
2205 &hf_rtps_flag_reserved02, /* Bit 1 */
2206 &hf_rtps_flag_endianness, /* Bit 0 */
2207 NULL
2210 static int* const DATA_FLAGSv1[] = {
2211 &hf_rtps_flag_reserved80, /* Bit 7 */
2212 &hf_rtps_flag_reserved40, /* Bit 6 */
2213 &hf_rtps_flag_unregister, /* Bit 5 */
2214 &hf_rtps_flag_inline_qos_v1, /* Bit 4 */
2215 &hf_rtps_flag_hash_key, /* Bit 3 */
2216 &hf_rtps_flag_alive, /* Bit 2 */
2217 &hf_rtps_flag_data_present_v1, /* Bit 1 */
2218 &hf_rtps_flag_endianness, /* Bit 0 */
2219 NULL
2222 static int* const DATA_FLAGSv2[] = {
2223 &hf_rtps_flag_reserved80, /* Bit 7 */
2224 &hf_rtps_flag_reserved40, /* Bit 6 */
2225 &hf_rtps_flag_reserved20, /* Bit 5 */
2226 &hf_rtps_flag_status_info, /* Bit 4 */
2227 &hf_rtps_flag_hash_key, /* Bit 3 */
2228 &hf_rtps_flag_data_present_v2, /* Bit 2 */
2229 &hf_rtps_flag_inline_qos_v2, /* Bit 1 */
2230 &hf_rtps_flag_endianness, /* Bit 0 */
2231 NULL
2234 static int* const NOKEY_DATA_FRAG_FLAGS[] = {
2235 &hf_rtps_flag_reserved80, /* Bit 7 */
2236 &hf_rtps_flag_reserved40, /* Bit 6 */
2237 &hf_rtps_flag_reserved20, /* Bit 5 */
2238 &hf_rtps_flag_reserved10, /* Bit 4 */
2239 &hf_rtps_flag_reserved08, /* Bit 3 */
2240 &hf_rtps_flag_reserved04, /* Bit 2 */
2241 &hf_rtps_flag_inline_qos_v2, /* Bit 1 */
2242 &hf_rtps_flag_endianness, /* Bit 0 */
2243 NULL
2246 static int* const NOKEY_DATA_FLAGS[] = {
2247 &hf_rtps_flag_reserved80, /* Bit 7 */
2248 &hf_rtps_flag_reserved40, /* Bit 6 */
2249 &hf_rtps_flag_reserved20, /* Bit 5 */
2250 &hf_rtps_flag_reserved10, /* Bit 4 */
2251 &hf_rtps_flag_reserved08, /* Bit 3 */
2252 &hf_rtps_flag_reserved04, /* Bit 2 */
2253 &hf_rtps_flag_inline_qos_v2, /* Bit 1 */
2254 &hf_rtps_flag_endianness, /* Bit 0 */
2255 NULL
2258 static int* const ACKNACK_FLAGS[] = {
2259 &hf_rtps_flag_reserved80, /* Bit 7 */
2260 &hf_rtps_flag_reserved40, /* Bit 6 */
2261 &hf_rtps_flag_reserved20, /* Bit 5 */
2262 &hf_rtps_flag_reserved10, /* Bit 4 */
2263 &hf_rtps_flag_reserved08, /* Bit 3 */
2264 &hf_rtps_flag_reserved04, /* Bit 2 */
2265 &hf_rtps_flag_final, /* Bit 1 */
2266 &hf_rtps_flag_endianness, /* Bit 0 */
2267 NULL
2270 static int* const NACK_FRAG_FLAGS[] = {
2271 &hf_rtps_flag_reserved80, /* Bit 7 */
2272 &hf_rtps_flag_reserved40, /* Bit 6 */
2273 &hf_rtps_flag_reserved20, /* Bit 5 */
2274 &hf_rtps_flag_reserved10, /* Bit 4 */
2275 &hf_rtps_flag_reserved08, /* Bit 3 */
2276 &hf_rtps_flag_reserved04, /* Bit 2 */
2277 &hf_rtps_flag_reserved02, /* Bit 1 */
2278 &hf_rtps_flag_endianness, /* Bit 0 */
2279 NULL
2282 static int* const GAP_FLAGS[] = {
2283 &hf_rtps_flag_reserved80, /* Bit 7 */
2284 &hf_rtps_flag_reserved40, /* Bit 6 */
2285 &hf_rtps_flag_reserved20, /* Bit 5 */
2286 &hf_rtps_flag_reserved10, /* Bit 4 */
2287 &hf_rtps_flag_reserved08, /* Bit 3 */
2288 &hf_rtps_flag_reserved04, /* Bit 2 */
2289 &hf_rtps_flag_reserved02, /* Bit 1 */
2290 &hf_rtps_flag_endianness, /* Bit 0 */
2291 NULL
2294 static int* const HEARTBEAT_FLAGS[] = {
2295 &hf_rtps_flag_reserved80, /* Bit 7 */
2296 &hf_rtps_flag_reserved40, /* Bit 6 */
2297 &hf_rtps_flag_reserved20, /* Bit 5 */
2298 &hf_rtps_flag_reserved10, /* Bit 4 */
2299 &hf_rtps_flag_reserved08, /* Bit 3 */
2300 &hf_rtps_flag_liveliness, /* Bit 2 */
2301 &hf_rtps_flag_final, /* Bit 1 */
2302 &hf_rtps_flag_endianness, /* Bit 0 */
2303 NULL
2306 static int* const HEARTBEAT_BATCH_FLAGS[] = {
2307 &hf_rtps_flag_reserved80, /* Bit 7 */
2308 &hf_rtps_flag_reserved40, /* Bit 6 */
2309 &hf_rtps_flag_reserved20, /* Bit 5 */
2310 &hf_rtps_flag_reserved10, /* Bit 4 */
2311 &hf_rtps_flag_reserved08, /* Bit 3 */
2312 &hf_rtps_flag_liveliness, /* Bit 2 */
2313 &hf_rtps_flag_final, /* Bit 1 */
2314 &hf_rtps_flag_endianness, /* Bit 0 */
2315 NULL
2318 static int* const HEARTBEAT_FRAG_FLAGS[] = {
2319 &hf_rtps_flag_reserved80, /* Bit 7 */
2320 &hf_rtps_flag_reserved40, /* Bit 6 */
2321 &hf_rtps_flag_reserved20, /* Bit 5 */
2322 &hf_rtps_flag_reserved10, /* Bit 4 */
2323 &hf_rtps_flag_reserved08, /* Bit 3 */
2324 &hf_rtps_flag_reserved04, /* Bit 2 */
2325 &hf_rtps_flag_reserved02, /* Bit 1 */
2326 &hf_rtps_flag_endianness, /* Bit 0 */
2327 NULL
2330 static int* const RTPS_DATA_FLAGS[] = {
2331 &hf_rtps_flag_reserved80, /* Bit 7 */
2332 &hf_rtps_flag_reserved40, /* Bit 6 */
2333 &hf_rtps_flag_reserved20, /* Bit 5 */
2334 &hf_rtps_flag_reserved10, /* Bit 4 */
2335 &hf_rtps_flag_data_serialized_key, /* Bit 3 */
2336 &hf_rtps_flag_data_present_v2, /* Bit 2 */
2337 &hf_rtps_flag_inline_qos_v2, /* Bit 1 */
2338 &hf_rtps_flag_endianness, /* Bit 0 */
2339 NULL
2342 static int* const RTPS_DATA_FRAG_FLAGS[] = {
2343 &hf_rtps_flag_reserved80, /* Bit 7 */
2344 &hf_rtps_flag_reserved40, /* Bit 6 */
2345 &hf_rtps_flag_reserved20, /* Bit 5 */
2346 &hf_rtps_flag_reserved10, /* Bit 4 */
2347 &hf_rtps_flag_reserved08, /* Bit 3 */
2348 &hf_rtps_flag_data_frag_serialized_key, /* Bit 2 */
2349 &hf_rtps_flag_inline_qos_v2, /* Bit 1 */
2350 &hf_rtps_flag_endianness, /* Bit 0 */
2351 NULL
2354 static int* const RTPS_DATA_BATCH_FLAGS[] = {
2355 &hf_rtps_flag_reserved80, /* Bit 7 */
2356 &hf_rtps_flag_reserved40, /* Bit 6 */
2357 &hf_rtps_flag_reserved20, /* Bit 5 */
2358 &hf_rtps_flag_reserved10, /* Bit 4 */
2359 &hf_rtps_flag_reserved08, /* Bit 3 */
2360 &hf_rtps_flag_reserved04, /* Bit 2 */
2361 &hf_rtps_flag_inline_qos_v2, /* Bit 1 */
2362 &hf_rtps_flag_endianness, /* Bit 0 */
2363 NULL
2366 static int* const RTPS_SAMPLE_INFO_FLAGS16[] = {
2367 &hf_rtps_flag_reserved8000, /* Bit 15 */
2368 &hf_rtps_flag_reserved4000, /* Bit 14 */
2369 &hf_rtps_flag_reserved2000, /* Bit 13 */
2370 &hf_rtps_flag_reserved1000, /* Bit 12 */
2371 &hf_rtps_flag_reserved0800, /* Bit 11 */
2372 &hf_rtps_flag_reserved0400, /* Bit 10 */
2373 &hf_rtps_flag_reserved0200, /* Bit 9 */
2374 &hf_rtps_flag_reserved0100, /* Bit 8 */
2375 &hf_rtps_flag_reserved0080, /* Bit 7 */
2376 &hf_rtps_flag_reserved0040, /* Bit 6 */
2377 &hf_rtps_flag_serialize_key16, /* Bit 5 */
2378 &hf_rtps_flag_invalid_sample, /* Bit 4 */
2379 &hf_rtps_flag_data_present16, /* Bit 3 */
2380 &hf_rtps_flag_offsetsn_present, /* Bit 2 */
2381 &hf_rtps_flag_inline_qos16_v2, /* Bit 1 */
2382 &hf_rtps_flag_timestamp_present, /* Bit 0 */
2383 NULL
2386 static int* const INFO_TS_FLAGS[] = {
2387 &hf_rtps_flag_reserved80, /* Bit 7 */
2388 &hf_rtps_flag_reserved40, /* Bit 6 */
2389 &hf_rtps_flag_reserved20, /* Bit 5 */
2390 &hf_rtps_flag_reserved10, /* Bit 4 */
2391 &hf_rtps_flag_reserved08, /* Bit 3 */
2392 &hf_rtps_flag_reserved04, /* Bit 2 */
2393 &hf_rtps_flag_timestamp, /* Bit 1 */
2394 &hf_rtps_flag_endianness, /* Bit 0 */
2395 NULL
2398 static int* const INFO_SRC_FLAGS[] = {
2399 &hf_rtps_flag_reserved80, /* Bit 7 */
2400 &hf_rtps_flag_reserved40, /* Bit 6 */
2401 &hf_rtps_flag_reserved20, /* Bit 5 */
2402 &hf_rtps_flag_reserved10, /* Bit 4 */
2403 &hf_rtps_flag_reserved08, /* Bit 3 */
2404 &hf_rtps_flag_reserved04, /* Bit 2 */
2405 &hf_rtps_flag_reserved02, /* Bit 1 */
2406 &hf_rtps_flag_endianness, /* Bit 0 */
2407 NULL
2410 static int* const INFO_REPLY_IP4_FLAGS[] = {
2411 &hf_rtps_flag_reserved80, /* Bit 7 */
2412 &hf_rtps_flag_reserved40, /* Bit 6 */
2413 &hf_rtps_flag_reserved20, /* Bit 5 */
2414 &hf_rtps_flag_reserved10, /* Bit 4 */
2415 &hf_rtps_flag_reserved08, /* Bit 3 */
2416 &hf_rtps_flag_reserved04, /* Bit 2 */
2417 &hf_rtps_flag_multicast, /* Bit 1 */
2418 &hf_rtps_flag_endianness, /* Bit 0 */
2419 NULL
2422 static int* const INFO_DST_FLAGS[] = {
2423 &hf_rtps_flag_reserved80, /* Bit 7 */
2424 &hf_rtps_flag_reserved40, /* Bit 6 */
2425 &hf_rtps_flag_reserved20, /* Bit 5 */
2426 &hf_rtps_flag_reserved10, /* Bit 4 */
2427 &hf_rtps_flag_reserved08, /* Bit 3 */
2428 &hf_rtps_flag_reserved04, /* Bit 2 */
2429 &hf_rtps_flag_reserved02, /* Bit 1 */
2430 &hf_rtps_flag_endianness, /* Bit 0 */
2431 NULL
2434 static int* const INFO_REPLY_FLAGS[] = {
2435 &hf_rtps_flag_reserved80, /* Bit 7 */
2436 &hf_rtps_flag_reserved40, /* Bit 6 */
2437 &hf_rtps_flag_reserved20, /* Bit 5 */
2438 &hf_rtps_flag_reserved10, /* Bit 4 */
2439 &hf_rtps_flag_reserved08, /* Bit 3 */
2440 &hf_rtps_flag_reserved04, /* Bit 2 */
2441 &hf_rtps_flag_multicast, /* Bit 1 */
2442 &hf_rtps_flag_endianness, /* Bit 0 */
2443 NULL
2446 static int* const RTI_CRC_FLAGS[] = {
2447 &hf_rtps_flag_reserved80, /* Bit 7 */
2448 &hf_rtps_flag_reserved40, /* Bit 6 */
2449 &hf_rtps_flag_reserved20, /* Bit 5 */
2450 &hf_rtps_flag_reserved10, /* Bit 4 */
2451 &hf_rtps_flag_reserved08, /* Bit 3 */
2452 &hf_rtps_flag_reserved04, /* Bit 2 */
2453 &hf_rtps_flag_reserved02, /* Bit 1 */
2454 &hf_rtps_flag_endianness, /* Bit 0 */
2455 NULL
2457 /* It is a 4 bytes field but with these 8 bits is enough */
2458 static int* const STATUS_INFO_FLAGS[] = {
2459 &hf_rtps_flag_reserved80, /* Bit 7 */
2460 &hf_rtps_flag_reserved40, /* Bit 6 */
2461 &hf_rtps_flag_reserved20, /* Bit 5 */
2462 &hf_rtps_flag_reserved10, /* Bit 4 */
2463 &hf_rtps_flag_reserved08, /* Bit 3 */
2464 &hf_rtps_flag_reserved04, /* Bit 2 */
2465 &hf_rtps_flag_unregistered, /* Bit 1 */
2466 &hf_rtps_flag_disposed, /* Bit 0 */
2467 NULL
2470 static int* const BUILTIN_ENDPOINT_FLAGS[] = {
2471 &hf_rtps_flag_participant_secure_reader, /* Bit 27 */
2472 &hf_rtps_flag_participant_secure_writer, /* Bit 26 */
2473 &hf_rtps_flag_secure_participant_volatile_message_reader, /* Bit 25 */
2474 &hf_rtps_flag_secure_participant_volatile_message_writer, /* Bit 24 */
2475 &hf_rtps_flag_participant_stateless_message_reader, /* Bit 23 */
2476 &hf_rtps_flag_participant_stateless_message_writer, /* Bit 22 */
2477 &hf_rtps_flag_secure_participant_message_reader, /* Bit 21 */
2478 &hf_rtps_flag_secure_participant_message_writer, /* Bit 20 */
2479 &hf_rtps_flag_secure_subscription_reader, /* Bit 19 */
2480 &hf_rtps_flag_secure_subscription_writer, /* Bit 18 */
2481 &hf_rtps_flag_secure_publication_reader, /* Bit 17 */
2482 &hf_rtps_flag_secure_publication_writer, /* Bit 16 */
2483 &hf_rtps_flag_builtin_endpoint_set_reserved, /* Bit 12-15 */
2484 &hf_rtps_flag_participant_message_datareader, /* Bit 11 */
2485 &hf_rtps_flag_participant_message_datawriter, /* Bit 10 */
2486 &hf_rtps_flag_participant_state_detector, /* Bit 9 */
2487 &hf_rtps_flag_participant_state_announcer, /* Bit 8 */
2488 &hf_rtps_flag_participant_proxy_detector, /* Bit 7 */
2489 &hf_rtps_flag_participant_proxy_announcer, /* Bit 6 */
2490 &hf_rtps_flag_subscription_detector, /* Bit 5 */
2491 &hf_rtps_flag_subscription_announcer, /* Bit 4 */
2492 &hf_rtps_flag_publication_detector, /* Bit 3 */
2493 &hf_rtps_flag_publication_announcer, /* Bit 2 */
2494 &hf_rtps_flag_participant_detector, /* Bit 1 */
2495 &hf_rtps_flag_participant_announcer, /* Bit 0 */
2496 NULL
2499 static int* const SECURE_FLAGS[] = {
2500 &hf_rtps_flag_reserved80, /* Bit 7 */
2501 &hf_rtps_flag_reserved40, /* Bit 6 */
2502 &hf_rtps_flag_reserved20, /* Bit 5 */
2503 &hf_rtps_flag_reserved10, /* Bit 4 */
2504 &hf_rtps_flag_reserved08, /* Bit 3 */
2505 &hf_rtps_flag_reserved04, /* Bit 2 */
2506 &hf_rtps_flag_multisubmessage, /* Bit 1 */
2507 &hf_rtps_flag_endianness, /* Bit 0 */
2508 NULL
2511 static int* const SECURE_PREFIX_FLAGS[] = {
2512 &hf_rtps_flag_vendor_specific_content, /* Bit 7 */
2513 &hf_rtps_flag_reserved40, /* Bit 6 */
2514 &hf_rtps_flag_reserved20, /* Bit 5 */
2515 &hf_rtps_flag_reserved10, /* Bit 4 */
2516 &hf_rtps_flag_reserved08, /* Bit 3 */
2517 &hf_rtps_flag_protected_with_psk, /* Bit 2 */
2518 &hf_rtps_flag_additional_authenticated_data, /* Bit 1 */
2519 &hf_rtps_flag_endianness, /* Bit 0 */
2520 NULL
2523 static int* const SECURE_POSTFIX_FLAGS[] = {
2524 &hf_rtps_flag_reserved80, /* Bit 7 */
2525 &hf_rtps_flag_reserved40, /* Bit 6 */
2526 &hf_rtps_flag_reserved20, /* Bit 5 */
2527 &hf_rtps_flag_reserved10, /* Bit 4 */
2528 &hf_rtps_flag_reserved08, /* Bit 3 */
2529 &hf_rtps_flag_reserved04, /* Bit 2 */
2530 &hf_rtps_flag_reserved02, /* Bit 1 */
2531 &hf_rtps_flag_endianness, /* Bit 0 */
2532 NULL
2535 static int* const ENDPOINT_SECURITY_INFO_FLAGS[] = {
2536 &hf_rtps_flag_endpoint_security_attribute_flag_is_valid, /* Bit 31 */
2537 &hf_rtps_flag_endpoint_security_attribute_flag_is_liveliness_protected, /* Bit 6 */
2538 &hf_rtps_flag_endpoint_security_attribute_flag_is_key_protected, /* Bit 5 */
2539 &hf_rtps_flag_endpoint_security_attribute_flag_is_payload_protected, /* Bit 4 */
2540 &hf_rtps_flag_endpoint_security_attribute_flag_is_submessage_protected, /* Bit 3 */
2541 &hf_rtps_flag_endpoint_security_attribute_flag_is_discovery_protected, /* Bit 2 */
2542 &hf_rtps_flag_endpoint_security_attribute_flag_is_write_protected, /* Bit 1 */
2543 &hf_rtps_flag_endpoint_security_attribute_flag_is_read_protected, /* Bit 0 */
2544 NULL
2547 static int* const PLUGIN_ENDPOINT_SECURITY_INFO_FLAGS[] = {
2548 &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_valid, /* Bit 31 */
2549 &hf_rtps_flag_participant_security_attribute_flag_key_psk_protected, /* Bit 4 */
2550 &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_liveliness_encrypted, /* Bit 2 */
2551 &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_key_encrypted, /* Bit 1 */
2552 &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_payload_encrypted, /* Bit 0 */
2553 NULL
2555 static int* const PARTICIPANT_SECURITY_INFO_FLAGS[] = {
2556 &hf_rtps_flag_participant_security_attribute_flag_is_valid, /* Bit 31 */
2557 &hf_rtps_flag_plugin_participant_security_attribute_flag_is_psk_encrypted, /* Bit 6 */
2558 &hf_rtps_flag_participant_security_attribute_flag_key_revisions_enabled, /* Bit 3 */
2559 &hf_rtps_flag_participant_security_attribute_flag_is_liveliness_protected, /* Bit 2 */
2560 &hf_rtps_flag_participant_security_attribute_flag_is_discovery_protected, /* Bit 1 */
2561 &hf_rtps_flag_participant_security_attribute_flag_is_rtps_protected, /* Bit 0 */
2562 NULL
2565 static int* const PLUGIN_PARTICIPANT_SECURITY_INFO_FLAGS[] = {
2566 &hf_rtps_flag_plugin_participant_security_attribute_flag_is_valid, /* Bit 31 */
2567 &hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_origin_encrypted, /* Bit 5 */
2568 &hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_origin_encrypted, /* Bit 4 */
2569 &hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_origin_encrypted, /* Bit 3 */
2570 &hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_encrypted, /* Bit 2 */
2571 &hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_encrypted, /* Bit 1 */
2572 &hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_encrypted, /* Bit 0 */
2573 NULL
2576 /* Vendor specific: RTI */
2577 static int* const APP_ACK_FLAGS[] = {
2578 &hf_rtps_flag_reserved80, /* Bit 7 */
2579 &hf_rtps_flag_reserved40, /* Bit 6 */
2580 &hf_rtps_flag_reserved20, /* Bit 5 */
2581 &hf_rtps_flag_reserved10, /* Bit 4 */
2582 &hf_rtps_flag_reserved08, /* Bit 3 */
2583 &hf_rtps_flag_reserved04, /* Bit 2 */
2584 &hf_rtps_flag_reserved02, /* Bit 1 */
2585 &hf_rtps_flag_endianness, /* Bit 0 */
2586 NULL
2588 /* Vendor specific: RTI */
2589 static int* const APP_ACK_CONF_FLAGS[] = {
2590 &hf_rtps_flag_reserved80, /* Bit 7 */
2591 &hf_rtps_flag_reserved40, /* Bit 6 */
2592 &hf_rtps_flag_reserved20, /* Bit 5 */
2593 &hf_rtps_flag_reserved10, /* Bit 4 */
2594 &hf_rtps_flag_reserved08, /* Bit 3 */
2595 &hf_rtps_flag_reserved04, /* Bit 2 */
2596 &hf_rtps_flag_reserved02, /* Bit 1 */
2597 &hf_rtps_flag_endianness, /* Bit 0 */
2598 NULL
2600 /* Vendor specific: RTI */
2601 static int* const HEARTBEAT_VIRTUAL_FLAGS[] = {
2602 &hf_rtps_flag_reserved80, /* Bit 7 */
2603 &hf_rtps_flag_reserved40, /* Bit 6 */
2604 &hf_rtps_flag_reserved20, /* Bit 5 */
2605 &hf_rtps_flag_reserved10, /* Bit 4 */
2606 &hf_rtps_flag_no_virtual_guids, /* Bit 3 */
2607 &hf_rtps_flag_multiple_writers, /* Bit 2 */
2608 &hf_rtps_flag_multiple_virtual_guids, /* Bit 1 */
2609 &hf_rtps_flag_endianness, /* Bit 0 */
2610 NULL
2612 /* Vendor specific: RTI */
2613 static int* const DATA_FRAG_FLAGS[] = {
2614 &hf_rtps_flag_reserved80, /* Bit 7 */
2615 &hf_rtps_flag_reserved40, /* Bit 6 */
2616 &hf_rtps_flag_reserved20, /* Bit 5 */
2617 &hf_rtps_flag_reserved10, /* Bit 4 */
2618 &hf_rtps_flag_reserved08, /* Bit 3 */
2619 &hf_rtps_flag_hash_key_rti, /* Bit 2 */
2620 &hf_rtps_flag_inline_qos_v2, /* Bit 1 */
2621 &hf_rtps_flag_endianness, /* Bit 0 */
2622 NULL
2624 #if 0
2625 /* Vendor specific: RTI */
2626 static int* const NACK_FLAGS[] = {
2627 &hf_rtps_flag_reserved80, /* Bit 7 */
2628 &hf_rtps_flag_reserved40, /* Bit 6 */
2629 &hf_rtps_flag_reserved20, /* Bit 5 */
2630 &hf_rtps_flag_reserved10, /* Bit 4 */
2631 &hf_rtps_flag_reserved08, /* Bit 3 */
2632 &hf_rtps_flag_reserved04, /* Bit 2 */
2633 &hf_rtps_flag_final, /* Bit 1 */
2634 &hf_rtps_flag_endianness, /* Bit 0 */
2635 NULL
2637 #endif
2639 static int* const VENDOR_BUILTIN_ENDPOINT_FLAGS[] = {
2640 &hf_rtps_flag_participant_bootstrap_reader, /* Bit 18 */
2641 &hf_rtps_flag_participant_bootstrap_writer, /* Bit 17 */
2642 &hf_rtps_flag_monitoring_logging_reader, /* Bit 16 */
2643 &hf_rtps_flag_monitoring_logging_writer, /* Bit 15 */
2644 &hf_rtps_flag_monitoring_event_reader, /* Bit 14 */
2645 &hf_rtps_flag_monitoring_event_writer, /* Bit 13 */
2646 &hf_rtps_flag_monitoring_periodic_reader, /* Bit 12 */
2647 &hf_rtps_flag_monitoring_periodic_writer, /* Bit 11 */
2648 &hf_rtps_flag_participant_config_secure_reader, /* Bit 10 */
2649 &hf_rtps_flag_participant_config_secure_writer, /* Bit 9 */
2650 &hf_rtps_flag_participant_config_reader, /* Bit 8 */
2651 &hf_rtps_flag_participant_config_writer, /* Bit 7 */
2652 &hf_rtps_flag_cloud_discovery_service_announcer, /* Bit 6 */
2653 &hf_rtps_flag_secure_service_request_reader, /* Bit 5 */
2654 &hf_rtps_flag_secure_service_request_writer, /* Bit 4 */
2655 &hf_rtps_flag_locator_ping_reader, /* Bit 3 */
2656 &hf_rtps_flag_locator_ping_writer, /* Bit 2 */
2657 &hf_rtps_flag_service_request_reader, /* Bit 1 */
2658 &hf_rtps_flag_service_request_writer, /* Bit 0 */
2659 NULL
2662 static int* const ENDPOINT_SECURITY_ATTRIBUTES[] = {
2663 &hf_rtps_flag_security_payload_protected, /* Bit 3 */
2664 &hf_rtps_flag_security_submessage_protected, /* Bit 2 */
2665 &hf_rtps_flag_security_discovery_protected, /* Bit 1 */
2666 &hf_rtps_flag_security_access_protected, /* Bit 0 */
2667 NULL
2671 static int* const SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS[] = {
2672 &hf_rtps_flag_security_algorithm_compatibility_mode,
2673 &hf_rtps_flag_security_symmetric_cipher_mask_custom_algorithm,
2674 &hf_rtps_flag_security_symmetric_cipher_mask_aes256_gcm,
2675 &hf_rtps_flag_security_symmetric_cipher_mask_aes128_gcm,
2676 NULL
2679 static int* const COMPRESSION_ID_MASK_FLAGS[] = {
2680 &hf_rtps_flag_compression_id_lz4,
2681 &hf_rtps_flag_compression_id_bzip2,
2682 &hf_rtps_flag_compression_id_zlib,
2683 NULL
2686 static int* const SECURITY_KEY_ESTABLISHMENT_MASK_FLAGS[] = {
2687 &hf_rtps_flag_security_algorithm_compatibility_mode,
2688 &hf_rtps_flag_security_key_establishment_mask_custom_algorithm,
2689 &hf_rtps_flag_security_key_establishment_mask_ecdheceum_p384,
2690 &hf_rtps_flag_security_key_establishment_mask_ecdheceum_p256,
2691 &hf_rtps_flag_security_key_establishment_mask_dhe_modp2048256,
2692 NULL
2695 static int* const SECURITY_DIGITAL_SIGNATURE_MASK_FLAGS[] = {
2696 &hf_rtps_flag_security_algorithm_compatibility_mode,
2697 &hf_rtps_flag_security_digital_signature_mask_custom_algorithm,
2698 &hf_rtps_flag_security_digital_signature_mask_ecdsa_p384_sha384,
2699 &hf_rtps_flag_security_digital_signature_mask_ecdsa_p256_sha256,
2700 &hf_rtps_flag_security_digital_signature_mask_rsassapkcs1v15_2048_sha256,
2701 &hf_rtps_flag_security_digital_signature_mask_rsassapssmgf1sha256_2048_sha256,
2702 NULL
2705 static int* const HEADER_EXTENSION_MASK_FLAGS[] = {
2706 &hf_rtps_flag_header_extension_parameters, /* Bit 7 */
2707 &hf_rtps_flag_header_extension_checksum1, /* Bit 6 */
2708 &hf_rtps_flag_header_extension_checksum2, /* Bit 5 */
2709 &hf_rtps_flag_header_extension_wextension, /* Bit 4 */
2710 &hf_rtps_flag_header_extension_uextension, /* Bit 3 */
2711 &hf_rtps_flag_header_extension_timestamp, /* Bit 2 */
2712 &hf_rtps_flag_header_extension_message_length, /* Bit 1 */
2713 &hf_rtps_flag_endianness, /* Bit 0 */
2714 NULL
2717 /**TCP get DomainId feature constants**/
2718 #define RTPS_UNKNOWN_DOMAIN_ID_VAL -1
2719 #define RTPS_UNKNOWN_DOMAIN_ID_STR "Unknown"
2720 #define RTPS_UNKNOWN_DOMAIN_ID_STR_LEN sizeof(RTPS_UNKNOWN_DOMAIN_ID_STR)
2721 #define RTPS_TCPMAP_DOMAIN_ID_KEY_STR "ParticipantGuid"
2722 #define RTPS_TCPMAP_DOMAIN_ID_PROTODATA_KEY 0
2724 /* Keys for mapping stuff in pinfo */
2725 #define RTPS_SERVICE_REQUEST_ID_PROTODATA_KEY 1
2726 #define RTPS_DATA_SESSION_FINAL_PROTODATA_KEY 2
2727 #define RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY 3
2728 #define RTPS_ROOT_MESSAGE_KEY 4
2729 #define RTPS_DECRYPTION_INFO_KEY 5
2731 #define RTPS_CHECKSUM_MAX_LEN 16
2733 /* End of TCP get DomainId feature constants */
2735 typedef struct _participant_info {
2736 int domainId;
2737 } participant_info;
2739 typedef struct _datawriter_qos {
2740 uint32_t reliability_kind;
2741 uint32_t durability_kind;
2742 uint32_t ownership_kind;
2743 } datawriter_qos;
2745 #define MAX_TOPIC_AND_TYPE_LENGTH 256
2746 typedef struct _type_mapping {
2747 endpoint_guid guid;
2748 char type_name[MAX_TOPIC_AND_TYPE_LENGTH];
2749 char topic_name[MAX_TOPIC_AND_TYPE_LENGTH];
2750 int fields_visited;
2751 datawriter_qos dw_qos;
2752 uint32_t dcps_publication_frame_number;
2753 uint64_t type_id;
2754 } type_mapping;
2756 /* Links a coherent set with an specific writer. Useful to detect if an empty packet is the end of a coherent set */
2757 typedef struct _coherent_set_entity_info {
2758 endpoint_guid guid;
2759 uint64_t writer_seq_number;
2760 uint64_t coherent_set_seq_number;
2761 uint64_t expected_coherent_set_end_writers_seq_number;
2762 } coherent_set_entity_info;
2764 typedef struct _coherent_set_key {
2765 endpoint_guid guid;
2766 uint64_t coherent_set_seq_number;
2767 } coherent_set_key;
2769 /* Holds information about the coherent set */
2770 typedef struct _coherent_set_info {
2771 coherent_set_key *key;
2772 uint64_t writer_seq_number;
2773 bool is_set;
2774 } coherent_set_info;
2776 /* Links a writer_seq_number with a coherent set. Useful when coherent set ends with parameter empty packet*/
2777 typedef struct _coherent_set_end {
2778 uint64_t writer_seq_number;
2779 coherent_set_key coherent_set_id;
2780 } coherent_set_end;
2782 typedef struct _coherent_set_track {
2783 wmem_map_t *entities_using_map;
2784 wmem_map_t *coherent_set_registry_map;
2785 } coherent_set_track;
2787 static coherent_set_track coherent_set_tracking;
2788 static wmem_map_t * registry;
2789 static reassembly_table rtps_reassembly_table;
2790 static wmem_map_t *discovered_participants_domain_ids;
2793 typedef struct {
2794 type_mapping instance_state_data_response_type_mapping;
2795 } builtin_types_type_mappings;
2797 typedef struct {
2798 dissection_info instance_state_data_response_dissection_info;
2799 dissection_info alive_instances_dissection_info;
2800 dissection_info disposed_instances_dissection_info;
2801 dissection_info unregistered_instances_dissection_info;
2802 dissection_info guid_t_dissection_info;
2803 dissection_info value_dissection_info;
2804 dissection_info instance_transition_data_dissection_info;
2805 dissection_info key_hash_value_dissection_info;
2806 dissection_info array_16_byte_dissection_info;
2807 dissection_info ntptime_t_dissection_info;
2808 dissection_info sequence_number_t_dissection_info;
2809 dissection_info serialized_key_dissection_info;
2810 dissection_info payload_dissection_info;
2811 } builtin_types_dissection_infos;
2814 /* Dissection info of types that are sent as user data but doesn't publish discovery data */
2815 typedef struct {
2816 builtin_types_type_mappings type_mappings;
2817 builtin_types_dissection_infos dissection_infos;
2818 } builtin_types_dissection_data_t;
2820 static builtin_types_dissection_data_t builtin_types_dissection_data;
2823 static type_mapping instance_state_data_response_type_mapping;
2824 static dissection_info instance_state_data_response_dissection_info;
2825 static dissection_info alive_instances_dissection_info;
2826 static dissection_info disposed_instances_dissection_info;
2827 static dissection_info unregistered_instances_dissection_info;
2828 static dissection_info writer_guid_dissection_info;
2829 static dissection_info reader_guid_dissection_info;
2830 static dissection_info value_dissection_info;
2833 static const fragment_items rtps_frag_items = {
2834 &ett_rtps_fragment,
2835 &ett_rtps_fragments,
2836 &hf_rtps_fragments,
2837 &hf_rtps_fragment,
2838 &hf_rtps_fragment_overlap,
2839 &hf_rtps_fragment_overlap_conflict,
2840 &hf_rtps_fragment_multiple_tails,
2841 &hf_rtps_fragment_too_long_fragment,
2842 &hf_rtps_fragment_error,
2843 &hf_rtps_fragment_count,
2844 &hf_rtps_reassembled_in,
2845 &hf_rtps_reassembled_length,
2846 &hf_rtps_reassembled_data,
2847 "RTPS fragments"
2850 /******************************************************************************/
2851 /* PRE-SHARED KEY DECODING FUNCTIONALITY */
2852 /******************************************************************************/
2853 #define RTPS_HMAC_256_BUFFER_SIZE_BYTES 32
2855 typedef struct {
2856 uint32_t host_id;
2857 uint32_t app_id;
2858 uint32_t instance_id;
2859 } rtps_guid_prefix_t;
2861 typedef enum {
2862 CRYPTO_ALGORITHM_NONE = CRYPTO_TRANSFORMATION_KIND_NONE,
2863 CRYPTO_ALGORITHM_AES128_GMAC = CRYPTO_TRANSFORMATION_KIND_AES128_GMAC,
2864 CRYPTO_ALGORITHM_AES128_GCM = CRYPTO_TRANSFORMATION_KIND_AES128_GCM,
2865 CRYPTO_ALGORITHM_AES256_GMAC = CRYPTO_TRANSFORMATION_KIND_AES256_GMAC,
2866 CRYPTO_ALGORITHM_AES256_GCM = CRYPTO_TRANSFORMATION_KIND_AES256_GCM
2867 } rtps_encryption_algorithm_t;
2869 #define RTPS_SECURITY_INIT_VECTOR_LEN 12
2870 typedef struct {
2871 rtps_guid_prefix_t guid_prefix;
2872 bool try_psk_decryption;
2873 uint32_t session_id;
2874 uint32_t transformation_key;
2875 rtps_encryption_algorithm_t algorithm;
2876 uint8_t init_vector[RTPS_SECURITY_INIT_VECTOR_LEN];
2877 uint32_t psk_index;
2878 } rtps_current_packet_decryption_info_t;
2880 typedef struct {
2881 uint32_t value;
2882 bool ignore;
2883 } rtps_psk_options_entry_uint32_string_t;
2885 typedef struct {
2886 char *passphrase_secret;
2888 char *passphrase_id_in;
2889 rtps_psk_options_entry_uint32_string_t passphrase_id;
2891 char *host_id_in;
2892 rtps_psk_options_entry_uint32_string_t host_id;
2894 char *app_id_in;
2895 rtps_psk_options_entry_uint32_string_t app_id;
2897 char *instance_id_in;
2898 rtps_psk_options_entry_uint32_string_t instance_id;
2900 } rtps_psk_options_entry_t;
2902 /* PSK table options in RTPS protocol options */
2903 typedef struct {
2904 rtps_psk_options_entry_t *entries;
2905 unsigned size;
2906 } rtps_psk_options_t;
2908 static rtps_psk_options_t rtps_psk_options = { NULL, 0 };
2911 * The table presented to the user has five columns: psk_index_str, psk,
2912 * host_id, app_id, and instance_id. Decoding of the RTPS message using the
2913 * pre-shared key will only take place if there is a match in the host_id,
2914 * app_id, instance_id, and psk_index. These fields do not require a match if
2915 * the user leaves them empty or containing only the '*' wildcard character
2916 * (note that the the psk secret passphrase must always match). Ignoring all the
2917 * previuos fields will result in an attempt to decode the RTPS message
2918 * regardless of the GUID or the PSK index.
2920 UAT_CSTRING_CB_DEF(
2921 rtps_psk_table_entry_field, passphrase_id_in,
2922 rtps_psk_options_entry_t)
2923 UAT_CSTRING_CB_DEF(
2924 rtps_psk_table_entry_field, passphrase_secret,
2925 rtps_psk_options_entry_t)
2926 UAT_CSTRING_CB_DEF(
2927 rtps_psk_table_entry_field, host_id_in,
2928 rtps_psk_options_entry_t)
2929 UAT_CSTRING_CB_DEF(
2930 rtps_psk_table_entry_field, app_id_in,
2931 rtps_psk_options_entry_t)
2932 UAT_CSTRING_CB_DEF(
2933 rtps_psk_table_entry_field, instance_id_in,
2934 rtps_psk_options_entry_t)
2936 static uat_field_t rtps_psk_table_field_array[] = {
2937 UAT_FLD_CSTRING(
2938 rtps_psk_table_entry_field, passphrase_id_in,
2939 "Passphrase Id",
2940 "Integer identifying the secret. "
2941 "Use the '*' character to match any Id."),
2942 UAT_FLD_CSTRING(
2943 rtps_psk_table_entry_field, passphrase_secret,
2944 "Passphrase Secret",
2945 "Seed used to derive the pre-shared secret key"),
2946 UAT_FLD_CSTRING(
2947 rtps_psk_table_entry_field, host_id_in,
2948 "Host ID (Hex)",
2949 "Limit the decoding to RTPS messages coming from the specified GUID."
2950 "Leave the field empty or use the '*' character to match any GUID."),
2951 UAT_FLD_CSTRING(
2952 rtps_psk_table_entry_field, app_id_in,
2953 "App ID (Hex)",
2954 "Limit the decoding to RTPS messages coming from the specified GUID."
2955 "Leave the field empty or use the '*' character to match any GUID."),
2956 UAT_FLD_CSTRING(
2957 rtps_psk_table_entry_field, instance_id_in,
2958 "Instance ID (Hex)",
2959 "Limit the decoding to RTPS messages coming from the specified GUID."
2960 "Leave the field empty or use the '*' character to match any GUID."),
2961 UAT_END_FIELDS
2964 static void *rtps_psk_options_copy_entry(
2965 void *destination,
2966 const void *source,
2967 size_t length _U_)
2969 const rtps_psk_options_entry_t *src = source;
2970 rtps_psk_options_entry_t *dest = destination;
2972 dest->passphrase_secret = g_strdup(src->passphrase_secret);
2974 dest->passphrase_id = src->passphrase_id;
2975 dest->passphrase_id_in = g_strdup(src->passphrase_id_in);
2977 dest->host_id = src->host_id;
2978 dest->host_id_in = g_strdup(src->host_id_in);
2980 dest->app_id = src->app_id;
2981 dest->app_id_in = g_strdup(src->app_id_in);
2983 dest->instance_id = src->instance_id;
2984 dest->instance_id_in = g_strdup(src->instance_id_in);
2986 return dest;
2989 static void rtps_psk_options_free_entry(void *record)
2991 rtps_psk_options_entry_t *entry = record;
2993 g_free(entry->passphrase_secret);
2994 entry->passphrase_secret = NULL;
2996 g_free(entry->passphrase_id_in);
2997 entry->passphrase_id_in = NULL;
2999 g_free(entry->host_id_in);
3000 entry->host_id_in = NULL;
3002 g_free(entry->app_id_in);
3003 entry->app_id_in = NULL;
3005 g_free(entry->instance_id_in);
3006 entry->instance_id_in = NULL;
3007 return;
3010 static bool rtps_psk_options_entry_uint32_string_validate(
3011 char **error_string,
3012 rtps_psk_options_entry_uint32_string_t *out,
3013 char *in,
3014 const char *field_name)
3016 if (in == NULL || strlen(in) == 0 || in[0] == '*') {
3017 out->ignore = true;
3018 } else {
3019 if (!ws_strtou32(in, NULL, &out->value)) {
3020 *error_string = g_strdup_printf(
3021 "The '%s' field must be either the '*' wildcard character, or a "
3022 "valid integer.",
3023 field_name);
3024 return false;
3027 return true;
3030 static bool rtps_psk_options_update_entry(void *record, char **error_string)
3032 size_t PASSPHRASE_MAX_LENGTH = 512; /* fixed by specification. */
3033 rtps_psk_options_entry_t *entry = record;
3034 size_t passphrase_length = 0;
3036 /* Validation of the Passphrase Id. */
3037 if (!rtps_psk_options_entry_uint32_string_validate(
3038 error_string,
3039 &entry->passphrase_id,
3040 entry->passphrase_id_in,
3041 "Passphrase Id")) {
3042 return false;
3045 /* Validation of the Passphrase Secret. */
3046 if (entry->passphrase_secret == NULL) {
3047 *error_string = g_strdup("The 'Passphrase Secret' field can't be empty");
3048 return false;
3050 g_strstrip(entry->passphrase_secret);
3052 passphrase_length = strlen(entry->passphrase_secret);
3053 if (passphrase_length == 0) {
3054 *error_string = g_strdup("The 'Passphrase Secret' field can't be empty");
3055 return false;
3057 if (passphrase_length > (PASSPHRASE_MAX_LENGTH - 1)) {
3058 *error_string = g_strdup_printf(
3059 "The 'Passphrase Secret' field has %zu characters length. "
3060 "It cannot be larger than %zu characters.",
3061 passphrase_length,
3062 PASSPHRASE_MAX_LENGTH - 1); /* last byte is for null character. */
3063 return false;
3066 /* Validation of the Host Id. */
3067 if (!rtps_psk_options_entry_uint32_string_validate(
3068 error_string,
3069 &entry->host_id,
3070 entry->host_id_in,
3071 "Host Id")) {
3072 return false;
3075 /* Validation of the App Id. */
3076 if (!rtps_psk_options_entry_uint32_string_validate(
3077 error_string,
3078 &entry->app_id,
3079 entry->app_id_in,
3080 "App Id")) {
3081 return false;
3084 /* Validation of the Instance Id. */
3085 if (!rtps_psk_options_entry_uint32_string_validate(
3086 error_string,
3087 &entry->instance_id,
3088 entry->instance_id_in,
3089 "Instance Id")) {
3090 return false;
3093 return true;
3095 /* End of PSK table options */
3097 static void rtps_current_packet_decryption_info_reset(
3098 rtps_current_packet_decryption_info_t *info)
3100 rtps_guid_prefix_t guid_prefix_zero = {0, 0, 0};
3102 info->guid_prefix = guid_prefix_zero;
3103 info->try_psk_decryption = false;
3104 info->session_id = 0;
3105 info->transformation_key = 0;
3106 info->algorithm = CRYPTO_ALGORITHM_NONE;
3107 memset(info->init_vector, 0, RTPS_SECURITY_INIT_VECTOR_LEN);
3108 info->psk_index = 0;
3109 return;
3112 /* ----------------------- PSK Session Key Generation ---------------------- */
3114 * The session key is calculated as follows:
3115 * HMAC-SHA256(
3116 * master_sender_key,
3117 * "SessionKey" | master_sender_salt | session_id)
3119 * This is implemented in rtps_psk_generate_session_key.
3121 * Each component of the above formula can be obtained as follows:
3123 * - master_sender_key and master_sender_salt 32 bytes element computed from:
3124 * HMAC-SHA256(prk_key, <derivation_suffix> | 0x01)
3126 * - prk_key: Implemented in rtps_psk_generate_prk_key.
3127 * HMAC-SHA256(public_salt_for_master_key, preshared_secret_key)
3129 * - public_salt_for_master_key (256 bits): Implemented in
3130 * rtps_generate_public_salt.
3131 * concatenate(
3132 * <prk_prefix> (64 bits),
3133 * <sender_key_id> (32 bits),
3134 * RTPS header (160 bits))
3135 * - preshared_secret_key: Secret key given by the user in the
3136 * dialog.
3138 * Where <derivation_suffix> is equal to "master sender key derivation" for
3139 * the master_sender_key and "master salt derivation" for the
3140 * master_sender_salt.
3142 * Where <prk_prefix> is equal to "PSK-SKEY" for the master_sender_key and
3143 * "PSK-SALT" for the master_sender_salt.
3145 * Where <sender_key_id> is sent in the transformation_key_id field of the
3146 * crypto header (only when the message is encoded using PSK).
3148 * This is implemented in rtps_psk_generate_master_sender.
3150 * - session_id: We can read the session_id from the crypto header of the
3151 * SRTPS_PREFIX submessage.
3152 * Note: The session_id is a counter starting at zero and increased by one
3153 * every time we have encoded a specific number of messages.
3155 static bool rtps_psk_generate_master_sender(
3156 uint8_t *output,
3157 bool is_salt,
3158 const char* preshared_secret_key,
3159 uint32_t sender_key_id,
3160 tvbuff_t *rtps_header_tvb,
3161 int rtps_header_tvb_offset);
3163 static gcry_error_t rtps_util_generate_hmac_sha256(
3164 void *output,
3165 const void *key,
3166 const void *data,
3167 size_t datalen);
3170 * @brief Generate the session key that will be used to decrypt PSK-encoded RTPS
3171 * messages. It requires the pre-shared secret key known and given by the user,
3172 * the RTPS header, and two fields (sender key id and session id) sent on the
3173 * wire.
3175 static bool rtps_psk_generate_session_key(
3176 packet_info *pinfo,
3177 const char *preshared_secret_key,
3178 uint32_t sender_key_id,
3179 uint32_t session_id,
3180 uint8_t *buffer)
3182 const char *sessionKeyString = "SessionKey";
3183 rtps_tvb_field* rtps_root = NULL;
3184 uint8_t sender_key[RTPS_HMAC_256_BUFFER_SIZE_BYTES];
3186 * Must be big enough to fit the sessionKeyString, the master sender key and
3187 * the session id.
3189 uint8_t input[50];
3190 size_t offset = 0;
3192 rtps_root = (rtps_tvb_field*) p_get_proto_data(
3193 pinfo->pool,
3194 pinfo,
3195 proto_rtps,
3196 RTPS_ROOT_MESSAGE_KEY);
3197 if (rtps_root == NULL || buffer == NULL) {
3198 return false;
3201 memcpy(input, sessionKeyString, strlen(sessionKeyString));
3202 offset += strlen(sessionKeyString);
3204 if (!rtps_psk_generate_master_sender(
3205 input + offset,
3206 true, /* is_salt. */
3207 preshared_secret_key,
3208 sender_key_id,
3209 rtps_root->tvb,
3210 rtps_root->tvb_offset)) {
3211 return false;
3213 offset += RTPS_HMAC_256_BUFFER_SIZE_BYTES;
3215 memcpy(
3216 input + offset,
3217 &session_id,
3218 sizeof(uint32_t));
3219 offset += sizeof(uint32_t);
3221 if (!rtps_psk_generate_master_sender(
3222 sender_key,
3223 false, /* is_salt. */
3224 preshared_secret_key,
3225 sender_key_id,
3226 rtps_root->tvb,
3227 rtps_root->tvb_offset)) {
3228 return false;
3231 return rtps_util_generate_hmac_sha256(
3232 buffer,
3233 sender_key,
3234 input,
3235 offset) == GPG_ERR_NO_ERROR;
3238 static bool rtps_psk_generate_prk_key(
3239 uint8_t *output,
3240 const char *prefix,
3241 const char *preshared_secret_key,
3242 uint32_t sender_key_id,
3243 tvbuff_t *rtps_header_tvb,
3244 int rtps_header_tvb_offset);
3247 * @brief Generate the master sender key or master sender salt (depending on the
3248 * is_salt parameter) that will be used to derive the session key.
3250 static bool rtps_psk_generate_master_sender(
3251 uint8_t *output,
3252 bool is_salt,
3253 const char* preshared_secret_key,
3254 uint32_t sender_key_id,
3255 tvbuff_t *rtps_header_tvb,
3256 int rtps_header_tvb_offset)
3258 const char *prk_prefix = is_salt ? "PSK-SALT" : "PSK-SKEY";
3259 const char *suffix = is_salt ?
3260 "master salt derivation" :
3261 "master sender key derivation";
3262 uint8_t prk_key[RTPS_HMAC_256_BUFFER_SIZE_BYTES];
3263 /* Must be big enough to fit the largest suffix and the 0x1 constant byte. */
3264 uint8_t input[50];
3266 if (!rtps_psk_generate_prk_key(
3267 prk_key,
3268 prk_prefix,
3269 preshared_secret_key,
3270 sender_key_id,
3271 rtps_header_tvb,
3272 rtps_header_tvb_offset)) {
3273 return false;
3276 memcpy(input, suffix, strlen(suffix));
3277 input[strlen(suffix)] = 0x1; /* Fixed value. */
3279 return rtps_util_generate_hmac_sha256(
3280 output,
3281 prk_key,
3282 input,
3283 strlen(suffix) + 1) == GPG_ERR_NO_ERROR;
3286 static void rtps_generate_public_salt(
3287 uint8_t *output,
3288 const char *prefix,
3289 uint32_t sender_key_id,
3290 tvbuff_t *rtps_header_tvb,
3291 int rtps_header_tvb_offset);
3294 * @brief Compute the Pseudo-Random Key; an intermediate step to get the
3295 * master sender. This function computes:
3296 * HMAC-SHA256(
3297 * concatenate(prefix, sender_key_id. rtps_header),
3298 * preshared_secret_key)
3300 static bool rtps_psk_generate_prk_key(
3301 uint8_t *output,
3302 const char *prefix,
3303 const char *preshared_secret_key,
3304 uint32_t sender_key_id,
3305 tvbuff_t *rtps_header_tvb,
3306 int rtps_header_tvb_offset)
3308 gcry_error_t error = GPG_ERR_NO_ERROR;
3309 uint8_t public_salt[RTPS_HMAC_256_BUFFER_SIZE_BYTES];
3311 rtps_generate_public_salt(
3312 public_salt,
3313 prefix,
3314 sender_key_id,
3315 rtps_header_tvb,
3316 rtps_header_tvb_offset);
3318 error = rtps_util_generate_hmac_sha256(
3319 output,
3320 public_salt,
3321 preshared_secret_key,
3322 strlen(preshared_secret_key));
3323 return error == GPG_ERR_NO_ERROR;
3327 * @brief Generates the public salt that can be used to derive the prk_key
3328 * and prk_salt Pseudo-Random Keys.
3330 * It does the concatenation of:
3331 * concatenate(
3332 * <8-byte prefix>,
3333 * <4-byte sender's key id>,
3334 * <20-byte RTPS header>)
3335 * So output must be a 32-byte buffer (i.e. RTPS_HMAC_256_BUFFER_SIZE_BYTES).
3337 static void rtps_generate_public_salt(
3338 uint8_t *output,
3339 const char *prefix,
3340 uint32_t sender_key_id,
3341 tvbuff_t *rtps_header_tvb,
3342 int rtps_header_tvb_offset)
3344 size_t offset = 0;
3346 /* Copy the 8-byte prefix. */
3347 memcpy(output, prefix, strlen(prefix));
3348 offset += strlen(prefix);
3350 /* Copy the 4-byte sender's key id. */
3351 memcpy(output + offset, &sender_key_id, sizeof(uint32_t));
3352 offset += sizeof(uint32_t);
3354 /* Copy the 20-byte RTPS header. */
3355 tvb_memcpy(
3356 rtps_header_tvb,
3357 output + offset,
3358 rtps_header_tvb_offset,
3359 20); /* RTPS HEADER SIZE. */
3361 return;
3365 * @brief Compute the HMAC-SHA256 of the data using the key.
3366 * This function is required to derive the PSK session key.
3368 static gcry_error_t rtps_util_generate_hmac_sha256(
3369 void *output,
3370 const void *key,
3371 const void *data,
3372 size_t datalen)
3374 gcry_mac_hd_t hmac;
3375 gcry_error_t error = GPG_ERR_NO_ERROR;
3376 size_t OUTPUT_SIZE = RTPS_HMAC_256_BUFFER_SIZE_BYTES;
3378 error = gcry_mac_open(&hmac, GCRY_MAC_HMAC_SHA256, 0, NULL);
3379 if (error != GPG_ERR_NO_ERROR) {
3380 gcry_mac_close(hmac);
3381 return error;
3384 error = gcry_mac_setkey(hmac, key, RTPS_HMAC_256_BUFFER_SIZE_BYTES);
3385 if (error != GPG_ERR_NO_ERROR) {
3386 gcry_mac_close(hmac);
3387 return error;
3390 error = gcry_mac_write(hmac, data, datalen);
3391 if (error != GPG_ERR_NO_ERROR) {
3392 gcry_mac_close(hmac);
3393 return error;
3396 error = gcry_mac_read(hmac, output, &OUTPUT_SIZE);
3397 if (error != GPG_ERR_NO_ERROR) {
3398 gcry_mac_close(hmac);
3399 ws_warning("Failure: %s/%s",
3400 gcry_strsource (error),
3401 gcry_strerror (error));
3402 return error;
3405 gcry_mac_close(hmac);
3406 return error;
3408 /* ------------------------------------------------------------------------- */
3411 * @brief Translate between the RTPS and gcrypt types.
3413 static int rtps_encryption_algorithm_to_gcry_enum(
3414 rtps_encryption_algorithm_t rtps_enum_in,
3415 int *gcry_cipher_mode_out)
3417 if (gcry_cipher_mode_out == NULL) {
3418 return -1;
3420 switch(rtps_enum_in) {
3421 case CRYPTO_ALGORITHM_AES128_GMAC:
3422 *gcry_cipher_mode_out = GCRY_CIPHER_MODE_CCM;
3423 return GCRY_CIPHER_AES128;
3424 case CRYPTO_ALGORITHM_AES128_GCM:
3425 *gcry_cipher_mode_out = GCRY_CIPHER_MODE_GCM;
3426 return GCRY_CIPHER_AES128;
3427 case CRYPTO_ALGORITHM_AES256_GMAC:
3428 *gcry_cipher_mode_out = GCRY_CIPHER_MODE_CCM;
3429 return GCRY_CIPHER_AES256;
3430 case CRYPTO_ALGORITHM_AES256_GCM:
3431 *gcry_cipher_mode_out = GCRY_CIPHER_MODE_GCM;
3432 return GCRY_CIPHER_AES256;
3433 case CRYPTO_ALGORITHM_NONE:
3434 default:
3435 *gcry_cipher_mode_out = GCRY_CIPHER_MODE_NONE;
3436 return GCRY_CIPHER_NONE;
3440 static gcry_error_t rtps_util_decrypt_data(
3441 uint8_t *encrypted_data,
3442 size_t encrypted_data_size,
3443 uint8_t *key,
3444 uint8_t *init_vector,
3445 uint8_t *tag,
3446 rtps_encryption_algorithm_t algorithm)
3448 gcry_error_t err = GPG_ERR_NO_ERROR;
3449 gcry_cipher_hd_t cipher_hd;
3450 int encription_algo;
3451 int encription_mode = 0;
3453 encription_algo = rtps_encryption_algorithm_to_gcry_enum(
3454 algorithm,
3455 &encription_mode);
3457 err = gcry_cipher_open(
3458 &cipher_hd,
3459 encription_algo,
3460 encription_mode,
3462 if (err != GPG_ERR_NO_ERROR) {
3463 ws_warning(
3464 "GCRY: cipher open %s/%s\n",
3465 gcry_strsource(err),
3466 gcry_strerror(err));
3467 return err;
3470 err = gcry_cipher_setkey(cipher_hd, key, RTPS_HMAC_256_BUFFER_SIZE_BYTES);
3471 if (err != GPG_ERR_NO_ERROR) {
3472 ws_warning(
3473 "GCRY: setkey %s/%s\n",
3474 gcry_strsource(err),
3475 gcry_strerror(err));
3476 gcry_cipher_close(cipher_hd);
3477 return err;
3480 if (init_vector != NULL) {
3481 err = gcry_cipher_setiv(
3482 cipher_hd,
3483 init_vector,
3484 RTPS_SECURITY_INIT_VECTOR_LEN);
3485 if (err != GPG_ERR_NO_ERROR) {
3486 ws_warning(
3487 "GCRY: setiv %s/%s\n",
3488 gcry_strsource(err),
3489 gcry_strerror(err));
3490 gcry_cipher_close(cipher_hd);
3491 return err;
3495 err = gcry_cipher_decrypt(
3496 cipher_hd,
3497 encrypted_data,
3498 encrypted_data_size,
3499 NULL,
3501 if (err != GPG_ERR_NO_ERROR) {
3502 ws_warning(
3503 "GCRY: encrypt %s/%s\n",
3504 gcry_strsource(err),
3505 gcry_strerror(err));
3506 gcry_cipher_close(cipher_hd);
3507 return err;
3510 if (tag != NULL) {
3511 err = gcry_cipher_checktag(cipher_hd, tag, SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH);
3512 if (err != GPG_ERR_NO_ERROR) {
3513 ws_warning(
3514 "GCRY: Decryption (checktag) failed: %s/%s\n",
3515 gcry_strsource(err),
3516 gcry_strerror(err));
3520 gcry_cipher_close(cipher_hd);
3521 return err;
3525 * @brief Generates the session key and uses it to decrypt the secure payload.
3526 * The decripted payload is stored in an allocated buffer using the allocator
3527 * passed as parameter.
3529 static uint8_t *rtps_decrypt_secure_payload(
3530 tvbuff_t *tvb,
3531 packet_info *pinfo,
3532 int offset,
3533 size_t secure_payload_len,
3534 uint8_t *preshared_secret_key,
3535 uint8_t *init_vector,
3536 rtps_encryption_algorithm_t algorithm,
3537 uint32_t transformation_key,
3538 uint32_t session_id,
3539 uint8_t *tag,
3540 uint8_t *session_key_output,
3541 gcry_error_t* error,
3542 wmem_allocator_t *allocator)
3544 uint8_t *secure_body_ptr;
3546 if (!rtps_psk_generate_session_key(
3547 pinfo,
3548 preshared_secret_key,
3549 transformation_key,
3550 session_id,
3551 session_key_output)) {
3552 return NULL;
3555 secure_body_ptr = wmem_alloc0(allocator, secure_payload_len);
3556 if (secure_body_ptr == NULL) {
3557 return NULL;
3560 tvb_memcpy(tvb, secure_body_ptr, offset, secure_payload_len);
3562 *error = rtps_util_decrypt_data(
3563 secure_body_ptr,
3564 secure_payload_len,
3565 session_key_output,
3566 init_vector,
3567 tag,
3568 algorithm);
3571 * Free the allocated memory if the decryption goes wrong or if the content is
3572 * not healthy.
3574 if (*error != GPG_ERR_NO_ERROR) {
3575 wmem_free(allocator, secure_body_ptr);
3576 secure_body_ptr = NULL;
3578 return secure_body_ptr;
3580 /******************************************************************************/
3582 static const true_false_string tfs_little_big_endianness = { "Little-Endian", "Big-Endian" };
3584 /* #19359 - ensure strings we copy aren't truncated halfway through a Unicode codepoint */
3585 static void rtps_strlcpy(char *dest, const char *src, size_t dest_size)
3587 /* Reserving the last character in case ws_utf8_truncate overwrites it */
3588 (void) g_strlcpy(dest, src, dest_size);
3589 ws_utf8_truncate(dest, strlen(dest));
3592 static int check_offset_addition(int offset, uint32_t value, proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb)
3594 int new_offset = offset + (int)value;
3595 if (new_offset < offset) {
3596 proto_tree_add_expert_format(tree, pinfo, &ei_rtps_value_too_large, tvb, 0, 0, "Offset value too large: %u", value);
3597 THROW(ReportedBoundsError);
3599 return new_offset;
3602 static void rtps_util_dissect_parameter_header(tvbuff_t * tvb, int * offset,
3603 const unsigned encoding, uint32_t * member_id, uint32_t * member_length) {
3604 *member_id = tvb_get_uint16(tvb, *offset, encoding);
3605 *offset += 2;
3606 *member_length = tvb_get_uint16(tvb, *offset, encoding);
3607 *offset += 2;
3609 if ((*member_id & PID_EXTENDED) == PID_EXTENDED) {
3610 /* get extended member id and length */
3611 *member_id = tvb_get_uint32(tvb, *offset, encoding);
3612 *offset += 4;
3613 *member_length = tvb_get_uint32(tvb, *offset, encoding);
3614 *offset += 4;
3618 static int dissect_crypto_algorithm_requirements(proto_tree *tree , tvbuff_t* tvb,
3619 int offset, int encoding, int* const *flags) {
3620 proto_tree_add_bitmask(
3621 tree,
3622 tvb,
3623 offset,
3624 hf_rtps_param_crypto_algorithm_requirements_trust_chain,
3625 ett_rtps_flags, flags,
3626 encoding);
3627 offset += 4;
3628 proto_tree_add_bitmask(
3629 tree,
3630 tvb,
3631 offset,
3632 hf_rtps_param_crypto_algorithm_requirements_message_auth,
3633 ett_rtps_flags, flags,
3634 encoding);
3635 offset += 4;
3636 return offset;
3639 static int dissect_mutable_member(proto_tree *tree , tvbuff_t * tvb, packet_info *pinfo, int offset, unsigned encoding, unsigned encoding_version,
3640 dissection_info * info, bool * is_end, bool show);
3642 static int get_native_type_cdr_length(uint64_t member_kind) {
3643 unsigned length = 0;
3645 switch (member_kind) {
3646 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE: {
3647 length = 1;
3648 break;
3650 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE:
3651 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE: {
3652 length = 1;
3653 break;
3655 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE: {
3656 length = 2;
3657 break;
3659 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE: {
3660 length = 2;
3661 break;
3663 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE:
3664 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE: {
3665 length = 4;
3666 break;
3668 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE: {
3669 length = 4;
3670 break;
3672 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE: {
3673 length = 8;
3674 break;
3676 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE: {
3677 length = 8;
3678 break;
3680 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE: {
3681 length = 4;
3682 break;
3684 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE: {
3685 length = 8;
3686 break;
3688 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE: {
3689 length = 16;
3690 break;
3692 default: {
3693 /* XXX We should probably add expert info, but make sure our offset advances for now. */
3694 length = 1;
3695 break;
3698 return length;
3701 static int get_native_type_cdr_alignment(uint64_t member_kind, int encapsulation_version) {
3702 unsigned align = 0;
3704 switch (member_kind) {
3705 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE: {
3706 align = 1;
3707 break;
3709 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE:
3710 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE: {
3711 align = 1;
3712 break;
3714 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE: {
3715 align = 2;
3716 break;
3718 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE: {
3719 align = 2;
3720 break;
3722 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE:
3723 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE: {
3724 align = 4;
3725 break;
3727 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE: {
3728 align = 4;
3729 break;
3731 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE: {
3732 align = (encapsulation_version == 1) ? 8 : 4;
3733 break;
3735 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE: {
3736 align = (encapsulation_version == 1) ? 8 : 4;
3737 break;
3739 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE: {
3740 align = 4;
3741 break;
3743 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE: {
3744 align = (encapsulation_version == 1) ? 8 : 4;
3745 break;
3747 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE: {
3748 align = (encapsulation_version == 1) ? 8 : 4;
3749 break;
3751 default: {
3752 align = 1;
3753 break;
3756 return align;
3759 static int get_encapsulation_endianness(int encapsulation_id)
3761 return (encapsulation_id == ENCAPSULATION_CDR_LE ||
3762 encapsulation_id == ENCAPSULATION_PL_CDR_LE ||
3763 encapsulation_id == ENCAPSULATION_CDR2_LE ||
3764 encapsulation_id == ENCAPSULATION_D_CDR2_LE ||
3765 encapsulation_id == ENCAPSULATION_PL_CDR2_LE) ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN;
3768 static int get_encapsulation_version(int encapsulation_id)
3770 return (encapsulation_id == ENCAPSULATION_CDR2_LE ||
3771 encapsulation_id == ENCAPSULATION_D_CDR2_LE ||
3772 encapsulation_id == ENCAPSULATION_PL_CDR2_LE) ? 2 : 1;
3776 static dissection_info* lookup_dissection_info_in_custom_and_builtin_types(uint64_t type_id) {
3777 dissection_info* info = NULL;
3778 if (dissection_infos != NULL) {
3779 info = (dissection_info*)wmem_map_lookup(dissection_infos, &(type_id));
3780 if (info == NULL && builtin_dissection_infos != NULL) {
3781 info = (dissection_info*)wmem_map_lookup(builtin_dissection_infos, &(type_id));
3784 return info;
3787 /* this is a recursive function. _info may or may not be NULL depending on the use iteration */
3788 // NOLINTNEXTLINE(misc-no-recursion)
3789 static int dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, packet_info *pinfo, int offset, unsigned encoding, unsigned encoding_version,
3790 dissection_info * _info, uint64_t type_id, char * name,
3791 RTICdrTypeObjectExtensibility extensibility, int offset_zero,
3792 uint16_t flags, uint32_t element_member_id, bool show) {
3794 uint64_t member_kind;
3795 dissection_info * info = NULL;
3796 uint32_t member_id;
3797 uint32_t member_length = 0;
3799 if (_info) { /* first call enters here */
3800 info = _info;
3801 member_kind = info->member_kind;
3802 } else {
3803 info = lookup_dissection_info_in_custom_and_builtin_types(type_id);
3804 if (info != NULL) {
3805 member_kind = info->member_kind;
3806 } else {
3807 member_kind = type_id;
3810 if ((flags & MEMBER_OPTIONAL) != 0) {
3811 int offset_before = offset;
3812 /* Parameter header is at minimum 4 bytes */
3813 ALIGN_ZERO(
3814 offset,
3815 get_native_type_cdr_alignment(RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE, encoding_version),
3816 offset_zero);
3817 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
3818 if (info
3819 && (flags & MEMBER_OPTIONAL) == MEMBER_OPTIONAL
3820 && element_member_id != 0
3821 && member_id != element_member_id) {
3822 offset = offset_before;
3823 return offset;
3825 if (member_length == 0) {
3826 return offset;
3829 if (extensibility == EXTENSIBILITY_MUTABLE) {
3830 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
3831 offset_zero = offset;
3832 if ((member_id & PID_LIST_END) == PID_LIST_END){
3833 /* If this is the end of the list, don't add a tree.
3834 * If we add more logic here in the future, take into account that
3835 * offset is incremented by 4 */
3836 offset += 0;
3837 return offset;
3839 if (member_length == 0){
3840 return offset;
3843 //proto_item_append_text(tree, "(Before Switch 0x%016" PRIx64 ")", type_id);
3845 increment_dissection_depth(pinfo);
3846 switch (member_kind) {
3847 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE: {
3848 int length = get_native_type_cdr_length(member_kind);
3849 if (show) {
3850 ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
3851 int16_t value = tvb_get_int8(tvb, offset);
3852 proto_tree_add_boolean_format(tree, hf_rtps_dissection_boolean, tvb, offset, length, value,
3853 "%s: %d", name, value);
3855 offset += length;
3856 break;
3858 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE:
3859 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE: {
3860 int length = get_native_type_cdr_length(member_kind);
3861 if (show) {
3862 ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
3863 int16_t value = tvb_get_int8(tvb, offset);
3864 proto_tree_add_uint_format(tree, hf_rtps_dissection_byte, tvb, offset, length, value,
3865 "%s: %d", name, value);
3867 offset += length;
3868 break;
3870 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE: {
3871 int length = get_native_type_cdr_length(member_kind);
3872 if (show) {
3873 ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
3874 int16_t value = tvb_get_int16(tvb, offset, encoding);
3875 proto_tree_add_int_format(tree, hf_rtps_dissection_int16, tvb, offset, length, value,
3876 "%s: %d", name, value);
3878 offset += length;
3879 break;
3881 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE: {
3882 int length = get_native_type_cdr_length(member_kind);
3883 if (show) {
3884 ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
3885 uint16_t value = tvb_get_uint16(tvb, offset, encoding);
3886 proto_tree_add_uint_format(tree, hf_rtps_dissection_uint16, tvb, offset, length, value,
3887 "%s: %u", name, value);
3889 offset += length;
3890 break;
3892 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE:
3893 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE: {
3894 int length = get_native_type_cdr_length(member_kind);
3895 if (show) {
3896 ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
3897 int value = tvb_get_int32(tvb, offset, encoding);
3898 proto_tree_add_int_format(tree, hf_rtps_dissection_int32, tvb, offset, length, value,
3899 "%s: %d", name, value);
3901 offset += length;
3902 break;
3904 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE: {
3905 int length = get_native_type_cdr_length(member_kind);
3906 if (show) {
3907 ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
3908 unsigned value = tvb_get_uint32(tvb, offset, encoding);
3909 proto_tree_add_uint_format(tree, hf_rtps_dissection_uint32, tvb, offset, length, value,
3910 "%s: %u", name, value);
3912 offset += length;
3913 break;
3915 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE: {
3916 int length = get_native_type_cdr_length(member_kind);
3917 if (show) {
3918 ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
3919 int64_t value = tvb_get_int64(tvb, offset, encoding);
3920 proto_tree_add_int64_format(tree, hf_rtps_dissection_int64, tvb, offset, length, value,
3921 "%s: %"PRId64, name, value);
3923 offset += length;
3924 break;
3926 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE: {
3927 int length = get_native_type_cdr_length(member_kind);
3928 if (show) {
3929 ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
3930 uint64_t value = tvb_get_uint64(tvb, offset, encoding);
3931 proto_tree_add_uint64_format(tree, hf_rtps_dissection_uint64, tvb, offset, length, value,
3932 "%s: %"PRIu64, name, value);
3934 offset += length;
3935 break;
3937 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE: {
3938 int length = get_native_type_cdr_length(member_kind);
3939 if (show) {
3940 ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
3941 float value = tvb_get_ieee_float(tvb, offset, encoding);
3942 proto_tree_add_float_format(tree, hf_rtps_dissection_float, tvb, offset, length, value,
3943 "%s: %.6f", name, value);
3945 offset += length;
3946 break;
3948 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE: {
3949 int length = get_native_type_cdr_length(member_kind);
3950 if (show) {
3951 ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
3952 double value = tvb_get_ieee_double(tvb, offset, encoding);
3953 proto_tree_add_double_format(tree, hf_rtps_dissection_double, tvb, offset, length, value,
3954 "%s: %.6f", name, value);
3956 offset += length;
3957 break;
3959 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE: {
3960 int length = get_native_type_cdr_length(member_kind);
3961 if (show) {
3962 ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
3963 proto_tree_add_item(tree, hf_rtps_dissection_int128, tvb, offset, length, encoding);
3965 offset += length;
3966 break;
3968 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE: {
3969 unsigned i;
3970 unsigned num_elements;
3971 proto_tree * aux_tree = NULL;
3972 int base_offset = offset;
3973 bool show_current_element = true;
3974 int array_kind_length = 0;
3975 unsigned bound = 0;
3976 int first_skipped_element_offset = 0;
3978 if (info != NULL) {
3979 bound = (unsigned)info->bound;
3981 /* In case this array is not shown and is a native type. We get the sze length for calculating
3982 * the whole array length */
3983 array_kind_length = get_native_type_cdr_length(info->base_type_id);
3985 /* Do not add any information to the tree if it is not shown */
3986 if (show) {
3987 aux_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtps_dissection_tree,
3988 NULL, name);
3989 } else if (array_kind_length != -1) {
3990 /* Total length of the array. Nothing else to do here. */
3991 offset += bound * array_kind_length;
3992 break;
3995 /* Get the maximum number of elements to be shown */
3996 num_elements = (enable_max_array_data_type_elements)
3997 ? MIN(bound, rtps_max_array_data_type_elements)
3998 : bound;
3999 for (i = 0; i < bound; i++) {
4000 char temp_buff[MAX_MEMBER_NAME];
4002 if (show && i < num_elements) {
4003 /* No need to copy if it will not be shown */
4004 snprintf(temp_buff, MAX_MEMBER_NAME, "%s[%u]", name, i);
4005 show_current_element = true;
4006 } else {
4007 if (show_current_element) {
4008 show_current_element = false;
4009 /* Updated only once */
4010 first_skipped_element_offset = offset;
4012 /* If this array has elements that won't be shown and is an array of native type
4013 * we can calculate the total offset and break the loop */
4014 if (array_kind_length != -1) {
4015 offset += (bound - i) * array_kind_length;
4016 break;
4019 offset = dissect_user_defined(aux_tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
4020 info->base_type_id, temp_buff, EXTENSIBILITY_INVALID, offset_zero, 0, 0, show_current_element);
4023 /* If reached the limit and there are remaining elements we need to show the message and
4024 * assign the length of the ramining elements to this */
4025 if (enable_max_array_data_type_elements && show && !show_current_element) {
4026 proto_tree_add_subtree_format(
4027 aux_tree,
4028 tvb,
4029 /* Start at the first item not shown */
4030 first_skipped_element_offset,
4031 offset - first_skipped_element_offset,
4032 ett_rtps_info_remaining_items,
4033 NULL,
4034 DISSECTION_INFO_REMAINING_ELEMENTS_STR_d,
4035 bound - num_elements);
4037 proto_item_set_len(aux_tree, offset - base_offset);
4038 break;
4040 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE: {
4041 unsigned i;
4042 unsigned num_elements;
4043 proto_tree * aux_tree = NULL;
4044 int base_offset = offset;
4045 bool show_current_element = true;
4046 int length = 4;
4047 int sequence_kind_length = 0;
4048 int first_skipped_element_offset = 0;
4050 ALIGN_ZERO(offset, length, offset_zero);
4051 unsigned seq_size = tvb_get_uint32(tvb, offset, encoding);
4053 /* In case this sequence is not shown and is a native type. We get the sze length for calculating
4054 * the whole seuqnece length */
4055 if (info != NULL) {
4056 sequence_kind_length = get_native_type_cdr_length(info->base_type_id);
4058 if (show) {
4059 aux_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_rtps_dissection_tree,
4060 NULL, "%s (%u elements)", name, seq_size);
4061 /* If it is a native type we can calculate the sequence length and finish. */
4062 } else if (sequence_kind_length != -1) {
4063 /* Number of elements integer size + number of elements * size of the native type */
4064 offset += 4 + seq_size * sequence_kind_length;
4065 break;
4067 offset += 4;
4069 num_elements = (enable_max_array_data_type_elements)
4070 ? MIN(seq_size, rtps_max_array_data_type_elements)
4071 : seq_size;
4072 for (i = 0; i < seq_size; i++) {
4073 char temp_buff[MAX_MEMBER_NAME];
4074 if (show && i < num_elements) {
4075 /* No need to copy if it will not be shown */
4076 snprintf(temp_buff, MAX_MEMBER_NAME, "%s[%u]", name, i);
4077 show_current_element = true;
4078 } else {
4079 if (show_current_element) {
4080 show_current_element = false;
4081 /* Updated only once */
4082 first_skipped_element_offset = offset;
4084 /* If this array has elements that won't be shown and is an array of native type
4085 * we can calculate the total offset and break the loop */
4086 if (sequence_kind_length != -1) {
4087 offset += (seq_size - i) * sequence_kind_length;
4088 break;
4091 if (info != NULL && info->base_type_id > 0)
4092 offset = dissect_user_defined(aux_tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
4093 info->base_type_id, temp_buff, EXTENSIBILITY_INVALID, offset_zero, 0, 0, show_current_element);
4095 /* If reached the limit and there are remaining elements we need to show the message and
4096 * assign the length of the ramining elements to this */
4097 if (enable_max_array_data_type_elements && show && !show_current_element) {
4098 proto_tree_add_subtree_format(
4099 aux_tree,
4100 tvb,
4101 /* Start at the first item not shown */
4102 first_skipped_element_offset,
4103 offset - first_skipped_element_offset,
4104 ett_rtps_info_remaining_items,
4105 NULL,
4106 DISSECTION_INFO_REMAINING_ELEMENTS_STR_d,
4107 seq_size - num_elements);
4109 proto_item_set_len(aux_tree, offset - base_offset);
4110 break;
4112 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRING_TYPE: {
4113 char * string_value = NULL;
4114 int length = 4;
4116 ALIGN_ZERO(offset, length, offset_zero);
4117 unsigned string_size = tvb_get_uint32(tvb, offset, encoding);
4118 offset += 4;
4119 //proto_item_append_text(tree, "(String length: %u)", string_size);
4120 if (show) {
4121 string_value = tvb_get_string_enc(pinfo->pool, tvb, offset, string_size, ENC_ASCII);
4122 proto_tree_add_string_format(tree, hf_rtps_dissection_string, tvb, offset, string_size,
4123 string_value, "%s: %s", name, string_value);
4125 offset += string_size;
4126 break;
4128 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ALIAS_TYPE: {
4129 uint64_t base_type_id = 0;
4130 if (info != NULL) {
4131 base_type_id = info->base_type_id;
4133 offset = dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
4134 base_type_id, name, EXTENSIBILITY_INVALID, offset_zero, 0, 0, show);
4135 break;
4137 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UNION_TYPE: {
4138 uint64_t key = type_id - 1;
4139 union_member_mapping * result = (union_member_mapping *)wmem_map_lookup(union_member_mappings, &(key));
4141 if (result != NULL) {
4142 int value = tvb_get_int32(tvb, offset, encoding);
4143 offset += 4;
4144 key = type_id + value;
4145 result = (union_member_mapping *)wmem_map_lookup(union_member_mappings, &(key));
4146 if (result != NULL) {
4147 if (show) {
4148 proto_item_append_text(tree, " (discriminator = %d, type_id = 0x%016" PRIx64 ")",
4149 value, result->member_type_id);
4151 offset = dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
4152 result->member_type_id, result->member_name, EXTENSIBILITY_INVALID, offset, 0, 0, show);
4153 } else {
4154 /* the hashmap uses the type_id to index the objects. subtracting -2 here to lookup the discriminator
4155 related to the type_id that identifies an union */
4156 key = type_id + HASHMAP_DISCRIMINATOR_CONSTANT;
4157 result = (union_member_mapping *)wmem_map_lookup(union_member_mappings, &(key));
4158 if (result != NULL) {
4159 if (show) {
4160 proto_item_append_text(tree, " (discriminator = %d, type_id = 0x%016" PRIx64 ")",
4161 value, result->member_type_id);
4163 offset = dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
4164 result->member_type_id, result->member_name, EXTENSIBILITY_INVALID, offset, 0, 0, show);
4167 } else {
4168 if (show) {
4169 proto_item_append_text(tree, "(NULL 0x%016" PRIx64 ")", type_id);
4172 break;
4174 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE: {
4175 unsigned i;
4176 proto_tree * aux_tree = NULL;
4177 unsigned shown_elements = 0;
4178 bool show_current_element = true;
4179 unsigned num_elements = 0;
4180 int first_skipped_element_offset = 0;
4182 if (info != NULL) {
4183 if (show) {
4184 aux_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtps_dissection_tree,
4185 NULL, name);
4187 if (info->extensibility == EXTENSIBILITY_MUTABLE) {
4188 bool is_end = false;
4189 /* Don't know beforehand the number of elements. Need to count them */
4190 while (!is_end) {
4191 if (!(show && shown_elements < rtps_max_data_type_elements) && show_current_element) {
4192 show_current_element = false;
4193 /* Updated only once */
4194 first_skipped_element_offset = offset;
4196 offset = dissect_mutable_member(aux_tree, tvb, pinfo, offset, encoding, encoding_version, info, &is_end, show_current_element);
4197 ++num_elements;
4198 if (show_current_element) {
4199 ++shown_elements;
4203 else {
4204 if (info->base_type_id > 0) {
4205 if (show) {
4206 proto_item_append_text(tree, "(BaseId: 0x%016" PRIx64 ")", info->base_type_id);
4208 offset = dissect_user_defined(aux_tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
4209 info->base_type_id, info->member_name, EXTENSIBILITY_INVALID,
4210 offset, 0, 0, show);
4213 /* Get the maximum number of elements to be shown depending if enable_max_data_type_elements is enabled */
4214 shown_elements = (enable_max_data_type_elements)
4215 ? MIN(info->num_elements, rtps_max_data_type_elements)
4216 : info->num_elements;
4217 for (i = 0; i < info->num_elements; i++) {
4218 if (info->elements[i].type_id > 0) {
4219 /* A member is shown if the parent cluster is shown and the position is in the
4220 * range of maximum number of elements shown */
4221 if (!(show && i < shown_elements) && show_current_element) {
4222 show_current_element = false;
4223 /* Updated only once */
4224 first_skipped_element_offset = offset;
4226 /* If a member is not shown all it children will inherit the "show_current_element" value */
4227 offset = dissect_user_defined(aux_tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
4228 info->elements[i].type_id, info->elements[i].member_name, info->extensibility,
4229 offset_zero, info->elements[i].flags, info->elements[i].member_id, show_current_element);
4232 num_elements = info->num_elements;
4234 /* If reached the limit and there are remaining elements we need to show the message and
4235 * assign the length of the ramining elements to this */
4236 if (enable_max_array_data_type_elements && show && !show_current_element) {
4237 proto_tree_add_subtree_format(
4238 aux_tree,
4239 tvb,
4240 first_skipped_element_offset,
4241 offset - first_skipped_element_offset,
4242 ett_rtps_info_remaining_items,
4243 NULL,
4244 DISSECTION_INFO_REMAINING_ELEMENTS_STR_d,
4245 num_elements - shown_elements);
4248 break;
4250 default:{
4251 /* undefined behavior. this should not happen. the following line helps to debug if it happened */
4252 if (show) {
4253 proto_item_append_text(tree, "(unknown 0x%016" PRIx64 ")", member_kind);
4255 break;
4258 decrement_dissection_depth(pinfo);
4260 if (extensibility == EXTENSIBILITY_MUTABLE) {
4261 offset_zero += member_length;
4262 return offset_zero;
4263 } else {
4264 return offset;
4268 // NOLINTNEXTLINE(misc-no-recursion)
4269 static int dissect_mutable_member(proto_tree *tree , tvbuff_t * tvb, packet_info *pinfo, int offset, unsigned encoding, unsigned encoding_version,
4270 dissection_info * info, bool * is_end, bool show) {
4272 proto_tree * member;
4273 uint32_t member_id, member_length;
4274 mutable_member_mapping * mapping;
4275 int64_t key;
4277 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
4278 if ((member_id & PID_LIST_END) == PID_LIST_END){
4279 /* If this is the end of the list, don't add a tree.
4280 * If we add more logic here in the future, take into account that
4281 * offset is incremented by 4 */
4282 offset += 0;
4283 *is_end = true;
4284 return offset;
4286 if (member_length == 0){
4287 return offset;
4289 member = proto_tree_add_subtree_format(tree, tvb, offset, member_length, ett_rtps_dissection_tree,
4290 NULL, "ID: %d, Length: %d", member_id, member_length);
4293 if (info->base_type_id > 0) {
4294 key = (info->base_type_id + info->base_type_id * member_id);
4295 mapping = (mutable_member_mapping *) wmem_map_lookup(mutable_member_mappings, &(key));
4296 if (mapping) { /* the library knows how to dissect this */
4297 proto_item_append_text(member, "(base found 0x%016" PRIx64 ")", key);
4298 dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL, mapping->member_type_id,
4299 mapping->member_name, EXTENSIBILITY_INVALID, offset, 0, mapping->member_id, show);
4300 proto_item_set_hidden(member);
4301 return check_offset_addition(offset, member_length, tree, NULL, tvb);
4302 } else
4303 proto_item_append_text(member, "(base not found 0x%016" PRIx64 " from 0x%016" PRIx64 ")",
4304 key, info->base_type_id);
4308 key = (info->type_id + info->type_id * member_id);
4309 mapping = (mutable_member_mapping *) wmem_map_lookup(mutable_member_mappings, &(key));
4310 if (mapping) { /* the library knows how to dissect this */
4311 proto_item_append_text(member, "(found 0x%016" PRIx64 ")", key);
4312 dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL, mapping->member_type_id,
4313 mapping->member_name, EXTENSIBILITY_INVALID, offset, 0, mapping->member_id, show);
4315 } else
4316 proto_item_append_text(member, "(not found 0x%016" PRIx64 " from 0x%016" PRIx64 ")",
4317 key, info->type_id);
4318 proto_item_set_hidden(member);
4319 return check_offset_addition(offset, member_length, tree, NULL, tvb);
4323 /* *********************************************************************** */
4324 /* Appends extra formatting for those submessages that have a status info
4326 static void generate_status_info(packet_info *pinfo,
4327 uint32_t writer_id,
4328 uint32_t status_info) {
4330 /* Defines the extra information associated to the writer involved in
4331 * this communication
4333 * Format: [?Ptwrpm]\(u?d?\)
4335 * First letter table:
4337 * writerEntityId value | Letter
4338 * ----------------------------------------------------------+--------
4339 * ENTITYID_UNKNOWN | ?
4340 * ENTITYID_PARTICIPANT | P
4341 * ENTITYID_SEDP_BUILTIN_TOPIC_WRITER | t
4342 * ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER | w
4343 * ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER | r
4344 * ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER | p
4345 * ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER | m
4346 * ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER | s
4347 * ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER | V
4348 * ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER | M
4349 * ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER | W
4350 * ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER | R
4351 * ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER | Pc
4352 * ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER | Pc
4353 * ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER | Pb
4354 * ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER | Pb
4355 * ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER | sPc
4356 * ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER | sPc
4359 * The letter is followed by:
4360 * status_info &1 | status_info & 2 | Text
4361 * ---------------+-----------------------+--------------
4362 * status_info not defined in inlineQos | [?]
4363 * 0 | 0 | [__]
4364 * 0 | 1 | [u_]
4365 * 1 | 0 | [_d]
4366 * 1 | 1 | [ud]
4368 /* 0123456 */
4369 char * writerId = NULL;
4370 char * disposeFlag = NULL;
4371 char * unregisterFlag = NULL;
4373 wmem_strbuf_t *buffer = wmem_strbuf_create(pinfo->pool);
4374 submessage_col_info* current_submessage_col_info = NULL;
4376 current_submessage_col_info = (submessage_col_info*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY);
4377 switch(writer_id) {
4378 case ENTITYID_PARTICIPANT:
4379 case ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER:
4380 writerId = "P";
4381 break;
4382 case ENTITYID_BUILTIN_TOPIC_WRITER:
4383 writerId = "t";
4384 break;
4385 case ENTITYID_BUILTIN_PUBLICATIONS_WRITER:
4386 writerId = "w";
4387 break;
4388 case ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER:
4389 writerId = "r";
4390 break;
4391 case ENTITYID_BUILTIN_PARTICIPANT_WRITER:
4392 writerId = "p";
4393 break;
4394 case ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER:
4395 writerId = "m";
4396 break;
4397 case ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER:
4398 writerId = "s";
4399 break;
4400 case ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER:
4401 writerId = "V";
4402 break;
4403 case ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER:
4404 writerId = "M";
4405 break;
4406 case ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER:
4407 writerId = "W";
4408 break;
4409 case ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER:
4410 writerId = "R";
4411 break;
4412 case ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER:
4413 case ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER:
4414 writerId = "Pb";
4415 break;
4416 case ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER:
4417 case ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER:
4418 writerId = "Pc";
4419 break;
4420 case ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER:
4421 case ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER:
4422 writerId = "sPc";
4423 break;
4424 case ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER:
4425 case ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER: {
4426 /* This is added to proto_rtps in rtps_util_add_rti_service_request* */
4427 uint32_t* service_id = (uint32_t*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_SERVICE_REQUEST_ID_PROTODATA_KEY);
4428 if (service_id != NULL && *service_id == RTI_SERVICE_REQUEST_ID_TOPIC_QUERY) {
4429 writerId = "tq";
4431 break;
4433 default:
4434 /* Unknown writer ID, don't format anything */
4435 break;
4438 switch(status_info) {
4439 case 0: unregisterFlag = "_"; disposeFlag = "_"; break;
4440 case 1: unregisterFlag = "_"; disposeFlag = "D"; break;
4441 case 2: unregisterFlag = "U"; disposeFlag = "_"; break;
4442 case 3: unregisterFlag = "U"; disposeFlag = "D"; break;
4443 default: /* Unknown status info, omit it */
4444 break;
4447 if (writerId != NULL || unregisterFlag != NULL ||
4448 disposeFlag != NULL ) {
4449 wmem_strbuf_append(buffer, "(");
4450 if (writerId != NULL) {
4451 wmem_strbuf_append(buffer, writerId);
4453 if (unregisterFlag != NULL || disposeFlag != NULL) {
4454 wmem_strbuf_append(buffer, "[");
4455 wmem_strbuf_append(buffer, unregisterFlag);
4456 wmem_strbuf_append(buffer, disposeFlag);
4457 wmem_strbuf_append(buffer, "]");
4459 wmem_strbuf_append(buffer, ")");
4460 current_submessage_col_info->status_info = wmem_strbuf_get_str(buffer);
4464 /* *********************************************************************** */
4467 * Coherent set starts if seqNumber == writerSeqNumber
4469 * Coherent sets end in three different ways:
4470 * - A new coherence set starts with the consecutive writerSeqNumber of the last coherent set packet.
4471 * -seqNumber == RTPS_SEQUENCENUMBER_UNKNOWN
4472 * - A DATA packet sent with the consecutive writerSeqNumber of the last coherent set packet.
4473 * - PID_END_COHERENT_SET received. That condition is not handled here. Check PID_END_COHERENT_SET dissection.
4474 * Empty Data condition is not handled here. rtps_util_detect_coherent_set_end_empty_data_case called at the end of dissect_RTPS_DATA and dissect_RTPS_DATA_FRAG_kind
4476 static void rtps_util_add_coherent_set_general_cases_case(
4477 proto_tree *tree,
4478 tvbuff_t *tvb,
4479 uint64_t coherent_seq_number,
4480 coherent_set_entity_info *coherent_set_entity_info_object) {
4482 coherent_set_entity_info *register_entry;
4483 proto_tree *marked_item_tree;
4484 coherent_set_info *coherent_set_info_entry;
4485 coherent_set_key coherent_set_info_key;
4487 coherent_set_entity_info_object->coherent_set_seq_number = coherent_seq_number;
4488 register_entry = (coherent_set_entity_info*)wmem_map_lookup(coherent_set_tracking.entities_using_map,
4489 &coherent_set_entity_info_object->guid);
4490 if (!register_entry) {
4491 register_entry = (coherent_set_entity_info*)wmem_memdup(wmem_file_scope(), coherent_set_entity_info_object, sizeof(coherent_set_entity_info));
4492 wmem_map_insert(
4493 coherent_set_tracking.entities_using_map,
4494 &register_entry->guid,
4495 register_entry);
4498 /* The hash and compare functions treat the key as a sequence of bytes */
4499 memset(&coherent_set_info_key, 0, sizeof(coherent_set_info_key));
4500 coherent_set_info_key.guid = coherent_set_entity_info_object->guid;
4501 coherent_set_info_key.coherent_set_seq_number = coherent_seq_number;
4502 coherent_set_info_entry = (coherent_set_info*)wmem_map_lookup(coherent_set_tracking.coherent_set_registry_map,
4503 &coherent_set_info_key);
4504 if (!coherent_set_info_entry) {
4505 coherent_set_info_entry = wmem_new0(wmem_file_scope(), coherent_set_info);
4506 coherent_set_info_entry->key = (coherent_set_key*)wmem_memdup(wmem_file_scope(), &coherent_set_info_key, sizeof(coherent_set_key));
4507 coherent_set_info_entry->is_set = false;
4508 wmem_map_insert(
4509 coherent_set_tracking.coherent_set_registry_map,
4510 coherent_set_info_entry->key,
4511 coherent_set_info_entry);
4514 if (coherent_set_info_entry->writer_seq_number < coherent_set_entity_info_object->writer_seq_number) {
4515 coherent_set_info_entry->writer_seq_number = coherent_set_entity_info_object->writer_seq_number;
4517 /* Start */
4518 if (coherent_set_entity_info_object->coherent_set_seq_number == coherent_set_entity_info_object->writer_seq_number) {
4519 marked_item_tree = proto_tree_add_uint64(tree, hf_rtps_coherent_set_start,
4520 tvb, 0, 0, coherent_seq_number);
4521 proto_item_set_generated(marked_item_tree);
4523 /* End case: Start of a new coherent set */
4524 if (coherent_set_entity_info_object->coherent_set_seq_number > register_entry->coherent_set_seq_number &&
4525 coherent_set_entity_info_object->writer_seq_number - 1 == register_entry->writer_seq_number) {
4526 coherent_set_info *previous_entry;
4528 marked_item_tree = proto_tree_add_uint64(tree, hf_rtps_coherent_set_end,
4529 tvb, 0, 0, register_entry->coherent_set_seq_number);
4530 proto_item_set_generated(marked_item_tree);
4531 coherent_set_info_key.coherent_set_seq_number = register_entry->writer_seq_number;
4532 coherent_set_info_key.guid = register_entry->guid;
4533 previous_entry = (coherent_set_info*)wmem_map_lookup(coherent_set_tracking.coherent_set_registry_map, &coherent_set_info_key);
4534 if (previous_entry) {
4535 previous_entry->is_set = true;
4540 if (!coherent_set_info_entry->is_set) {
4542 coherent_set_info_key.coherent_set_seq_number = coherent_seq_number - 1;
4544 /* End case: Sequence unknown received */
4546 if (coherent_set_entity_info_object->coherent_set_seq_number == RTPS_SEQUENCENUMBER_UNKNOWN) {
4547 register_entry->coherent_set_seq_number = coherent_set_entity_info_object->coherent_set_seq_number;
4548 marked_item_tree = proto_tree_add_uint64(tree, hf_rtps_coherent_set_end,
4549 tvb, 0, 0, coherent_set_info_entry->key->coherent_set_seq_number);
4550 proto_item_set_generated(marked_item_tree);
4551 coherent_set_info_entry->is_set = true;
4553 } else if (coherent_set_info_entry->writer_seq_number == coherent_set_entity_info_object->writer_seq_number) {
4554 proto_tree *ti;
4556 ti = proto_tree_add_uint64(tree, hf_rtps_coherent_set_end,
4557 tvb, 0, 0, coherent_set_info_entry->key->coherent_set_seq_number);
4558 proto_item_set_generated(ti);
4560 /* Update the entity */
4561 coherent_set_entity_info_object->expected_coherent_set_end_writers_seq_number = coherent_set_entity_info_object->writer_seq_number + 1;
4562 *register_entry = *coherent_set_entity_info_object;
4566 * Handles the coherent set termination case where the coherent set finishes by sending a DATA or DATA_FRAG with no parameters.
4567 * For the other cases, check rtps_util_add_coherent_set_general_cases_case.
4568 * this function must be called at the end of dissect_RTPS_DATA and dissect_RTPS_DATA_FRAG_kind
4570 static void rtps_util_detect_coherent_set_end_empty_data_case(
4572 coherent_set_entity_info *coherent_set_entity_info_object) {
4573 coherent_set_entity_info *coherent_set_entry = NULL;
4575 coherent_set_entry = (coherent_set_entity_info*) wmem_map_lookup(coherent_set_tracking.entities_using_map, &coherent_set_entity_info_object->guid);
4576 if (coherent_set_entry) {
4577 coherent_set_info *coherent_set_info_entry;
4578 coherent_set_key key;
4580 /* The hash and compare functions treat the key as a sequence of bytes. */
4581 memset(&key, 0, sizeof(key));
4582 key.guid = coherent_set_entity_info_object->guid;
4583 key.coherent_set_seq_number = coherent_set_entry->coherent_set_seq_number;
4585 coherent_set_info_entry = (coherent_set_info*)wmem_map_lookup(coherent_set_tracking.coherent_set_registry_map, &key);
4586 if (coherent_set_info_entry
4587 && (coherent_set_entry->expected_coherent_set_end_writers_seq_number == coherent_set_entity_info_object->writer_seq_number)
4588 && !coherent_set_info_entry->is_set) {
4589 coherent_set_info_entry->is_set = true;
4590 coherent_set_info_entry->writer_seq_number = coherent_set_entry->expected_coherent_set_end_writers_seq_number - 1;
4595 static uint16_t rtps_util_add_protocol_version(proto_tree *tree, /* Can NOT be NULL */
4596 tvbuff_t *tvb,
4597 int offset) {
4598 proto_item *ti;
4599 proto_tree *version_tree;
4600 uint16_t version;
4602 version = tvb_get_ntohs(tvb, offset);
4604 ti = proto_tree_add_uint_format(tree, hf_rtps_protocol_version, tvb, offset, 2,
4605 version, "Protocol version: %d.%d",
4606 tvb_get_uint8(tvb, offset), tvb_get_uint8(tvb, offset+1));
4607 version_tree = proto_item_add_subtree(ti, ett_rtps_proto_version);
4609 proto_tree_add_item(version_tree, hf_rtps_protocol_version_major, tvb, offset, 1, ENC_NA);
4610 proto_tree_add_item(version_tree, hf_rtps_protocol_version_minor, tvb, offset+1, 1, ENC_NA);
4612 return version;
4616 /* ------------------------------------------------------------------------- */
4617 /* Interpret the next bytes as vendor ID. If proto_tree and field ID is
4618 * provided, it can also set.
4620 static uint16_t rtps_util_add_vendor_id(proto_tree *tree,
4621 tvbuff_t *tvb,
4622 int offset) {
4623 uint8_t major, minor;
4624 uint16_t vendor_id;
4626 major = tvb_get_uint8(tvb, offset);
4627 minor = tvb_get_uint8(tvb, offset+1);
4628 vendor_id = tvb_get_ntohs(tvb, offset);
4630 proto_tree_add_uint_format_value(tree, hf_rtps_vendor_id, tvb, offset, 2, vendor_id,
4631 "%02d.%02d (%s)", major, minor,
4632 val_to_str_const(vendor_id, vendor_vals, "Unknown"));
4634 return vendor_id;
4639 /* ------------------------------------------------------------------------- */
4640 /* Insert in the protocol tree the next 8 bytes interpreted as Locator_t
4642 * Locator_t is a struct defined as:
4643 * struct {
4644 * long kind; // kind of locator
4645 * unsigned long port;
4646 * octet[16] address;
4647 * } Locator_t;
4649 static int rtps_util_add_locator_t(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset,
4650 const unsigned encoding, const char *label) {
4652 proto_tree *ti;
4653 proto_tree *locator_tree;
4654 uint32_t kind;
4655 uint32_t port;
4656 const int parameter_size = 24;
4658 locator_tree = proto_tree_add_subtree(tree, tvb, offset, parameter_size, ett_rtps_locator,
4659 NULL, label);
4661 proto_tree_add_item_ret_uint(locator_tree, hf_rtps_locator_kind, tvb, offset, 4, encoding, &kind);
4662 switch (kind) {
4663 case LOCATOR_KIND_UDPV4:
4664 case LOCATOR_KIND_TUDPV4: {
4665 ti = proto_tree_add_item_ret_uint(
4666 locator_tree,
4667 hf_rtps_locator_port,
4668 tvb,
4669 offset + 4,
4671 encoding,
4672 &port);
4674 if (port == 0)
4675 expert_add_info(pinfo, ti, &ei_rtps_locator_port);
4676 proto_item_append_text(tree, " (%s, %s:%u)",
4677 val_to_str(kind, rtps_locator_kind_vals, "%02x"),
4678 tvb_ip_to_str(pinfo->pool, tvb, offset + 20), port);
4679 proto_tree_add_item(locator_tree, hf_rtps_locator_ipv4, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
4680 break;
4682 case LOCATOR_KIND_TCPV4_LAN:
4683 case LOCATOR_KIND_TCPV4_WAN:
4684 case LOCATOR_KIND_TLSV4_LAN:
4685 case LOCATOR_KIND_TLSV4_WAN: {
4686 uint16_t ip_kind;
4687 ti = proto_tree_add_item_ret_uint(
4688 locator_tree,
4689 hf_rtps_locator_port,
4690 tvb,
4691 offset + 4,
4693 encoding,
4694 &port);
4695 if (port == 0)
4696 expert_add_info(pinfo, ti, &ei_rtps_locator_port);
4697 ip_kind = tvb_get_uint16(tvb, offset+16, encoding);
4698 if (ip_kind == 0xFFFF) { /* IPv4 format */
4699 uint16_t public_address_port = tvb_get_uint16(tvb, offset + 18, ENC_BIG_ENDIAN);
4700 proto_tree_add_item(locator_tree, hf_rtps_locator_public_address_port,
4701 tvb, offset+18, 2, ENC_BIG_ENDIAN);
4702 proto_tree_add_item(locator_tree, hf_rtps_locator_ipv4, tvb, offset+20,
4703 4, ENC_BIG_ENDIAN);
4704 proto_item_append_text(tree, " (%s, %s:%d, Logical Port = %u)",
4705 val_to_str(kind, rtps_locator_kind_vals, "%02x"),
4706 tvb_ip_to_str(pinfo->pool, tvb, offset + 20), public_address_port, port);
4707 } else { /* IPv6 format */
4708 proto_tree_add_item(locator_tree, hf_rtps_locator_ipv6, tvb, offset+8,
4709 16, ENC_NA);
4710 proto_item_append_text(tree, " (%s, %s, Logical Port = %u)",
4711 val_to_str(kind, rtps_locator_kind_vals, "%02x"),
4712 tvb_ip6_to_str(pinfo->pool, tvb, offset + 8), port);
4714 break;
4716 case LOCATOR_KIND_SHMEM: {
4717 uint32_t hostId;
4718 ti = proto_tree_add_item_ret_uint(
4719 locator_tree,
4720 hf_rtps_locator_port,
4721 tvb,
4722 offset + 4,
4724 encoding,
4725 &port);
4726 proto_tree_add_item_ret_uint(locator_tree, hf_rtps_param_host_id, tvb, offset+10, 4, ENC_BIG_ENDIAN, &hostId);
4727 if (port == 0)
4728 expert_add_info(pinfo, ti, &ei_rtps_locator_port);
4729 proto_item_append_text(tree, " (%s, HostId = 0x%08x, Port = %u)",
4730 val_to_str(kind, rtps_locator_kind_vals, "%02x"),
4731 hostId, port);
4732 break;
4734 case LOCATOR_KIND_UDPV6: {
4735 ti = proto_tree_add_item_ret_uint(
4736 locator_tree,
4737 hf_rtps_locator_port,
4738 tvb,
4739 offset + 4,
4741 encoding,
4742 &port);
4743 if (port == 0)
4744 expert_add_info(pinfo, ti, &ei_rtps_locator_port);
4745 proto_tree_add_item(locator_tree, hf_rtps_locator_ipv6, tvb, offset+8, 16, ENC_NA);
4746 proto_item_append_text(tree, " (%s, %s:%u)",
4747 val_to_str(kind, rtps_locator_kind_vals, "%02x"),
4748 tvb_ip6_to_str(pinfo->pool, tvb, offset + 8), port);
4749 break;
4751 case LOCATOR_KIND_DTLS: {
4752 proto_tree_add_item_ret_uint(
4753 locator_tree,
4754 hf_rtps_locator_port,
4755 tvb,
4756 offset + 4,
4758 encoding,
4759 &port);
4760 proto_tree_add_item(locator_tree, hf_rtps_locator_ipv6, tvb, offset+8, 16, ENC_NA);
4761 proto_item_append_text(tree, " (%s, %s:%u)",
4762 val_to_str(kind, rtps_locator_kind_vals, "%02x"),
4763 tvb_ip6_to_str(pinfo->pool, tvb, offset + 8), port);
4764 break;
4767 * +-------+-------+-------+-------+
4768 * | Flags | |
4769 * +-------+ +
4770 * | DDS_Octet UUID[9] |
4771 * + +-------+-------+
4772 * | | public_port |
4773 * +-------+-------+-------+-------+
4774 * | DDS_Octet public_ip_address[4]|
4775 * +-------+-------+-------+-------+
4777 case LOCATOR_KIND_UDPV4_WAN: {
4778 uint8_t flags = 0;
4779 ws_in4_addr locator_ip = 0;
4780 const uint32_t uuid_size = 9;
4781 const uint32_t locator_port_size = 4;
4782 const uint32_t locator_port_offset = offset + 4;
4783 const uint32_t flags_offset = locator_port_offset + locator_port_size;
4784 const uint32_t uuid_offset = flags_offset + 1;
4785 const uint32_t port_offset = uuid_offset + uuid_size;
4786 const uint32_t ip_offset = port_offset + 2;
4787 int hf_port = 0;
4788 int hf_ip = 0;
4789 char* ip_str = NULL;
4790 uint32_t public_port = 0;
4791 bool is_public = false;
4793 ti = proto_tree_add_item_ret_uint(
4794 locator_tree,
4795 hf_rtps_locator_port,
4796 tvb,
4797 locator_port_offset,
4798 locator_port_size,
4799 encoding,
4800 &port);
4801 flags = tvb_get_int8(tvb, flags_offset);
4802 proto_tree_add_bitmask_value(
4803 locator_tree,
4804 tvb,
4805 flags_offset,
4806 hf_rtps_udpv4_wan_locator_flags,
4807 ett_rtps_flags,
4808 UDPV4_WAN_LOCATOR_FLAGS,
4809 (uint64_t)flags);
4811 /* UUID */
4812 proto_tree_add_item(locator_tree, hf_rtps_uuid, tvb, uuid_offset, UUID_SIZE, encoding);
4815 * The P flag indicates that the locator contains a globally public IP address
4816 * and public port where a transport instance can be reached. public_ip_address
4817 * contains the public IP address and public_port contains the public UDP port.
4818 * Locators with the P flag set are called PUBLIC locators.
4820 is_public = ((flags & FLAG_UDPV4_WAN_LOCATOR_P) != 0);
4821 if (is_public) {
4822 hf_ip = hf_rtps_udpv4_wan_locator_public_ip;
4823 hf_port = hf_rtps_udpv4_wan_locator_public_port;
4824 } else {
4825 hf_ip = hf_rtps_udpv4_wan_locator_local_ip;
4826 hf_port = hf_rtps_udpv4_wan_locator_local_port;
4829 /* Port & IP */
4830 ip_str = tvb_ip_to_str(pinfo->pool, tvb, ip_offset);
4831 locator_ip = tvb_get_ipv4(tvb, ip_offset);
4832 if (locator_ip != 0) {
4833 proto_tree_add_item_ret_uint(
4834 locator_tree,
4835 hf_port,
4836 tvb,
4837 port_offset,
4839 ENC_NA,
4840 &public_port);
4841 proto_tree_add_ipv4(
4842 locator_tree,
4843 hf_ip,
4844 tvb,
4845 ip_offset,
4847 locator_ip);
4849 if (port == 0)
4850 expert_add_info(pinfo, ti, &ei_rtps_locator_port);
4851 if (ip_str != NULL && locator_ip != 0) {
4852 if (is_public) {
4853 proto_item_append_text(tree, " (%s, public: %s:%u, rtps port:%u)",
4854 val_to_str(kind, rtps_locator_kind_vals, "%02x"),
4855 ip_str, public_port, port);
4856 } else {
4857 proto_item_append_text(tree, " (%s, local: %s:%u)",
4858 val_to_str(kind, rtps_locator_kind_vals, "%02x"),
4859 ip_str, port);
4863 /* Default case, we already have the locator kind so don't do anything */
4864 default:
4865 break;
4867 return offset + parameter_size;
4870 /* ------------------------------------------------------------------------- */
4871 /* Insert in the protocol tree the next bytes interpreted as Sequence of
4872 * unsigned shorts.
4873 * The formatted buffer is: val1, val2, val3, ...
4874 * Returns the new updated offset
4876 static int rtps_util_add_seq_short(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_item,
4877 const unsigned encoding, int param_length _U_, const char *label) {
4878 uint32_t num_elem;
4879 uint32_t i;
4880 proto_tree *string_tree;
4882 num_elem = tvb_get_uint32(tvb, offset, encoding);
4883 offset += 4;
4885 /* Create the string node with an empty string, the replace it later */
4886 string_tree = proto_tree_add_subtree_format(tree, tvb, offset, num_elem * 4,
4887 ett_rtps_seq_ulong, NULL, "%s (%d elements)", label, num_elem);
4889 for (i = 0; i < num_elem; ++i) {
4890 proto_tree_add_item(string_tree, hf_item, tvb, offset, 2, encoding);
4891 offset += 2;
4894 return offset;
4897 static int rtps_util_add_locator_ex_t(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset,
4898 const unsigned encoding, int param_length) {
4899 int locator_offset = 0;
4901 locator_offset = rtps_util_add_locator_t(tree, pinfo, tvb,
4902 offset, encoding, "locator");
4903 offset += rtps_util_add_seq_short(tree, tvb, locator_offset, hf_rtps_encapsulation_id,
4904 encoding, param_length - (locator_offset - offset), "encapsulations");
4905 return offset;
4908 /* ------------------------------------------------------------------------- */
4909 /* Insert in the protocol tree the next bytes interpreted as a list of
4910 * Locators:
4911 * - unsigned long numLocators
4912 * - locator 1
4913 * - locator 2
4914 * - ...
4915 * - locator n
4916 * Returns the new offset after parsing the locator list
4918 static int rtps_util_add_locator_list(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
4919 int offset, const uint8_t *label, const unsigned encoding) {
4921 proto_tree *locator_tree;
4922 uint32_t num_locators;
4924 num_locators = tvb_get_uint32(tvb, offset, encoding);
4926 locator_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
4927 ett_rtps_locator_udp_v4, NULL, "%s: %d Locators", label, num_locators);
4928 offset += 4;
4929 if (num_locators > 0) {
4930 uint32_t i;
4931 char temp_buff[20];
4933 for (i = 0; i < num_locators; ++i) {
4934 snprintf(temp_buff, 20, "Locator[%d]", i);
4935 rtps_util_add_locator_t(locator_tree, pinfo, tvb, offset,
4936 encoding, temp_buff);
4937 offset += 24;
4940 return offset;
4943 /* ------------------------------------------------------------------------- */
4944 /* Insert in the protocol tree the next bytes interpreted as a list of
4945 * multichannel Locators:
4946 * - unsigned long numLocators
4947 * - locator 1
4948 * - locator 2
4949 * - ...
4950 * - locator n
4951 * Returns the new offset after parsing the locator list
4953 static int rtps_util_add_multichannel_locator_list(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
4954 int offset, const uint8_t *label, const unsigned encoding) {
4956 proto_tree *locator_tree;
4957 uint32_t num_locators;
4959 num_locators = tvb_get_uint32(tvb, offset, encoding);
4960 locator_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
4961 ett_rtps_locator_udp_v4, NULL, "%s: %d Locators", label, num_locators);
4963 offset += 4;
4964 if (num_locators > 0) {
4965 uint32_t i;
4966 for (i = 0; i < num_locators; ++i) {
4967 proto_tree *ti, *locator_item_tree;
4968 uint32_t kind;
4969 uint32_t port;
4970 char *channel_address;
4971 locator_item_tree = proto_tree_add_subtree(locator_tree, tvb, offset, 24, ett_rtps_locator,
4972 NULL, label);
4973 proto_tree_add_item_ret_uint(locator_item_tree, hf_rtps_locator_kind, tvb, offset, 4, encoding, &kind);
4974 switch (kind) {
4975 case LOCATOR_KIND_UDPV4:
4976 case LOCATOR_KIND_TUDPV4: {
4977 proto_tree_add_item(locator_item_tree, hf_rtps_locator_ipv4, tvb, offset + 16, 4,
4978 ENC_BIG_ENDIAN);
4979 channel_address = tvb_ip_to_str(pinfo->pool, tvb, offset + 16);
4980 break;
4982 case LOCATOR_KIND_UDPV6: {
4983 proto_tree_add_item(locator_tree, hf_rtps_locator_ipv6, tvb, offset + 4, 16, ENC_NA);
4984 channel_address = tvb_ip6_to_str(pinfo->pool, tvb, offset + 4);
4985 proto_item_append_text(tree, " (%s, %s)",
4986 val_to_str(kind, rtps_locator_kind_vals, "%02x"),
4987 tvb_ip6_to_str(pinfo->pool, tvb, offset + 4));
4988 break;
4990 /* Default case, Multichannel locators only should be present in UDPv4 and UDPv6 transports
4991 * Unknown address format.
4992 * */
4993 default:
4994 offset += 24;
4995 continue;
4996 break;
4998 ti = proto_tree_add_item_ret_uint(locator_item_tree, hf_rtps_locator_port, tvb, offset + 20, 4, encoding, &port);
4999 if (port == 0)
5000 expert_add_info(pinfo, ti, &ei_rtps_locator_port);
5001 proto_item_append_text(tree, " (%s, %s:%u)",
5002 val_to_str(kind, rtps_locator_kind_vals, "%02x"),
5003 channel_address, port);
5004 offset += 24;
5007 return offset;
5010 /* ------------------------------------------------------------------------- */
5011 /* Insert in the protocol tree the next 4 bytes interpreted as IPV4Address_t
5013 static void rtps_util_add_ipv4_address_t(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset,
5014 const unsigned encoding, int hf_item) {
5016 proto_item *ti;
5018 ti = proto_tree_add_item(tree, hf_item, tvb, offset, 4, encoding);
5019 if (tvb_get_ntohl(tvb, offset) == IPADDRESS_INVALID)
5020 expert_add_info(pinfo, ti, &ei_rtps_ip_invalid);
5025 /* ------------------------------------------------------------------------- */
5026 /* Insert in the protocol tree the next 8 bytes interpreted as LocatorUDPv4
5028 * LocatorUDPv4 is a struct defined as:
5029 * struct {
5030 * unsigned long address;
5031 * unsigned long port;
5032 * } LocatorUDPv4_t;
5035 static void rtps_util_add_locator_udp_v4(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
5036 int offset, const uint8_t *label, const unsigned encoding) {
5038 proto_item *ti;
5039 proto_tree *locator_tree;
5040 uint32_t port;
5042 locator_tree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_rtps_locator_udp_v4, NULL, label);
5044 rtps_util_add_ipv4_address_t(locator_tree, pinfo, tvb, offset,
5045 encoding, hf_rtps_locator_udp_v4);
5047 ti = proto_tree_add_item_ret_uint(locator_tree, hf_rtps_locator_udp_v4_port, tvb, offset, 4, encoding, &port);
5048 if (port == PORT_INVALID)
5049 expert_add_info(pinfo, ti, &ei_rtps_port_invalid);
5052 /* ------------------------------------------------------------------------- */
5053 /* Insert in the protocol tree the next 8 bytes interpreted as GuidPrefix
5054 * If tree is specified, it fills up the protocol tree item:
5055 * - hf_rtps_guid_prefix
5056 * - hf_rtps_host_id
5057 * - hf_rtps_app_id
5058 * - hf_rtps_app_id_instance_id
5059 * - hf_rtps_app_id_app_kind
5061 static void rtps_util_add_guid_prefix_v1(proto_tree *tree, tvbuff_t *tvb, int offset,
5062 int hf_prefix, int hf_host_id, int hf_app_id, int hf_app_id_instance_id,
5063 int hf_app_id_app_kind, const uint8_t *label) {
5064 uint64_t prefix;
5065 uint32_t host_id, app_id, instance_id;
5066 uint8_t app_kind;
5067 proto_item *ti;
5068 proto_tree *guid_tree, *appid_tree;
5069 const uint8_t *safe_label = (label == NULL) ? (const uint8_t *)"guidPrefix" : label;
5071 /* Read values from TVB */
5072 prefix = tvb_get_ntoh64(tvb, offset);
5073 host_id = tvb_get_ntohl(tvb, offset);
5074 app_id = tvb_get_ntohl(tvb, offset + 4);
5075 instance_id = (app_id >> 8);
5076 app_kind = (app_id & 0xff);
5078 if (tree != NULL) {
5079 ti = proto_tree_add_uint64_format(tree, hf_prefix, tvb, offset, 8, prefix,
5080 "%s=%08x %08x { hostId=%08x, appId=%08x (%s: %06x) }",
5081 safe_label, host_id, app_id, host_id, app_id,
5082 val_to_str(app_kind, app_kind_vals, "%02x"),
5083 instance_id);
5085 guid_tree = proto_item_add_subtree(ti, ett_rtps_guid_prefix);
5087 /* Host Id */
5088 proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN);
5090 /* AppId (root of the app_id sub-tree) */
5091 ti = proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
5092 appid_tree = proto_item_add_subtree(ti, ett_rtps_app_id);
5094 /* InstanceId */
5095 proto_tree_add_item(appid_tree, hf_app_id_instance_id, tvb, offset+4, 3, ENC_BIG_ENDIAN);
5096 /* AppKind */
5097 proto_tree_add_item(appid_tree, hf_app_id_app_kind, tvb, offset+7, 1, ENC_BIG_ENDIAN);
5101 /* ------------------------------------------------------------------------- */
5102 /* Insert in the protocol tree the next 12 bytes interpreted as GuidPrefix
5103 * If tree is specified, it fills up the protocol tree item:
5104 * - hf_rtps_guid_prefix
5105 * - hf_rtps_host_id
5106 * - hf_rtps_app_id
5107 * - hf_rtps_counter
5109 static void rtps_util_add_guid_prefix_v2(proto_tree *tree, tvbuff_t *tvb, int offset,
5110 int hf_prefix, int hf_host_id, int hf_app_id,
5111 int hf_instance_id, int hf_prefix_extra) {
5112 if (tree) {
5113 proto_item *ti;
5114 proto_tree *guid_tree;
5116 /* The text node (root of the guid prefix sub-tree) */
5117 ti = proto_tree_add_item(tree, hf_prefix, tvb, offset, 12, ENC_NA);
5118 guid_tree = proto_item_add_subtree(ti, ett_rtps_guid_prefix);
5120 /* Optional filter that can be guidPrefix.src or guidPrefix.dst */
5121 if (hf_prefix_extra != 0) {
5122 ti = proto_tree_add_item(tree, hf_prefix_extra, tvb, offset, 12, ENC_NA);
5123 proto_item_set_hidden(ti);
5126 /* Host Id */
5127 proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN);
5129 /* App Id */
5130 proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
5132 /* Counter */
5133 proto_tree_add_item(guid_tree, hf_instance_id, tvb, offset+8, 4, ENC_BIG_ENDIAN);
5136 /* ------------------------------------------------------------------------- */
5137 /* Insert the entityId from the next 4 bytes. Since there are more than
5138 * one entityId, we need to specify also the IDs of the entityId (and its
5139 * sub-components), as well as the label identifying it.
5140 * Returns true if the entityKind is one of the NDDS built-in entities.
5142 static bool rtps_util_add_entity_id(proto_tree *tree, tvbuff_t *tvb, int offset,
5143 int hf_item, int hf_item_entity_key, int hf_item_entity_kind,
5144 int subtree_entity_id, const char *label, uint32_t *entity_id_out) {
5145 uint32_t entity_id = tvb_get_ntohl(tvb, offset);
5146 uint32_t entity_key = (entity_id >> 8);
5147 uint8_t entity_kind = (entity_id & 0xff);
5148 const char *str_predef = try_val_to_str(entity_id, entity_id_vals);
5150 if (entity_id_out != NULL) {
5151 *entity_id_out = entity_id;
5154 if (tree != NULL) {
5155 proto_tree *entity_tree;
5156 proto_item *ti;
5158 if (str_predef == NULL) {
5159 /* entityId is not a predefined value, format it */
5160 ti = proto_tree_add_uint_format(tree, hf_item, tvb, offset, 4, entity_id,
5161 "%s: 0x%08x (%s: 0x%06x)",
5162 label, entity_id,
5163 val_to_str(entity_kind, entity_kind_vals, "unknown kind (%02x)"),
5164 entity_key);
5165 } else {
5166 /* entityId is a predefined value */
5167 ti = proto_tree_add_uint_format(tree, hf_item, tvb, offset, 4, entity_id,
5168 "%s: %s (0x%08x)", label, str_predef, entity_id);
5171 entity_tree = proto_item_add_subtree(ti, subtree_entity_id);
5173 proto_tree_add_item(entity_tree, hf_item_entity_key, tvb, offset, 3, ENC_BIG_ENDIAN);
5174 proto_tree_add_item(entity_tree, hf_item_entity_kind, tvb, offset+3, 1, ENC_BIG_ENDIAN);
5177 /* is a built-in entity if the bit M and R (5 and 6) of the entityKind are set */
5178 /* return ((entity_kind & 0xc0) == 0xc0); */
5179 return ( ((entity_kind & 0xc0) == 0xc0) ||
5180 entity_id == ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER ||
5181 entity_id == ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER ||
5182 entity_id == ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER ||
5183 entity_id == ENTITYID_RTI_BUILTIN_LOCATOR_PING_READER);
5186 /* ------------------------------------------------------------------------- */
5187 /* Insert the entityId from the next 4 bytes as a generic one (not connected
5188 * to any protocol field). It simply insert the content as a simple text entry
5189 * and returns in the passed buffer only the value (without the label).
5191 static void rtps_util_add_generic_entity_id(proto_tree *tree, tvbuff_t *tvb, int offset, const char *label,
5192 int hf_item, int hf_item_entity_key, int hf_item_entity_kind,
5193 int subtree_entity_id) {
5194 uint32_t entity_id = tvb_get_ntohl(tvb, offset);
5195 uint32_t entity_key = (entity_id >> 8);
5196 uint8_t entity_kind = (entity_id & 0xff);
5197 const char *str_predef = try_val_to_str(entity_id, entity_id_vals);
5198 proto_item *ti;
5199 proto_tree *entity_tree;
5201 if (str_predef == NULL) {
5202 /* entityId is not a predefined value, format it */
5203 ti = proto_tree_add_uint_format(tree, hf_item, tvb, offset, 4, entity_id,
5204 "%s: 0x%08x (%s: 0x%06x)", label, entity_id,
5205 val_to_str(entity_kind, entity_kind_vals, "unknown kind (%02x)"),
5206 entity_key);
5207 } else {
5208 /* entityId is a predefined value */
5209 ti = proto_tree_add_uint_format_value(tree, hf_item, tvb, offset, 4, entity_id,
5210 "%s: %s (0x%08x)", label, str_predef, entity_id);
5213 entity_tree = proto_item_add_subtree(ti, subtree_entity_id);
5215 proto_tree_add_item(entity_tree, hf_item_entity_key, tvb, offset, 3, ENC_BIG_ENDIAN);
5216 proto_tree_add_item(entity_tree, hf_item_entity_kind, tvb, offset+3, 1, ENC_BIG_ENDIAN);
5220 /* ------------------------------------------------------------------------- */
5221 /* Interpret the next 12 octets as a generic GUID and insert it in the protocol
5222 * tree as simple text (no reference fields are set).
5223 * It is mostly used in situation where is not required to perform search for
5224 * this kind of GUID (i.e. like in some DATA parameter lists).
5226 static void rtps_util_add_generic_guid_v1(proto_tree *tree, tvbuff_t *tvb, int offset,
5227 int hf_guid, int hf_host_id, int hf_app_id, int hf_app_id_instance_id,
5228 int hf_app_id_app_kind, int hf_entity, int hf_entity_key,
5229 int hf_entity_kind) {
5231 uint64_t prefix;
5232 uint32_t host_id, app_id, entity_id;
5233 proto_item *ti;
5234 proto_tree *guid_tree, *appid_tree, *entity_tree;
5236 /* Read typed data */
5237 prefix = tvb_get_ntoh64(tvb, offset);
5238 host_id = tvb_get_ntohl(tvb, offset);
5239 app_id = tvb_get_ntohl(tvb, offset + 4);
5240 entity_id = tvb_get_ntohl(tvb, offset + 8);
5242 ti = proto_tree_add_uint64_format_value(tree, hf_guid, tvb, offset, 8, prefix, "%08x %08x %08x",
5243 host_id, app_id, entity_id);
5245 guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid);
5247 /* Host Id */
5248 proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN);
5250 /* AppId (root of the app_id sub-tree) */
5251 ti = proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
5252 appid_tree = proto_item_add_subtree(ti, ett_rtps_app_id);
5254 /* InstanceId */
5255 proto_tree_add_item(appid_tree, hf_app_id_instance_id, tvb, offset+4, 3, ENC_BIG_ENDIAN);
5256 /* AppKind */
5257 proto_tree_add_item(appid_tree, hf_app_id_app_kind, tvb, offset+7, 1, ENC_BIG_ENDIAN);
5259 /* Entity (root of the app_id sub-tree) */
5260 ti = proto_tree_add_item(guid_tree, hf_entity, tvb, offset+8, 4, ENC_BIG_ENDIAN);
5261 entity_tree = proto_item_add_subtree(ti, ett_rtps_entity);
5263 proto_tree_add_item(entity_tree, hf_entity_key, tvb, offset+8, 3, ENC_BIG_ENDIAN);
5264 proto_tree_add_item(entity_tree, hf_entity_kind, tvb, offset+11, 1, ENC_BIG_ENDIAN);
5267 /* ------------------------------------------------------------------------- */
5268 /* Insert in the protocol tree the next data interpreted as a String
5269 * Returns the new offset (after reading the string)
5270 * XXX - should check that string length field makes sense, possibly by
5271 * comparing to a passed-in container length (cf. #19359)
5273 static int rtps_util_add_string(proto_tree *tree, tvbuff_t *tvb, int offset,
5274 int hf_item, const unsigned encoding) {
5275 uint32_t size;
5277 proto_tree_add_item_ret_uint(tree, hf_rtps_string_length, tvb, offset, 4, encoding, &size);
5278 proto_tree_add_item(tree, hf_item, tvb, offset+4, size, ENC_ASCII);
5280 /* NDDS align strings at 4-bytes word. So:
5281 * string_length: 4 -> buffer_length = 4;
5282 * string_length: 5 -> buffer_length = 8;
5283 * string_length: 6 -> buffer_length = 8;
5284 * string_length: 7 -> buffer_length = 8;
5285 * string_length: 8 -> buffer_length = 8;
5286 * ...
5288 return offset + 4 + ((size + 3) & 0xfffffffc);
5291 static int rtps_util_add_data_tags(proto_tree *rtps_parameter_tree, tvbuff_t *tvb,
5292 int offset, const unsigned encoding, int param_length) {
5294 /* 0...2...........7...............15.............23...............31
5295 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5296 * | Sequence Size |
5297 * +ITEM 0---------+---------------+---------------+---------------+
5298 * | Name String Bytes |
5299 * +---------------+---------------+---------------+---------------+
5300 * | Value String Bytes |
5301 * +---------------+---------------+---------------+---------------+
5302 * ....
5303 * +ITEM N---------+---------------+---------------+---------------+
5304 * | Name String Bytes |
5305 * +---------------+---------------+---------------+---------------+
5306 * | Value String Bytes |
5307 * +---------------+---------------+---------------+---------------+
5310 proto_tree *tags_seq_tree = NULL;
5311 proto_tree *tag_tree = NULL;
5312 uint32_t seq_sum_elements, i;
5314 seq_sum_elements = tvb_get_uint32(tvb, offset, encoding);
5315 offset += 4;
5317 tags_seq_tree = proto_tree_add_subtree_format(rtps_parameter_tree, tvb, offset - 4, param_length,
5318 ett_rtps_data_tag_seq, NULL, "Tags (size = %u)", seq_sum_elements);
5320 for (i = 0; i < seq_sum_elements; ++i) {
5321 uint32_t initial_offset = offset;
5322 tag_tree = proto_tree_add_subtree_format(tags_seq_tree, tvb, offset, -1, ett_rtps_data_tag_item,
5323 NULL, "Tag [%u]", i);
5324 offset = rtps_util_add_string(tag_tree, tvb, offset, hf_rtps_data_tag_name, encoding);
5325 offset = rtps_util_add_string(tag_tree, tvb, offset, hf_rtps_data_tag_value, encoding);
5326 proto_item_set_len(tag_tree, offset - initial_offset);
5328 return offset;
5333 /* ------------------------------------------------------------------------- */
5334 /* Interpret the next 16 octets as a generic GUID and insert it in the protocol
5335 * tree as simple text (no reference fields are set).
5336 * It is mostly used in situation where is not required to perform search for
5337 * this kind of GUID (i.e. like in some DATA parameter lists).
5339 static void rtps_util_add_generic_guid_v2(proto_tree *tree, tvbuff_t *tvb, int offset,
5340 int hf_guid, int hf_host_id, int hf_app_id, int hf_instance_id,
5341 int hf_entity, int hf_entity_key, int hf_entity_kind, proto_tree *print_tree) {
5343 uint32_t host_id, app_id, entity_id, instance_id;
5344 proto_item *ti;
5345 proto_tree *guid_tree, *entity_tree;
5347 /* Read typed data */
5348 host_id = tvb_get_ntohl(tvb, offset);
5349 app_id = tvb_get_ntohl(tvb, offset + 4);
5350 instance_id = tvb_get_ntohl(tvb, offset + 8);
5351 entity_id = tvb_get_ntohl(tvb, offset + 12);
5353 ti = proto_tree_add_bytes_format_value(tree, hf_guid, tvb, offset, 16, NULL, "%08x %08x %08x %08x",
5354 host_id, app_id, instance_id, entity_id);
5356 /* If the method is called with a valid print_tree pointer, we add the info to the tree.
5357 * This improves usability a lot since the user doesn't have to click a lot to debug. */
5358 proto_item_append_text(print_tree, "%08x %08x %08x %08x",
5359 host_id, app_id, instance_id, entity_id);
5361 guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid);
5363 /* Host Id */
5364 proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN);
5366 /* App Id */
5367 proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
5369 /* Instance Id */
5370 proto_tree_add_item(guid_tree, hf_instance_id, tvb, offset+8, 4, ENC_BIG_ENDIAN);
5372 /* Entity (root of the app_id sub-tree) */
5373 ti = proto_tree_add_item(guid_tree, hf_entity, tvb, offset+12, 4, ENC_BIG_ENDIAN);
5374 entity_tree = proto_item_add_subtree(ti, ett_rtps_entity);
5376 proto_tree_add_item(entity_tree, hf_entity_key, tvb, offset+12, 3, ENC_BIG_ENDIAN);
5377 proto_tree_add_item(entity_tree, hf_entity_kind, tvb, offset+15, 1, ENC_BIG_ENDIAN);
5381 /* ------------------------------------------------------------------------- */
5382 /* Insert in the protocol tree the next 8 bytes interpreted as sequence
5383 * number.
5385 static uint64_t rtps_util_add_seq_number(proto_tree *tree,
5386 tvbuff_t *tvb,
5387 int offset,
5388 const unsigned encoding,
5389 const char *label) {
5390 uint64_t hi = (uint64_t)tvb_get_uint32(tvb, offset, encoding);
5391 uint64_t lo = (uint64_t)tvb_get_uint32(tvb, offset+4, encoding);
5392 uint64_t all = (hi << 32) | lo;
5394 proto_tree_add_int64_format(tree, hf_rtps_sm_seq_number, tvb, offset, 8,
5395 all, "%s: %" PRIu64, label, all);
5397 return all;
5401 /* ------------------------------------------------------------------------- */
5402 /* Vendor specific: RTI
5403 * Insert in the protocol tree the next 8 bytes interpreted as TransportInfo
5405 static void rtps_util_add_transport_info(proto_tree *tree,
5406 tvbuff_t *tvb,
5407 int offset,
5408 const unsigned encoding,
5409 int transport_index)
5411 int32_t classId = tvb_get_uint32(tvb, offset, encoding);
5413 if (tree) {
5414 proto_tree *xport_info_tree;
5416 xport_info_tree = proto_tree_add_subtree_format(tree, tvb, offset, 8, ett_rtps_transport_info, NULL,
5417 "transportInfo %d: %s", transport_index, val_to_str_const(classId, ndds_transport_class_id_vals, "unknown"));
5419 proto_tree_add_item(xport_info_tree, hf_rtps_transportInfo_classId, tvb,
5420 offset, 4, encoding);
5421 proto_tree_add_item(xport_info_tree, hf_rtps_transportInfo_messageSizeMax, tvb,
5422 offset+4, 4, encoding);
5426 /* ------------------------------------------------------------------------- */
5427 /* Insert in the protocol tree the next 8 bytes interpreted as an RTPS time_t,
5428 * which is like an NTP time stamp, except that it uses the UNIX epoch,
5429 * rather than the NTP epoch, as the time base. Doesn't check for TIME_ZERO,
5430 * TIME_INVALID, or TIME_INFINITE, and doesn't show the seconds and
5431 * fraction field separately.
5433 static void rtps_util_add_timestamp(proto_tree *tree,
5434 tvbuff_t *tvb,
5435 int offset,
5436 const unsigned encoding,
5437 int hf_time) {
5439 proto_tree_add_item(tree, hf_time, tvb, offset, 8,
5440 ENC_TIME_RTPS|encoding);
5444 /* ------------------------------------------------------------------------- */
5445 /* Insert in the protocol tree the next 8 bytes interpreted as an RTPS time_t.
5446 * Checks for special values except for TIME_INVALID, and shows the
5447 * seconds and fraction as separate fields.
5449 static void rtps_util_add_timestamp_sec_and_fraction(proto_tree *tree,
5450 tvbuff_t *tvb,
5451 int offset,
5452 const unsigned encoding,
5453 int hf_time _U_) {
5455 char tempBuffer[MAX_TIMESTAMP_SIZE];
5456 double absolute;
5457 int32_t sec;
5458 uint32_t frac;
5460 if (tree) {
5461 proto_tree *time_tree;
5463 sec = tvb_get_uint32(tvb, offset, encoding);
5464 frac = tvb_get_uint32(tvb, offset+4, encoding);
5466 if ((sec == 0x7fffffff) && (frac == 0xffffffff)) {
5467 (void) g_strlcpy(tempBuffer, "INFINITE", MAX_TIMESTAMP_SIZE);
5468 } else if ((sec == 0) && (frac == 0)) {
5469 (void) g_strlcpy(tempBuffer, "0 sec", MAX_TIMESTAMP_SIZE);
5470 } else {
5471 absolute = (double)sec + (double)frac / ((double)(0x80000000) * 2.0);
5472 snprintf(tempBuffer, MAX_TIMESTAMP_SIZE,
5473 "%f sec (%ds + 0x%08x)", absolute, sec, frac);
5476 time_tree = proto_tree_add_subtree_format(tree, tvb, offset, 8,
5477 ett_rtps_timestamp, NULL, "%s: %s", "lease_duration", tempBuffer);
5479 proto_tree_add_item(time_tree, hf_rtps_param_timestamp_sec, tvb, offset, 4, encoding);
5480 proto_tree_add_item(time_tree, hf_rtps_param_timestamp_fraction, tvb, offset+4, 4, encoding);
5484 /* ------------------------------------------------------------------------- */
5485 /* Insert in the protocol tree the next data interpreted as a port (unsigned
5486 * 32-bit integer)
5488 static void rtps_util_add_port(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
5489 int offset, const unsigned encoding, int hf_item) {
5490 proto_item *ti;
5491 uint32_t port;
5493 ti = proto_tree_add_item_ret_uint(tree, hf_item, tvb, offset, 4, encoding, &port);
5494 if (port == PORT_INVALID)
5495 expert_add_info(pinfo, ti, &ei_rtps_port_invalid);
5499 /* ------------------------------------------------------------------------- */
5500 /* Insert in the protocol tree the next bytes interpreted as
5501 * DurabilityServiceQosPolicy
5503 static void rtps_util_add_durability_service_qos(proto_tree *tree,
5504 tvbuff_t *tvb,
5505 int offset,
5506 const unsigned encoding) {
5507 proto_tree *subtree;
5509 subtree = proto_tree_add_subtree(tree, tvb, offset, 28, ett_rtps_durability_service, NULL, "PID_DURABILITY_SERVICE");
5511 rtps_util_add_timestamp_sec_and_fraction(subtree, tvb, offset, encoding, hf_rtps_durability_service_cleanup_delay);
5512 proto_tree_add_item(subtree, hf_rtps_durability_service_history_kind, tvb, offset+8, 4, encoding);
5513 proto_tree_add_item(subtree, hf_rtps_durability_service_history_depth, tvb, offset+12, 4, encoding);
5514 proto_tree_add_item(subtree, hf_rtps_durability_service_max_samples, tvb, offset+16, 4, encoding);
5515 proto_tree_add_item(subtree, hf_rtps_durability_service_max_instances, tvb, offset+20, 4, encoding);
5516 proto_tree_add_item(subtree, hf_rtps_durability_service_max_samples_per_instances, tvb, offset+24, 4, encoding);
5519 /* ------------------------------------------------------------------------- */
5520 /* Insert in the protocol tree the next bytes interpreted as Liveliness
5521 * QoS Policy structure.
5523 static void rtps_util_add_liveliness_qos(proto_tree *tree, tvbuff_t *tvb, int offset, const unsigned encoding) {
5525 proto_tree *subtree;
5527 subtree = proto_tree_add_subtree(tree, tvb, offset, 12, ett_rtps_liveliness, NULL, "PID_LIVELINESS");
5529 proto_tree_add_item(subtree, hf_rtps_liveliness_kind, tvb, offset, 4, encoding);
5530 rtps_util_add_timestamp_sec_and_fraction(subtree, tvb, offset+4, encoding, hf_rtps_liveliness_lease_duration);
5533 /* ------------------------------------------------------------------------- */
5534 /* Insert in the protocol tree the next bytes interpreted as Liveliness
5535 * QoS Policy structure.
5537 static void rtps_util_add_product_version(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, int vendor_id) {
5539 proto_tree *subtree;
5540 uint8_t major, minor, release, revision;
5541 int release_offset;
5542 int revision_offset;
5544 release_offset = 2;
5545 revision_offset = 3;
5546 major = tvb_get_uint8(tvb, offset);
5547 minor = tvb_get_uint8(tvb, offset+1);
5548 release = tvb_get_uint8(tvb, offset+2);
5549 revision = tvb_get_uint8(tvb, offset+3);
5551 if (vendor_id == RTPS_VENDOR_RTI_DDS) {
5552 if (major < 5 && revision == 0) {
5553 subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL,
5554 "Product version: %d.%d%s", major, minor, format_char(pinfo->pool, release));
5555 } else if (major < 5 && revision > 0) {
5556 subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL,
5557 "Product version: %d.%d%s rev%d", major, minor, format_char(pinfo->pool, release), revision);
5558 } else {
5559 subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL,
5560 "Product version: %d.%d.%d.%d", major, minor, release, revision);
5562 } else if (vendor_id == RTPS_VENDOR_RTI_DDS_MICRO) {
5563 /* In Micro < 3.0.0 release and revision numbers are switched */
5564 if (major < 3) {
5565 revision = revision ^ release;
5566 release = revision ^ release;
5567 revision = revision ^ release;
5569 revision_offset = revision_offset ^ release_offset;
5570 release_offset = revision_offset ^ release_offset;
5571 revision_offset = revision_offset ^ release_offset;
5573 if (revision != 0) {
5574 subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL,
5575 "Product version: %d.%d.%d.%d", major, minor, release, revision);
5576 } else {
5577 subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL,
5578 "Product version: %d.%d.%d", major, minor, release);
5580 } else {
5581 return;
5584 proto_tree_add_item(subtree, hf_rtps_param_product_version_major,
5585 tvb, offset, 1, ENC_NA);
5586 proto_tree_add_item(subtree, hf_rtps_param_product_version_minor,
5587 tvb, offset+1, 1, ENC_NA);
5588 /* If major revision is smaller than 5, release interpreted as char */
5589 if (vendor_id == RTPS_VENDOR_RTI_DDS && major < 5) {
5590 proto_tree_add_item(subtree, hf_rtps_param_product_version_release_as_char,
5591 tvb, offset + release_offset, 1, ENC_ASCII);
5592 } else {
5593 proto_tree_add_item(subtree, hf_rtps_param_product_version_release,
5594 tvb, offset + release_offset, 1, ENC_NA);
5596 proto_tree_add_item(subtree, hf_rtps_param_product_version_revision,
5597 tvb, offset + revision_offset, 1, ENC_NA);
5600 /* ------------------------------------------------------------------------- */
5601 /* Insert in the protocol tree the next bytes interpreted as Sequence of
5602 * Strings.
5603 * The formatted buffer is: "string1", "string2", "string3", ...
5604 * Returns the new updated offset
5606 static int rtps_util_add_seq_string(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset,
5607 const unsigned encoding, int hf_numstring,
5608 int hf_string, const char *label) {
5609 uint32_t size;
5610 int32_t i, num_strings;
5611 const char *retVal;
5612 proto_tree *string_tree;
5613 int start;
5615 proto_tree_add_item_ret_int(tree, hf_numstring, tvb, offset, 4, encoding, &num_strings);
5616 offset += 4;
5618 if (num_strings == 0) {
5619 return offset;
5622 start = offset;
5623 /* Create the string node with a fake string, the replace it later */
5624 string_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtps_seq_string, NULL, label);
5626 for (i = 0; i < num_strings; ++i) {
5627 size = tvb_get_uint32(tvb, offset, encoding);
5629 retVal = (const char* )tvb_get_string_enc(pinfo->pool, tvb, offset+4, size, ENC_ASCII);
5631 proto_tree_add_string_format(string_tree, hf_string, tvb, offset, size+4, retVal,
5632 "%s[%d]: %s", label, i, retVal);
5634 offset += (4 + ((size + 3) & 0xfffffffc));
5637 proto_item_set_len(string_tree, offset - start);
5638 return offset;
5641 /* ------------------------------------------------------------------------- */
5642 /* Insert in the protocol tree the next bytes interpreted as Sequence of
5643 * longs.
5644 * The formatted buffer is: val1, val2, val3, ...
5645 * Returns the new updated offset
5647 static int rtps_util_add_seq_ulong(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_item,
5648 const unsigned encoding, int param_length _U_, const char *label) {
5649 uint32_t num_elem;
5650 uint32_t i;
5651 proto_tree *string_tree;
5653 num_elem = tvb_get_uint32(tvb, offset, encoding);
5654 offset += 4;
5656 /* Create the string node with an empty string, the replace it later */
5657 string_tree = proto_tree_add_subtree_format(tree, tvb, offset, num_elem*4,
5658 ett_rtps_seq_ulong, NULL, "%s (%d elements)", label, num_elem);
5660 for (i = 0; i < num_elem; ++i) {
5661 proto_tree_add_item(string_tree, hf_item, tvb, offset, 4, encoding);
5662 offset += 4;
5665 return offset;
5668 /* ------------------------------------------------------------------------- */
5669 static const char *rtps_util_typecode_id_to_string(uint32_t typecode_id) {
5670 switch(typecode_id) {
5671 case RTI_CDR_TK_ENUM: return "enum";
5672 case RTI_CDR_TK_UNION: return "union";
5673 case RTI_CDR_TK_STRUCT: return "struct";
5674 case RTI_CDR_TK_LONG: return "long";
5675 case RTI_CDR_TK_SHORT: return "short";
5676 case RTI_CDR_TK_USHORT: return "unsigned short";
5677 case RTI_CDR_TK_ULONG: return "unsigned long";
5678 case RTI_CDR_TK_FLOAT: return "float";
5679 case RTI_CDR_TK_DOUBLE: return "double";
5680 case RTI_CDR_TK_BOOLEAN: return "boolean";
5681 case RTI_CDR_TK_CHAR: return "char";
5682 case RTI_CDR_TK_OCTET: return "octet";
5683 case RTI_CDR_TK_LONGLONG: return "longlong";
5684 case RTI_CDR_TK_ULONGLONG: return "unsigned long long";
5685 case RTI_CDR_TK_LONGDOUBLE: return "long double";
5686 case RTI_CDR_TK_WCHAR: return "wchar";
5687 case RTI_CDR_TK_WSTRING: return "wstring";
5688 case RTI_CDR_TK_STRING: return "string";
5689 case RTI_CDR_TK_SEQUENCE: return "sequence";
5690 case RTI_CDR_TK_ARRAY: return "array";
5691 case RTI_CDR_TK_ALIAS: return "alias";
5692 case RTI_CDR_TK_VALUE: return "valuetype";
5694 case RTI_CDR_TK_NULL:
5695 default:
5696 return "<unknown type>";
5700 /* ------------------------------------------------------------------------- */
5701 /* Insert in the protocol tree the next bytes interpreted as typecode info
5702 * Returns the number of bytes parsed
5704 // NOLINTNEXTLINE(misc-no-recursion)
5705 static int rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, const unsigned encoding,
5706 int indent_level, int is_pointer, uint16_t bitfield, int is_key, const int offset_begin,
5707 char *name,
5708 int seq_max_len, /* -1 = not a sequence field */
5709 uint32_t *arr_dimension, /* if !NULL: array of 10 int */
5710 int ndds_40_hack) {
5711 const int original_offset = offset;
5712 uint32_t tk_id;
5713 uint16_t tk_size;
5714 unsigned int i;
5715 char *indent_string;
5716 int retVal;
5717 char type_name[40];
5719 /* Structure of the typecode data:
5720 * Offset | Size | Field | Notes
5721 * ----------|-------|------------------------------|---------------------
5722 * ? | ? | pad? |
5723 * 0 | 4 | RTI_CDR_TK_XXXXX | 4 bytes aligned
5724 * 4 | 2 | length the struct |
5727 /* Calc indent string */
5728 indent_string = (char *)wmem_alloc(wmem_epan_scope(), (indent_level*2)+1);
5729 memset(indent_string, ' ', (indent_level*2)+1);
5730 indent_string[indent_level*2] = '\0';
5732 /* Gets TK ID */
5733 LONG_ALIGN(offset);
5734 tk_id = tvb_get_uint32(tvb, offset, encoding);
5735 offset += 4;
5737 /* Gets TK size */
5738 tk_size = tvb_get_uint16(tvb, offset, encoding);
5739 offset += 2;
5741 retVal = tk_size + 6; /* 6 = 4 (typecode ID) + 2 (size) */
5743 /* The first bit of typecode is set to 1, clear it */
5744 tk_id &= 0x7fffffff;
5746 /* HACK: NDDS 4.0 and NDDS 4.1 has different typecode ID list.
5747 * The ID listed in the RTI_CDR_TK_XXXXX are the one from NDDS 4.1
5748 * In order to correctly dissect NDDS 4.0 packets containing typecode
5749 * information, we check if the ID of the element at level zero is a
5750 * struct or union. If not, it means we are dissecting a ndds 4.0 packet
5751 * (and we can decrement the ID to match the correct values).
5753 if (indent_level == 0) {
5754 if (tk_id == RTI_CDR_TK_OCTET) {
5755 ndds_40_hack = 1;
5758 if (ndds_40_hack) {
5759 ++tk_id;
5762 (void) g_strlcpy(type_name, rtps_util_typecode_id_to_string(tk_id), sizeof(type_name));
5764 /* Structure of the typecode data:
5766 * <type_code_header> ::=
5767 * <kind>
5768 * <type_code_length>
5770 * <kind> ::= long (0=TK_NULL, 1=TK_SHORT...)
5771 * <type_code_length> ::= unsugned short
5774 switch(tk_id) {
5776 /* Structure of the typecode data:
5778 * <union_type_code> ::=
5779 * <type_code_header>
5780 * <name>
5781 * <default_index>
5782 * <discriminator_type_code>
5783 * <member_count>
5784 * <union_member>+
5785 * <union_member> ::= <member_length><name><union_member_detail>
5786 * <member_length> ::= unsigned short
5787 * <name> ::= <string>
5788 * <string> ::= <length>char+<eol>
5789 * <length> ::= unsigned long
5790 * <eol> ::= (char)0
5792 * <union_member_detail> ::= <is_pointer>
5793 * <labels_count>
5794 * <label>+
5795 * <type_code>
5796 * <labels_count> ::= unsigned long
5797 * <label> ::= long
5800 case RTI_CDR_TK_UNION: {
5801 uint32_t struct_name_len;
5802 uint8_t *struct_name;
5803 const char *discriminator_name; /* for unions */
5804 char *discriminator_enum_name = NULL; /* for unions with enum discriminator */
5805 /*uint32_t defaultIdx;*/ /* Currently is ignored */
5806 uint32_t disc_id; /* Used temporarily to populate 'discriminator_name' */
5807 uint16_t disc_size; /* Currently is ignored */
5808 uint32_t disc_offset_begin, num_members, member_name_len;
5809 uint16_t member_length;
5810 uint8_t *member_name = NULL;
5811 uint32_t next_offset, field_offset_begin, member_label_count, discriminator_enum_name_length;
5812 int32_t member_label;
5813 unsigned j;
5815 /* - - - - - - - Union name - - - - - - - */
5816 /* Pad-align */
5817 LONG_ALIGN(offset);
5819 /* Get structure name length */
5820 struct_name_len = tvb_get_uint32(tvb, offset, encoding);
5821 offset += 4;
5822 struct_name = tvb_get_string_enc(pinfo->pool, tvb, offset, struct_name_len, ENC_ASCII);
5823 offset = check_offset_addition(offset, struct_name_len, tree, NULL, tvb);
5825 /* - - - - - - - Default index - - - - - - - */
5826 LONG_ALIGN(offset);
5827 /*defaultIdx = NEXT_uint32(tvb, offset, encoding);*/
5828 offset += 4;
5830 /* - - - - - - - Discriminator type code - - - - - - - */
5831 /* We don't recursively dissect everything, instead we just read the type */
5832 disc_id = tvb_get_uint32(tvb, offset, encoding);
5833 offset += 4;
5835 disc_size = tvb_get_uint16(tvb, offset, encoding);
5836 offset += 2;
5837 disc_offset_begin = offset;
5838 disc_id &= 0x7fffffff;
5839 discriminator_name = rtps_util_typecode_id_to_string(disc_id);
5840 if (disc_id == RTI_CDR_TK_ENUM) {
5841 /* Enums has also a name that we should print */
5842 LONG_ALIGN(offset);
5843 discriminator_enum_name_length = tvb_get_uint32(tvb, offset, encoding);
5844 discriminator_enum_name = tvb_get_string_enc(pinfo->pool, tvb, offset+4, discriminator_enum_name_length, ENC_ASCII);
5846 offset = disc_offset_begin + disc_size;
5847 #if 0
5848 field_offset_begin = offset;
5849 increment_dissection_depth(pinfo);
5850 offset += rtps_util_add_typecode(
5851 tree,
5852 tvb,
5853 pinfo,
5854 offset,
5855 encoding,
5856 indent_level+1,
5860 field_offset_begin,
5861 member_name,
5863 NULL,
5864 ndds_40_hack);
5865 decrement_dissection_depth(pinfo);
5866 #endif
5868 /* Add the entry of the union in the tree */
5869 proto_tree_add_string_format(tree, hf_rtps_union, tvb, original_offset, retVal, struct_name, "%sunion %s (%s%s%s) {",
5870 indent_string, struct_name, discriminator_name,
5871 (discriminator_enum_name ? " " : ""),
5872 (discriminator_enum_name ? discriminator_enum_name : ""));
5874 if (seq_max_len != -1) {
5875 /* We're dissecting a sequence of struct, bypass the seq definition */
5876 snprintf(type_name, 40, "%s", struct_name);
5877 break;
5880 /* - - - - - - - Number of members - - - - - - - */
5881 LONG_ALIGN(offset);
5882 num_members = tvb_get_uint32(tvb, offset, encoding);
5883 offset += 4;
5885 /* - - - - - - - <union_member>+ - - - - - - - */
5886 next_offset = offset;
5888 for (i = 0; i < num_members; ++i) {
5889 uint8_t member_is_pointer;
5890 /* Safety: this theoretically should be the same already */
5891 field_offset_begin = offset = next_offset;
5893 SHORT_ALIGN(offset);
5895 /* member's length */
5896 member_length = tvb_get_uint16(tvb, offset, encoding);
5897 offset += 2;
5898 next_offset = offset + member_length;
5900 /* Name length */
5901 LONG_ALIGN(offset);
5902 member_name_len = tvb_get_uint32(tvb, offset, encoding);
5903 offset += 4;
5905 /* Name */
5906 member_name = tvb_get_string_enc(pinfo->pool, tvb, offset, member_name_len, ENC_ASCII);
5907 offset = check_offset_addition(offset, member_name_len, tree, NULL, tvb);
5909 /* is Pointer ? */
5910 member_is_pointer = tvb_get_uint8(tvb, offset);
5911 offset++;
5913 /* Label count */
5914 LONG_ALIGN(offset);
5915 member_label_count = tvb_get_uint32(tvb, offset, encoding);
5916 offset += 4;
5918 for (j = 0; j < member_label_count; ++j) {
5919 proto_item* case_item;
5920 /* Label count */
5921 LONG_ALIGN(offset);
5922 member_label = tvb_get_uint32(tvb, offset, encoding);
5923 offset += 4;
5925 /* Add the entry of the union in the tree */
5926 case_item = proto_tree_add_uint_format(tree, hf_rtps_union_case, tvb, field_offset_begin, 1, member_label,
5927 "%s case %d:", indent_string, member_label);
5928 proto_item_set_len(case_item, retVal);
5931 increment_dissection_depth(pinfo);
5932 offset += rtps_util_add_typecode(tree, tvb, pinfo, offset, encoding,
5933 indent_level+2, member_is_pointer, 0, 0, field_offset_begin,
5934 member_name, -1, NULL, ndds_40_hack);
5935 decrement_dissection_depth(pinfo);
5937 /* Finally prints the name of the struct (if provided) */
5938 (void) g_strlcpy(type_name, "}", sizeof(type_name));
5939 break;
5941 } /* end of case UNION */
5944 case RTI_CDR_TK_ENUM:
5945 case RTI_CDR_TK_STRUCT: {
5946 /* Structure of the typecode data:
5948 * <union_type_code> ::=
5949 * <type_code_header>
5950 * <name>
5951 * <default_index>
5952 * <discriminator_type_code>
5953 * <member_count>
5954 * <member>+
5956 * <struct_type_code> ::=
5957 * <type_code_header>
5958 * <name>
5959 * <member_count>
5960 * <member>+
5962 * <name> ::= <string>
5963 * <string> ::= <length>char+<eol>
5964 * <length> ::= unsigned long
5965 * <eol> ::= (char)0
5966 * <member_count> ::= unsigned long
5968 * STRUCT / UNION:
5969 * Foreach member {
5970 * - A2: 2: member length
5971 * - A4: 4: member name length
5972 * - n: member name
5973 * - 1: isPointer?
5974 * - A2 2: bitfield bits (-1=none)
5975 * - 1: isKey?
5976 * - A4 4: Typecode ID
5977 * - A2 2: length
5980 * ENUM:
5981 * Foreach member {
5982 * - A2: 2: member length
5983 * - A4: 4: member name length
5984 * - n: member name
5985 * - A4: 4: ordinal number
5987 * -> ----------------------------------------------------- <-
5988 * -> The alignment pad bytes belong to the FOLLOWING field <-
5989 * -> A4 = 4 bytes alignment, A2 = 2 bytes alignment <-
5990 * -> ----------------------------------------------------- <-
5992 int8_t *struct_name;
5993 uint32_t struct_name_len, num_members;
5994 uint32_t next_offset;
5995 const char *typecode_name;
5997 /* Pad-align */
5998 LONG_ALIGN(offset);
6000 /* Get structure name length */
6001 struct_name_len = tvb_get_uint32(tvb, offset, encoding);
6002 offset += 4;
6004 /* struct name */
6005 struct_name = tvb_get_string_enc(pinfo->pool, tvb, offset, struct_name_len, ENC_ASCII);
6006 offset = check_offset_addition(offset, struct_name_len, tree, NULL, tvb);
6009 if (tk_id == RTI_CDR_TK_ENUM) {
6010 typecode_name = "enum";
6011 } else if (tk_id == RTI_CDR_TK_VALUE_PARAM) {
6012 /* uint16_t type_modifier; */
6013 /* uint32_t baseTypeCodeKind; */
6014 uint32_t baseTypeCodeLength;
6016 /* Need to read the type modifier and the base type code */
6017 typecode_name = "<sparse type>";
6018 SHORT_ALIGN(offset);
6019 /* type_modifier = */ tvb_get_uint16(tvb, offset, encoding);
6020 offset += 2;
6022 LONG_ALIGN(offset);
6023 /* baseTypeCodeKind = */ tvb_get_uint32(tvb, offset, encoding);
6024 offset += 4;
6026 baseTypeCodeLength = tvb_get_uint32(tvb, offset, encoding);
6027 offset += 4;
6028 offset = check_offset_addition(offset, baseTypeCodeLength, tree, NULL, tvb);
6029 } else {
6030 typecode_name = "struct";
6033 if (seq_max_len != -1) {
6034 /* We're dissecting a sequence of struct, bypass the seq definition */
6035 snprintf(type_name, 40, "%s", struct_name);
6036 break;
6038 /* Prints it */
6039 proto_tree_add_string_format(tree, hf_rtps_struct, tvb, original_offset, retVal, struct_name,
6040 "%s%s %s {", indent_string, typecode_name, struct_name);
6042 /* PAD align */
6043 LONG_ALIGN(offset);
6045 /* number of members */
6046 num_members = tvb_get_uint32(tvb, offset, encoding);
6047 offset += 4;
6049 next_offset = offset;
6050 for (i = 0; i < num_members; ++i) {
6051 uint8_t *member_name;
6052 uint32_t member_name_len;
6053 uint16_t member_length;
6054 uint32_t field_offset_begin;
6056 /* Safety: this theoretically should be the same already */
6057 field_offset_begin = offset = next_offset;
6059 SHORT_ALIGN(offset);
6061 /* member's length */
6062 member_length = tvb_get_uint16(tvb, offset, encoding);
6063 offset += 2;
6064 next_offset = offset + member_length;
6066 /* Name length */
6067 LONG_ALIGN(offset);
6068 member_name_len = tvb_get_uint32(tvb, offset, encoding);
6069 offset += 4;
6071 /* Name */
6072 member_name = tvb_get_string_enc(pinfo->pool, tvb, offset, member_name_len, ENC_ASCII);
6073 offset += member_name_len;
6075 if (tk_id == RTI_CDR_TK_ENUM) {
6076 /* ordinal number */
6077 uint32_t ordinal_number;
6078 LONG_ALIGN(offset);
6079 ordinal_number = tvb_get_uint32(tvb, offset, encoding);
6080 offset += 4;
6082 proto_tree_add_string_format(tree, hf_rtps_member_name, tvb, field_offset_begin, (offset-field_offset_begin), member_name,
6083 "%s %s = %d;", indent_string, member_name, ordinal_number);
6084 } else {
6085 /* Structs */
6086 uint16_t member_bitfield;
6087 uint8_t member_is_pointer;
6088 uint8_t member_is_key;
6090 /* is Pointer ? */
6091 member_is_pointer = tvb_get_uint8(tvb, offset);
6092 offset++;
6094 /* Bitfield */
6095 SHORT_ALIGN(offset);
6096 member_bitfield = tvb_get_uint16(tvb, offset, encoding);
6097 offset += 2; /* pad will be added by typecode dissector */
6099 /* is Key ? */
6100 member_is_key = tvb_get_uint8(tvb, offset);
6101 offset++;
6103 increment_dissection_depth(pinfo);
6104 offset += rtps_util_add_typecode(tree, tvb, pinfo, offset, encoding,
6105 indent_level+1, member_is_pointer, member_bitfield, member_is_key,
6106 field_offset_begin, member_name, -1, NULL, ndds_40_hack);
6107 decrement_dissection_depth(pinfo);
6110 /* Finally prints the name of the struct (if provided) */
6111 (void) g_strlcpy(type_name, "}", sizeof(type_name));
6112 break;
6115 case RTI_CDR_TK_WSTRING:
6116 case RTI_CDR_TK_STRING: {
6117 /* Structure of the typecode data:
6118 * Offset | Size | Field | Notes
6119 * ----------|-------|------------------------------|---------------------
6120 * 6 | 2 | pad |
6121 * 8 | 4 | String length | 4-bytes aligned
6123 uint32_t string_length;
6125 LONG_ALIGN(offset);
6126 string_length = tvb_get_uint32(tvb, offset, encoding);
6127 offset += 4;
6128 snprintf(type_name, 40, "%s<%d>",
6129 (tk_id == RTI_CDR_TK_STRING) ? "string" : "wstring",
6130 string_length);
6131 break;
6134 case RTI_CDR_TK_SEQUENCE: {
6135 /* Structure of the typecode data:
6137 * - A4: 4: Sequence max length
6138 * - the sequence typecode
6140 uint32_t seq_max_len2;
6141 LONG_ALIGN(offset);
6142 seq_max_len2 = tvb_get_uint32(tvb, offset, encoding);
6143 offset += 4;
6145 /* Recursive decode seq typecode */
6146 /*offset += */rtps_util_add_typecode(tree, tvb, pinfo, offset, encoding, indent_level,
6147 is_pointer, bitfield, is_key, offset_begin, name,
6148 seq_max_len2, NULL, ndds_40_hack);
6149 /* Differently from the other typecodes, the line has been already printed */
6150 return retVal;
6153 case RTI_CDR_TK_ARRAY: {
6154 /* Structure of the typecode data:
6156 * - A4: 4: number of dimensions
6157 * - A4: 4: dim1
6158 * - <A4: 4: dim2>
6159 * - ...
6160 * - the array typecode
6162 uint32_t size[MAX_ARRAY_DIMENSION]; /* Max dimensions */
6163 uint32_t dim_max;
6165 LONG_ALIGN(offset);
6166 dim_max = tvb_get_uint32(tvb, offset, encoding);
6167 offset += 4;
6169 if (dim_max > MAX_ARRAY_DIMENSION) {
6170 /* We don't have a tree item to add expert info to... */
6171 dim_max = MAX_ARRAY_DIMENSION;
6174 for (i = 0; i < MAX_ARRAY_DIMENSION; ++i) size[i] = 0;
6175 for (i = 0; i < dim_max; ++i) {
6176 size[i] = tvb_get_uint32(tvb, offset, encoding);
6177 offset += 4;
6180 /* Recursive decode seq typecode */
6181 increment_dissection_depth(pinfo);
6182 /*offset += */rtps_util_add_typecode(tree, tvb, pinfo, offset, encoding,
6183 indent_level, is_pointer, bitfield, is_key, offset_begin,
6184 name, -1, size, ndds_40_hack);
6185 decrement_dissection_depth(pinfo);
6186 /* Differently from the other typecodes, the line has been already printed */
6187 return retVal;
6190 case RTI_CDR_TK_ALIAS: {
6191 /* Structure of the typecode data:
6193 * - A4: 4: alias name size
6194 * - A4: 4: alias name
6195 * - A4: 4: the alias typecode
6197 uint32_t alias_name_length;
6198 uint8_t *alias_name;
6200 LONG_ALIGN(offset);
6201 alias_name_length = tvb_get_uint32(tvb, offset, encoding);
6202 offset += 4;
6203 alias_name = tvb_get_string_enc(pinfo->pool, tvb, offset, alias_name_length, ENC_ASCII);
6204 offset = check_offset_addition(offset, alias_name_length, tree, NULL, tvb);
6205 (void) g_strlcpy(type_name, alias_name, sizeof(type_name));
6206 break;
6211 * VALUETYPES:
6212 * - A4: 4: name length
6213 * - n: name
6214 * - A2: type modifier
6215 * - A4: base type code
6216 * - A4: number of members
6217 * Foreach member: (it's just like a struct)
6220 case RTI_CDR_TK_VALUE_PARAM:
6221 case RTI_CDR_TK_VALUE: {
6222 /* Not fully dissected for now */
6223 /* Pad-align */
6224 uint32_t value_name_len;
6225 int8_t *value_name;
6226 const char *type_id_name = "valuetype";
6227 LONG_ALIGN(offset);
6229 /* Get structure name length */
6230 value_name_len = tvb_get_uint32(tvb, offset, encoding);
6231 offset += 4;
6233 /* value name */
6234 value_name = tvb_get_string_enc(pinfo->pool, tvb, offset, value_name_len, ENC_ASCII);
6235 offset = check_offset_addition(offset, value_name_len, tree, NULL, tvb);
6237 if (tk_id == RTI_CDR_TK_VALUE_PARAM) {
6238 type_id_name = "valueparam";
6240 snprintf(type_name, sizeof(type_name), "%s '%s'", type_id_name, value_name);
6241 break;
6243 } /* switch(tk_id) */
6245 /* Sequence print */
6246 if (seq_max_len != -1) {
6247 proto_tree_add_string_format(tree, hf_rtps_sequence, tvb, offset_begin, (offset-offset_begin), type_name,
6248 "%ssequence<%s, %d> %s%s;%s", indent_string, type_name, seq_max_len,
6249 is_pointer ? "*" : "",
6250 name ? name : "",
6251 is_key ? KEY_COMMENT : "");
6252 return retVal;
6255 /* Array print */
6256 if (arr_dimension != NULL) {
6257 /* Printing an array */
6258 wmem_strbuf_t *dim_str = wmem_strbuf_create(pinfo->pool);
6259 for (i = 0; i < MAX_ARRAY_DIMENSION; ++i) {
6260 if (arr_dimension[i] != 0) {
6261 wmem_strbuf_append_printf(dim_str, "[%d]", arr_dimension[i]);
6262 } else {
6263 break;
6266 proto_tree_add_string_format(tree, hf_rtps_array, tvb, offset_begin, (offset-offset_begin), type_name,
6267 "%s%s %s%s;%s", indent_string, type_name, name ? name : "",
6268 wmem_strbuf_get_str(dim_str), is_key ? KEY_COMMENT : "");
6269 return retVal;
6272 /* Bitfield print */
6273 if (bitfield != 0xffff && name != NULL && is_pointer == 0) {
6274 proto_tree_add_string_format(tree, hf_rtps_bitfield, tvb, offset_begin, (offset-offset_begin), type_name,
6275 "%s%s %s:%d;%s", indent_string, type_name, name,
6276 bitfield, is_key ? KEY_COMMENT : "");
6277 return retVal;
6280 /* Everything else */
6281 proto_tree_add_string_format(tree, hf_rtps_datatype, tvb, offset_begin, (offset-offset_begin), type_name,
6282 "%s%s%s%s%s;%s", indent_string, type_name,
6283 name ? " " : "",
6284 is_pointer ? "*" : "",
6285 name ? name : "",
6286 is_key ? KEY_COMMENT : "");
6287 return retVal;
6290 static int rtps_util_add_type_id(proto_tree *tree,
6291 tvbuff_t * tvb, int offset, const unsigned encoding,
6292 int zero, int hf_base, proto_item * append_info_item,
6293 uint64_t * type_id) {
6294 proto_item * ti;
6295 uint16_t short_number;
6296 uint64_t longlong_number;
6297 int hf_type;
6298 short_number = tvb_get_uint16(tvb, offset, encoding);
6299 ti = proto_tree_add_item(tree, hf_rtps_type_object_type_id_disc, tvb, offset, 2, encoding);
6300 proto_item_set_hidden(ti);
6302 /* Here we choose the proper hf item to use */
6303 if (hf_base != -1) {
6304 if (short_number <= 13)
6305 hf_type = hf_rtps_type_object_base_primitive_type_id;
6306 else
6307 hf_type = hf_rtps_type_object_base_type;
6308 } else {
6309 if (short_number <= 13)
6310 hf_type = hf_rtps_type_object_primitive_type_id;
6311 else
6312 hf_type = hf_rtps_type_object_type_id;
6315 offset += 2;
6316 if (short_number <= 13) {
6317 proto_tree_add_item(tree, hf_type, tvb, offset, 2, encoding);
6318 if (append_info_item) {
6319 proto_item_append_text(append_info_item, "(%s)",
6320 val_to_str(short_number, type_object_kind, "(0x%016x)"));
6322 offset += 2;
6323 } else {
6324 ALIGN_ZERO(offset, 8, zero);
6325 longlong_number = tvb_get_uint64(tvb, offset, encoding);
6326 proto_tree_add_item(tree, hf_type, tvb, offset, 8, encoding);
6327 if (append_info_item) {
6328 proto_item_append_text(append_info_item, "(0x%016" PRIx64 ")", longlong_number);
6330 offset += 8;
6333 if (short_number <= 13) {
6334 if (type_id) {
6335 *type_id = short_number;
6337 } else {
6338 if (type_id) {
6339 *type_id = longlong_number;
6342 return offset;
6345 static int rtps_util_add_type_annotation_usage(proto_tree *tree,
6346 tvbuff_t * tvb, int offset, const unsigned encoding, int zero) {
6347 uint32_t long_number, i;
6348 uint16_t short_number;
6349 offset = rtps_util_add_type_id(tree, tvb, offset, encoding, zero, -1, NULL, NULL);
6350 long_number = tvb_get_uint32(tvb, offset, encoding);
6351 offset += 4;
6352 for (i = 0; i < long_number; i++) {
6353 proto_tree_add_item(tree, hf_rtps_type_object_member_id, tvb, offset, 4, encoding);
6354 offset += 4;
6355 short_number = tvb_get_uint16(tvb, offset, encoding);
6356 proto_tree_add_item(tree, hf_rtps_type_object_annotation_value_d, tvb, offset, 2, encoding);
6357 offset += 2;
6358 /* There may be more additions in the future */
6359 switch (short_number) {
6360 case 4: /* UINT_16 */
6361 proto_tree_add_item(tree, hf_rtps_type_object_annotation_value_16, tvb, offset, 2, encoding);
6362 offset += 2;
6363 break;
6364 default:
6365 break;
6369 return offset;
6372 static int rtps_util_add_type_library_type(proto_tree *tree,
6373 tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info *info) {
6374 proto_tree * annotation_tree;
6375 uint32_t member_id = 0, member_length = 0, long_number, i;
6376 int offset_tmp;
6377 uint16_t short_number;
6378 char * name = NULL;
6379 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6380 offset_tmp = offset;
6382 /* dissect property */
6383 short_number = tvb_get_uint16(tvb, offset_tmp, encoding);
6384 proto_tree_add_bitmask_value(tree, tvb, offset_tmp, hf_rtps_type_object_flags,
6385 ett_rtps_flags, TYPE_FLAG_FLAGS, short_number);
6386 if (info) {
6387 if (short_number & 0x02)
6388 info->extensibility = EXTENSIBILITY_MUTABLE;
6389 else if (short_number & 0x01)
6390 info->extensibility = EXTENSIBILITY_FINAL;
6391 else
6392 info->extensibility = EXTENSIBILITY_EXTENSIBLE;
6394 offset_tmp += 2;
6395 if (info)
6396 offset_tmp = rtps_util_add_type_id(tree, tvb, offset_tmp, encoding, offset, -1, tree, &(info->type_id));
6397 else
6398 offset_tmp = rtps_util_add_type_id(tree, tvb, offset_tmp, encoding, offset, -1, tree, NULL);
6399 rtps_util_add_string(tree, tvb, offset_tmp, hf_rtps_type_object_type_property_name,
6400 encoding);
6401 long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
6402 name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset_tmp+4, long_number, ENC_ASCII);
6403 if (info)
6404 (void) g_strlcpy(info->member_name, name, sizeof(info->member_name));
6406 proto_item_append_text(tree, " %s", name);
6407 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6409 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6410 offset_tmp = offset;
6412 /* dissect annotation_seq */
6413 long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
6414 annotation_tree = proto_tree_add_subtree_format(tree, tvb, offset_tmp, member_length,
6415 ett_rtps_type_annotation_usage_list, NULL, "Annotation Usage Member List (%d elements)",
6416 long_number);
6417 offset_tmp += 4;
6418 for (i = 0; i < long_number ; i++) {
6419 offset_tmp = rtps_util_add_type_annotation_usage(annotation_tree, tvb, offset_tmp,
6420 encoding, offset);
6422 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6424 return offset;
6427 static void rtps_util_add_type_element_enumeration(proto_tree *tree,
6428 tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info) {
6429 proto_tree * enumerated_constant;
6430 uint32_t member_id = 0, member_length = 0;
6431 uint32_t long_number, i;
6432 int enum_size, offset_tmp;
6434 offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
6436 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6437 /* dissect Bound */
6438 proto_tree_add_item(tree, hf_rtps_type_object_bound, tvb, offset, 4, encoding);
6439 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6441 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6442 /* dissect constant seq */
6443 offset_tmp = offset;
6444 long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
6445 offset_tmp += 4;
6446 for (i = 0; i < long_number; i++) {
6447 char * name = NULL;
6448 uint32_t size, value;
6449 enum_size = offset_tmp;
6450 size = tvb_get_uint32(tvb, offset_tmp + 4, encoding);
6451 name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset_tmp + 8, size, ENC_ASCII);
6452 value = tvb_get_uint32(tvb, offset_tmp, encoding);
6453 enumerated_constant = proto_tree_add_subtree_format(tree, tvb, offset_tmp, 0,
6454 ett_rtps_type_enum_constant, NULL, "%s (%u)", name, value);
6455 proto_tree_add_item(enumerated_constant, hf_rtps_type_object_enum_constant_value, tvb, offset_tmp, 4, encoding);
6456 offset_tmp += 4;
6457 offset_tmp = rtps_util_add_string(enumerated_constant, tvb, offset_tmp, hf_rtps_type_object_enum_constant_name, encoding);
6458 proto_item_set_len(enumerated_constant, offset_tmp - enum_size);
6461 info->num_elements = 0;
6464 static void rtps_util_add_type_element_sequence(proto_tree *tree,
6465 tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info) {
6466 uint32_t member_id = 0, member_length = 0;
6467 int zero_alignment;
6468 offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
6470 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6471 zero_alignment = offset;
6472 rtps_util_add_type_id(tree, tvb, offset, encoding, zero_alignment, -1 , NULL, &(info->base_type_id));
6473 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6474 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6475 proto_tree_add_item(tree, hf_rtps_type_object_element_shared, tvb, offset, 1, encoding);
6476 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6477 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6478 /* dissect Bound */
6479 proto_tree_add_item(tree, hf_rtps_type_object_bound, tvb, offset, 4, encoding);
6480 if (info)
6481 info->bound = tvb_get_int32(tvb, offset, encoding);
6484 static void rtps_util_add_type_element_string(proto_tree *tree,
6485 tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info _U_) {
6486 uint32_t member_id = 0, member_length = 0;
6487 int zero_alignment;
6488 offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
6490 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6491 zero_alignment = offset;
6492 rtps_util_add_type_id(tree, tvb, offset, encoding, zero_alignment, -1, NULL, NULL);
6493 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6494 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6495 proto_tree_add_item(tree, hf_rtps_type_object_element_shared, tvb, offset, 1, encoding);
6496 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6497 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6498 /* dissect Bound */
6499 proto_tree_add_item(tree, hf_rtps_type_object_bound, tvb, offset, 4, encoding);
6500 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6503 static void rtps_util_add_type_element_array(proto_tree *tree,
6504 tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info _U_) {
6505 proto_tree * bound_tree;
6506 uint32_t member_id = 0, member_length = 0;
6507 uint32_t long_number, i;
6508 int zero_alignment, offset_tmp;
6509 offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
6511 /* Dissect Collection Type */
6512 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6513 zero_alignment = offset;
6514 rtps_util_add_type_id(tree, tvb, offset, encoding, zero_alignment, -1, NULL, &(info->base_type_id));
6515 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6516 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6517 proto_tree_add_item(tree, hf_rtps_type_object_element_shared, tvb, offset, 1, encoding);
6518 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6519 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6521 /* dissect Bound sequence */
6523 offset_tmp = offset;
6524 long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
6525 bound_tree = proto_tree_add_subtree_format(tree, tvb, offset_tmp, member_length,
6526 ett_rtps_type_bound_list, NULL, "Bounds (%d elements)",
6527 long_number);
6528 offset_tmp += 4;
6529 for (i = 0; i < long_number ; i++) {
6530 proto_tree_add_item(bound_tree, hf_rtps_type_object_bound, tvb, offset_tmp, 4, encoding);
6531 if (info) info->bound = tvb_get_int32(tvb, offset_tmp, encoding);
6532 if (info) info->num_elements = tvb_get_int32(tvb, offset_tmp, encoding);
6534 offset_tmp += 4;
6538 static void rtps_util_add_type_element_alias(proto_tree *tree,
6539 tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info) {
6540 uint32_t member_id = 0, member_length = 0;
6541 offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
6543 /* dissect base_type */
6544 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6545 rtps_util_add_type_id(tree, tvb, offset, encoding, offset, hf_rtps_type_object_base_type, NULL, &(info->base_type_id));
6548 static int rtps_util_add_type_member(proto_tree *tree,
6549 tvbuff_t * tvb, int offset, const unsigned encoding,
6550 dissection_info * info, dissection_element * member_object) {
6551 proto_tree * member_property, *annotation_tree;
6552 uint32_t member_id = 0, member_length = 0;
6553 uint32_t long_number, i;
6554 uint16_t short_number;
6555 uint64_t member_type_id;
6556 int offset_tmp;
6557 char * name = NULL;
6559 member_property = proto_tree_add_subtree(tree, tvb, offset, 0,
6560 ett_rtps_type_element, NULL, "Member Property");
6561 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6562 offset_tmp = offset;
6563 short_number = tvb_get_uint16(tvb, offset_tmp, encoding);
6564 proto_tree_add_bitmask_value(member_property, tvb, offset_tmp, hf_rtps_type_object_flags,
6565 ett_rtps_flags, MEMBER_FLAGS, short_number);
6566 if (member_object) member_object->flags = short_number;
6567 offset_tmp += 2;
6568 ALIGN_ZERO(offset_tmp, 4, offset);
6569 proto_tree_add_item(member_property, hf_rtps_type_object_member_id, tvb, offset_tmp, 4, encoding);
6570 member_id = tvb_get_uint32(tvb, offset_tmp, encoding);
6571 offset_tmp += 4;
6572 offset_tmp = rtps_util_add_type_id(member_property, tvb, offset_tmp, encoding,
6573 offset, -1, tree, &member_type_id);
6574 rtps_util_add_string(member_property, tvb, offset_tmp, hf_rtps_type_object_name, encoding);
6575 long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
6576 name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset_tmp+4, long_number, ENC_ASCII);
6577 proto_item_append_text(tree, " %s (ID: %d)", name, member_id);
6578 if (member_object) {
6579 member_object->member_id = member_id;
6580 (void) g_strlcpy(member_object->member_name, name, sizeof(member_object->member_name));
6581 member_object->type_id = member_type_id;
6583 if (info && info->extensibility == EXTENSIBILITY_MUTABLE) {
6584 mutable_member_mapping * mutable_mapping = NULL;
6585 mutable_mapping = wmem_new(wmem_file_scope(), mutable_member_mapping);
6586 (void) g_strlcpy(mutable_mapping->member_name, name, sizeof(mutable_mapping->member_name));
6587 mutable_mapping->struct_type_id = info->type_id;
6588 mutable_mapping->member_type_id = member_type_id;
6589 mutable_mapping->member_id = member_id;
6590 mutable_mapping->key = (mutable_mapping->struct_type_id + mutable_mapping->struct_type_id * mutable_mapping->member_id);
6591 proto_item_append_text(tree, "(Inserted 0x%016" PRIx64 " from 0x%016" PRIx64 ")", mutable_mapping->key, mutable_mapping->struct_type_id);
6592 wmem_map_insert(mutable_member_mappings, &(mutable_mapping->key), (void *) mutable_mapping);
6596 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6598 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6599 offset_tmp = offset;
6600 long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
6601 annotation_tree = proto_tree_add_subtree_format(tree, tvb, offset_tmp, member_length,
6602 ett_rtps_type_annotation_usage_list, NULL, "Annotation Usage Member List (%d elements)",
6603 long_number);
6604 offset_tmp += 4;
6605 for (i = 0; i < long_number ; i++) {
6606 offset_tmp = rtps_util_add_type_annotation_usage(annotation_tree, tvb, offset_tmp,
6607 encoding, offset);
6609 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6611 long_number = tvb_get_uint32(tvb, offset, encoding);
6612 if ((long_number & PID_LIST_END) == PID_LIST_END) {
6613 offset += 4;
6616 return offset;
6619 static int rtps_util_add_type_union_member(proto_tree *tree,
6620 tvbuff_t * tvb, int offset, const unsigned encoding, uint64_t union_type_id,
6621 bool is_discriminator, dissection_info * info _U_) {
6622 proto_tree * labels;
6623 int long_number, i;
6624 int offset_tmp;
6625 uint32_t member_id = 0, member_length = 0;
6626 dissection_element object;
6627 offset = rtps_util_add_type_member(tree, tvb, offset, encoding, NULL, &object); //&(info->elements[i])
6629 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6630 offset_tmp = offset;
6632 long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
6634 labels = proto_tree_add_subtree_format(tree, tvb, offset_tmp, member_length,
6635 ett_rtps_type_enum_constant, NULL, "Labels (%u elements)", long_number);
6636 offset_tmp += 4;
6637 if ((object.flags & 8) == 8) {
6638 union_member_mapping * mapping = NULL;
6640 mapping = wmem_new(wmem_file_scope(), union_member_mapping);
6641 (void) g_strlcpy(mapping->member_name, object.member_name, sizeof(mapping->member_name));
6642 mapping->member_type_id = object.type_id;
6643 mapping->discriminator = HASHMAP_DISCRIMINATOR_CONSTANT;
6644 mapping->union_type_id = union_type_id + mapping->discriminator;
6646 wmem_map_insert(union_member_mappings, &(mapping->union_type_id), (void *) mapping);
6647 proto_item_append_text(labels, " Added mapping for discriminator (0x%016" PRIx64 ") name = %s",
6648 mapping->union_type_id, mapping->member_name);
6650 if (is_discriminator) {
6651 union_member_mapping * mapping = NULL;
6653 mapping = wmem_new(wmem_file_scope(), union_member_mapping);
6654 (void) g_strlcpy(mapping->member_name, object.member_name, sizeof(mapping->member_name));
6655 mapping->member_type_id = object.type_id;
6656 mapping->discriminator = -1;
6657 mapping->union_type_id = union_type_id + mapping->discriminator;
6659 wmem_map_insert(union_member_mappings, &(mapping->union_type_id), (void *) mapping);
6660 proto_item_append_text(labels, " Added mapping for discriminator (0x%016" PRIx64 ") name = %s",
6661 mapping->union_type_id, mapping->member_name);
6663 for (i = 0; i < long_number; i++) {
6664 proto_item * ti;
6665 union_member_mapping * mapping = NULL;
6666 uint32_t discriminator_case;
6668 mapping = wmem_new(wmem_file_scope(), union_member_mapping);
6670 discriminator_case = tvb_get_uint32(tvb, offset_tmp, encoding);
6671 ti = proto_tree_add_item(labels, hf_rtps_type_object_union_label, tvb, offset_tmp, 4, encoding);
6672 offset_tmp += 4;
6674 (void) g_strlcpy(mapping->member_name, object.member_name, sizeof(mapping->member_name));
6675 mapping->member_type_id = object.type_id;
6676 mapping->discriminator = discriminator_case;
6677 mapping->union_type_id = union_type_id + discriminator_case;
6679 wmem_map_insert(union_member_mappings, &(mapping->union_type_id), (void *) mapping);
6680 proto_item_append_text(ti, " Added mapping for discriminator (0x%016" PRIx64 ") name = %s",
6681 mapping->union_type_id, mapping->member_name);
6684 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6685 long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
6687 if ((long_number & PID_LIST_END) == PID_LIST_END) {
6688 offset += 4;
6691 return offset;
6694 static void rtps_util_add_type_element_union(proto_tree *tree,
6695 tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info) {
6696 proto_tree * members;
6697 uint32_t member_id = 0, member_length = 0;
6698 uint32_t long_number, i;
6699 int offset_tmp;
6700 offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
6702 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6703 offset_tmp = offset;
6705 long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
6706 members = proto_tree_add_subtree(tree, tvb, offset_tmp, -1,
6707 ett_rtps_type_enum_constant, NULL, "Members");
6709 offset_tmp += 4;
6711 for (i = 0; i < long_number; i++) {
6712 proto_tree * member = NULL;
6713 int offset_member = offset_tmp;
6714 member = proto_tree_add_subtree(members, tvb, offset_tmp, 0,
6715 ett_rtps_type_enum_constant, NULL, "Member");
6716 offset_tmp = rtps_util_add_type_union_member(member, tvb, offset_tmp, encoding,
6717 info->type_id, (i == 0), info);
6718 proto_item_set_len(member, offset_tmp - offset_member);
6721 long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
6722 if ((long_number & PID_LIST_END) == PID_LIST_END) {
6723 offset_tmp += 4;
6725 proto_item_set_len(members, offset_tmp - offset);
6728 static void rtps_util_add_type_element_struct(proto_tree *tree,
6729 tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info) {
6730 proto_tree * member;
6731 uint32_t member_id = 0, member_length = 0;
6732 uint32_t long_number, i;
6733 int offset_tmp, member_size;
6734 wmem_array_t *elements = NULL;
6735 dissection_element zero_element = {0};
6737 offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
6739 /* dissect base_type */
6740 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6741 offset = rtps_util_add_type_id(tree, tvb, offset, encoding, offset, hf_rtps_type_object_base_type, NULL, &(info->base_type_id));
6743 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6744 /* dissect seq_member*/
6746 offset_tmp = offset;
6747 long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
6749 offset_tmp += 4;
6751 if (info) {
6752 elements = wmem_array_sized_new(wmem_file_scope(), sizeof(dissection_element), MIN(long_number, DISSECTION_INFO_MAX_ELEMENTS_DEFAULT_VALUE));
6754 for (i = 0; i < long_number; i++) {
6755 member_size = offset_tmp;
6756 member = proto_tree_add_subtree(tree, tvb, offset_tmp, 0,
6757 ett_rtps_type_enum_constant, NULL, "");
6758 if (info && elements) {
6759 wmem_array_append_one(elements, zero_element);
6760 offset_tmp = rtps_util_add_type_member(member, tvb, offset_tmp, encoding, info, wmem_array_index(elements, i));
6761 } else {
6762 offset_tmp = rtps_util_add_type_member(member, tvb, offset_tmp, encoding, NULL, NULL);
6764 proto_item_set_len(member, offset_tmp - member_size);
6766 if (info) {
6767 info->num_elements = wmem_array_get_count(elements);
6768 info->elements = wmem_array_finalize(elements);
6772 static void rtps_util_add_type_library(proto_tree *tree, packet_info * pinfo,
6773 tvbuff_t * tvb, int offset, const unsigned encoding, uint32_t size);
6775 // NOLINTNEXTLINE(misc-no-recursion)
6776 static void rtps_util_add_type_element_module(proto_tree *tree, packet_info * pinfo,
6777 tvbuff_t * tvb, int offset, const unsigned encoding) {
6778 uint32_t long_number;
6779 char * name = NULL;
6780 long_number = tvb_get_uint32(tvb, offset, encoding);
6781 name = tvb_get_string_enc(pinfo->pool, tvb, offset+4, long_number, ENC_ASCII);
6782 proto_item_set_text(tree, "module %s", name);
6783 offset = rtps_util_add_string(tree, tvb, offset, hf_rtps_type_object_element_module_name, encoding);
6784 rtps_util_add_type_library(tree, pinfo, tvb, offset, encoding, -1);
6787 // NOLINTNEXTLINE(misc-no-recursion)
6788 static int rtps_util_add_type_library_element(proto_tree *tree, packet_info * pinfo,
6789 tvbuff_t * tvb, int offset, const unsigned encoding) {
6790 proto_tree * element_tree;
6791 uint32_t long_number;
6792 uint32_t member_id = 0, member_length = 0;
6793 int initial_offset = offset;
6794 dissection_info * info;
6795 bool add_info = true;
6797 info = wmem_new(wmem_file_scope(), dissection_info);
6798 info->elements = NULL;
6800 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6801 long_number = tvb_get_uint32(tvb, offset, encoding);
6802 info->member_kind = long_number;
6804 element_tree = proto_tree_add_subtree(tree, tvb, offset, 0,
6805 ett_rtps_type_element, NULL, "");
6806 offset = check_offset_addition(offset, member_length, tree, pinfo, tvb);
6807 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6808 proto_item_set_len(element_tree, member_length + offset - initial_offset);
6809 switch (long_number) {
6810 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE: /*ENUMERATION */
6811 rtps_util_add_type_element_enumeration(element_tree, tvb, offset, encoding, info);
6812 break;
6813 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ALIAS_TYPE: /* ALIAS */
6814 rtps_util_add_type_element_alias(element_tree, tvb, offset, encoding, info);
6815 break;
6816 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE: /* ARRAY */
6817 rtps_util_add_type_element_array(element_tree, tvb, offset, encoding, info);
6818 break;
6819 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE: /* SEQUENCE */
6820 rtps_util_add_type_element_sequence(element_tree, tvb, offset, encoding, info);
6821 break;
6822 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRING_TYPE: /* STRING : COLLECTION */
6823 rtps_util_add_type_element_string(element_tree, tvb, offset, encoding, info);
6824 break;
6825 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UNION_TYPE:
6826 rtps_util_add_type_element_union(element_tree, tvb, offset, encoding, info);
6827 break;
6828 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE: /* STRUCT */
6829 rtps_util_add_type_element_struct(element_tree, tvb, offset, encoding, info);
6830 break;
6831 case RTI_CDR_TYPE_OBJECT_TYPE_KIND_MODULE:
6832 /* This does *not* fill in the info structure, so do *not* add it. */
6833 add_info = false;
6834 rtps_util_add_type_element_module(element_tree, pinfo, tvb, offset, encoding);
6835 break;
6836 default:
6837 /* We have *not* filled in the info structure, so do *not* add it. */
6838 add_info = false;
6839 proto_item_append_text(element_tree, "Kind: %u", long_number);
6840 proto_tree_add_item(element_tree, hf_rtps_type_object_element_raw, tvb, offset,
6841 member_length, encoding);
6842 break;
6844 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
6845 LONG_ALIGN(offset);
6846 long_number = tvb_get_uint32(tvb, offset, encoding);
6847 if ((long_number & PID_LIST_END) != PID_LIST_END) {
6848 expert_add_info_format(pinfo, element_tree, &ei_rtps_parameter_value_invalid,
6849 "Now it should be PID_LIST_END and it is not"); \
6851 offset += 4;
6852 proto_item_set_len(element_tree, offset - initial_offset);
6854 if (add_info) {
6855 wmem_map_insert(dissection_infos, &(info->type_id), (void *) info);
6858 return offset;
6861 // NOLINTNEXTLINE(misc-no-recursion)
6862 static void rtps_util_add_type_library(proto_tree *tree, packet_info * pinfo,
6863 tvbuff_t * tvb, int offset, const unsigned encoding, uint32_t size) {
6864 proto_tree * library_tree;
6865 uint32_t long_number, i;
6866 long_number = tvb_get_uint32(tvb, offset, encoding);
6867 library_tree = proto_tree_add_subtree_format(tree, tvb, offset, size,
6868 ett_rtps_type_library, NULL, "Type Library (%d elements)", long_number);
6869 offset += 4;
6870 increment_dissection_depth(pinfo);
6871 for (i = 0; i < long_number; i++) {
6872 offset = rtps_util_add_type_library_element(library_tree, pinfo, tvb,
6873 offset, encoding);
6875 decrement_dissection_depth(pinfo);
6878 static void rtps_util_add_typeobject(proto_tree *tree, packet_info * pinfo,
6879 tvbuff_t * tvb, int offset, const unsigned encoding, uint32_t size,
6880 type_mapping * type_mapping_object ) {
6881 proto_tree * typeobject_tree;
6882 int offset_tmp = 0;
6883 uint32_t member_id = 0, member_length = 0;
6884 uint32_t long_number;
6885 uint64_t type_id;
6887 typeobject_tree = proto_tree_add_subtree(tree, tvb, offset, size,
6888 ett_rtps_type_object, NULL, "Type Object");
6889 /* --- This is the standard parameterized serialization --- */
6890 /* TypeLibrary */
6891 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6892 offset_tmp = offset;
6893 /* Dissect the member */
6894 rtps_util_add_type_library(typeobject_tree, pinfo, tvb, offset_tmp, encoding, member_length);
6895 offset = check_offset_addition(offset, member_length, tree, pinfo, tvb);
6896 /* End TypeLibrary */
6898 /* _TypeId */
6899 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
6900 offset_tmp = offset;
6901 /* Dissect the member. In this case, the typeid is an union with a short
6902 * as a discriminator*/
6903 rtps_util_add_type_id(typeobject_tree, tvb, offset_tmp, encoding, offset, -1, NULL, &type_id);
6904 if (type_mapping_object) type_mapping_object->type_id = type_id;
6905 offset = check_offset_addition(offset, member_length, tree, pinfo, tvb);
6906 /* End _TypeId */
6908 long_number = tvb_get_uint32(tvb, offset, encoding);
6909 if ((long_number & PID_LIST_END) != PID_LIST_END) {
6910 expert_add_info_format(pinfo, typeobject_tree, &ei_rtps_parameter_value_invalid,
6911 "This should be PID_LIST_END and it is not"); \
6916 #if defined (HAVE_ZLIB) || defined (HAVE_ZLIBNG)
6917 static void rtps_add_zlib_compressed_typeobject(proto_tree *tree, packet_info * pinfo,
6918 tvbuff_t * tvb, int offset, const unsigned encoding, unsigned compressed_size,
6919 unsigned decompressed_size, type_mapping * type_mapping_object) {
6921 tvbuff_t *decompressed_data_child_tvb;
6922 tvbuff_t *compressed_type_object_subset;
6923 proto_tree *decompressed_type_object_subtree;
6925 compressed_type_object_subset = tvb_new_subset_length(tvb, offset, decompressed_size);
6926 decompressed_data_child_tvb = tvb_child_uncompress_zlib(tvb, compressed_type_object_subset, 0, compressed_size);
6927 if (decompressed_data_child_tvb) {
6928 decompressed_type_object_subtree = proto_tree_add_subtree(tree, decompressed_data_child_tvb,
6929 0, 0, ett_rtps_decompressed_type_object, NULL, "[Uncompressed type object]");
6930 rtps_util_add_typeobject(decompressed_type_object_subtree, pinfo,
6931 decompressed_data_child_tvb, 0, encoding, decompressed_size, type_mapping_object);
6933 else {
6934 proto_tree_add_subtree(tree, compressed_type_object_subset,
6935 0, 0, ett_rtps_decompressed_type_object, NULL, "[Failed to decompress type object]");
6938 #else
6939 static void rtps_add_zlib_compressed_typeobject(proto_tree *tree _U_, packet_info * pinfo _U_,
6940 tvbuff_t * tvb _U_, int offset _U_, const unsigned encoding _U_, unsigned compressed_size _U_,
6941 unsigned decompressed_size _U_, type_mapping * type_mapping_object _U_)
6944 #endif
6946 /* ------------------------------------------------------------------------- */
6947 /* Insert in the protocol tree the next bytes interpreted as Sequence of
6948 * Octets.
6949 * The formatted buffer is: [ 0x01, 0x02, 0x03, 0x04, ...]
6950 * The maximum number of elements displayed is 10, after that a '...' is
6951 * inserted.
6953 static int rtps_util_add_seq_octets(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
6954 int offset, const unsigned encoding, int param_length, int hf_id) {
6955 uint32_t seq_length;
6956 proto_item *ti;
6958 ti = proto_tree_add_item_ret_uint(tree, hf_rtps_sequence_size, tvb, offset, 4, encoding, &seq_length);
6960 offset += 4;
6961 /* param length -1 means not specified */
6962 if (param_length != -1 && param_length < 4 + (int)seq_length) {
6963 expert_add_info_format(pinfo, ti, &ei_rtps_parameter_value_invalid, "ERROR: Parameter value too small");
6964 return offset + seq_length;
6967 if (seq_length) {
6968 proto_tree_add_item(tree, hf_id, tvb, offset, seq_length, ENC_NA);
6971 return offset + seq_length;
6974 static int rtps_util_add_data_holder(proto_tree *tree, tvbuff_t * tvb, packet_info * pinfo,
6975 int offset, const unsigned encoding, int seq_index, int alignment_zero) {
6976 proto_tree * data_holder_tree, * properties_tree, * property_tree;
6977 proto_item * tii, * ti, * data_holder;
6978 uint32_t seq_size, i;
6979 int offset_tmp, data_holder_begin;
6981 data_holder_tree = proto_tree_add_subtree_format(tree, tvb, offset,
6982 -1, ett_rtps_data_holder, &data_holder, "Data Holder [%d]", seq_index);
6983 data_holder_begin = offset;
6984 offset = rtps_util_add_string(data_holder_tree, tvb, offset,
6985 hf_rtps_pgm_data_holder_class_id, encoding);
6986 LONG_ALIGN_ZERO(offset, alignment_zero);
6988 offset_tmp = offset;
6989 properties_tree = proto_tree_add_subtree_format(data_holder_tree, tvb, offset,
6990 -1, ett_rtps_data_holder_properties, &tii, "String Properties");
6991 seq_size = tvb_get_uint32(tvb, offset, encoding);
6992 offset += 4;
6993 for(i = 0; i < seq_size; i++) {
6994 int local_offset = offset;
6995 property_tree = proto_tree_add_subtree_format(properties_tree, tvb, offset,
6996 -1, ett_rtps_property_tree, &ti, "Property [%d]", i);
6997 offset = rtps_util_add_string(property_tree, tvb, offset,
6998 hf_rtps_property_name, encoding);
6999 offset = rtps_util_add_string(property_tree, tvb, offset,
7000 hf_rtps_property_value, encoding);
7001 proto_item_set_len(ti, offset - local_offset);
7003 proto_item_set_len(tii, offset - offset_tmp);
7005 offset_tmp = offset;
7006 properties_tree = proto_tree_add_subtree_format(data_holder_tree, tvb, offset,
7007 -1, ett_rtps_data_holder_properties, &tii, "Binary Properties");
7008 seq_size = tvb_get_uint32(tvb, offset, encoding);
7009 offset += 4;
7010 for(i = 0; i < seq_size; i++) {
7011 int local_offset = offset;
7012 LONG_ALIGN(offset);
7013 property_tree = proto_tree_add_subtree_format(properties_tree, tvb, offset,
7014 -1, ett_rtps_property_tree, &ti, "Property [%d]", i);
7015 offset = rtps_util_add_string(property_tree, tvb, offset,
7016 hf_rtps_property_name, encoding);
7017 offset = rtps_util_add_seq_octets(property_tree, pinfo, tvb, offset,
7018 encoding, -1, hf_rtps_param_user_data);
7019 proto_item_set_len(ti, offset - local_offset);
7021 proto_item_set_len(tii, offset - offset_tmp);
7022 proto_item_set_len(data_holder, offset - offset_tmp);
7024 proto_item_set_len(data_holder, offset - data_holder_begin);
7025 return offset;
7028 static int rtps_util_add_data_holder_seq(proto_tree *tree, tvbuff_t * tvb,
7029 packet_info * pinfo, int offset, const unsigned encoding, int alignment_zero) {
7030 proto_tree * data_holder_seq_tree;
7031 proto_item * ti;
7032 uint32_t seq_length;
7033 uint32_t i;
7035 data_holder_seq_tree = proto_tree_add_subtree(tree, tvb, offset,
7036 -1, ett_rtps_data_holder_seq, &ti, "Data Holder Sequence");
7037 seq_length = tvb_get_uint32(tvb, offset, encoding);
7038 offset += 4;
7039 for(i = 0; i < seq_length; i++) {
7040 offset = rtps_util_add_data_holder(data_holder_seq_tree, tvb, pinfo, offset,
7041 encoding, i, alignment_zero);
7043 return offset;
7046 /* ------------------------------------------------------------------------- */
7047 /* Insert in the protocol tree the next bytes interpreted as a Bitmap
7048 * struct {
7049 * SequenceNumber_t bitmapBase;
7050 * sequence<long, 8> bitmap;
7051 * } SequenceNumberSet;
7053 * Returns the new offset after reading the bitmap.
7055 static int rtps_util_add_bitmap(proto_tree *tree,
7056 packet_info *pinfo,
7057 tvbuff_t *tvb,
7058 int offset,
7059 const unsigned encoding,
7060 const char *label,
7061 bool show_analysis) {
7062 int32_t num_bits;
7063 uint32_t data;
7064 wmem_strbuf_t *temp_buff = wmem_strbuf_create(pinfo->pool);
7065 wmem_strbuf_t *analysis_buff = wmem_strbuf_create(pinfo->pool);
7066 int i, j, idx;
7067 char *last_one;
7068 proto_item *ti = NULL, *ti_tree = NULL;
7069 proto_tree *bitmap_tree;
7070 const int original_offset = offset;
7071 uint32_t datamask;
7072 uint64_t first_seq_number;
7073 bool first_nack = true;
7075 bitmap_tree = proto_tree_add_subtree(tree, tvb, original_offset, offset-original_offset,
7076 ett_rtps_bitmap, &ti_tree, label);
7078 /* Bitmap base sequence number */
7079 first_seq_number = rtps_util_add_seq_number(bitmap_tree, tvb, offset, encoding, "bitmapBase");
7080 offset += 8;
7082 /* Reads the bitmap size */
7083 proto_tree_add_item_ret_uint(bitmap_tree, hf_rtps_bitmap_num_bits, tvb, offset, 4, encoding, &num_bits);
7084 offset += 4;
7085 /* bitmap base 0 means that this is a preemptive ACKNACK */
7086 if (first_seq_number == 0 && show_analysis) {
7087 ti = proto_tree_add_uint_format(bitmap_tree, hf_rtps_acknack_analysis, tvb, 0, 0,
7088 1, "Acknack Analysis: Preemptive ACKNACK");
7089 proto_item_set_generated(ti);
7092 if (first_seq_number > 0 && num_bits == 0 && show_analysis) {
7093 ti = proto_tree_add_uint_format(bitmap_tree, hf_rtps_acknack_analysis, tvb, 0, 0,
7094 2, "Acknack Analysis: Expecting sample %" PRIu64, first_seq_number);
7095 proto_item_set_generated(ti);
7098 if (num_bits > 0 && show_analysis) {
7099 ti = proto_tree_add_uint_format(bitmap_tree, hf_rtps_acknack_analysis, tvb, 0, 0,
7100 3, "Acknack Analysis: Lost samples");
7101 proto_item_set_generated(ti);
7104 /* Reads the bits (and format the print buffer) */
7105 idx = 0;
7106 for (i = 0; i < num_bits; i += 32) {
7107 data = tvb_get_uint32(tvb, offset, encoding);
7108 offset += 4;
7109 for (j = 0; j < 32; ++j) {
7110 datamask = (1U << (31-j));
7111 wmem_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0');
7112 if ((data & datamask) == datamask) {
7113 proto_item_append_text(ti,
7114 first_nack ? " %" PRIu64 : ", %" PRIu64,
7115 first_seq_number + idx);
7116 first_nack = false;
7118 ++idx;
7119 if ((idx >= num_bits) || (wmem_strbuf_get_len(temp_buff) >= (ITEM_LABEL_LENGTH - 1))) {
7120 break;
7125 /* removes all the ending '0' */
7126 last_one = strrchr(wmem_strbuf_get_str(temp_buff), '1');
7127 if (last_one) {
7128 wmem_strbuf_truncate(temp_buff, (size_t) (last_one - wmem_strbuf_get_str(temp_buff)) + 1);
7131 if (wmem_strbuf_get_len(temp_buff) > 0) {
7132 proto_tree_add_bytes_format_value(bitmap_tree, hf_rtps_bitmap, tvb,
7133 original_offset + 12, offset - original_offset - 12,
7134 NULL, "%s", wmem_strbuf_get_str(temp_buff));
7137 proto_item_set_len(ti_tree, offset-original_offset);
7139 /* Add analysis of the information */
7140 if (num_bits > 0 && show_analysis) {
7141 proto_item_append_text(ti, "%s in range [%" PRIu64 ",%" PRIu64 "]",
7142 wmem_strbuf_get_str(analysis_buff), first_seq_number, first_seq_number + num_bits - 1);
7145 return offset;
7148 /* ------------------------------------------------------------------------- */
7149 /* Insert in the protocol tree the next bytes interpreted as a FragmentNumberSet
7150 * typedef unsigned long FragmentNumber_t;
7151 * struct {
7152 * FragmentNumber_t bitmapBase;
7153 * sequence<FragmentNumber_t> bitmap;
7154 * } FragmentNumberSet;
7156 * Returns the new offset after reading the bitmap.
7158 static int rtps_util_add_fragment_number_set(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
7159 int offset, const unsigned encoding, const char *label, int section_size) {
7160 uint64_t base;
7161 int32_t num_bits;
7162 uint32_t data;
7163 wmem_strbuf_t *temp_buff = wmem_strbuf_create(pinfo->pool);
7164 char *last_one;
7165 int i, j, idx;
7166 proto_item *ti;
7167 proto_tree *bitmap_tree;
7168 const int original_offset = offset;
7169 uint32_t datamask;
7170 int expected_size;
7171 int base_size;
7173 bitmap_tree = proto_tree_add_subtree(tree, tvb, original_offset, offset-original_offset, ett_rtps_bitmap, &ti, label);
7175 /* RTI DDS 4.2d was sending the FragmentNumber_t as a 64-bit long integer
7176 * instead of 32-bit long.
7177 * Attempt to decode this section as 32-bit, then check if the size of the
7178 * message match what is here. If not re-decode it as 64-bit.
7180 num_bits = tvb_get_uint32(tvb, offset+4, encoding);
7181 expected_size = ((num_bits + 31) / 32) * 4 + 8;
7182 if (expected_size == section_size) {
7183 base = (uint64_t)tvb_get_uint32(tvb, offset, encoding);
7184 base_size = 4;
7185 offset += 8;
7186 } else {
7187 /* Attempt to use 64-bit for base */
7188 num_bits = tvb_get_uint32(tvb, offset+8, encoding);
7189 /* num_bits/8 must be aligned to the 4-byte word */
7190 expected_size = (((num_bits / 8) + 3) / 4) * 4 + 12;
7191 if (expected_size == section_size) {
7192 uint64_t hi = (uint64_t)tvb_get_uint32(tvb, offset, encoding);
7193 uint64_t lo = (uint64_t)tvb_get_uint32(tvb, offset+4, encoding);
7194 base = (hi << 32) | lo;
7195 base_size = 8;
7196 offset += 12;
7197 } else {
7198 /* size don't match, packet error */
7199 expert_add_info_format(pinfo, ti, &ei_rtps_parameter_value_invalid, "Illegal size for fragment number set");
7200 return -1;
7204 /* Reads the bits (and format the print buffer) */
7205 idx = 0;
7206 for (i = 0; i < num_bits; i += 32) {
7207 data = tvb_get_uint32(tvb, offset, encoding);
7208 offset += 4;
7209 for (j = 0; j < 32; ++j) {
7210 datamask = (1U << (31-j));
7211 wmem_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0');
7212 ++idx;
7213 if ((idx >= num_bits) || (wmem_strbuf_get_len(temp_buff) >= (ITEM_LABEL_LENGTH - 1))) {
7214 break;
7219 /* removes all the ending '0' */
7220 last_one = strrchr(wmem_strbuf_get_str(temp_buff), '1');
7221 if (last_one) {
7222 wmem_strbuf_truncate(temp_buff, (size_t) (last_one - wmem_strbuf_get_str(temp_buff)));
7225 if (base_size == 8) {
7226 proto_tree_add_uint64(bitmap_tree, hf_rtps_fragment_number_base64, tvb, original_offset, 8,
7227 base);
7228 } else {
7229 proto_tree_add_item(bitmap_tree, hf_rtps_fragment_number_base, tvb, original_offset, base_size, encoding);
7231 proto_tree_add_uint(bitmap_tree, hf_rtps_fragment_number_num_bits, tvb, original_offset + base_size, 4, num_bits);
7233 if (wmem_strbuf_get_len(temp_buff) > 0) {
7234 proto_tree_add_bytes_format_value(bitmap_tree, hf_rtps_bitmap, tvb, original_offset + base_size + 4, offset - original_offset - base_size - 4,
7235 NULL, "%s", wmem_strbuf_get_str(temp_buff));
7238 proto_item_set_len(ti, offset-original_offset);
7239 return offset;
7242 static void rtps_util_insert_type_mapping_in_registry(packet_info *pinfo, type_mapping *type_mapping_object) {
7243 if (type_mapping_object) {
7244 if ((type_mapping_object->fields_visited & TOPIC_INFO_ALL_SET) == TOPIC_INFO_ALL_SET &&
7245 type_mapping_object->guid.fields_present == GUID_HAS_ALL &&
7246 !wmem_map_lookup(registry, &(type_mapping_object->guid))) {
7247 if (((type_mapping_object->guid.entity_id & 0x02) == 0x02) || ((type_mapping_object->guid.entity_id & 0x04) == 0x04)){
7248 /* If it is an application defined writer matches 0x02. Matches 0x04 if it is an application defined reader */
7249 type_mapping_object->dcps_publication_frame_number = pinfo->num;
7250 wmem_map_insert(registry, &(type_mapping_object->guid), type_mapping_object);
7256 static void rtps_util_store_type_mapping(packet_info *pinfo _U_, tvbuff_t *tvb, int offset,
7257 type_mapping * type_mapping_object, const char * value,
7258 int topic_info_add_id) {
7259 if (enable_topic_info && type_mapping_object) {
7260 switch (topic_info_add_id) {
7261 case TOPIC_INFO_ADD_GUID: {
7262 type_mapping_object->guid.host_id = tvb_get_ntohl(tvb, offset);
7263 type_mapping_object->guid.app_id = tvb_get_ntohl(tvb, offset+4);
7264 type_mapping_object->guid.instance_id = tvb_get_ntohl(tvb, offset+8);
7265 type_mapping_object->guid.entity_id = tvb_get_ntohl(tvb, offset+12);
7266 type_mapping_object->guid.fields_present |=
7267 GUID_HAS_HOST_ID|GUID_HAS_APP_ID|GUID_HAS_INSTANCE_ID|GUID_HAS_ENTITY_ID;
7268 type_mapping_object->fields_visited =
7269 type_mapping_object->fields_visited | TOPIC_INFO_ADD_GUID;
7270 break;
7272 case TOPIC_INFO_ADD_TOPIC_NAME: {
7273 rtps_strlcpy(type_mapping_object->topic_name, value, MAX_TOPIC_AND_TYPE_LENGTH);
7274 type_mapping_object->fields_visited =
7275 type_mapping_object->fields_visited | TOPIC_INFO_ADD_TOPIC_NAME;
7276 break;
7278 case TOPIC_INFO_ADD_TYPE_NAME: {
7279 rtps_strlcpy(type_mapping_object->type_name, value, MAX_TOPIC_AND_TYPE_LENGTH);
7280 type_mapping_object->fields_visited =
7281 type_mapping_object->fields_visited | TOPIC_INFO_ADD_TYPE_NAME;
7282 break;
7285 default:
7286 break;
7291 static unsigned hash_by_participant_guid(const void *key) {
7292 const endpoint_guid* guid = (const endpoint_guid*)key;
7293 int vals[] = { guid->host_id, guid->app_id, guid->instance_id };
7294 GBytes* gbytes = g_bytes_new(vals, sizeof(vals));
7295 unsigned hash = g_bytes_hash(gbytes);
7296 g_bytes_unref(gbytes);
7297 return hash;
7300 static unsigned hash_by_guid(const void *key) {
7301 const endpoint_guid * guid = (const endpoint_guid *) key;
7302 DISSECTOR_ASSERT(guid->fields_present & GUID_HAS_APP_ID);
7303 return g_int_hash(&(guid->app_id));
7306 static gboolean compare_by_guid(const void *guid_a, const void *guid_b) {
7307 return memcmp(guid_a, guid_b, sizeof(endpoint_guid)) == 0;
7310 static gboolean compare_by_participant_guid(const void *guid_a, const void *guid_b) {
7311 const endpoint_guid* a = (const endpoint_guid*)guid_a;
7312 const endpoint_guid* b = (const endpoint_guid*)guid_b;
7313 return ((a->host_id == b->host_id) && (a->app_id == b->app_id) && (a->instance_id == b->instance_id));
7316 static unsigned get_domain_id_from_tcp_discovered_participants(wmem_map_t *map, endpoint_guid* key) {
7317 participant_info *p_info = (participant_info*)wmem_map_lookup(map, (void*)key);
7318 return (p_info != NULL) ? p_info->domainId: RTPS_UNKNOWN_DOMAIN_ID_VAL;
7321 static unsigned coherent_set_key_hash_by_key(const void *key) {
7322 return wmem_strong_hash((const uint8_t *)key, sizeof(coherent_set_key));
7325 static gboolean compare_by_coherent_set_key(const void *key_a, const void *key_b) {
7326 return memcmp(key_a, key_b, sizeof(coherent_set_key)) == 0;
7329 static type_mapping * rtps_util_get_topic_info(endpoint_guid * guid) {
7330 /* At this point, we know the boolean enable_topic_info is true */
7331 type_mapping * result = NULL;
7332 if (guid) {
7333 unsigned entity_id_low = 0xFF & guid->entity_id;
7334 /* If the entity guid low is ENTITYID_NORMAL_META_GROUP_READER or ENTITYID_NORMAL_META_GROUP_WRITER then
7335 * is a builtin endpoint that uses the type InstaneStateResponseData. The type_mapping for this type is not
7336 * available through discovery. It is defined by code in
7337 * initialize_instance_state_data_response_dissection_info function.
7339 if (entity_id_low == ENTITYID_NORMAL_META_GROUP_READER || entity_id_low == ENTITYID_NORMAL_META_GROUP_WRITER) {
7340 result = &builtin_types_dissection_data.type_mappings.instance_state_data_response_type_mapping;
7342 else if (guid->fields_present == GUID_HAS_ALL)
7343 result = (type_mapping *)wmem_map_lookup(registry, guid);
7345 return result;
7348 static void rtps_util_format_typename(wmem_allocator_t *scope, char * type_name, char ** output) {
7349 char ** tokens;
7350 char * result_caps;
7351 /* The standard specifies that the max size of a type name
7352 can be 255 bytes */
7353 tokens = wmem_strsplit(scope, type_name, "::", 255);
7354 result_caps = wmem_strjoinv(scope, "_", tokens);
7355 *output = wmem_ascii_strdown(scope, result_caps, -1);
7359 /* Adds the topic topic information to the tree and the topic name to the info column.
7360 * Topic name will be added to the info column only if the topic information is stored
7361 * in the "registry map".
7362 * This is used when the packet doesn't contain the topic information (PID_TOPIC_INFORMATION)
7364 static const char* rtps_util_add_topic_info(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb,
7365 int offset, endpoint_guid * guid) {
7366 const char* topic_name = NULL;
7367 if (enable_topic_info) {
7368 proto_tree * topic_info_tree;
7369 proto_item * ti;
7370 bool is_builtin_type = false;
7371 type_mapping * type_mapping_object = rtps_util_get_topic_info(guid);
7372 /* If it is a builtin type mapping then the information is not taken from discovery data */
7373 is_builtin_type = (type_mapping_object == &builtin_types_dissection_data.type_mappings.instance_state_data_response_type_mapping);
7374 if (type_mapping_object != NULL) {
7375 const char* topic_information_text = (!is_builtin_type) ?
7376 "[Topic Information (from Discovery)]" :
7377 "[Topic Information (BuiltIn type)]";
7378 topic_name = type_mapping_object->topic_name;
7379 if (topic_name != NULL) {
7380 submessage_col_info* current_submessage_col_info = NULL;
7382 topic_info_tree = proto_tree_add_subtree(tree, tvb, offset, 0,
7383 ett_rtps_topic_info, NULL, topic_information_text);
7384 ti = proto_tree_add_string(topic_info_tree, hf_rtps_param_type_name, tvb, offset, 0,
7385 type_mapping_object->type_name);
7386 proto_item_set_generated(ti);
7387 if (!is_builtin_type) {
7388 ti = proto_tree_add_string(topic_info_tree, hf_rtps_param_topic_name, tvb, offset, 0,
7389 topic_name);
7390 proto_item_set_generated(ti);
7391 ti = proto_tree_add_uint(topic_info_tree, hf_rtps_dcps_publication_data_frame_number,
7392 tvb, 0, 0, type_mapping_object->dcps_publication_frame_number);
7394 proto_item_set_generated(ti);
7395 current_submessage_col_info = (submessage_col_info*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY);
7396 if (current_submessage_col_info != NULL && current_submessage_col_info->topic_name == NULL) {
7397 current_submessage_col_info->topic_name = wmem_strdup(pinfo->pool, topic_name);
7402 return topic_name;
7405 /* Uncompress data and returns it uncompressed on a new tvb.
7407 * @param[in] tree a chunk of data in the tvb and return a new tvb with the uncompressed data
7408 * @param[in] tvb
7409 * @param[in] offset offset at the beginning of the compressed data.
7410 * @param[in] size in bytes from the initial offset to the end of the serialized data
7411 * @param[in] compressed_size size in bytes of the compressed chunk in the tvb.
7412 * @param[out] True if it tries to uncompress the data. In environment where Zlib is not available this will be false. This is used for
7413 * distinguis when the data is not decompressed because Zlib is not available (not warning) and cases where it is but fails (warning).
7415 * @return The uncompressed data on a new TVB if everything goes fine. Otherwise NULL
7417 static
7418 tvbuff_t *rtps_util_get_uncompressed_tvb_zlib(
7419 tvbuff_t *tvb _U_,
7420 const int offset _U_,
7421 const unsigned compressed_size _U_,
7422 bool *tried_to_decompress) {
7423 tvbuff_t *uncompressed_tvb = NULL;
7424 #if defined(HAVE_ZLIB) || defined(HAVE_ZLIBNG)
7425 /* If ZLIB is available always try to decompress. */
7426 *tried_to_decompress = true;
7427 uncompressed_tvb = tvb_new_subset_length_caplen(tvb, offset, compressed_size, -1);
7428 uncompressed_tvb = tvb_child_uncompress_zlib(uncompressed_tvb, uncompressed_tvb, 0, compressed_size);
7429 #else
7430 *tried_to_decompress = false;
7431 #endif
7432 return uncompressed_tvb;
7436 * 0...2...........8...............16
7437 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
7438 * | X X X X X X X X X X X | C C C P P |
7439 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
7440 * X = Unused options bits
7441 * C = Compression bits
7442 * P = Padding bits
7443 * C = 0b111 would be extended compression options which would come in as an
7444 * additional header before the payload.
7445 * C = 0b000 to indicate no compression
7448 /* Dissects the encapsultaion options
7450 * @param[in] tree
7451 * @param[in] packet info.
7452 * @param[in] tvb
7453 * @param[in] offset at the beginning of the encapsulation options.
7454 * @param[out] encapsulation_options_out If not null it will contain the encapsulation options
7455 * @param[out] compression_option_out If not null it will contain the compression option
7456 * @param[out] padding_bytes_out If not null it will contain the padding bytes
7457 * @param[out] extended_header_bits_out If not null it will contain the extended header bits
7458 * @return the offset after the encapsulation options
7459 * @note All output parameters are optional.
7461 static
7462 int rtps_util_dissect_encapsulation_options(
7463 proto_tree *tree,
7464 tvbuff_t *tvb,
7465 int offset,
7466 int16_t *encapsulation_options_out,
7467 uint8_t *compression_options_out,
7468 uint8_t *padding_bytes_out,
7469 uint8_t *extended_header_bits_out) {
7470 uint8_t compression_options = 0;
7471 proto_tree *compression_options_subtree = NULL;
7472 int16_t encapsulation_options = 0;
7473 uint8_t padding_bytes = 0;
7474 uint8_t extended_header_bits = 0;
7476 /* Encapsulation length (or option). Always big endian. */
7477 encapsulation_options = tvb_get_int16(tvb, offset, ENC_BIG_ENDIAN);
7478 if (encapsulation_options != 0) {
7479 compression_options_subtree = proto_tree_add_subtree_format(
7480 tree,
7481 tvb,
7482 offset,
7484 ett_rtps_data_encapsulation_options,
7485 NULL,
7486 "Encapsulation options (0x%02x)",
7487 encapsulation_options);
7488 /* If compression options ENCAPSULATION_OPTIONS_COMPRESSION_EXTENDED_HEADER_VALUE bits are set, the
7489 header contains an extra field */
7490 extended_header_bits = (encapsulation_options
7491 & ENCAPSULATION_OPTIONS_COMPRESSION_EXTENDED_HEADER_VALUE);
7492 GET_ENCAPSULATION_COMPRESSION_OPTIONS(encapsulation_options, compression_options);
7493 padding_bytes = (encapsulation_options & ENCAPSULATION_OPTIONS_COMPRESSION_PADDING_BYTES_MASK);
7494 proto_tree_add_int(
7495 compression_options_subtree,
7496 hf_rtps_encapsulation_options_compression_plugin_class_id,
7497 tvb,
7498 offset + 1,
7500 compression_options);
7501 proto_tree_add_int(
7502 compression_options_subtree,
7503 hf_rtps_padding_bytes,
7504 tvb,
7505 offset + 1,
7507 padding_bytes);
7508 offset += 2;
7509 padding_bytes = encapsulation_options & ENCAPSULATION_OPTIONS_COMPRESSION_PADDING_BYTES_MASK;
7510 } else {
7511 /* Encapsulation length (or option). Always big endian. */
7512 proto_tree_add_item(
7513 tree,
7514 hf_rtps_param_serialize_encap_len,
7515 tvb,
7516 offset,
7518 ENC_BIG_ENDIAN);
7519 offset += 2;
7521 /* Set the optional outputs */
7522 if (encapsulation_options_out != NULL) {
7523 *encapsulation_options_out = encapsulation_options;
7525 if (compression_options_out != NULL) {
7526 *compression_options_out = compression_options;
7528 if (padding_bytes_out != NULL) {
7529 *padding_bytes_out = padding_bytes;
7531 if (extended_header_bits_out != NULL) {
7532 *extended_header_bits_out = extended_header_bits;
7534 return offset;
7537 static bool rtps_util_try_dissector(proto_tree *tree,
7538 packet_info *pinfo, tvbuff_t *tvb, int offset, endpoint_guid * guid,
7539 rtps_dissector_data * data, unsigned encoding, unsigned encoding_version, bool try_dissection_from_type_object) {
7542 if (enable_topic_info) {
7543 type_mapping * type_mapping_object = rtps_util_get_topic_info(guid);
7544 if (type_mapping_object != NULL) {
7545 char * dissector_name = NULL;
7546 tvbuff_t *next_tvb;
7547 dissection_info* info = NULL;
7549 if (try_dissection_from_type_object && enable_user_data_dissection) {
7550 info = lookup_dissection_info_in_custom_and_builtin_types(type_mapping_object->type_id);
7551 if (info != NULL) {
7552 proto_item_append_text(tree, " (TypeId: 0x%016" PRIx64 ")", info->type_id);
7553 return dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, info,
7554 info->type_id, info->member_name, EXTENSIBILITY_INVALID, offset,
7555 0 /* flags */, 0 /* member_id */, true);
7558 /* This part tries to dissect the content using a dissector */
7559 next_tvb = tvb_new_subset_remaining(tvb, offset);
7561 rtps_util_format_typename(pinfo->pool, type_mapping_object->type_name, &dissector_name);
7562 return dissector_try_string_with_data(rtps_type_name_table, dissector_name,
7563 next_tvb, pinfo, tree, true, data);
7566 /* Return false so the content is dissected by the codepath following this one */
7567 return false;
7570 static int rtps_util_add_rti_topic_query_service_request(proto_tree * tree, packet_info *pinfo,
7571 tvbuff_t * tvb, int offset, unsigned encoding) {
7573 struct TopicQuerySelection {
7574 string filter_class_name; //@Optional 0
7575 string filter_expression; // 1
7576 sequence<string> filter_parameters;
7577 }; //@top-level false
7578 //@Extensibility MUTABLE_EXTENSIBILITY
7580 struct TopicQueryData {
7581 TopicQuerySelection topic_query_selection;
7582 SequenceNumber_t sync_sequence_number;
7583 string topic_name;
7584 GUID_t original_related_reader_guid;
7585 }; //@top-level false
7586 //@Extensibility MUTABLE_EXTENSIBILITY
7588 proto_tree * topic_query_tree, * topic_query_selection_tree, *topic_query_filter_params_tree;
7589 proto_item * ti;
7590 uint16_t encapsulation_id, encapsulation_opt;
7591 uint32_t param_id, param_length, param_length_2, num_filter_params;
7592 int alignment_zero, tmp_offset;
7593 uint32_t i;
7594 char* topic_name = NULL;
7595 int topic_name_len = 0;
7596 topic_query_tree = proto_tree_add_subtree(tree, tvb, offset,
7597 0 /* To be defined */, ett_rtps_topic_query_tree, &ti, "Topic Query Data");
7599 /* Encapsulation Id */
7600 encapsulation_id = tvb_get_ntohs(tvb, offset); /* Always big endian */
7601 proto_tree_add_uint(topic_query_tree, hf_rtps_encapsulation_id,
7602 tvb, offset, 2, encapsulation_id);
7603 offset += 2;
7604 encoding = get_encapsulation_endianness(encapsulation_id);
7605 /* Encapsulation length (or option) */
7606 encapsulation_opt = tvb_get_ntohs(tvb, offset); /* Always big endian */
7607 proto_tree_add_uint(topic_query_tree, hf_rtps_encapsulation_options, tvb,
7608 offset, 2, encapsulation_opt);
7609 offset += 2;
7610 alignment_zero = offset;
7611 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &param_id, &param_length);
7612 tmp_offset = offset;
7614 /* TopicQuerySelection */
7615 topic_query_selection_tree = proto_tree_add_subtree(topic_query_tree, tvb, tmp_offset,
7616 0 /* To be defined */, ett_rtps_topic_query_selection_tree, &ti, "Topic Query Selection");
7618 SHORT_ALIGN_ZERO(tmp_offset,alignment_zero);
7619 rtps_util_dissect_parameter_header(tvb, &tmp_offset, encoding, &param_id, &param_length_2);
7620 if (param_id == 0) { /* Optional string filter_class_name */
7621 LONG_ALIGN_ZERO(tmp_offset, alignment_zero);
7622 rtps_util_add_string(topic_query_selection_tree, tvb, tmp_offset,
7623 hf_rtps_topic_query_selection_filter_class_name, encoding);
7625 tmp_offset += param_length_2;
7627 SHORT_ALIGN_ZERO(tmp_offset,alignment_zero);
7628 rtps_util_dissect_parameter_header(tvb, &tmp_offset, encoding, &param_id, &param_length_2);
7630 LONG_ALIGN_ZERO(tmp_offset, alignment_zero);
7631 tmp_offset = rtps_util_add_string(topic_query_selection_tree, tvb, tmp_offset,
7632 hf_rtps_topic_query_selection_filter_expression, encoding);
7634 SHORT_ALIGN_ZERO(tmp_offset,alignment_zero);
7635 rtps_util_dissect_parameter_header(tvb, &tmp_offset, encoding, &param_id, &param_length_2);
7637 num_filter_params = tvb_get_uint32(tvb, tmp_offset, encoding);
7638 proto_tree_add_item(topic_query_selection_tree, hf_rtps_topic_query_selection_num_parameters,
7639 tvb, tmp_offset, 4, encoding);
7640 topic_query_filter_params_tree = proto_tree_add_subtree_format(topic_query_selection_tree, tvb,
7641 tmp_offset + 4, 0 /* To be defined */, ett_rtps_topic_query_filter_params_tree, &ti,
7642 "Filter Parameters (size = %u)", num_filter_params);
7643 tmp_offset += 4;
7645 for (i = 0; i < num_filter_params; ++i) {
7646 uint32_t string_size;
7647 char * retVal;
7648 LONG_ALIGN_ZERO(tmp_offset, alignment_zero);
7649 string_size = tvb_get_uint32(tvb, tmp_offset, encoding);
7650 retVal = tvb_get_string_enc(pinfo->pool, tvb, tmp_offset+4, string_size, ENC_ASCII);
7652 proto_tree_add_string_format(topic_query_filter_params_tree,
7653 hf_rtps_topic_query_selection_filter_parameter, tvb,
7654 tmp_offset, string_size+4, retVal, "%s[%d]: %s", "Filter Parameter", i, retVal);
7656 tmp_offset += (4 + string_size);
7658 SHORT_ALIGN_ZERO(tmp_offset, alignment_zero);
7659 tmp_offset += 4;
7660 proto_tree_add_item(topic_query_selection_tree, hf_rtps_topic_query_selection_kind,
7661 tvb, tmp_offset, 4, encoding);
7663 offset = check_offset_addition(offset, param_length, tree, NULL, tvb);
7664 SHORT_ALIGN_ZERO(offset,alignment_zero);
7665 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &param_id, &param_length);
7667 rtps_util_add_seq_number(topic_query_tree, tvb, offset, encoding, "Sync Sequence Number");
7668 offset = check_offset_addition(offset, param_length, tree, NULL, tvb);
7670 SHORT_ALIGN_ZERO(offset,alignment_zero);
7671 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &param_id, &param_length);
7673 LONG_ALIGN_ZERO(offset, alignment_zero);
7674 topic_name_len = tvb_get_uint32(tvb, offset, encoding);
7675 topic_name = tvb_get_string_enc(pinfo->pool, tvb, offset + 4, topic_name_len, ENC_ASCII);
7676 proto_tree_add_string(topic_query_tree, hf_rtps_topic_query_topic_name, tvb, offset, topic_name_len + 4, topic_name);
7677 if (topic_name != NULL) {
7678 submessage_col_info* current_submessage_col_info = NULL;
7679 current_submessage_col_info = (submessage_col_info*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY);
7680 if (current_submessage_col_info != NULL && current_submessage_col_info->topic_name == NULL) {
7681 current_submessage_col_info->topic_name = wmem_strdup(pinfo->pool, topic_name);
7686 offset = check_offset_addition(offset, param_length, tree, NULL, tvb);
7688 SHORT_ALIGN_ZERO(offset,alignment_zero);
7689 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &param_id, &param_length);
7691 rtps_util_add_generic_guid_v2(topic_query_tree, tvb, offset,
7692 hf_rtps_topic_query_original_related_reader_guid,
7693 hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id,
7694 hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_entity_kind,
7695 NULL);
7697 offset = check_offset_addition(offset, param_length, tree, NULL, tvb);
7698 return offset;
7701 static int rtps_util_add_rti_locator_reachability_service_request(proto_tree * tree,
7702 packet_info *pinfo, tvbuff_t * tvb, int offset, unsigned encoding) {
7703 proto_tree * locator_reachability_tree, * locator_seq_tree;
7704 proto_item * ti;
7705 uint16_t encapsulation_id, encapsulation_opt;
7706 uint32_t param_id, param_length, seq_length, i;
7707 locator_reachability_tree = proto_tree_add_subtree(tree, tvb, offset,
7708 0 /* To be defined */, ett_rtps_locator_reachability_tree, &ti, "Locator Reachability Data");
7709 /* Encapsulation Id */
7710 encapsulation_id = tvb_get_ntohs(tvb, offset); /* Always big endian */
7711 proto_tree_add_uint(locator_reachability_tree, hf_rtps_encapsulation_id,
7712 tvb, offset, 2, encapsulation_id);
7713 offset += 2;
7714 encoding = get_encapsulation_endianness(encapsulation_id);
7715 /* Encapsulation length (or option) */
7716 encapsulation_opt = tvb_get_ntohs(tvb, offset); /* Always big endian */
7717 proto_tree_add_uint(locator_reachability_tree, hf_rtps_encapsulation_options, tvb,
7718 offset, 2, encapsulation_opt);
7719 offset += 2;
7721 rtps_util_dissect_parameter_header(tvb, &offset, encoding, &param_id, &param_length);
7723 seq_length = tvb_get_uint32(tvb, offset, encoding);
7724 locator_seq_tree = proto_tree_add_subtree_format(locator_reachability_tree, tvb, offset,
7725 param_length, ett_rtps_locator_list_tree, &ti, "Locator List [Size = %u]", seq_length);
7726 offset += 4;
7727 for(i = 0; i < seq_length; i++) {
7728 rtps_util_add_locator_t(locator_seq_tree, pinfo, tvb, offset, encoding, "Locator");
7729 offset += 24;
7731 return offset;
7734 static int rtps_util_add_instance_state_request_data(proto_tree* tree, tvbuff_t* tvb,
7735 int offset, const unsigned encoding) {
7736 proto_tree* instance_state_request_tree = NULL;
7737 proto_item* ti = NULL;
7738 /* The sum of all fields */
7739 const unsigned instance_state_request_data_len = 8 + GUID_SIZE + (4 * 3);
7740 instance_state_request_tree = proto_tree_add_subtree(
7741 tree,
7742 tvb,
7743 offset,
7744 instance_state_request_data_len,
7745 ett_rtps_instance_transition_data,
7746 &ti,
7747 "Instance State Request Data");
7748 rtps_util_add_seq_number(instance_state_request_tree, tvb, offset, encoding, "seqNumber");
7749 offset += 8;
7750 rtps_util_add_generic_guid_v2(instance_state_request_tree, tvb, offset, hf_rtps_pgm_dst_endpoint_guid,
7751 hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id,
7752 hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_entity_kind,
7753 NULL);
7754 offset += GUID_SIZE;
7755 proto_tree_add_item(instance_state_request_tree, hf_rtps_writer_group_oid, tvb, offset, 4, encoding);
7756 offset += 4;
7757 proto_tree_add_item(instance_state_request_tree, hf_rtps_reader_group_oid, tvb, offset, 4, encoding);
7758 offset += 4;
7759 proto_tree_add_item(instance_state_request_tree, hf_rtps_writer_session_id, tvb, offset, 4, encoding);
7760 offset += 4;
7761 return offset;
7764 static int rtps_util_add_rti_service_request(proto_tree * tree, packet_info *pinfo, tvbuff_t * tvb,
7765 int offset, const unsigned encoding, uint32_t service_id) {
7766 uint32_t *service_id_copy = wmem_alloc(pinfo->pool, sizeof(uint32_t));
7767 *service_id_copy = service_id;
7768 /* This is used in append_status_info for adding the column info */
7769 p_add_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_SERVICE_REQUEST_ID_PROTODATA_KEY, (void *)service_id_copy);
7770 switch (service_id) {
7771 case RTI_SERVICE_REQUEST_ID_TOPIC_QUERY:
7772 offset = rtps_util_add_rti_topic_query_service_request(tree, pinfo, tvb, offset + 4,
7773 encoding);
7774 break;
7775 case RTI_SERVICE_REQUEST_ID_LOCATOR_REACHABILITY:
7776 offset = rtps_util_add_rti_locator_reachability_service_request(tree, pinfo, tvb, offset + 4,
7777 encoding);
7778 break;
7779 case RTI_SERVICE_REQUEST_ID_UNKNOWN: {
7780 uint32_t seq_length;
7781 seq_length = tvb_get_uint32(tvb, offset, encoding);
7782 proto_tree_add_item(tree, hf_rtps_srm_request_body,
7783 tvb, offset + 4, seq_length, ENC_NA);
7784 offset = check_offset_addition(offset, seq_length, tree, NULL, tvb);
7785 offset = check_offset_addition(offset, 4, tree, NULL, tvb);
7786 break;
7788 case RTI_SERVICE_REQUEST_ID_INSTANCE_STATE: {
7789 /* First four after the sequence size are not needed */
7790 offset += 8;
7791 offset = rtps_util_add_instance_state_request_data(tree, tvb, offset, encoding);
7792 break;
7795 return offset;
7798 /* *********************************************************************** */
7799 /* * Parameter Sequence dissector * */
7800 /* *********************************************************************** */
7802 * It returns the new offset representing the point where the parameter
7803 * sequence terminates.
7804 * In case of protocol error, it returns 0 (cannot determine the end of
7805 * the sequence, the caller should be responsible to find the end of the
7806 * section if possible or pass the error back and abort dissecting the
7807 * current packet).
7808 * If no error occurred, the returned value is ALWAYS > than the offset passed.
7810 #define ENSURE_LENGTH(size) \
7811 if (param_length < size) { \
7812 expert_add_info_format(pinfo, param_len_item, &ei_rtps_parameter_value_invalid, "ERROR: parameter value too small (must be at least %d octets)", size); \
7813 break; \
7816 static bool dissect_parameter_sequence_rti_dds(proto_tree *rtps_parameter_tree, packet_info *pinfo, tvbuff_t *tvb,
7817 proto_item *parameter_item, proto_item * param_len_item, int offset,
7818 const unsigned encoding, int param_length, uint16_t parameter, type_mapping * type_mapping_object,
7819 bool is_inline_qos, unsigned vendor_id) {
7821 switch(parameter) {
7823 case PID_DATA_TAGS:
7824 ENSURE_LENGTH(4);
7825 rtps_util_add_data_tags(rtps_parameter_tree, tvb, offset, encoding, param_length);
7826 break;
7828 case PID_SAMPLE_SIGNATURE:
7829 ENSURE_LENGTH(16);
7830 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_sample_signature_epoch, tvb,
7831 offset, 8, encoding);
7832 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_sample_signature_nonce, tvb,
7833 offset+8, 4, encoding);
7834 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_sample_signature_length, tvb,
7835 offset+12, 4, encoding);
7836 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_sample_signature_signature, tvb,
7837 offset+16, param_length-16, ENC_NA);
7838 break;
7840 case PID_ENABLE_AUTHENTICATION:
7841 ENSURE_LENGTH(4);
7842 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_enable_authentication, tvb,
7843 offset, 4, ENC_NA);
7844 break;
7846 case PID_RELATED_ENTITY_GUID:
7847 ENSURE_LENGTH(16);
7848 rtps_util_add_guid_prefix_v2(
7849 rtps_parameter_tree,
7850 tvb,
7851 offset,
7852 hf_rtps_sm_guid_prefix,
7853 hf_rtps_sm_host_id,
7854 hf_rtps_sm_app_id,
7855 hf_rtps_sm_instance_id,
7857 rtps_util_add_entity_id(
7858 rtps_parameter_tree,
7859 tvb,
7860 offset + 12,
7861 hf_rtps_sm_entity_id,
7862 hf_rtps_sm_entity_id_key,
7863 hf_rtps_sm_entity_id_kind,
7864 ett_rtps_entity,
7865 "Related entity instance id",
7866 NULL);
7867 break;
7869 case PID_BUILTIN_ENDPOINT_QOS:
7870 ENSURE_LENGTH(1);
7871 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_builtin_endpoint_qos, tvb,
7872 offset, 1, ENC_NA);
7873 break;
7875 case PID_ENDPOINT_SECURITY_INFO: {
7876 uint32_t flags;
7877 ENSURE_LENGTH(8);
7878 flags = tvb_get_uint32(tvb, offset, encoding);
7879 proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
7880 hf_rtps_param_endpoint_security_attributes_mask, ett_rtps_flags,
7881 ENDPOINT_SECURITY_INFO_FLAGS, flags);
7882 flags = tvb_get_uint32(tvb, offset, encoding);
7883 proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
7884 hf_rtps_param_plugin_endpoint_security_attributes_mask, ett_rtps_flags,
7885 PLUGIN_ENDPOINT_SECURITY_INFO_FLAGS, flags);
7886 break;
7889 case PID_PARTICIPANT_SECURITY_INFO: {
7890 uint32_t flags;
7891 ENSURE_LENGTH(8);
7892 flags = tvb_get_uint32(tvb, offset, encoding);
7893 proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
7894 hf_rtps_param_participant_security_attributes_mask, ett_rtps_flags,
7895 PARTICIPANT_SECURITY_INFO_FLAGS, flags);
7896 offset += 4;
7897 flags = tvb_get_uint32(tvb, offset, encoding);
7898 proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
7899 hf_rtps_param_plugin_participant_security_attributes_mask, ett_rtps_flags,
7900 PLUGIN_PARTICIPANT_SECURITY_INFO_FLAGS, flags);
7901 break;
7904 case PID_VENDOR_BUILTIN_ENDPOINT_SET: {
7905 uint32_t flags;
7906 ENSURE_LENGTH(4);
7907 flags = tvb_get_uint32(tvb, offset, encoding);
7908 proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
7909 hf_rtps_param_vendor_builtin_endpoint_set_flags, ett_rtps_flags,
7910 VENDOR_BUILTIN_ENDPOINT_FLAGS, flags);
7911 break;
7913 /* 0...2...........7...............15.............23...............31
7914 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
7915 * | Unsigned long classId |
7916 * +---------------+---------------+---------------+---------------+
7917 * | Unsigned long uncompressedSerializedLength |
7918 * +---------------+---------------+---------------+---------------+
7919 * | byteSeq compressedSerializedTypeObject |
7920 * +---------------+---------------+---------------+---------------+
7921 * classId:
7922 * value(0) RTI_OSAPI_COMPRESSION_CLASS_ID_NONE
7923 * value(1) RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB
7924 * value(2) RTI_OSAPI_COMPRESSION_CLASS_ID_BZIP2
7925 * value(-1) RTI_OSAPI_COMPRESSION_CLASS_ID_AUTO
7927 case PID_TYPE_OBJECT_LB: {
7928 unsigned compressed_size;
7929 unsigned decompressed_size;
7930 unsigned compression_plugin_class;
7931 tvbuff_t *compressed_type_object_subset;
7933 ENSURE_LENGTH(8);
7934 proto_tree_add_item(rtps_parameter_tree, hf_rtps_compression_plugin_class_id, tvb, offset, 4, encoding);
7935 proto_tree_add_item(rtps_parameter_tree, hf_rtps_uncompressed_serialized_length, tvb, offset + 4, 4, encoding);
7937 compression_plugin_class = tvb_get_uint32(tvb, offset, encoding);
7938 decompressed_size = tvb_get_uint32(tvb, offset + 4, encoding);
7939 /* Get the number of bytes (elements) in the sequence */
7940 compressed_size = tvb_get_uint32(tvb, offset + 8, encoding);
7942 switch(compression_plugin_class) {
7943 case RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB: {
7944 /* + 12 Because First 4 bytes of the sequence are the number of elements in the sequence */
7945 proto_tree_add_item(rtps_parameter_tree, hf_rtps_compressed_serialized_type_object, tvb, offset + 12, param_length - 8, encoding);
7946 compressed_type_object_subset = tvb_new_subset_length(tvb, offset + 12, decompressed_size);
7947 rtps_add_zlib_compressed_typeobject(rtps_parameter_tree, pinfo, compressed_type_object_subset,
7948 0, encoding, compressed_size, decompressed_size, type_mapping_object);
7949 break;
7951 case RTI_OSAPI_COMPRESSION_CLASS_ID_NONE: {
7952 compressed_type_object_subset = tvb_new_subset_length(tvb, offset + 12, decompressed_size);
7953 rtps_util_add_typeobject(rtps_parameter_tree, pinfo,
7954 compressed_type_object_subset, 0, encoding, decompressed_size, type_mapping_object);
7955 break;
7957 default: {
7958 /* + 12 Because First 4 bytes of the sequence are the number of elements in the sequence */
7959 proto_tree_add_item(rtps_parameter_tree, hf_rtps_compressed_serialized_type_object, tvb, offset + 12, param_length - 8, encoding);
7962 break;
7965 case PID_ENDPOINT_SECURITY_ATTRIBUTES: {
7966 uint32_t flags;
7967 ENSURE_LENGTH(4);
7968 flags = tvb_get_uint32(tvb, offset, encoding);
7969 proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
7970 hf_rtps_param_endpoint_security_attributes, ett_rtps_flags,
7971 ENDPOINT_SECURITY_ATTRIBUTES, flags);
7972 break;
7975 case PID_TOPIC_QUERY_PUBLICATION: {
7976 ENSURE_LENGTH(8);
7977 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_topic_query_publication_enable,
7978 tvb, offset, 1, encoding);
7979 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_topic_query_publication_sessions,
7980 tvb, offset+4, 4, encoding);
7981 break;
7984 case PID_ENDPOINT_PROPERTY_CHANGE_EPOCH: {
7985 ENSURE_LENGTH(8);
7986 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_endpoint_property_change_epoch,
7987 tvb, offset, 8, encoding);
7988 break;
7991 case PID_TOPIC_QUERY_GUID:
7992 if (is_inline_qos) {
7993 ENSURE_LENGTH(16);
7994 rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
7995 hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
7996 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
7997 hf_rtps_param_entity_kind, NULL);
7999 break;
8001 case PID_REACHABILITY_LEASE_DURATION:
8002 ENSURE_LENGTH(8);
8003 rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding,
8004 hf_rtps_participant_lease_duration);
8005 break;
8007 case PID_RELATED_SOURCE_GUID: {
8008 ENSURE_LENGTH(16);
8009 /* PID_RELATED_SOURCE_GUID */
8010 rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
8011 hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
8012 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
8013 hf_rtps_param_entity_kind, NULL);
8014 break;
8016 /* 0...2...........7...............15.............23...............31
8017 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8018 * | PID_TRANSPORT_INFO_LIST | length |
8019 * +---------------+---------------+---------------+---------------+
8020 * | unsigned long Seq.Length |
8021 * +---------------+---------------+---------------+---------------+
8022 * | ... |
8023 * | TransportInfo 1 |
8024 * | ... |
8025 * +---------------+---------------+---------------+---------------+
8026 * | ... |
8027 * | TransportInfo 2 |
8028 * | ... |
8029 * +---------------+---------------+---------------+---------------+
8030 * | ... |
8031 * | TransportInfo n |
8032 * | ... |
8033 * +---------------+---------------+---------------+---------------+
8035 * IDL:
8036 * struct TRANSPORT_INFO {
8037 * long classid;
8038 * long messageSizeMax;
8039 * };
8041 * struct TRANSPORT_INFO_LIST {
8042 * Sequence<TRANSPORT_INFO> TransportInfoList;
8043 * };
8046 /* PID_RELATED_READER_GUID and PID_TRANSPORT_INFO_LIST have the same value */
8047 case PID_TRANSPORT_INFO_LIST: {
8048 if (is_inline_qos) {
8049 ENSURE_LENGTH(16);
8050 /* PID_RELATED_READER_GUID */
8051 rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
8052 hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
8053 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
8054 hf_rtps_param_entity_kind, NULL);
8055 } else {
8056 ENSURE_LENGTH(4);
8058 int i;
8059 uint32_t temp_offset;
8060 uint32_t seq_size = tvb_get_uint32(tvb, offset, encoding);
8061 if (seq_size > 0) {
8062 temp_offset = offset+4; /* move to first transportInfo */
8063 i = 1;
8064 while(seq_size-- > 0) {
8065 rtps_util_add_transport_info(rtps_parameter_tree, tvb, temp_offset, encoding, i);
8066 temp_offset += 8;
8067 ++i;
8072 break;
8075 /* PID_DIRECT_COMMUNICATION and PID_SOURCE_GUID have the same value */
8076 case PID_DIRECT_COMMUNICATION: {
8077 if (is_inline_qos) {
8078 ENSURE_LENGTH(16);
8079 /* PID_SOURCE_GUID */
8080 rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
8081 hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
8082 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
8083 hf_rtps_param_entity_kind, NULL);
8084 } else {
8085 proto_tree_add_item(rtps_parameter_tree, hf_rtps_direct_communication, tvb, offset, 1, ENC_NA );
8087 break;
8090 /* Product Version Version 5.3.1 and earlier
8091 * 0...2...........7...............15.............23...............31
8092 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8093 * | PID_TYPE_CONSISTENCY_KIND | length |
8094 * +---------------+---------------+---------------+---------------+
8095 * | unsigned short value Kind | = = u n u s e d = = = = = = |
8096 * +---------------+---------------+---------------+---------------+
8098 * Product Version 5.3.3 and later
8099 * 0...2...........7...............15.............23...............31
8100 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8101 * | PID_TYPE_CONSISTENCY_KIND | length |
8102 * +---------------+---------------+---------------+---------------+
8103 * | unsigned short value Kind | Boolean ISeqB | Boolean IStrB |
8104 * +---------------+---------------+---------------+---------------+
8105 * | Boolean IMemN | Boolean PTypW | Boolean FtypV | Boolean IEnLN |
8106 * +---------------+---------------+---------------+---------------+
8107 * ISeqB = Ignore Sequence Names
8108 * IStrB = Ignore String names
8109 * IMemN = Ignore Member Names
8110 * PTypW = Prevent Type Widening
8111 * FtypV = Force Type Validation
8112 * IEnLN = Ignore Enum Literal Names
8114 case PID_TYPE_CONSISTENCY: {
8115 if (param_length !=4 && param_length !=8) {
8116 expert_add_info_format(pinfo, rtps_parameter_tree,
8117 &ei_rtps_pid_type_csonsistency_invalid_size,
8118 "PID_TYPE_CONSISTENCY invalid size. It has a size of %d bytes. Expected %d or %d bytes.",
8119 param_length, 4, 8);
8120 break;
8122 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_type_consistency_kind, tvb, offset, 2, encoding);
8123 /* Parameter size can be used as a discriminator between product versions. */
8124 if (param_length == 8) {
8125 offset += 2;
8126 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_ignore_sequence_bounds,
8127 tvb, offset, 1, encoding);
8128 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_ignore_string_bounds,
8129 tvb, offset + 1, 1, encoding);
8130 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_ignore_member_names,
8131 tvb, offset + 2, 1, encoding);
8132 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_prevent_type_widening,
8133 tvb, offset + 3, 1, encoding);
8134 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_force_type_validation,
8135 tvb, offset + 4, 1, encoding);
8136 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_ignore_enum_literal_names,
8137 tvb, offset + 5, 1, encoding);
8139 break;
8142 /* ==================================================================
8143 * Here are all the deprecated items.
8146 /* 0...2...........7...............15.............23...............31
8147 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8148 * | PID_PRODUCT_VERSION | length |
8149 * +---------------+---------------+---------------+---------------+
8150 * | uint8 major | uint8 minor | uint8 release |uint8 revision |
8151 * +---------------+---------------+---------------+---------------+
8153 case PID_PRODUCT_VERSION: {
8154 ENSURE_LENGTH(4);
8155 rtps_util_add_product_version(rtps_parameter_tree, pinfo, tvb, offset, vendor_id);
8156 break;
8159 /* 0...2...........7...............15.............23...............31
8160 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8161 * | PID_PLUGIN_PROMISCUITY_KIND | length |
8162 * +---------------+---------------+---------------+---------------+
8163 * | short value | |
8164 * +---------------+---------------+---------------+---------------+
8166 case PID_PLUGIN_PROMISCUITY_KIND: {
8167 ENSURE_LENGTH(4);
8168 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_plugin_promiscuity_kind, tvb, offset, 4, encoding);
8169 break;
8171 /* 0...2...........7...............15.............23...............31
8172 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8173 * | PID_ENTITY_VIRTUAL_GUID | length |
8174 * +---------------+---------------+---------------+---------------+
8175 * | |
8176 * +- -+
8177 * | octet[12] guidPrefix |
8178 * +- -+
8179 * | |
8180 * +---------------+---------------+---------------+---------------+
8181 * | octet[4] entityId |
8182 * +---------------+---------------+---------------+---------------+
8185 case PID_ENTITY_VIRTUAL_GUID: {
8186 ENSURE_LENGTH(16);
8187 rtps_util_add_guid_prefix_v2(rtps_parameter_tree, tvb, offset,
8188 hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id, hf_rtps_sm_app_id,
8189 hf_rtps_sm_instance_id, 0);
8190 rtps_util_add_entity_id(rtps_parameter_tree, tvb, offset+12,
8191 hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind,
8192 ett_rtps_entity, "virtualGUIDSuffix", NULL);
8193 break;
8197 /* 0...2...........7...............15.............23...............31
8198 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8199 * | PID_SERVICE_KIND | length |
8200 * +---------------+---------------+---------------+---------------+
8201 * | long value |
8202 * +---------------+---------------+---------------+---------------+
8204 case PID_SERVICE_KIND: {
8205 ENSURE_LENGTH(4);
8206 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_service_kind, tvb, offset, 4, encoding);
8207 break;
8211 case PID_ROLE_NAME: {
8212 rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_param_role_name, encoding);
8213 break;
8217 case PID_ACK_KIND: {
8218 ENSURE_LENGTH(4);
8219 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_acknowledgment_kind, tvb, offset, 4, encoding);
8220 break;
8223 /* 0...2...........7...............15.............23...............31
8224 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8225 * | PID_PEER_HOST_EPOCH | length |
8226 * +---------------+---------------+---------------+---------------+
8227 * | unsigned long epoch |
8228 * +---------------+---------------+---------------+---------------+
8230 case PID_PEER_HOST_EPOCH: {
8231 ENSURE_LENGTH(4);
8232 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_peer_host_epoch, tvb, offset, 4, encoding);
8233 break;
8236 /* 0...2...........7...............15.............23...............31
8237 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8238 * | PID_DOMAIN_ID|PID_RTI_DOMAIN_ID| length |
8239 * +---------------+---------------+---------------+---------------+
8240 * | long domain_id |
8241 * +---------------+---------------+---------------+---------------+
8244 case PID_RTI_DOMAIN_ID:
8245 case PID_DOMAIN_ID: {
8246 if (is_inline_qos) { /* PID_RELATED_ORIGINAL_WRITER_INFO_LEGACY */
8247 ENSURE_LENGTH(16);
8248 rtps_util_add_guid_prefix_v2(rtps_parameter_tree, tvb, offset, hf_rtps_sm_guid_prefix,
8249 hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0);
8250 rtps_util_add_entity_id(rtps_parameter_tree, tvb, offset+12, hf_rtps_sm_entity_id,
8251 hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity,
8252 "virtualGUIDSuffix", NULL);
8253 /* Sequence number */
8254 rtps_util_add_seq_number(rtps_parameter_tree, tvb, offset+16,
8255 encoding, "virtualSeqNumber");
8256 } else {
8257 ENSURE_LENGTH(4);
8258 proto_tree_add_item(rtps_parameter_tree, hf_rtps_domain_id, tvb, offset, 4, encoding);
8260 /* Each packet stores its participant guid in the private table. This is done in dissect_rtps */
8261 endpoint_guid *participant_guid = (endpoint_guid*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_TCPMAP_DOMAIN_ID_PROTODATA_KEY);
8262 if (participant_guid != NULL) {
8263 /* Since this information is fixed there is no need to update in a second pass */
8264 if (!wmem_map_contains(discovered_participants_domain_ids, participant_guid)) {
8265 int domainId = tvb_get_int32(tvb, offset, encoding);
8266 participant_info *p_info = (participant_info*)wmem_new(wmem_file_scope(), participant_info);
8267 p_info->domainId = domainId;
8268 endpoint_guid *participant_guid_copy = (endpoint_guid*)wmem_memdup(wmem_file_scope(),
8269 participant_guid, sizeof(endpoint_guid));
8270 wmem_map_insert(discovered_participants_domain_ids,
8271 (const void*)participant_guid_copy, (void*)p_info);
8275 break;
8278 case PID_RELATED_ORIGINAL_WRITER_INFO: {
8279 if (is_inline_qos) { /* PID_RELATED_ORIGINAL_WRITER_INFO */
8280 ENSURE_LENGTH(16);
8281 rtps_util_add_guid_prefix_v2(
8282 rtps_parameter_tree,
8283 tvb,
8284 offset,
8285 hf_rtps_sm_guid_prefix,
8286 hf_rtps_sm_host_id,
8287 hf_rtps_sm_app_id,
8288 hf_rtps_sm_instance_id,
8290 rtps_util_add_entity_id(
8291 rtps_parameter_tree,
8292 tvb,
8293 offset + 12,
8294 hf_rtps_sm_entity_id,
8295 hf_rtps_sm_entity_id_key,
8296 hf_rtps_sm_entity_id_kind,
8297 ett_rtps_entity,
8298 "virtualGUIDSuffix",
8299 NULL);
8300 /* Sequence number */
8301 rtps_util_add_seq_number(
8302 rtps_parameter_tree,
8303 tvb,
8304 offset + 16,
8305 encoding,
8306 "virtualSeqNumber");
8308 break;
8311 /* 0...2...........7...............15.............23...............31
8312 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8313 * | PID_DOMAIN_TAG | length |
8314 * +---------------+---------------+---------------+---------------+
8315 * | long domain_tag.Length |
8316 * +---------------+---------------+---------------+---------------+
8317 * | string domain_tag |
8318 * | ... |
8319 * +---------------+---------------+---------------+---------------+
8321 case PID_DOMAIN_TAG: {
8322 ENSURE_LENGTH(4);
8323 rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_domain_tag, encoding);
8324 break;
8327 case PID_EXTENDED: {
8328 ENSURE_LENGTH(8);
8329 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_extended_parameter, tvb, offset, 4, encoding);
8330 offset += 4;
8331 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_extended_pid_length, tvb, offset, 4, encoding);
8332 break;
8335 case PID_TYPE_OBJECT: {
8336 rtps_util_add_typeobject(rtps_parameter_tree, pinfo, tvb,
8337 offset, encoding, param_length, type_mapping_object);
8338 break;
8341 /* 0...2...........7...............15.............23...............31
8342 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8343 * | PID_TYPECODE_RTPS2 | length |
8344 * +---------------+---------------+---------------+---------------+
8345 * | |
8346 * + Type code description +
8347 * | |
8348 * +---------------+---------------+---------------+---------------+
8350 case PID_TYPECODE:
8351 case PID_TYPECODE_RTPS2: {
8352 rtps_util_add_typecode(rtps_parameter_tree,
8353 tvb,
8354 pinfo,
8355 offset,
8356 encoding,
8357 0, /* indent level */
8358 0, /* isPointer */
8359 -1, /* bitfield */
8360 0, /* isKey */
8361 offset,
8362 NULL, /* name */
8363 -1, /* not a seq field */
8364 NULL, /* not an array */
8365 0); /* ndds 4.0 hack: init to false */
8366 break;
8369 /* 0...2...........7...............15.............23...............31
8370 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8371 * | PID_DISABLE_POSITIVE_ACKS | length |
8372 * +---------------+---------------+---------------+---------------+
8373 * | boolean value | = = = = = = = = u n u s e d = = = = = = = = |
8374 * +---------------+---------------+---------------+---------------+
8376 case PID_DISABLE_POSITIVE_ACKS: {
8377 ENSURE_LENGTH(1);
8378 proto_tree_add_item(rtps_parameter_tree, hf_rtps_disable_positive_ack, tvb, offset, 1, ENC_NA );
8379 break;
8382 /* 0...2...........7...............15.............23...............31
8383 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8384 * | PID_EXPECTS_VIRTUAL_HB | length |
8385 * +---------------+---------------+---------------+---------------+
8386 * | boolean value | = = = = = = = = u n u s e d = = = = = = = = |
8387 * +---------------+---------------+---------------+---------------+
8389 case PID_EXPECTS_VIRTUAL_HB: {
8390 ENSURE_LENGTH(1);
8391 proto_tree_add_item(rtps_parameter_tree, hf_rtps_expects_virtual_heartbeat, tvb, offset, 1, ENC_NA );
8392 break;
8395 /* 0...2...........7...............15.............23...............31
8396 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8397 * | PID_LOCATOR_FILTER_LIST | length |
8398 * +---------------+---------------+---------------+---------------+
8399 * | unsigned long number_of_channels |
8400 * +---------------+---------------+---------------+---------------+
8401 * | |
8402 * ~ String filter_name ~
8403 * | |
8404 * +---------------+---------------+---------------+---------------+
8405 * | |
8406 * ~ LocatorList ~ <----------+
8407 * | | Repeat |
8408 * +---------------+---------------+---------------+---------------+ For each|
8409 * | | Channel |
8410 * ~ String filter_expression ~ |
8411 * | | |
8412 * +---------------+---------------+---------------+---------------+ <----------+
8414 case PID_LOCATOR_FILTER_LIST: {
8415 int32_t number_of_channels, ch;
8416 proto_tree *channel_tree;
8417 proto_item *ti_channel;
8418 char temp_buff[20];
8419 int old_offset;
8420 uint32_t off = offset;
8422 ENSURE_LENGTH(4);
8423 proto_tree_add_item_ret_int(rtps_parameter_tree, hf_rtps_locator_filter_list_num_channels, tvb, off, 4, encoding, &number_of_channels );
8424 proto_item_append_text(parameter_item, " (%d channels)", number_of_channels );
8425 off += 4;
8427 if (number_of_channels == 0) {
8428 /* Do not dissect the rest */
8429 break;
8432 /* filter name */
8433 off = rtps_util_add_string(rtps_parameter_tree, tvb, off, hf_rtps_locator_filter_list_filter_name, encoding);
8435 /* Foreach channel... */
8436 for (ch = 0; ch < number_of_channels; ++ch) {
8437 snprintf(temp_buff, 20, "Channel[%u]", ch);
8438 old_offset = off;
8439 channel_tree = proto_tree_add_subtree_format(rtps_parameter_tree, tvb, off, 0, ett_rtps_locator_filter_channel, &ti_channel, "Channel[%u]", ch);
8441 off = rtps_util_add_multichannel_locator_list(channel_tree, pinfo, tvb, off, temp_buff, encoding);
8442 /* Filter expression */
8443 off = rtps_util_add_string(rtps_parameter_tree, tvb, off, hf_rtps_locator_filter_list_filter_exp, encoding);
8445 /* Now we know the length of the channel data, set the length */
8446 proto_item_set_len(ti_channel, (off - old_offset));
8447 } /* End of for each channel */
8448 break;
8449 }/* End of case PID_LOCATOR_FILTER_LIST */
8451 /* 0...2...........7...............15.............23...............31
8452 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8453 * | PID_UNICAST_LOCATOR_EX | 0x8007 |
8454 * +---------------+---------------+---------------+---------------+
8455 * | long kind |
8456 * +---------------+---------------+---------------+---------------+
8457 * | long port |
8458 * +---------------+---------------+---------------+---------------+
8459 * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
8460 * +---------------+---------------+---------------+---------------+
8461 * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
8462 * +---------------+---------------+---------------+---------------+
8463 * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
8464 * +---------------+---------------+---------------+---------------+
8465 * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
8466 * +---------------+---------------+---------------+---------------+
8467 * | Locator Sequence Length |
8468 * +---------------+---------------+---------------+---------------+
8469 * | Locator 1 | Locator 2 |
8470 * +---------------+---------------+---------------+---------------+
8472 case PID_UNICAST_LOCATOR_EX: {
8473 ENSURE_LENGTH(28);
8474 rtps_util_add_locator_ex_t(rtps_parameter_tree, pinfo, tvb, offset, encoding, param_length);
8475 break;
8478 case PID_ENDPOINT_SECURITY_SYMMETRIC_CIPHER_ALGO: {
8479 ENSURE_LENGTH(4);
8480 proto_tree_add_bitmask(
8481 rtps_parameter_tree,
8482 tvb,
8483 offset,
8484 hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_required_mask,
8485 ett_rtps_flags,
8486 SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS,
8487 encoding);
8489 break;
8492 case PID_PARTICIPANT_SECURITY_SYMMETRIC_CIPHER_ALGO: {
8493 ENSURE_LENGTH(12);
8494 proto_tree_add_bitmask(
8495 rtps_parameter_tree,
8496 tvb,
8497 offset,
8498 hf_rtps_param_participant_security_symmetric_cipher_algorithms_supported_mask,
8499 ett_rtps_flags,
8500 SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS,
8501 encoding);
8502 offset += 4;
8503 proto_tree_add_bitmask(
8504 rtps_parameter_tree,
8505 tvb,
8506 offset,
8507 hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_required_mask,
8508 ett_rtps_flags,
8509 SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS,
8510 encoding);
8511 offset += 4;
8512 proto_tree_add_bitmask(
8513 rtps_parameter_tree,
8514 tvb,
8515 offset,
8516 hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_key_exchange_used_bit,
8517 ett_rtps_flags,
8518 SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS,
8519 encoding);
8520 break;
8523 case PID_PARTICIPANT_SECURITY_KEY_ESTABLISHMENT_ALGO: {
8524 ENSURE_LENGTH(8);
8525 proto_tree *sub_tree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, 4,
8526 ett_rtps_crypto_algorithm_requirements, NULL, "Shared Secret");
8527 dissect_crypto_algorithm_requirements(sub_tree, tvb, offset,
8528 encoding, SECURITY_KEY_ESTABLISHMENT_MASK_FLAGS);
8529 break;
8532 case PID_PARTICIPANT_SECURITY_DIGITAL_SIGNATURE_ALGO: {
8533 ENSURE_LENGTH(16);
8534 proto_tree *sub_tree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, 4,
8535 ett_rtps_crypto_algorithm_requirements, NULL, "Trust Chain");
8536 offset = dissect_crypto_algorithm_requirements(sub_tree, tvb, offset,
8537 encoding, SECURITY_DIGITAL_SIGNATURE_MASK_FLAGS);
8538 sub_tree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, 4,
8539 ett_rtps_crypto_algorithm_requirements, NULL, "Message Authentication");
8540 dissect_crypto_algorithm_requirements(sub_tree, tvb, offset,
8541 encoding, SECURITY_DIGITAL_SIGNATURE_MASK_FLAGS);
8542 break;
8545 default: {
8546 return false;
8548 }/* End of switch for parameters for vendor RTI */
8549 return true;
8552 static bool dissect_parameter_sequence_toc(proto_tree *rtps_parameter_tree, packet_info *pinfo _U_,
8553 tvbuff_t *tvb, proto_item *parameter_item _U_, proto_item *param_len_item _U_, int offset,
8554 const unsigned encoding, int param_length _U_,
8555 uint16_t parameter) {
8557 switch(parameter) {
8559 /* 0...2...........7...............15.............23...............31
8560 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8561 * | PID_TYPECODE_RTPS2 | length |
8562 * +---------------+---------------+---------------+---------------+
8563 * | |
8564 * + Type code description +
8565 * | |
8566 * +---------------+---------------+---------------+---------------+
8568 case PID_TYPECODE_RTPS2: {
8569 rtps_util_add_typecode(rtps_parameter_tree,
8570 tvb,
8571 pinfo,
8572 offset,
8573 encoding,
8574 0, /* indent level */
8575 0, /* isPointer */
8576 -1, /* bitfield */
8577 0, /* isKey */
8578 offset,
8579 NULL, /* name */
8580 0, /* not a seq field */
8581 NULL, /* not an array */
8582 0); /* ndds 4.0 hack: init to false */
8583 break;
8586 default:
8587 return false;
8589 return true;
8592 static bool dissect_parameter_sequence_adl(proto_tree *rtps_parameter_tree _U_, packet_info *pinfo _U_,
8593 tvbuff_t *tvb _U_, proto_item *parameter_item _U_, proto_item *param_len_item _U_, int offset _U_,
8594 const unsigned encoding _U_, int param_length _U_,
8595 uint16_t parameter) {
8597 switch(parameter) {
8599 case PID_ADLINK_WRITER_INFO: {
8600 break;
8602 case PID_ADLINK_READER_DATA_LIFECYCLE: {
8603 break;
8605 case PID_ADLINK_WRITER_DATA_LIFECYCLE: {
8606 break;
8608 case PID_ADLINK_ENDPOINT_GUID: {
8609 break;
8611 case PID_ADLINK_SYNCHRONOUS_ENDPOINT: {
8612 break;
8614 case PID_ADLINK_RELAXED_QOS_MATCHING: {
8615 break;
8617 case PID_ADLINK_PARTICIPANT_VERSION_INFO: {
8618 break;
8620 case PID_ADLINK_NODE_NAME: {
8621 break;
8623 case PID_ADLINK_EXEC_NAME: {
8624 break;
8626 case PID_ADLINK_PROCESS_ID: {
8627 break;
8629 case PID_ADLINK_SERVICE_TYPE: {
8630 break;
8632 case PID_ADLINK_ENTITY_FACTORY: {
8633 break;
8635 case PID_ADLINK_WATCHDOG_SCHEDULING: {
8636 break;
8638 case PID_ADLINK_LISTENER_SCHEDULING: {
8639 break;
8641 case PID_ADLINK_SUBSCRIPTION_KEYS: {
8642 break;
8644 case PID_ADLINK_READER_LIFESPAN: {
8645 break;
8647 case PID_ADLINK_SHARE: {
8648 break;
8650 case PID_ADLINK_TYPE_DESCRIPTION: {
8651 break;
8653 case PID_ADLINK_LAN_ID: {
8654 break;
8656 case PID_ADLINK_ENDPOINT_GID: {
8657 break;
8659 case PID_ADLINK_GROUP_GID: {
8660 break;
8662 case PID_ADLINK_EOTINFO: {
8663 break;
8665 case PID_ADLINK_PART_CERT_NAME: {
8666 break;
8668 case PID_ADLINK_LAN_CERT_NAME: {
8669 break;
8671 default:
8672 return false;
8674 return true;
8678 static bool dissect_parameter_sequence_v1(proto_tree *rtps_parameter_tree, packet_info *pinfo, tvbuff_t *tvb,
8679 proto_item *parameter_item, proto_item * param_len_item, int offset,
8680 const unsigned encoding, int size, int param_length,
8681 uint16_t parameter, uint16_t version, type_mapping * type_mapping_object,
8682 coherent_set_entity_info *coherent_set_entity_info_object) {
8684 proto_tree *subtree;
8686 switch(parameter) {
8688 /* 0...2...........7...............15.............23...............31
8689 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8690 * | PID_PARTICIPANT_LEASE_DURATION| 0x0008 |
8691 * +---------------+---------------+---------------+---------------+
8692 * | long NtpTime.seconds |
8693 * +---------------+---------------+---------------+---------------+
8694 * | unsigned long NtpTime.fraction |
8695 * +---------------+---------------+---------------+---------------+
8697 case PID_PARTICIPANT_LEASE_DURATION:
8698 ENSURE_LENGTH(8);
8699 rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding,
8700 hf_rtps_participant_lease_duration);
8701 break;
8704 /* 0...2...........7...............15.............23...............31
8705 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8706 * | PID_TIME_BASED_FILTER | 0x0008 |
8707 * +---------------+---------------+---------------+---------------+
8708 * | long NtpTime.seconds |
8709 * +---------------+---------------+---------------+---------------+
8710 * | unsigned long NtpTime.fraction |
8711 * +---------------+---------------+---------------+---------------+
8713 case PID_TIME_BASED_FILTER:
8714 ENSURE_LENGTH(8);
8715 rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding,
8716 hf_rtps_time_based_filter_minimum_separation);
8717 break;
8719 /* 0...2...........7...............15.............23...............31
8720 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8721 * | PID_TOPIC_NAME | length |
8722 * +---------------+---------------+---------------+---------------+
8723 * | unsigned long String.length |
8724 * +---------------+---------------+---------------+---------------+
8725 * | str[0] | str[1] | str[2] | str[3] |
8726 * +---------------+---------------+---------------+---------------+
8727 * | ... |
8728 * +---------------+---------------+---------------+---------------+
8730 case PID_TOPIC_NAME: {
8731 const char * retVal = NULL;
8732 uint32_t str_size = tvb_get_uint32(tvb, offset, encoding);
8734 retVal = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset+4, str_size, ENC_ASCII);
8735 rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_param_topic_name, encoding);
8736 /* If topic information is enabled we have to store the topic name for showing after the DATA(r|w)
8737 * in the infor column. This information is used in append_status_info function.
8739 if (retVal != NULL && enable_topic_info) {
8740 submessage_col_info* current_submessage_col_info = NULL;
8742 rtps_util_store_type_mapping(pinfo, tvb, offset, type_mapping_object, retVal, TOPIC_INFO_ADD_TOPIC_NAME);
8743 /* retVal has packet scope lifetime, enough for adding to the DATA(r|w) column information */
8744 current_submessage_col_info = (submessage_col_info*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY);
8745 if (current_submessage_col_info != NULL && current_submessage_col_info->topic_name == NULL) {
8746 current_submessage_col_info->topic_name = retVal;
8749 break;
8752 /* 0...2...........7...............15.............23...............31
8753 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8754 * | PID_OWNERSHIP_STRENGTH | 0x0004 |
8755 * +---------------+---------------+---------------+---------------+
8756 * | long strength |
8757 * +---------------+---------------+---------------+---------------+
8759 case PID_OWNERSHIP_STRENGTH:
8760 ENSURE_LENGTH(4);
8761 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_strength, tvb, offset, 4, encoding);
8762 break;
8764 /* 0...2...........7...............15.............23...............31
8765 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8766 * | PID_TYPE_NAME | length |
8767 * +---------------+---------------+---------------+---------------+
8768 * | unsigned long String.length |
8769 * +---------------+---------------+---------------+---------------+
8770 * | str[0] | str[1] | str[2] | str[3] |
8771 * +---------------+---------------+---------------+---------------+
8772 * | ... |
8773 * +---------------+---------------+---------------+---------------+
8775 case PID_TYPE_NAME: {
8776 const char * retVal = NULL;
8777 uint32_t str_size = tvb_get_uint32(tvb, offset, encoding);
8779 retVal = (char*) tvb_get_string_enc(pinfo->pool, tvb, offset+4, str_size, ENC_ASCII);
8781 rtps_util_store_type_mapping(pinfo, tvb, offset, type_mapping_object,
8782 retVal, TOPIC_INFO_ADD_TYPE_NAME);
8784 rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_param_type_name, encoding);
8785 break;
8788 /* 0...2...........7...............15.............23...............31
8789 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8790 * | PID_XXXXXXXXXXX | 0x0004 |
8791 * +---------------+---------------+---------------+---------------+
8792 * | long port |
8793 * +---------------+---------------+---------------+---------------+
8795 case PID_METATRAFFIC_MULTICAST_PORT:
8796 case PID_METATRAFFIC_UNICAST_PORT:
8797 case PID_DEFAULT_UNICAST_PORT:
8798 ENSURE_LENGTH(4);
8799 rtps_util_add_port(rtps_parameter_tree, pinfo, tvb, offset, encoding, hf_rtps_param_port);
8800 break;
8802 /* 0...2...........7...............15.............23...............31
8803 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8804 * | PID_EXPECTS_INLINE_QOS | 0x0004 |
8805 * +---------------+---------------+---------------+---------------+
8806 * | boolean | N O T U S E D |
8807 * +---------------+---------------+---------------+---------------+
8809 case PID_EXPECTS_INLINE_QOS:
8810 ENSURE_LENGTH(1);
8811 proto_tree_add_item(rtps_parameter_tree, hf_rtps_expects_inline_qos, tvb, offset, 1, ENC_NA );
8812 break;
8814 /* 0...2...........7...............15.............23...............31
8815 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8816 * | PID_XXXXXXXXXXX | length |
8817 * +---------------+---------------+---------------+---------------+
8818 * | unsigned long ip_address |
8819 * +---------------+---------------+---------------+---------------+
8821 case PID_METATRAFFIC_MULTICAST_IPADDRESS:
8822 case PID_DEFAULT_UNICAST_IPADDRESS:
8823 case PID_MULTICAST_IPADDRESS:
8824 case PID_METATRAFFIC_UNICAST_IPADDRESS:
8825 rtps_util_add_ipv4_address_t(rtps_parameter_tree, pinfo, tvb, offset,
8826 encoding, hf_param_ip_address);
8827 break;
8829 /* 0...2...........7...............15.............23...............31
8830 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8831 * | PID_PROTOCOL_VERSION | 0x0004 |
8832 * +---------------+---------------+---------------+---------------+
8833 * | uint8 major | uint8 minor | N O T U S E D |
8834 * +---------------+---------------+---------------+---------------+
8836 case PID_PROTOCOL_VERSION:
8837 ENSURE_LENGTH(2);
8838 rtps_util_add_protocol_version(rtps_parameter_tree, tvb, offset);
8839 break;
8841 /* 0...2...........7...............15.............23...............31
8842 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8843 * | PID_VENDOR_ID | 0x0004 |
8844 * +---------------+---------------+---------------+---------------+
8845 * | uint8 major | uint8 minor | N O T U S E D |
8846 * +---------------+---------------+---------------+---------------+
8848 case PID_VENDOR_ID:
8849 ENSURE_LENGTH(2);
8850 rtps_util_add_vendor_id(rtps_parameter_tree, tvb, offset);
8851 break;
8853 /* 0...2...........7...............15.............23...............31
8854 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8855 * | PID_RELIABILITY | 0x0004 |
8856 * +---------------+---------------+---------------+---------------+
8857 * | unsigned long kind |
8858 * +---------------+---------------+---------------+---------------+
8860 case PID_RELIABILITY_OFFERED: /* Deprecated */
8861 case PID_RELIABILITY:
8862 ENSURE_LENGTH(4);
8863 proto_tree_add_item(rtps_parameter_tree, hf_rtps_reliability_kind, tvb, offset, 4, encoding);
8864 /* Older version of the protocol (and for PID_RELIABILITY_OFFERED)
8865 * this parameter was carrying also a NtpTime called
8866 * 'maxBlockingTime'.
8868 if (size == 12) {
8869 rtps_util_add_timestamp(rtps_parameter_tree, tvb, offset + 4,
8870 encoding, hf_rtps_reliability_max_blocking_time);
8872 break;
8874 /* 0...2...........7...............15.............23...............31
8875 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8876 * | PID_LIVELINESS | 0x000c |
8877 * +---------------+---------------+---------------+---------------+
8878 * | unsigned long kind |
8879 * +---------------+---------------+---------------+---------------+
8880 * | long NtpTime.seconds |
8881 * +---------------+---------------+---------------+---------------+
8882 * | unsigned long NtpTime.fraction |
8883 * +---------------+---------------+---------------+---------------+
8884 * NDDS 3.1 sends only 'kind' on the wire.
8887 case PID_LIVELINESS_OFFERED: /* Deprecated */
8888 case PID_LIVELINESS:
8889 ENSURE_LENGTH(12);
8890 rtps_util_add_liveliness_qos(rtps_parameter_tree, tvb, offset, encoding);
8891 break;
8893 /* 0...2...........7...............15.............23...............31
8894 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8895 * | PID_DURABILITY | 0x0004 |
8896 * +---------------+---------------+---------------+---------------+
8897 * | unsigned long kind |
8898 * +---------------+---------------+---------------+---------------+
8900 case PID_DURABILITY:
8901 ENSURE_LENGTH(4);
8902 proto_tree_add_item(rtps_parameter_tree, hf_rtps_durability, tvb, offset, 4, encoding);
8903 break;
8905 /* 0...2...........7...............15.............23...............31
8906 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8907 * | PID_DURABILITY_SERVICE | 0x0004 |
8908 * +---------------+---------------+---------------+---------------+
8909 * | long NtpTime.seconds |
8910 * +---------------+---------------+---------------+---------------+
8911 * | unsigned long NtpTime.fraction |
8912 * +---------------+---------------+---------------+---------------+
8913 * | unsigned long kind |
8914 * +---------------+---------------+---------------+---------------+
8915 * | long history_depth |
8916 * +---------------+---------------+---------------+---------------+
8917 * | long max_samples |
8918 * +---------------+---------------+---------------+---------------+
8919 * | long max_instances |
8920 * +---------------+---------------+---------------+---------------+
8921 * | long max_samples_per_instance |
8922 * +---------------+---------------+---------------+---------------+
8924 case PID_DURABILITY_SERVICE:
8925 ENSURE_LENGTH(28);
8926 rtps_util_add_durability_service_qos(rtps_parameter_tree, tvb, offset, encoding);
8927 break;
8929 /* 0...2...........7...............15.............23...............31
8930 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8931 * | PID_OWNERSHIP | 0x0004 |
8932 * +---------------+---------------+---------------+---------------+
8933 * | unsigned long kind |
8934 * +---------------+---------------+---------------+---------------+
8936 case PID_OWNERSHIP_OFFERED: /* Deprecated */
8937 case PID_OWNERSHIP:
8938 ENSURE_LENGTH(4);
8939 proto_tree_add_item(rtps_parameter_tree, hf_rtps_ownership, tvb, offset, 4, encoding);
8940 break;
8942 /* 0...2...........7...............15.............23...............31
8943 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8944 * | PID_PRESENTATION | 0x0008 |
8945 * +---------------+---------------+---------------+---------------+
8946 * | unsigned long kind |
8947 * +---------------+---------------+---------------+---------------+
8948 * | boolean | boolean | N O T U S E D |
8949 * +---------------+---------------+---------------+---------------+
8951 case PID_PRESENTATION_OFFERED: /* Deprecated */
8952 case PID_PRESENTATION:
8953 ENSURE_LENGTH(6);
8954 proto_tree_add_item(rtps_parameter_tree, hf_rtps_presentation_access_scope, tvb, offset, 4, encoding);
8955 proto_tree_add_item(rtps_parameter_tree, hf_rtps_presentation_coherent_access, tvb, offset+4, 1, ENC_NA );
8956 proto_tree_add_item(rtps_parameter_tree, hf_rtps_presentation_ordered_access, tvb, offset+5, 1, ENC_NA );
8957 break;
8959 /* 0...2...........7...............15.............23...............31
8960 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8961 * | PID_DEADLINE | 0x0008 |
8962 * +---------------+---------------+---------------+---------------+
8963 * | long NtpTime.seconds |
8964 * +---------------+---------------+---------------+---------------+
8965 * | unsigned long NtpTime.fraction |
8966 * +---------------+---------------+---------------+---------------+
8968 case PID_DEADLINE_OFFERED: /* Deprecated */
8969 case PID_DEADLINE:
8970 ENSURE_LENGTH(8);
8971 rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding, hf_rtps_deadline_period);
8972 break;
8974 /* 0...2...........7...............15.............23...............31
8975 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8976 * | PID_DESTINATION_ORDER | 0x0004 |
8977 * +---------------+---------------+---------------+---------------+
8978 * | unsigned long kind |
8979 * +---------------+---------------+---------------+---------------+
8981 case PID_DESTINATION_ORDER_OFFERED: /* Deprecated */
8982 case PID_DESTINATION_ORDER:
8983 ENSURE_LENGTH(4);
8984 proto_tree_add_item(rtps_parameter_tree, hf_rtps_destination_order, tvb, offset, 4, encoding);
8985 break;
8987 /* 0...2...........7...............15.............23...............31
8988 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
8989 * | PID_LATENCY_BUDGET | 0x0008 |
8990 * +---------------+---------------+---------------+---------------+
8991 * | long NtpTime.seconds |
8992 * +---------------+---------------+---------------+---------------+
8993 * | unsigned long NtpTime.fraction |
8994 * +---------------+---------------+---------------+---------------+
8996 case PID_LATENCY_BUDGET_OFFERED:
8997 case PID_LATENCY_BUDGET:
8998 ENSURE_LENGTH(8);
8999 rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset,
9000 encoding, hf_rtps_latency_budget_duration);
9001 break;
9003 /* 0...2...........7...............15.............23...............31
9004 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9005 * | PID_PARTITION | length |
9006 * +---------------+---------------+---------------+---------------+
9007 * | unsigned long sequence_size |
9008 * +---------------+---------------+---------------+---------------+
9009 * | unsigned long string[0].size |
9010 * +---------------+---------------+---------------+---------------+
9011 * | string[0][0] | string[0][1] | string[0][2] | string[0][3] |
9012 * +---------------+---------------+---------------+---------------+
9013 * | ... |
9014 * +---------------+---------------+---------------+---------------+
9015 * The value is a sequence of strings.
9017 case PID_PARTITION_OFFERED: /* Deprecated */
9018 case PID_PARTITION:
9019 ENSURE_LENGTH(4);
9020 rtps_util_add_seq_string(rtps_parameter_tree, pinfo, tvb, offset, encoding,
9021 hf_rtps_param_partition_num, hf_rtps_param_partition, "name");
9022 break;
9023 case PID_TOPIC_NAME_ALIASES:
9024 ENSURE_LENGTH(4);
9025 rtps_util_add_seq_string(rtps_parameter_tree, pinfo, tvb, offset, encoding,
9026 hf_rtps_param_topic_alias_num, hf_rtps_param_topic_alias, "Topic alias");
9027 break;
9029 /* 0...2...........7...............15.............23...............31
9030 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9031 * | PID_LIFESPAN | 0x0008 |
9032 * +---------------+---------------+---------------+---------------+
9033 * | long NtpTime.seconds |
9034 * +---------------+---------------+---------------+---------------+
9035 * | unsigned long NtpTime.fraction |
9036 * +---------------+---------------+---------------+---------------+
9038 case PID_LIFESPAN:
9039 ENSURE_LENGTH(8);
9040 rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding,
9041 hf_rtps_lifespan_duration);
9042 break;
9044 /* 0...2...........7...............15.............23...............31
9045 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9046 * | PID_USER_DATA | length |
9047 * +---------------+---------------+---------------+---------------+
9048 * | unsigned long sequence_size |
9049 * +---------------+---------------+---------------+---------------+
9050 * | octet[0] | octet[1] | octet[2] | octet[3] |
9051 * +---------------+---------------+---------------+---------------+
9052 * | ... |
9053 * +---------------+---------------+---------------+---------------+
9055 case PID_USER_DATA:
9056 ENSURE_LENGTH(4);
9057 rtps_util_add_seq_octets(rtps_parameter_tree, pinfo, tvb, offset,
9058 encoding, param_length, hf_rtps_param_user_data);
9059 break;
9061 /* 0...2...........7...............15.............23...............31
9062 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9063 * | PID_GROUP_DATA | length |
9064 * +---------------+---------------+---------------+---------------+
9065 * | unsigned long sequence_size |
9066 * +---------------+---------------+---------------+---------------+
9067 * | octet[0] | octet[1] | octet[2 ] | octet[3] |
9068 * +---------------+---------------+---------------+---------------+
9069 * | ... |
9070 * +---------------+---------------+---------------+---------------+
9072 case PID_GROUP_DATA:
9073 ENSURE_LENGTH(4);
9074 rtps_util_add_seq_octets(rtps_parameter_tree, pinfo, tvb, offset,
9075 encoding, param_length, hf_rtps_param_group_data);
9076 break;
9078 /* 0...2...........7...............15.............23...............31
9079 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9080 * | PID_TOPIC_DATA | length |
9081 * +---------------+---------------+---------------+---------------+
9082 * | unsigned long sequence_size |
9083 * +---------------+---------------+---------------+---------------+
9084 * | octet[0] | octet[1] | octet[2] | octet[3] |
9085 * +---------------+---------------+---------------+---------------+
9086 * | ... |
9087 * +---------------+---------------+---------------+---------------+
9089 case PID_TOPIC_DATA:
9090 ENSURE_LENGTH(4);
9091 rtps_util_add_seq_octets(rtps_parameter_tree, pinfo, tvb, offset,
9092 encoding, param_length, hf_rtps_param_topic_data);
9093 break;
9095 /* 0...2...........7...............15.............23...............31
9096 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9097 * | PID_UNICAST_LOCATOR | 0x0018 |
9098 * +---------------+---------------+---------------+---------------+
9099 * | long kind |
9100 * +---------------+---------------+---------------+---------------+
9101 * | long port |
9102 * +---------------+---------------+---------------+---------------+
9103 * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
9104 * +---------------+---------------+---------------+---------------+
9105 * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
9106 * +---------------+---------------+---------------+---------------+
9107 * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
9108 * +---------------+---------------+---------------+---------------+
9109 * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
9110 * +---------------+---------------+---------------+---------------+
9112 case PID_UNICAST_LOCATOR:
9113 ENSURE_LENGTH(24);
9114 rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb,
9115 offset, encoding, "locator");
9116 break;
9118 /* 0...2...........7...............15.............23...............31
9119 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9120 * | PID_MULTICAST_LOCATOR | 0x0018 |
9121 * +---------------+---------------+---------------+---------------+
9122 * | long kind |
9123 * +---------------+---------------+---------------+---------------+
9124 * | long port |
9125 * +---------------+---------------+---------------+---------------+
9126 * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
9127 * +---------------+---------------+---------------+---------------+
9128 * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
9129 * +---------------+---------------+---------------+---------------+
9130 * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
9131 * +---------------+---------------+---------------+---------------+
9132 * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
9133 * +---------------+---------------+---------------+---------------+
9135 case PID_MULTICAST_LOCATOR:
9136 ENSURE_LENGTH(24);
9137 rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb,
9138 offset, encoding, "locator");
9139 break;
9141 /* 0...2...........7...............15.............23...............31
9142 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9143 * | PID_DEFAULT_UNICAST_LOCATOR | 0x0018 |
9144 * +---------------+---------------+---------------+---------------+
9145 * | long kind |
9146 * +---------------+---------------+---------------+---------------+
9147 * | long port |
9148 * +---------------+---------------+---------------+---------------+
9149 * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
9150 * +---------------+---------------+---------------+---------------+
9151 * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
9152 * +---------------+---------------+---------------+---------------+
9153 * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
9154 * +---------------+---------------+---------------+---------------+
9155 * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
9156 * +---------------+---------------+---------------+---------------+
9158 case PID_DEFAULT_UNICAST_LOCATOR:
9159 ENSURE_LENGTH(24);
9160 rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb, offset,
9161 encoding, "locator");
9162 break;
9164 /* 0...2...........7...............15.............23...............31
9165 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9166 * | PID_METATRAFFIC_UNICAST_LOC...| 0x0018 |
9167 * +---------------+---------------+---------------+---------------+
9168 * | long kind |
9169 * +---------------+---------------+---------------+---------------+
9170 * | long port |
9171 * +---------------+---------------+---------------+---------------+
9172 * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
9173 * +---------------+---------------+---------------+---------------+
9174 * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
9175 * +---------------+---------------+---------------+---------------+
9176 * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
9177 * +---------------+---------------+---------------+---------------+
9178 * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
9179 * +---------------+---------------+---------------+---------------+
9181 case PID_METATRAFFIC_UNICAST_LOCATOR:
9182 ENSURE_LENGTH(24);
9183 rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb, offset,
9184 encoding, "locator");
9185 break;
9187 /* 0...2...........7...............15.............23...............31
9188 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9189 * | PID_METATRAFFIC_MULTICAST_L...| 0x0018 |
9190 * +---------------+---------------+---------------+---------------+
9191 * | long kind |
9192 * +---------------+---------------+---------------+---------------+
9193 * | long port |
9194 * +---------------+---------------+---------------+---------------+
9195 * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
9196 * +---------------+---------------+---------------+---------------+
9197 * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
9198 * +---------------+---------------+---------------+---------------+
9199 * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
9200 * +---------------+---------------+---------------+---------------+
9201 * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
9202 * +---------------+---------------+---------------+---------------+
9204 case PID_METATRAFFIC_MULTICAST_LOCATOR:
9205 ENSURE_LENGTH(24);
9206 rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb,
9207 offset, encoding, "locator");
9208 break;
9210 /* 0...2...........7...............15.............23...............31
9211 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9212 * | PID_PARTICIPANT_MANUAL_LIVE...| 0x0004 |
9213 * +---------------+---------------+---------------+---------------+
9214 * | long livelinessEpoch |
9215 * +---------------+---------------+---------------+---------------+
9217 case PID_PARTICIPANT_BUILTIN_ENDPOINTS:
9218 ENSURE_LENGTH(4);
9219 proto_tree_add_item(rtps_parameter_tree, hf_rtps_participant_builtin_endpoints, tvb, offset, 4, encoding);
9220 break;
9222 case PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT:
9223 ENSURE_LENGTH(4);
9224 proto_tree_add_item(rtps_parameter_tree, hf_rtps_participant_manual_liveliness_count, tvb, offset, 4, encoding);
9225 break;
9227 /* 0...2...........7...............15.............23...............31
9228 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9229 * | PID_HISTORY | 0x0004 |
9230 * +---------------+---------------+---------------+---------------+
9231 * | long kind |
9232 * +---------------+---------------+---------------+---------------+
9233 * | long depth |
9234 * +---------------+---------------+---------------+---------------+
9236 case PID_HISTORY:
9237 ENSURE_LENGTH(8);
9238 proto_tree_add_item(rtps_parameter_tree, hf_rtps_history_kind, tvb, offset, 4, encoding);
9239 proto_tree_add_item(rtps_parameter_tree, hf_rtps_history_depth, tvb, offset+4, 4, encoding);
9240 break;
9242 /* 0...2...........7...............15.............23...............31
9243 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9244 * | PID_RESOURCE_LIMIT | 0x0004 |
9245 * +---------------+---------------+---------------+---------------+
9246 * | long max_samples |
9247 * +---------------+---------------+---------------+---------------+
9248 * | long max_instances |
9249 * +---------------+---------------+---------------+---------------+
9250 * | long max_samples_per_instances |
9251 * +---------------+---------------+---------------+---------------+
9253 case PID_RESOURCE_LIMIT:
9254 ENSURE_LENGTH(12);
9255 subtree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, 12, ett_rtps_resource_limit, NULL, "Resource Limit");
9256 proto_tree_add_item(subtree, hf_rtps_resource_limit_max_samples, tvb, offset, 4, encoding);
9257 proto_tree_add_item(subtree, hf_rtps_resource_limit_max_instances, tvb, offset+4, 4, encoding);
9258 proto_tree_add_item(subtree, hf_rtps_resource_limit_max_samples_per_instances, tvb, offset+8, 4, encoding);
9259 break;
9261 /* 0...2...........7...............15.............23...............31
9262 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9263 * | PID_CONTENT_FILTER_PROPERTY | length |
9264 * +---------------+---------------+---------------+---------------+
9265 * | unsigned long String1.length |
9266 * +---------------+---------------+---------------+---------------+
9267 * | str1[0] | str1[1] | str1[2] | str1[3] |
9268 * +---------------+---------------+---------------+---------------+
9269 * | ... |
9270 * +---------------+---------------+---------------+---------------+
9271 * | unsigned long String2.length |
9272 * +---------------+---------------+---------------+---------------+
9273 * | str2[0] | str2[1] | str2[2] | str2[3] |
9274 * +---------------+---------------+---------------+---------------+
9275 * | ... |
9276 * +---------------+---------------+---------------+---------------+
9277 * | unsigned long String3.length |
9278 * +---------------+---------------+---------------+---------------+
9279 * | str3[0] | str3[1] | str3[2] | str3[3] |
9280 * +---------------+---------------+---------------+---------------+
9281 * | ... |
9282 * +---------------+---------------+---------------+---------------+
9283 * | unsigned long String4.length |
9284 * +---------------+---------------+---------------+---------------+
9285 * | str4[0] | str4[1] | str4[2] | str4[3] |
9286 * +---------------+---------------+---------------+---------------+
9287 * | ... |
9288 * +---------------+---------------+---------------+---------------+
9289 * | ... |
9290 * | Filter Parameters |
9291 * | ... |
9292 * +---------------+---------------+---------------+---------------+
9294 * String1: ContentFilterTopicName
9295 * String2: RelatedTopicName
9296 * String3: FilterClassName
9297 * String4: FilterExpression
9298 * ExpressionParameters: sequence of Strings
9300 * Note: those strings starts all to a word-aligned (4 bytes) offset
9302 case PID_CONTENT_FILTER_PROPERTY: {
9303 uint32_t temp_offset = offset;
9304 ENSURE_LENGTH(20);
9305 temp_offset = rtps_util_add_string(rtps_parameter_tree, tvb, temp_offset,
9306 hf_rtps_param_content_filter_topic_name, encoding);
9307 temp_offset = rtps_util_add_string(rtps_parameter_tree, tvb, temp_offset,
9308 hf_rtps_param_related_topic_name, encoding);
9309 temp_offset = rtps_util_add_string(rtps_parameter_tree, tvb, temp_offset,
9310 hf_rtps_param_filter_class_name, encoding);
9311 temp_offset = rtps_util_add_string(rtps_parameter_tree, tvb, temp_offset,
9312 hf_rtps_param_filter_expression, encoding);
9313 /*temp_offset = */rtps_util_add_seq_string(rtps_parameter_tree, pinfo, tvb, temp_offset,
9314 encoding, hf_rtps_param_expression_parameters_num,
9315 hf_rtps_param_expression_parameters, "expressionParameters");
9316 break;
9319 /* 0...2...........7...............15.............23...............31
9320 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9321 * | PID_PROPERTY_LIST | length |
9322 * +---------------+---------------+---------------+---------------+
9323 * | unsigned long Seq.Length |
9324 * +---------------+---------------+---------------+---------------+
9325 * | ... |
9326 * | Property 1 |
9327 * | ... |
9328 * +---------------+---------------+---------------+---------------+
9329 * | ... |
9330 * | Property 2 |
9331 * | ... |
9332 * +---------------+---------------+---------------+---------------+
9333 * | ... |
9334 * | Property n |
9335 * | ... |
9336 * +---------------+---------------+---------------+---------------+
9338 * IDL:
9339 * struct PROPERTY {
9340 * String Name;
9341 * String Value;
9342 * };
9344 * struct PROPERTY_LIST {
9345 * Sequence<PROPERTY> PropertyList;
9346 * };
9349 case PID_PROPERTY_LIST:
9350 case PID_PROPERTY_LIST_OLD:
9351 ENSURE_LENGTH(4);
9353 uint32_t temp_offset, prop_size;
9354 const uint8_t *propName, *propValue;
9355 proto_item *list_item, *item;
9356 proto_tree *property_list_tree, *property_tree;
9357 uint32_t seq_size = tvb_get_uint32(tvb, offset, encoding);
9358 int start_offset = offset, str_length;
9360 proto_item_append_text( parameter_item, " (%d properties)", seq_size );
9361 if (seq_size > 0) {
9362 property_list_tree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, -1, ett_rtps_property_list, &list_item, "Property List");
9364 temp_offset = offset+4;
9365 while(seq_size-- > 0) {
9366 prop_size = tvb_get_uint32(tvb, temp_offset, encoding);
9367 propName = tvb_get_string_enc(pinfo->pool, tvb, temp_offset+4, prop_size, ENC_ASCII);
9369 /* NDDS align strings at 4-bytes word. */
9370 str_length = (4 + ((prop_size + 3) & 0xfffffffc));
9371 item = proto_tree_add_string(property_list_tree, hf_rtps_property_name, tvb, temp_offset, str_length, propName);
9372 property_tree = proto_item_add_subtree(item, ett_rtps_property);
9373 temp_offset += str_length;
9375 prop_size = tvb_get_uint32(tvb, temp_offset, encoding);
9376 propValue = tvb_get_string_enc(pinfo->pool, tvb, temp_offset+4, prop_size, ENC_ASCII);
9378 /* NDDS align strings at 4-bytes word. */
9379 str_length = (4 + ((prop_size + 3) & 0xfffffffc));
9380 proto_tree_add_string(property_tree, hf_rtps_property_value, tvb, temp_offset, str_length, propValue);
9381 temp_offset += str_length;
9384 proto_item_set_len(list_item, temp_offset-start_offset);
9387 break;
9389 /* 0...2...........7...............15.............23...............31
9390 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9391 * | PID_FILTER_SIGNATURE | length |
9392 * +---------------+---------------+---------------+---------------+
9393 * | ... |
9394 * +---------------+---------------+---------------+---------------+
9396 * IDL:
9397 * struct CONTENT_FILTER_SIGNATURE {
9398 * sequence<long> filterBitmap;
9399 * sequence<FILTER_SIGNATURE, 4> filterSignature;
9402 * where:
9403 * struct FILTER_SIGNATURE {
9404 * long filterSignature[4];
9407 case PID_FILTER_SIGNATURE: {
9408 uint32_t temp_offset;
9409 uint32_t prev_offset;
9410 uint32_t fs_elem;
9411 uint32_t fs[4];
9412 ENSURE_LENGTH(8);
9414 /* Dissect filter bitmap */
9415 temp_offset = rtps_util_add_seq_ulong(rtps_parameter_tree, tvb, offset,
9416 hf_rtps_filter_bitmap, encoding, param_length, "filterBitmap");
9418 /* Dissect sequence of FILTER_SIGNATURE */
9419 fs_elem = tvb_get_uint32(tvb, temp_offset, encoding);
9420 temp_offset += 4;
9421 while (fs_elem-- > 0) {
9422 prev_offset = temp_offset;
9423 /* Dissect the next FILTER_SIGNATURE object */
9424 fs[0] = tvb_get_uint32(tvb, temp_offset, encoding);
9425 temp_offset += 4;
9426 fs[1] = tvb_get_uint32(tvb, temp_offset, encoding);
9427 temp_offset += 4;
9428 fs[2] = tvb_get_uint32(tvb, temp_offset, encoding);
9429 temp_offset += 4;
9430 fs[3] = tvb_get_uint32(tvb, temp_offset, encoding);
9431 temp_offset += 4;
9432 proto_tree_add_bytes_format_value(rtps_parameter_tree, hf_rtps_filter_signature, tvb, prev_offset, temp_offset - prev_offset, NULL, "%08x %08x %08x %08x",
9433 fs[0], fs[1], fs[2], fs[3]);
9436 break;
9440 /* 0...2...........7...............15.............23...............31
9441 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9442 * | PID_COHERENT_SET | length |
9443 * +---------------+---------------+---------------+---------------+
9444 * | |
9445 * + SequenceNumber seqNumber +
9446 * | |
9447 * +---------------+---------------+---------------+---------------+
9449 case PID_COHERENT_SET: {
9450 uint64_t coherent_seq_number;
9452 ENSURE_LENGTH(8);
9453 coherent_seq_number = rtps_util_add_seq_number(rtps_parameter_tree, tvb, offset,
9454 encoding, "sequenceNumber");
9455 if (coherent_set_entity_info_object && rtps_parameter_tree) {
9456 rtps_util_add_coherent_set_general_cases_case(rtps_parameter_tree,
9457 tvb, coherent_seq_number, coherent_set_entity_info_object);
9459 break;
9461 /* 0...2...........7...............15.............23...............31
9462 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9463 * | PID_TYPECODE | length |
9464 * +---------------+---------------+---------------+---------------+
9465 * | |
9466 * + Type code description +
9467 * | |
9468 * +---------------+---------------+---------------+---------------+
9470 case PID_TYPECODE:
9471 rtps_util_add_typecode(rtps_parameter_tree, tvb, pinfo, offset, encoding,
9472 0, /* indent level */
9473 0, /* isPointer */
9474 -1, /* bitfield */
9475 0, /* isKey */
9476 offset,
9477 NULL, /* name */
9478 -1, /* not a seq field */
9479 NULL, /* not an array */
9480 0); /* ndds 4.0 hack: init to false */
9481 break;
9483 /* 0...2...........7...............15.............23...............31
9484 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9485 * | PID_PARTICIPANT_GUID | 0x000c |
9486 * +---------------+---------------+---------------+---------------+
9487 * | guid[0] | guid[1] | guid[2] | guid[3] |
9488 * +---------------+---------------+---------------+---------------+
9489 * | guid[4] | guid[5] | guid[6] | guid[7] |
9490 * +---------------+---------------+---------------+---------------+
9491 * | guid[8] | guid[9] | guid[10] | guid[11] |
9492 * +---------------+---------------+---------------+---------------+
9494 case PID_PARTICIPANT_GUID:
9495 if (version < 0x0200) {
9496 ENSURE_LENGTH(12);
9497 rtps_util_add_generic_guid_v1(rtps_parameter_tree, tvb, offset,
9498 hf_rtps_participant_guid_v1, hf_rtps_param_host_id, hf_rtps_param_app_id,
9499 hf_rtps_param_instance_id_v1, hf_rtps_param_app_kind,
9500 hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_entity_kind);
9501 } else {
9502 ENSURE_LENGTH(16);
9503 rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
9504 hf_rtps_participant_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
9505 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
9506 hf_rtps_param_entity_kind, NULL);
9508 break;
9510 /* 0...2...........7...............15.............23...............31
9511 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9512 * | PID_PARTICIPANT_ENTITY_ID | 0x0004 |
9513 * +---------------+---------------+---------------+---------------+
9514 * | entity[0] | entity[1] | entity[2] | entity[3] |
9515 * +---------------+---------------+---------------+---------------+
9517 case PID_PARTICIPANT_ENTITY_ID:
9518 ENSURE_LENGTH(4);
9519 rtps_util_add_generic_entity_id(rtps_parameter_tree, tvb, offset, "Participant entity ID",
9520 hf_rtps_param_entity, hf_rtps_param_entity_key,
9521 hf_rtps_param_entity_kind, ett_rtps_entity);
9523 break;
9525 /* 0...2...........7...............15.............23...............31
9526 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9527 * | PID_GROUP_GUID | 0x000c |
9528 * +---------------+---------------+---------------+---------------+
9529 * | guid[0] | guid[1] | guid[2] | guid[3] |
9530 * +---------------+---------------+---------------+---------------+
9531 * | guid[4] | guid[5] | guid[6] | guid[7] |
9532 * +---------------+---------------+---------------+---------------+
9533 * | guid[8] | guid[9] | guid[10] | guid[11] |
9534 * +---------------+---------------+---------------+---------------+
9536 case PID_GROUP_GUID:
9537 if (version < 0x0200) {
9538 ENSURE_LENGTH(12);
9539 rtps_util_add_generic_guid_v1(rtps_parameter_tree, tvb, offset,
9540 hf_rtps_group_guid_v1, hf_rtps_param_host_id, hf_rtps_param_app_id,
9541 hf_rtps_param_instance_id_v1, hf_rtps_param_app_kind,
9542 hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_entity_kind);
9543 } else {
9544 ENSURE_LENGTH(16);
9545 rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
9546 hf_rtps_group_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
9547 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
9548 hf_rtps_param_entity_kind, NULL);
9550 break;
9552 /* 0...2...........7...............15.............23...............31
9553 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9554 * | PID_GROUP_ENTITY_ID | 0x0004 |
9555 * +---------------+---------------+---------------+---------------+
9556 * | entity[0] | entity[1] | entity[2] | entity[3] |
9557 * +---------------+---------------+---------------+---------------+
9559 case PID_GROUP_ENTITY_ID:
9560 ENSURE_LENGTH(4);
9561 rtps_util_add_generic_entity_id(rtps_parameter_tree, tvb, offset, "Group entity ID",
9562 hf_rtps_param_entity, hf_rtps_param_entity_key,
9563 hf_rtps_param_entity_kind, ett_rtps_entity);
9564 break;
9566 /* ==================================================================
9567 * Here are all the deprecated items.
9570 case PID_PERSISTENCE:
9571 ENSURE_LENGTH(8);
9572 rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding,
9573 hf_rtps_persistence);
9574 break;
9576 case PID_TYPE_CHECKSUM:
9577 ENSURE_LENGTH(4);
9578 proto_tree_add_checksum(rtps_parameter_tree, tvb, offset, hf_rtps_type_checksum, -1, NULL, pinfo, 0, encoding, PROTO_CHECKSUM_NO_FLAGS);
9579 break;
9581 case PID_EXPECTS_ACK:
9582 ENSURE_LENGTH(1);
9583 proto_tree_add_item(rtps_parameter_tree, hf_rtps_expects_ack, tvb, offset, 1, ENC_NA );
9584 break;
9586 case PID_MANAGER_KEY: {
9587 int i = 0;
9588 uint32_t manager_key;
9590 subtree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, param_length, ett_rtps_manager_key, NULL, "Manager Keys");
9592 while (param_length >= 4) {
9593 manager_key = tvb_get_uint32(tvb, offset, encoding);
9594 proto_tree_add_uint_format(subtree, hf_rtps_manager_key, tvb, offset, 4,
9595 manager_key, "Key[%d]: 0x%X", i, manager_key);
9597 ++i;
9598 offset +=4;
9599 param_length -= 4; /* decrement count */
9601 break;
9604 case PID_RECV_QUEUE_SIZE:
9605 case PID_SEND_QUEUE_SIZE:
9606 ENSURE_LENGTH(4);
9607 proto_tree_add_item(rtps_parameter_tree, hf_rtps_queue_size, tvb, offset, 4, encoding);
9608 break;
9610 case PID_VARGAPPS_SEQUENCE_NUMBER_LAST:
9611 ENSURE_LENGTH(4);
9612 rtps_util_add_seq_number(rtps_parameter_tree, tvb, offset, encoding, "sequenceNumberLast");
9613 break;
9615 case PID_SENTINEL:
9616 /* PID_SENTINEL should ignore any value of parameter length */
9617 break;
9619 /* This is the default branch when we don't have enough information
9620 * on how to decode the parameter. It can be used also for known
9621 * parameters.
9623 /* 0...2...........7...............15.............23...............31
9624 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9625 * | <pid_id> | 0x0000 |
9626 * +---------------+---------------+---------------+---------------+
9628 case PID_TYPE2_NAME:
9629 case PID_TYPE2_CHECKSUM:
9630 case PID_RELIABILITY_ENABLED:
9631 expert_add_info(pinfo, parameter_item, &ei_rtps_parameter_not_decoded);
9632 /* Fall Through */
9633 case PID_PAD:
9634 if (param_length > 0) {
9635 proto_tree_add_item(rtps_parameter_tree, hf_rtps_parameter_data, tvb,
9636 offset, param_length, ENC_NA);
9638 break;
9640 default:
9641 return false;
9644 return true;
9647 static bool dissect_parameter_sequence_v2(proto_tree *rtps_parameter_tree, packet_info *pinfo, tvbuff_t *tvb,
9648 proto_item *parameter_item _U_, proto_item *param_len_item,
9649 int offset, const unsigned encoding, int param_length,
9650 uint16_t parameter, uint32_t *pStatusInfo, uint16_t vendor_id _U_,
9651 type_mapping * type_mapping_object,
9652 coherent_set_entity_info *coherent_set_entity_info_object _U_) {
9653 proto_item *ti;
9655 switch(parameter) {
9656 /* 0...2...........7...............15.............23...............31
9657 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9658 * | PID_STATUS_INFO | 0x0004 |
9659 * +---------------+---------------+---------------+---------------+
9660 * | long statusInfo |
9661 * +---------------+---------------+---------------+---------------+
9663 case PID_STATUS_INFO: {
9664 bool* is_data_session_intermediate = NULL;
9665 ENSURE_LENGTH(4);
9666 /* PID_STATUS_INFO is always coded in network byte order (big endian) */
9667 proto_tree_add_bitmask(rtps_parameter_tree, tvb, offset,
9668 hf_rtps_param_status_info_flags, ett_rtps_flags,
9669 STATUS_INFO_FLAGS, ENC_BIG_ENDIAN);
9670 if (pStatusInfo != NULL) {
9671 *pStatusInfo = tvb_get_ntohl(tvb, offset);
9673 is_data_session_intermediate = (bool*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_DATA_SESSION_FINAL_PROTODATA_KEY);
9674 if (is_data_session_intermediate != NULL) {
9675 *is_data_session_intermediate = true;
9677 break;
9680 /* 0...2...........7...............15.............23...............31
9681 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9682 * | PID_DIRECTED_WRITE | 0x0010 |
9683 * +---------------+---------------+---------------+---------------+
9684 * | |
9685 * +- -+
9686 * | octet[12] guidPrefix |
9687 * +- -+
9688 * | |
9689 * +---------------+---------------+---------------+---------------+
9690 * | octet[4] entityId |
9691 * +---------------+---------------+---------------+---------------+
9693 case PID_DIRECTED_WRITE: {
9694 ENSURE_LENGTH(16);
9695 rtps_util_add_guid_prefix_v2(rtps_parameter_tree, tvb, offset, hf_rtps_sm_guid_prefix,
9696 hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0);
9697 rtps_util_add_entity_id(rtps_parameter_tree, tvb, offset+12, hf_rtps_sm_entity_id,
9698 hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity,
9699 "guidSuffix", NULL);
9700 break;
9704 /* 0...2...........7...............15.............23...............31
9705 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9706 * | PID_KEY_HASH | xxxx |
9707 * +---------------+---------------+---------------+---------------+
9708 * | |
9709 * +- -+
9710 * | octet[xxxx] guid |
9711 * +- -+
9712 * | |
9713 * +---------------+---------------+---------------+---------------+
9714 * Differently from the other GUID, the KEY_HASH parameter may have
9715 * variable length in the future.
9716 * As consequence, no interpretation is performed here (and no check
9717 * for size).
9719 case PID_KEY_HASH: {
9720 uint8_t guidPart;
9721 int i;
9722 ti = proto_tree_add_bytes_format(rtps_parameter_tree, hf_rtps_guid, tvb, offset, param_length, NULL, "guid: ");
9723 for (i = 0; i < param_length; ++i) {
9724 guidPart = tvb_get_uint8(tvb, offset+i);
9725 proto_item_append_text(ti, "%02x", guidPart);
9726 if (( ((i+1) % 4) == 0 ) && (i != param_length-1) )
9727 proto_item_append_text(ti, ":");
9729 break;
9732 /* 0...2...........7...............15.............23...............31
9733 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9734 * | PID_TRANSPORT_PRIORITY | 0x0004 |
9735 * +---------------+---------------+---------------+---------------+
9736 * | unsigned long value |
9737 * +---------------+---------------+---------------+---------------+
9739 case PID_TRANSPORT_PRIORITY:
9740 ENSURE_LENGTH(4);
9741 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_transport_priority, tvb, offset, 4, encoding);
9742 break;
9744 /* 0...2...........7...............15.............23...............31
9745 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9746 * | PID_CONTENT_FILTER_INFO | length |
9747 * +---------------+---------------+---------------+---------------+
9748 * | ... |
9749 * +---------------+---------------+---------------+---------------+
9751 * IDL:
9752 * struct CONTENT_FILTER_SIGNATURE {
9753 * sequence<long> filterBitmap;
9754 * sequence<FILTER_SIGNATURE, 4> filterSignature;
9757 * where:
9758 * struct FILTER_SIGNATURE {
9759 * long filterSignature[4];
9762 case PID_CONTENT_FILTER_INFO: {
9763 uint32_t temp_offset;
9764 uint32_t prev_offset;
9765 uint32_t fs_elem;
9766 uint32_t fs[4];
9767 ENSURE_LENGTH(8);
9769 /* Dissect filter bitmap */
9770 temp_offset = rtps_util_add_seq_ulong(rtps_parameter_tree, tvb, offset,
9771 hf_rtps_filter_bitmap, encoding, param_length, "filterBitmap");
9773 /* Dissect sequence of FILTER_SIGNATURE */
9774 fs_elem = tvb_get_uint32(tvb, temp_offset, encoding);
9775 temp_offset += 4;
9776 while (fs_elem-- > 0) {
9777 prev_offset = temp_offset;
9778 /* Dissect the next FILTER_SIGNATURE object */
9779 fs[0] = tvb_get_uint32(tvb, temp_offset, encoding);
9780 temp_offset += 4;
9781 fs[1] = tvb_get_uint32(tvb, temp_offset, encoding);
9782 temp_offset += 4;
9783 fs[2] = tvb_get_uint32(tvb, temp_offset, encoding);
9784 temp_offset += 4;
9785 fs[3] = tvb_get_uint32(tvb, temp_offset, encoding);
9786 temp_offset += 4;
9787 proto_tree_add_bytes_format_value(rtps_parameter_tree, hf_rtps_filter_signature, tvb, prev_offset, temp_offset - prev_offset, NULL, "%08x %08x %08x %08x",
9788 fs[0], fs[1], fs[2], fs[3]);
9791 break;
9794 /* 0...2...........7...............15.............23...............31
9795 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9796 * | PID_BUILTIN_ENDPOINT_SET | length |
9797 * +---------------+---------------+---------------+---------------+
9798 * | long value |
9799 * +---------------+---------------+---------------+---------------+
9801 case PID_BUILTIN_ENDPOINT_SET: {
9802 uint32_t flags;
9803 ENSURE_LENGTH(4);
9804 flags = tvb_get_uint32(tvb, offset, encoding);
9805 proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
9806 hf_rtps_param_builtin_endpoint_set_flags, ett_rtps_flags,
9807 BUILTIN_ENDPOINT_FLAGS, flags);
9808 break;
9810 /* 0...2...........7...............15.............23...............31
9811 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9812 * | PID_TYPE_MAX_SIZE_SERIALIZED | length |
9813 * +---------------+---------------+---------------+---------------+
9814 * | long value |
9815 * +---------------+---------------+---------------+---------------+
9817 case PID_TYPE_MAX_SIZE_SERIALIZED:
9818 ENSURE_LENGTH(4);
9819 proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_type_max_size_serialized, tvb, offset, 4, encoding);
9820 break;
9824 /* 0...2...........7...............15.............23...............31
9825 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9826 * | PID_ORIGINAL_WRITER_INFO | length |
9827 * +---------------+---------------+---------------+---------------+
9828 * | |
9829 * +- -+
9830 * | octet[12] guidPrefix |
9831 * +- -+
9832 * | |
9833 * +---------------+---------------+---------------+---------------+
9834 * | octet[4] entityId |
9835 * +---------------+---------------+---------------+---------------+
9836 * | |
9837 * + SequenceNumber writerSeqNum +
9838 * | |
9839 * +---------------+---------------+---------------+---------------+
9841 case PID_ORIGINAL_WRITER_INFO:
9842 ENSURE_LENGTH(16);
9843 rtps_util_add_guid_prefix_v2(rtps_parameter_tree, tvb, offset, hf_rtps_sm_guid_prefix,
9844 hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0);
9845 rtps_util_add_entity_id(rtps_parameter_tree, tvb, offset+12, hf_rtps_sm_entity_id,
9846 hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity,
9847 "virtualGUIDSuffix", NULL);
9849 /* Sequence number */
9850 rtps_util_add_seq_number(rtps_parameter_tree, tvb, offset+16,
9851 encoding, "virtualSeqNumber");
9852 break;
9854 /* 0...2...........7...............15.............23...............31
9855 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9856 * | PID_ENTITY_NAME | length |
9857 * +---------------+---------------+---------------+---------------+
9858 * | unsigned long String.length |
9859 * +---------------+---------------+---------------+---------------+
9860 * | str[0] | str[1] | str[2] | str[3] |
9861 * +---------------+---------------+---------------+---------------+
9862 * | ... |
9863 * +---------------+---------------+---------------+---------------+
9865 case PID_ENTITY_NAME:
9866 rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_param_entity_name, encoding);
9867 break;
9869 /* 0...2...........7...............15.............23...............31
9870 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9871 * | PID_ENDPOINT_GUID | 0x0010 |
9872 * +---------------+---------------+---------------+---------------+
9873 * | guid[0] | guid[1] | guid[2] | guid[3] |
9874 * +---------------+---------------+---------------+---------------+
9875 * | guid[4] | guid[5] | guid[6] | guid[7] |
9876 * +---------------+---------------+---------------+---------------+
9877 * | guid[8] | guid[9] | guid[10] | guid[11] |
9878 * +---------------+---------------+---------------+---------------+
9879 * | guid[12] | guid[13] | guid[14] | guid[15] |
9880 * +---------------+---------------+---------------+---------------+
9882 case PID_ENDPOINT_GUID:
9883 ENSURE_LENGTH(16);
9884 rtps_util_store_type_mapping(pinfo, tvb, offset, type_mapping_object,
9885 NULL, TOPIC_INFO_ADD_GUID);
9886 rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
9887 hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
9888 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
9889 hf_rtps_param_entity_kind, NULL);
9890 break;
9893 /* 0...2...........7...............15.............23...............31
9894 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9895 * | PID_DATA_REPRESENTATION | length |
9896 * +---------------+---------------+---------------+---------------+
9897 * | uint32 SequenceSize |
9898 * +---------------+---------------+---------------+---------------+
9899 * | int16 DataRepresentationId[0] | int16 DataRepresentationId[1] |
9900 * +---------------+-------------------------------+---------------+
9901 * | ... | int16 DataRepresentationId[N] |
9902 * +---------------+---------------+---------------+---------------+
9903 * | uint32_t Compression_id (Optional) |
9904 * +---------------+---------------+---------------+---------------+
9905 * compression_iD flags:
9906 * ZLIB: 0001b
9907 * BZIP: 0010b
9908 * LZ4: 0100b
9911 case PID_DATA_REPRESENTATION: {
9912 proto_tree *data_representation_seq_subtree;
9913 proto_item *item;
9914 unsigned value;
9915 unsigned item_offset;
9916 unsigned seq_size;
9917 unsigned counter = 0;
9918 unsigned initial_offset = offset;
9919 unsigned compression_id_offset = 0;
9921 seq_size = tvb_get_uint32(tvb, offset, encoding);
9922 data_representation_seq_subtree = proto_tree_add_subtree_format(rtps_parameter_tree, tvb, offset,
9923 param_length, ett_rtps_data_representation, &item, "Data Representation Sequence[%d]", seq_size);
9924 item_offset = offset + 4;
9925 for (; counter < seq_size; ++counter) {
9926 value = tvb_get_uint16(tvb, item_offset, encoding);
9927 proto_tree_add_uint_format(data_representation_seq_subtree, hf_rtps_param_data_representation,
9928 tvb, item_offset, 2, value, "[%d]: %s (0x%X)", counter,
9929 val_to_str(value, data_representation_kind_vals, "Unknown data representation value: %u"),
9930 value);
9931 item_offset += 2;
9933 compression_id_offset = item_offset;
9934 ALIGN_ME(compression_id_offset, 4);
9935 if (compression_id_offset - initial_offset >= 4) {
9936 proto_tree_add_bitmask(
9937 rtps_parameter_tree,
9938 tvb,
9939 compression_id_offset,
9940 hf_rtps_param_compression_id_mask,
9941 ett_rtps_flags,
9942 COMPRESSION_ID_MASK_FLAGS,
9943 encoding);
9945 break;
9947 /* This parameter PID serializes a sequence number like the existing PID_COHERENT_SET */
9948 /* 0...2...........7...............15.............23...............31
9949 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9950 * | PID_GROUP_COHERENT_SET | length |
9951 * +---------------+---------------+---------------+---------------+
9952 * | |
9953 * + SequenceNumber seqNumber +
9954 * | |
9955 * +---------------+---------------+---------------+---------------+
9957 case PID_GROUP_COHERENT_SET: {
9958 uint64_t hi = (uint64_t)tvb_get_uint32(tvb, offset, encoding);
9959 uint64_t lo = (uint64_t)tvb_get_uint32(tvb, offset + 4, encoding);
9960 uint64_t all = (hi << 32) | lo;
9962 proto_tree_add_uint64(
9963 rtps_parameter_tree,
9964 hf_rtps_param_group_coherent_set,
9965 tvb, offset,
9966 sizeof(uint64_t),
9967 all);
9968 break;
9970 /* This parameter serializes a sequence number like the existing PID_COHERENT_SET
9971 * and only applies to an end coherent set sample.
9973 /* 0...2...........7...............15.............23...............31
9974 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9975 * | PID_END_GROUP_COHERENT_SET | length |
9976 * +---------------+---------------+---------------+---------------+
9977 * | |
9978 * + SequenceNumber seqNumber +
9979 * | |
9980 * +---------------+---------------+---------------+---------------+
9982 case PID_END_GROUP_COHERENT_SET: {
9983 uint64_t hi = (uint64_t)tvb_get_uint32(tvb, offset, encoding);
9984 uint64_t lo = (uint64_t)tvb_get_uint32(tvb, offset + 4, encoding);
9985 uint64_t all = (hi << 32) | lo;
9987 proto_tree_add_uint64(
9988 rtps_parameter_tree,
9989 hf_rtps_param_end_group_coherent_set,
9990 tvb, offset,
9991 sizeof(uint64_t),
9992 all);
9993 break;
9995 /* This parameter serializes a SN like the existing PID_COHERENT_SET and
9996 * only applies to an end coherent set sample.
9997 * Since there are different ways to finish a coherent set it is necessary
9998 * to store information about the available coherent sets. this PID requires
9999 * set the corrresponding coherence set as "is_set".
10001 /* 0...2...........7...............15.............23...............31
10002 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10003 * | PID_END_COHERENT_SET | length |
10004 * +---------------+---------------+---------------+---------------+
10005 * | |
10006 * + SequenceNumber seqNumber +
10007 * | |
10008 * +---------------+---------------+---------------+---------------+
10010 case PID_END_COHERENT_SET: {
10012 coherent_set_key coherent_set_info_key;
10013 uint64_t coherent_seq_number = 0;
10014 coherent_set_entity_info *register_entry = NULL;
10015 coherent_set_info *coherent_set_info_entry;
10017 coherent_seq_number = rtps_util_add_seq_number(
10018 rtps_parameter_tree,
10019 tvb,
10020 offset,
10021 encoding,
10022 "coherenceSetSequenceNumber");
10023 ti = proto_tree_add_uint64(
10024 rtps_parameter_tree,
10025 hf_rtps_coherent_set_end,
10026 tvb,
10029 coherent_seq_number);
10030 proto_item_set_generated(ti);
10031 /* Need to finish the stored coherence set */
10032 if (coherent_set_entity_info_object != NULL) {
10033 register_entry = (coherent_set_entity_info*)wmem_map_lookup(
10034 coherent_set_tracking.entities_using_map,
10035 &coherent_set_entity_info_object->guid);
10036 if (register_entry) {
10037 register_entry->coherent_set_seq_number = coherent_seq_number;
10038 memset(&coherent_set_info_key, 0, sizeof(coherent_set_info_key));
10039 coherent_set_info_key.guid = register_entry->guid;
10040 coherent_set_info_key.coherent_set_seq_number = register_entry->coherent_set_seq_number;
10041 coherent_set_info_entry = (coherent_set_info*)wmem_map_lookup(
10042 coherent_set_tracking.coherent_set_registry_map,
10043 &coherent_set_info_key);
10044 if (coherent_set_info_entry) {
10045 /* The coherence set is completely set up */
10046 coherent_set_info_entry->is_set = true;
10047 /* Updating by last time the writer_seq_number */
10048 coherent_set_info_entry->writer_seq_number = coherent_set_entity_info_object->writer_seq_number;
10052 break;
10054 /* This parameter serializes a long (4-byte integer) and only applies to an end coherent set sample */
10055 /* 0...2...........7...............15.............23...............31
10056 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10057 * | MIG..._SET_SAMPLE_COUNT | length |
10058 * +---------------+---------------+---------------+---------------+
10059 * + sampleCount +
10060 * +---------------+---------------+---------------+---------------+
10062 case MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT: {
10063 uint32_t sample_count = tvb_get_uint32(tvb, offset, encoding);
10065 proto_tree_add_uint(
10066 rtps_parameter_tree,
10067 hf_rtps_param_mig_end_coherent_set_sample_count,
10068 tvb, offset,
10069 sizeof(uint32_t),
10070 sample_count);
10071 break;
10074 /* 0...2...........7...............15.............23...............31
10075 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10076 * | PID_DEFAULT_MULTICAST_LOCATOR | 0x0018 |
10077 * +---------------+---------------+---------------+---------------+
10078 * | long kind |
10079 * +---------------+---------------+---------------+---------------+
10080 * | long port |
10081 * +---------------+---------------+---------------+---------------+
10082 * | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
10083 * +---------------+---------------+---------------+---------------+
10084 * | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
10085 * +---------------+---------------+---------------+---------------+
10086 * | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
10087 * +---------------+---------------+---------------+---------------+
10088 * | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
10089 * +---------------+---------------+---------------+---------------+
10091 case PID_DEFAULT_MULTICAST_LOCATOR: {
10092 ENSURE_LENGTH(24);
10093 rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb, offset, encoding, "locator");
10094 break;
10097 default:
10098 return false;
10099 } /* End of switch(parameter) */
10101 return true;
10103 #undef ENSURE_LENGTH
10105 static int dissect_parameter_sequence(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
10106 int offset, const unsigned encoding, unsigned size, const char *label,
10107 uint16_t version, uint32_t *pStatusInfo, uint16_t vendor_id,
10108 bool is_inline_qos, coherent_set_entity_info *coherent_set_entity_info_object) {
10110 proto_item *ti, *param_item, *param_len_item = NULL;
10111 proto_tree *rtps_parameter_sequence_tree, *rtps_parameter_tree;
10112 uint32_t parameter, param_length, param_length_length = 2;
10113 int original_offset = offset, initial_offset = offset;
10114 type_mapping * type_mapping_object = NULL;
10115 const char * param_name = NULL;
10116 if (!pinfo->fd->visited) {
10118 * At minimum, type_mapping_object->fields_visited must be
10119 * initialized to 0, because we haven't visited any fields
10120 * yet. The routines that visit fields just set individual
10121 * bits in type_mapping_object->fields_visited; they don't
10122 * initialize it.
10124 type_mapping_object = wmem_new(wmem_file_scope(), type_mapping);
10125 type_mapping_object->fields_visited = 0;
10126 type_mapping_object->guid.fields_present = 0;
10129 rtps_parameter_sequence_tree = proto_tree_add_subtree_format(tree, tvb, offset, size,
10130 ett_rtps_parameter_sequence, &ti, "%s:", label);
10132 /* Loop through all the parameters defined until PID_SENTINEL is found */
10133 for (;;) {
10134 size -= offset - original_offset;
10135 if (size < 4) {
10136 expert_add_info_format(pinfo, (param_len_item == NULL) ? ti : param_len_item,
10137 &ei_rtps_parameter_value_invalid, "ERROR: not enough bytes to read the next parameter");
10138 return offset + size;
10140 original_offset = offset;
10142 /* Reads parameter and create the sub tree. At this point we don't know
10143 * the final string that will identify the node or its length. It will
10144 * be set later...
10146 parameter = tvb_get_uint16(tvb, offset, encoding);
10147 param_length = tvb_get_uint16(tvb, offset+2, encoding);
10148 if ((parameter & PID_EXTENDED) == PID_EXTENDED) {
10149 offset += 4;
10150 /* get extended member id and length */
10151 parameter = tvb_get_uint32(tvb, offset, encoding);
10152 param_length = tvb_get_uint32(tvb, offset+4, encoding);
10153 param_length_length = 4;
10155 if (version < 0x0200) {
10156 rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1,
10157 ett_rtps_parameter, &param_item, val_to_str(parameter, parameter_id_vals, "Unknown (0x%04x)"));
10159 proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id, tvb, offset, 2, parameter);
10160 } else {
10161 bool goto_default = true;
10162 switch(vendor_id) {
10163 case RTPS_VENDOR_RTI_DDS:
10164 case RTPS_VENDOR_RTI_DDS_MICRO: {
10165 if (is_inline_qos) {
10166 param_name = try_val_to_str(parameter, parameter_id_inline_qos_rti);
10167 if (param_name != NULL) {
10168 rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1,
10169 ett_rtps_parameter, &param_item, val_to_str(parameter, parameter_id_inline_qos_rti, "Unknown (0x%04x)"));
10170 proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_inline_rti, tvb, offset,
10171 param_length_length, parameter);
10172 goto_default = false;
10174 } else {
10175 param_name = try_val_to_str(parameter, parameter_id_rti_vals);
10176 if (param_name != NULL) {
10177 rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1,
10178 ett_rtps_parameter, &param_item, val_to_str(parameter, parameter_id_rti_vals, "Unknown (0x%04x)"));
10179 proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_rti, tvb, offset,
10180 param_length_length, parameter);
10181 goto_default = false;
10184 break;
10186 case RTPS_VENDOR_TOC: {
10187 param_name = try_val_to_str(parameter, parameter_id_toc_vals);
10188 if (param_name != NULL) {
10189 rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1,
10190 ett_rtps_parameter, &param_item, val_to_str(parameter, parameter_id_toc_vals, "Unknown (0x%04x)"));
10192 proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_toc, tvb, offset,
10193 param_length_length, parameter);
10194 goto_default = false;
10196 break;
10198 case RTPS_VENDOR_ADL_DDS: {
10199 param_name = try_val_to_str(parameter, parameter_id_adl_vals);
10200 if (param_name != NULL) {
10201 rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1,
10202 ett_rtps_parameter, &param_item, val_to_str(parameter, parameter_id_adl_vals, "Unknown (0x%04x)"));
10204 proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_adl, tvb, offset,
10205 param_length_length, parameter);
10206 goto_default = false;
10208 break;
10211 if (goto_default) {
10212 rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1,
10213 ett_rtps_parameter, &param_item, val_to_str(parameter, parameter_id_v2_vals, "Unknown (0x%04x)"));
10214 proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_v2, tvb, offset,
10215 param_length_length, parameter);
10219 /* after param_id */
10220 offset += param_length_length;
10222 if (parameter == PID_SENTINEL) {
10223 /* PID_SENTINEL closes the parameter list, (length is ignored) */
10224 proto_item_set_len(param_item, 4);
10225 offset += 2;
10226 proto_item_set_len(rtps_parameter_sequence_tree, offset - initial_offset);
10227 return offset;
10230 /* parameter length */
10231 param_len_item = proto_tree_add_item(rtps_parameter_tree, hf_rtps_parameter_length,
10232 tvb, offset, param_length_length, encoding);
10233 offset += param_length_length;
10235 /* Make sure we have enough bytes for the param value */
10236 if ((size-4 < param_length) &&
10237 (parameter != PID_SENTINEL)) {
10238 expert_add_info_format(pinfo, param_len_item, &ei_rtps_parameter_value_invalid, "Not enough bytes to read the parameter value");
10239 return offset + size;
10242 /* Sets the end of this item (now we know it!) */
10243 proto_item_set_len(param_item, param_length+2*param_length_length);
10245 /* This way, we can include vendor specific dissections without modifying the main ones */
10247 if (!dissect_parameter_sequence_v1(rtps_parameter_tree, pinfo, tvb, param_item, param_len_item,
10248 offset, encoding, size, param_length, parameter, version, type_mapping_object, coherent_set_entity_info_object)) {
10249 if ((version < 0x0200) ||
10250 !dissect_parameter_sequence_v2(rtps_parameter_tree, pinfo, tvb, param_item, param_len_item,
10251 offset, encoding, param_length, parameter,
10252 pStatusInfo, vendor_id, type_mapping_object, coherent_set_entity_info_object)) {
10253 if (param_length > 0) {
10254 proto_tree_add_item(rtps_parameter_tree, hf_rtps_parameter_data, tvb,
10255 offset, param_length, ENC_NA);
10260 switch (vendor_id) {
10261 case RTPS_VENDOR_RTI_DDS:
10262 case RTPS_VENDOR_RTI_DDS_MICRO: {
10263 dissect_parameter_sequence_rti_dds(rtps_parameter_tree, pinfo, tvb,
10264 param_item, param_len_item, offset, encoding, param_length, parameter, type_mapping_object, is_inline_qos, vendor_id);
10265 break;
10267 case RTPS_VENDOR_TOC: {
10268 dissect_parameter_sequence_toc(rtps_parameter_tree, pinfo, tvb,
10269 param_item, param_len_item, offset, encoding, param_length, parameter);
10270 break;
10272 case RTPS_VENDOR_ADL_DDS: {
10273 dissect_parameter_sequence_adl(rtps_parameter_tree, pinfo, tvb,
10274 param_item, param_len_item, offset, encoding, param_length, parameter);
10275 break;
10277 default:
10278 break;
10281 rtps_util_insert_type_mapping_in_registry(pinfo, type_mapping_object);
10282 offset += param_length;
10284 return offset;
10287 static bool rtps_is_ping(tvbuff_t *tvb, packet_info *pinfo, int offset)
10289 bool is_ping = false;
10291 if (!tvb_strneql(tvb, offset, "NDDSPING", 8))
10292 is_ping = true;
10294 if (is_ping)
10295 col_set_str(pinfo->cinfo, COL_INFO, "PING");
10297 return is_ping;
10300 /* *********************************************************************** */
10301 /* * A P P_ A C K_ C O N F * */
10302 /* *********************************************************************** */
10303 static void dissect_APP_ACK_CONF(tvbuff_t *tvb,
10304 packet_info *pinfo _U_,
10305 int offset,
10306 uint8_t flags,
10307 const unsigned encoding,
10308 int octets_to_next_header,
10309 proto_tree *tree,
10310 proto_item *item,
10311 endpoint_guid * guid)
10314 * 0...2...........7...............15.............23...............31
10315 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10316 * | APP_ACK_CONF |X|X|X|X|X|X|X|E| octetsToNextHeader |
10317 * +---------------+---------------+---------------+---------------+
10318 * | EntityId readerEntityId |
10319 * +---------------+---------------+---------------+---------------+
10320 * | EntityId writerEntityId |
10321 * +---------------+---------------+---------------+---------------+
10322 * + unsigned long virtualWriterCount +
10323 * +---------------+---------------+---------------+---------------+
10324 * | GuidPrefix virtualWriterGuidPrefix |
10325 * +---------------+---------------+---------------+---------------+
10326 * EntityId virtualWriterObjectId
10328 * (after last interval) unsigned long virtualWriterEpoch
10331 int original_offset; /* Offset to the readerEntityId */
10332 int32_t virtual_writer_count;
10333 uint32_t wid;
10334 proto_item *octet_item;
10335 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, APP_ACK_CONF_FLAGS, flags);
10337 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding);
10338 offset += 4;
10339 original_offset = offset;
10341 if (octets_to_next_header < 20) {
10342 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", 20);
10343 return;
10346 /* readerEntityId */
10347 rtps_util_add_entity_id(tree,
10348 tvb,
10349 offset,
10350 hf_rtps_sm_rdentity_id,
10351 hf_rtps_sm_rdentity_id_key,
10352 hf_rtps_sm_rdentity_id_kind,
10353 ett_rtps_rdentity,
10354 "readerEntityId",
10355 NULL);
10356 offset += 4;
10358 /* writerEntityId */
10359 rtps_util_add_entity_id(tree,
10360 tvb,
10361 offset,
10362 hf_rtps_sm_wrentity_id,
10363 hf_rtps_sm_wrentity_id_key,
10364 hf_rtps_sm_wrentity_id_kind,
10365 ett_rtps_wrentity,
10366 "writerEntityId",
10367 &wid);
10368 offset += 4;
10369 guid->entity_id = wid;
10370 guid->fields_present |= GUID_HAS_ENTITY_ID;
10371 rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
10373 /* virtualWriterCount */
10374 proto_tree_add_item_ret_uint(tree, hf_rtps_param_app_ack_conf_virtual_writer_count, tvb, offset, 4,
10375 encoding, &virtual_writer_count);
10376 offset += 4;
10379 /* Deserialize Virtual Writers */
10380 proto_tree *sil_tree_writer_list;
10381 proto_tree *sil_tree_writer;
10383 int32_t current_writer_index = 0;
10385 /** Writer list **/
10387 sil_tree_writer_list = proto_tree_add_subtree_format(tree, tvb, offset, -1,
10388 ett_rtps_app_ack_virtual_writer_list, NULL, "Virtual Writer List");
10390 current_writer_index = 0;
10392 while (current_writer_index < virtual_writer_count) {
10393 sil_tree_writer = proto_tree_add_subtree_format(sil_tree_writer_list, tvb, offset, -1,
10394 ett_rtps_app_ack_virtual_writer, NULL, "virtualWriter[%d]", current_writer_index);
10396 /* Virtual Writer Guid */
10397 rtps_util_add_guid_prefix_v2(sil_tree_writer, tvb, offset,
10398 hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id, hf_rtps_sm_app_id,
10399 hf_rtps_sm_instance_id, 0);
10401 rtps_util_add_entity_id(sil_tree_writer, tvb, offset+12,
10402 hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind,
10403 ett_rtps_entity, "virtualGUIDSuffix", NULL);
10405 offset += 16;
10407 /* Counter */
10408 proto_tree_add_item(tree, hf_rtps_param_app_ack_conf_count, tvb, offset, 4, encoding);
10409 offset += 4;
10411 current_writer_index++;
10413 } /* virtual_writer_count */
10417 if (offset < original_offset + octets_to_next_header)
10419 /* In this case there must be something wrong in the bitmap: there
10420 * are some extra bytes that we don't know how to decode
10422 expert_add_info_format(pinfo, item, &ei_rtps_extra_bytes, "Don't know how to decode those extra bytes: %d", octets_to_next_header - offset);
10424 else if (offset > original_offset + octets_to_next_header)
10426 /* Decoding the bitmap went over the end of this submessage.
10427 * Enter an item in the protocol tree that spans over the entire
10428 * submessage.
10430 expert_add_info(pinfo, item, &ei_rtps_missing_bytes);
10434 static void dissect_parameterized_serialized_data(proto_tree *tree, tvbuff_t *tvb,
10435 int offset_input, int size, const unsigned encoding)
10437 uint32_t member_id, member_length;
10438 proto_item * ti;
10439 proto_tree * data_tree, * member_tree;
10440 int offset = offset_input;
10441 int deserialized_size = 0;
10442 data_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1,
10443 ett_rtps_serialized_data, &ti, "serializedData");
10444 while (deserialized_size < size) {
10445 ALIGN_ZERO(offset, 2, offset_input);
10446 member_id = tvb_get_uint16(tvb, offset, encoding);
10447 member_length = tvb_get_uint16(tvb, offset+2, encoding);
10449 if ((member_id & PID_EXTENDED) == PID_EXTENDED) {
10450 member_id = tvb_get_uint32(tvb, offset+4, encoding);
10451 member_length = tvb_get_uint32(tvb, offset+8, encoding);
10452 member_tree = proto_tree_add_subtree_format(data_tree, tvb, offset, member_length + 12,
10453 ett_rtps_data_member, NULL, "Member (id = %u, len = %u)", member_id, member_length);
10454 proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member_id_ext, tvb, offset+4, 4, encoding);
10455 proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member_length_ext, tvb, offset+8, 4, encoding);
10456 offset += 12;
10457 deserialized_size += 12;
10458 } else if ((member_id & PID_LIST_END) == PID_LIST_END){
10459 /* If this is the end of the list, don't add a tree.
10460 * If we add more logic here in the future, take into account that
10461 * offset is incremented by 4 */
10462 deserialized_size += 4;
10463 break;
10464 } else {
10465 member_tree = proto_tree_add_subtree_format(data_tree, tvb, offset, member_length + 4,
10466 ett_rtps_data_member, NULL, "Member (id = %u, len = %u)", member_id, member_length);
10467 proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member_id, tvb, offset, 2, encoding);
10468 proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member_length, tvb, offset+2, 2, encoding);
10469 offset += 4;
10470 deserialized_size += 4;
10473 proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member, tvb, offset,
10474 member_length, encoding);
10475 offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
10476 deserialized_size += member_length;
10478 proto_item_set_len(ti, deserialized_size);
10481 /************************************************************************ */
10482 /* Encapsulated data * */
10483 /* ********************************************************************** */
10485 * Note: the encapsulation header is ALWAYS big endian, then the encapsulation
10486 * type specified the type of endianness of the payload.
10487 * 0...2...........8...............16..............24..............32
10488 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10489 *| representation_identifier | X X X X X X X X X X X | C C C P P |
10490 *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10491 *~ ~
10492 * ~... Bytes of data representation using a format that ... ~
10493 * ~... depends on the RepresentationIdentifier and options ... ~
10494 * ~ ~
10495 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10497 * X = Unused options bits
10498 * C = Compression bits
10499 * P = Padding bits
10501 * If compressed:
10502 * 0...2...........8...............16..............24..............32
10503 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10504 * | representation_identifier | X X X X X X X X X X X | C C C P P |
10505 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10506 * ~ Uncompressed Length ~
10507 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10508 * ~ *Extended Compression Options ~
10509 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10510 * ~ Compressed User Data ... ~
10511 * ~ ~
10512 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10514 * C = 0b111 would be extended compression options which would come in as an
10515 * additional header before the payload.
10516 * C = 0b000 to indicate no compression
10518 * This options field would be used for future enhancements.For example,
10519 * could be used to define a custom compressor plugin for matching purposes.
10522 /* Dissects the encapsultaion header and uncompress the serialized
10523 * data if is is compressed and it is compressed in using Zlib.
10525 * @param[in] tree
10526 * @param[in] packet info.
10527 * @param[in] tvb
10528 * @param[in] offset offset at the beginning of the encapsulation id.
10529 * @param[in] size in bytes from the initial offset to the end of the serialized data
10530 * @param[in] uncompress_if_compressed true for uncompressing if the data should be uncompressed.
10531 * @param[out] encapsulation_id_out If not null it will contain the encapsultaion_id
10532 * @param[out] compression_option_out If not null it will contain the compression option
10533 * @param[out] padding_bytes_out If not null it will contain the padding bytes
10534 * @param[out] extended_compression_options_out If not null it will contain the extended compression options
10535 * @param[out] extended_header_bits_out If not null it will contain the extended header bits
10536 * @param[out] is_compressed_out If not null it will indicate if the serielized data is compressed
10537 * @param[out] uncompressed_ok_out If not null it will indicate if the serizlized data has been successfully uncompressed
10538 * @param[out] uncompressed_tvb_out If not null it will contain the uncompressed tvb pointer. If the seriaized data is not uncompressed it will return NULL.
10539 * @param[out] compressed_data_tree_out If not null it will contain the subtree of the uncompressed data.
10541 * @return the offset after the at the beginining of the serialized data
10542 * @note All output parameters are optional.
10544 static
10545 int rtps_prepare_encapsulated_data(
10546 proto_tree *tree,
10547 packet_info *pinfo,
10548 tvbuff_t *tvb,
10549 int offset,
10550 int size,
10551 bool uncompress_if_compressed,
10552 uint16_t *encapsulation_id_out,
10553 uint8_t *compression_option_out,
10554 uint8_t *padding_bytes_out,
10555 uint32_t *extended_compression_options_out,
10556 uint8_t *extended_header_bits_out,
10557 bool *is_compressed_out,
10558 bool *uncompressed_ok_out,
10559 tvbuff_t **uncompressed_tvb_out,
10560 proto_tree **compressed_data_tree_out) {
10561 int initial_offset = offset;
10562 int16_t encapsulation_options = 0;
10563 uint32_t compressed_size = 0;
10564 uint32_t uncompressed_size = 0;
10565 uint16_t encapsulation_id = 0;
10566 uint8_t compression_option = 0;
10567 uint8_t padding_bytes = 0;
10568 uint32_t extended_compression_options = 0;
10569 uint8_t extended_header_bits = 0;
10570 bool is_compressed = 0;
10571 bool uncompressed_ok = 0;
10572 tvbuff_t *uncompressed_tvb = NULL;
10574 /* This logic applies to data that is not a fragment (-1) or is the first fragment */
10575 /* Encapsulation ID */
10576 encapsulation_id = tvb_get_ntohs(tvb, offset); /* Always big endian */
10577 proto_tree_add_uint(tree,
10578 hf_rtps_param_serialize_encap_kind, tvb, offset, 2, encapsulation_id);
10579 offset += 2;
10581 offset = rtps_util_dissect_encapsulation_options(
10582 tree,
10583 tvb,
10584 offset,
10585 &encapsulation_options,
10586 &compression_option,
10587 &padding_bytes,
10588 &extended_header_bits);
10589 /* If compressed on a supported format we have to uncompress it on a new tvb
10590 * and reset the offset */
10591 is_compressed = (encapsulation_options & ENCAPSULATION_OPTIONS_COMPRESSION_BYTES_MASK) != 0;
10592 if (is_compressed) {
10593 uncompressed_size = tvb_get_int32(tvb, offset, ENC_BIG_ENDIAN);
10594 proto_tree_add_item(
10595 tree,
10596 hf_rtps_uncompressed_serialized_length,
10597 tvb,
10598 offset,
10600 ENC_BIG_ENDIAN);
10601 offset += 4;
10602 /* Get the compression extended options if required */
10603 if (extended_header_bits == ENCAPSULATION_OPTIONS_COMPRESSION_EXTENDED_HEADER_VALUE) {
10604 extended_compression_options = tvb_get_int32(tvb, offset, ENC_BIG_ENDIAN);
10605 proto_tree_add_item(
10606 tree,
10607 hf_rtps_encapsulation_extended_compression_options,
10608 tvb,
10609 offset,
10611 ENC_BIG_ENDIAN);
10612 offset += 4;
10614 /* Get the compressed size. Padding bytes are the padding at the end of the compressed data */
10615 compressed_size = size - (offset - initial_offset) - padding_bytes;
10618 /* Only decompress if it is compressed with ZLIB */
10619 if (uncompress_if_compressed && (compression_option == RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB)) {
10620 bool tried_to_uncompress = false;
10621 proto_item *uncompressed_data_item = NULL;
10623 /* Try to uncompress the data */
10624 uncompressed_tvb = rtps_util_get_uncompressed_tvb_zlib(
10625 tvb,
10626 offset,
10627 compressed_size,
10628 &tried_to_uncompress);
10629 /* The uncompressed data size must be the same as it is in the "Uncompressed Length" field */
10630 uncompressed_ok = (uncompressed_tvb != NULL
10631 && (uncompressed_size == (uint32_t)tvb_reported_length(uncompressed_tvb)));
10633 /* If uncompression went well we have a new tvb that holds the uncompressed data */
10634 if (tried_to_uncompress) {
10635 tvbuff_t *child_tvb = NULL;
10636 int child_size = 0;
10637 int child_offset = 0;
10639 /* If the tvb is not uncompressed we add use the ovb, offset and size
10640 * of the original tvb */
10641 if (uncompressed_tvb != NULL) {
10642 child_tvb = uncompressed_tvb;
10643 child_size = -1;
10644 child_offset = 0;
10645 } else {
10646 child_tvb = tvb;
10647 child_size = compressed_size;
10648 child_offset = offset;
10650 /* Uncompressed sample hangs from a different subtree */
10651 *compressed_data_tree_out = proto_tree_add_subtree(
10652 tree,
10653 child_tvb,
10654 child_offset,
10655 child_size,
10656 ett_rtps_decompressed_serialized_data,
10657 &uncompressed_data_item,
10658 "[Decompressed data]");
10659 /* If we tried to decompress we need to add hf_rtps_uncompression_ok set to true or false*/
10660 if (!(uncompressed_ok)) {
10661 expert_add_info_format(
10662 pinfo,
10663 uncompressed_data_item,
10664 &ei_rtps_uncompression_error,
10665 "Error: unable to uncompress payload");
10670 /* Set the optional output parameters */
10671 if (encapsulation_id_out != NULL) {
10672 *encapsulation_id_out = encapsulation_id;
10674 if (compression_option_out != NULL) {
10675 *compression_option_out = compression_option;
10677 if (padding_bytes_out != NULL) {
10678 *padding_bytes_out = padding_bytes;
10680 if (extended_compression_options_out != NULL) {
10681 *extended_compression_options_out = extended_compression_options;
10683 if (extended_header_bits_out != NULL) {
10684 *extended_header_bits_out = extended_header_bits;
10686 if (is_compressed_out != NULL) {
10687 *is_compressed_out = is_compressed;
10689 if (uncompressed_ok_out != NULL) {
10690 *uncompressed_ok_out = uncompressed_ok;
10692 if (uncompressed_tvb_out != NULL) {
10693 *uncompressed_tvb_out = uncompressed_tvb;
10695 return offset;
10700 /* *********************************************************************** */
10701 /* * Serialized data dissector * */
10702 /* *********************************************************************** */
10703 /* Note: the encapsulation header is ALWAYS big endian, then the encapsulation
10704 * type specified the type of endianness of the payload.
10706 * Fragmentation : Options only appear on first fragment
10707 * Serieaized data might be compressed or uncompressed. Depending on that the
10708 * header contains more elements. This is indicated in the encapsulation
10709 * options where:
10711 * X = Unused options bits
10712 * C = Compression bits
10713 * P = Padding bits
10715 * 0...2...........8...............16..............24..............32
10716 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10717 * | representation_identifier |X X X X X X X X X X X|C C C P P|
10718 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10719 * ~ ~
10720 * ~ ... Bytes of data representation using a format that ... ~
10721 * ~ ... depends on the RepresentationIdentifier and options ... ~
10722 * ~ ~
10723 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10725 * If compressed:
10727 * 0...2...........8...............16..............24..............32
10728 * + -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10729 * | representation_identifier | X X X X X X X X X X X | C C C P P |
10730 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10731 * ~ Uncompressed Length ~
10732 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10733 * ~ *Extended Compression Options ~
10734 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10735 * ~ Compressed User Data ... ~
10736 * ~ ~
10737 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10739 * C = 0b111 would be extended compression options which would come in as an
10740 * additional header before the payload.
10741 * C = 0b000 to indicate no compression
10743 * *This options field would be used for future enhancements.For example,
10744 * could be used to define a custom compressor plugin for matching purposes.
10748 static void dissect_serialized_data(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset,
10749 int size, const char *label, uint16_t vendor_id, bool is_discovery_data,
10750 endpoint_guid * guid, int32_t frag_number /* -1 if no fragmentation */) {
10751 proto_item *ti;
10752 proto_tree *rtps_parameter_sequence_tree;
10753 uint16_t encapsulation_id;
10754 bool try_dissection_from_type_object = false;
10755 unsigned encapsulation_encoding = ENC_BIG_ENDIAN;
10756 rtps_dissector_data * data = wmem_new(pinfo->pool, rtps_dissector_data);
10757 tvbuff_t *data_holder_tvb = tvb;
10758 tvbuff_t *compressed_tvb = NULL;
10759 proto_tree *dissected_data_holder_tree = NULL;
10760 bool is_compressed = false;
10761 bool uncompressed_ok = false;
10762 proto_tree *compressed_subtree = NULL;
10764 data->encapsulation_id = 0;
10765 data->position_in_batch = -1;
10766 /* Creates the sub-tree */
10767 rtps_parameter_sequence_tree = proto_tree_add_subtree(tree, tvb, offset, size,
10768 ett_rtps_serialized_data, &ti, label);
10770 /* We store this value for using later */
10771 dissected_data_holder_tree = rtps_parameter_sequence_tree;
10773 if (frag_number > 1) {
10774 /* if the data is a fragment and not the first fragment, simply dissect the
10775 content as raw bytes */
10776 proto_tree_add_item(rtps_parameter_sequence_tree, hf_rtps_issue_data, tvb,
10777 offset, size, ENC_NA);
10778 } else {
10779 /* Dissects the encapsulation header options and uncompress the tvb if it is
10780 * compressed and can be uncompressed */
10781 offset = rtps_prepare_encapsulated_data(
10782 rtps_parameter_sequence_tree,
10783 pinfo,
10784 tvb,
10785 offset,
10786 size,
10787 true,
10788 &encapsulation_id,
10789 NULL,
10790 NULL,
10791 NULL,
10792 NULL,
10793 &is_compressed,
10794 &uncompressed_ok,
10795 &compressed_tvb,
10796 &compressed_subtree);
10797 data->encapsulation_id = encapsulation_id;
10798 if (is_compressed && uncompressed_ok) {
10799 data_holder_tvb = compressed_tvb;
10800 offset = 0;
10801 dissected_data_holder_tree = compressed_subtree;
10804 /* Sets the correct values for encapsulation_encoding */
10805 encapsulation_encoding = get_encapsulation_endianness(encapsulation_id);
10807 if (encapsulation_id == ENCAPSULATION_CDR_LE ||
10808 encapsulation_id == ENCAPSULATION_CDR_BE ||
10809 encapsulation_id == ENCAPSULATION_CDR2_LE ||
10810 encapsulation_id == ENCAPSULATION_CDR2_BE ||
10811 encapsulation_id == ENCAPSULATION_PL_CDR_LE ||
10812 encapsulation_id == ENCAPSULATION_PL_CDR_BE) {
10813 try_dissection_from_type_object = true;
10816 /* In case it is compressed only try to dissect the type object if it is correctly uncompressed */
10817 try_dissection_from_type_object = try_dissection_from_type_object
10818 && ((is_compressed == uncompressed_ok));
10820 /* At this point:
10821 * - uncompressed_tvb contains the uncompressed tvb or the packet tvb
10822 * - compressed_data_tree points to the tree of the uncompressed data
10823 * or the rtps_parameter_sequence_tree.
10824 * - offset points to 0 of the uncompressed tvb or the offseet of the packet
10825 * tvb if it is not decompressed.
10826 * Only try to dissect the user data if it is not compressed or it is compressed and correctly uncompressed */
10827 if (is_compressed == uncompressed_ok) {
10828 if (rtps_util_try_dissector(dissected_data_holder_tree,
10829 pinfo, data_holder_tvb, offset, guid, data, encapsulation_encoding,
10830 get_encapsulation_version(encapsulation_id), try_dissection_from_type_object)) {
10831 return;
10833 /* The payload */
10834 size -= 4;
10835 switch (encapsulation_id) {
10836 /* CDR_LE and CDR_BE data should be dissected like this if it is a fragment or
10837 if it is not */
10838 case ENCAPSULATION_CDR_LE:
10839 case ENCAPSULATION_CDR_BE:
10840 proto_tree_add_item(dissected_data_holder_tree, hf_rtps_issue_data, data_holder_tvb,
10841 offset, size, ENC_NA);
10842 break;
10844 case ENCAPSULATION_PL_CDR_LE:
10845 case ENCAPSULATION_PL_CDR_BE:
10846 if (is_discovery_data) {
10847 dissect_parameter_sequence(dissected_data_holder_tree, pinfo, data_holder_tvb, offset,
10848 encapsulation_encoding, size, "serializedData", 0x0200, NULL, vendor_id, false, NULL);
10850 else if (frag_number != NOT_A_FRAGMENT) {
10851 /* fragments should be dissected as raw bytes (not parameterized) */
10852 proto_tree_add_item(dissected_data_holder_tree, hf_rtps_issue_data, data_holder_tvb,
10853 offset, size, ENC_NA);
10854 break;
10856 else {
10857 /* Instead of showing a warning like before, we now dissect the data as
10858 * (id - length - value) members */
10859 dissect_parameterized_serialized_data(dissected_data_holder_tree,
10860 data_holder_tvb, offset, size, encapsulation_encoding);
10862 break;
10864 default:
10865 proto_tree_add_item(dissected_data_holder_tree, hf_rtps_data_serialize_data, tvb,
10866 offset, size, ENC_NA);
10872 /* *********************************************************************** */
10873 /* * A P P_ A C K * */
10874 /* *********************************************************************** */
10875 static void dissect_APP_ACK(tvbuff_t *tvb,
10876 packet_info *pinfo,
10877 int offset,
10878 uint8_t flags,
10879 const unsigned encoding,
10880 int octets_to_next_header,
10881 proto_tree *tree,
10882 proto_item *item,
10883 endpoint_guid * guid)
10886 * 0...2...........7...............15.............23...............31
10887 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10888 * | APP_ACK |X|X|X|X|X|X|X|E| octetsToNextHeader |
10889 * +---------------+---------------+---------------+---------------+
10890 * | EntityId readerEntityId |
10891 * +---------------+---------------+---------------+---------------+
10892 * | EntityId writerEntityId |
10893 * +---------------+---------------+---------------+---------------+
10894 * + unsigned long virtualWriterCount +
10895 * +---------------+---------------+---------------+---------------+
10896 * | GuidPrefix virtualWriterGuidPrefix |
10897 * +---------------+---------------+---------------+---------------+
10898 * EntityId virtualWriterObjectId
10899 * unsigned short intervalCount | unsigned short bytesToNextVirtualWriter
10901 * SequenceNumber intervalFirstSn
10902 * SequenceNumber intervalLastSn
10903 * unsigned short intervalFlags | unsigned short payloadLength
10905 * (after last interval) unsigned long virtualWriterEpoch
10908 int original_offset; /* Offset to the readerEntityId */
10909 int32_t virtual_writer_count;
10910 uint32_t wid; /* Writer EntityID */
10911 proto_item *octet_item;
10912 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, APP_ACK_FLAGS, flags);
10914 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
10915 offset + 2, 2, encoding);
10917 if (octets_to_next_header < 56) {
10918 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", 56);
10919 return;
10922 offset += 4;
10923 original_offset = offset;
10925 /* readerEntityId */
10926 rtps_util_add_entity_id(tree,
10927 tvb,
10928 offset,
10929 hf_rtps_sm_rdentity_id,
10930 hf_rtps_sm_rdentity_id_key,
10931 hf_rtps_sm_rdentity_id_kind,
10932 ett_rtps_rdentity,
10933 "readerEntityId",
10934 &wid);
10935 offset += 4;
10936 guid->entity_id = wid;
10937 rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
10939 /* writerEntityId */
10940 rtps_util_add_entity_id(tree,
10941 tvb,
10942 offset,
10943 hf_rtps_sm_wrentity_id,
10944 hf_rtps_sm_wrentity_id_key,
10945 hf_rtps_sm_wrentity_id_kind,
10946 ett_rtps_wrentity,
10947 "writerEntityId",
10948 &wid);
10949 offset += 4;
10951 /* virtualWriterCount */
10952 proto_tree_add_item_ret_int(tree, hf_rtps_param_app_ack_virtual_writer_count, tvb, offset, 4, encoding, &virtual_writer_count);
10953 offset += 4;
10957 /* Deserialize Virtual Writers */
10958 proto_tree *sil_tree_writer_list;
10960 int32_t current_writer_index;
10961 int32_t current_interval_count;
10962 /* uint16_t interval_flags = 0; */
10963 /* uint32_t current_virtual_guid_index = 0;*/
10965 /** Writer list **/
10966 sil_tree_writer_list = proto_tree_add_subtree_format(tree, tvb, offset, -1,
10967 ett_rtps_app_ack_virtual_writer_list, NULL, "Virtual Writer List");
10969 current_writer_index = 0;
10971 while (current_writer_index < virtual_writer_count) {
10972 proto_tree *sil_tree_writer;
10973 proto_tree *sil_tree_interval_list;
10974 int32_t interval_count;
10976 sil_tree_writer = proto_tree_add_subtree_format(sil_tree_writer_list, tvb, offset, -1,
10977 ett_rtps_app_ack_virtual_writer, NULL, "virtualWriter[%d]", current_writer_index);
10979 /* Virtual Writer Guid */
10980 #if 0
10981 rtps_util_add_generic_guid(sil_tree_writer,
10982 tvb,
10983 offset,
10984 "virtualGUID",
10985 buffer,
10986 MAX_GUID_SIZE);
10987 #endif
10988 offset += 16;
10991 /* Interval count */
10992 proto_tree_add_item_ret_int(sil_tree_writer, hf_rtps_param_app_ack_interval_count,
10993 tvb, offset, 2, encoding, &interval_count);
10994 offset += 2;
10996 /* bytes to next virtual writer */
10997 proto_tree_add_item(sil_tree_writer, hf_rtps_param_app_ack_octets_to_next_virtual_writer,
10998 tvb, offset, 2, encoding);
10999 offset += 2;
11001 /* Interval list */
11002 sil_tree_interval_list = proto_tree_add_subtree_format(sil_tree_writer, tvb, offset, -1,
11003 ett_rtps_app_ack_virtual_writer_interval_list, NULL, "Interval List");
11005 current_interval_count = 0;
11006 while (current_interval_count < interval_count) {
11007 proto_tree *sil_tree_interval;
11008 int32_t interval_payload_length;
11010 sil_tree_interval = proto_tree_add_subtree_format(sil_tree_interval_list, tvb, offset, -1,
11011 ett_rtps_app_ack_virtual_writer_interval, NULL, "Interval[%d]", current_interval_count);
11013 /* firstVirtualSN */
11014 rtps_util_add_seq_number(sil_tree_interval,
11015 tvb,
11016 offset,
11017 encoding,
11018 "firstVirtualSN");
11019 offset += 8;
11021 /* lastVirtualSN */
11022 rtps_util_add_seq_number(sil_tree_interval,
11023 tvb,
11024 offset,
11025 encoding,
11026 "lastVirtualSN");
11027 offset += 8;
11029 /* interval flags */
11030 proto_tree_add_item(sil_tree_interval, hf_rtps_param_app_ack_interval_flags,
11031 tvb, offset, 2, encoding);
11032 offset += 2;
11034 /* interval payload length */
11035 proto_tree_add_item_ret_int(sil_tree_interval, hf_rtps_param_app_ack_interval_payload_length,
11036 tvb, offset, 2, encoding, &interval_payload_length);
11037 offset += 2;
11039 if (interval_payload_length > 0) {
11040 proto_tree_add_item(sil_tree_interval, hf_rtps_serialized_data, tvb, offset,
11041 interval_payload_length, ENC_NA);
11042 offset += ((interval_payload_length + 3) & 0xfffffffc);
11045 ++current_interval_count;
11047 } /* interval list */
11049 /* Count */
11050 proto_tree_add_item(tree, hf_rtps_param_app_ack_count, tvb, offset, 4, encoding);
11051 offset += 4;
11053 current_writer_index++;
11055 } /* virtual_writer_count */
11059 if (offset < original_offset + octets_to_next_header)
11061 /* In this case there must be something wrong in the bitmap: there
11062 * are some extra bytes that we don't know how to decode
11064 expert_add_info_format(pinfo, item, &ei_rtps_extra_bytes, "Don't know how to decode those extra bytes: %d", octets_to_next_header - offset);
11066 else if (offset > original_offset + octets_to_next_header)
11068 /* Decoding the bitmap went over the end of this submessage.
11069 * Enter an item in the protocol tree that spans over the entire
11070 * submessage.
11072 expert_add_info(pinfo, item, &ei_rtps_missing_bytes);
11076 /* *********************************************************************** */
11077 /* * P A D * */
11078 /* *********************************************************************** */
11079 static void dissect_PAD(tvbuff_t *tvb,
11080 packet_info *pinfo,
11081 int offset,
11082 uint8_t flags,
11083 const unsigned encoding,
11084 int octets_to_next_header,
11085 proto_tree *tree) {
11086 /* 0...2...........7...............15.............23...............31
11087 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
11088 * | PAD |X|X|X|X|X|X|X|E| octetsToNextHeader |
11089 * +---------------+---------------+---------------+---------------+
11091 proto_item *item;
11093 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, PAD_FLAGS, flags);
11095 item = proto_tree_add_item(tree,
11096 hf_rtps_sm_octets_to_next_header,
11097 tvb,
11098 offset + 2,
11100 encoding);
11101 if (octets_to_next_header != 0) {
11102 expert_add_info(pinfo, item, &ei_rtps_sm_octets_to_next_header_not_zero);
11110 /* *********************************************************************** */
11111 /* * D A T A * */
11112 /* *********************************************************************** */
11113 static void dissect_DATA_v1(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
11114 const unsigned encoding, int octets_to_next_header, proto_tree *tree) {
11115 /* RTPS 1.0/1.1:
11116 * 0...2...........7...............15.............23...............31
11117 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
11118 * | DATA |X|X|X|U|H|A|P|E| octetsToNextHeader |
11119 * +---------------+---------------+---------------+---------------+
11120 * | ObjectId readerObjectId |
11121 * +---------------+---------------+---------------+---------------+
11122 * | ObjectId writerObjectId |
11123 * +---------------+---------------+---------------+---------------+
11124 * | HostId hostId (iff H==1) |
11125 * +---------------+---------------+---------------+---------------+
11126 * | AppId appId (iff H==1) |
11127 * +---------------+---------------+---------------+---------------+
11128 * | ObjectId objectId |
11129 * +---------------+---------------+---------------+---------------+
11130 * | |
11131 * + SequenceNumber writerSeqNumber +
11132 * | |
11133 * +---------------+---------------+---------------+---------------+
11134 * | |
11135 * ~ ParameterSequence parameters [only if P==1] ~
11136 * | |
11137 * +---------------+---------------+---------------+---------------+
11138 * Note: on RTPS 1.0, flag U is not present
11140 * RTPS 1.2:
11141 * 0...2...........7...............15.............23...............31
11142 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
11143 * | DATA |X|X|U|Q|H|A|D|E| octetsToNextHeader |
11144 * +---------------+---------------+---------------+---------------+
11145 * | EntityId readerEntityId |
11146 * +---------------+---------------+---------------+---------------+
11147 * | EntityId writerEntityId |
11148 * +---------------+---------------+---------------+---------------+
11149 * | |
11150 * + KeyHashPrefix keyHashPrefix [only if H==1] +
11151 * | |
11152 * +---------------+---------------+---------------+---------------+
11153 * | KeyHashSuffix keyHashSuffix |
11154 * +---------------+---------------+---------------+---------------+
11155 * | |
11156 * + SequenceNumber writerSeqNum +
11157 * | |
11158 * +---------------+---------------+---------------+---------------+
11159 * | |
11160 * ~ ParameterList inlineQos [only if Q==1] ~
11161 * | |
11162 * +---------------+---------------+---------------+---------------+
11163 * | |
11164 * ~ SerializedData serializedData [only if D==1] ~
11165 * | |
11166 * +---------------+---------------+---------------+---------------+
11167 * Notes:
11168 * - inlineQos is NEW
11169 * - serializedData is equivalent to the old 'parameters'
11171 int min_len;
11172 bool is_builtin_entity = false; /* true=entityId.entityKind = built-in */
11173 int old_offset = offset;
11174 uint32_t wid; /* Writer EntityID */
11175 proto_item *octet_item;
11177 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, DATA_FLAGSv1, flags);
11179 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
11180 offset + 2, 2, encoding);
11182 /* Calculates the minimum length for this submessage */
11183 min_len = 20;
11184 if ((flags & FLAG_DATA_H) != 0) min_len += 8;
11185 if ((flags & FLAG_DATA_Q) != 0) min_len += 4;
11186 if ((flags & FLAG_DATA_D) != 0) min_len += 4;
11188 if (octets_to_next_header < min_len) {
11189 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
11190 return;
11193 offset += 4;
11195 /* readerEntityId */
11196 is_builtin_entity |= rtps_util_add_entity_id(tree, tvb, offset,
11197 hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind,
11198 ett_rtps_rdentity, "readerEntityId", NULL);
11199 offset += 4;
11201 /* writerEntityId */
11202 is_builtin_entity |= rtps_util_add_entity_id(tree, tvb, offset,
11203 hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind,
11204 ett_rtps_wrentity, "writerEntityId", &wid);
11205 offset += 4;
11207 /* Checks for predefined declarations
11209 * writerEntityId value | A flag | Extra
11210 * -------------------------------------------|--------|-------------
11211 * ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER | 1 | r+
11212 * ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER | 0 | r-
11213 * ENTITYID_BUILTIN_PUBLICATIONS_WRITER | 1 | w+
11214 * ENTITYID_BUILTIN_PUBLICATIONS_WRITER | 0 | w-
11215 * ENTITYID_BUILTIN_PARTICIPANT_WRITER | 1 | p+
11216 * ENTITYID_BUILTIN_PARTICIPANT_WRITER | 0 | p- (*)
11217 * ENTITYID_BUILTIN_TOPIC_WRITER | 1 | t+ (*)
11218 * ENTITYID_BUILTIN_TOPIC_WRITER | 0 | t- (*)
11220 * Note (*): Currently NDDS does not publish those values
11222 if (wid == ENTITYID_BUILTIN_PUBLICATIONS_WRITER && (flags & FLAG_DATA_A) != 0) {
11223 col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_WPLUS);
11224 } else if (wid == ENTITYID_BUILTIN_PUBLICATIONS_WRITER && (flags & FLAG_DATA_A) == 0) {
11225 col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_WMINUS);
11226 } else if (wid == ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER && (flags & FLAG_DATA_A) != 0) {
11227 col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_RPLUS);
11228 } else if (wid == ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER && (flags & FLAG_DATA_A) == 0) {
11229 col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_RMINUS);
11230 } else if (wid == ENTITYID_BUILTIN_PARTICIPANT_WRITER && (flags & FLAG_DATA_A) != 0) {
11231 col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_PPLUS);
11232 } else if (wid == ENTITYID_BUILTIN_PARTICIPANT_WRITER && (flags & FLAG_DATA_A) == 0) {
11233 col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_PMINUS);
11234 } else if (wid == ENTITYID_BUILTIN_TOPIC_WRITER && (flags & FLAG_DATA_A) != 0) {
11235 col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_TPLUS);
11236 } else if (wid == ENTITYID_BUILTIN_TOPIC_WRITER && (flags & FLAG_DATA_A) == 0) {
11237 col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_TMINUS);
11240 /* If flag H is defined, read the HostId and AppId fields */
11241 if ((flags & FLAG_DATA_H) != 0) {
11242 rtps_util_add_guid_prefix_v1(tree, tvb, offset,
11243 hf_rtps_sm_guid_prefix_v1, hf_rtps_sm_host_id, hf_rtps_sm_app_id,
11244 hf_rtps_sm_instance_id_v1, hf_rtps_sm_app_kind,
11245 "keyHashPrefix");
11247 offset += 8;
11248 } else {
11249 /* Flag H not set, use hostId, appId from the packet header */
11252 /* Complete the GUID by reading the Object ID */
11253 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key,
11254 hf_rtps_sm_entity_id_kind, ett_rtps_entity, "keyHashSuffix", NULL);
11255 offset += 4;
11257 /* Sequence number */
11258 rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber");
11259 offset += 8;
11261 /* InlineQos */
11262 if ((flags & FLAG_DATA_Q) != 0) {
11263 bool is_inline_qos = true;
11264 offset = dissect_parameter_sequence(tree, pinfo, tvb, offset,
11265 encoding, octets_to_next_header, "inlineQos",
11266 0x0102, NULL, 0, is_inline_qos, NULL);
11269 /* SerializedData */
11270 if ((flags & FLAG_DATA_D) != 0) {
11271 if (is_builtin_entity) {
11272 dissect_parameter_sequence(tree, pinfo, tvb, offset,
11273 encoding, octets_to_next_header, "serializedData",
11274 0x0102, NULL, 0, false, NULL);
11275 } else {
11276 proto_tree_add_item(tree, hf_rtps_issue_data, tvb, offset,
11277 octets_to_next_header - (offset - old_offset) + 4,
11278 ENC_NA);
11283 static void dissect_DATA_v2(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
11284 const unsigned encoding, int octets_to_next_header, proto_tree *tree,
11285 uint16_t vendor_id, endpoint_guid *guid) {
11288 * 0...2...........7...............15.............23...............31
11289 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
11290 * | DATA |X|X|X|I|H|D|Q|E| octetsToNextHeader |
11291 * +---------------+---------------+---------------+---------------+
11292 * | EntityId readerEntityId |
11293 * +---------------+---------------+---------------+---------------+
11294 * | EntityId writerEntityId |
11295 * +---------------+---------------+---------------+---------------+
11296 * | |
11297 * + SequenceNumber writerSeqNum +
11298 * | |
11299 * +---------------+---------------+---------------+---------------+
11300 * | |
11301 * + +
11302 * | KeyHashPrefix keyHashPrefix [only if H==1] |
11303 * + +
11304 * | |
11305 * +---------------+---------------+---------------+---------------+
11306 * | KeyHashSuffix keyHashSuffix |
11307 * +---------------+---------------+---------------+---------------+
11308 * | StatusInfo statusInfo [only if I==1] |
11309 * +---------------+---------------+---------------+---------------+
11310 * | |
11311 * ~ ParameterList inlineQos [only if Q==1] ~
11312 * | |
11313 * +---------------+---------------+---------------+---------------+
11314 * | |
11315 * ~ SerializedData serializedData [only if D==1] ~
11316 * | |
11317 * +---------------+---------------+---------------+---------------+
11319 int min_len;
11320 int old_offset = offset;
11321 uint32_t wid; /* Writer EntityID */
11322 uint32_t status_info = 0xffffffff;
11323 proto_item *octet_item;
11324 bool from_builtin_writer;
11326 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, DATA_FLAGSv2, flags);
11328 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
11329 offset + 2, 2, encoding);
11331 /* Calculates the minimum length for this submessage */
11332 min_len = 20;
11333 if ((flags & FLAG_DATA_Q_v2) != 0) min_len += 4;
11334 if ((flags & FLAG_DATA_D_v2) != 0) min_len += 4;
11335 if ((flags & FLAG_DATA_H) != 0) min_len += 12;
11337 if (octets_to_next_header < min_len) {
11338 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
11339 return;
11342 offset += 4;
11345 /* readerEntityId */
11346 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
11347 hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
11348 offset += 4;
11350 /* writerEntityId */
11351 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
11352 hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
11353 offset += 4;
11354 guid->entity_id = wid;
11355 guid->fields_present |= GUID_HAS_ENTITY_ID;
11356 rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
11358 /* Sequence number */
11359 rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber");
11360 offset += 8;
11362 /* If flag H is defined, read the GUID Prefix */
11363 if ((flags & FLAG_DATA_H) != 0) {
11364 rtps_util_add_guid_prefix_v2(tree, tvb, offset, hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id,
11365 hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0);
11367 offset += 12;
11368 } else {
11369 /* Flag H not set, use hostId, appId from the packet header */
11372 /* Complete the GUID by reading the Object ID */
11373 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key,
11374 hf_rtps_sm_entity_id_kind, ett_rtps_entity, "keyHashSuffix", NULL);
11375 offset += 4;
11377 if ((flags & FLAG_DATA_I) != 0) {
11378 proto_tree_add_item(tree, hf_rtps_data_status_info, tvb, offset, 4, encoding);
11379 offset += 4;
11382 /* InlineQos */
11383 if ((flags & FLAG_DATA_Q_v2) != 0) {
11384 bool is_inline_qos = true;
11385 offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding,
11386 octets_to_next_header - (offset - old_offset) + 4,
11387 "inlineQos", 0x0200, NULL, vendor_id, is_inline_qos, NULL);
11390 /* SerializedData */
11391 if ((flags & FLAG_DATA_D_v2) != 0) {
11392 from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY)
11393 || ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY)
11394 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER)
11395 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER))
11396 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER)
11397 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? true : false;
11398 dissect_serialized_data(tree, pinfo, tvb, offset,
11399 octets_to_next_header - (offset - old_offset) + 4,
11400 "serializedData", vendor_id, from_builtin_writer, guid, NOT_A_FRAGMENT);
11402 generate_status_info(pinfo, wid, status_info);
11406 static void dissect_HEADER_EXTENSION(tvbuff_t* tvb, packet_info* pinfo, int offset, uint8_t flags,
11407 const unsigned encoding, proto_tree* tree, int octets_to_next_header, uint16_t vendor_id) {
11409 * 0...2...........7...............15.............23...............31
11410 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
11411 * | DATA_HE |P|C|C|W|U|T|L|E| octetsToNextHeader |
11412 * +---------------+---------------+---------------+---------------+
11413 * | MessageLength messageLength (Only if L == 1 ) |
11414 * +---------------+---------------+---------------+---------------+
11415 * | |
11416 * + TimeStamp rtpsSendTimestamp (Only if T == 1 ) +
11417 * | |
11418 * +---------------+---------------+---------------+---------------+
11419 * | UExtension4 uExtension (Only if U == 1 ) |
11420 * +---------------+---------------+---------------+---------------+
11421 * | |
11422 * + WExtension8 wExtension8 (Only if W == 1 ) +
11423 * | |
11424 * +---------------+---------------+---------------+---------------+
11425 * | |
11426 * + Checksum messageChecksum (Only if CC != 00 ) +
11427 * | |
11428 * +---------------+---------------+---------------+---------------+
11429 * | |
11430 * + ParameterList parameters (Only if P != 0 ) +
11431 * | |
11432 * +---------------+---------------+---------------+---------------+
11433 * C1,C2 == 01 -> 4 bytes checksum
11434 * C1,C2 == 10 -> 8 bytes checksum
11435 * C1,C2 == 11 -> 16 bytes checksum
11437 #define RTPS_HE_ENDIANESS_FLAG (0x01)
11438 #define RTPS_HE_MESSAGE_LENGTH_FLAG (0x02)
11439 #define RTPS_HE_TIMESTAMP_FLAG (0x04)
11440 #define RTPS_HE_UEXTENSION_FLAG (0x08)
11441 #define RTPS_HE_WEXTENSION_FLAG (0x10)
11442 #define RTPS_HE_CHECKSUM_2_FLAG (0x20)
11443 #define RTPS_HE_CHECKSUM_1_FLAG (0x40)
11444 #define RTPS_HE_PARAMETERS_FLAG (0x80)
11446 #define RTPS_HE_CHECKSUM_CRC32 RTPS_HE_CHECKSUM_2_FLAG
11447 #define RTPS_HE_CHECKSUM_CRC64 RTPS_HE_CHECKSUM_1_FLAG
11448 #define RTPS_HE_CHECKSUM_MD5 (RTPS_HE_CHECKSUM_1_FLAG | RTPS_HE_CHECKSUM_2_FLAG)
11450 uint8_t checksum_type = 0;
11451 int initial_offset = offset;
11452 unsigned checksum_flags = PROTO_CHECKSUM_NO_FLAGS;
11453 bool is_crc_supported = true;
11454 /*Checksum can be CRC32, CRC64 and MD5 */
11455 union _calculated_checksum {
11456 uint8_t md5[RTPS_CHECKSUM_MAX_LEN];
11457 uint32_t crc32c;
11458 uint64_t crc64;
11459 } calculated_checksum = {0}, he_checksum = {0};
11461 ++offset;
11462 proto_tree_add_bitmask_value(
11463 tree,
11464 tvb,
11465 offset,
11466 hf_rtps_header_extension_flags,
11467 ett_rtps_flags,
11468 HEADER_EXTENSION_MASK_FLAGS,
11469 flags);
11470 ++offset;
11471 proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset, 2, encoding);
11472 offset += 2;
11473 if ((flags & RTPS_HE_MESSAGE_LENGTH_FLAG) == RTPS_HE_MESSAGE_LENGTH_FLAG) {
11474 proto_tree_add_item(tree, hf_rtps_message_length, tvb, offset, 4, encoding);
11475 offset += 4;
11477 if ((flags & RTPS_HE_TIMESTAMP_FLAG) == RTPS_HE_TIMESTAMP_FLAG) {
11478 rtps_util_add_timestamp(tree,
11479 tvb, offset,
11480 encoding,
11481 hf_rtps_timestamp);
11482 offset += 8;
11484 if ((flags & RTPS_HE_UEXTENSION_FLAG) == RTPS_HE_UEXTENSION_FLAG) {
11485 proto_tree_add_item(tree, hf_rtps_uextension, tvb, offset, 4, encoding);
11486 offset += 4;
11488 if ((flags & RTPS_HE_WEXTENSION_FLAG) == RTPS_HE_WEXTENSION_FLAG) {
11489 proto_tree_add_item(tree, hf_rtps_wextension, tvb, offset, 8, encoding);
11490 offset += 8;
11492 checksum_type = (flags & (RTPS_HE_CHECKSUM_2_FLAG | RTPS_HE_CHECKSUM_1_FLAG));
11493 if (checksum_type != 0) {
11494 int checksum_len = 0;
11496 /* Adds the CRC of the RTPS message */
11497 switch (checksum_type) {
11498 /* 32-bit checksum */
11499 case RTPS_HE_CHECKSUM_CRC32:
11500 checksum_len = 4;
11501 break;
11503 /* 64-bit checksum */
11504 case RTPS_HE_CHECKSUM_CRC64:
11505 checksum_len = 8;
11506 is_crc_supported = false;
11507 break;
11509 /* 128-bit checksum */
11510 case RTPS_HE_CHECKSUM_MD5:
11511 checksum_len = 16;
11512 break;
11513 default:
11514 break;
11517 /* If the check CRC feature is enabled */
11518 if (enable_rtps_crc_check && is_crc_supported) {
11519 char* tvb_zero_checksum = NULL;
11520 rtps_tvb_field *rtps_root = NULL;
11522 checksum_flags = PROTO_CHECKSUM_VERIFY;
11523 rtps_root = (rtps_tvb_field*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_ROOT_MESSAGE_KEY);
11524 if (rtps_root != NULL) {
11525 /* The checksum in the wire is the checksum of the RTPS message with the
11526 * checksum field set to 0. To calculate the checksum of the RTPS message
11527 * we need to set those bytes to 0 in a separate buffer.
11529 tvb_zero_checksum = wmem_alloc0_array(pinfo->pool, char, rtps_root->tvb_len);
11530 tvb_memcpy(
11531 rtps_root->tvb,
11532 tvb_zero_checksum,
11533 rtps_root->tvb_offset,
11534 rtps_root->tvb_len);
11536 /* Set checksum bytes to 0 */
11537 memset(tvb_zero_checksum + offset, 0, checksum_len);
11538 switch (checksum_type) {
11539 case RTPS_HE_CHECKSUM_CRC32:
11540 /* Checksum is always big endian */
11541 he_checksum.crc32c = tvb_get_uint32(tvb, offset, ENC_BIG_ENDIAN);
11542 calculated_checksum.crc32c = crc32c_calculate_no_swap(
11543 tvb_zero_checksum,
11544 rtps_root->tvb_len,
11545 CRC32C_PRELOAD);
11546 calculated_checksum.crc32c ^= CRC32C_PRELOAD;
11547 break;
11549 case RTPS_HE_CHECKSUM_CRC64:
11550 /* CRC64 is not supported yet */
11551 break;
11553 case RTPS_HE_CHECKSUM_MD5:
11554 tvb_memcpy(
11555 tvb,
11556 &he_checksum.md5,
11557 offset,
11558 checksum_len);
11559 gcry_md_hash_buffer(
11560 GCRY_MD_MD5,
11561 calculated_checksum.md5,
11562 tvb_zero_checksum,
11563 rtps_root->tvb_len);
11564 break;
11566 default:
11567 break;
11571 switch (checksum_type) {
11572 case RTPS_HE_CHECKSUM_CRC32:
11573 proto_tree_add_checksum(
11574 tree,
11575 tvb,
11576 offset,
11577 hf_rtps_header_extension_checksum_crc32c,
11579 &ei_rtps_checksum_check_error,
11580 pinfo,
11581 calculated_checksum.crc32c,
11582 ENC_BIG_ENDIAN,
11583 checksum_flags);
11584 break;
11585 case RTPS_HE_CHECKSUM_MD5:
11586 proto_tree_add_checksum_bytes(
11587 tree,
11588 tvb,
11589 offset,
11590 hf_rtps_header_extension_checksum_md5,
11592 &ei_rtps_checksum_check_error,
11593 pinfo,
11594 calculated_checksum.md5,
11595 checksum_len,
11596 checksum_flags);
11597 break;
11599 case RTPS_HE_CHECKSUM_CRC64:
11600 default:
11601 break;
11603 offset += checksum_len;
11605 if ((flags & RTPS_HE_PARAMETERS_FLAG) == RTPS_HE_PARAMETERS_FLAG) {
11606 unsigned parameter_endianess = ((flags & RTPS_HE_ENDIANESS_FLAG) == RTPS_HE_ENDIANESS_FLAG)
11607 ? ENC_LITTLE_ENDIAN
11608 : ENC_BIG_ENDIAN;
11609 dissect_parameter_sequence(tree, pinfo, tvb, offset, parameter_endianess,
11610 octets_to_next_header - (offset - initial_offset),
11611 "Parameters", 0x0200, NULL, vendor_id, false, NULL);
11615 static void dissect_DATA_FRAG(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
11616 const unsigned encoding, int octets_to_next_header, proto_tree *tree,
11617 uint16_t vendor_id, endpoint_guid *guid) {
11619 * 0...2...........7...............15.............23...............31
11620 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
11621 * | DATA_FRAG |X|X|X|X|X|H|Q|E| octetsToNextHeader |
11622 * +---------------+---------------+---------------+---------------+
11623 * | EntityId readerEntityId |
11624 * +---------------+---------------+---------------+---------------+
11625 * | EntityId writerEntityId |
11626 * +---------------+---------------+---------------+---------------+
11627 * | |
11628 * + SequenceNumber writerSeqNum +
11629 * | |
11630 * +---------------+---------------+---------------+---------------+
11631 * | |
11632 * + +
11633 * | KeyHashPrefix keyHashPrefix [only if H==1] |
11634 * + +
11635 * | |
11636 * +---------------+---------------+---------------+---------------+
11637 * | KeyHashSuffix keyHashSuffix |
11638 * +---------------+---------------+---------------+---------------+
11639 * | FragmentNumber fragmentStartingNum |
11640 * +---------------+---------------+---------------+---------------+
11641 * | ushort fragmentsInSubmessage | ushort fragmentSize |
11642 * +---------------+---------------+---------------+---------------+
11643 * | unsigned long sampleSize |
11644 * +---------------+---------------+---------------+---------------+
11645 * | |
11646 * ~ ParameterList inlineQos [only if Q==1] ~
11647 * | |
11648 * +---------------+---------------+---------------+---------------+
11649 * | |
11650 * ~ SerializedData serializedData ~
11651 * | |
11652 * +---------------+---------------+---------------+---------------+
11655 int min_len;
11656 int old_offset = offset;
11657 uint32_t frag_number = 0;
11658 proto_item *octet_item;
11659 uint32_t wid;
11660 bool from_builtin_writer;
11662 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, DATA_FRAG_FLAGS, flags);
11664 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
11665 offset + 2, 2, encoding);
11667 /* Calculates the minimum length for this submessage */
11668 min_len = 32;
11669 if ((flags & FLAG_DATA_FRAG_Q) != 0) min_len += 4;
11670 if ((flags & FLAG_DATA_FRAG_H) != 0) min_len += 12;
11672 if (octets_to_next_header < min_len) {
11673 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
11674 return;
11677 offset += 4;
11679 /* readerEntityId */
11680 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
11681 hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
11682 offset += 4;
11684 /* writerEntityId */
11685 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
11686 hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
11687 offset += 4;
11688 guid->entity_id = wid;
11689 guid->fields_present |= GUID_HAS_ENTITY_ID;
11690 rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
11692 /* Sequence number */
11693 rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber");
11694 offset += 8;
11696 /* If flag H is defined, read the GUID Prefix */
11697 if ((flags & FLAG_DATA_H) != 0) {
11698 rtps_util_add_guid_prefix_v2(tree, tvb, offset, hf_rtps_sm_guid_prefix,
11699 hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0);
11700 offset += 12;
11701 } else {
11702 /* Flag H not set, use hostId, appId from the packet header */
11705 /* Complete the GUID by reading the Object ID */
11706 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key,
11707 hf_rtps_sm_entity_id_kind, ett_rtps_entity, "keyHashSuffix", NULL);
11708 offset += 4;
11711 /* Fragment number */
11712 proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_number, tvb, offset, 4, encoding, &frag_number);
11713 offset += 4;
11715 /* Fragments in submessage */
11716 proto_tree_add_item(tree, hf_rtps_data_frag_num_fragments, tvb, offset, 2, encoding);
11717 offset += 2;
11719 /* Fragment size */
11720 proto_tree_add_item(tree, hf_rtps_data_frag_size, tvb, offset, 2, encoding);
11721 offset += 2;
11723 /* sampleSize */
11724 proto_tree_add_item(tree, hf_rtps_data_frag_sample_size, tvb, offset, 4, encoding);
11725 offset += 4;
11727 /* InlineQos */
11728 if ((flags & FLAG_DATA_Q_v2) != 0) {
11729 bool is_inline_qos = true;
11730 offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding,
11731 octets_to_next_header - (offset - old_offset) + 4,
11732 "inlineQos", 0x0200, NULL, vendor_id, is_inline_qos, NULL);
11735 /* SerializedData */
11736 if ((flags & FLAG_DATA_D_v2) != 0) {
11737 from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY)
11738 || ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY)
11739 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER)
11740 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER))
11741 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER)
11742 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? true : false;
11743 dissect_serialized_data(tree, pinfo, tvb, offset,
11744 octets_to_next_header - (offset - old_offset) + 4,
11745 "serializedData", vendor_id, from_builtin_writer, NULL, (int32_t)frag_number);
11750 /* *********************************************************************** */
11751 /* * N O K E Y _ D A T A * */
11752 /* *********************************************************************** */
11753 static void dissect_NOKEY_DATA(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
11754 const unsigned encoding, int octets_to_next_header, proto_tree *tree,
11755 uint16_t version, uint16_t vendor_id) {
11756 /* RTPS 1.0/1.1:
11757 * 0...2...........7...............15.............23...............31
11758 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
11759 * | ISSUE |X|X|X|X|X|X|P|E| octetsToNextHeader |
11760 * +---------------+---------------+---------------+---------------+
11761 * | ObjectId readerObjectId |
11762 * +---------------+---------------+---------------+---------------+
11763 * | ObjectId writerObjectId |
11764 * +---------------+---------------+---------------+---------------+
11765 * | |
11766 * + SequenceNumber writerSeqNumber +
11767 * | |
11768 * +---------------+---------------+---------------+---------------+
11769 * | |
11770 * ~ ParameterSequence parameters [only if P==1] ~
11771 * | |
11772 * +---------------+---------------+---------------+---------------+
11773 * | |
11774 * ~ UserData issueData ~
11775 * | |
11776 * +---------------+---------------+---------------+---------------+
11778 * RTPS 1.2:
11779 * 0...2...........7...............15.............23...............31
11780 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
11781 * | NOKEY_DATA |X|X|X|X|X|D|Q|E| octetsToNextHeader |
11782 * +---------------+---------------+---------------+---------------+
11783 * | EntityId readerEntityId |
11784 * +---------------+---------------+---------------+---------------+
11785 * | EntityId writerEntityId |
11786 * +---------------+---------------+---------------+---------------+
11787 * | |
11788 * + SequenceNumber writerSeqNum +
11789 * | |
11790 * +---------------+---------------+---------------+---------------+
11791 * | |
11792 * ~ ParameterList inlineQos [only if Q==1] ~
11793 * | |
11794 * +---------------+---------------+---------------+---------------+
11795 * | |
11796 * ~ SerializedData serializedData [only if D==0] ~
11797 * | |
11798 * +---------------+---------------+---------------+---------------+
11800 * RTPS 2.0:
11801 * 0...2...........7...............15.............23...............31
11802 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
11803 * | NOKEY_DATA |X|X|X|X|X|D|Q|E| octetsToNextHeader |
11804 * +---------------+---------------+---------------+---------------+
11805 * | EntityId readerEntityId |
11806 * +---------------+---------------+---------------+---------------+
11807 * | EntityId writerEntityId |
11808 * +---------------+---------------+---------------+---------------+
11809 * | |
11810 * + SequenceNumber writerSeqNum +
11811 * | |
11812 * +---------------+---------------+---------------+---------------+
11813 * | |
11814 * ~ ParameterList inlineQos [only if Q==1] ~
11815 * | |
11816 * +---------------+---------------+---------------+---------------+
11817 * | |
11818 * ~ SerializedData serializedData [only if D==1] ~
11819 * | |
11820 * +---------------+---------------+---------------+---------------+
11821 * Notes:
11822 * - inlineQos is equivalent to the old 'parameters'
11823 * - serializedData is equivalent to the old 'issueData'
11826 int min_len;
11827 uint32_t wid; /* Writer EntityID */
11828 bool from_builtin_writer;
11829 int old_offset = offset;
11830 proto_item *octet_item;
11832 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, NOKEY_DATA_FLAGS, flags);
11834 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
11835 offset + 2, 2, encoding);
11837 /* Calculates the minimum length for this submessage */
11838 min_len = 16;
11839 if ((flags & FLAG_NOKEY_DATA_Q) != 0) min_len += 4;
11841 if (octets_to_next_header < min_len) {
11842 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
11843 return;
11846 offset += 4;
11848 /* readerEntityId */
11849 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
11850 hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
11851 offset += 4;
11853 /* writerEntityId */
11854 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
11855 hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
11856 offset += 4;
11858 /* Sequence number */
11859 rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber");
11860 offset += 8;
11862 /* Parameters */
11863 if ((flags & FLAG_NOKEY_DATA_Q) != 0) {
11864 bool is_inline_qos = true;
11865 offset = dissect_parameter_sequence(tree, pinfo, tvb, offset,
11866 encoding, octets_to_next_header, "inlineQos",
11867 version, NULL, vendor_id, is_inline_qos, NULL);
11871 /* Issue Data */
11872 if ((version < 0x0200) && (flags & FLAG_NOKEY_DATA_D) == 0) {
11873 proto_tree_add_item(tree, hf_rtps_issue_data, tvb, offset,
11874 octets_to_next_header - (offset - old_offset) + 4,
11875 ENC_NA);
11878 if ((version >= 0x0200) && (flags & FLAG_DATA_D_v2) != 0) {
11879 from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY)
11880 || ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY)
11881 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER)
11882 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER))
11883 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER)
11884 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? true : false;
11885 dissect_serialized_data(tree, pinfo, tvb, offset,
11886 octets_to_next_header - (offset - old_offset) + 4,
11887 "serializedData", vendor_id, from_builtin_writer, NULL, NOT_A_FRAGMENT);
11892 /* *********************************************************************** */
11893 /* * N O K E Y _ D A T A _ F R A G * */
11894 /* *********************************************************************** */
11895 static void dissect_NOKEY_DATA_FRAG(tvbuff_t *tvb, packet_info *pinfo, int offset,
11896 uint8_t flags, const unsigned encoding, int octets_to_next_header, proto_tree *tree,
11897 uint16_t vendor_id) {
11899 * 0...2...........7...............15.............23...............31
11900 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
11901 * |NOKEY_DATA_FRAG|X|X|X|X|X|X|Q|E| octetsToNextHeader |
11902 * +---------------+---------------+---------------+---------------+
11903 * | EntityId readerEntityId |
11904 * +---------------+---------------+---------------+---------------+
11905 * | EntityId writerEntityId |
11906 * +---------------+---------------+---------------+---------------+
11907 * | |
11908 * + SequenceNumber writerSeqNum +
11909 * | |
11910 * +---------------+---------------+---------------+---------------+
11911 * | FragmentNumber fragmentStartingNum |
11912 * +---------------+---------------+---------------+---------------+
11913 * | ushort fragmentsInSubmessage | ushort fragmentSize |
11914 * +---------------+---------------+---------------+---------------+
11915 * | unsigned long sampleSize |
11916 * +---------------+---------------+---------------+---------------+
11917 * | |
11918 * ~ ParameterList inlineQos [only if Q==1] ~
11919 * | |
11920 * +---------------+---------------+---------------+---------------+
11921 * | |
11922 * ~ SerializedData serializedData ~
11923 * | |
11924 * +---------------+---------------+---------------+---------------+
11927 int min_len;
11928 uint32_t wid; /* Writer EntityID */
11929 bool from_builtin_writer;
11930 int old_offset = offset;
11931 uint32_t frag_number = 0;
11932 proto_item *octet_item;
11933 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, NOKEY_DATA_FRAG_FLAGS, flags);
11935 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
11936 offset + 2, 2, encoding);
11938 /* Calculates the minimum length for this submessage */
11939 min_len = 28;
11940 if ((flags & FLAG_NOKEY_DATA_Q) != 0) min_len += 4;
11942 if (octets_to_next_header < min_len) {
11943 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
11944 return;
11947 offset += 4;
11949 /* readerEntityId */
11950 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
11951 hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
11952 offset += 4;
11954 /* writerEntityId */
11955 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
11956 hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
11957 offset += 4;
11959 /* Sequence number */
11960 rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber");
11961 offset += 8;
11963 /* Fragment number */
11964 proto_tree_add_item_ret_uint(tree, hf_rtps_nokey_data_frag_number, tvb,
11965 offset, 4, encoding, &frag_number);
11966 offset += 4;
11968 /* Fragments in submessage */
11969 proto_tree_add_item(tree, hf_rtps_nokey_data_frag_num_fragments, tvb,
11970 offset, 2, encoding);
11971 offset += 2;
11973 /* Fragment size */
11974 proto_tree_add_item(tree, hf_rtps_nokey_data_frag_size, tvb,
11975 offset, 2, encoding);
11976 offset += 2;
11978 /* InlineQos */
11979 if ((flags & FLAG_DATA_Q_v2) != 0) {
11980 bool is_inline_qos = true;
11981 offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding,
11982 octets_to_next_header - (offset - old_offset) + 4,
11983 "inlineQos", 0x0200, NULL, vendor_id, is_inline_qos, NULL);
11986 /* SerializedData */
11987 if ((flags & FLAG_DATA_D_v2) != 0) {
11988 from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY)
11989 || ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY)
11990 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER)
11991 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER))
11992 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER)
11993 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? true : false;
11994 dissect_serialized_data(tree, pinfo, tvb,offset,
11995 octets_to_next_header - (offset - old_offset) + 4,
11996 "serializedData", vendor_id, from_builtin_writer, NULL, (int32_t)frag_number);
12000 static void dissect_PING(tvbuff_t* tvb, int offset, const unsigned encoding, int octets_to_next_header, proto_tree* tree) {
12001 proto_tree_add_item(tree, hf_rtps_ping,tvb, offset, octets_to_next_header, encoding);
12004 /* *********************************************************************** */
12005 /* * A C K N A C K * */
12006 /* *********************************************************************** */
12007 static void dissect_ACKNACK(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
12008 const unsigned encoding, int octets_to_next_header, proto_tree *tree,
12009 proto_item *item, endpoint_guid *guid) {
12010 /* RTPS 1.0/1.1:
12011 * 0...2...........7...............15.............23...............31
12012 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
12013 * | ACK |X|X|X|X|X|X|F|E| octetsToNextHeader |
12014 * +---------------+---------------+---------------+---------------+
12015 * | ObjectId readerObjectId |
12016 * +---------------+---------------+---------------+---------------+
12017 * | ObjectId writerObjectId |
12018 * +---------------+---------------+---------------+---------------+
12019 * | |
12020 * + Bitmap bitmap +
12021 * | |
12022 * +---------------+---------------+---------------+---------------+
12023 * | Counter count |
12024 * +---------------+---------------+---------------+---------------+
12026 * RTPS 1.2/2.0:
12027 * 0...2...........7...............15.............23...............31
12028 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
12029 * | ACKNACK |X|X|X|X|X|X|F|E| octetsToNextHeader |
12030 * +---------------+---------------+---------------+---------------+
12031 * | EntityId readerEntityId |
12032 * +---------------+---------------+---------------+---------------+
12033 * | EntityId writerEntityId |
12034 * +---------------+---------------+---------------+---------------+
12035 * | |
12036 * + SequenceNumberSet readerSNState +
12037 * | |
12038 * +---------------+---------------+---------------+---------------+
12039 * | Counter count |
12040 * +---------------+---------------+---------------+---------------+
12042 int original_offset; /* Offset to the readerEntityId */
12043 proto_item *octet_item;
12044 uint32_t wid;
12046 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, ACKNACK_FLAGS, flags);
12047 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding);
12048 if (octets_to_next_header < 20) {
12049 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 20)");
12050 return;
12053 offset += 4;
12054 original_offset = offset;
12056 /* readerEntityId */
12057 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
12058 hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
12059 offset += 4;
12061 /* writerEntityId */
12062 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
12063 hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
12064 offset += 4;
12065 guid->entity_id = wid;
12066 guid->fields_present |= GUID_HAS_ENTITY_ID;
12067 rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
12069 /* Bitmap */
12070 offset = rtps_util_add_bitmap(tree, pinfo, tvb, offset, encoding, "readerSNState", true);
12072 /* RTPS 1.0 didn't have count: make sure we don't decode it wrong
12073 * in this case
12075 if (offset + 4 == original_offset + octets_to_next_header) {
12076 /* Count is present */
12077 proto_tree_add_item(tree, hf_rtps_acknack_count, tvb, offset, 4, encoding);
12078 } else if (offset < original_offset + octets_to_next_header) {
12079 /* In this case there must be something wrong in the bitmap: there
12080 * are some extra bytes that we don't know how to decode
12082 expert_add_info_format(pinfo, item, &ei_rtps_extra_bytes, "Don't know how to decode those extra bytes: %d", octets_to_next_header - offset);
12083 } else if (offset > original_offset + octets_to_next_header) {
12084 /* Decoding the bitmap went over the end of this submessage.
12085 * Enter an item in the protocol tree that spans over the entire
12086 * submessage.
12088 expert_add_info(pinfo, item, &ei_rtps_missing_bytes);
12093 /* *********************************************************************** */
12094 /* * N A C K _ F R A G * */
12095 /* *********************************************************************** */
12096 static void dissect_NACK_FRAG(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
12097 const unsigned encoding, int octets_to_next_header, proto_tree *tree) {
12099 * 0...2...........7...............15.............23...............31
12100 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
12101 * | NACK_FRAG |X|X|X|X|X|X|X|E| octetsToNextHeader |
12102 * +---------------+---------------+---------------+---------------+
12103 * | EntityId readerEntityId |
12104 * +---------------+---------------+---------------+---------------+
12105 * | EntityId writerEntityId |
12106 * +---------------+---------------+---------------+---------------+
12107 * | |
12108 * + SequenceNumberSet writerSN +
12109 * | |
12110 * +---------------+---------------+---------------+---------------+
12111 * | |
12112 * ~ FragmentNumberSet fragmentNumberState +
12113 * | |
12114 * +---------------+---------------+---------------+---------------+
12115 * | Counter count |
12116 * +---------------+---------------+---------------+---------------+
12118 proto_item *octet_item;
12120 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, NACK_FRAG_FLAGS, flags);
12122 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
12123 offset + 2, 2, encoding);
12125 if (octets_to_next_header < 24) {
12126 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 24)");
12127 return;
12130 offset += 4;
12132 /* readerEntityId */
12133 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
12134 hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
12135 offset += 4;
12137 /* writerEntityId */
12138 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
12139 hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", NULL);
12140 offset += 4;
12142 /* Writer sequence number */
12143 rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSN");
12144 offset += 8;
12146 /* FragmentNumberSet */
12147 offset = rtps_util_add_fragment_number_set(tree, pinfo, tvb, offset, encoding,
12148 "fragmentNumberState", octets_to_next_header - 20);
12150 if (offset == -1) {
12151 return;
12153 /* Count */
12154 proto_tree_add_item(tree, hf_rtps_nack_frag_count, tvb, offset, 4, encoding);
12157 /* *********************************************************************** */
12158 /* * H E A R T B E A T * */
12159 /* *********************************************************************** */
12160 static void dissect_HEARTBEAT(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
12161 const unsigned encoding, int octets_to_next_header, proto_tree *tree,
12162 uint16_t version, endpoint_guid *guid) {
12163 /* RTPS 1.0/1.1:
12164 * 0...2...........7...............15.............23...............31
12165 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
12166 * | HEARTBEAT |X|X|X|X|X|L|F|E| octetsToNextHeader |
12167 * +---------------+---------------+---------------+---------------+
12168 * | ObjectId readerObjectId |
12169 * +---------------+---------------+---------------+---------------+
12170 * | ObjectId writerObjectId |
12171 * +---------------+---------------+---------------+---------------+
12172 * | |
12173 * + SequenceNumber firstAvailableSeqNumber +
12174 * | |
12175 * +---------------+---------------+---------------+---------------+
12176 * | |
12177 * + SequenceNumber lastSeqNumber +
12178 * | |
12179 * +---------------+---------------+---------------+---------------+
12180 * | long counter |
12181 * +---------------+---------------+---------------+---------------+
12183 * Notes:
12184 * - on RTPS 1.0, counter is not present
12185 * - on RTPS 1.0, L flag is not present
12187 * RTPS 1.2/2.0:
12188 * 0...2...........7...............15.............23...............31
12189 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
12190 * | HEARTBEAT |X|X|X|X|X|X|F|E| octetsToNextHeader |
12191 * +---------------+---------------+---------------+---------------+
12192 * | EntityId readerEntityId |
12193 * +---------------+---------------+---------------+---------------+
12194 * | EntityId writerEntityId |
12195 * +---------------+---------------+---------------+---------------+
12196 * | |
12197 * + SequenceNumber firstAvailableSeqNumber +
12198 * | |
12199 * +---------------+---------------+---------------+---------------+
12200 * | |
12201 * + SequenceNumber lastSeqNumber +
12202 * | |
12203 * +---------------+---------------+---------------+---------------+
12204 * | Counter count |
12205 * +---------------+---------------+---------------+---------------+
12207 proto_item *octet_item;
12208 uint32_t wid;
12209 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, HEARTBEAT_FLAGS, flags);
12211 octet_item = proto_tree_add_item(tree,
12212 hf_rtps_sm_octets_to_next_header,
12213 tvb,
12214 offset + 2,
12216 encoding);
12218 if ((octets_to_next_header < 24) && (version <= 0x0101)) {
12219 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 24)");
12220 return;
12222 else if (octets_to_next_header < 28) {
12223 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 28)");
12224 return;
12227 offset += 4;
12229 /* readerEntityId */
12230 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
12231 hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
12232 offset += 4;
12234 /* writerEntityId */
12235 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
12236 hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
12237 offset += 4;
12238 guid->entity_id = wid;
12239 guid->fields_present |= GUID_HAS_ENTITY_ID;
12240 rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
12242 /* First available Sequence Number */
12243 rtps_util_add_seq_number(tree, tvb, offset, encoding, "firstAvailableSeqNumber");
12244 offset += 8;
12246 /* Last Sequence Number */
12247 rtps_util_add_seq_number(tree, tvb, offset, encoding, "lastSeqNumber");
12248 offset += 8;
12250 /* Counter: it was not present in RTPS 1.0 */
12251 if (version >= 0x0101) {
12252 proto_tree_add_item(tree, hf_rtps_heartbeat_count, tvb, offset, 4, encoding);
12256 /* *********************************************************************** */
12257 /* * H E A R T B E A T _ B A T C H * */
12258 /* *********************************************************************** */
12259 static void dissect_HEARTBEAT_BATCH(tvbuff_t *tvb, packet_info *pinfo, int offset,
12260 uint8_t flags, const unsigned encoding, int octets_to_next_header,
12261 proto_tree *tree, endpoint_guid *guid) {
12263 * 0...2...........7...............15.............23...............31
12264 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
12265 * |HEARTBEAT_BATCH|X|X|X|X|X|L|F|E| octetsToNextHeader |
12266 * +---------------+---------------+---------------+---------------+
12267 * | EntityId readerId |
12268 * +---------------+---------------+---------------+---------------+
12269 * | EntityId writerId |
12270 * +---------------+---------------+---------------+---------------+
12271 * | |
12272 * + SequenceNumber firstBatchSN +
12273 * | |
12274 * +---------------+---------------+---------------+---------------+
12275 * | |
12276 * + SequenceNumber lastBatchSN +
12277 * | |
12278 * +---------------+---------------+---------------+---------------+
12279 * | |
12280 * + SequenceNumber firstSN +
12281 * | |
12282 * +---------------+---------------+---------------+---------------+
12283 * | |
12284 * + SequenceNumber lastSN +
12285 * | |
12286 * +---------------+---------------+---------------+---------------+
12287 * | Count count |
12288 * +---------------+---------------+---------------+---------------+
12290 proto_item *octet_item;
12291 uint32_t wid;
12292 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, HEARTBEAT_BATCH_FLAGS, flags);
12294 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
12295 offset + 2, 2, encoding);
12297 if (octets_to_next_header < 36) {
12298 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 36)");
12299 return;
12302 /* Skip decoding the entire packet if (tree == NULL) */
12303 if (tree == NULL) {
12304 return;
12307 offset += 4;
12309 /* readerEntityId */
12310 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
12311 hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
12312 offset += 4;
12314 /* writerEntityId */
12315 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
12316 hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
12317 offset += 4;
12318 guid->entity_id = wid;
12319 guid->fields_present |= GUID_HAS_ENTITY_ID;
12320 rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
12322 /* First available Batch Sequence Number */
12323 rtps_util_add_seq_number(tree, tvb, offset, encoding, "firstBatchSN");
12324 offset += 8;
12326 /* Last Batch Sequence Number */
12327 rtps_util_add_seq_number(tree, tvb, offset, encoding, "lastBatchSN");
12328 offset += 8;
12330 /* First available Sequence Number */
12331 rtps_util_add_seq_number(tree, tvb, offset, encoding, "firstSeqNumber");
12332 offset += 8;
12334 /* Last Sequence Number */
12335 rtps_util_add_seq_number(tree, tvb, offset, encoding, "lastSeqNumber");
12336 offset += 8;
12338 /* Counter */
12339 proto_tree_add_item(tree, hf_rtps_heartbeat_batch_count, tvb, offset, 4, encoding);
12342 /* *********************************************************************** */
12343 /* * H E A R T B E A T _ V I R T U A L * */
12344 /* *********************************************************************** */
12346 static void dissect_HEARTBEAT_VIRTUAL(tvbuff_t *tvb, packet_info *pinfo _U_, int offset,
12347 uint8_t flags, const unsigned encoding, int octets_to_next_header, proto_tree *tree,
12348 uint16_t vendor_id _U_, endpoint_guid *guid) {
12351 * VIRTUAL_HB:
12353 * 0...2...........7...............15.............23...............31
12354 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
12355 * | VIRTUAL_HB |X|X|X|X|N|W|V|E| octetsToNextHeader |
12356 * +---------------+---------------+---------------+---------------+
12357 * | EntityId readerId |
12358 * +---------------+---------------+---------------+---------------+
12359 * | EntityId writerId |
12360 * +---------------+---------------+---------------+---------------+
12361 * | Guid_t virtualGUID (V=0 & N=0) |
12362 * + +
12363 * | |
12364 * + +
12365 * | |
12366 * + +
12367 * | |
12368 * +---------------+---------------+---------------+---------------+
12369 * | unsigned long numWriters (W=1) |
12370 * +---------------+---------------+---------------+---------------+
12371 * | |
12372 * ~ WriterVirtualHBList writerVirtualHBList ~
12373 * | |
12374 * +---------------+---------------+---------------+---------------+
12375 * | unsigned long count |
12376 * +---------------+---------------+---------------+---------------+
12378 * WRITER_VIRTUAL_HB:
12380 * 0...2...........7...............15.............23...............31
12381 * +---------------+---------------+---------------+---------------+
12382 * | EntityId writerId (W=1) |
12383 * +---------------+---------------+---------------+---------------+
12384 * | unsigned long numVirtualGUIDs (N=0) |
12385 * +---------------+---------------+---------------+---------------+
12386 * | |
12387 * ~ VirtualGUIDHBList virtualGUIDHBList ~
12388 * | |
12389 * +---------------+---------------+---------------+---------------+
12391 * VIRTUAL_GUID_HB:
12393 * 0...2...........7...............15.............23...............31
12394 * +---------------+---------------+---------------+---------------+
12395 * | Guid_t virtualGUID (V=1) |
12396 * + +
12397 * | |
12398 * + +
12399 * | |
12400 * + +
12401 * | |
12402 * +---------------+---------------+---------------+---------------+
12403 * | |
12404 * + SequenceNumber firstVirtualSN +
12405 * | |
12406 * +---------------+---------------+---------------+---------------+
12407 * | |
12408 * + SequenceNumber lastVirtualSN +
12409 * | |
12410 * +---------------+---------------+---------------+---------------+
12411 * | |
12412 * + SequenceNumber firstRTPSSN +
12413 * | |
12414 * +---------------+---------------+---------------+---------------+
12415 * | |
12416 * + SequenceNumber lastRTPSSN +
12417 * | |
12418 * +---------------+---------------+---------------+---------------+
12421 uint32_t num_writers, num_virtual_guids, wid;
12422 int writer_id_offset, virtual_guid_offset = 0, old_offset;
12423 proto_item *octet_item, *ti;
12425 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, HEARTBEAT_VIRTUAL_FLAGS, flags);
12427 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
12428 offset + 2, 2, encoding);
12430 if (octets_to_next_header < 12) {
12431 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", 12);
12432 return;
12434 offset += 4;
12436 /* readerEntityId */
12437 rtps_util_add_entity_id(tree,
12438 tvb,
12439 offset,
12440 hf_rtps_sm_rdentity_id,
12441 hf_rtps_sm_rdentity_id_key,
12442 hf_rtps_sm_rdentity_id_kind,
12443 ett_rtps_rdentity,
12444 "readerEntityId",
12445 NULL);
12446 offset += 4;
12448 /* writerEntityId */
12449 rtps_util_add_entity_id(tree,
12450 tvb,
12451 offset,
12452 hf_rtps_sm_wrentity_id,
12453 hf_rtps_sm_wrentity_id_key,
12454 hf_rtps_sm_wrentity_id_kind,
12455 ett_rtps_wrentity,
12456 "writerEntityId",
12457 &wid);
12458 writer_id_offset = offset;
12459 offset += 4;
12460 guid->entity_id = wid;
12461 guid->fields_present |= GUID_HAS_ENTITY_ID;
12462 rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
12464 /* virtualGUID */
12465 if (!(flags & FLAG_VIRTUAL_HEARTBEAT_V) && !(flags & FLAG_VIRTUAL_HEARTBEAT_N)) {
12466 /*rtps_util_add_generic_guid(tree,
12467 tvb,
12468 offset,
12469 "virtualGUID",
12470 buffer,
12471 MAX_GUID_SIZE);*/
12472 virtual_guid_offset = offset;
12473 offset += 16;
12476 /* num_writers */
12477 ti = proto_tree_add_item(tree, hf_rtps_virtual_heartbeat_num_writers, tvb,
12478 offset, 4, encoding);
12479 if (flags & FLAG_VIRTUAL_HEARTBEAT_W) {
12480 num_writers = tvb_get_uint32(tvb, offset, encoding);
12481 offset += 4;
12482 } else {
12483 proto_item_set_text(ti, "numWriters: 1");
12484 num_writers = 1;
12488 /* Deserialize Writers */
12489 proto_tree *sil_tree_writer_list;
12490 uint32_t current_writer_index;
12492 /** Writer list **/
12493 sil_tree_writer_list = proto_tree_add_subtree_format(tree, tvb, offset, -1,
12494 ett_rtps_writer_heartbeat_virtual_list, NULL, "Writer List");
12496 current_writer_index = 0;
12498 while (current_writer_index < num_writers) {
12499 proto_tree *sil_tree_writer;
12500 sil_tree_writer = proto_tree_add_subtree_format(sil_tree_writer_list, tvb, offset, -1,
12501 ett_rtps_writer_heartbeat_virtual, NULL, "writer[%d]", current_writer_index);
12503 if (num_writers == 1) {
12504 old_offset = offset;
12505 offset = writer_id_offset;
12508 rtps_util_add_entity_id(sil_tree_writer,
12509 tvb,
12510 offset,
12511 hf_rtps_sm_wrentity_id,
12512 hf_rtps_sm_wrentity_id_key,
12513 hf_rtps_sm_wrentity_id_kind,
12514 ett_rtps_wrentity,
12515 "writerEntityId",
12516 NULL);
12518 if (num_writers == 1) {
12519 offset = old_offset;
12520 } else {
12521 offset += 4;
12524 if (!(flags & FLAG_VIRTUAL_HEARTBEAT_N)) {
12525 proto_tree_add_item(sil_tree_writer, hf_rtps_virtual_heartbeat_num_virtual_guids, tvb,
12526 offset, 4, encoding);
12527 num_virtual_guids = tvb_get_uint32(tvb, offset, encoding);
12528 offset += 4;
12529 } else {
12530 num_virtual_guids = 0;
12533 /** Virtual GUID list **/
12534 if (num_virtual_guids != 0) {
12535 proto_tree *sil_tree_virtual_guid_list;
12536 uint32_t current_virtual_guid_index;
12538 sil_tree_virtual_guid_list = proto_tree_add_subtree_format(sil_tree_writer, tvb, offset, -1,
12539 ett_rtps_virtual_guid_heartbeat_virtual_list, NULL, "Virtual GUID List");
12541 current_virtual_guid_index = 0;
12543 while (current_virtual_guid_index < num_virtual_guids) {
12544 proto_tree *sil_tree_virtual_guid;
12545 sil_tree_virtual_guid = proto_tree_add_subtree_format(sil_tree_virtual_guid_list, tvb, offset, -1,
12546 ett_rtps_virtual_guid_heartbeat_virtual, NULL, "virtualGUID[%d]", current_virtual_guid_index);
12548 if (!(flags & FLAG_VIRTUAL_HEARTBEAT_V)) {
12549 old_offset = offset;
12550 offset = virtual_guid_offset;
12553 /*rtps_util_add_generic_guid_v2(sil_tree_virtual_guid,
12554 tvb,
12555 offset,
12556 "virtualGUID",
12557 buffer,
12558 MAX_GUID_SIZE);*/
12560 if (!(flags & FLAG_VIRTUAL_HEARTBEAT_V)) {
12561 offset = old_offset;
12562 } else {
12563 offset += 16;
12566 /* firstVirtualSN */
12567 rtps_util_add_seq_number(sil_tree_virtual_guid,
12568 tvb,
12569 offset,
12570 encoding,
12571 "firstVirtualSN");
12572 offset += 8;
12574 /* lastVirtualSN */
12575 rtps_util_add_seq_number(sil_tree_virtual_guid,
12576 tvb,
12577 offset,
12578 encoding,
12579 "lastVirtualSN");
12580 offset += 8;
12582 /* firstRTPSSN */
12583 rtps_util_add_seq_number(sil_tree_virtual_guid,
12584 tvb,
12585 offset,
12586 encoding,
12587 "firstRTPSSN");
12588 offset += 8;
12590 /* lastRTPSSN */
12591 rtps_util_add_seq_number(sil_tree_virtual_guid,
12592 tvb,
12593 offset,
12594 encoding,
12595 "lastRTPSSN");
12596 offset += 8;
12598 current_virtual_guid_index++;
12602 current_writer_index++;
12606 /* Count */
12607 proto_tree_add_item(tree, hf_rtps_virtual_heartbeat_count, tvb, offset, 4, encoding);
12611 /* *********************************************************************** */
12612 /* * H E A R T B E A T _ F R A G * */
12613 /* *********************************************************************** */
12614 static void dissect_HEARTBEAT_FRAG(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
12615 const unsigned encoding, int octets_to_next_header, proto_tree *tree, endpoint_guid *guid) {
12617 * 0...2...........7...............15.............23...............31
12618 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
12619 * |HEARTBEAT_FRAG |X|X|X|X|X|X|X|E| octetsToNextHeader |
12620 * +---------------+---------------+---------------+---------------+
12621 * | EntityId readerEntityId |
12622 * +---------------+---------------+---------------+---------------+
12623 * | EntityId writerEntityId |
12624 * +---------------+---------------+---------------+---------------+
12625 * | |
12626 * + SequenceNumber writerSeqNumber +
12627 * | |
12628 * +---------------+---------------+---------------+---------------+
12629 * | FragmentNumber lastFragmentNum |
12630 * +---------------+---------------+---------------+---------------+
12631 * | Counter count |
12632 * +---------------+---------------+---------------+---------------+
12634 proto_item *octet_item;
12635 uint32_t wid;
12636 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, HEARTBEAT_FRAG_FLAGS, flags);
12638 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
12639 offset + 2, 2, encoding);
12641 if (octets_to_next_header < 24) {
12642 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 24)");
12643 return;
12646 /* Skip decoding the entire packet if (tree == NULL) */
12647 if (tree == NULL) {
12648 return;
12651 offset += 4;
12653 /* readerEntityId */
12654 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
12655 hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
12656 offset += 4;
12658 /* writerEntityId */
12659 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
12660 hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
12661 offset += 4;
12662 guid->entity_id = wid;
12663 guid->fields_present |= GUID_HAS_ENTITY_ID;
12664 rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
12666 /* First available Sequence Number */
12667 rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber");
12668 offset += 8;
12670 /* Fragment number */
12671 proto_tree_add_item(tree, hf_rtps_heartbeat_frag_number, tvb, offset, 4, encoding);
12672 offset += 4;
12674 /* Counter */
12675 proto_tree_add_item(tree, hf_rtps_heartbeat_frag_count, tvb, offset, 4, encoding);
12678 /* *********************************************************************** */
12679 /* * R T P S _ D A T A * */
12680 /* * A N D * */
12681 /* * R T P S _ D A T A _ S E S S I O N * */
12682 /* *********************************************************************** */
12683 static void dissect_RTPS_DATA(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
12684 unsigned encoding, int octets_to_next_header, proto_tree *tree,
12685 uint16_t vendor_id, bool is_session, endpoint_guid *guid) {
12688 * 0...2...........7...............15.............23...............31
12689 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
12690 * | RTPS_DATA |X|X|X|X|K|D|Q|E| octetsToNextHeader |
12691 * +---------------+---------------+---------------+---------------+
12692 * | Flags extraFlags | octetsToInlineQos |
12693 * +---------------+---------------+---------------+---------------+
12694 * | EntityId readerEntityId |
12695 * +---------------+---------------+---------------+---------------+
12696 * | EntityId writerEntityId |
12697 * +---------------+---------------+---------------+---------------+
12698 * | |
12699 * + SequenceNumber writerSeqNum +
12700 * | |
12701 * +---------------+---------------+---------------+---------------+
12702 * | |
12703 * ~ ParameterList inlineQos [only if Q==1] ~
12704 * | |
12705 * +---------------+---------------+---------------+---------------+
12706 * | |
12707 * ~ SerializedData serializedData [only if D==1 || K==1] ~
12708 * | |
12709 * +---------------+---------------+---------------+---------------+
12711 * 0...2...........7...............15.............23...............31
12712 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
12713 * |RTPS_DATA_SESSI|X|X|X|X|K|D|Q|E| octetsToNextHeader |
12714 * +---------------+---------------+---------------+---------------+
12715 * | Flags extraFlags | octetsToInlineQos |
12716 * +---------------+---------------+---------------+---------------+
12717 * | EntityId readerEntityId |
12718 * +---------------+---------------+---------------+---------------+
12719 * | EntityId writerEntityId |
12720 * +---------------+---------------+---------------+---------------+
12721 * | |
12722 * + SequenceNumber writerSessionSeqNum +
12723 * | |
12724 * +---------------+---------------+---------------+---------------+
12725 * | |
12726 * + SequenceNumber writerVirtualSeqNum +
12727 * | |
12728 * +---------------+---------------+---------------+---------------+
12729 * | |
12730 * ~ ParameterList inlineQos [only if Q==1] ~
12731 * | |
12732 * +---------------+---------------+---------------+---------------+
12733 * | |
12734 * ~ SerializedData serializedData [only if D==1 || K==1] ~
12735 * | |
12736 * +---------------+---------------+---------------+---------------+
12738 int min_len;
12739 int old_offset = offset;
12740 uint32_t writer_wid; /* Writer EntityID */
12741 uint32_t reader_wid = 0;
12742 uint32_t status_info = 0xffffffff;
12743 bool from_builtin_writer;
12744 proto_item *octet_item;
12745 coherent_set_entity_info coherent_set_entity_info_object = {0};
12747 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, RTPS_DATA_FLAGS, flags);
12749 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
12750 offset + 2, 2, encoding);
12752 /* Calculates the minimum length for this submessage */
12753 min_len = 20;
12754 if (is_session) {
12755 min_len += 8;
12756 bool* is_data_session_final = wmem_alloc(pinfo->pool, sizeof(bool));
12757 *is_data_session_final = false;
12758 p_add_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_DATA_SESSION_FINAL_PROTODATA_KEY, is_data_session_final);
12760 if ((flags & FLAG_RTPS_DATA_Q) != 0) min_len += 4;
12761 if ((flags & FLAG_RTPS_DATA_D) != 0) min_len += 4;
12762 if ((flags & FLAG_RTPS_DATA_K) != 0) min_len += 4;
12764 if (octets_to_next_header < min_len) {
12765 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
12766 return;
12769 offset += 4;
12771 /* extraFlags */
12772 proto_tree_add_item(tree, hf_rtps_extra_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
12773 offset += 2;
12775 /* octetsToInlineQos */
12776 proto_tree_add_item(tree, hf_rtps_octets_to_inline_qos, tvb, offset, 2, encoding);
12777 offset += 2;
12779 /* readerEntityId */
12780 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
12781 hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", &reader_wid);
12782 offset += 4;
12784 /* writerEntityId */
12785 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
12786 hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &writer_wid);
12787 offset += 4;
12788 guid->entity_id = writer_wid;
12789 guid->fields_present |= GUID_HAS_ENTITY_ID;
12790 rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
12792 /* Sequence number */
12793 if (is_session) {
12794 rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSessionSeqNumber");
12795 offset += 8;
12797 rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerVirtualSeqNumber");
12798 offset += 8;
12799 } else {
12800 coherent_set_entity_info_object.writer_seq_number = rtps_util_add_seq_number(tree, tvb, offset,
12801 encoding, "writerSeqNumber");
12802 coherent_set_entity_info_object.guid = *guid;
12803 offset += 8;
12806 /* InlineQos */
12807 if ((flags & FLAG_RTPS_DATA_Q) != 0) {
12808 bool is_inline_qos = true;
12809 offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding,
12810 octets_to_next_header - (offset - old_offset) + 4,
12811 "inlineQos", 0x0200, &status_info, vendor_id, is_inline_qos, &coherent_set_entity_info_object);
12814 /* SerializedData */
12815 if (((flags & FLAG_RTPS_DATA_D) != 0) || ((flags & FLAG_RTPS_DATA_K) != 0)) {
12816 if (writer_wid == ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER) {
12817 /* Dissect the serialized data as ParticipantMessageData:
12818 * struct ParticipantMessageData {
12819 * KeyHashPrefix_t participantGuidPrefix;
12820 * KeyHashSuffix_t kind;
12821 * sequence<octet> data;
12824 proto_tree *rtps_pm_tree;
12825 proto_tree *guid_tree;
12826 uint32_t kind;
12827 uint32_t encapsulation_id, encapsulation_len;
12828 proto_item *ti;
12829 rtps_pm_tree = proto_tree_add_subtree(tree, tvb, offset,
12830 octets_to_next_header - (offset - old_offset) + 4,
12831 ett_rtps_part_message_data, &ti, "ParticipantMessageData");
12833 /* Encapsulation ID */
12834 proto_tree_add_item_ret_uint(rtps_pm_tree, hf_rtps_param_serialize_encap_kind, tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_id);
12835 offset += 2;
12837 encoding = get_encapsulation_endianness(encapsulation_id);
12839 /* Encapsulation length (or option) */
12840 proto_tree_add_item_ret_uint(rtps_pm_tree, hf_rtps_param_serialize_encap_len, tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_len);
12841 offset += 2;
12843 guid_tree = proto_item_add_subtree(ti, ett_rtps_part_message_data);
12845 rtps_util_add_guid_prefix_v2(guid_tree, tvb, offset, hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id,
12846 hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0);
12847 offset += 12;
12849 /* Kind */
12850 proto_tree_add_item_ret_uint(guid_tree, hf_rtps_encapsulation_kind, tvb, offset, 4, ENC_BIG_ENDIAN, &kind);
12851 offset += 4;
12853 rtps_util_add_seq_octets(rtps_pm_tree, pinfo, tvb, offset, encoding,
12854 octets_to_next_header - (offset - old_offset) + 4, hf_rtps_data_serialize_data);
12856 } else if (writer_wid == ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER || writer_wid == ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER) {
12857 /* PGM stands for Participant Generic Message */
12858 proto_tree * rtps_pgm_tree, * guid_tree, * message_identity_tree;
12859 proto_item *ti;
12860 uint32_t encapsulation_id, encapsulation_opt;
12861 int32_t alignment_zero;
12862 uint64_t sequence_number;
12864 ti = proto_tree_add_boolean_format(tree, hf_rtps_pgm, tvb, offset,
12865 octets_to_next_header - (offset - old_offset) + 4, true, "Participant Generic Message");
12866 rtps_pgm_tree = proto_item_add_subtree(ti, ett_rtps_pgm_data);
12868 proto_tree_add_item_ret_uint(rtps_pgm_tree, hf_rtps_param_serialize_encap_kind,
12869 tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_id);
12870 encoding = get_encapsulation_endianness(encapsulation_id);
12872 offset += 2;
12873 proto_tree_add_item_ret_uint(rtps_pgm_tree, hf_rtps_param_serialize_encap_len,
12874 tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_opt);
12876 offset += 2;
12877 alignment_zero = offset;
12878 /* Message Identity */
12879 message_identity_tree = proto_tree_add_subtree(rtps_pgm_tree, tvb, offset,
12880 24 , ett_rtps_message_identity, &ti, "Message Identity");
12882 guid_tree = proto_item_add_subtree(ti, ett_rtps_message_identity);
12883 proto_item_append_text(guid_tree, " (");
12884 rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
12885 hf_rtps_message_identity_source_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
12886 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
12887 hf_rtps_param_entity_kind, guid_tree);
12888 offset += 16;
12890 proto_tree_add_item(message_identity_tree, hf_rtps_sm_seq_number, tvb, offset, 8, encoding);
12892 /* This snippet shows the sequence number in the parent tree */
12893 sequence_number = tvb_get_uint64(tvb, offset, encoding);
12894 proto_item_append_text(guid_tree, ", sn: %" PRIu64 ")",
12895 sequence_number);
12896 offset += 8;
12898 /* Related Message Identity */
12899 message_identity_tree = proto_tree_add_subtree(rtps_pgm_tree, tvb, offset,
12900 24 , ett_rtps_related_message_identity, &ti, "Related Message Identity");
12902 guid_tree = proto_item_add_subtree(ti, ett_rtps_related_message_identity);
12903 proto_item_append_text(guid_tree, " (");
12904 rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
12905 hf_rtps_message_identity_source_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
12906 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
12907 hf_rtps_param_entity_kind, guid_tree);
12908 offset += 16;
12910 proto_tree_add_item(message_identity_tree, hf_rtps_sm_seq_number, tvb,
12911 offset, 8, encoding);
12913 /* This snippet shows the sequence number in the parent tree */
12914 sequence_number = tvb_get_uint64(tvb, offset, encoding);
12915 proto_item_append_text(guid_tree, ", sn: %" PRIu64 ")",
12916 sequence_number);
12917 offset += 8;
12919 guid_tree = proto_item_add_subtree(rtps_pgm_tree, ett_rtps_pgm_data);
12920 rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
12921 hf_rtps_pgm_dst_participant_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
12922 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
12923 hf_rtps_param_entity_kind, NULL);
12924 offset += 16;
12926 guid_tree = proto_item_add_subtree(rtps_pgm_tree, ett_rtps_pgm_data);
12927 rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
12928 hf_rtps_pgm_dst_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
12929 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
12930 hf_rtps_param_entity_kind, NULL);
12931 offset += 16;
12933 guid_tree = proto_item_add_subtree(rtps_pgm_tree, ett_rtps_pgm_data);
12934 rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
12935 hf_rtps_pgm_src_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
12936 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
12937 hf_rtps_param_entity_kind, NULL);
12938 offset += 16;
12940 offset = rtps_util_add_string(rtps_pgm_tree, tvb, offset, hf_rtps_pgm_message_class_id, encoding);
12942 rtps_util_add_data_holder_seq(rtps_pgm_tree, tvb, pinfo, offset,
12943 encoding, alignment_zero);
12944 } else if (writer_wid == ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER) {
12945 proto_tree * locator_ping_tree, *guid_tree;
12946 proto_item *ti;
12947 uint32_t encapsulation_id, encapsulation_opt;
12949 locator_ping_tree = proto_tree_add_subtree(tree, tvb, offset,
12950 octets_to_next_header - (offset - old_offset) + 4,
12951 ett_rtps_locator_ping_tree, &ti, "Locator Ping Message");
12953 /* Encapsulation Id */
12954 proto_tree_add_item_ret_uint(locator_ping_tree, hf_rtps_encapsulation_id,
12955 tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_id);
12956 offset += 2;
12957 encoding = get_encapsulation_endianness(encapsulation_id);
12959 /* Encapsulation length (or option) */
12960 proto_tree_add_item_ret_uint(locator_ping_tree, hf_rtps_encapsulation_options,
12961 tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_opt);
12962 offset += 2;
12964 guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid);
12965 rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
12966 hf_rtps_source_participant_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
12967 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
12968 hf_rtps_param_entity_kind, NULL);
12969 offset += 16;
12970 rtps_util_add_locator_t(locator_ping_tree, pinfo, tvb, offset, encoding,
12971 "Destination Locator");
12973 } else if (writer_wid == ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER) {
12975 struct ServiceRequest {
12976 long service_id; //@key
12977 GUID_t instance_id; //@key
12978 sequence<octet> request_body;
12979 }; //@Extensibility EXTENSIBLE_EXTENSIBILITY
12981 proto_tree * service_request_tree, * guid_tree;
12982 proto_item *ti;
12983 uint32_t encapsulation_id, encapsulation_opt;
12984 int32_t service_id;
12986 ti = proto_tree_add_boolean_format(tree, hf_rtps_srm, tvb, offset,
12987 octets_to_next_header - (offset - old_offset) + 4,
12988 true, "Service Request Message");
12989 service_request_tree = proto_item_add_subtree(ti, ett_rtps_service_request_tree);
12991 /* Encapsulation Id */
12992 proto_tree_add_item_ret_uint(service_request_tree, hf_rtps_encapsulation_id,
12993 tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_id);
12994 offset += 2;
12995 encoding = get_encapsulation_endianness(encapsulation_id);
12996 /* Encapsulation length (or option) */
12997 proto_tree_add_item_ret_uint(service_request_tree, hf_rtps_encapsulation_options, tvb,
12998 offset, 2, ENC_BIG_ENDIAN, &encapsulation_opt);
12999 offset += 2;
13001 proto_tree_add_item_ret_int(service_request_tree, hf_rtps_srm_service_id, tvb,
13002 offset, 4, encoding, &service_id);
13003 offset += 4;
13004 guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid);
13005 rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
13006 hf_rtps_srm_instance_id, hf_rtps_param_host_id, hf_rtps_param_app_id,
13007 hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
13008 hf_rtps_param_entity_kind, NULL);
13009 offset += 16;
13010 rtps_util_add_rti_service_request(service_request_tree, pinfo, tvb, offset,
13011 encoding, service_id);
13013 } else {
13014 const char *label;
13015 if (((flags & FLAG_RTPS_DATA_D) != 0) || ((flags & FLAG_RTPS_DATA_K) == 0)) {
13016 label = "serializedData";
13017 } else if (((flags & FLAG_RTPS_DATA_D) == 0) || ((flags & FLAG_RTPS_DATA_K) != 0)) {
13018 label = "serializedKey";
13019 } else {
13020 /* D==1 && K==1 */
13021 label = "<invalid or unknown data type>";
13024 from_builtin_writer = (((writer_wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY)
13025 || ((writer_wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY)
13026 || (writer_wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER)
13027 || (writer_wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER))
13028 || (writer_wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER)
13029 || (writer_wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? true : false;
13030 /* At the end still dissect the rest of the bytes as raw data */
13031 dissect_serialized_data(tree, pinfo, tvb, offset,
13032 octets_to_next_header - (offset - old_offset) + 4,
13033 label, vendor_id, from_builtin_writer, guid, NOT_A_FRAGMENT);
13036 rtps_util_detect_coherent_set_end_empty_data_case(&coherent_set_entity_info_object);
13037 generate_status_info(pinfo, writer_wid, status_info);
13040 static void dissect_RTPS_DATA_SESSION(tvbuff_t* tvb, packet_info* pinfo, int offset, uint8_t flags,
13041 unsigned encoding, int octets_to_next_header, proto_tree* tree,
13042 uint16_t vendor_id, endpoint_guid* guid) {
13043 bool is_data_session_intermediate = false;
13044 proto_item* ti = NULL;
13046 p_set_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_DATA_SESSION_FINAL_PROTODATA_KEY, &is_data_session_intermediate);
13047 dissect_RTPS_DATA(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
13048 tree, vendor_id, true, guid);
13049 ti = proto_tree_add_boolean(tree, hf_rtps_data_session_intermediate, tvb, offset, 0, is_data_session_intermediate);
13050 proto_item_set_generated(ti);
13053 /* *********************************************************************** */
13054 /* * R T P S _ D A T A _ F R A G _ [SESSION] * */
13055 /* *********************************************************************** */
13056 static void dissect_RTPS_DATA_FRAG_kind(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
13057 const unsigned encoding, int octets_to_next_header, proto_tree *tree,
13058 uint16_t vendor_id, bool is_session, endpoint_guid *guid) {
13060 * There are two kinds of DATA_FRAG, RTPS_DATA_FRAG and RTPS_DATA_FRAG_SESSION
13061 * the only difference is that RTPS_DATA_FRAG_SESSION has an extra sequence number after
13062 * writerSeqNum.
13064 * RTPS_DATA_FRAG:
13065 * 0...2...........7...............15.............23...............31
13066 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13067 * |RTPS_DATA_FRAG |X|X|X|X|X|K|Q|E| octetsToNextHeader |
13068 * +---------------+---------------+---------------+---------------+
13069 * | Flags extraFlags | octetsToInlineQos |
13070 * +---------------+---------------+---------------+---------------+
13071 * | EntityId readerEntityId |
13072 * +---------------+---------------+---------------+---------------+
13073 * | EntityId writerEntityId |
13074 * +---------------+---------------+---------------+---------------+
13075 * | |
13076 * + SequenceNumber writerSeqNum +
13077 * | |
13078 * +---------------+---------------+---------------+---------------+
13079 * | FragmentNumber fragmentStartingNum |
13080 * +---------------+---------------+---------------+---------------+
13081 * | ushort fragmentsInSubmessage | ushort fragmentSize |
13082 * +---------------+---------------+---------------+---------------+
13083 * | unsigned long sampleSize |
13084 * +---------------+---------------+---------------+---------------+
13085 * | |
13086 * ~ ParameterList inlineQos [only if Q==1] ~
13087 * | |
13088 * +---------------+---------------+---------------+---------------+
13089 * | |
13090 * ~ SerializedData serializedData ~
13091 * | |
13092 * +---------------+---------------+---------------+---------------+
13095 * RTPS_DATA_FRAG_SESSION:
13096 * 0...2...........7...............15.............23...............31
13097 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13098 * |RTPS.._SESSION |X|X|X|X|X|K|Q|E| octetsToNextHeader |
13099 * +---------------+---------------+---------------+---------------+
13100 * | Flags extraFlags | octetsToInlineQos |
13101 * +---------------+---------------+---------------+---------------+
13102 * | EntityId readerEntityId |
13103 * +---------------+---------------+---------------+---------------+
13104 * | EntityId writerEntityId |
13105 * +---------------+---------------+---------------+---------------+
13106 * | |
13107 * + SequenceNumber writerSeqNum +
13108 * | |
13109 * +---------------+---------------+---------------+---------------+
13110 * | |
13111 * + SequenceNumber virtualSeqNum +
13112 * | |
13113 * +---------------+---------------+---------------+---------------+
13114 * | FragmentNumber fragmentStartingNum |
13115 * +---------------+---------------+---------------+---------------+
13116 * | ushort fragmentsInSubmessage | ushort fragmentSize |
13117 * +---------------+---------------+---------------+---------------+
13118 * | unsigned long sampleSize |
13119 * +---------------+---------------+---------------+---------------+
13120 * | |
13121 * ~ ParameterList inlineQos [only if Q==1] ~
13122 * | |
13123 * +---------------+---------------+---------------+---------------+
13124 * | |
13125 * ~ SerializedData serializedData ~
13126 * | |
13127 * +---------------+---------------+---------------+---------------+
13131 int min_len;
13132 int old_offset = offset;
13133 uint64_t sample_seq_number = 0;
13134 uint32_t frag_number = 0, frag_size = 0, sample_size = 0, num_frags = 0;
13135 uint32_t wid; /* Writer EntityID */
13136 bool from_builtin_writer;
13137 uint32_t status_info = 0xffffffff;
13138 proto_item *octet_item;
13139 coherent_set_entity_info coherent_set_entity_info_object = {0};
13141 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, RTPS_DATA_FRAG_FLAGS, flags);
13143 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
13144 offset + 2, 2, encoding);
13146 /* Calculates the minimum length for this submessage
13147 * RTPS_DATA_FRAG_SESSION len = RTPS_DATA_FRAG len + 8 (extra virtualSequenceNum field).
13149 min_len = (is_session)
13150 ? 44
13151 : 36;
13152 if ((flags & FLAG_RTPS_DATA_FRAG_Q) != 0) min_len += 4;
13154 if (octets_to_next_header < min_len) {
13155 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
13156 return;
13159 offset += 4;
13161 /* extraFlags */
13162 proto_tree_add_item(tree, hf_rtps_extra_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
13163 offset += 2;
13165 /* octetsToInlineQos */
13166 proto_tree_add_item(tree, hf_rtps_octets_to_inline_qos, tvb, offset, 2, encoding);
13167 offset += 2;
13169 /* readerEntityId */
13170 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
13171 hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
13172 offset += 4;
13174 /* writerEntityId */
13175 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
13176 hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
13177 offset += 4;
13178 guid->entity_id = wid;
13179 guid->fields_present |= GUID_HAS_ENTITY_ID;
13180 rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
13183 /* Sequence number */
13184 coherent_set_entity_info_object.writer_seq_number = rtps_util_add_seq_number(tree, tvb, offset,
13185 encoding, "writerSeqNumber");
13186 coherent_set_entity_info_object.guid = *guid;
13187 offset += 8;
13189 /* virtual Sequence Number (Only in RTPS_DATA_FRAG_SESSION)*/
13190 if (is_session) {
13191 rtps_util_add_seq_number(tree, tvb, offset, encoding, "virtualSeqNumber");
13192 offset += 8;
13194 /* Fragment number */
13195 proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_number, tvb, offset, 4, encoding, &frag_number);
13196 offset += 4;
13198 /* Fragments in submessage */
13199 proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_num_fragments, tvb, offset, 2, encoding, &num_frags);
13200 offset += 2;
13202 /* Fragment size */
13203 proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_size, tvb, offset, 2, encoding, &frag_size);
13204 if (frag_size == 0) {
13205 // A zero fragment size means we don't advance our offset in loops, so
13206 // treat that as invalid.
13207 proto_tree_add_expert_format(tree, pinfo, &ei_rtps_invalid_fragment_size, tvb, offset, 2,
13208 "Invalid fragment size: %u", frag_size);
13210 offset += 2;
13212 /* sampleSize */
13213 proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_sample_size, tvb, offset, 4, encoding, &sample_size);
13214 offset += 4;
13216 /* InlineQos */
13217 if ((flags & FLAG_RTPS_DATA_FRAG_Q) != 0) {
13218 bool is_inline_qos = true;
13219 offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding,
13220 octets_to_next_header - (offset - old_offset) + 4,
13221 "inlineQos", 0x0200, &status_info, vendor_id, is_inline_qos, &coherent_set_entity_info_object);
13224 /* SerializedData */
13225 if (frag_size > 0) {
13226 char label[20];
13227 snprintf(label, 9, "fragment");
13228 if ((flags & FLAG_RTPS_DATA_FRAG_K) != 0) {
13229 snprintf(label, 14, "serializedKey");
13231 from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY)
13232 || ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY)
13233 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER)
13234 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER))
13235 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER)
13236 || (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? true : false;
13238 uint32_t frag_index_in_submessage = 0, this_frag_number = 0, this_frag_size = 0, fragment_offset = 0;
13239 bool more_fragments = false;
13240 if (enable_rtps_reassembly) {
13241 tvbuff_t* new_tvb = NULL;
13242 fragment_head *frag_msg = NULL;
13243 while(frag_index_in_submessage < num_frags) {
13244 this_frag_number = frag_number + frag_index_in_submessage;
13245 more_fragments = (this_frag_number * frag_size < sample_size);
13246 this_frag_size = more_fragments ? frag_size : (sample_size - ((this_frag_number - 1) * frag_size));
13247 fragment_offset = this_frag_number == 1 ? 0 : (((this_frag_number - 1) * frag_size));
13248 pinfo->fragmented = true;
13249 frag_msg = fragment_add_check(&rtps_reassembly_table,
13250 tvb, offset, pinfo,
13251 (uint32_t)sample_seq_number, /* ID for fragments belonging together */
13252 (void *)guid, /* make sure only fragments from the same writer are considered for reassembly */
13253 fragment_offset, /* fragment offset */
13254 this_frag_size, /* fragment length */
13255 more_fragments); /* More fragments? */
13257 new_tvb = process_reassembled_data(tvb, offset + (frag_index_in_submessage * frag_size), pinfo,
13258 "Reassembled sample", frag_msg, &rtps_frag_items,
13259 NULL, tree);
13261 if (frag_index_in_submessage == 0) {
13262 generate_status_info(pinfo, wid, status_info);
13263 if (frag_msg) { /* Reassembled */
13264 col_append_str(pinfo->cinfo, COL_INFO, " [Reassembled]");
13265 } else { /* Not last packet of reassembled Short Message */
13266 col_append_str(pinfo->cinfo, COL_INFO," [RTPS fragment]");
13270 if (new_tvb) {
13271 snprintf(label, 19, "reassembled sample");
13272 dissect_serialized_data(tree, pinfo, new_tvb, 0,
13273 sample_size, label, vendor_id, from_builtin_writer, guid, NOT_A_FRAGMENT);
13274 break;
13275 } else {
13276 snprintf(label, 15, "fragment [%d]", frag_index_in_submessage);
13277 dissect_serialized_data(tree, pinfo, tvb, offset + (frag_index_in_submessage * frag_size),
13278 this_frag_size, label, vendor_id, from_builtin_writer, NULL, this_frag_number);
13280 frag_index_in_submessage++;
13282 } else {
13283 while (frag_index_in_submessage < num_frags) {
13284 this_frag_number = frag_number + frag_index_in_submessage;
13285 more_fragments = (this_frag_number * frag_size < sample_size);
13286 this_frag_size = more_fragments ? frag_size : (sample_size - ((this_frag_number - 1) * frag_size));
13287 fragment_offset = frag_index_in_submessage * frag_size;
13288 snprintf(label, 20, "fragment [%d]", frag_index_in_submessage);
13289 dissect_serialized_data(tree, pinfo, tvb, offset + fragment_offset,
13290 this_frag_size, label, vendor_id, from_builtin_writer, NULL, this_frag_number);
13291 frag_index_in_submessage++;
13293 generate_status_info(pinfo, wid, status_info);
13296 rtps_util_detect_coherent_set_end_empty_data_case(&coherent_set_entity_info_object);
13299 /* *********************************************************************** */
13300 /* * R T P S _ D A T A _ B A T C H * */
13301 /* *********************************************************************** */
13302 static void dissect_RTPS_DATA_BATCH(tvbuff_t *tvb, packet_info *pinfo, int offset,
13303 uint8_t flags, const unsigned encoding, int octets_to_next_header,
13304 proto_tree *tree, uint16_t vendor_id, endpoint_guid *guid) {
13307 * 0...2...........7...............15.............23...............31
13308 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13309 * |RTPS_DATA_BATCH|X|X|X|X|X|X|Q|E| octetsToNextHeader |
13310 * +---------------+---------------+---------------+---------------+
13311 * | Flags extraFlags | octetsToInlineQos |
13312 * +---------------+---------------+---------------+---------------+
13313 * | EntityId readerId |
13314 * +---------------+---------------+---------------+---------------+
13315 * | EntityId writerId |
13316 * +---------------+---------------+---------------+---------------+
13317 * | |
13318 * + SequenceNumber batchSN +
13319 * | |
13320 * +---------------+---------------+---------------+---------------+
13321 * | |
13322 * + SequenceNumber firstSampleSN +
13323 * | |
13324 * +---------------+---------------+---------------+---------------+
13325 * | SequenceNumberOffset offsetToLastSampleSN |
13326 * +---------------+---------------+---------------+---------------+
13327 * | unsigned long batchSampleCount |
13328 * +---------------+---------------+---------------+---------------+
13329 * | |
13330 * ~ ParameterList batchInlineQos [only if Q==1] ~
13331 * | |
13332 * +---------------+---------------+---------------+---------------+
13333 * | unsigned long octetsToSLEncapsulationId |
13334 * +---------------+---------------+---------------+---------------+
13335 * | |
13336 * ~ SampleInfoList sampleInfoList ~
13337 * | |
13338 * +---------------+---------------+---------------+---------------+
13339 * | SampleListEncapsulationId | |
13340 * +---------------+---------------+---------------+---------------+
13341 * | |
13342 * ~ SampleList sampleList ~
13343 * | |
13344 * +---------------+---------------+---------------+---------------+
13347 * SampleInfo:
13348 * 0...............8..............16..............24..............32
13349 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13350 * |X|X|X|X|X|X|X|X|X|X|K|I|D|O|Q|T| octetsToInlineQoS |
13351 * +---------------+---------------+---------------+---------------+
13352 * | unsigned long serializedDataLength |
13353 * +---------------+---------------+---------------+---------------+
13354 * | |
13355 * + Timestamp timestamp [only if T==1] +
13356 * | |
13357 * +---------------+---------------+---------------+---------------+
13358 * | SequenceNumberOffset offsetSN [only if O==1] |
13359 * +---------------+---------------+---------------+---------------+
13360 * | |
13361 * ~ ParameterList sampleInlineQos [only if Q==1] ~
13362 * | |
13363 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13366 * Sample:
13367 * 0...............8..............16..............24..............32
13368 * +---------------+---------------+---------------+---------------+
13369 * | |
13370 * ~ SerializedData serializedData [sampleInfo D==1 || K==1] ~
13371 * | |
13372 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13375 int min_len;
13376 int old_offset = offset;
13377 uint32_t wid; /* Writer EntityID */
13378 uint32_t status_info = 0xffffffff;
13379 int32_t octetsToSLEncapsulationId;
13380 int32_t sampleListOffset;
13381 uint16_t encapsulation_id;
13382 bool try_dissection_from_type_object = false;
13383 uint16_t *sample_info_flags = NULL;
13384 uint32_t *sample_info_length = NULL;
13385 int32_t sample_info_count = 0,
13386 sample_info_max = rtps_max_batch_samples_dissected;
13387 proto_item *octet_item;
13388 rtps_dissector_data * data = NULL;
13389 bool is_compressed = false;
13390 bool uncompressed_ok = false;
13391 proto_tree *compressed_subtree = NULL;
13392 tvbuff_t *data_holder_tvb = tvb;
13393 tvbuff_t *compressed_tvb = NULL;
13394 proto_tree *dissected_data_holder_tree = tree;
13397 data = wmem_new(pinfo->pool, rtps_dissector_data);
13398 data->encapsulation_id = 0;
13400 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, RTPS_DATA_BATCH_FLAGS, flags);
13402 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
13403 offset + 2, 2, encoding);
13405 /* Calculates the minimum length for this submessage */
13406 min_len = 44;
13407 if ((flags & FLAG_RTPS_DATA_BATCH_Q) != 0) min_len += 4;
13409 if (octets_to_next_header < min_len) {
13410 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
13411 return;
13414 offset += 4;
13416 /* extraFlags */
13417 proto_tree_add_item(tree, hf_rtps_extra_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
13418 offset += 2;
13420 /* octetsToInlineQos */
13421 proto_tree_add_item(tree, hf_rtps_octets_to_inline_qos, tvb, offset, 2, encoding);
13422 offset += 2;
13425 /* readerEntityId */
13426 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
13427 hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
13428 offset += 4;
13430 /* writerEntityId */
13431 rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
13432 hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
13433 offset += 4;
13434 guid->entity_id = wid;
13435 guid->fields_present |= GUID_HAS_ENTITY_ID;
13436 rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
13439 /* Batch sequence number */
13440 rtps_util_add_seq_number(tree, tvb, offset, encoding, "batchSeqNumber");
13441 offset += 8;
13443 /* First sample sequence number */
13444 rtps_util_add_seq_number(tree, tvb, offset, encoding, "firstSampleSeqNumber");
13445 offset += 8;
13447 /* offsetToLastSampleSN */
13448 proto_tree_add_item(tree, hf_rtps_data_batch_offset_to_last_sample_sn, tvb, offset, 4, encoding);
13449 offset += 4;
13451 /* batchSampleCount */
13452 proto_tree_add_item(tree, hf_rtps_data_batch_sample_count, tvb, offset, 4, encoding);
13453 offset += 4;
13455 /* Parameter list (if Q==1) */
13456 /* InlineQos */
13457 if ((flags & FLAG_RTPS_DATA_BATCH_Q) != 0) {
13458 offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding,
13459 octets_to_next_header - (offset - old_offset) + 4,
13460 "batchInlineQos", 0x0200, &status_info, vendor_id, false, NULL);
13463 /* octetsToSLEncapsulationId */
13464 proto_tree_add_item_ret_uint(tree, hf_rtps_data_batch_octets_to_sl_encap_id, tvb,
13465 offset, 4, encoding, &octetsToSLEncapsulationId);
13466 offset += 4;
13467 sampleListOffset = offset + octetsToSLEncapsulationId;
13470 /* Sample info list */
13472 proto_item *ti, *list_item;
13473 proto_tree *sil_tree;
13474 sample_info_count = 0;
13476 sil_tree = proto_tree_add_subtree(tree, tvb, offset, octetsToSLEncapsulationId,
13477 ett_rtps_sample_info_list, &list_item, "Sample Info List");
13479 /* Allocate sample_info_flags and sample_info_length
13480 * to store a copy of the flags for each sample info */
13481 if (rtps_max_batch_samples_dissected == 0) {
13482 sample_info_max = 1024; /* Max size of sampleInfo shown */
13484 sample_info_flags = (uint16_t *)wmem_alloc(pinfo->pool, sizeof(uint16_t) *sample_info_max);
13485 sample_info_length = (uint32_t *)wmem_alloc(pinfo->pool, sizeof(uint32_t) *sample_info_max);
13487 /* Sample Info List: start decoding the sample info list until the offset
13488 * is greater or equal than 'sampleListOffset' */
13489 while (offset < sampleListOffset) {
13490 uint16_t flags2;
13491 /*uint16_t octetsToInlineQos;*/
13492 int min_length;
13493 proto_tree *si_tree;
13494 int offset_begin_sampleinfo = offset;
13496 if (rtps_max_batch_samples_dissected > 0 && (unsigned)sample_info_count >= rtps_max_batch_samples_dissected) {
13497 expert_add_info(pinfo, list_item, &ei_rtps_more_samples_available);
13498 offset = sampleListOffset;
13499 break;
13502 si_tree = proto_tree_add_subtree_format(sil_tree, tvb, offset, -1, ett_rtps_sample_info, &ti, "sampleInfo[%d]", sample_info_count);
13504 flags2 = tvb_get_ntohs(tvb, offset); /* Flags are always big endian */
13505 sample_info_flags[sample_info_count] = flags2;
13506 proto_tree_add_bitmask_value(si_tree, tvb, offset, hf_rtps_sm_flags2, ett_rtps_flags, RTPS_SAMPLE_INFO_FLAGS16, flags2);
13507 offset += 2;
13508 proto_tree_add_item(si_tree, hf_rtps_data_batch_octets_to_inline_qos, tvb,
13509 offset, 2, encoding);
13510 offset += 2;
13512 min_length = 4;
13513 if ((flags2 & FLAG_SAMPLE_INFO_T) != 0) min_len += 8;
13514 if ((flags2 & FLAG_SAMPLE_INFO_Q) != 0) min_len += 4;
13515 if ((flags2 & FLAG_SAMPLE_INFO_O) != 0) min_len += 4;
13517 /* Ensure there are enough bytes to decode */
13518 if (sampleListOffset - offset < min_length) {
13519 expert_add_info_format(pinfo, ti, &ei_rtps_parameter_value_invalid, "Error: not enough bytes to dissect sample info");
13520 return;
13523 /* Serialized data length */
13524 proto_tree_add_item_ret_uint(si_tree, hf_rtps_data_batch_serialized_data_length, tvb,
13525 offset, 4, encoding, &sample_info_length[sample_info_count]);
13526 offset += 4;
13528 /* Timestamp [only if T==1] */
13529 if ((flags2 & FLAG_SAMPLE_INFO_T) != 0) {
13530 rtps_util_add_timestamp(si_tree, tvb, offset, encoding, hf_rtps_data_batch_timestamp);
13531 offset += 8;
13534 /* Offset SN [only if O==1] */
13535 if ((flags2 & FLAG_SAMPLE_INFO_O) != 0) {
13536 proto_tree_add_item(si_tree, hf_rtps_data_batch_offset_sn, tvb, offset, 4, encoding);
13537 offset += 4;
13540 /* Parameter list [only if Q==1] */
13541 if ((flags2 & FLAG_SAMPLE_INFO_Q) != 0) {
13542 offset = dissect_parameter_sequence(si_tree, pinfo, tvb, offset, encoding,
13543 octets_to_next_header - (offset - old_offset) + 4,
13544 "sampleInlineQos", 0x0200, &status_info, vendor_id, false, NULL);
13546 proto_item_set_len(ti, offset - offset_begin_sampleinfo);
13547 sample_info_count++;
13548 } /* while (offset < sampleListOffset) */
13551 /* Dissects the encapsulated data heder and uncompress the tvb if it is compressed and
13552 it can be uncompressed */
13553 offset = rtps_prepare_encapsulated_data(
13554 tree,
13555 pinfo,
13556 tvb,
13557 offset,
13558 tvb_reported_length(tvb) - offset,
13559 true,
13560 &encapsulation_id,
13561 NULL,
13562 NULL,
13563 NULL,
13564 NULL,
13565 &is_compressed,
13566 &uncompressed_ok,
13567 &compressed_tvb,
13568 &compressed_subtree);
13569 data->encapsulation_id = encapsulation_id;
13570 if (is_compressed && uncompressed_ok) {
13571 data_holder_tvb = compressed_tvb;
13572 offset = 0;
13573 dissected_data_holder_tree = compressed_subtree;
13574 octets_to_next_header = tvb_reported_length(data_holder_tvb);
13575 old_offset = 0;
13578 /* If it is compressed but not uncompressed don't try to dissect */
13579 if (is_compressed == uncompressed_ok) {
13580 /* Now the list of serialized data:
13581 * Serialized data is allocated one after another one.
13582 * We need to use the data previously stored in the sampleInfo to detect the
13583 * kind and size.
13584 * - sample_info_flags -> Array of uint16_t holding the flags for this sample info
13585 * - sample_info_length -> Array of uint32_t with the size of this sample info
13586 * - sample_info_count -> size of the above arrays
13587 * This section will NEVER dissect more than 'sample_info_count'.
13588 * Note, if there are not enough bytes in the buffer, don't dissect it (this
13589 * can happen for example when a DISPOSE message is sent, there are sample
13590 * info records, but the payload size is zero for all of them)
13592 if ((octets_to_next_header - (offset - old_offset) > 0)) {
13593 proto_item *ti;
13594 proto_tree *sil_tree;
13595 int count = 0;
13597 sil_tree = proto_tree_add_subtree(
13598 dissected_data_holder_tree,
13599 data_holder_tvb,
13600 offset,
13602 ett_rtps_sample_batch_list,
13603 &ti,
13604 "Serialized Sample List");
13605 for (count = 0; count < sample_info_count; ++count) {
13606 /* Ensure there are enough bytes in the buffer to dissect the next sample */
13607 if (octets_to_next_header - (offset - old_offset) + 4 < (int)sample_info_length[count]) {
13608 expert_add_info_format(pinfo, ti, &ei_rtps_parameter_value_invalid, "Error: not enough bytes to dissect sample");
13609 return;
13611 /* We have enough bytes to dissect the next sample, so we update the rtps_dissector_data
13612 * "position in the batch" value and dissect the sample
13614 data->position_in_batch = count;
13615 if (encapsulation_id == ENCAPSULATION_CDR_LE ||
13616 encapsulation_id == ENCAPSULATION_CDR_BE ||
13617 encapsulation_id == ENCAPSULATION_CDR2_LE ||
13618 encapsulation_id == ENCAPSULATION_CDR2_BE ||
13619 encapsulation_id == ENCAPSULATION_PL_CDR_LE ||
13620 encapsulation_id == ENCAPSULATION_PL_CDR_BE) {
13621 try_dissection_from_type_object = true;
13623 if ((sample_info_flags[count] & FLAG_SAMPLE_INFO_K) != 0) {
13624 proto_tree_add_bytes_format(sil_tree, hf_rtps_serialized_key,
13625 data_holder_tvb, offset, sample_info_length[count], NULL, "serializedKey[%d]", count);
13626 } else {
13627 if (!rtps_util_try_dissector(
13628 sil_tree, pinfo, data_holder_tvb, offset, guid, data, get_encapsulation_endianness(encapsulation_id), get_encapsulation_version(encapsulation_id), try_dissection_from_type_object)) {
13629 proto_tree_add_bytes_format(sil_tree, hf_rtps_serialized_data,
13630 data_holder_tvb, offset, sample_info_length[count], NULL, "serializedData[%d]", count);
13633 offset += sample_info_length[count];
13637 generate_status_info(pinfo, wid, status_info);
13640 /* *********************************************************************** */
13641 /* * G A P * */
13642 /* *********************************************************************** */
13643 static void dissect_GAP(tvbuff_t *tvb, packet_info *pinfo, int offset,
13644 uint8_t flags, const unsigned encoding, int octets_to_next_header,
13645 proto_tree *tree, endpoint_guid *guid) {
13646 /* RTPS 1.0/1.1:
13647 * 0...2...........7...............15.............23...............31
13648 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13649 * | GAP |X|X|X|X|X|X|X|E| octetsToNextHeader |
13650 * +---------------+---------------+---------------+---------------+
13651 * | ObjectId readerObjectId |
13652 * +---------------+---------------+---------------+---------------+
13653 * | ObjectId writerObjectId |
13654 * +---------------+---------------+---------------+---------------+
13655 * | |
13656 * + SequenceNumber firstSeqNumber +
13657 * | |
13658 * +---------------+---------------+---------------+---------------+
13659 * | |
13660 * + Bitmap bitmap +
13661 * | |
13662 * +---------------+---------------+---------------+---------------+
13664 * RTPS 1.2/2.0
13665 * 0...2...........7...............15.............23...............31
13666 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13667 * | GAP |X|X|X|X|X|X|F|E| octetsToNextHeader |
13668 * +---------------+---------------+---------------+---------------+
13669 * | EntityId readerEntityId |
13670 * +---------------+---------------+---------------+---------------+
13671 * | EntityId writerEntityId |
13672 * +---------------+---------------+---------------+---------------+
13673 * | |
13674 * + SequenceNumber gapStart +
13675 * | |
13676 * +---------------+---------------+---------------+---------------+
13677 * | |
13678 * ~ SequenceNumberSet gapList ~
13679 * | |
13680 * +---------------+---------------+---------------+---------------+
13682 proto_item *octet_item;
13683 uint32_t wid;
13684 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, GAP_FLAGS, flags);
13686 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
13687 offset + 2, 2, encoding);
13689 if (octets_to_next_header < 24) {
13690 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 24)");
13691 return;
13694 offset += 4;
13696 /* readerEntityId */
13697 rtps_util_add_entity_id(tree, tvb, offset,
13698 hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind,
13699 ett_rtps_rdentity, "readerEntityId", NULL);
13700 offset += 4;
13702 /* writerEntityId */
13703 rtps_util_add_entity_id(tree, tvb, offset,
13704 hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind,
13705 ett_rtps_wrentity, "writerEntityId", &wid);
13706 offset += 4;
13707 guid->entity_id = wid;
13708 guid->fields_present |= GUID_HAS_ENTITY_ID;
13709 rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
13712 /* First Sequence Number */
13713 rtps_util_add_seq_number(tree, tvb, offset, encoding, "gapStart");
13714 offset += 8;
13716 /* Bitmap */
13717 rtps_util_add_bitmap(tree, pinfo, tvb, offset, encoding, "gapList", false);
13721 /* *********************************************************************** */
13722 /* * I N F O _ T S * */
13723 /* *********************************************************************** */
13724 static void dissect_INFO_TS(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
13725 const unsigned encoding, int octets_to_next_header, proto_tree *tree) {
13726 /* RTPS 1.0/1.1:
13727 * 0...2...........7...............15.............23...............31
13728 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13729 * | INFO_TS |X|X|X|X|X|X|I|E| octetsToNextHeader |
13730 * +---------------+---------------+---------------+---------------+
13731 * | |
13732 * + NtpTime ntpTimestamp [only if I==0] +
13733 * | |
13734 * +---------------+---------------+---------------+---------------+
13736 * RTPS 1.2/2.0:
13737 * 0...2...........7...............15.............23...............31
13738 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13739 * | INFO_TS |X|X|X|X|X|X|T|E| octetsToNextHeader |
13740 * +---------------+---------------+---------------+---------------+
13741 * | |
13742 * + Timestamp timestamp [only if T==1] +
13743 * | |
13744 * +---------------+---------------+---------------+---------------+
13747 int min_len;
13748 proto_item *octet_item;
13750 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_TS_FLAGS, flags);
13752 octet_item = proto_tree_add_item(tree,
13753 hf_rtps_sm_octets_to_next_header,
13754 tvb,
13755 offset + 2,
13757 encoding);
13759 min_len = 0;
13760 if ((flags & FLAG_INFO_TS_T) == 0) min_len += 8;
13762 if (octets_to_next_header != min_len) {
13763 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == %u)", min_len);
13764 return;
13767 offset += 4;
13769 if ((flags & FLAG_INFO_TS_T) == 0) {
13770 rtps_util_add_timestamp(tree,
13771 tvb,
13772 offset,
13773 encoding,
13774 hf_rtps_info_ts_timestamp);
13779 /* *********************************************************************** */
13780 /* * I N F O _ S R C * */
13781 /* *********************************************************************** */
13782 static void dissect_INFO_SRC(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
13783 const unsigned encoding, int octets_to_next_header, proto_tree *tree, uint16_t rtps_version) {
13784 /* RTPS 1.0/1.1:
13785 * 0...2...........7...............15.............23...............31
13786 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13787 * | INFO_SRC |X|X|X|X|X|X|X|E| octetsToNextHeader |
13788 * +---------------+---------------+---------------+---------------+
13789 * | IPAddress appIpAddress |
13790 * +---------------+---------------+---------------+---------------+
13791 * | ProtocolVersion version | VendorId vendor |
13792 * +---------------+---------------+---------------+---------------+
13793 * | HostId hostId |
13794 * +---------------+---------------+---------------+---------------+
13795 * | AppId appId |
13796 * +---------------+---------------+---------------+---------------+
13798 * RTPS 1.2/2.0:
13799 * 0...2...........7...............15.............23...............31
13800 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13801 * | INFO_SRC |X|X|X|X|X|X|X|E| octetsToNextHeader |
13802 * +---------------+---------------+---------------+---------------+
13803 * | long unused |
13804 * +---------------+---------------+---------------+---------------+
13805 * | ProtocolVersion version | VendorId vendor |
13806 * +---------------+---------------+---------------+---------------+
13807 * | |
13808 * + GuidPrefix guidPrefix +
13809 * | |
13810 * +---------------+---------------+---------------+---------------+
13812 proto_item *octet_item;
13813 uint16_t version;
13815 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_SRC_FLAGS, flags);
13817 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
13818 offset + 2, 2, encoding);
13820 if (rtps_version < 0x0200) {
13821 if (octets_to_next_header != 16) {
13822 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 16)");
13823 return;
13825 } else {
13826 if (octets_to_next_header != 20) {
13827 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 20)");
13828 return;
13832 offset += 4;
13834 /* Use version field to determine what to display */
13835 version = tvb_get_ntohs(tvb, offset+4);
13836 if (version < 0x102) {
13837 proto_tree_add_item(tree, hf_rtps_info_src_ip, tvb, offset, 4, encoding);
13838 } else {
13839 proto_tree_add_item(tree, hf_rtps_info_src_unused, tvb, offset, 4, encoding);
13842 offset += 4;
13844 rtps_util_add_protocol_version(tree, tvb, offset);
13845 offset += 2;
13847 /* Vendor ID */
13848 rtps_util_add_vendor_id(tree, tvb, offset);
13849 offset += 2;
13851 if (rtps_version < 0x0200) {
13852 rtps_util_add_guid_prefix_v1(tree, tvb, offset,
13853 hf_rtps_sm_guid_prefix_v1, hf_rtps_sm_host_id, hf_rtps_sm_app_id,
13854 hf_rtps_sm_instance_id_v1, hf_rtps_sm_app_kind,
13855 NULL); /* Use default 'guidPrefix' */
13856 } else {
13857 rtps_util_add_guid_prefix_v2(tree, tvb, offset, hf_rtps_guid_prefix_src,
13858 hf_rtps_host_id, hf_rtps_app_id, hf_rtps_sm_instance_id, hf_rtps_guid_prefix);
13863 /* *********************************************************************** */
13864 /* * I N F O _ R E P L Y _ I P 4 * */
13865 /* *********************************************************************** */
13866 static void dissect_INFO_REPLY_IP4(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
13867 const unsigned encoding, int octets_to_next_header, proto_tree *tree) {
13868 /* RTPS 1.0/1.1:
13869 * 0...2...........7...............15.............23...............31
13870 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13871 * | INFO_REPLY |X|X|X|X|X|X|M|E| octetsToNextHeader |
13872 * +---------------+---------------+---------------+---------------+
13873 * | IPAddress unicastReplyIpAddress |
13874 * +---------------+---------------+---------------+---------------+
13875 * | Port unicastReplyPort |
13876 * +---------------+---------------+---------------+---------------+
13877 * | IPAddress multicastReplyIpAddress [ only if M==1 ] |
13878 * +---------------+---------------+---------------+---------------+
13879 * | Port multicastReplyPort [ only if M==1 ] |
13880 * +---------------+---------------+---------------+---------------+
13882 * RTPS 1.2/2.0:
13883 * 0...2...........7...............15.............23...............31
13884 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13885 * |INFO_REPLY_IP4 |X|X|X|X|X|X|M|E| octetsToNextHeader |
13886 * +---------------+---------------+---------------+---------------+
13887 * | |
13888 * + LocatorUDPv4 unicastReplyLocator +
13889 * | |
13890 * +---------------+---------------+---------------+---------------+
13891 * | |
13892 * + LocatorUDPv4 multicastReplyLocator [only if M==1] +
13893 * | |
13894 * +---------------+---------------+---------------+---------------+
13896 int min_len;
13897 proto_item *octet_item;
13899 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_REPLY_IP4_FLAGS, flags);
13901 octet_item = proto_tree_add_item(tree,
13902 hf_rtps_sm_octets_to_next_header,
13903 tvb,
13904 offset + 2,
13906 encoding);
13908 min_len = 8;
13909 if ((flags & FLAG_INFO_REPLY_IP4_M) != 0) min_len += 8;
13911 if (octets_to_next_header != min_len) {
13912 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == %u)", min_len);
13913 return;
13916 offset += 4;
13919 /* unicastReplyLocator */
13920 rtps_util_add_locator_udp_v4(tree, pinfo, tvb, offset,
13921 "unicastReplyLocator", encoding);
13923 offset += 8;
13925 /* multicastReplyLocator */
13926 if ((flags & FLAG_INFO_REPLY_IP4_M) != 0) {
13927 rtps_util_add_locator_udp_v4(tree, pinfo, tvb, offset,
13928 "multicastReplyLocator", encoding);
13929 /*offset += 8;*/
13933 /* *********************************************************************** */
13934 /* * I N F O _ D S T * */
13935 /* *********************************************************************** */
13936 static void dissect_INFO_DST(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
13937 const unsigned encoding, int octets_to_next_header, proto_tree *tree,
13938 uint16_t version, endpoint_guid *dst_guid) {
13939 /* RTPS 1.0/1.1:
13940 * 0...2...........7...............15.............23...............31
13941 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13942 * | INFO_DST |X|X|X|X|X|X|X|E| octetsToNextHeader |
13943 * +---------------+---------------+---------------+---------------+
13944 * | HostId hostId |
13945 * +---------------+---------------+---------------+---------------+
13946 * | AppId appId |
13947 * +---------------+---------------+---------------+---------------+
13949 * RTPS 1.2/2.0:
13950 * 0...2...........7...............15.............23...............31
13951 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13952 * | INFO_DST |X|X|X|X|X|X|X|E| octetsToNextHeader |
13953 * +---------------+---------------+---------------+---------------+
13954 * | |
13955 * + GuidPrefix guidPrefix +
13956 * | |
13957 * +---------------+---------------+---------------+---------------+
13959 proto_item *octet_item;
13961 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_DST_FLAGS, flags);
13963 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
13964 offset + 2, 2, encoding);
13966 if (version < 0x0200) {
13967 if (octets_to_next_header != 8) {
13968 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 8)");
13969 return;
13971 } else {
13972 if (octets_to_next_header != 12) {
13973 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 12)");
13974 return;
13978 offset += 4;
13980 if (version < 0x0200) {
13981 rtps_util_add_guid_prefix_v1(tree, tvb, offset,
13982 hf_rtps_sm_guid_prefix_v1, hf_rtps_sm_host_id, hf_rtps_sm_app_id,
13983 hf_rtps_sm_instance_id_v1, hf_rtps_sm_app_kind,
13984 NULL);
13985 } else {
13986 rtps_util_add_guid_prefix_v2(tree, tvb, offset, hf_rtps_guid_prefix_dst,
13987 hf_rtps_host_id, hf_rtps_app_id, hf_rtps_sm_instance_id, hf_rtps_guid_prefix);
13989 dst_guid->host_id = tvb_get_ntohl(tvb, offset);
13990 dst_guid->app_id = tvb_get_ntohl(tvb, offset + 4);
13991 dst_guid->instance_id = tvb_get_ntohl(tvb, offset + 8);
13992 dst_guid->fields_present |= GUID_HAS_HOST_ID|GUID_HAS_APP_ID|GUID_HAS_INSTANCE_ID;
13996 /* *********************************************************************** */
13997 /* * I N F O _ R E P L Y * */
13998 /* *********************************************************************** */
13999 static void dissect_INFO_REPLY(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
14000 const unsigned encoding, int octets_to_next_header, proto_tree *tree) {
14001 /* RTPS 1.0/1.1:
14002 * INFO_REPLY is *NOT* the same thing as the old INFO_REPLY.
14004 * RTPS 1.2/2.0:
14005 * 0...2...........7...............15.............23...............31
14006 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
14007 * | INFO_REPLY |X|X|X|X|X|X|M|E| octetsToNextHeader |
14008 * +---------------+---------------+---------------+---------------+
14009 * | |
14010 * ~ LocatorList unicastReplyLocatorList ~
14011 * | |
14012 * +---------------+---------------+---------------+---------------+
14013 * | |
14014 * ~ LocatorList multicastReplyLocatorList [only if M==1] ~
14015 * | |
14016 * +---------------+---------------+---------------+---------------+
14019 int min_len;
14020 proto_item *octet_item;
14022 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_REPLY_FLAGS, flags);
14024 octet_item = proto_tree_add_item(tree,
14025 hf_rtps_sm_octets_to_next_header,
14026 tvb,
14027 offset + 2,
14029 encoding);
14031 min_len = 4;
14032 if ((flags & FLAG_INFO_REPLY_M) != 0) min_len += 4;
14034 if (octets_to_next_header < min_len) {
14035 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
14036 return;
14039 offset += 4;
14041 /* unicastReplyLocatorList */
14042 offset = rtps_util_add_locator_list(tree, pinfo, tvb, offset, "unicastReplyLocatorList", encoding);
14044 /* multicastReplyLocatorList */
14045 if ((flags & FLAG_INFO_REPLY_M) != 0) {
14046 /*offset = */rtps_util_add_locator_list(tree, pinfo, tvb, offset, "multicastReplyLocatorList", encoding);
14050 /* *********************************************************************** */
14051 /* * RTI CRC * */
14052 /* *********************************************************************** */
14053 static void dissect_RTI_CRC(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
14054 const unsigned encoding, int octets_to_next_header,proto_tree *tree) {
14056 * 0...2...........7...............15.............23...............31
14057 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
14058 * | RTI_CRC |X|X|X|X|X|X|X|E| octetsToNextHeader |
14059 * +---------------+---------------+---------------+---------------+
14060 * | RTPS Message length (without the 20 bytes header) |
14061 * +---------------+---------------+---------------+---------------+
14062 * | CRC32 |
14063 * +---------------+---------------+---------------+---------------+
14064 Total 12 bytes */
14065 proto_item *octet_item;
14067 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, RTI_CRC_FLAGS, flags);
14069 octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
14070 offset + 2, 2, encoding);
14072 if (octets_to_next_header != 8) {
14073 expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 8)");
14074 return;
14077 offset += 4;
14078 proto_tree_add_item(tree, hf_rtps_sm_rti_crc_number, tvb, offset, 4, encoding);
14080 offset += 4;
14081 proto_tree_add_item(tree, hf_rtps_sm_rti_crc_result, tvb, offset, 4, ENC_BIG_ENDIAN);
14085 * @brief Do a forward search for the begining of the tags section in the
14086 * SRTPS POSTFIX/SEC POSTFIX submessage.
14088 static int rtps_util_look_for_secure_tag(
14089 tvbuff_t *tvb,
14090 int offset)
14092 int submessage_offset = offset;
14093 uint8_t submessage_id = 0;
14094 int tvb_remaining_len = tvb_reported_length_remaining(tvb, offset);
14095 int submessage_len = 0;
14097 while (tvb_remaining_len > 4) {
14098 submessage_id = tvb_get_uint8(tvb, submessage_offset);
14099 submessage_len = tvb_get_uint16(
14100 tvb,
14101 submessage_offset + 2,
14102 ENC_LITTLE_ENDIAN);
14103 tvb_remaining_len -= submessage_len;
14104 if (submessage_id == SUBMESSAGE_SRTPS_POSTFIX
14105 || submessage_id == SUBMESSAGE_SEC_POSTFIX) {
14106 return submessage_offset + 4;
14108 submessage_offset += submessage_len;
14109 tvb_remaining_len -= submessage_len;
14111 return -1;
14114 // NOLINTNEXTLINE(misc-no-recursion)
14115 static void dissect_SECURE(
14116 tvbuff_t *tvb,
14117 packet_info *pinfo,
14118 int offset,
14119 uint8_t flags,
14120 const unsigned encoding _U_,
14121 int octets_to_next_header,
14122 proto_tree *tree,
14123 uint16_t vendor_id _U_,
14124 endpoint_guid *guid,
14125 bool dissecting_encrypted_submessage)
14127 /* *********************************************************************** */
14128 /* * SECURE SUBMESSAGE * */
14129 /* *********************************************************************** */
14130 /* 0...2...........7...............15.............23...............31
14131 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
14132 * | SECURE SUBMSG |X|X|X|X|X|X|S|E| octetsToNextHeader |
14133 * +---------------+---------------+---------------+---------------+
14134 * | long transformationKind |
14135 * +---------------+---------------+---------------+---------------+
14136 * | |
14137 * + octet transformationId[8] +
14138 * | |
14139 * +---------------+---------------+---------------+---------------+
14140 * | |
14141 * + octet secure_data[] +
14142 * | |
14143 * +---------------+---------------+---------------+---------------+
14145 proto_tree * payload_tree;
14146 unsigned local_encoding;
14147 int secure_body_len = 0;
14148 rtps_current_packet_decryption_info_t *decryption_info;
14149 int initial_offset = offset;
14151 proto_tree_add_bitmask_value(
14152 tree,
14153 tvb,
14154 offset + 1,
14155 hf_rtps_sm_flags,
14156 ett_rtps_flags,
14157 SECURE_FLAGS,
14158 flags);
14159 local_encoding = ((flags & FLAG_E) != 0) ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN;
14161 proto_tree_add_item(
14162 tree,
14163 hf_rtps_sm_octets_to_next_header,
14164 tvb,
14165 offset + 2,
14167 local_encoding);
14168 offset += 4;
14170 payload_tree = proto_tree_add_subtree_format(
14171 tree,
14172 tvb,
14173 offset,
14174 octets_to_next_header,
14175 ett_rtps_secure_payload_tree,
14176 NULL,
14177 "Secured payload");
14179 proto_tree_add_item(
14180 payload_tree,
14181 hf_rtps_secure_secure_data_length,
14182 tvb,
14183 offset,
14185 ENC_BIG_ENDIAN);
14186 offset += 4;
14188 secure_body_len = octets_to_next_header - 4;
14189 proto_tree_add_item(
14190 payload_tree,
14191 hf_rtps_secure_secure_data,
14192 tvb,
14193 offset,
14194 octets_to_next_header - 4,
14195 local_encoding);
14197 decryption_info = (rtps_current_packet_decryption_info_t *)
14198 p_get_proto_data(
14199 pinfo->pool,
14200 pinfo,
14201 proto_rtps,
14202 RTPS_DECRYPTION_INFO_KEY);
14204 if (!enable_rtps_psk_decryption
14205 || decryption_info == NULL
14206 || !decryption_info->try_psk_decryption) {
14207 return;
14210 if (dissecting_encrypted_submessage) {
14212 * This should never happen.
14213 * If an RTPS message is encrypted with a pre-shared key, then the dissector
14214 * will use this function to decrypt the SEC_BODY submessage and attempt to
14215 * dissect it by calling dissect_rtps_submessages. The
14216 * dissecting_encrypted_submessage parameter makes sure that the recursion
14217 * is not infinite. However, this is not really possible because pre-shared
14218 * key encryption takes only place at the RTPS message level; there
14219 * shouldn't be another pre-shared key encoded SEC_BODY submessage at this
14220 * point. Clang complains about the recursion because it doesn't have the
14221 * information about the RTPS protocol. We ignore the warning with the
14222 * NOLINTNEXTLINE suppression (misc-no-recursion argument) above each
14223 * affected function.
14225 return;
14228 for (unsigned entry_idx = 0; entry_idx < rtps_psk_options.size; entry_idx++) {
14229 uint8_t *decrypted_data = NULL;
14230 uint8_t session_key[RTPS_HMAC_256_BUFFER_SIZE_BYTES];
14231 uint8_t *tag = NULL;
14232 int tag_offset = 0;
14233 gcry_error_t error = GPG_ERR_NO_ERROR;
14234 /* Iterate all entries in the PSK table of the RTPS protocol options */
14235 rtps_psk_options_entry_t *entry = &rtps_psk_options.entries[entry_idx];
14236 /* Check if each field is equal or the ignore options are enabled */
14237 bool host_id_mismatch = !entry->host_id.ignore
14238 && entry->host_id.value != decryption_info->guid_prefix.host_id;
14239 bool host_app_mismatch = !entry->app_id.ignore
14240 && entry->app_id.value != decryption_info->guid_prefix.app_id;
14241 bool host_instance_mismatch = !entry->instance_id.ignore
14242 && entry->instance_id.value != decryption_info->guid_prefix.instance_id;
14243 bool psk_index_mismatch = !entry->passphrase_id.ignore
14244 && entry->passphrase_id.value != decryption_info->psk_index;
14247 * We proceed to decryption only if host, app and instance ids are equals
14248 * (or ignored).
14250 if (host_id_mismatch
14251 || host_app_mismatch
14252 || host_instance_mismatch
14253 || psk_index_mismatch) {
14254 continue;
14258 * When decrypting with PSKs there is only one tag in the SRTPS POSTFIX/SEC
14259 * POSTFIX submessage. The offset is the one until the next submessage.
14260 * The 4 constant is the sum of submessage_id(1 byte)
14261 * + flags (1 byte) + octects to the next submessage(2 bytes)
14263 tag_offset = rtps_util_look_for_secure_tag(
14264 tvb,
14265 initial_offset + octets_to_next_header + 4);
14266 if (tag_offset > 0) {
14267 tag = tvb_memdup(
14268 pinfo->pool,
14269 tvb,
14270 tag_offset,
14271 SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH);
14274 /* Decrypt the payload */
14275 decrypted_data = rtps_decrypt_secure_payload(
14276 tvb,
14277 pinfo,
14278 offset,
14279 (size_t) secure_body_len,
14280 entry->passphrase_secret,
14281 decryption_info->init_vector,
14282 decryption_info->algorithm,
14283 decryption_info->transformation_key,
14284 decryption_info->session_id,
14285 tag,
14286 session_key,
14287 &error,
14288 pinfo->pool);
14289 error = gpg_err_code(error);
14290 if (error == GPG_ERR_NO_ERROR) {
14291 tvbuff_t *decrypted_tvb = NULL;
14293 * Each byte becomes two hexadecimal characters.
14294 * We also add one for the NUL terminator, which we will add manually
14295 * because bytes_to_hexstr does not add it.
14297 char session_key_hexadecimal_representation[
14298 RTPS_HMAC_256_BUFFER_SIZE_BYTES * 2 + 1];
14299 char *session_key_nul_terminator_ptr = NULL;
14300 rtps_guid_prefix_t guid_backup = decryption_info->guid_prefix;
14302 /* Add the decrypted payload as a generated tvb */
14303 decrypted_tvb = tvb_new_real_data(
14304 decrypted_data,
14305 (unsigned) secure_body_len,
14306 secure_body_len);
14307 tvb_set_child_real_data_tvbuff(tvb, decrypted_tvb);
14308 session_key_nul_terminator_ptr = bytes_to_hexstr(
14309 session_key_hexadecimal_representation,
14310 session_key,
14311 RTPS_HMAC_256_BUFFER_SIZE_BYTES);
14312 *session_key_nul_terminator_ptr = '\0';
14314 proto_tree* decrypted_subtree = NULL;
14315 decrypted_subtree = proto_tree_add_subtree_format(
14316 payload_tree,
14317 decrypted_tvb,
14318 offset,
14319 secure_body_len,
14320 ett_rtps_decrypted_payload,
14321 NULL,
14322 "Decrypted Payload (Passphrase Secret: \"%s\", "
14323 "Passphrase ID: %d Session Key: %s)",
14324 entry->passphrase_secret,
14325 entry->passphrase_id.value,
14326 session_key_hexadecimal_representation);
14327 add_new_data_source(pinfo, decrypted_tvb, "Decrypted Data");
14328 proto_item_set_generated(decrypted_subtree);
14331 * Reset the content of the decryption info except the guid. This way we
14332 * avoid interefering in possible decription inside the secure payload.
14334 rtps_current_packet_decryption_info_reset(decryption_info);
14335 decryption_info->guid_prefix = guid_backup;
14337 dissect_rtps_submessages(
14338 decrypted_tvb,
14340 pinfo,
14341 decrypted_subtree,
14342 0x0200,
14343 vendor_id,
14344 guid,
14345 true /* dissecting_encrypted_submessage. */);
14346 break;
14347 } else if (error == GPG_ERR_CHECKSUM) {
14348 /* Wrong PSK */
14349 proto_tree_add_expert_format(
14350 payload_tree,
14351 pinfo,
14352 &ei_rtps_invalid_psk,
14353 tvb,
14354 offset,
14355 octets_to_next_header,
14356 "Bad %s tag check. " \
14357 "Possibly wrong passphrase secret (\"%s\") or malformed packet",
14358 val_to_str(
14359 decryption_info->algorithm,
14360 secure_transformation_kind,
14361 "Unknown algorithm"),
14362 entry->passphrase_secret);
14363 break;
14364 } else {
14365 /* General error. Displaying GCRY error output */
14366 proto_tree_add_expert_format(
14367 payload_tree,
14368 pinfo,
14369 &ei_rtps_invalid_psk,
14370 tvb,
14371 offset,
14372 octets_to_next_header,
14373 "Unable to decrypt content with passphrase secret (\"%s\"). %s: %s",
14374 entry->passphrase_secret,
14375 gcry_strsource(error),
14376 gcry_strerror(error));
14377 break;
14382 static void dissect_SECURE_PREFIX(tvbuff_t *tvb, packet_info *pinfo _U_, int offset,
14383 uint8_t flags, const unsigned encoding, int octets_to_next_header,
14384 proto_tree *tree, uint16_t vendor_id _U_) {
14386 * MIG_RTPS_SECURE_RTPS_PREFIX and MIG_RTPS_SECURE_PREFIX share same serialization:
14387 * 0...2...........8...............16.............24...............32
14388 * +---------------+---------------+---------------+---------------+
14389 * | 0x33 / 0x31 |X|X|X|X|X|X|X|E| octetsToNextHeader |
14390 * +---------------+---------------+---------------+---------------+
14391 * | |
14392 * + SecureDataHeader sec_data_header +
14393 * | |
14394 * +---------------+---------------+---------------+---------------+
14396 * where SecureDataHeader is:
14398 * SecureDataHeader: TransformationIdentifier (kind + key) + plugin_sec_header
14399 * 0...2...........8...............16.............24...............32
14400 * +---------------+---------------+---------------+---------------+
14401 * | Revision_id |tran...on_kind |
14402 * +---------------+---------------+---------------+---------------+
14403 * | |
14404 * + octet transformation_key_id[4] +
14405 * | |
14406 * +---------------+---------------+---------------+---------------+
14407 * | sesion_id |
14408 * +---------------+---------------+---------------+---------------+
14409 * | init_vector_suffix[8] |
14410 * +---------------+---------------+---------------+---------------+
14412 proto_tree * sec_data_header_tree;
14413 int flags_offset = offset + 1;
14414 int session_id_offset = 0;
14415 int transformation_key_offset = 0;
14416 int algorithm_offset = 0;
14417 int init_vector_offset = 0;
14418 int psk_index_offset_three_bytes = 0;
14419 int psk_index_offset_fourth_byte = 0;
14420 uint32_t psk_index = 0;
14421 proto_item *passphrase_id_item = NULL;
14422 unsigned flags_byte = 0;
14423 bool is_psk_protected = false;
14424 proto_item *transformation_kind_item = NULL;
14426 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags,
14427 ett_rtps_flags, SECURE_PREFIX_FLAGS, flags);
14429 flags_byte = tvb_get_uint8(tvb, flags_offset);
14430 is_psk_protected = (flags_byte & 0x04) != 0;
14431 proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2,
14432 2, encoding);
14433 offset += 4;
14435 sec_data_header_tree = proto_tree_add_subtree_format(tree, tvb, offset, octets_to_next_header,
14436 ett_rtps_secure_dataheader_tree, NULL, "Secure Data Header");
14438 /* Transformation Kind field used to be 4 bytes. Now it is splitted:
14439 * - 3 bytes: Transformation Key Revision
14440 * - 1 byte: Transformation Kind
14441 * A single byte is enough for Transformation Kind since it only has five possible values (0-4).
14443 psk_index_offset_three_bytes = offset;
14444 proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_transformation_key_revision_id, tvb,
14445 offset, 3, ENC_BIG_ENDIAN);
14446 offset += 3;
14448 algorithm_offset = offset;
14449 proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_transformation_kind, tvb,
14450 offset, 1, ENC_BIG_ENDIAN);
14452 offset += 1;
14453 transformation_key_offset = offset;
14454 proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_transformation_key_id, tvb,
14455 offset, 4, ENC_NA);
14457 offset += 3;
14458 if (is_psk_protected) {
14459 proto_tree *transformation_kind_tree;
14460 /* PSK index is the last byte of the transformation kind */
14461 psk_index_offset_fourth_byte = offset;
14462 transformation_kind_tree = proto_item_add_subtree(
14463 transformation_kind_item,
14464 ett_rtps_secure_transformation_kind);
14465 proto_tree_add_item(
14466 transformation_kind_tree,
14467 hf_rtps_secure_dataheader_passphrase_key_id,
14468 tvb,
14469 psk_index_offset_fourth_byte,
14471 ENC_NA);
14473 offset += 1;
14474 session_id_offset = offset;
14475 proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_session_id, tvb,
14476 offset, 4, ENC_BIG_ENDIAN);
14477 offset += 4;
14479 init_vector_offset = session_id_offset;
14480 proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_init_vector_suffix, tvb,
14481 offset, octets_to_next_header-12, ENC_NA);
14483 if (is_psk_protected) {
14484 uint8_t *psk_index_bytes = (uint8_t*) &psk_index;
14485 tvb_memcpy(tvb, &psk_index_bytes[1], psk_index_offset_three_bytes, 3);
14486 tvb_memcpy(tvb, psk_index_bytes, psk_index_offset_fourth_byte, 1);
14487 passphrase_id_item = proto_tree_add_uint(
14488 sec_data_header_tree,
14489 hf_rtps_secure_dataheader_passphrase_id,
14490 tvb,
14493 psk_index);
14494 proto_item_set_generated(passphrase_id_item);
14498 * If PSK decryption is enabled, then store the session id, init vector and
14499 * transformation key for using them later during the session key generation.
14501 if (is_psk_protected && enable_rtps_psk_decryption) {
14502 rtps_current_packet_decryption_info_t *decryption_info =
14503 (rtps_current_packet_decryption_info_t *) p_get_proto_data(
14504 pinfo->pool,
14505 pinfo,
14506 proto_rtps,
14507 RTPS_DECRYPTION_INFO_KEY);
14508 if (decryption_info == NULL) {
14509 return;
14512 decryption_info->try_psk_decryption = true;
14513 decryption_info->algorithm = tvb_get_uint8(tvb, algorithm_offset);
14515 /* Copy the bytes as they are. Without considering the endianness */
14516 tvb_memcpy(
14517 tvb,
14518 &decryption_info->session_id,
14519 session_id_offset,
14520 sizeof(uint32_t));
14521 tvb_memcpy(
14522 tvb,
14523 &decryption_info->init_vector,
14524 init_vector_offset,
14525 RTPS_SECURITY_INIT_VECTOR_LEN);
14526 tvb_memcpy(
14527 tvb,
14528 &decryption_info->transformation_key,
14529 transformation_key_offset,
14530 sizeof(uint32_t));
14533 * PSK index is the composition of the three bytes of the transformation key
14534 * revision Id and the byte of the transformation id.
14536 decryption_info->psk_index = psk_index;
14540 static void dissect_SECURE_POSTFIX(
14541 tvbuff_t *tvb,
14542 packet_info *pinfo _U_,
14543 int offset,
14544 uint8_t flags,
14545 const unsigned encoding,
14546 int octets_to_next_header,
14547 proto_tree *tree,
14548 uint16_t vendor_id _U_)
14551 * MIG_RTPS_SECURE_RTPS_POSTFIX and MIG_RTPS_SECURE_POSTFIX share the same
14552 * serialization:
14553 * 0...2...........8...............16.............24...............32
14554 * +---------------+---------------+---------------+---------------+
14555 * | 0x34 / 0x32 |X|X|X|X|X|X|X|E| octetsToNextHeader |
14556 * +---------------+---------------+---------------+---------------+
14557 * | |
14558 * + SecureDataTag sec_data_tag +
14559 * | |
14560 * +---------------+---------------+---------------+---------------+
14562 * where SecureDataTag is:
14563 * 0...2...........8...............16.............24...............32
14564 * +---------------+---------------+---------------+---------------+
14565 * | |
14566 * ~ octet plugin_sec_tag[] ~
14567 * | |
14568 * +---------------+---------------+---------------+---------------+
14570 * and plugin_sec_tag is:
14571 * 0...2...........8...............16.............24...............32
14572 * +---------------+---------------+---------------+---------------+
14573 * ~ octet[16] plugin_sec_tag.common_mac ~
14574 * +---------------+---------------+---------------+---------------+
14575 * + plugin_sec_tag.receiver_specific_macs: |
14576 * | long plugin_sec_tag.receiver_specific_macs.length = N |
14577 * +---------------+---------------+---------------+---------------+
14578 * | octet[4] receiver_specific_macs[0].receiver_mac_key_id |
14579 * | octet[16] receiver_specific_macs[0].receiver_mac |
14580 * +---------------+---------------+---------------+---------------+
14581 * | . . . |
14582 * +---------------+---------------+---------------+---------------+
14583 * | octet[4] receiver_specific_macs[N-1].receiver_mac_key_id |
14584 * | octet[16] receiver_specific_macs[N-1].receiver_mac |
14585 * +---------------+---------------+---------------+---------------+
14587 int specific_macs_num = 0;
14589 ++offset;
14590 proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags,
14591 ett_rtps_flags, SECURE_POSTFIX_FLAGS, flags);
14593 ++offset;
14594 proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset,
14595 2, encoding);
14596 offset += 2;
14597 proto_tree_add_item(
14598 tree,
14599 hf_rtps_secure_datatag_plugin_sec_tag_common_mac,
14600 tvb,
14601 offset,
14602 SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH,
14603 encoding);
14604 offset += SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH;
14606 * The receiver-specific mac length is encoded in big endian (regardless of
14607 * the submessage flags), as per the Security specification.
14609 proto_tree_add_item(
14610 tree,
14611 hf_rtps_secure_datatag_plugin_specific_macs_len,
14612 tvb,
14613 offset,
14615 ENC_BIG_ENDIAN);
14616 specific_macs_num = tvb_get_int32(tvb, offset, ENC_BIG_ENDIAN);
14617 offset += 4;
14619 /* Dissect specific macs */
14620 if (specific_macs_num > 0) {
14621 int RECEIVER_SPECIFIC_MAC_KEY_LENGTH = 4; /* bytes. */
14622 int secure_tags_list_member_size =
14623 RECEIVER_SPECIFIC_MAC_KEY_LENGTH + SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH;
14625 proto_tree *sec_data_tag_tree = NULL;
14626 sec_data_tag_tree = proto_tree_add_subtree_format(
14627 tree,
14628 tvb,
14629 offset,
14630 octets_to_next_header,
14631 ett_rtps_secure_dataheader_tree,
14632 NULL,
14633 "Receiver Specific Macs");
14634 for (int tag_counter = 0; tag_counter < specific_macs_num; tag_counter++) {
14635 proto_tree *tag_tree = NULL;
14636 int tag_offset = tag_counter * secure_tags_list_member_size;
14638 tag_tree = proto_tree_add_subtree_format(
14639 sec_data_tag_tree,
14640 tvb,
14641 offset + tag_offset,
14642 secure_tags_list_member_size,
14643 ett_rtps_secure_postfix_tag_list_item,
14644 NULL,
14645 "Receiver Specific Mac[%d]",
14646 tag_counter);
14647 proto_tree_add_item(
14648 tag_tree,
14649 hf_rtps_secure_datatag_plugin_sec_tag,
14650 tvb,
14651 offset + tag_offset,
14652 SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH,
14653 encoding);
14654 proto_tree_add_item(
14655 tag_tree,
14656 hf_rtps_secure_datatag_plugin_sec_tag_key,
14657 tvb,
14658 offset + tag_offset + SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH,
14659 RECEIVER_SPECIFIC_MAC_KEY_LENGTH,
14660 encoding);
14665 * 0...2...........7...............15.............23...............31
14666 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
14667 * | BINDING_PING |X|X|X|X|X|B|L|E| octetsToNextHeader |
14668 * +---------------+---------------+---------------+---------------+
14669 * | DDS_UnsignedLong rtps_port |
14670 * +---------------+---------------+---------------+---------------+
14671 * | |
14672 * + DDS_Octet address[12][If L = 0] +
14673 * | |
14674 * + +
14675 * | |
14676 * +---------------+---------------+---------------+---------------+
14677 * | |
14678 * + DDS_Octet address[16][If L = 1] +
14679 * | |
14680 * + +
14681 * | |
14682 * + +
14683 * | |
14684 * +---------------+---------------+---------------+---------------+
14687 static void dissect_UDP_WAN_BINDING_PING(tvbuff_t *tvb, packet_info *pinfo _U_, int offset,
14688 uint8_t flags, const unsigned encoding, int octets_to_next_header _U_,
14689 proto_tree *tree, uint16_t vendor_id _U_) {
14691 const unsigned flags_offset = offset + 1;
14692 const unsigned next_header_offset = flags_offset + 1;
14693 const unsigned port_offset = next_header_offset + 2;
14694 const unsigned address_offset = port_offset + 4;
14696 proto_tree_add_bitmask_value(tree, tvb, flags_offset, hf_rtps_udpv4_wan_binding_ping_flags,
14697 ett_rtps_flags, UDPV4_WAN_BINDING_PING_FLAGS, flags);
14698 proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, next_header_offset,
14699 2, encoding);
14700 proto_tree_add_item(tree, hf_rtps_udpv4_wan_binding_ping_port, tvb, port_offset,
14701 4, encoding);
14703 * Address[12] [If L=0] is the only one we currently support, and it maps to:
14704 * DDS_Octet UUID[9] + 3 bytes of padding.
14706 if (flags & FLAG_UDPV4_WAN_BINDING_PING_FLAG_L) {
14707 proto_tree_add_item(
14708 tree,
14709 hf_rtps_long_address,
14710 tvb,
14711 address_offset,
14712 LONG_ADDRESS_SIZE,
14713 encoding);
14714 } else {
14715 proto_tree_add_item(
14716 tree,
14717 hf_rtps_uuid,
14718 tvb,
14719 address_offset,
14720 UUID_SIZE,
14721 encoding);
14725 // NOLINTNEXTLINE(misc-no-recursion)
14726 static bool dissect_rtps_submessage_v2(
14727 tvbuff_t *tvb,
14728 packet_info *pinfo,
14729 int offset,
14730 uint8_t flags,
14731 const unsigned encoding,
14732 uint8_t submessageId,
14733 uint16_t vendor_id,
14734 int octets_to_next_header,
14735 proto_tree *rtps_submessage_tree,
14736 proto_item *submessage_item,
14737 endpoint_guid *guid,
14738 endpoint_guid *dst_guid,
14739 bool dissecting_encrypted_submessage)
14741 switch (submessageId)
14743 case SUBMESSAGE_HEADER_EXTENSION:
14744 dissect_HEADER_EXTENSION(tvb, pinfo, offset, flags, encoding, rtps_submessage_tree, octets_to_next_header, vendor_id);
14745 break;
14746 case SUBMESSAGE_DATA_FRAG:
14747 dissect_DATA_FRAG(tvb, pinfo, offset, flags, encoding,
14748 octets_to_next_header, rtps_submessage_tree, vendor_id, guid);
14749 break;
14751 case SUBMESSAGE_NOKEY_DATA_FRAG:
14752 dissect_NOKEY_DATA_FRAG(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id);
14753 break;
14755 case SUBMESSAGE_NACK_FRAG:
14756 dissect_NACK_FRAG(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree);
14757 break;
14759 case SUBMESSAGE_ACKNACK_SESSION:
14760 case SUBMESSAGE_ACKNACK_BATCH:
14761 dissect_ACKNACK(tvb, pinfo, offset, flags, encoding,
14762 octets_to_next_header, rtps_submessage_tree, submessage_item, dst_guid);
14763 break;
14765 case SUBMESSAGE_APP_ACK:
14766 dissect_APP_ACK(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, submessage_item, guid);
14767 break;
14769 case SUBMESSAGE_APP_ACK_CONF:
14770 dissect_APP_ACK_CONF(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, submessage_item, guid);
14771 break;
14773 case SUBMESSAGE_HEARTBEAT_SESSION:
14774 case SUBMESSAGE_HEARTBEAT_BATCH:
14775 dissect_HEARTBEAT_BATCH(tvb, pinfo, offset, flags, encoding,
14776 octets_to_next_header, rtps_submessage_tree, guid);
14777 break;
14779 case SUBMESSAGE_HEARTBEAT_FRAG:
14780 dissect_HEARTBEAT_FRAG(tvb, pinfo, offset, flags, encoding,
14781 octets_to_next_header, rtps_submessage_tree, guid);
14782 break;
14784 case SUBMESSAGE_HEARTBEAT_VIRTUAL:
14785 dissect_HEARTBEAT_VIRTUAL(tvb, pinfo, offset, flags, encoding,
14786 octets_to_next_header, rtps_submessage_tree, vendor_id, guid);
14787 break;
14789 case SUBMESSAGE_RTPS_DATA_SESSION: {
14790 dissect_RTPS_DATA_SESSION(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
14791 rtps_submessage_tree, vendor_id, guid);
14792 break;
14794 case SUBMESSAGE_RTPS_DATA:
14795 dissect_RTPS_DATA(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
14796 rtps_submessage_tree, vendor_id, false, guid);
14798 break;
14800 case SUBMESSAGE_RTI_DATA_FRAG_SESSION:
14801 case SUBMESSAGE_RTPS_DATA_FRAG:
14802 dissect_RTPS_DATA_FRAG_kind(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
14803 rtps_submessage_tree, vendor_id, (submessageId == SUBMESSAGE_RTI_DATA_FRAG_SESSION), guid);
14804 break;
14806 case SUBMESSAGE_RTPS_DATA_BATCH:
14807 dissect_RTPS_DATA_BATCH(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
14808 rtps_submessage_tree, vendor_id, guid);
14809 break;
14811 case SUBMESSAGE_RTI_CRC:
14812 if (vendor_id == RTPS_VENDOR_RTI_DDS) {
14813 dissect_RTI_CRC(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
14814 rtps_submessage_tree);
14816 break;
14817 case SUBMESSAGE_SEC_BODY:
14818 dissect_SECURE(
14819 tvb,
14820 pinfo,
14821 offset,
14822 flags,
14823 encoding,
14824 octets_to_next_header,
14825 rtps_submessage_tree,
14826 vendor_id,
14827 guid,
14828 dissecting_encrypted_submessage);
14829 break;
14830 case SUBMESSAGE_SEC_PREFIX:
14831 case SUBMESSAGE_SRTPS_PREFIX:
14832 dissect_SECURE_PREFIX(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
14833 rtps_submessage_tree, vendor_id);
14834 break;
14835 case SUBMESSAGE_SEC_POSTFIX:
14836 case SUBMESSAGE_SRTPS_POSTFIX:
14837 dissect_SECURE_POSTFIX(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
14838 rtps_submessage_tree, vendor_id);
14839 break;
14840 case SUBMESSAGE_RTI_UDP_WAN_BINDING_PING:
14841 dissect_UDP_WAN_BINDING_PING(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
14842 rtps_submessage_tree, vendor_id);
14843 break;
14845 default:
14846 return false;
14849 return true;
14852 static bool dissect_rtps_submessage_v1(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags, const unsigned encoding,
14853 uint8_t submessageId, uint16_t version, uint16_t vendor_id, int octets_to_next_header,
14854 proto_tree *rtps_submessage_tree, proto_item *submessage_item,
14855 endpoint_guid * guid, endpoint_guid * dst_guid)
14857 switch (submessageId)
14859 case SUBMESSAGE_PAD:
14860 dissect_PAD(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree);
14861 break;
14863 case SUBMESSAGE_DATA:
14864 if (version < 0x0200) {
14865 dissect_DATA_v1(tvb, pinfo, offset, flags, encoding,
14866 octets_to_next_header, rtps_submessage_tree);
14867 } else {
14868 dissect_DATA_v2(tvb, pinfo, offset, flags, encoding,
14869 octets_to_next_header, rtps_submessage_tree, vendor_id, guid);
14871 break;
14873 case SUBMESSAGE_NOKEY_DATA:
14874 dissect_NOKEY_DATA(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree,
14875 version, vendor_id);
14876 break;
14878 case SUBMESSAGE_ACKNACK:
14879 dissect_ACKNACK(tvb, pinfo, offset, flags, encoding,
14880 octets_to_next_header, rtps_submessage_tree, submessage_item, dst_guid);
14881 break;
14883 case SUBMESSAGE_HEARTBEAT:
14884 dissect_HEARTBEAT(tvb, pinfo, offset, flags, encoding,
14885 octets_to_next_header, rtps_submessage_tree, version, guid);
14886 break;
14888 case SUBMESSAGE_GAP:
14889 dissect_GAP(tvb, pinfo, offset, flags, encoding,
14890 octets_to_next_header, rtps_submessage_tree, guid);
14891 break;
14893 case SUBMESSAGE_INFO_TS:
14894 dissect_INFO_TS(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree);
14895 break;
14897 case SUBMESSAGE_INFO_SRC:
14898 dissect_INFO_SRC(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, version);
14899 break;
14901 case SUBMESSAGE_INFO_REPLY_IP4:
14902 dissect_INFO_REPLY_IP4(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree);
14903 break;
14905 case SUBMESSAGE_INFO_DST:
14906 dissect_INFO_DST(tvb, pinfo, offset, flags, encoding,
14907 octets_to_next_header, rtps_submessage_tree, version, dst_guid);
14908 break;
14910 case SUBMESSAGE_INFO_REPLY:
14911 dissect_INFO_REPLY(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree);
14912 break;
14914 default:
14915 return false;
14918 return true;
14921 /***************************************************************************/
14922 /* The main packet dissector function
14924 static bool dissect_rtps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
14926 proto_item *ti;
14927 proto_tree *rtps_tree;
14928 uint8_t majorRev;
14929 uint16_t version, vendor_id;
14930 bool is_ping;
14931 endpoint_guid guid = {0};
14932 endpoint_guid *guid_copy;
14933 uint32_t magic_number;
14934 char domain_id_str[RTPS_UNKNOWN_DOMAIN_ID_STR_LEN] = RTPS_UNKNOWN_DOMAIN_ID_STR;
14935 bool is_domain_id_calculated = false;
14936 const char* not_accuracy_str = "";
14937 int length_remaining = 0;
14938 rtps_tvb_field rtps_root;
14940 /* Check 'RTPS' signature:
14941 * A header is invalid if it has less than 16 octets
14943 length_remaining = tvb_reported_length_remaining(tvb, offset);
14944 if (length_remaining < 16)
14945 return false;
14947 magic_number = tvb_get_ntohl(tvb, offset);
14948 if (magic_number != RTPX_MAGIC_NUMBER &&
14949 magic_number != RTPS_MAGIC_NUMBER) {
14950 return false;
14952 /* Distinguish between RTPS 1.x and 2.x here */
14953 majorRev = tvb_get_uint8(tvb,offset+4);
14954 if ((majorRev != 1) && (majorRev != 2))
14955 return false;
14957 /* Save the beginning of the RTPS message */
14958 rtps_root.tvb = tvb;
14959 rtps_root.tvb_offset = offset;
14960 rtps_root.tvb_len = tvb_reported_length_remaining(tvb, offset);
14961 p_set_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_ROOT_MESSAGE_KEY, (void **)&rtps_root);
14962 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTPS");
14963 col_clear(pinfo->cinfo, COL_INFO);
14965 /* create display subtree for the protocol */
14966 ti = proto_tree_add_item(tree, proto_rtps, tvb, 0, -1, ENC_NA);
14967 rtps_tree = proto_item_add_subtree(ti, ett_rtps);
14969 /* magic */
14970 proto_tree_add_item(rtps_tree, hf_rtps_magic, tvb, 0, 4, ENC_NA | ENC_ASCII);
14972 /* Protocol Version */
14973 version = rtps_util_add_protocol_version(rtps_tree, tvb, offset+4);
14975 /* Vendor Id */
14976 vendor_id = rtps_util_add_vendor_id(rtps_tree, tvb, offset+6);
14978 is_ping = rtps_is_ping(tvb, pinfo, offset+8);
14980 if (is_ping) {
14981 dissect_PING(tvb, offset + 8, ENC_BIG_ENDIAN, length_remaining - 8, rtps_tree);
14982 } else {
14983 if (version < 0x0200)
14984 rtps_util_add_guid_prefix_v1(rtps_tree, tvb, offset+8,
14985 hf_rtps_guid_prefix_v1, hf_rtps_host_id, hf_rtps_app_id,
14986 hf_rtps_app_id_instance_id, hf_rtps_app_id_app_kind, NULL);
14987 else
14988 rtps_util_add_guid_prefix_v2(rtps_tree, tvb, offset+8, hf_rtps_guid_prefix_src,
14989 hf_rtps_host_id, hf_rtps_app_id, hf_rtps_sm_instance_id, hf_rtps_guid_prefix);
14991 guid.host_id = tvb_get_ntohl(tvb, offset+8);
14992 guid.app_id = tvb_get_ntohl(tvb, offset+12);
14993 guid.instance_id = tvb_get_ntohl(tvb, offset+16);
14996 * If decription is enabled, store the guid prefix to be used later in the
14997 * dissect_SECURE and dissect_SECURE_PREFIX functions.
14999 if (enable_rtps_psk_decryption) {
15000 rtps_current_packet_decryption_info_t *decryption_info = wmem_alloc(
15001 pinfo->pool,
15002 sizeof(rtps_current_packet_decryption_info_t));
15003 if (decryption_info == NULL) {
15004 return false;
15007 rtps_current_packet_decryption_info_reset(decryption_info);
15008 decryption_info->guid_prefix.host_id = guid.host_id;
15009 decryption_info->guid_prefix.app_id = guid.app_id;
15010 decryption_info->guid_prefix.instance_id = guid.instance_id;
15012 p_set_proto_data(
15013 pinfo->pool,
15014 pinfo,
15015 proto_rtps,
15016 RTPS_DECRYPTION_INFO_KEY,
15017 (void **) decryption_info);
15020 guid.fields_present = GUID_HAS_HOST_ID|GUID_HAS_APP_ID|GUID_HAS_INSTANCE_ID;
15021 /* If the packet uses TCP we need top store the participant GUID to get the domainId later
15022 * For that operation the member fields_present is not required and is not affected by
15023 * its changes.
15025 guid_copy = (endpoint_guid*)wmem_memdup(pinfo->pool,
15026 (const void*)&guid, sizeof(endpoint_guid));
15027 p_add_proto_data(pinfo->pool, pinfo, proto_rtps,
15028 RTPS_TCPMAP_DOMAIN_ID_PROTODATA_KEY, (void *)guid_copy);
15029 #ifdef RTI_BUILD
15030 pinfo->guid_prefix_host = tvb_get_ntohl(tvb, offset + 8);
15031 pinfo->guid_prefix_app = tvb_get_ntohl(tvb, offset + 12);
15032 pinfo->guid_prefix_count = tvb_get_ntohl(tvb, offset + 16);
15033 pinfo->guid_rtps2 = 1;
15034 #endif
15036 /* Extract the domain id and participant index */
15038 int domain_id, doffset, participant_idx = 0, nature;
15039 proto_tree *mapping_tree;
15040 /* For a complete description of these rules, see RTPS documentation
15042 RTPS 1.2 mapping:
15043 domain_id = ((pinfo->destport - PORT_BASE)/10) % 100;
15044 participant_idx = (pinfo->destport - PORT_BASE) / 1000;
15045 nature = (pinfo->destport % 10);
15047 For Unicast, the port mapping formula is:
15048 metatraffic_unicast_port = port_base +
15049 (domain_id_gain * domain_id) +
15050 (participant_id_gain * participant_id) +
15051 builtin_unicast_port_offset
15052 For Multicast, the port mapping is:
15053 metatraffic_multicast_port = port_base +
15054 (domain_id_gain * domain_id) +
15055 builtin_multicast_port_offset
15057 Where the constants are:
15058 port_base = 7400
15059 domain_id_gain = 250
15060 participant_id_gain = 2
15061 builtin_multicast_port_offset = 0
15062 builtin_unicast_port_offset = 10
15063 user_multicast_port_offset = 1
15064 user_unicast_port_offset = 11
15067 To obtain the individual components from the port number, the reverse formulas are:
15068 domain_id = (port - port_base) / 250 (valid both multicast / unicast)
15069 Doffset = (port - port_Base - (domain_id * 250));
15070 participant_idx = (Doffset - 10) / 2;
15073 if (version < 0x0200) {
15074 /* If using TCP domainId cannot deduced from the port. It must be taken from the participant
15075 * discovery packets or Unknown.
15077 domain_id = get_domain_id_from_tcp_discovered_participants(discovered_participants_domain_ids, &guid);
15078 if (pinfo->ptype != PT_TCP && domain_id == RTPS_UNKNOWN_DOMAIN_ID_VAL) {
15079 domain_id = ((pinfo->destport - PORT_BASE) / 10) % 100;
15080 is_domain_id_calculated = true;
15082 participant_idx = (pinfo->destport - PORT_BASE) / 1000;
15083 nature = (pinfo->destport % 10);
15084 } else {
15085 domain_id = get_domain_id_from_tcp_discovered_participants(discovered_participants_domain_ids, &guid);
15086 if (pinfo->ptype != PT_TCP && pinfo->destport > PORT_BASE && domain_id == RTPS_UNKNOWN_DOMAIN_ID_VAL) {
15087 domain_id = (pinfo->destport - PORT_BASE) / DOMAIN_GAIN;
15088 is_domain_id_calculated = true;
15090 doffset = (pinfo->destport - PORT_BASE - domain_id * DOMAIN_GAIN);
15091 if (doffset == 0) {
15092 nature = PORT_METATRAFFIC_MULTICAST;
15094 else if (doffset == 1) {
15095 nature = PORT_USERTRAFFIC_MULTICAST;
15097 else {
15098 participant_idx = (doffset - 10) / 2;
15099 if ((doffset - 10) % 2 == 0) {
15100 nature = PORT_METATRAFFIC_UNICAST;
15102 else {
15103 nature = PORT_USERTRAFFIC_UNICAST;
15106 if (domain_id > 232 || domain_id < 0) {
15107 domain_id = RTPS_UNKNOWN_DOMAIN_ID_VAL;
15110 /* Used string for the domain participant to show Unknown if the domainId is not known when using TCP*/
15111 if (domain_id != RTPS_UNKNOWN_DOMAIN_ID_VAL) {
15112 snprintf(domain_id_str, RTPS_UNKNOWN_DOMAIN_ID_STR_LEN,
15113 "%"PRId32, domain_id);
15114 if (is_domain_id_calculated) {
15115 not_accuracy_str = " (Based on calculated domainId. Might not be accurate)";
15118 if ((nature == PORT_METATRAFFIC_UNICAST) || (nature == PORT_USERTRAFFIC_UNICAST) ||
15119 (version < 0x0200)) {
15120 mapping_tree = proto_tree_add_subtree_format(rtps_tree, tvb, 0, 0,
15121 ett_rtps_default_mapping, NULL, "Default port mapping%s: domainId=%s, "
15122 "participantIdx=%d, nature=%s",
15123 not_accuracy_str,
15124 domain_id_str,
15125 participant_idx,
15126 val_to_str(nature, nature_type_vals, "%02x"));
15127 } else {
15128 mapping_tree = proto_tree_add_subtree_format(rtps_tree, tvb, 0, 0,
15129 ett_rtps_default_mapping, NULL, "Default port mapping%s: %s, domainId=%s",
15130 not_accuracy_str,
15131 val_to_str(nature, nature_type_vals, "%02x"),
15132 domain_id_str);
15135 ti = proto_tree_add_uint(mapping_tree, hf_rtps_domain_id, tvb, 0, 0, domain_id);
15136 proto_item_set_generated(ti);
15137 if ((nature == PORT_METATRAFFIC_UNICAST) || (nature == PORT_USERTRAFFIC_UNICAST) ||
15138 (version < 0x0200)) {
15139 ti = proto_tree_add_uint(mapping_tree, hf_rtps_participant_idx, tvb, 0, 0, participant_idx);
15140 proto_item_set_generated(ti);
15142 ti = proto_tree_add_uint(mapping_tree, hf_rtps_nature_type, tvb, 0, 0, nature);
15143 proto_item_set_generated(ti);
15146 /* offset behind RTPS's Header (need to be set in case tree=NULL)*/
15147 offset += ((version < 0x0200) ? 16 : 20);
15149 dissect_rtps_submessages(
15150 tvb,
15151 offset,
15152 pinfo,
15153 rtps_tree,
15154 version,
15155 vendor_id,
15156 &guid,
15157 false /* dissecting_encrypted_submessage. */);
15159 /* If TCP there's an extra OOB byte at the end of the message */
15160 /* TODO: What to do with it? */
15161 return true;
15163 } /* dissect_rtps(...) */
15165 static
15166 void append_submessage_col_info(packet_info* pinfo, submessage_col_info* current_submessage_col_info) {
15167 bool* is_data_session_intermediate = NULL;
15169 /* Status info column: (r),(p[U])...*/
15170 if (current_submessage_col_info->status_info != NULL) {
15171 col_append_str(pinfo->cinfo, COL_INFO, current_submessage_col_info->status_info);
15173 /* DATA_SESSION last package */
15174 is_data_session_intermediate = (bool*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_DATA_SESSION_FINAL_PROTODATA_KEY);
15175 if (is_data_session_intermediate != NULL && !*is_data_session_intermediate) {
15176 current_submessage_col_info->data_session_kind = "(Last)";
15177 col_append_str(pinfo->cinfo, COL_INFO, current_submessage_col_info->data_session_kind);
15179 /* Topic name */
15180 if (current_submessage_col_info->topic_name != NULL) {
15181 col_append_sep_str(pinfo->cinfo, COL_INFO, " -> ", current_submessage_col_info->topic_name);
15185 // NOLINTNEXTLINE(misc-no-recursion)
15186 void dissect_rtps_submessages(
15187 tvbuff_t *tvb,
15188 int offset,
15189 packet_info *pinfo,
15190 proto_tree *rtps_tree,
15191 uint16_t version,
15192 uint16_t vendor_id,
15193 endpoint_guid *guid,
15194 bool dissecting_encrypted_submessage)
15196 uint8_t submessageId, flags;
15197 int sub_hf;
15198 const value_string *sub_vals;
15199 proto_item *ti;
15200 proto_tree *rtps_submessage_tree;
15201 unsigned encoding;
15202 int next_submsg, octets_to_next_header;
15203 endpoint_guid dst_guid;
15204 submessage_col_info current_submessage_col_info = {NULL, NULL, NULL};
15206 /* No fields have been set in GUID yet. */
15207 dst_guid.fields_present = 0;
15208 while (tvb_reported_length_remaining(tvb, offset) > 0) {
15209 submessageId = tvb_get_uint8(tvb, offset);
15211 if (version < 0x0200) {
15212 sub_hf = hf_rtps_sm_id;
15213 sub_vals = submessage_id_vals;
15214 } else {
15215 if ((submessageId & 0x80) && (vendor_id == RTPS_VENDOR_RTI_DDS)) {
15216 sub_hf = hf_rtps_sm_idv2;
15217 sub_vals = submessage_id_rti;
15218 } else {
15219 sub_hf = hf_rtps_sm_idv2;
15220 sub_vals = submessage_id_valsv2;
15224 col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str(submessageId, sub_vals, "Unknown[%02x]"));
15226 /* Creates the subtree 'Submessage: XXXX' */
15227 if (submessageId & 0x80) {
15228 if (vendor_id == RTPS_VENDOR_RTI_DDS) {
15229 ti = proto_tree_add_uint_format_value(rtps_tree, sub_hf, tvb, offset, 1, submessageId, "%s",
15230 val_to_str(submessageId, submessage_id_rti, "Vendor-specific (0x%02x)"));
15231 } else {
15232 ti = proto_tree_add_uint_format_value(rtps_tree, sub_hf, tvb, offset, 1,
15233 submessageId, "Vendor-specific (0x%02x)", submessageId);
15235 } else {
15236 ti = proto_tree_add_uint(rtps_tree, sub_hf, tvb, offset, 1, submessageId);
15239 rtps_submessage_tree = proto_item_add_subtree(ti, ett_rtps_submessage);
15241 /* Gets the flags */
15242 flags = tvb_get_uint8(tvb, offset + 1);
15244 /* Gets the E (Little endian) flag */
15245 encoding = ((flags & FLAG_E) != 0) ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN;
15247 /* Octets-to-next-header */
15248 octets_to_next_header = tvb_get_uint16(tvb, offset + 2, encoding);
15249 if ((octets_to_next_header == 0) && (version >= 0x0200)
15250 && (submessageId != SUBMESSAGE_PAD) && (submessageId != SUBMESSAGE_INFO_TS)) {
15251 octets_to_next_header = tvb_reported_length_remaining(tvb, offset + 4);
15253 next_submsg = offset + octets_to_next_header + 4;
15255 /* Set length of this item */
15256 proto_item_set_len(ti, octets_to_next_header + 4);
15258 /* Now decode each single submessage
15259 * The offset passed to the dissectors points to the start of the
15260 * submessage (at the ID byte).
15262 p_set_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY, (void **)&current_submessage_col_info);
15263 if (!dissect_rtps_submessage_v1(tvb, pinfo, offset, flags, encoding,
15264 submessageId, version, vendor_id,
15265 octets_to_next_header, rtps_submessage_tree,
15266 ti, guid, &dst_guid)) {
15267 if ((version < 0x0200) ||
15268 !dissect_rtps_submessage_v2(
15269 tvb,
15270 pinfo,
15271 offset,
15272 flags,
15273 encoding,
15274 submessageId,
15275 vendor_id,
15276 octets_to_next_header,
15277 rtps_submessage_tree,
15279 guid,
15280 &dst_guid,
15281 dissecting_encrypted_submessage)) {
15282 proto_tree_add_uint(rtps_submessage_tree, hf_rtps_sm_flags,
15283 tvb, offset + 1, 1, flags);
15284 proto_tree_add_uint(rtps_submessage_tree,
15285 hf_rtps_sm_octets_to_next_header,
15286 tvb, offset + 2, 2, octets_to_next_header);
15289 append_submessage_col_info(pinfo, &current_submessage_col_info);
15290 /* Reset the col info for the next submessage */
15291 current_submessage_col_info.data_session_kind = NULL;
15292 current_submessage_col_info.status_info = NULL;
15293 current_submessage_col_info.topic_name = NULL;
15294 /* next submessage's offset */
15295 offset = next_submsg;
15299 static bool dissect_rtps_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
15301 int offset = 0;
15303 return dissect_rtps(tvb, pinfo, tree, offset);
15306 static bool dissect_rtps_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
15308 /* In RTPS over TCP the first 4 bytes are the packet length
15309 * as 32-bit unsigned int coded as BIG ENDIAN
15310 * uint32_t tcp_len = tvb_get_ntohl(tvb, offset);
15312 int offset = 4;
15314 return dissect_rtps(tvb, pinfo, tree, offset);
15317 static bool dissect_rtps_rtitcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
15319 int offset = 0;
15321 return dissect_rtps(tvb, pinfo, tree, offset);
15324 static int dissect_simple_rtps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
15326 int offset = 0;
15328 if (dissect_rtps(tvb, pinfo, tree, offset) == false)
15329 return 0;
15331 return tvb_captured_length(tvb);
15335 * Type InstanceStateDataresponse is sent as user user data but there is no discovery data for it.
15336 * So it is necessary to add it manually so Wireshark can dissect it
15338 static void initialize_instance_state_data_response_dissection_info(builtin_types_dissection_data_t *_builtin_types_dissection_data) {
15339 uint32_t element = 0;
15340 const uint64_t InstanceStateDataResponse_type_id = 0x9d6d4c879b0e6aa9;
15341 const uint64_t sequence_100_InstanceTransitionData_type_id = 0x2dac07d5577caaf6;
15342 const uint64_t guid_t_type_id = 0x36d940c4ed806097;
15343 const uint64_t value_type_id = 0x974064b1120169ed;
15344 const uint64_t instancetransitiondata_type_id = 0xceb6f5e405f4bde7;
15345 const uint64_t KeyHashValue_type_id = 0x48725f37453310ed;
15346 const uint64_t SerializedKey_type_id = 0x3fd77a8ff43c7e55;
15347 const uint64_t payload_type_id = 0x0d0ecc8d34a5c3ab;
15348 const uint64_t ntptime_t_type_id = 0x842c59af7e962a4c;
15349 const uint64_t sequencenumber_t_type_id = 0xb933efe30d85453b;
15351 * @appendable @nested
15352 * struct GUID_t {
15353 * octet value[16];
15354 * };
15355 * @appendable @nested
15356 * struct SequenceNumber_t {
15357 * long high;
15358 * unsigned long low;
15359 * };
15361 * @final @nested
15362 * struct NtpTime_t {
15363 * int32 sec;
15364 * uint32 frac;
15365 * };
15366 * @final @nested
15367 * struct SerializedKey {
15368 * sequence<octet> payload;
15369 * };
15370 * typedef octet KeyHashValue[16];
15372 * struct InstanceTransitionData {
15373 * @optional KeyHashValue key_hash;
15374 * @optional SerializedKey serialized_key;
15375 * NtpTime_t last_update_timestamp;
15376 * SequenceNumber_t transition_sequence_number;
15377 * };
15380 /* All dissection_infos are added to the "dissection_infos" map */
15382 /* value */
15383 g_strlcpy(_builtin_types_dissection_data->dissection_infos.value_dissection_info.member_name, "value", MAX_TOPIC_AND_TYPE_LENGTH);
15384 _builtin_types_dissection_data->dissection_infos.value_dissection_info.num_elements = VALUE_NUM_ELEMENTS;
15385 _builtin_types_dissection_data->dissection_infos.value_dissection_info.bound = VALUE_NUM_ELEMENTS;
15386 _builtin_types_dissection_data->dissection_infos.value_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE;
15387 _builtin_types_dissection_data->dissection_infos.value_dissection_info.base_type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE;
15388 _builtin_types_dissection_data->dissection_infos.value_dissection_info.type_id = value_type_id;
15389 _builtin_types_dissection_data->dissection_infos.value_dissection_info.bound = VALUE_NUM_ELEMENTS;
15390 _builtin_types_dissection_data->dissection_infos.value_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS);
15391 wmem_map_insert(
15392 builtin_dissection_infos,
15393 &(_builtin_types_dissection_data->dissection_infos.value_dissection_info.type_id),
15394 (void*)&(_builtin_types_dissection_data->dissection_infos.value_dissection_info));
15396 /* GUID_t */
15397 g_strlcpy(_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.member_name, "GUID_t", MAX_TOPIC_AND_TYPE_LENGTH);
15398 _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.num_elements = GUID_T_NUM_ELEMENTS;
15399 _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE;
15400 _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.type_id = guid_t_type_id;
15401 _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS);
15402 /* octet value[16] */
15403 _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements[0].flags = 0;
15404 _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements[0].member_id = 0;
15405 _builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements[0].type_id = value_type_id;
15406 g_strlcpy(_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements[0].member_name, "value", MAX_TOPIC_AND_TYPE_LENGTH);
15407 wmem_map_insert(
15408 builtin_dissection_infos,
15409 &(_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.type_id),
15410 (void*)&(_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info));
15412 /* Payload */
15413 g_strlcpy(_builtin_types_dissection_data->dissection_infos.payload_dissection_info.member_name, "payload", MAX_TOPIC_AND_TYPE_LENGTH);
15414 _builtin_types_dissection_data->dissection_infos.payload_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE;
15415 _builtin_types_dissection_data->dissection_infos.payload_dissection_info.base_type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE;
15416 _builtin_types_dissection_data->dissection_infos.payload_dissection_info.type_id = payload_type_id;
15417 _builtin_types_dissection_data->dissection_infos.payload_dissection_info.bound = -1;
15418 _builtin_types_dissection_data->dissection_infos.payload_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS);
15419 wmem_map_insert(
15420 builtin_dissection_infos,
15421 &(_builtin_types_dissection_data->dissection_infos.payload_dissection_info.type_id),
15422 (void*)&(_builtin_types_dissection_data->dissection_infos.payload_dissection_info));
15424 /* KeyHashValue */
15425 g_strlcpy(_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.member_name, "KeyHashValue", MAX_TOPIC_AND_TYPE_LENGTH);
15426 _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.num_elements = KEY_HAS_VALUE_NUM_ELEMENTS;
15427 _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.bound = KEY_HAS_VALUE_NUM_ELEMENTS;
15428 _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE;
15429 _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.base_type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE;
15430 _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.type_id = KeyHashValue_type_id;
15431 _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.bound = KEY_HAS_VALUE_NUM_ELEMENTS;
15432 _builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS);
15433 wmem_map_insert(
15434 builtin_dissection_infos,
15435 &(_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.type_id),
15436 (void*)&(_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info));
15438 /* SerializedKey */
15439 g_strlcpy(_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.member_name, "SerializedKey", MAX_TOPIC_AND_TYPE_LENGTH);
15440 _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.num_elements = GUID_T_NUM_ELEMENTS;
15441 _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE;
15442 _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.type_id = SerializedKey_type_id;
15443 _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS);
15444 /* sequence<octet> payload */
15445 _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements[0].flags = 0;
15446 _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements[0].member_id = 0;
15447 _builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements[0].type_id = payload_type_id;
15448 g_strlcpy(_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements[0].member_name, "payload", MAX_TOPIC_AND_TYPE_LENGTH);
15449 wmem_map_insert(
15450 builtin_dissection_infos,
15451 &(_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.type_id),
15452 (void*)&(_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info));
15454 /* NtpTime_t */
15455 g_strlcpy(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.member_name, "NtpTime_t", MAX_TOPIC_AND_TYPE_LENGTH);
15456 _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.num_elements = NTPTIME_T_NUM_ELEMENTS;
15457 _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE;
15458 _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.type_id = ntptime_t_type_id;
15459 _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, NTPTIME_T_NUM_ELEMENTS);
15460 /* int32 sec */
15461 _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[0].flags = 0;
15462 _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[0].member_id = 0;
15463 _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[0].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE;
15464 g_strlcpy(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[0].member_name, "sec", MAX_TOPIC_AND_TYPE_LENGTH);
15465 /* uint32 frac */
15466 _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[1].flags = 0;
15467 _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[1].member_id = 1;
15468 _builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[1].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE;
15469 g_strlcpy(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[1].member_name, "frac", MAX_TOPIC_AND_TYPE_LENGTH);
15470 wmem_map_insert(
15471 builtin_dissection_infos,
15472 &(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.type_id),
15473 (void*)&(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info));
15475 /* SequenceNumber_t */
15476 g_strlcpy(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.member_name, "SequenceNumber_t", MAX_TOPIC_AND_TYPE_LENGTH);
15477 _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.num_elements = SEQUENCE_NUMBER_T_NUM_ELEMENTS;
15478 _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE;
15479 _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.type_id = sequencenumber_t_type_id;
15480 _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, SEQUENCE_NUMBER_T_NUM_ELEMENTS);
15481 _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[0].flags = 0;
15482 _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[0].member_id = 0;
15483 _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[0].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE;
15484 g_strlcpy(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[0].member_name, "high", MAX_TOPIC_AND_TYPE_LENGTH);
15485 _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[1].flags = 0;
15486 _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[1].member_id = 1;
15487 _builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[1].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE;
15488 g_strlcpy(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[1].member_name, "low", MAX_TOPIC_AND_TYPE_LENGTH);
15489 wmem_map_insert(
15490 builtin_dissection_infos,
15491 &(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.type_id),
15492 (void*)&(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info));
15494 /* Instance transition Data */
15495 g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.member_name, "InstanceTransitionData", MAX_TOPIC_AND_TYPE_LENGTH);
15496 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.num_elements = INSTANCE_TRANSITION_DATA_NUM_ELEMENTS;
15497 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE;
15498 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.type_id = instancetransitiondata_type_id;
15499 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, INSTANCE_TRANSITION_DATA_NUM_ELEMENTS);
15500 wmem_map_insert(
15501 builtin_dissection_infos,
15502 &(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.type_id),
15503 (void*)&(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info));
15505 for (element = 0; element < _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.num_elements; ++element) {
15506 switch (element) {
15507 case 0:
15508 /* @optional KeyHashValue key_hash */
15509 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].flags = MEMBER_OPTIONAL;
15510 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_id = element;
15511 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].type_id = KeyHashValue_type_id;
15512 g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_name, "key_hash", MAX_TOPIC_AND_TYPE_LENGTH);
15513 break;
15514 case 1:
15515 /* @optional SerializedKey serialized_key */
15516 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].flags = MEMBER_OPTIONAL;
15517 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_id = element;
15518 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].type_id = SerializedKey_type_id;
15519 g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_name, "serialized_key", MAX_TOPIC_AND_TYPE_LENGTH);
15520 break;
15521 case 2:
15522 /* NtpTime_t last_update_timestamp */
15523 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].flags = 0;
15524 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_id = element;
15525 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].type_id = ntptime_t_type_id;
15526 g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_name, "last_update_timestamp", MAX_TOPIC_AND_TYPE_LENGTH);
15527 break;
15528 case 3:
15529 /* SequenceNumber_t transition_sequence_number */
15530 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].flags = 0;
15531 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_id = element;
15532 _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].type_id = sequencenumber_t_type_id;
15533 g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_name, "transition_sequence_number", MAX_TOPIC_AND_TYPE_LENGTH);
15534 break;
15538 /* InstanceStateDataResponse
15539 * struct InstanceStateDataResponse {
15540 * @optional sequence<InstanceTransitionData> alive_instances;
15541 * @optional sequence<InstanceTransitionData> disposed_instances;
15542 * @optional sequence<InstanceTransitionData> unregistered_instances;
15543 * GUID_t writer_guid;
15544 * GUID_t reader_guid;
15545 * uint32 reader_group_oid;
15546 * boolean complete_snapshot;
15547 * };
15550 /* This type mapping is not available in the "registry" map. It is used in the function
15551 * rtps_util_get_topic_info when the endopint GUID determines that the type is InstanceStateDataResponse
15553 _builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.type_id = InstanceStateDataResponse_type_id;
15554 _builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.guid.entity_id = ENTITYID_NORMAL_META_GROUP_READER;
15555 _builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.guid.fields_present = GUID_HAS_ALL;
15556 _builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.fields_visited = TOPIC_INFO_ALL_SET;
15557 g_strlcpy(_builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.topic_name, "InstanceStateDataResponse", MAX_TOPIC_AND_TYPE_LENGTH);
15558 g_strlcpy(_builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.type_name, "InstanceStateDataResponse", MAX_TOPIC_AND_TYPE_LENGTH);
15560 g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.member_name, "InstanceStateDataResponse", MAX_TOPIC_AND_TYPE_LENGTH);
15561 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.num_elements = INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS;
15562 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.bound = INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS;
15563 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE;
15564 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS);
15565 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.base_type_id = 0;
15566 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.type_id = InstanceStateDataResponse_type_id;
15567 wmem_map_insert(
15568 builtin_dissection_infos,
15569 &(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.type_id),
15570 (void*)&(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info));
15572 /* sequence_100_InstanceTransitionData */
15573 g_strlcpy(_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.member_name, "sequence_100_InstanceTransitionData", MAX_TOPIC_AND_TYPE_LENGTH);
15574 _builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.num_elements = INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS;
15575 _builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.bound = SEQUENCE_100_IINSTANCE_TRANSITION_DATA_BOUND;
15576 _builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE;
15577 _builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.base_type_id = instancetransitiondata_type_id;
15578 _builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.type_id = sequence_100_InstanceTransitionData_type_id;
15579 wmem_map_insert(
15580 builtin_dissection_infos,
15581 &(_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.type_id),
15582 (void*)&(_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info));
15584 /* @optional sequence<InstanceTransitionData> alive_instances */
15585 for (element = 0; element < _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.num_elements; ++element) {
15586 switch (element) {
15587 case 0:
15588 /* @optional sequence<InstanceTransitionData> alive_instances */
15589 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = MEMBER_OPTIONAL;
15590 g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "alive_instances", MAX_MEMBER_NAME);
15591 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = sequence_100_InstanceTransitionData_type_id;
15592 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
15593 break;
15594 case 1:
15595 /* @optional sequence<InstanceTransitionData> disposed_instances */
15596 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = MEMBER_OPTIONAL;
15597 g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "disposed_instances", MAX_MEMBER_NAME);
15598 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = sequence_100_InstanceTransitionData_type_id;
15599 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
15600 break;
15601 case 2:
15602 /* @optional sequence<InstanceTransitionData> unregistered_instances */
15603 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = MEMBER_OPTIONAL;
15604 g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "unregistered_instances", MAX_MEMBER_NAME);
15605 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = sequence_100_InstanceTransitionData_type_id;
15606 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
15607 break;
15608 case 3:
15609 /* GUID_t writer_guid */
15610 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = 0;
15611 g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "writer_gid", MAX_MEMBER_NAME);
15612 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = guid_t_type_id;
15613 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
15614 break;
15615 case 4:
15616 /* GUID_t reader_guid */
15617 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = 0;
15618 g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "reader_gid", MAX_MEMBER_NAME);
15619 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = guid_t_type_id;
15620 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
15621 break;
15622 case 5:
15623 /* uint32 reader_group_oid */
15624 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = 0;
15625 g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "reader_group_oid", MAX_MEMBER_NAME);
15626 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE;
15627 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
15628 break;
15629 case 6:
15630 /* boolean complete_snapshot */
15631 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = 0;
15632 g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "complete_snapshot", MAX_MEMBER_NAME);
15633 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE;
15634 _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
15635 break;
15640 void proto_register_rtps(void) {
15642 static hf_register_info hf[] = {
15643 { &hf_rtps_ping, {
15644 "Ping String",
15645 "rtps.ping_str",
15646 FT_STRING,
15647 BASE_NONE,
15648 NULL,
15650 "RTPS Ping String",
15651 HFILL }
15653 { &hf_rtps_magic, {
15654 "Magic",
15655 "rtps.magic",
15656 FT_STRING,
15657 BASE_NONE,
15658 NULL,
15660 "RTPS magic",
15661 HFILL }
15663 /* Protocol Version (composed as major.minor) -------------------------- */
15664 { &hf_rtps_protocol_version, {
15665 "version",
15666 "rtps.version",
15667 FT_UINT16,
15668 BASE_HEX,
15669 NULL,
15671 "RTPS protocol version number",
15672 HFILL }
15674 { &hf_rtps_protocol_version_major, {
15675 "major",
15676 "rtps.version.major",
15677 FT_INT8,
15678 BASE_DEC,
15679 NULL,
15681 "RTPS major protocol version number",
15682 HFILL }
15684 { &hf_rtps_protocol_version_minor, {
15685 "minor",
15686 "rtps.version.minor",
15687 FT_INT8,
15688 BASE_DEC,
15689 NULL,
15691 "RTPS minor protocol version number",
15692 HFILL }
15695 /* Domain Participant and Participant Index ---------------------------- */
15696 { &hf_rtps_domain_id, {
15697 "domain_id",
15698 "rtps.domain_id",
15699 FT_UINT32,
15700 BASE_DEC,
15701 NULL,
15703 "Domain ID",
15704 HFILL }
15707 { &hf_rtps_domain_tag, {
15708 "domain_tag",
15709 "rtps.domain_tag",
15710 FT_STRINGZ,
15711 BASE_NONE,
15712 NULL,
15714 "Domain Tag ID",
15715 HFILL }
15718 { &hf_rtps_participant_idx, {
15719 "participant_idx",
15720 "rtps.participant_idx",
15721 FT_UINT32,
15722 BASE_DEC,
15723 NULL,
15725 "Participant index",
15726 HFILL }
15728 { &hf_rtps_nature_type, {
15729 "traffic_nature",
15730 "rtps.traffic_nature",
15731 FT_UINT32,
15732 BASE_DEC,
15733 VALS(nature_type_vals),
15735 "Nature of the traffic (meta/user-traffic uni/multi-cast)",
15736 HFILL }
15739 /* Vendor ID ----------------------------------------------------------- */
15740 { &hf_rtps_vendor_id, {
15741 "vendorId",
15742 "rtps.vendorId",
15743 FT_UINT16,
15744 BASE_HEX,
15745 NULL,
15747 "Unique identifier of the DDS vendor that generated this packet",
15748 HFILL }
15751 /* Guid Prefix for the Packet ------------------------------------------ */
15752 { &hf_rtps_guid_prefix_v1,
15753 { "guidPrefix", "rtps.guidPrefix_v1",
15754 FT_UINT64, BASE_HEX, NULL, 0,
15755 "GuidPrefix of the RTPS packet", HFILL }
15758 { &hf_rtps_guid_prefix,
15759 { "guidPrefix", "rtps.guidPrefix",
15760 FT_BYTES, BASE_NONE, NULL, 0,
15761 "a generic guidPrefix that is transmitted inside the submessage (this is NOT the guidPrefix described in the packet header)", HFILL }
15764 { &hf_rtps_guid_prefix_src,
15765 { "guidPrefix", "rtps.guidPrefix.src",
15766 FT_BYTES, BASE_NONE, NULL, 0,
15767 "the guidPrefix of the entity sending the sample", HFILL }
15770 { &hf_rtps_guid_prefix_dst,
15771 { "guidPrefix", "rtps.guidPrefix.dst",
15772 FT_BYTES, BASE_NONE, NULL, 0,
15773 "the guidPrefix of the entity receiving the sample", HFILL }
15776 /* Host ID ------------------------------------------------------------- */
15777 { &hf_rtps_host_id, { /* HIDDEN */
15778 "hostId",
15779 "rtps.hostId",
15780 FT_UINT32,
15781 BASE_HEX,
15782 NULL,
15784 "Sub-component 'hostId' of the GuidPrefix of the RTPS packet",
15785 HFILL }
15788 /* AppID (composed as instanceId, appKind) ----------------------------- */
15789 { &hf_rtps_app_id, {
15790 "appId",
15791 "rtps.appId",
15792 FT_UINT32,
15793 BASE_HEX,
15794 NULL,
15796 "Sub-component 'appId' of the GuidPrefix of the RTPS packet",
15797 HFILL }
15799 { &hf_rtps_app_id_instance_id, {
15800 "appId.instanceId",
15801 "rtps.appId.instanceId",
15802 FT_UINT24,
15803 BASE_HEX,
15804 NULL,
15806 "'instanceId' field of the 'AppId' structure",
15807 HFILL }
15809 { &hf_rtps_app_id_app_kind, {
15810 "appid.appKind",
15811 "rtps.appId.appKind",
15812 FT_UINT8,
15813 BASE_HEX,
15814 VALS(app_kind_vals),
15816 "'appKind' field of the 'AppId' structure",
15817 HFILL }
15822 /* Submessage ID ------------------------------------------------------- */
15823 { &hf_rtps_sm_id, {
15824 "submessageId",
15825 "rtps.sm.id",
15826 FT_UINT8,
15827 BASE_HEX,
15828 VALS(submessage_id_vals),
15830 "defines the type of submessage",
15831 HFILL }
15834 { &hf_rtps_sm_idv2, {
15835 "submessageId",
15836 "rtps.sm.id",
15837 FT_UINT8,
15838 BASE_HEX,
15839 VALS(submessage_id_valsv2),
15841 "defines the type of submessage",
15842 HFILL }
15845 /* Submessage flags ---------------------------------------------------- */
15846 { &hf_rtps_sm_flags, {
15847 "Flags",
15848 "rtps.sm.flags",
15849 FT_UINT8,
15850 BASE_HEX,
15851 NULL,
15853 "bitmask representing the flags associated with a submessage",
15854 HFILL }
15856 { &hf_rtps_sm_flags2, {
15857 "Flags",
15858 "rtps.sm.flags",
15859 FT_UINT16,
15860 BASE_HEX,
15861 NULL,
15863 "bitmask representing the flags associated with a submessage",
15864 HFILL }
15867 /* octets to next header ---------------------------------------------- */
15868 { &hf_rtps_sm_octets_to_next_header, {
15869 "octetsToNextHeader",
15870 "rtps.sm.octetsToNextHeader",
15871 FT_UINT16,
15872 BASE_DEC,
15873 NULL,
15875 "Size of the submessage payload",
15876 HFILL }
15879 /* GUID as {GuidPrefix, EntityId} ------------------------------------ */
15880 { &hf_rtps_sm_guid_prefix_v1, {
15881 "guidPrefix",
15882 "rtps.sm.guidPrefix_v1",
15883 FT_UINT64,
15884 BASE_HEX,
15885 NULL,
15887 "a generic guidPrefix that is transmitted inside the submessage (this is NOT the guidPrefix described in the packet header)",
15888 HFILL }
15891 { &hf_rtps_sm_guid_prefix, {
15892 "guidPrefix",
15893 "rtps.sm.guidPrefix",
15894 FT_BYTES,
15895 BASE_NONE,
15896 NULL,
15898 "a generic guidPrefix that is transmitted inside the submessage (this is NOT the guidPrefix described in the packet header)",
15899 HFILL }
15902 { &hf_rtps_sm_host_id, {
15903 "host_id",
15904 "rtps.sm.guidPrefix.hostId",
15905 FT_UINT32,
15906 BASE_HEX,
15907 NULL,
15909 "The hostId component of the rtps.sm.guidPrefix",
15910 HFILL }
15913 { &hf_rtps_sm_app_id, {
15914 "appId",
15915 "rtps.sm.guidPrefix.appId",
15916 FT_UINT32,
15917 BASE_HEX,
15918 NULL,
15920 "AppId component of the rtps.sm.guidPrefix",
15921 HFILL }
15923 { &hf_rtps_sm_instance_id_v1, {
15924 "instanceId",
15925 "rtps.sm.guidPrefix.appId.instanceId",
15926 FT_UINT24,
15927 BASE_HEX,
15928 NULL,
15930 "instanceId component of the AppId of the rtps.sm.guidPrefix",
15931 HFILL }
15933 { &hf_rtps_sm_app_kind, {
15934 "appKind",
15935 "rtps.sm.guidPrefix.appId.appKind",
15936 FT_UINT8,
15937 BASE_HEX,
15938 NULL,
15940 "appKind component of the AppId of the rtps.sm.guidPrefix",
15941 HFILL }
15943 { &hf_rtps_sm_instance_id, {
15944 "instanceId",
15945 "rtps.sm.guidPrefix.instanceId",
15946 FT_UINT32,
15947 BASE_HEX,
15948 NULL,
15950 "instanceId component of the rtps.sm.guidPrefix",
15951 HFILL }
15954 /* Entity ID (composed as entityKey, entityKind) ----------------------- */
15955 { &hf_rtps_sm_entity_id, {
15956 "entityId",
15957 "rtps.sm.entityId",
15958 FT_UINT32,
15959 BASE_HEX,
15960 VALS(entity_id_vals),
15962 "Object entity ID as it appears in a DATA submessage (keyHashSuffix)",
15963 HFILL }
15965 { &hf_rtps_sm_entity_id_key, {
15966 "entityKey",
15967 "rtps.sm.entityId.entityKey",
15968 FT_UINT24,
15969 BASE_HEX,
15970 NULL,
15972 "'entityKey' field of the object entity ID",
15973 HFILL }
15975 { &hf_rtps_sm_entity_id_kind, {
15976 "entityKind",
15977 "rtps.sm.entityId.entityKind",
15978 FT_UINT8,
15979 BASE_HEX,
15980 VALS(entity_kind_vals),
15982 "'entityKind' field of the object entity ID",
15983 HFILL }
15986 { &hf_rtps_sm_rdentity_id, {
15987 "readerEntityId",
15988 "rtps.sm.rdEntityId",
15989 FT_UINT32,
15990 BASE_HEX,
15991 VALS(entity_id_vals),
15993 "Reader entity ID as it appears in a submessage",
15994 HFILL }
15996 { &hf_rtps_sm_rdentity_id_key, {
15997 "readerEntityKey",
15998 "rtps.sm.rdEntityId.entityKey",
15999 FT_UINT24,
16000 BASE_HEX,
16001 NULL,
16003 "'entityKey' field of the reader entity ID",
16004 HFILL }
16006 { &hf_rtps_sm_rdentity_id_kind, {
16007 "readerEntityKind",
16008 "rtps.sm.rdEntityId.entityKind",
16009 FT_UINT8,
16010 BASE_HEX,
16011 VALS(entity_kind_vals),
16013 "'entityKind' field of the reader entity ID",
16014 HFILL }
16017 { &hf_rtps_sm_wrentity_id, {
16018 "writerEntityId",
16019 "rtps.sm.wrEntityId",
16020 FT_UINT32,
16021 BASE_HEX,
16022 VALS(entity_id_vals),
16024 "Writer entity ID as it appears in a submessage",
16025 HFILL }
16027 { &hf_rtps_sm_wrentity_id_key, {
16028 "writerEntityKey",
16029 "rtps.sm.wrEntityId.entityKey",
16030 FT_UINT24,
16031 BASE_HEX,
16032 NULL,
16034 "'entityKey' field of the writer entity ID",
16035 HFILL }
16037 { &hf_rtps_sm_wrentity_id_kind, {
16038 "writerEntityKind",
16039 "rtps.sm.wrEntityId.entityKind",
16040 FT_UINT8,
16041 BASE_HEX,
16042 VALS(entity_kind_vals),
16044 "'entityKind' field of the writer entity ID",
16045 HFILL }
16050 /* Sequence number ----------------------------------------------------- */
16051 { &hf_rtps_sm_seq_number, {
16052 "writerSeqNumber",
16053 "rtps.sm.seqNumber",
16054 FT_INT64,
16055 BASE_DEC,
16056 NULL,
16058 "Writer sequence number",
16059 HFILL }
16062 { &hf_rtps_info_src_ip, {
16063 "appIpAddress",
16064 "rtps.info_src.ip",
16065 FT_IPv4,
16066 BASE_NONE,
16067 NULL,
16069 NULL,
16070 HFILL }
16073 { &hf_rtps_info_src_unused, {
16074 "Unused",
16075 "rtps.info_src.unused",
16076 FT_UINT32,
16077 BASE_HEX,
16078 NULL,
16080 NULL,
16081 HFILL }
16084 /* Parameter Id -------------------------------------------------------- */
16085 { &hf_rtps_parameter_id, {
16086 "parameterId",
16087 "rtps.param.id",
16088 FT_UINT16,
16089 BASE_HEX,
16090 VALS(parameter_id_vals),
16092 "Parameter Id",
16093 HFILL }
16096 { &hf_rtps_parameter_id_v2, {
16097 "parameterId",
16098 "rtps.param.id",
16099 FT_UINT16,
16100 BASE_HEX,
16101 VALS(parameter_id_v2_vals),
16103 "Parameter Id",
16104 HFILL }
16107 { &hf_rtps_parameter_id_inline_rti, {
16108 "Parameter Id", "rtps.param.id", FT_UINT16,
16109 BASE_HEX, VALS(parameter_id_inline_qos_rti), 0, NULL, HFILL }
16112 { &hf_rtps_parameter_id_toc, {
16113 "parameterId",
16114 "rtps.param.id",
16115 FT_UINT16,
16116 BASE_HEX,
16117 VALS(parameter_id_toc_vals),
16119 "Parameter Id",
16120 HFILL }
16123 { &hf_rtps_parameter_id_rti, {
16124 "parameterId",
16125 "rtps.param.id",
16126 FT_UINT16,
16127 BASE_HEX,
16128 VALS(parameter_id_rti_vals),
16130 "Parameter Id",
16131 HFILL }
16134 { &hf_rtps_parameter_id_adl, {
16135 "parameterId",
16136 "rtps.param.id",
16137 FT_UINT16,
16138 BASE_HEX,
16139 VALS(parameter_id_adl_vals),
16141 "Parameter Id",
16142 HFILL }
16145 /* Parameter Length ---------------------------------------------------- */
16146 { &hf_rtps_parameter_length, {
16147 "parameterLength",
16148 "rtps.param.length",
16149 FT_UINT16,
16150 BASE_DEC,
16151 NULL,
16153 "Parameter Length",
16154 HFILL }
16157 /* String Length ---------------------------------------------------- */
16158 { &hf_rtps_string_length, {
16159 "String length",
16160 "rtps.param.string.length",
16161 FT_UINT32,
16162 BASE_DEC,
16163 NULL,
16165 NULL,
16166 HFILL }
16169 /* Parameter / Topic --------------------------------------------------- */
16170 { &hf_rtps_param_topic_name, {
16171 "topic",
16172 "rtps.param.topicName",
16173 FT_STRINGZ,
16174 BASE_NONE,
16175 NULL,
16177 "String representing the value value of a PID_TOPIC parameter",
16178 HFILL }
16181 /* Parameter / Strength ------------------------------------------------ */
16182 { &hf_rtps_param_strength, {
16183 "strength",
16184 "rtps.param.strength",
16185 FT_INT32,
16186 BASE_DEC,
16187 NULL,
16189 "Decimal value representing the value of a PID_OWNERSHIP_STRENGTH parameter",
16190 HFILL }
16193 /* Parameter / Type Name ----------------------------------------------- */
16194 { &hf_rtps_param_type_name, {
16195 "typeName",
16196 "rtps.param.typeName",
16197 FT_STRINGZ,
16198 BASE_NONE,
16199 NULL,
16201 "String representing the value of a PID_TYPE_NAME parameter",
16202 HFILL }
16205 /* Parameter / User Data ----------------------------------------------- */
16206 { &hf_rtps_param_user_data, {
16207 "userData",
16208 "rtps.param.userData",
16209 FT_BYTES,
16210 BASE_NONE,
16211 NULL,
16213 "The user data sent in a PID_USER_DATA parameter",
16214 HFILL }
16217 /* Parameter / Group Data ---------------------------------------------- */
16218 { &hf_rtps_param_group_data, {
16219 "groupData",
16220 "rtps.param.groupData",
16221 FT_BYTES,
16222 BASE_NONE,
16223 NULL,
16225 "The user data sent in a PID_GROUP_DATA parameter",
16226 HFILL }
16229 { &hf_rtps_transportInfo_classId, {
16230 "classID",
16231 "rtps.transportInfo.classID",
16232 FT_INT32,
16233 BASE_DEC,
16234 NULL,
16236 "Class ID of transport",
16237 HFILL }
16240 { &hf_rtps_transportInfo_messageSizeMax, {
16241 "messageSizeMax",
16242 "rtps.transportInfo.messageSizeMax",
16243 FT_INT32,
16244 BASE_DEC,
16245 NULL,
16247 "Maximum message size of transport",
16248 HFILL }
16250 { &hf_rtps_coherent_set_start, {
16251 "Coherent set start",
16252 "rtps.coherent_set.start",
16253 FT_UINT64,
16254 BASE_DEC,
16255 NULL,
16257 "Start of a coherent set",
16258 HFILL }
16261 { &hf_rtps_coherent_set_end, {
16262 "End of coherent set sequence",
16263 "rtps.coherent_set.end",
16264 FT_UINT64,
16265 BASE_DEC,
16266 NULL,
16268 "End of a coherent set",
16269 HFILL }
16272 /* Parameter / Topic Data ---------------------------------------------- */
16273 { &hf_rtps_param_topic_data, {
16274 "topicData",
16275 "rtps.param.topicData",
16276 FT_BYTES,
16277 BASE_NONE,
16278 NULL,
16280 "The user data sent in a PID_TOPIC_DATA parameter",
16281 HFILL }
16285 /* Parameter / Content Filter Name ------------------------------------- */
16286 { &hf_rtps_param_content_filter_topic_name, {
16287 "contentFilterTopicName",
16288 "rtps.param.contentFilterTopicName",
16289 FT_STRINGZ,
16290 BASE_NONE,
16291 NULL,
16293 "Value of the content filter topic name as sent in a PID_CONTENT_FILTER_PROPERTY parameter",
16294 HFILL }
16296 { &hf_rtps_param_related_topic_name, {
16297 "relatedTopicName",
16298 "rtps.param.relatedTopicName",
16299 FT_STRINGZ,
16300 BASE_NONE,
16301 NULL,
16303 "Value of the related topic name as sent in a PID_CONTENT_FILTER_PROPERTY parameter",
16304 HFILL }
16306 { &hf_rtps_param_filter_class_name, {
16307 "filterClassName",
16308 "rtps.param.filterClassName",
16309 FT_STRINGZ,
16310 BASE_NONE,
16311 NULL,
16313 "Value of the filter class name as sent in a PID_CONTENT_FILTER_PROPERTY parameter",
16314 HFILL }
16317 { &hf_rtps_durability_service_cleanup_delay,
16318 { "Service Cleanup Delay", "rtps.durability.service_cleanup_delay",
16319 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
16320 "Time using the RTPS time_t standard format", HFILL }
16323 { &hf_rtps_liveliness_lease_duration,
16324 { "Lease Duration", "rtps.liveliness.lease_duration",
16325 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
16326 "Time using the RTPS time_t standard format", HFILL }
16329 { &hf_rtps_participant_lease_duration,
16330 { "Duration", "rtps.participant_lease_duration",
16331 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
16332 "Time using the RTPS time_t standard format", HFILL }
16335 { &hf_rtps_time_based_filter_minimum_separation,
16336 { "Minimum Separation", "rtps.time_based_filter.minimum_separation",
16337 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
16338 "Time using the RTPS time_t standard format", HFILL }
16341 { &hf_rtps_reliability_max_blocking_time,
16342 { "Max Blocking Time", "rtps.reliability.max_blocking_time",
16343 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
16344 "Time using the RTPS time_t standard format", HFILL }
16347 { &hf_rtps_deadline_period,
16348 { "Period", "rtps.deadline_period",
16349 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
16350 "Time using the RTPS time_t standard format", HFILL }
16353 { &hf_rtps_latency_budget_duration,
16354 { "Duration", "rtps.latency_budget.duration",
16355 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
16356 "Time using the RTPS time_t standard format", HFILL }
16359 { &hf_rtps_lifespan_duration,
16360 { "Duration", "rtps.lifespan",
16361 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
16362 "Time using the RTPS time_t standard format", HFILL }
16365 { &hf_rtps_persistence,
16366 { "Persistence", "rtps.persistence",
16367 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
16368 "Time using the RTPS time_t standard format", HFILL }
16371 { &hf_rtps_info_ts_timestamp,
16372 { "Timestamp", "rtps.info_ts.timestamp",
16373 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
16374 "Time using the RTPS time_t standard format", HFILL }
16377 { &hf_rtps_timestamp,
16378 { "Timestamp", "rtps.timestamp",
16379 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
16380 "Time using the RTPS time_t standard format", HFILL }
16383 { &hf_rtps_locator_kind,
16384 { "Kind", "rtps.locator.kind",
16385 FT_UINT32, BASE_HEX, VALS(rtps_locator_kind_vals), 0,
16386 NULL, HFILL }
16389 { &hf_rtps_locator_port,
16390 { "Port", "rtps.locator.port",
16391 FT_UINT32, BASE_DEC, NULL, 0,
16392 NULL, HFILL }
16394 #if 0
16395 { &hf_rtps_logical_port,
16396 { "RTPS Logical Port", "rtps.locator.port",
16397 FT_INT32, BASE_DEC, NULL, 0,
16398 NULL, HFILL }
16400 #endif
16401 { &hf_rtps_locator_public_address_port,
16402 { "Public Address Port", "rtps.locator.public_address_port",
16403 FT_INT32, BASE_DEC, NULL, 0,
16404 NULL, HFILL }
16407 { &hf_rtps_locator_ipv4,
16408 { "Address", "rtps.locator.ipv4",
16409 FT_IPv4, BASE_NONE, NULL, 0,
16410 NULL, HFILL }
16413 { &hf_rtps_locator_ipv6,
16414 { "Address", "rtps.locator.ipv6",
16415 FT_IPv6, BASE_NONE, NULL, 0,
16416 NULL, HFILL }
16419 { &hf_rtps_participant_builtin_endpoints,
16420 { "BuiltIn Endpoint", "rtps.participant_builtin_endpoints",
16421 FT_UINT32, BASE_HEX, NULL, 0,
16422 NULL, HFILL }
16425 { &hf_rtps_participant_manual_liveliness_count,
16426 { "Manual Liveliness Count", "rtps.participant_manual_liveliness_count",
16427 FT_UINT32, BASE_HEX, NULL, 0,
16428 NULL, HFILL }
16431 { &hf_rtps_history_depth,
16432 { "Depth", "rtps.history_depth",
16433 FT_INT32, BASE_DEC, NULL, 0,
16434 NULL, HFILL }
16437 { &hf_rtps_resource_limit_max_samples,
16438 { "Max Samples", "rtps.resource_limit.max_samples",
16439 FT_INT32, BASE_DEC, NULL, 0,
16440 NULL, HFILL }
16443 { &hf_rtps_resource_limit_max_instances,
16444 { "Max Instances", "rtps.resource_limit.max_instances",
16445 FT_INT32, BASE_DEC, NULL, 0,
16446 NULL, HFILL }
16449 { &hf_rtps_resource_limit_max_samples_per_instances,
16450 { "Max Samples Per Instance", "rtps.resource_limit.max_samples_per_instance",
16451 FT_INT32, BASE_DEC, NULL, 0,
16452 NULL, HFILL }
16455 { &hf_rtps_filter_bitmap,
16456 { "Filter Bitmap", "rtps.filter_bitmap",
16457 FT_UINT32, BASE_HEX, NULL, 0,
16458 NULL, HFILL }
16461 { &hf_rtps_type_checksum,
16462 { "Checksum", "rtps.type_checksum",
16463 FT_UINT32, BASE_HEX, NULL, 0,
16464 NULL, HFILL }
16467 { &hf_rtps_queue_size,
16468 { "queueSize", "rtps.queue_size",
16469 FT_UINT32, BASE_HEX, NULL, 0,
16470 NULL, HFILL }
16473 { &hf_rtps_acknack_count,
16474 { "Count", "rtps.acknack.count",
16475 FT_INT32, BASE_DEC, NULL, 0,
16476 NULL, HFILL }
16479 { &hf_rtps_param_app_ack_virtual_writer_count,
16480 { "virtualWriterCount", "rtps.app_ack.virtual_writer_count",
16481 FT_INT32, BASE_DEC, NULL, 0,
16482 NULL, HFILL }
16485 { &hf_rtps_param_app_ack_count,
16486 { "count", "rtps.app_ack.count",
16487 FT_INT32, BASE_DEC, NULL, 0,
16488 NULL, HFILL }
16491 { &hf_rtps_param_app_ack_conf_virtual_writer_count,
16492 { "virtualWriterCount", "rtps.app_ack_conf.virtual_writer_count",
16493 FT_UINT32, BASE_DEC, NULL, 0,
16494 NULL, HFILL }
16497 { &hf_rtps_param_app_ack_conf_count,
16498 { "count", "rtps.app_ack_conf.count",
16499 FT_INT32, BASE_DEC, NULL, 0,
16500 NULL, HFILL }
16503 { &hf_rtps_param_app_ack_interval_payload_length,
16504 { "intervalPayloadLength", "rtps.app_ack.interval_payload_length",
16505 FT_INT16, BASE_DEC, NULL, 0,
16506 NULL, HFILL }
16509 { &hf_rtps_param_app_ack_interval_flags,
16510 { "intervalFlags", "rtps.app_ack.interval_flags",
16511 FT_INT16, BASE_DEC, NULL, 0,
16512 NULL, HFILL }
16515 { &hf_rtps_param_app_ack_interval_count,
16516 { "intervalCount", "rtps.app_ack.interval_count",
16517 FT_INT16, BASE_DEC, NULL, 0,
16518 NULL, HFILL }
16521 { &hf_rtps_param_app_ack_octets_to_next_virtual_writer,
16522 { "octetsToNextVirtualWriter", "rtps.app_ack.octets_to_next_virtual_writer",
16523 FT_INT16, BASE_DEC, NULL, 0,
16524 NULL, HFILL }
16527 { &hf_rtps_durability_service_history_kind,
16528 { "History Kind", "rtps.durability_service.history_kind",
16529 FT_UINT32, BASE_HEX, VALS(history_qos_vals), 0,
16530 NULL, HFILL }
16533 { &hf_rtps_durability_service_history_depth,
16534 { "History Depth", "rtps.durability_service.history_depth",
16535 FT_INT32, BASE_DEC, NULL, 0,
16536 NULL, HFILL }
16539 { &hf_rtps_durability_service_max_samples,
16540 { "Max Samples", "rtps.durability_service.max_samples",
16541 FT_INT32, BASE_DEC, NULL, 0,
16542 NULL, HFILL }
16545 { &hf_rtps_durability_service_max_instances,
16546 { "Max Instances", "rtps.durability_service.max_instances",
16547 FT_INT32, BASE_DEC, NULL, 0,
16548 NULL, HFILL }
16551 { &hf_rtps_durability_service_max_samples_per_instances,
16552 { "Max Samples Per Instance", "rtps.durability_service.max_samples_per_instance",
16553 FT_INT32, BASE_DEC, NULL, 0,
16554 NULL, HFILL }
16557 { &hf_rtps_liveliness_kind,
16558 { "Kind", "rtps.liveliness.kind",
16559 FT_UINT32, BASE_HEX, VALS(liveliness_qos_vals), 0,
16560 NULL, HFILL }
16563 { &hf_rtps_manager_key,
16564 { "Key", "rtps.manager_key",
16565 FT_UINT32, BASE_HEX, NULL, 0,
16566 NULL, HFILL }
16569 { &hf_rtps_locator_udp_v4,
16570 { "Address", "rtps.locator_udp_v4.ip",
16571 FT_IPv4, BASE_NONE, NULL, 0,
16572 NULL, HFILL }
16575 { &hf_rtps_locator_udp_v4_port,
16576 { "Port", "rtps.locator_udp_v4.port",
16577 FT_UINT32, BASE_HEX, NULL, 0,
16578 NULL, HFILL }
16581 { &hf_param_ip_address,
16582 { "Address", "rtps.param.ip_address",
16583 FT_IPv4, BASE_NONE, NULL, 0,
16584 NULL, HFILL }
16587 { &hf_rtps_param_port,
16588 { "Port", "rtps.param.port",
16589 FT_UINT32, BASE_HEX, NULL, 0,
16590 NULL, HFILL }
16593 { &hf_rtps_expects_inline_qos,
16594 { "Inline QoS", "rtps.expects_inline_qos",
16595 FT_BOOLEAN, BASE_NONE, NULL, 0,
16596 NULL, HFILL }
16599 { &hf_rtps_presentation_coherent_access,
16600 { "Coherent Access", "rtps.presentation.coherent_access",
16601 FT_BOOLEAN, BASE_NONE, NULL, 0,
16602 NULL, HFILL }
16605 { &hf_rtps_presentation_ordered_access,
16606 { "Ordered Access", "rtps.presentation.ordered_access",
16607 FT_BOOLEAN, BASE_NONE, NULL, 0,
16608 NULL, HFILL }
16611 { &hf_rtps_direct_communication,
16612 { "Direct Communication", "rtps.direct_communication",
16613 FT_BOOLEAN, BASE_NONE, NULL, 0,
16614 NULL, HFILL }
16617 { &hf_rtps_expects_ack,
16618 { "expectsAck", "rtps.expects_ack",
16619 FT_BOOLEAN, BASE_NONE, NULL, 0,
16620 NULL, HFILL }
16623 { &hf_rtps_expects_virtual_heartbeat,
16624 { "expectsVirtualHB", "rtps.expects_virtual_heartbeat",
16625 FT_BOOLEAN, BASE_NONE, NULL, 0,
16626 NULL, HFILL }
16629 { &hf_rtps_reliability_kind,
16630 { "Kind", "rtps.reliability_kind",
16631 FT_UINT32, BASE_HEX, VALS(reliability_qos_vals), 0,
16632 NULL, HFILL }
16635 { &hf_rtps_durability,
16636 { "Durability", "rtps.durability",
16637 FT_UINT32, BASE_HEX, VALS(durability_qos_vals), 0,
16638 NULL, HFILL }
16641 { &hf_rtps_ownership,
16642 { "Kind", "rtps.ownership",
16643 FT_UINT32, BASE_HEX, VALS(ownership_qos_vals), 0,
16644 NULL, HFILL }
16647 { &hf_rtps_presentation_access_scope,
16648 { "Access Scope", "rtps.presentation.access_scope",
16649 FT_UINT32, BASE_HEX, VALS(presentation_qos_vals), 0,
16650 NULL, HFILL }
16653 { &hf_rtps_destination_order,
16654 { "Kind", "rtps.destination_order",
16655 FT_UINT32, BASE_HEX, VALS(destination_order_qos_vals), 0,
16656 NULL, HFILL }
16659 { &hf_rtps_history_kind,
16660 { "Kind", "rtps.history.kind",
16661 FT_UINT32, BASE_HEX, VALS(history_qos_vals), 0,
16662 NULL, HFILL }
16665 { &hf_rtps_data_status_info,
16666 { "statusInfo", "rtps.data.status_info",
16667 FT_UINT32, BASE_HEX, NULL, 0,
16668 NULL, HFILL }
16671 { &hf_rtps_param_serialize_encap_kind,
16672 { "encapsulation kind", "rtps.param.serialize.encap_kind",
16673 FT_UINT16, BASE_HEX, VALS(encapsulation_id_vals), 0,
16674 NULL, HFILL }
16677 { &hf_rtps_param_serialize_encap_len,
16678 { "encapsulation options", "rtps.param.serialize.encap_len",
16679 FT_UINT16, BASE_HEX, NULL, 0,
16680 NULL, HFILL }
16683 /* Parameter / NtpTime ------------------------------------------------- */
16684 { &hf_rtps_param_timestamp_sec, {
16685 "seconds", "rtps.param.ntpTime.sec",
16686 FT_INT32, BASE_DEC, NULL, 0,
16687 "The 'second' component of an RTPS time_t",
16688 HFILL }
16691 { &hf_rtps_param_timestamp_fraction, {
16692 "fraction", "rtps.param.ntpTime.fraction",
16693 FT_UINT32, BASE_DEC, NULL, 0,
16694 "The 'fraction' component of an RTPS time_t",
16695 HFILL }
16698 { &hf_rtps_param_transport_priority,
16699 { "Value", "rtps.param.transport_priority",
16700 FT_UINT32, BASE_DEC, NULL, 0,
16701 NULL, HFILL }
16704 { &hf_rtps_param_type_max_size_serialized,
16705 { "Value", "rtps.param.type_max_size_serialized",
16706 FT_UINT32, BASE_DEC, NULL, 0,
16707 NULL, HFILL }
16710 { &hf_rtps_param_peer_host_epoch,
16711 { "Peer Host Epoch", "rtps.param.peer_host_epoch",
16712 FT_UINT32, BASE_DEC, NULL, 0,
16713 NULL, HFILL }
16716 { &hf_rtps_param_endpoint_property_change_epoch,
16717 { "Endpoint Property Change Epoch", "rtps.param.endpoint_property_change_epoch",
16718 FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL }
16721 { &hf_rtps_param_entity_name,
16722 { "entityName", "rtps.param.entityName",
16723 FT_STRINGZ, BASE_NONE, NULL, 0,
16724 "String representing the name of the entity addressed by the submessage",
16725 HFILL }
16728 { &hf_rtps_param_role_name,
16729 { "roleName", "rtps.param.roleName",
16730 FT_STRINGZ, BASE_NONE, NULL, 0,
16731 "String representing the role name of the entity addressed by the submessage",
16732 HFILL }
16735 { &hf_rtps_disable_positive_ack,
16736 { "disablePositiveAcks", "rtps.disable_positive_ack",
16737 FT_BOOLEAN, BASE_NONE, NULL, 0,
16738 NULL, HFILL }
16741 { &hf_rtps_participant_guid_v1,
16742 { "Participant GUID", "rtps.param.participant_guid_v1",
16743 FT_UINT64, BASE_HEX, NULL, 0,
16744 NULL, HFILL }
16747 { &hf_rtps_participant_guid,
16748 { "Participant GUID", "rtps.param.participant_guid",
16749 FT_BYTES, BASE_NONE, NULL, 0,
16750 NULL, HFILL }
16753 { &hf_rtps_group_guid_v1,
16754 { "Group GUID", "rtps.param.group_guid_v1",
16755 FT_UINT64, BASE_HEX, NULL, 0,
16756 NULL, HFILL }
16759 { &hf_rtps_group_guid,
16760 { "Group GUID", "rtps.param.group_guid",
16761 FT_BYTES, BASE_NONE, NULL, 0,
16762 NULL, HFILL }
16765 { &hf_rtps_endpoint_guid,
16766 { "Endpoint GUID", "rtps.param.endpoint_guid",
16767 FT_BYTES, BASE_NONE, NULL, 0,
16768 NULL, HFILL }
16771 { &hf_rtps_param_host_id,
16772 { "hostId", "rtps.param.guid.hostId",
16773 FT_UINT32, BASE_HEX, NULL, 0,
16774 NULL, HFILL }
16777 { &hf_rtps_param_app_id,
16778 { "appId", "rtps.param.guid.appId",
16779 FT_UINT32, BASE_HEX, NULL, 0,
16780 NULL, HFILL }
16783 { &hf_rtps_param_instance_id_v1,
16784 { "instanceId", "rtps.param.guid.instanceId",
16785 FT_UINT24, BASE_HEX, NULL, 0,
16786 NULL, HFILL }
16789 { &hf_rtps_param_instance_id,
16790 { "instanceId", "rtps.param.guid.instanceId",
16791 FT_UINT32, BASE_HEX, NULL, 0,
16792 NULL, HFILL }
16795 { &hf_rtps_param_app_kind,
16796 { "instanceId", "rtps.param.guid.appKind",
16797 FT_UINT8, BASE_HEX, NULL, 0,
16798 NULL, HFILL }
16801 { &hf_rtps_param_entity,
16802 { "entityId", "rtps.param.guid.entityId",
16803 FT_UINT32, BASE_HEX, VALS(entity_id_vals), 0,
16804 NULL, HFILL }
16807 { &hf_rtps_param_entity_key,
16808 { "entityKey", "rtps.param.guid.entityKey",
16809 FT_UINT24, BASE_HEX, NULL, 0,
16810 NULL, HFILL }
16813 { &hf_rtps_param_entity_kind,
16814 { "entityKind", "rtps.param.guid.entityKind",
16815 FT_UINT8, BASE_HEX, VALS(entity_kind_vals), 0,
16816 NULL, HFILL }
16819 { &hf_rtps_param_extended_pid_length,
16820 { "Extended Length", "rtps.param.extended_pid_length",
16821 FT_UINT32, BASE_HEX, NULL, 0,
16822 NULL, HFILL }
16825 { &hf_rtps_param_extended_parameter,
16826 { "Extended Parameter", "rtps.param.extended_parameter",
16827 FT_UINT32, BASE_HEX, NULL, 0,
16828 NULL, HFILL }
16831 { &hf_rtps_data_frag_number,
16832 { "fragmentStartingNum", "rtps.data_frag.number",
16833 FT_UINT32, BASE_DEC, NULL, 0,
16834 NULL, HFILL }
16837 { &hf_rtps_data_frag_sample_size,
16838 { "sampleSize", "rtps.data_frag.sample_size",
16839 FT_UINT32, BASE_DEC, NULL, 0,
16840 NULL, HFILL }
16843 { &hf_rtps_data_frag_num_fragments,
16844 { "fragmentsInSubmessage", "rtps.data_frag.num_fragments",
16845 FT_UINT16, BASE_DEC, NULL, 0,
16846 NULL, HFILL }
16849 { &hf_rtps_data_frag_size,
16850 { "fragmentSize", "rtps.data_frag.size",
16851 FT_UINT16, BASE_DEC, NULL, 0,
16852 NULL, HFILL }
16855 { &hf_rtps_nokey_data_frag_number,
16856 { "fragmentStartingNum", "rtps.nokey_data_frag.number",
16857 FT_UINT32, BASE_DEC, NULL, 0,
16858 NULL, HFILL }
16861 { &hf_rtps_nokey_data_frag_num_fragments,
16862 { "fragmentsInSubmessage", "rtps.nokey_data_frag.num_fragments",
16863 FT_UINT16, BASE_DEC, NULL, 0,
16864 NULL, HFILL }
16867 { &hf_rtps_nokey_data_frag_size,
16868 { "fragmentSize", "rtps.nokey_data_frag.size",
16869 FT_UINT16, BASE_DEC, NULL, 0,
16870 NULL, HFILL }
16873 { &hf_rtps_nack_frag_count,
16874 { "Count", "rtps.nack_frag.count",
16875 FT_INT32, BASE_DEC, NULL, 0,
16876 NULL, HFILL }
16879 { &hf_rtps_heartbeat_frag_number,
16880 { "lastFragmentNum", "rtps.heartbeat_frag.number",
16881 FT_UINT32, BASE_DEC, NULL, 0,
16882 NULL, HFILL }
16885 { &hf_rtps_heartbeat_frag_count,
16886 { "Count", "rtps.heartbeat_frag.count",
16887 FT_UINT32, BASE_DEC, NULL, 0,
16888 NULL, HFILL }
16891 { &hf_rtps_heartbeat_batch_count,
16892 { "Count", "rtps.heartbeat_batch.count",
16893 FT_UINT32, BASE_DEC, NULL, 0,
16894 NULL, HFILL }
16897 { &hf_rtps_virtual_heartbeat_count,
16898 { "Count", "rtps.virtual_heartbeat.count",
16899 FT_UINT32, BASE_DEC, NULL, 0,
16900 NULL, HFILL }
16903 { &hf_rtps_virtual_heartbeat_num_virtual_guids,
16904 { "numVirtualGUIDs", "rtps.virtual_heartbeat.num_virtual_guids",
16905 FT_UINT32, BASE_DEC, NULL, 0,
16906 NULL, HFILL }
16909 { &hf_rtps_virtual_heartbeat_num_writers,
16910 { "numWriters", "rtps.virtual_heartbeat.num_writers",
16911 FT_UINT32, BASE_DEC, NULL, 0,
16912 NULL, HFILL }
16915 { &hf_rtps_data_serialize_data, {
16916 "serializedData", "rtps.data.serialize_data",
16917 FT_BYTES, BASE_NONE, NULL, 0,
16918 NULL, HFILL }
16921 { &hf_rtps_parameter_data, {
16922 "parameterData", "rtps.parameter_data",
16923 FT_BYTES, BASE_NONE, NULL, 0,
16924 NULL, HFILL }
16927 { &hf_rtps_data_batch_timestamp,
16928 { "Timestamp", "rtps.data_batch.timestamp",
16929 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
16930 "Time using the RTPS time_t standard format", HFILL }
16933 { &hf_rtps_data_batch_offset_to_last_sample_sn,
16934 { "offsetToLastSampleSN", "rtps.data_batch.offset_to_last_sample_sn",
16935 FT_UINT32, BASE_DEC, NULL, 0,
16936 NULL, HFILL }
16939 { &hf_rtps_data_batch_sample_count,
16940 { "batchSampleCount", "rtps.data_batch.sample_count",
16941 FT_UINT32, BASE_DEC, NULL, 0,
16942 NULL, HFILL }
16945 { &hf_rtps_data_batch_offset_sn,
16946 { "offsetSN", "rtps.data_batch.offset_sn",
16947 FT_UINT32, BASE_DEC, NULL, 0,
16948 NULL, HFILL }
16951 { &hf_rtps_data_batch_octets_to_sl_encap_id,
16952 { "octetsToSLEncapsulationId", "rtps.data_batch.octets_to_sl_encap_id",
16953 FT_UINT32, BASE_DEC, NULL, 0,
16954 NULL, HFILL }
16957 { &hf_rtps_data_batch_serialized_data_length,
16958 { "serializedDataLength", "rtps.data_batch.serialized_data_length",
16959 FT_UINT32, BASE_DEC, NULL, 0,
16960 NULL, HFILL }
16963 { &hf_rtps_data_batch_octets_to_inline_qos,
16964 { "octetsToInlineQos", "rtps.data_batch.octets_to_inline_qos",
16965 FT_UINT16, BASE_DEC, NULL, 0,
16966 NULL, HFILL }
16969 { &hf_rtps_fragment_number_base64,
16970 { "bitmapBase", "rtps.fragment_number.base64",
16971 FT_UINT64, BASE_DEC, NULL, 0,
16972 NULL, HFILL }
16975 { &hf_rtps_fragment_number_base,
16976 { "bitmapBase", "rtps.fragment_number.base32",
16977 FT_UINT32, BASE_DEC, NULL, 0,
16978 NULL, HFILL }
16981 { &hf_rtps_fragment_number_num_bits,
16982 { "numBits", "rtps.fragment_number.num_bits",
16983 FT_UINT32, BASE_DEC, NULL, 0,
16984 NULL, HFILL }
16987 { &hf_rtps_bitmap_num_bits,
16988 { "numBits", "rtps.bitmap.num_bits",
16989 FT_UINT32, BASE_DEC, NULL, 0,
16990 NULL, HFILL }
16993 { &hf_rtps_acknack_analysis,
16994 { "Acknack Analysis", "rtps.sm.acknack_analysis",
16995 FT_UINT32, BASE_DEC, NULL, 0,
16996 NULL, HFILL }
16999 { &hf_rtps_param_partition_num,
17000 { "Number of partition names", "rtps.param.partition_num",
17001 FT_INT32, BASE_DEC, NULL, 0,
17002 NULL, HFILL }
17005 { &hf_rtps_param_topic_alias_num,
17006 { "Number of topic aliases", "rtps.param.topic_alias_num",
17007 FT_INT32, BASE_DEC, NULL, 0,
17008 NULL, HFILL }
17011 { &hf_rtps_param_expression_parameters_num,
17012 { "Number of expression params", "rtps.param.expression_parameters_num",
17013 FT_INT32, BASE_DEC, NULL, 0,
17014 NULL, HFILL }
17017 { &hf_rtps_param_partition,
17018 { "name", "rtps.param.partition",
17019 FT_STRING, BASE_NONE, NULL, 0,
17020 NULL, HFILL }
17023 { &hf_rtps_param_topic_alias,
17024 { "Topic alias", "rtps.param.topic_alias",
17025 FT_STRING, BASE_NONE, NULL, 0,
17026 NULL, HFILL }
17029 { &hf_rtps_param_filter_expression,
17030 { "filterExpression", "rtps.param.filter_expression",
17031 FT_STRING, BASE_NONE, NULL, 0,
17032 NULL, HFILL }
17035 { &hf_rtps_param_expression_parameters,
17036 { "expressionParameters", "rtps.param.expression_parameters",
17037 FT_STRING, BASE_NONE, NULL, 0,
17038 NULL, HFILL }
17041 { &hf_rtps_locator_filter_list_num_channels,
17042 { "numberOfChannels", "rtps.param.locator_filter_list.num_channels",
17043 FT_INT32, BASE_DEC, NULL, 0,
17044 NULL, HFILL }
17047 { &hf_rtps_locator_filter_list_filter_name,
17048 { "filterName", "rtps.param.locator_filter_list.filter_name",
17049 FT_STRING, BASE_NONE, NULL, 0,
17050 NULL, HFILL }
17053 { &hf_rtps_locator_filter_list_filter_exp,
17054 { "filterExpression", "rtps.param.locator_filter_list.filter_exp",
17055 FT_STRING, BASE_NONE, NULL, 0,
17056 NULL, HFILL }
17059 { &hf_rtps_extra_flags,
17060 { "Extra flags", "rtps.extra_flags",
17061 FT_UINT16, BASE_HEX, NULL, 0xFFFF,
17062 NULL, HFILL }
17065 { &hf_rtps_param_builtin_endpoint_set_flags,
17066 { "Flags", "rtps.param.builtin_endpoint_set",
17067 FT_UINT32, BASE_HEX, NULL, 0,
17068 "bitmask representing the flags in PID_BUILTIN_ENDPOINT_SET",
17069 HFILL }
17072 { &hf_rtps_param_vendor_builtin_endpoint_set_flags,
17073 { "Flags", "rtps.param.vendor_builtin_endpoint_set",
17074 FT_UINT32, BASE_HEX, NULL, 0,
17075 "bitmask representing the flags in PID_VENDOR_BUILTIN_ENDPOINT_SET",
17076 HFILL }
17079 { &hf_rtps_param_endpoint_security_attributes,
17080 { "Flags", "rtps.param.endpoint_security_attributes",
17081 FT_UINT32, BASE_HEX, NULL, 0,
17082 "bitmask representing the flags in PID_ENDPOINT_SECURITY_ATTRIBUTES",
17083 HFILL }
17086 { &hf_rtps_param_plugin_promiscuity_kind, {
17087 "promiscuityKind", "rtps.param.plugin_promiscuity_kind",
17088 FT_UINT32, BASE_HEX, VALS(plugin_promiscuity_kind_vals), 0, NULL, HFILL }
17091 { &hf_rtps_param_service_kind, {
17092 "serviceKind", "rtps.param.service_kind",
17093 FT_UINT32, BASE_HEX, VALS(service_kind_vals), 0, NULL, HFILL }
17096 { &hf_rtps_param_data_representation,{
17097 "Data Representation Kind", "rtps.param.data_representation",
17098 FT_UINT16, BASE_DEC, VALS(data_representation_kind_vals), 0, NULL, HFILL }
17101 { &hf_rtps_param_type_consistency_kind, {
17102 "Type Consistency Kind", "rtps.param.type_consistency_kind",
17103 FT_UINT16, BASE_HEX, VALS(type_consistency_kind_vals), 0, NULL, HFILL }
17106 { &hf_rtps_param_ignore_sequence_bounds, {
17107 "Ignore Sequence Bounds", "rtps.param.ignore_sequence_bounds",
17108 FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
17111 { &hf_rtps_param_ignore_string_bounds, {
17112 "Ignore String Bounds", "rtps.param.ignore_string_bounds",
17113 FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
17116 { &hf_rtps_param_ignore_member_names, {
17117 "Ignore Member Names", "rtps.param.ignore_member_names",
17118 FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
17121 { &hf_rtps_param_prevent_type_widening, {
17122 "Prevent Type Widening", "rtps.param.prevent_type_widening",
17123 FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
17126 { &hf_rtps_param_force_type_validation, {
17127 "Force Type Validation", "rtps.param.force_type_validation",
17128 FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
17131 { &hf_rtps_param_ignore_enum_literal_names, {
17132 "Ignore Enum Literal Names", "rtps.param.ignore_enum_literal_names",
17133 FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
17136 { &hf_rtps_param_acknowledgment_kind, {
17137 "Acknowledgment Kind", "rtps.param.acknowledgment_kind",
17138 FT_UINT32, BASE_HEX, VALS(acknowledgement_kind_vals), 0, NULL, HFILL }
17141 /* Finally the raw issue data ------------------------------------------ */
17142 { &hf_rtps_issue_data, {
17143 "serializedData", "rtps.issueData",
17144 FT_BYTES, BASE_NONE, NULL, 0, "The user data transferred in a ISSUE submessage", HFILL }
17147 { &hf_rtps_param_product_version_major, {
17148 "Major", "rtps.param.product_version.major",
17149 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
17152 { &hf_rtps_param_product_version_minor, {
17153 "Minor", "rtps.param.product_version.minor",
17154 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
17157 { &hf_rtps_param_product_version_release, {
17158 "Release", "rtps.param.product_version.release",
17159 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
17162 { &hf_rtps_param_product_version_release_as_char, {
17163 "Release", "rtps.param.product_version.release_string",
17164 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
17167 { &hf_rtps_param_product_version_revision, {
17168 "Revision", "rtps.param.product_version.revision",
17169 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
17172 { &hf_rtps_encapsulation_id, {
17173 "encapsulation id", "rtps.encapsulation_id",
17174 FT_UINT16, BASE_HEX, VALS(encapsulation_id_vals), 0, NULL, HFILL }
17177 { &hf_rtps_encapsulation_kind, {
17178 "kind", "rtps.encapsulation_kind",
17179 FT_UINT32, BASE_HEX, VALS(participant_message_data_kind), 0, NULL, HFILL }
17182 { &hf_rtps_octets_to_inline_qos, {
17183 "Octets to inline QoS", "rtps.octets_to_inline_qos",
17184 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
17187 { &hf_rtps_filter_signature, {
17188 "filterSignature", "rtps.filter_signature",
17189 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
17192 { &hf_rtps_bitmap, {
17193 "bitmap", "rtps.bitmap",
17194 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
17197 { &hf_rtps_property_name, {
17198 "Property Name", "rtps.property_name",
17199 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
17202 { &hf_rtps_property_value, {
17203 "Value", "rtps.property_value",
17204 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
17207 { &hf_rtps_union, {
17208 "union", "rtps.union",
17209 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
17212 { &hf_rtps_union_case, {
17213 "case", "rtps.union_case",
17214 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
17217 { &hf_rtps_struct, {
17218 "struct", "rtps.struct",
17219 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
17222 { &hf_rtps_member_name, {
17223 "member_name", "rtps.member_name",
17224 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
17227 { &hf_rtps_sequence, {
17228 "sequence", "rtps.sequence",
17229 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
17232 { &hf_rtps_array, {
17233 "array", "rtps.array",
17234 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
17237 { &hf_rtps_bitfield, {
17238 "bitfield", "rtps.bitfield",
17239 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
17242 { &hf_rtps_datatype, {
17243 "datatype", "rtps.datatype",
17244 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
17247 { &hf_rtps_sequence_size, {
17248 "sequenceSize", "rtps.sequence_size",
17249 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_octet_octets), 0, NULL, HFILL }
17252 { &hf_rtps_guid, {
17253 "guid", "rtps.guid",
17254 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
17257 { &hf_rtps_heartbeat_count, {
17258 "count", "rtps.heartbeat_count",
17259 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
17262 { &hf_rtps_encapsulation_options, {
17263 "Encapsulation options", "rtps.encapsulation_options",
17264 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
17267 { &hf_rtps_serialized_key, {
17268 "serializedKey", "rtps.serialized_key",
17269 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
17272 { &hf_rtps_serialized_data, {
17273 "serializedData", "rtps.serialized_data",
17274 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
17277 { &hf_rtps_sm_rti_crc_number, {
17278 "RTPS Message Length", "rtps.sm.rti_crc.message_length",
17279 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
17282 { &hf_rtps_sm_rti_crc_result, {
17283 "CRC", "rtps.sm.rti_crc",
17284 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }
17286 { &hf_rtps_message_length, {
17287 "RTPS Message Length", "rtps.message_length",
17288 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
17291 /* Flag bits */
17292 { &hf_rtps_flag_reserved80, {
17293 "Reserved", "rtps.flag.reserved",
17294 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, NULL, HFILL }
17296 { &hf_rtps_flag_reserved40, {
17297 "Reserved", "rtps.flag.reserved",
17298 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40, NULL, HFILL }
17300 { &hf_rtps_flag_reserved20, {
17301 "Reserved", "rtps.flag.reserved",
17302 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20, NULL, HFILL }
17304 { &hf_rtps_flag_reserved10, {
17305 "Reserved", "rtps.flag.reserved",
17306 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10, NULL, HFILL }
17308 { &hf_rtps_flag_reserved08, {
17309 "Reserved", "rtps.flag.reserved",
17310 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL }
17312 { &hf_rtps_flag_reserved04, {
17313 "Reserved", "rtps.flag.reserved",
17314 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
17316 { &hf_rtps_flag_reserved02, {
17317 "Reserved", "rtps.flag.reserved",
17318 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
17320 { &hf_rtps_flag_reserved8000, {
17321 "Reserved", "rtps.flag.reserved",
17322 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x8000, NULL, HFILL }
17324 { &hf_rtps_flag_reserved4000, {
17325 "Reserved", "rtps.flag.reserved",
17326 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x4000, NULL, HFILL }
17328 { &hf_rtps_flag_reserved2000, {
17329 "Reserved", "rtps.flag.reserved",
17330 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x2000, NULL, HFILL }
17332 { &hf_rtps_flag_reserved1000, {
17333 "Reserved", "rtps.flag.reserved",
17334 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x1000, NULL, HFILL }
17336 { &hf_rtps_flag_reserved0800, {
17337 "Reserved", "rtps.flag.reserved",
17338 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0800, NULL, HFILL }
17340 { &hf_rtps_flag_reserved0400, {
17341 "Reserved", "rtps.flag.reserved",
17342 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0400, NULL, HFILL }
17344 { &hf_rtps_flag_reserved0200, {
17345 "Reserved", "rtps.flag.reserved",
17346 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0200, NULL, HFILL }
17348 { &hf_rtps_flag_reserved0100, {
17349 "Reserved", "rtps.flag.reserved",
17350 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0100, NULL, HFILL }
17352 { &hf_rtps_flag_reserved0080, {
17353 "Reserved", "rtps.flag.reserved",
17354 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0080, NULL, HFILL }
17356 { &hf_rtps_flag_reserved0040, {
17357 "Reserved", "rtps.flag.reserved",
17358 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0040, NULL, HFILL }
17360 { &hf_rtps_flag_builtin_endpoint_set_reserved, {
17361 "Reserved", "rtps.flag.reserved",
17362 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x0000F000, NULL, HFILL }
17364 { &hf_rtps_flag_unregister, {
17365 "Unregister flag", "rtps.flag.unregister",
17366 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20, NULL, HFILL }
17368 { &hf_rtps_flag_inline_qos_v1, {
17369 "Inline QoS", "rtps.flag.inline_qos",
17370 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10, NULL, HFILL }
17372 { &hf_rtps_flag_hash_key, {
17373 "Hash key flag", "rtps.flag.hash_key",
17374 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL }
17376 { &hf_rtps_flag_hash_key_rti, {
17377 "Hash key flag", "rtps.flag.hash_key",
17378 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
17380 { &hf_rtps_flag_alive, {
17381 "Alive flag", "rtps.flag.alive",
17382 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
17384 { &hf_rtps_flag_data_present_v1, {
17385 "Data present", "rtps.flag.data_present",
17386 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
17388 { &hf_rtps_flag_multisubmessage, {
17389 "Multi-submessage", "rtps.flag.multisubmessage",
17390 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
17392 { &hf_rtps_flag_endianness, {
17393 "Endianness", "rtps.flag.endianness",
17394 FT_BOOLEAN, 8, TFS(&tfs_little_big_endianness), 0x01, NULL, HFILL }
17396 { &hf_rtps_flag_additional_authenticated_data, {
17397 "Additional Authenticated Data", "rtps.flag.additional_authenticated_data",
17398 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
17400 { &hf_rtps_flag_protected_with_psk, {
17401 "Message protected with PSK", "rtps.flag.message_protected_with_psk",
17402 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
17404 { &hf_rtps_flag_vendor_specific_content, {
17405 "Vendor-Specific Content", "rtps.flag.vendor_specific_content",
17406 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, NULL, HFILL }
17408 { &hf_rtps_flag_inline_qos_v2, {
17409 "Inline QoS", "rtps.flag.inline_qos",
17410 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
17412 { &hf_rtps_flag_data_present_v2, {
17413 "Data present", "rtps.flag.data_present",
17414 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
17416 { &hf_rtps_flag_status_info, {
17417 "Status info flag", "rtps.flag.status_info",
17418 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10, NULL, HFILL }
17420 { &hf_rtps_flag_final, {
17421 "Final flag", "rtps.flag.final",
17422 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
17424 { &hf_rtps_flag_liveliness, {
17425 "Liveliness flag", "rtps.flag.liveliness",
17426 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
17428 { &hf_rtps_flag_multicast, {
17429 "Multicast flag", "rtps.flag.multicast",
17430 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
17432 { &hf_rtps_flag_data_serialized_key, {
17433 "Serialized Key", "rtps.flag.data.serialized_key",
17434 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL }
17436 { &hf_rtps_flag_data_frag_serialized_key, {
17437 "Serialized Key", "rtps.flag.data_frag.serialized_key",
17438 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
17440 { &hf_rtps_flag_timestamp, {
17441 "Timestamp flag", "rtps.flag.timestamp",
17442 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
17444 { &hf_rtps_flag_no_virtual_guids, {
17445 "No virtual GUIDs flag", "rtps.flag.no_virtual_guids",
17446 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL }
17448 { &hf_rtps_flag_multiple_writers, {
17449 "Multiple writers flag", "rtps.flag.multiple_writers",
17450 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
17452 { &hf_rtps_flag_multiple_virtual_guids, {
17453 "Multiple virtual GUIDs flag", "rtps.flag.multiple_virtual_guids",
17454 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
17456 { &hf_rtps_flag_serialize_key16, {
17457 "Serialized Key", "rtps.flag.serialize_key",
17458 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0020, NULL, HFILL }
17460 { &hf_rtps_flag_invalid_sample, {
17461 "Invalid sample", "rtps.flag.invalid_sample",
17462 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0010, NULL, HFILL }
17464 { &hf_rtps_flag_data_present16, {
17465 "Data present", "rtps.flag.data_present",
17466 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0008, NULL, HFILL }
17468 { &hf_rtps_flag_offsetsn_present, {
17469 "OffsetSN present", "rtps.flag.offsetsn_present",
17470 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0004, NULL, HFILL }
17472 { &hf_rtps_flag_inline_qos16_v2, {
17473 "Inline QoS", "rtps.flag.inline_qos",
17474 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0002, NULL, HFILL }
17476 { &hf_rtps_flag_timestamp_present, {
17477 "Timestamp present", "rtps.flag.timestamp_present",
17478 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0001, NULL, HFILL }
17480 { &hf_rtps_param_status_info_flags,
17481 { "Flags", "rtps.param.status_info",
17482 FT_UINT32, BASE_HEX, NULL, 0, "bitmask representing the flags in PID_STATUS_INFO", HFILL }
17484 { &hf_rtps_header_extension_flags,
17485 { "Flags", "rtps.header_extension_flags",
17486 FT_UINT8, BASE_HEX, NULL, 0, "bitmask representing header extension flags", HFILL }
17488 { &hf_rtps_flag_header_extension_parameters, {
17489 "Header Extension Parameter List Present", "rtps.flag.header_extension.parameter_list",
17490 FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_PARAMETERS_FLAG, NULL, HFILL }
17492 { &hf_rtps_flag_header_extension_checksum2, {
17493 "Header Extension Message Checksum 2", "rtps.flag.header_extension.message_checksum2",
17494 FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_CHECKSUM_2_FLAG, NULL, HFILL }
17496 { &hf_rtps_flag_header_extension_checksum1, {
17497 "Header Extension Message Checksum 1", "rtps.flag.header_extension.message_checksum1",
17498 FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_CHECKSUM_1_FLAG, NULL, HFILL }
17500 { &hf_rtps_flag_header_extension_wextension, {
17501 "Header Extension W Extension Present", "rtps.flag.header_extension.wextension",
17502 FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_WEXTENSION_FLAG, NULL, HFILL }
17504 { &hf_rtps_flag_header_extension_uextension, {
17505 "Header Extension U Extension Present", "rtps.flag.header_extension.uextension",
17506 FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_UEXTENSION_FLAG, NULL, HFILL }
17508 { &hf_rtps_flag_header_extension_timestamp, {
17509 "Header Extension Timestamp Present", "rtps.flag.header_extension.timestamp",
17510 FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_TIMESTAMP_FLAG, NULL, HFILL }
17512 { &hf_rtps_flag_header_extension_message_length, {
17513 "Header Extension Message Length", "rtps.flag.header_extension.message_length",
17514 FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_MESSAGE_LENGTH_FLAG, NULL, HFILL }
17516 { &hf_rtps_header_extension_checksum_crc32c, {
17517 "Header Extension Checksum CRC-32C", "rtps.header_extension.checksum_crc32c",
17518 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }
17520 { &hf_rtps_header_extension_checksum_crc64, {
17521 "Header Extension Checksum CRC64", "rtps.header_extension.checksum_crc64",
17522 FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }
17524 { &hf_rtps_header_extension_checksum_md5, {
17525 "Header Extension Checksum MD5", "rtps.header_extension.checksum_md5",
17526 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
17528 { &hf_rtps_uextension, {
17529 "Header Extension uExtension", "rtps.uextension",
17530 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
17532 { &hf_rtps_wextension, {
17533 "Header Extension wExtension", "rtps.wextension",
17534 FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }
17536 { &hf_rtps_flag_unregistered, {
17537 "Unregistered", "rtps.flag.unregistered",
17538 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
17540 { &hf_rtps_flag_disposed, {
17541 "Disposed", "rtps.flag.undisposed",
17542 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01, NULL, HFILL }
17544 { &hf_rtps_flag_participant_announcer, {
17545 "Participant Announcer", "rtps.flag.participant_announcer",
17546 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
17548 { &hf_rtps_flag_participant_detector, {
17549 "Participant Detector", "rtps.flag.participant_detector",
17550 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
17552 { &hf_rtps_flag_publication_announcer, {
17553 "Publication Announcer", "rtps.flag.publication_announcer",
17554 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
17556 { &hf_rtps_flag_publication_detector, {
17557 "Publication Detector", "rtps.flag.publication_detector",
17558 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL }
17560 { &hf_rtps_flag_subscription_announcer, {
17561 "Subscription Announcer", "rtps.flag.subscription_announcer",
17562 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL }
17564 { &hf_rtps_flag_subscription_detector, {
17565 "Subscription Detector", "rtps.flag.subscription_detector",
17566 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL }
17568 { &hf_rtps_flag_participant_proxy_announcer, {
17569 "Participant Proxy Announcer", "rtps.flag.participant_proxy_announcer",
17570 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040, NULL, HFILL }
17572 { &hf_rtps_flag_participant_proxy_detector, {
17573 "Participant Proxy Detector", "rtps.flag.participant_proxy_detector",
17574 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000080, NULL, HFILL }
17576 { &hf_rtps_flag_participant_state_announcer, {
17577 "Participant State Announcer", "rtps.flag.participant_state_announcer",
17578 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000100, NULL, HFILL }
17580 { &hf_rtps_flag_participant_state_detector, {
17581 "Participant State Detector", "rtps.flag.participant_state_detector",
17582 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000200, NULL, HFILL }
17584 { &hf_rtps_flag_participant_message_datawriter, {
17585 "Participant Message DataWriter", "rtps.flag.participant_message_datawriter",
17586 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000400, NULL, HFILL }
17588 { &hf_rtps_flag_participant_message_datareader, {
17589 "Participant Message DataReader", "rtps.flag.participant_message_datareader",
17590 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000800, NULL, HFILL }
17592 { &hf_rtps_flag_secure_publication_writer, {
17593 "Secure Publication Writer", "rtps.flag.secure_publication_writer",
17594 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00010000, NULL, HFILL }
17596 { &hf_rtps_flag_secure_publication_reader, {
17597 "Secure Publication Reader", "rtps.flag.secure_publication_reader",
17598 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00020000, NULL, HFILL }
17600 { &hf_rtps_flag_secure_subscription_writer, {
17601 "Secure Subscription Writer", "rtps.flag.secure_subscription_writer",
17602 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00040000, NULL, HFILL }
17604 { &hf_rtps_flag_secure_subscription_reader, {
17605 "Secure Subscription Reader", "rtps.flag.secure_subscription_reader",
17606 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00080000, NULL, HFILL }
17608 { &hf_rtps_flag_secure_participant_message_writer, {
17609 "Secure Participant Message Writer", "rtps.flag.secure_participant_message_writer",
17610 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00100000, NULL, HFILL }
17612 { &hf_rtps_flag_secure_participant_message_reader, {
17613 "Secure Participant Message Reader", "rtps.flag.secure_participant_message_reader",
17614 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00200000, NULL, HFILL }
17616 { &hf_rtps_flag_participant_stateless_message_writer, {
17617 "Participant Stateless Message Writer", "rtps.flag.participant_stateless_message_writer",
17618 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00400000, NULL, HFILL }
17620 { &hf_rtps_flag_participant_stateless_message_reader, {
17621 "Participant Stateless Message Reader", "rtps.flag.participant_stateless_message_reader",
17622 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00800000, NULL, HFILL }
17624 { &hf_rtps_flag_secure_participant_volatile_message_writer,{
17625 "Secure Participant Volatile Message Writer", "rtps.flag.secure_participant_volatile_message_writer",
17626 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x01000000, NULL, HFILL }
17628 { &hf_rtps_flag_secure_participant_volatile_message_reader,{
17629 "Secure Participant Volatile Message Reader", "rtps.flag.secure_participant_volatile_message_reader",
17630 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x02000000, NULL, HFILL }
17632 { &hf_rtps_flag_participant_secure_writer,{
17633 "Participant Secure Writer", "rtps.flag.participant_secure_writer",
17634 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x04000000, NULL, HFILL }
17636 { &hf_rtps_flag_participant_secure_reader,{
17637 "Participant Secure Reader", "rtps.flag.participant_secure_reader",
17638 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x08000000, NULL, HFILL }
17640 { &hf_rtps_type_object_type_id_disc,
17641 { "TypeId (_d)", "rtps.type_object.type_id.discr",
17642 FT_INT16, BASE_DEC, 0x0, 0,
17643 NULL, HFILL }
17645 { &hf_rtps_type_object_primitive_type_id,
17646 { "Type Id", "rtps.type_object.primitive_type_id",
17647 FT_UINT16, BASE_HEX, VALS(type_object_kind), 0,
17648 NULL, HFILL }
17650 { &hf_rtps_type_object_base_primitive_type_id,
17651 { "Base Id", "rtps.type_object.base_primitive_type_id",
17652 FT_UINT16, BASE_HEX, VALS(type_object_kind), 0,
17653 NULL, HFILL }
17655 { &hf_rtps_type_object_type_id,
17656 { "Type Id", "rtps.type_object.type_id",
17657 FT_UINT64, BASE_HEX, 0x0, 0,
17658 NULL, HFILL }
17660 { &hf_rtps_type_object_base_type,
17661 { "Base Type Id", "rtps.type_object.base_type_id",
17662 FT_UINT64, BASE_HEX, 0x0, 0,
17663 NULL, HFILL }
17665 { &hf_rtps_type_object_element_raw, {
17666 "Type Element Content", "rtps.type_object.element",
17667 FT_BYTES, BASE_NONE, NULL, 0,
17668 NULL, HFILL }
17670 { &hf_rtps_type_object_type_property_name,
17671 { "Name", "rtps.type_object.property.name",
17672 FT_STRING, BASE_NONE, 0x0, 0,
17673 NULL, HFILL }
17675 { &hf_rtps_type_object_member_id,
17676 { "Member Id", "rtps.type_object.annotation.member_id",
17677 FT_UINT32, BASE_DEC, 0x0, 0,
17678 NULL, HFILL }
17680 { &hf_rtps_type_object_name,
17681 { "Name", "rtps.type_object.member.name",
17682 FT_STRING, BASE_NONE, 0x0, 0,
17683 NULL, HFILL }
17685 { &hf_rtps_type_object_annotation_value_d,
17686 { "Annotation Member (_d)", "rtps.type_object.annotation.value_d",
17687 FT_UINT16, BASE_DEC, 0x0, 0,
17688 NULL, HFILL }
17690 { &hf_rtps_type_object_annotation_value_16,
17691 { "16 bits type", "rtps.type_object.annotation.value",
17692 FT_UINT16, BASE_DEC, 0x0, 0,
17693 NULL, HFILL }
17695 { &hf_rtps_type_object_union_label,
17696 { "Label", "rtps.type_object.union.label",
17697 FT_UINT32, BASE_DEC, 0x0, 0,
17698 NULL, HFILL }
17700 { &hf_rtps_type_object_bound,
17701 { "Bound", "rtps.type_object.bound",
17702 FT_UINT32, BASE_DEC, 0x0, 0,
17703 NULL, HFILL }
17705 { &hf_rtps_type_object_enum_constant_name,
17706 { "Enum name", "rtps.type_object.enum.name",
17707 FT_STRING, BASE_NONE, 0x0, 0,
17708 NULL, HFILL }
17710 { &hf_rtps_type_object_enum_constant_value,
17711 { "Enum value", "rtps.type_object.enum.value",
17712 FT_INT32, BASE_DEC, 0x0, 0,
17713 NULL, HFILL }
17715 { &hf_rtps_type_object_element_shared,
17716 { "Element shared", "rtps.type_object.shared",
17717 FT_BOOLEAN, BASE_NONE, NULL, 0,
17718 NULL, HFILL }
17720 { &hf_rtps_flag_typeflag_final, {
17721 "FINAL", "rtps.flag.typeflags.final",
17722 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0001, NULL, HFILL }
17724 { &hf_rtps_flag_typeflag_mutable, {
17725 "MUTABLE", "rtps.flag.typeflags.mutable",
17726 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0002, NULL, HFILL }
17728 { &hf_rtps_flag_typeflag_nested, {
17729 "NESTED", "rtps.flag.typeflags.nested",
17730 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0004, NULL, HFILL }
17732 { &hf_rtps_type_object_flags, {
17733 "Flags", "rtps.flag.typeflags",
17734 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }
17736 { &hf_rtps_flag_memberflag_key, {
17737 "Key", "rtps.flag.typeflags.key",
17738 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0001, NULL, HFILL }
17740 { &hf_rtps_flag_memberflag_optional, {
17741 "Optional", "rtps.flag.typeflags.optional",
17742 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0002, NULL, HFILL }
17744 { &hf_rtps_flag_memberflag_shareable, {
17745 "Shareable", "rtps.flag.typeflags.shareable",
17746 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0004, NULL, HFILL }
17748 { &hf_rtps_flag_memberflag_union_default, {
17749 "Union default", "rtps.flag.typeflags.union_default",
17750 FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0008, NULL, HFILL }
17752 { &hf_rtps_type_object_element_module_name,
17753 { "Module name", "rtps.type_object.module_name",
17754 FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL }
17756 { &hf_rtps_flag_service_request_writer, {
17757 "Service Request Writer", "rtps.flag.service_request_writer",
17758 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
17760 { &hf_rtps_flag_service_request_reader, {
17761 "Service Request Reader", "rtps.flag.service_request_reader",
17762 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
17764 { &hf_rtps_flag_locator_ping_writer, {
17765 "Locator Ping Writer", "rtps.flag.locator_ping_writer",
17766 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
17768 { &hf_rtps_flag_locator_ping_reader, {
17769 "Locator Ping Reader", "rtps.flag.locator_ping_reader",
17770 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL }
17772 { &hf_rtps_flag_secure_service_request_writer, {
17773 "Secure Service Request Writer", "rtps.flag.secure_service_request_writer",
17774 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL }
17776 { &hf_rtps_flag_secure_service_request_reader, {
17777 "Secure Service Request Reader", "rtps.flag.secure_service_request_reader",
17778 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL }
17780 { &hf_rtps_flag_security_access_protected, {
17781 "Access Protected", "rtps.flag.security.access_protected",
17782 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
17784 { &hf_rtps_flag_security_discovery_protected, {
17785 "Discovery Protected", "rtps.flag.security.discovery_protected",
17786 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
17788 { &hf_rtps_flag_security_submessage_protected, {
17789 "Submessage Protected", "rtps.flag.security.submessage_protected",
17790 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
17792 { &hf_rtps_flag_security_payload_protected, {
17793 "Payload Protected", "rtps.flag.security.payload_protected",
17794 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL }
17796 { &hf_rtps_flag_endpoint_security_attribute_flag_is_read_protected,{
17797 "Read Protected", "rtps.flag.security.info.read_protected",
17798 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
17800 { &hf_rtps_flag_endpoint_security_attribute_flag_is_write_protected,{
17801 "Write Protected", "rtps.flag.security.info.write_protected",
17802 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
17804 { &hf_rtps_flag_endpoint_security_attribute_flag_is_discovery_protected,{
17805 "Discovery Protected", "rtps.flag.security.info.discovery_protected",
17806 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
17808 { &hf_rtps_flag_endpoint_security_attribute_flag_is_submessage_protected,{
17809 "Submessage Protected", "rtps.flag.security.info.submessage_protected",
17810 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL }
17812 { &hf_rtps_flag_endpoint_security_attribute_flag_is_payload_protected,{
17813 "Payload Protected", "rtps.flag.security.info.payload_protected",
17814 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL }
17816 { &hf_rtps_flag_endpoint_security_attribute_flag_is_key_protected,{
17817 "Key Protected", "rtps.flag.security.info.key_protected",
17818 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL }
17820 { &hf_rtps_flag_endpoint_security_attribute_flag_is_liveliness_protected,{
17821 "Liveliness Protected", "rtps.flag.security.info.liveliness_protected",
17822 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040, NULL, HFILL }
17824 { &hf_rtps_flag_endpoint_security_attribute_flag_is_valid,{
17825 "Mask Valid", "rtps.flag.security.info.valid",
17826 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000, NULL, HFILL }
17828 { &hf_rtps_param_endpoint_security_attributes_mask,{
17829 "EndpointSecurityAttributesMask", "rtps.param.endpoint_security_attributes",
17830 FT_UINT32, BASE_HEX, NULL, 0,
17831 "Bitmask representing the EndpointSecurityAttributes flags in PID_ENDPOINT_SECURITY_INFO",
17832 HFILL }
17834 { &hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_required_mask, {
17835 "Builtin Endpoints Required Mask", "rtps.param.participant_security_symmetric_cipher_algorithms.builtin_endpoints_used_bit",
17836 FT_UINT32, BASE_HEX, NULL, 0,
17837 "Bitmask representing the Symmetric Cipher algorithm the builtin endpoints use",
17838 HFILL }
17840 { &hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_key_exchange_used_bit, {
17841 "Key Exchange Builtin Endpoints Required Mask", "rtps.param.participant_security_symmetric_cipher_algorithms.builtin_endpoints_key_exchange_required_mask",
17842 FT_UINT32, BASE_HEX, NULL, 0,
17843 "Bitmask representing the Symmetric Cipher algorithm the key exchange builtin endpoints require",
17844 HFILL }
17846 { &hf_rtps_param_participant_security_symmetric_cipher_algorithms_supported_mask, {
17847 "Supported Mask", "rtps.param.security_symmetric_cipher_algorithms.supported_mask",
17848 FT_UINT32, BASE_HEX, 0, 0, "Bitmask representing supported Symmetric Cipher algorithms",
17849 HFILL }
17851 { &hf_rtps_param_compression_id_mask, {
17852 "Compression Id Mask", "rtps.param.compression_id_mask",
17853 FT_UINT32, BASE_HEX, 0, 0, "Bitmask representing compression id.", HFILL }
17855 { &hf_rtps_flag_compression_id_zlib, {
17856 "ZLIB", "rtps.flag.compression_id_zlib",
17857 FT_BOOLEAN, 32, TFS(&tfs_set_notset), RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB, NULL, HFILL }
17859 { &hf_rtps_flag_compression_id_bzip2, {
17860 "BZIP2", "rtps.flag.compression_id_bzip2",
17861 FT_BOOLEAN, 32, TFS(&tfs_set_notset), RTI_OSAPI_COMPRESSION_CLASS_ID_BZIP2, NULL, HFILL }
17863 { &hf_rtps_flag_compression_id_lz4, {
17864 "LZ4", "rtps.flag.compression_id_lz4",
17865 FT_BOOLEAN, 32, TFS(&tfs_set_notset), RTI_OSAPI_COMPRESSION_CLASS_ID_LZ4, NULL, HFILL }
17867 { &hf_rtps_flag_security_symmetric_cipher_mask_aes128_gcm, {
17868 "AES128 GCM", "rtps.flag.security_symmetric_cipher_mask.aes128_gcm",
17869 FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_SYMMETRIC_CIPHER_BIT_AES128_GCM, NULL, HFILL }
17871 { &hf_rtps_flag_security_symmetric_cipher_mask_aes256_gcm, {
17872 "AES256 GCM", "rtps.flag.security_symmetric_cipher_mask.aes256_gcm",
17873 FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_SYMMETRIC_CIPHER_BIT_AES256_GCM, NULL, HFILL }
17875 { &hf_rtps_flag_security_symmetric_cipher_mask_custom_algorithm, {
17876 "Custom Algorithm", "rtps.flag.security_symmetric_cipher_mask.custom_algorithm",
17877 FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_SYMMETRIC_CIPHER_BIT_CUSTOM_ALGORITHM, NULL, HFILL }
17879 { &hf_rtps_flag_security_key_establishment_mask_dhe_modp2048256, {
17880 "DHE_MODP2048256", "rtps.flag.security_key_establishment_mask.dhe_modp2048256",
17881 FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_KEY_ESTABLISHMENT_BIT_DHE_MODP2048256, NULL, HFILL }
17883 { &hf_rtps_flag_security_key_establishment_mask_ecdheceum_p256, {
17884 "ECDHECEUM_P256", "rtps.flag.security_key_establishment_mask.ecdheceum_p256",
17885 FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_KEY_ESTABLISHMENT_BIT_ECDHECEUM_P256, NULL, HFILL }
17887 { &hf_rtps_flag_security_key_establishment_mask_ecdheceum_p384, {
17888 "ECDHECEUM_P384", "rtps.flag.security_key_establishment_mask.ecdheceum_p384",
17889 FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_KEY_ESTABLISHMENT_BIT_ECDHECEUM_P384, NULL, HFILL }
17891 { &hf_rtps_flag_security_key_establishment_mask_custom_algorithm, {
17892 "Custom Algorithm", "rtps.flag.security_key_establishment_mask.custom_algorithm",
17893 FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_KEY_ESTABLISHMENT_BIT_CUSTOM_ALGORITHM, NULL, HFILL }
17895 { &hf_rtps_flag_security_algorithm_compatibility_mode, {
17896 "Compatibility Mode", "rtps.flag.security_algorithm_compatibility_mode",
17897 FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_ALGORITHM_BIT_COMPATIBILITY_MODE, NULL, HFILL }
17899 { &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_payload_encrypted, {
17900 "Submessage Encrypted", "rtps.flag.security.info.plugin_submessage_encrypted",
17901 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
17903 { &hf_rtps_param_crypto_algorithm_requirements_trust_chain, {
17904 "Supported", "rtps.param.crypto_algorithm_requirements.supported",
17905 FT_UINT32, BASE_HEX, 0, 0, "Bitmask representing the trust chain", HFILL }
17907 { &hf_rtps_param_crypto_algorithm_requirements_message_auth, {
17908 "Required", "rtps.param.crypto_algorithm_requirements.required",
17909 FT_UINT32, BASE_HEX, 0, 0, "Bitmask representing the message authentication", HFILL }
17911 { &hf_rtps_flag_security_digital_signature_mask_rsassapssmgf1sha256_2048_sha256, {
17912 "RSASSAPSSMGF1SHA256_2048_SHA256", "rtps.flag.security_digital_signature_mask.rsassapssmgf1sha256_2048_sha256",
17913 FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_RSASSAPSSMGF1SHA256_2048_SHA256, NULL, HFILL }
17915 { &hf_rtps_flag_security_digital_signature_mask_rsassapkcs1v15_2048_sha256, {
17916 "RSASSAPKCS1V15_2048_SHA256", "rtps.flag.security_digital_signature_mask.rsassapkcs1v15_2048_sha256",
17917 FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_RSASSAPKCS1V15_2048_SHA256, NULL, HFILL }
17919 { &hf_rtps_flag_security_digital_signature_mask_ecdsa_p256_sha256, {
17920 "ECDSA_P256_SHA256", "rtps.flag.security_digital_signature_mask.ecdsa_p256_sha256",
17921 FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_ECDSA_P256_SHA256, NULL, HFILL }
17923 { &hf_rtps_flag_security_digital_signature_mask_ecdsa_p384_sha384, {
17924 "ECDSA_P384_SHA384", "rtps.flag.security_digital_signature_mask.ecdsa_p384_sha384",
17925 FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_ECDSA_P384_SHA384, NULL, HFILL }
17927 { &hf_rtps_flag_security_digital_signature_mask_custom_algorithm, {
17928 "Custom Algorithm", "rtps.flag.security_digital_signature_mask.custom_algorithm",
17929 FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_CUSTOM_ALGORITHM, NULL, HFILL }
17931 { &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_key_encrypted,{
17932 "Payload Encrypted", "rtps.flag.security.info.plugin_payload_encrypted",
17933 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
17935 { &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_liveliness_encrypted,{
17936 "Submessage Origin Encrypted", "rtps.flag.security.info.plugin_liveliness_encrypted",
17937 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
17939 { &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_valid,{
17940 "Mask Valid", "rtps.flag.security.info.plugin_valid",
17941 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000, NULL, HFILL }
17943 { &hf_rtps_param_plugin_endpoint_security_attributes_mask,{
17944 "PluginEndpointSecurityAttributesMask (valid dissection if using the Specification Builtin Plugins)",
17945 "rtps.param.plugin_endpoint_security_attributes",
17946 FT_UINT32, BASE_HEX, NULL, 0,
17947 "bitmask representing the PluginEndpointSecurityAttributes flags in PID_ENDPOINT_SECURITY_INFO",
17948 HFILL }
17950 { &hf_rtps_flag_participant_security_attribute_flag_is_rtps_protected,{
17951 "RTPS Protected", "rtps.flag.security.info.participant_rtps_protected",
17952 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
17954 { &hf_rtps_flag_participant_security_attribute_flag_is_discovery_protected,{
17955 "Discovery Protected", "rtps.flag.security.info.participant_discovery_protected",
17956 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
17958 { &hf_rtps_flag_participant_security_attribute_flag_is_liveliness_protected,{
17959 "Liveliness Protected", "rtps.flag.security.info.participant_liveliness_protected",
17960 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
17962 { &hf_rtps_flag_participant_security_attribute_flag_key_revisions_enabled,{
17963 "Key Revisions Enabled", "rtps.flag.security.info.key_revisions_enabled",
17964 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL }
17966 { &hf_rtps_flag_participant_security_attribute_flag_key_psk_protected,{
17967 "RTPS Pre-Shared Key Protected", "rtps.flag.security.info.participant_psk_protected",
17968 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL }
17970 { &hf_rtps_flag_participant_security_attribute_flag_is_valid,{
17971 "Mask Valid", "rtps.flag.security.info.participant_mask_valid",
17972 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000, NULL, HFILL }
17974 { &hf_rtps_param_participant_security_attributes_mask,{
17975 "ParticipantSecurityAttributesMask",
17976 "rtps.param.participant_security_attributes",
17977 FT_UINT32, BASE_HEX, NULL, 0,
17978 "bitmask representing the ParticipantSecurityAttributes flags in PID_PARTICIPANT_SECURITY_INFO",
17979 HFILL }
17981 { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_encrypted,{
17982 "RTPS Encrypted", "rtps.flag.security.info.plugin_participant_rtps_encrypted",
17983 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
17985 { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_encrypted,{
17986 "Discovery Encrypted", "rtps.flag.security.info.plugin_participant_discovery_encrypted",
17987 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
17989 { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_encrypted,{
17990 "Liveliness Encrypted", "rtps.flag.security.info.plugin_participant_liveliness_encrypted",
17991 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
17993 { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_origin_encrypted,{
17994 "RTPS Origin Encrypted", "rtps.flag.security.info.plugin_participant_rtps_origin_encrypted",
17995 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL }
17997 { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_origin_encrypted,{
17998 "Discovery Origin Encrypted", "rtps.flag.security.info.plugin_participant_discovery_origin_encrypted",
17999 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL }
18001 { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_origin_encrypted,{
18002 "Liveliness Origin Encrypted", "rtps.flag.security.info.plugin_participant_liveliness_origin_encrypted",
18003 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL }
18005 { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_psk_encrypted,{
18006 "RTPS Pre-Shared Key Encrypted", "rtps.flag.security.info.plugin_participant_psk_encrypted",
18007 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040, NULL, HFILL }
18009 { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_valid,{
18010 "Mask Valid", "rtps.flag.security.info.plugin_participant_mask_valid",
18011 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000, NULL, HFILL }
18013 { &hf_rtps_param_plugin_participant_security_attributes_mask,{
18014 "PluginParticipantSecurityAttributesMask (valid dissection if using the Specification Builtin Plugins)",
18015 "rtps.param.plugin_participant_security_attributes",
18016 FT_UINT32, BASE_HEX, NULL, 0,
18017 "bitmask representing the PluginParticipantSecurityAttributes flags in PID_PARTICIPANT_SECURITY_INFO",
18018 HFILL }
18020 { &hf_rtps_param_enable_authentication,
18021 { "Authentication enabled", "rtps.secure.enable_authentication",
18022 FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
18024 { &hf_rtps_param_builtin_endpoint_qos,
18025 { "Built-in Endpoint QoS", "rtps.param.builtin_endpoint_qos",
18026 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }
18028 { &hf_rtps_param_sample_signature_epoch,
18029 { "Epoch", "rtps.sample_signature.epoch",
18030 FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }
18032 { &hf_rtps_param_sample_signature_nonce,
18033 { "Nonce", "rtps.sample_signature.nonce",
18034 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
18036 { &hf_rtps_param_sample_signature_length,
18037 {"Signature Length", "rtps.sample_signature.signature_length",
18038 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
18040 { &hf_rtps_param_sample_signature_signature,
18041 { "Signature", "rtps.sample_signature.signature",
18042 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
18044 { &hf_rtps_secure_dataheader_transformation_kind, {
18045 "Transformation Kind", "rtps.secure.data_header.transformation_kind",
18046 FT_INT8, BASE_DEC, VALS(secure_transformation_kind), 0,
18047 NULL, HFILL }
18049 { &hf_rtps_secure_dataheader_transformation_key_revision_id, {
18050 "Transformation Key Revision Id", "rtps.secure.data_header.transformation_key_revision_id",
18051 FT_INT24, BASE_DEC, NULL, 0,
18052 NULL, HFILL }
18054 { &hf_rtps_secure_dataheader_transformation_key_id, {
18055 "Transformation Key Id", "rtps.secure.data_header.transformation_key",
18056 FT_BYTES, BASE_NONE, NULL, 0,
18057 NULL, HFILL }
18059 { &hf_rtps_secure_dataheader_passphrase_id, {
18060 "Passphrase Id", "rtps.secure.data_header.passphrase_id",
18061 FT_UINT32, BASE_DEC, NULL, 0,
18062 NULL, HFILL }
18064 { &hf_rtps_secure_dataheader_passphrase_key_id, {
18065 "Passphrase Key Id", "rtps.secure.data_header.passphrase_key_id",
18066 FT_UINT8, BASE_HEX, NULL, 0,
18067 NULL, HFILL }
18069 { &hf_rtps_secure_dataheader_init_vector_suffix, {
18070 "Plugin Secure Header", "rtps.secure.data_header.init_vector_suffix",
18071 FT_BYTES, BASE_NONE, NULL, 0,
18072 NULL, HFILL }
18074 { &hf_rtps_secure_dataheader_session_id, {
18075 "Session Id", "rtps.secure.data_header.session_id",
18076 FT_UINT32, BASE_HEX, NULL, 0,
18077 NULL, HFILL }
18079 { &hf_rtps_secure_datatag_plugin_sec_tag, {
18080 "Receiver-Specific Mac",
18081 "rtps.secure.data_tag.receiver_specific_mac",
18082 FT_BYTES, BASE_NONE, NULL, 0,
18083 NULL, HFILL }
18085 { &hf_rtps_secure_datatag_plugin_sec_tag_key, {
18086 "Receiver-Specific Mac Key Id",
18087 "rtps.secure.data_tag.receiver_specific_macs_key_id",
18088 FT_BYTES, BASE_NONE, NULL, 0,
18089 NULL, HFILL }
18091 { &hf_rtps_secure_datatag_plugin_sec_tag_common_mac, {
18092 "Plugin Secure Tag Common Mac", "rtps.secure.data_tag.common_mac",
18093 FT_BYTES, BASE_NONE, NULL, 0,
18094 NULL, HFILL }
18096 { &hf_rtps_secure_datatag_plugin_specific_macs_len, {
18097 "Plugin Secure Tag Receiver-Specific Macs Length", "rtps.secure.data_tag.specific_macs_len",
18098 FT_UINT32, BASE_DEC, NULL, 0,
18099 NULL, HFILL }
18101 { &hf_rtps_srm_service_id,
18102 { "Service Id", "rtps.srm.service_id",
18103 FT_INT32, BASE_DEC, VALS(service_request_kind), 0, NULL, HFILL }
18105 { &hf_rtps_srm_request_body, {
18106 "Request Body", "rtps.srm.request_body",
18107 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
18109 { &hf_rtps_srm_instance_id, {
18110 "Instance Id", "rtps.srm.instance_id",
18111 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
18113 { &hf_rtps_topic_query_selection_filter_class_name,
18114 { "Class Name", "rtps.srm.topic_query.class_name",
18115 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
18117 { &hf_rtps_topic_query_selection_filter_expression,
18118 { "Filter Expression", "rtps.srm.topic_query.filter_expression",
18119 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
18121 { &hf_rtps_topic_query_selection_filter_parameter,
18122 { "Filter Parameter", "rtps.srm.topic_query.filter_parameter",
18123 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
18125 { &hf_rtps_topic_query_selection_num_parameters,
18126 { "Number of Filter Parameters", "rtps.srm.topic_query.num_filter_parameters",
18127 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
18129 { &hf_rtps_topic_query_topic_name,
18130 { "Topic Name", "rtps.srm.topic_query.topic_name",
18131 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
18133 { &hf_rtps_topic_query_original_related_reader_guid,
18134 { "Original Related Reader GUID", "rtps.srm.topic_query.original_related_reader_guid",
18135 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
18137 { &hf_rtps_topic_query_selection_kind,
18138 { "Topic Query Selection Kind", "rtps.srm.topic_query.kind",
18139 FT_UINT32, BASE_DEC, VALS(topic_query_selection_kind), 0, NULL, HFILL }
18141 { &hf_rtps_data_session_intermediate,
18142 { "Data Session Intermediate Packet", "rtps.data_session.intermediate",
18143 FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
18145 { &hf_rtps_secure_secure_data_length,
18146 { "Secure Data Length", "rtps.secure.secure_data_length",
18147 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
18149 { &hf_rtps_secure_secure_data,
18150 { "Secure Data", "rtps.secure.secure_data",
18151 FT_BYTES, BASE_NONE, NULL, 0, "The user data transferred in a secure payload", HFILL }
18153 { &hf_rtps_secure_session_key,
18154 { "[Session Key]", "rtps.secure.session_key",
18155 FT_BYTES, BASE_NONE, NULL, 0, "The user data transferred in a secure payload", HFILL }
18157 { &hf_rtps_pgm, {
18158 "Participant Generic Message", "rtps.pgm",
18159 FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0, NULL, HFILL }
18161 { &hf_rtps_srm, {
18162 "Service Request Message", "rtps.srm",
18163 FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0, NULL, HFILL }
18165 { &hf_rtps_pgm_dst_participant_guid,
18166 { "Destination Participant GUID", "rtps.pgm.dst_participant_guid",
18167 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
18169 { &hf_rtps_source_participant_guid,
18170 { "Source Participant GUID", "rtps.pgm.source_participant_guid",
18171 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
18173 { &hf_rtps_pgm_dst_endpoint_guid,
18174 { "Destination Endpoint GUID", "rtps.pgm.dst_endpoint_guid",
18175 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
18177 { &hf_rtps_pgm_src_endpoint_guid,
18178 { "Source Endpoint GUID", "rtps.pgm.src_endpoint_guid",
18179 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
18181 { &hf_rtps_message_identity_source_guid,
18182 { "Source GUID", "rtps.pgm.message_identity.source_guid",
18183 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
18185 { &hf_rtps_pgm_message_class_id,
18186 { "Message class id", "rtps.pgm.data_holder.message_class_id",
18187 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
18189 { &hf_rtps_pgm_data_holder_class_id,
18190 { "Class Id", "rtps.pgm.data_holder.class_id",
18191 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
18193 #if 0
18194 { &hf_rtps_pgm_data_holder_stringseq_size,
18195 { "Size", "rtps.pgm.data_holder.string_seq_size",
18196 FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }
18198 { &hf_rtps_pgm_data_holder_stringseq_name,
18199 { "Name", "rtps.pgm.data_holder.string_seq_name",
18200 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
18202 { &hf_rtps_pgm_data_holder_long_long,
18203 { "Long long", "rtps.pgm.data_holder.long_long",
18204 FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL }
18206 #endif
18207 { &hf_rtps_param_topic_query_publication_enable,
18208 { "Enable", "rtps.param.topic_query_publication_enable",
18209 FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
18211 { &hf_rtps_param_topic_query_publication_sessions,
18212 { "Number of sessions", "rtps.param.topic_query_publication_sessions",
18213 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
18215 { &hf_rtps_pl_cdr_member,
18216 { "Member value", "rtps.data.value",
18217 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
18219 { &hf_rtps_pl_cdr_member_id,
18220 { "Member ID", "rtps.data.member_id",
18221 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
18223 { &hf_rtps_pl_cdr_member_length,
18224 { "Member length", "rtps.data.member_length",
18225 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
18227 { &hf_rtps_pl_cdr_member_id_ext,
18228 { "Member ID", "rtps.data.member_id",
18229 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
18231 { &hf_rtps_pl_cdr_member_length_ext,
18232 { "Member length", "rtps.data.member_length",
18233 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
18235 { &hf_rtps_dcps_publication_data_frame_number,{
18236 "DCPSPublicationData In", "rtps.dcps_publication_data_frame_number",
18237 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
18238 "This is a submessage sent by the DataWriter described in the DCPSPublicationData found in this frame", HFILL }
18240 { &hf_rtps_data_tag_name,
18241 { "Name", "rtps.param.data_tag.name",
18242 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
18244 { &hf_rtps_data_tag_value,
18245 { "Value", "rtps.param.data_tag.value",
18246 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
18248 { &hf_rtps_fragments,
18249 { "Message fragments", "rtps.fragments",
18250 FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }
18252 { &hf_rtps_fragment,
18253 { "Message fragment", "rtps.fragment",
18254 FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
18256 { &hf_rtps_fragment_overlap,
18257 { "Message fragment overlap", "rtps.fragment.overlap",
18258 FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
18260 { &hf_rtps_fragment_overlap_conflict,
18261 { "Message fragment overlapping with conflicting data", "rtps.fragment.overlap.conflicts",
18262 FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
18264 { &hf_rtps_fragment_multiple_tails,
18265 { "Message has multiple tail fragments", "rtps.fragment.multiple_tails",
18266 FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
18268 { &hf_rtps_fragment_too_long_fragment,
18269 { "Message fragment too long", "rtps.fragment.too_long_fragment",
18270 FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
18272 { &hf_rtps_fragment_error,
18273 { "Message defragmentation error", "rtps.fragment.error",
18274 FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
18276 { &hf_rtps_fragment_count,
18277 { "Message fragment count", "rtps.fragment.count",
18278 FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }
18280 { &hf_rtps_reassembled_in,
18281 { "Reassembled in", "rtps.reassembled.in",
18282 FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
18284 { &hf_rtps_reassembled_length,
18285 { "Reassembled length", "rtps.reassembled.length",
18286 FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }
18288 { &hf_rtps_reassembled_data,
18289 { "Reassembled RTPS data", "rtps.reassembled.data", FT_BYTES, BASE_NONE,
18290 NULL, 0x0, "The reassembled payload", HFILL }
18292 { &hf_rtps_compression_plugin_class_id,
18293 { "Compression class Id", "rtps.param.compression_class_id", FT_UINT32, BASE_DEC,
18294 VALS(class_id_enum_names), 0x0, NULL, HFILL }
18296 { &hf_rtps_encapsulation_options_compression_plugin_class_id,
18297 { "Compression class Id", "rtps.param.plugin.compression_class_id", FT_INT8, BASE_DEC,
18298 VALS(class_id_enum_names), 0x0, NULL, HFILL }
18300 { &hf_rtps_padding_bytes,
18301 { "Padding bytes", "rtps.padding_bytes", FT_INT8, BASE_DEC,
18302 NULL, 0x0, NULL, HFILL }
18304 { &hf_rtps_uncompressed_serialized_length,
18305 { "Uncompressed serialized length", "rtps.param.uncompressed_serialized_length", FT_UINT32, BASE_DEC,
18306 NULL, 0x0, "The reassembled payload", HFILL }
18309 { &hf_rtps_encapsulation_extended_compression_options,
18310 { "Uncompressed serialized length", "rtps.extended_compression_options", FT_UINT32, BASE_DEC,
18311 NULL, 0x0, "Extended compression options", HFILL }
18313 { &hf_rtps_compressed_serialized_type_object,
18314 { "Compressed serialized type object", "rtps.param.compressed_serialized_typeobject", FT_BYTES, BASE_NONE,
18315 NULL, 0x0, "The reassembled payload", HFILL }
18318 { &hf_rtps_dissection_boolean,
18319 {"BOOLEAN", "rtps.dissection.boolean",
18320 FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
18323 { &hf_rtps_dissection_byte,
18324 {"BYTE", "rtps.dissection.byte",
18325 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
18328 { &hf_rtps_dissection_int16,
18329 {"INT16", "rtps.dissection.int16",
18330 FT_INT16, BASE_DEC, NULL, 0, NULL, HFILL }
18333 { &hf_rtps_dissection_uint16,
18334 {"UINT16", "rtps.dissection.uint16",
18335 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
18338 { &hf_rtps_dissection_int32,
18339 {"INT32", "rtps.dissection.int32",
18340 FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }
18343 { &hf_rtps_dissection_uint32,
18344 {"UINT32", "rtps.dissection.uint32",
18345 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
18348 { &hf_rtps_dissection_int64,
18349 {"INT64", "rtps.dissection.int64",
18350 FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL }
18353 { &hf_rtps_dissection_uint64,
18354 {"UINT64", "rtps.dissection.uint64",
18355 FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }
18358 { &hf_rtps_dissection_float,
18359 {"FLOAT", "rtps.dissection.float",
18360 FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL }
18363 { &hf_rtps_dissection_double,
18364 {"DOUBLE", "rtps.dissection.double",
18365 FT_DOUBLE, BASE_NONE, NULL, 0, NULL, HFILL }
18368 { &hf_rtps_dissection_int128,
18369 {"INT128", "rtps.dissection.int128",
18370 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
18373 { &hf_rtps_dissection_string,
18374 { "STRING", "rtps.dissection.string",
18375 FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL }
18377 { &hf_rtps_flag_udpv4_wan_locator_u, {
18378 "UUID Locator", "rtps.flag.udpv4_wan_locator.u",
18379 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01, NULL, HFILL }
18381 { &hf_rtps_flag_udpv4_wan_locator_p, {
18382 "Public Locator", "rtps.flag.udpv4_wan_locator.p",
18383 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
18385 { &hf_rtps_flag_udpv4_wan_locator_b, {
18386 "Bidirectional Locator", "rtps.flag.udpv4_wan_locator.b",
18387 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
18389 { &hf_rtps_flag_udpv4_wan_locator_r, {
18390 "Relay Locator", "rtps.flag.udpv4_wan_locator.r",
18391 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL }
18393 { &hf_rtps_udpv4_wan_locator_flags, {
18394 "Flags", "rtps.flag.udpv4_wan_locator",
18395 FT_UINT8, BASE_HEX, NULL, 0, "Bitmask representing the flags UDPv4 WAN locator", HFILL }
18397 { &hf_rtps_uuid,{
18398 "UUID", "rtps.uuid",
18399 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
18401 { &hf_rtps_udpv4_wan_locator_public_ip, {
18402 "Public IP", "rtps.udpv4_wan_locator.public_ip",
18403 FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL }
18405 { &hf_rtps_udpv4_wan_locator_public_port, {
18406 "Public port", "rtps.udpv4_wan_locator.public_port",
18407 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
18409 { &hf_rtps_udpv4_wan_locator_local_ip,{
18410 "Local IP", "rtps.udpv4_wan_locator.local_ip",
18411 FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL }
18413 { &hf_rtps_udpv4_wan_locator_local_port,{
18414 "Local port", "rtps.udpv4_wan_locator.local_port",
18415 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
18417 { &hf_rtps_flag_udpv4_wan_binding_ping_e, {
18418 "Endianness", "rtps.flag.udpv4_wan_binding_ping.e",
18419 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01, NULL, HFILL }
18421 { &hf_rtps_flag_udpv4_wan_binding_ping_l, {
18422 "Long address", "rtps.flag.udpv4_wan_binding_ping.l",
18423 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
18425 { &hf_rtps_flag_udpv4_wan_binding_ping_b,{
18426 "Bidirectional", "rtps.flag.udpv4_wan_binding_ping.b",
18427 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
18429 { &hf_rtps_udpv4_wan_binding_ping_flags, {
18430 "Flags", "rtps.flag.udpv4_wan_binding_ping",
18431 FT_UINT8, BASE_HEX, NULL, 0, "Bitmask representing the flags UDPv4 WAN binding ping", HFILL }
18433 { &hf_rtps_udpv4_wan_binding_ping_port, {
18434 "RTPS port", "rtps.flag.udpv4_wan_binding_rtps_port",
18435 FT_UINT32, BASE_DEC, NULL, 0, "UDPv4 WAN binding ping RTPS port", HFILL }
18437 { &hf_rtps_long_address, {
18438 "Long address", "rtps.long_address", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
18440 { &hf_rtps_param_group_coherent_set, {
18441 "Group coherent set sequence number", "rtps.param.group_coherent_set",
18442 FT_UINT64, BASE_DEC, NULL, 0, "Decimal value representing the value of PID_GROUP_COHERENT_SET parameter", HFILL }
18444 { &hf_rtps_param_end_group_coherent_set, {
18445 "End group coherent set sequence number", "rtps.param.end_group_coherent_set",
18446 FT_UINT64, BASE_DEC, NULL, 0, "Decimal value representing the value of PID_END_GROUP_COHERENT_SET parameter", HFILL }
18448 { &hf_rtps_param_mig_end_coherent_set_sample_count, {
18449 "Ended coherent set sample count", "rtps.param.mig_end_coherent_set_sample_count",
18450 FT_UINT32, BASE_DEC, NULL, 0, "Decimal value representing the value of MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT parameter", HFILL }
18452 { &hf_rtps_flag_cloud_discovery_service_announcer,{
18453 "Cloud Discovery Service Announcer", "rtps.flag.cloud_discovery_service_announcer",
18454 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040, NULL, HFILL }
18456 { &hf_rtps_writer_group_oid, {
18457 "Writer Group OID", "rtps.writer_group_oid",
18458 FT_UINT32, BASE_DEC, NULL, 0, "Decimal representing the writer group OID", HFILL }
18460 { &hf_rtps_reader_group_oid, {
18461 "Reader Group OID", "rtps.reader_group_oid",
18462 FT_UINT32, BASE_DEC, NULL, 0, "Decimal representing the reader group OID", HFILL }
18464 { &hf_rtps_writer_session_id,{
18465 "Writer Session ID", "rtps.writer_session_id",
18466 FT_UINT32, BASE_DEC, NULL, 0, "Decimal representing the writer session ID", HFILL }
18468 { &hf_rtps_flag_participant_config_writer,{
18469 "Participant Config Writer", "rtps.flag.participant_config_writer",
18470 FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_WRITER, NULL, HFILL }
18472 { &hf_rtps_flag_participant_config_reader,{
18473 "Participant Config Reader", "rtps.flag.participant_config_reader",
18474 FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_READER, NULL, HFILL }
18476 { &hf_rtps_flag_participant_config_secure_writer,{
18477 "Participant Config Secure Writer", "rtps.flag.participant_config_secure_writer",
18478 FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_SECURE_WRITER, NULL, HFILL }
18480 { &hf_rtps_flag_participant_config_secure_reader,{
18481 "Participant Config Secure Reader", "rtps.flag.participant_config_secure_reader",
18482 FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_SECURE_READER, NULL, HFILL }
18484 { &hf_rtps_flag_participant_bootstrap_writer,{
18485 "Participant Bootstrap Writer", "rtps.flag.participant_bootstrap_writer",
18486 FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_BOOTSTRAP_WRITER, NULL, HFILL }
18488 { &hf_rtps_flag_participant_bootstrap_reader,{
18489 "Participant Bootstrap Reader", "rtps.flag.participant_bootstrap_reader",
18490 FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_BOOTSTRAP_READER, NULL, HFILL }
18492 { &hf_rtps_flag_monitoring_periodic_writer,{
18493 "Monitoring Periodic Writer", "rtps.flag.monitoring_periodic_writer",
18494 FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_PERIODIC_WRITER, NULL, HFILL }
18496 { &hf_rtps_flag_monitoring_periodic_reader,{
18497 "Monitoring Periodic Reader", "rtps.flag.monitoring_periodic_reader",
18498 FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_PERIODIC_READER, NULL, HFILL }
18500 { &hf_rtps_flag_monitoring_event_writer,{
18501 "Monitoring Event Writer", "rtps.flag.monitoring_event_writer",
18502 FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_EVENT_WRITER, NULL, HFILL }
18504 { &hf_rtps_flag_monitoring_event_reader,{
18505 "Monitoring Event Reader", "rtps.flag.monitoring_event_reader",
18506 FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_EVENT_READER, NULL, HFILL }
18508 { &hf_rtps_flag_monitoring_logging_writer,{
18509 "Monitoring Logging Writer", "rtps.flag.monitoring_logging_writer",
18510 FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_LOGGING_WRITER, NULL, HFILL }
18512 { &hf_rtps_flag_monitoring_logging_reader,{
18513 "Monitoring Logging Reader", "rtps.flag.monitoring_logging_reader",
18514 FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_LOGGING_READER, NULL, HFILL }
18518 static int *ett[] = {
18519 &ett_rtps,
18520 &ett_rtps_default_mapping,
18521 &ett_rtps_proto_version,
18522 &ett_rtps_product_version,
18523 &ett_rtps_submessage,
18524 &ett_rtps_parameter_sequence,
18525 &ett_rtps_parameter,
18526 &ett_rtps_flags,
18527 &ett_rtps_entity,
18528 &ett_rtps_generic_guid,
18529 &ett_rtps_rdentity,
18530 &ett_rtps_wrentity,
18531 &ett_rtps_guid_prefix,
18532 &ett_rtps_app_id,
18533 &ett_rtps_locator_udp_v4,
18534 &ett_rtps_locator,
18535 &ett_rtps_locator_list,
18536 &ett_rtps_timestamp,
18537 &ett_rtps_bitmap,
18538 &ett_rtps_seq_string,
18539 &ett_rtps_seq_ulong,
18540 &ett_rtps_resource_limit,
18541 &ett_rtps_durability_service,
18542 &ett_rtps_liveliness,
18543 &ett_rtps_manager_key,
18544 &ett_rtps_serialized_data,
18545 &ett_rtps_locator_filter_channel,
18546 &ett_rtps_part_message_data,
18547 &ett_rtps_sample_info_list,
18548 &ett_rtps_sample_info,
18549 &ett_rtps_sample_batch_list,
18550 &ett_rtps_locator_filter_locator,
18551 &ett_rtps_writer_heartbeat_virtual_list,
18552 &ett_rtps_writer_heartbeat_virtual,
18553 &ett_rtps_virtual_guid_heartbeat_virtual_list,
18554 &ett_rtps_virtual_guid_heartbeat_virtual,
18555 &ett_rtps_app_ack_virtual_writer_list,
18556 &ett_rtps_app_ack_virtual_writer,
18557 &ett_rtps_app_ack_virtual_writer_interval_list,
18558 &ett_rtps_app_ack_virtual_writer_interval,
18559 &ett_rtps_transport_info,
18560 &ett_rtps_property_list,
18561 &ett_rtps_property,
18562 &ett_rtps_topic_info,
18563 &ett_rtps_topic_info_dw_qos,
18564 &ett_rtps_type_object,
18565 &ett_rtps_type_library,
18566 &ett_rtps_type_element,
18567 &ett_rtps_type_annotation_usage_list,
18568 &ett_rtps_type_enum_constant,
18569 &ett_rtps_type_bound_list,
18570 &ett_rtps_secure_payload_tree,
18571 &ett_rtps_secure_dataheader_tree,
18572 &ett_rtps_secure_transformation_kind,
18573 &ett_rtps_pgm_data,
18574 &ett_rtps_message_identity,
18575 &ett_rtps_related_message_identity,
18576 &ett_rtps_data_holder_seq,
18577 &ett_rtps_data_holder,
18578 &ett_rtps_data_holder_properties,
18579 &ett_rtps_property_tree,
18580 &ett_rtps_param_header_tree,
18581 &ett_rtps_custom_dissection_info,
18582 &ett_rtps_service_request_tree,
18583 &ett_rtps_locator_ping_tree,
18584 &ett_rtps_locator_reachability_tree,
18585 &ett_rtps_locator_list_tree,
18586 &ett_rtps_topic_query_tree,
18587 &ett_rtps_topic_query_selection_tree,
18588 &ett_rtps_topic_query_filter_params_tree,
18589 &ett_rtps_data_member,
18590 &ett_rtps_data_tag_seq,
18591 &ett_rtps_data_tag_item,
18592 &ett_rtps_fragment,
18593 &ett_rtps_fragments,
18594 &ett_rtps_data_representation,
18595 &ett_rtps_decompressed_type_object,
18596 &ett_rtps_dissection_tree,
18597 &ett_rtps_info_remaining_items,
18598 &ett_rtps_data_encapsulation_options,
18599 &ett_rtps_decompressed_serialized_data,
18600 &ett_rtps_instance_transition_data,
18601 &ett_rtps_crypto_algorithm_requirements,
18602 &ett_rtps_decrypted_payload,
18603 &ett_rtps_secure_postfix_tag_list_item
18606 static ei_register_info ei[] = {
18607 { &ei_rtps_sm_octets_to_next_header_error, { "rtps.sm.octetsToNextHeader.error", PI_PROTOCOL, PI_WARN, "(Error: bad length)", EXPFILL }},
18608 { &ei_rtps_locator_port, { "rtps.locator.port.invalid", PI_PROTOCOL, PI_WARN, "Invalid Port", EXPFILL }},
18609 { &ei_rtps_ip_invalid, { "rtps.ip_invalid", PI_PROTOCOL, PI_WARN, "IPADDRESS_INVALID_STRING", EXPFILL }},
18610 { &ei_rtps_port_invalid, { "rtps.port_invalid", PI_PROTOCOL, PI_WARN, "PORT_INVALID_STRING", EXPFILL }},
18611 { &ei_rtps_parameter_value_invalid, { "rtps.parameter_value_too_small", PI_PROTOCOL, PI_WARN, "ERROR: Parameter value too small", EXPFILL }},
18612 { &ei_rtps_parameter_not_decoded, { "rtps.parameter_not_decoded", PI_PROTOCOL, PI_WARN, "[DEPRECATED] - Parameter not decoded", EXPFILL }},
18613 { &ei_rtps_sm_octets_to_next_header_not_zero, { "rtps.sm.octetsToNextHeader.not_zero", PI_PROTOCOL, PI_WARN, "Should be ZERO", EXPFILL }},
18614 { &ei_rtps_extra_bytes, { "rtps.extra_bytes", PI_MALFORMED, PI_ERROR, "Unhandled extra byte", EXPFILL }},
18615 { &ei_rtps_missing_bytes, { "rtps.missing_bytes", PI_MALFORMED, PI_ERROR, "Not enough bytes to decode", EXPFILL }},
18616 { &ei_rtps_more_samples_available, { "rtps.more_samples_available", PI_PROTOCOL, PI_NOTE, "More samples available. Configure this limit from preferences dialog", EXPFILL }},
18617 { &ei_rtps_pid_type_csonsistency_invalid_size, { "rtps.pid_type_consistency_invalid_size", PI_MALFORMED, PI_ERROR, "PID_TYPE_CONSISTENCY invalid size", EXPFILL }},
18618 { &ei_rtps_uncompression_error, { "rtps.uncompression_error", PI_PROTOCOL, PI_WARN, "Unable to uncompress the compressed payload.", EXPFILL }},
18619 { &ei_rtps_value_too_large, { "rtps.value_too_large", PI_MALFORMED, PI_ERROR, "Length value goes past the end of the packet", EXPFILL }},
18620 { &ei_rtps_checksum_check_error, { "rtps.checksum_error", PI_CHECKSUM, PI_ERROR, "Error: Unexpected checksum", EXPFILL }},
18621 { &ei_rtps_invalid_psk, { "rtps.psk_decryption_error", PI_UNDECODED, PI_ERROR, "Unable to decrypt content using PSK", EXPFILL }},
18622 { &ei_rtps_invalid_fragment_size, { "rtps.fragment_size", PI_MALFORMED, PI_WARN, "Invalid fragment size", EXPFILL }},
18625 module_t *rtps_module;
18626 expert_module_t *expert_rtps;
18627 uat_t * rtps_psk_uat;
18629 proto_rtps = proto_register_protocol("Real-Time Publish-Subscribe Wire Protocol", "RTPS", "rtps");
18630 proto_register_field_array(proto_rtps, hf, array_length(hf));
18631 proto_register_subtree_array(ett, array_length(ett));
18632 expert_rtps = expert_register_protocol(proto_rtps);
18633 expert_register_field_array(expert_rtps, ei, array_length(ei));
18635 /* Registers the control in the preference panel */
18636 rtps_module = prefs_register_protocol(proto_rtps, NULL);
18637 prefs_register_uint_preference(
18638 rtps_module,
18639 "max_batch_samples_dissected",
18640 "Max samples dissected for DATA_BATCH",
18641 "Specifies the maximum number of samples dissected in a DATA_BATCH "
18642 "submessage. Increasing this value may affect performance if the "
18643 "trace has a lot of big batched samples.",
18645 &rtps_max_batch_samples_dissected);
18647 prefs_register_bool_preference(
18648 rtps_module,
18649 "enable_max_dissection_info_elements",
18650 "Limit the number of elements dissected in structs",
18651 "Enabling this option may affect performance if the trace has messages "
18652 "with large Data Types.",
18653 &enable_max_data_type_elements);
18655 prefs_register_uint_preference(
18656 rtps_module,
18657 "max_dissection_info_elements",
18658 "Max Dissection info elements shown in structs",
18659 "Specifies the maximum number of Data Type elements dissected. "
18660 "Increasing this value may affect performance if the trace has "
18661 "messages with large Data Types.",
18663 &rtps_max_data_type_elements);
18665 prefs_register_bool_preference(
18666 rtps_module,
18667 "enable_max_dissection_array_elements",
18668 "Limit the number of elements dissected in arrays or sequences",
18669 "Disabling this option may affect performance if the trace has messages "
18670 "with large arrays or sequences.",
18671 &enable_max_array_data_type_elements);
18673 prefs_register_uint_preference(
18674 rtps_module,
18675 "max_dissection_array_elements",
18676 "Max Dissection elements shown in arrays or sequences",
18677 "Specifies the maximum number of Data Type elements dissected in arrays or sequences. "
18678 "Increasing this value may affect "
18679 "performance if the trace has messages with large Data Types.",
18681 &rtps_max_array_data_type_elements);
18683 prefs_register_bool_preference(
18684 rtps_module,
18685 "enable_topic_info",
18686 "Enable Topic Information",
18687 "Shows the Topic Name and Type Name of the samples. "
18688 "Note: this can considerably increase the dissection time.",
18689 &enable_topic_info);
18691 prefs_register_bool_preference(
18692 rtps_module,
18693 "enable_user_data_dissection",
18694 "Enable User Data Dissection (based on Type Object)",
18695 "Dissects the user data if the Type Object is propagated in Discovery.",
18696 &enable_user_data_dissection);
18698 prefs_register_bool_preference(
18699 rtps_module,
18700 "enable_rtps_reassembly",
18701 "Enable RTPS Reassembly",
18702 "Enables the reassembly of DATA_FRAG submessages.",
18703 &enable_rtps_reassembly);
18705 prefs_register_bool_preference(
18706 rtps_module,
18707 "enable_rtps_checksum_check",
18708 "Enable RTPS Checksum check (Only CRC-32C and MD5 supported)",
18709 "Detects the RTPS packets with invalid checksums (Only CRC-32C and MD5 "
18710 "supported)",
18711 &enable_rtps_crc_check);
18713 prefs_register_bool_preference(
18714 rtps_module,
18715 "enable_rtps_psk_decryption",
18716 "Enable RTPS PSK decryption",
18717 "Decode RTPS messages protected with a pre-shared key",
18718 &enable_rtps_psk_decryption);
18720 rtps_psk_uat = uat_new(
18721 "RTPS GUID-PSK",
18722 sizeof(rtps_psk_options_entry_t),
18723 "RTPS PSK Keys",
18724 true,
18725 &rtps_psk_options.entries,
18726 &rtps_psk_options.size,
18727 0x00000001,
18728 NULL,
18729 rtps_psk_options_copy_entry,
18730 rtps_psk_options_update_entry,
18731 rtps_psk_options_free_entry,
18732 NULL,
18733 NULL,
18734 rtps_psk_table_field_array);
18736 prefs_register_uat_preference(
18737 rtps_module,
18738 "psk_keys",
18739 "Pre-shared keys",
18740 "List of pre-shared keys that will be used to decode RTPS messages if"
18741 " the previous option is enabled",
18742 rtps_psk_uat);
18744 rtps_type_name_table = register_dissector_table("rtps.type_name", "RTPS Type Name",
18745 proto_rtps, FT_STRING, STRING_CASE_SENSITIVE);
18747 registry = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), hash_by_guid, compare_by_guid);
18748 dissection_infos = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_int64_hash, g_int64_equal);
18749 union_member_mappings = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_int64_hash, g_int64_equal);
18750 mutable_member_mappings = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_int64_hash, g_int64_equal);
18751 coherent_set_tracking.entities_using_map = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), hash_by_guid, compare_by_guid);
18752 coherent_set_tracking.coherent_set_registry_map = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), coherent_set_key_hash_by_key, compare_by_coherent_set_key);
18753 builtin_dissection_infos = wmem_map_new_autoreset(wmem_epan_scope(), wmem_epan_scope(), g_int64_hash, g_int64_equal);
18755 coherent_set_tracking.entities_using_map = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), hash_by_guid, compare_by_guid);
18756 discovered_participants_domain_ids = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), hash_by_participant_guid, compare_by_participant_guid);
18757 /* In order to get this dissector from other dissectors */
18758 register_dissector("rtps", dissect_simple_rtps, proto_rtps);
18760 initialize_instance_state_data_response_dissection_info(&builtin_types_dissection_data);
18762 reassembly_table_register(&rtps_reassembly_table,
18763 &addresses_reassembly_table_functions);
18766 void proto_reg_handoff_rtps(void) {
18767 heur_dissector_add("rtitcp", dissect_rtps_rtitcp, "RTPS over RTITCP", "rtps_rtitcp", proto_rtps, HEURISTIC_ENABLE);
18768 heur_dissector_add("udp", dissect_rtps_udp, "RTPS over UDP", "rtps_udp", proto_rtps, HEURISTIC_ENABLE);
18769 heur_dissector_add("tcp", dissect_rtps_tcp, "RTPS over TCP", "rtps_tcp", proto_rtps, HEURISTIC_ENABLE);
18773 * Editor modelines
18775 * Local Variables:
18776 * c-basic-offset: 2
18777 * tab-width: 8
18778 * indent-tabs-mode: nil
18779 * End:
18781 * ex: set shiftwidth=2 tabstop=8 expandtab:
18782 * :indentSize=2:tabSize=8:noTabs=true: