/* packet-rtps.c * ~~~~~~~~~~~~~ * * Routines for Real-Time Publish-Subscribe Protocol (RTPS) dissection * * (c) 2005-2014 Copyright, Real-Time Innovations, Inc. * Real-Time Innovations, Inc. * 232 East Java Drive * Sunnyvale, CA 94089 * * Copyright 2003, LUKAS POKORNY * PETR SMOLIK * ZDENEK SEBEK * * Czech Technical University in Prague * Faculty of Electrical Engineering * Department of Control Engineering * * Wireshark - Network traffic analyzer * By Gerald Combs * Copyright 1998 Gerald Combs * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * ------------------------------------- * * The following file is part of the RTPS packet dissector for Wireshark. * * RTPS protocol was developed by Real-Time Innovations, Inc. as wire * protocol for Data Distribution System. * Additional information at: * * OMG DDS standards: http://portals.omg.org/dds/omg-dds-standard/ * * Older OMG DDS specification: * http://www.omg.org/cgi-bin/doc?ptc/2003-07-07 * * NDDS and RTPS information: http://www.rti.com/resources.html * */ #include "config.h" #include #include #include #include "packet-rtps.h" #include void proto_register_rtps(void); void proto_reg_handoff_rtps(void); #define MAX_GUID_PREFIX_SIZE (128) #define MAX_GUID_SIZE (160) #define MAX_VENDOR_ID_SIZE (128) #define MAX_PARAM_SIZE (256) #define MAX_TIMESTAMP_SIZE (128) static const char *const SM_EXTRA_RPLUS = "(r+)"; static const char *const SM_EXTRA_RMINUS = "(r-)"; static const char *const SM_EXTRA_WPLUS = "(w+)"; static const char *const SM_EXTRA_WMINUS = "(w-)"; static const char *const SM_EXTRA_PPLUS = "(p+)"; static const char *const SM_EXTRA_PMINUS = "(p-)"; static const char *const SM_EXTRA_TPLUS = "(t+)"; static const char *const SM_EXTRA_TMINUS = "(t-)"; /***************************************************************************/ /* Protocol Fields Identifiers */ static int proto_rtps = -1; static int hf_rtps_magic = -1; static int hf_rtps_protocol_version = -1; static int hf_rtps_protocol_version_major = -1; static int hf_rtps_protocol_version_minor = -1; static int hf_rtps_vendor_id = -1; static int hf_rtps_domain_id = -1; static int hf_rtps_participant_idx = -1; static int hf_rtps_nature_type = -1; static int hf_rtps_guid_prefix_v1 = -1; static int hf_rtps_guid_prefix = -1; static int hf_rtps_guid_prefix_src = -1; static int hf_rtps_guid_prefix_dst = -1; static int hf_rtps_host_id = -1; static int hf_rtps_app_id = -1; static int hf_rtps_app_id_instance_id = -1; static int hf_rtps_app_id_app_kind = -1; static int hf_rtps_sm_id = -1; static int hf_rtps_sm_idv2 = -1; static int hf_rtps_sm_flags = -1; static int hf_rtps_sm_flags2 = -1; static int hf_rtps_sm_octets_to_next_header = -1; static int hf_rtps_sm_guid_prefix_v1 = -1; static int hf_rtps_sm_guid_prefix = -1; static int hf_rtps_sm_host_id = -1; static int hf_rtps_sm_app_id = -1; static int hf_rtps_sm_instance_id_v1 = -1; static int hf_rtps_sm_app_kind = -1; static int hf_rtps_sm_instance_id = -1; static int hf_rtps_sm_entity_id = -1; static int hf_rtps_sm_entity_id_key = -1; static int hf_rtps_sm_entity_id_kind = -1; static int hf_rtps_sm_rdentity_id = -1; static int hf_rtps_sm_rdentity_id_key = -1; static int hf_rtps_sm_rdentity_id_kind = -1; static int hf_rtps_sm_wrentity_id = -1; static int hf_rtps_sm_wrentity_id_key = -1; static int hf_rtps_sm_wrentity_id_kind = -1; static int hf_rtps_sm_seq_number = -1; static int hf_rtps_info_src_ip = -1; static int hf_rtps_info_src_unused = -1; static int hf_rtps_parameter_id = -1; static int hf_rtps_parameter_id_v2 = -1; static int hf_rtps_parameter_id_inline_rti = -1; static int hf_rtps_parameter_id_toc = -1; static int hf_rtps_parameter_id_rti = -1; static int hf_rtps_parameter_id_pt = -1; static int hf_rtps_parameter_length = -1; static int hf_rtps_param_topic_name = -1; static int hf_rtps_param_strength = -1; static int hf_rtps_param_type_name = -1; static int hf_rtps_param_user_data = -1; static int hf_rtps_param_group_data = -1; static int hf_rtps_param_topic_data = -1; static int hf_rtps_param_content_filter_topic_name = -1; static int hf_rtps_param_related_topic_name = -1; static int hf_rtps_param_filter_class_name = -1; static int hf_rtps_issue_data = -1; static int hf_rtps_durability_service_cleanup_delay = -1; static int hf_rtps_liveliness_lease_duration = -1; static int hf_rtps_participant_lease_duration = -1; static int hf_rtps_time_based_filter_minimum_separation = -1; static int hf_rtps_reliability_max_blocking_time = -1; static int hf_rtps_deadline_period = -1; static int hf_rtps_latency_budget_duration = -1; static int hf_rtps_lifespan_duration = -1; static int hf_rtps_persistence = -1; static int hf_rtps_info_ts_timestamp = -1; static int hf_rtps_locator_kind = -1; static int hf_rtps_locator_port = -1; /* static int hf_rtps_logical_port = -1; */ static int hf_rtps_locator_public_address_port = -1; static int hf_rtps_locator_ipv4 = -1; static int hf_rtps_locator_ipv6 = -1; static int hf_rtps_participant_builtin_endpoints = -1; static int hf_rtps_participant_manual_liveliness_count = -1; static int hf_rtps_history_depth = -1; static int hf_rtps_resource_limit_max_samples = -1; static int hf_rtps_resource_limit_max_instances = -1; static int hf_rtps_resource_limit_max_samples_per_instances = -1; static int hf_rtps_filter_bitmap = -1; static int hf_rtps_type_checksum = -1; static int hf_rtps_queue_size = -1; static int hf_rtps_acknack_count = -1; static int hf_rtps_durability_service_history_kind = -1; static int hf_rtps_durability_service_history_depth = -1; static int hf_rtps_durability_service_max_samples = -1; static int hf_rtps_durability_service_max_instances = -1; static int hf_rtps_durability_service_max_samples_per_instances = -1; static int hf_rtps_liveliness_kind = -1; static int hf_rtps_manager_key = -1; static int hf_rtps_locator_udp_v4 = -1; static int hf_rtps_locator_udp_v4_port = -1; static int hf_param_ip_address = -1; static int hf_rtps_param_port = -1; static int hf_rtps_expects_inline_qos = -1; static int hf_rtps_presentation_coherent_access = -1; static int hf_rtps_presentation_ordered_access = -1; static int hf_rtps_expects_ack = -1; static int hf_rtps_reliability_kind = -1; static int hf_rtps_durability = -1; static int hf_rtps_ownership = -1; static int hf_rtps_presentation_access_scope = -1; static int hf_rtps_destination_order = -1; static int hf_rtps_history_kind = -1; static int hf_rtps_data_status_info = -1; static int hf_rtps_param_serialize_encap_kind = -1; static int hf_rtps_param_serialize_encap_len = -1; static int hf_rtps_param_transport_priority = -1; static int hf_rtps_param_type_max_size_serialized = -1; static int hf_rtps_param_entity_name = -1; static int hf_rtps_param_role_name = -1; static int hf_rtps_disable_positive_ack = -1; static int hf_rtps_participant_guid_v1 = -1; static int hf_rtps_participant_guid = -1; static int hf_rtps_group_guid = -1; static int hf_rtps_endpoint_guid = -1; static int hf_rtps_param_host_id = -1; static int hf_rtps_param_app_id = -1; static int hf_rtps_param_instance_id = -1; static int hf_rtps_param_instance_id_v1 = -1; static int hf_rtps_param_app_kind = -1; static int hf_rtps_param_entity = -1; static int hf_rtps_param_entity_key = -1; static int hf_rtps_param_hf_entity_kind = -1; static int hf_rtps_data_frag_number = -1; static int hf_rtps_data_frag_num_fragments = -1; static int hf_rtps_data_frag_size = -1; static int hf_rtps_data_frag_sample_size = -1; static int hf_rtps_nokey_data_frag_number = -1; static int hf_rtps_nokey_data_frag_num_fragments= -1; static int hf_rtps_nokey_data_frag_size = -1; static int hf_rtps_nack_frag_count = -1; static int hf_rtps_heartbeat_frag_number = -1; static int hf_rtps_heartbeat_frag_count = -1; static int hf_rtps_heartbeat_batch_count = -1; static int hf_rtps_data_serialize_data = -1; static int hf_rtps_data_batch_timestamp = -1; static int hf_rtps_data_batch_offset_to_last_sample_sn = -1; static int hf_rtps_data_batch_sample_count = -1; static int hf_rtps_data_batch_offset_sn = -1; static int hf_rtps_data_batch_octets_to_sl_encap_id = -1; static int hf_rtps_data_batch_serialized_data_length = -1; static int hf_rtps_data_batch_octets_to_inline_qos = -1; static int hf_rtps_fragment_number_base64 = -1; static int hf_rtps_fragment_number_base = -1; static int hf_rtps_fragment_number_num_bits = -1; static int hf_rtps_bitmap_num_bits = -1; static int hf_rtps_param_partition_num = -1; static int hf_rtps_param_partition = -1; static int hf_rtps_param_filter_expression = -1; static int hf_rtps_param_expression_parameters_num = -1; static int hf_rtps_param_expression_parameters = -1; static int hf_rtps_locator_filter_list_num_channels = -1; static int hf_rtps_locator_filter_list_filter_name = -1; static int hf_rtps_locator_filter_list_filter_exp = -1; static int hf_rtps_extra_flags = -1; static int hf_rtps_param_builtin_endpoint_set_flags = -1; static int hf_rtps_param_vendor_builtin_endpoint_set_flags = -1; static int hf_rtps_param_endpoint_security_attributes = -1; static int hf_rtps_param_plugin_promiscuity_kind = -1; static int hf_rtps_param_service_kind = -1; static int hf_rtps_param_sample_signature_epoch = -1; static int hf_rtps_param_sample_signature_nonce = -1; static int hf_rtps_param_sample_signature_length = -1; static int hf_rtps_param_sample_signature_signature = -1; static int hf_rtps_secure_secure_data_length = -1; static int hf_rtps_secure_secure_data = -1; static int hf_rtps_param_enable_authentication = -1; static int hf_rtps_param_enable_encryption = -1; static int hf_rtps_secure_dataheader_transformation_kind = -1; static int hf_rtps_secure_dataheader_transformation_key_id = -1; static int hf_rtps_secure_dataheader_plugin_sec_header = -1; static int hf_rtps_secure_datatag_plugin_sec_tag = -1; static int hf_rtps_pgm = -1; static int hf_rtps_pgm_dst_participant_guid = -1; static int hf_rtps_pgm_dst_endpoint_guid = -1; static int hf_rtps_pgm_src_endpoint_guid = -1; static int hf_rtps_source_participant_guid = -1; static int hf_rtps_message_identity_source_guid = -1; static int hf_rtps_pgm_message_class_id = -1; static int hf_rtps_pgm_data_holder_class_id = -1; /* static int hf_rtps_pgm_data_holder_stringseq_size = -1; */ /* static int hf_rtps_pgm_data_holder_stringseq_name = -1; */ /* static int hf_rtps_pgm_data_holder_long_long = -1; */ static int hf_rtps_param_timestamp_sec = -1; static int hf_rtps_param_timestamp_fraction = -1; static int hf_rtps_transportInfo_classId = -1; static int hf_rtps_transportInfo_messageSizeMax = -1; static int hf_rtps_param_app_ack_count = -1; static int hf_rtps_param_app_ack_virtual_writer_count = -1; static int hf_rtps_param_app_ack_conf_virtual_writer_count = -1; static int hf_rtps_param_app_ack_conf_count = -1; static int hf_rtps_param_app_ack_interval_payload_length = -1; static int hf_rtps_param_app_ack_interval_flags = -1; static int hf_rtps_param_app_ack_interval_count = -1; static int hf_rtps_param_app_ack_octets_to_next_virtual_writer = -1; static int hf_rtps_expects_virtual_heartbeat = -1; static int hf_rtps_direct_communication = -1; static int hf_rtps_param_peer_host_epoch = -1; static int hf_rtps_param_endpoint_property_change_epoch = -1; static int hf_rtps_virtual_heartbeat_count = -1; static int hf_rtps_virtual_heartbeat_num_virtual_guids = -1; static int hf_rtps_virtual_heartbeat_num_writers = -1; static int hf_rtps_param_extended_parameter = -1; static int hf_rtps_param_extended_pid_length = -1; static int hf_rtps_param_type_consistency_kind = -1; static int hf_rtps_parameter_data = -1; static int hf_rtps_param_product_version_major = -1; static int hf_rtps_param_product_version_minor = -1; static int hf_rtps_param_product_version_release = -1; static int hf_rtps_param_product_version_release_as_char = -1; static int hf_rtps_param_product_version_revision = -1; static int hf_rtps_param_acknowledgment_kind = -1; static int hf_rtps_param_topic_query_publication_enable = -1; static int hf_rtps_param_topic_query_publication_sessions = -1; static int hf_rtps_srm = -1; static int hf_rtps_srm_service_id = -1; static int hf_rtps_srm_request_body = -1; static int hf_rtps_srm_instance_id = -1; static int hf_rtps_topic_query_selection_filter_class_name = -1; static int hf_rtps_topic_query_selection_filter_expression = -1; static int hf_rtps_topic_query_selection_num_parameters = -1; static int hf_rtps_topic_query_selection_filter_parameter = -1; static int hf_rtps_topic_query_topic_name = -1; static int hf_rtps_topic_query_original_related_reader_guid = -1; static int hf_rtps_encapsulation_id = -1; static int hf_rtps_encapsulation_kind = -1; static int hf_rtps_octets_to_inline_qos = -1; static int hf_rtps_filter_signature = -1; static int hf_rtps_bitmap = -1; static int hf_rtps_acknack_analysis = -1; static int hf_rtps_property_name = -1; static int hf_rtps_property_value = -1; static int hf_rtps_union = -1; static int hf_rtps_union_case = -1; static int hf_rtps_struct = -1; static int hf_rtps_member_name = -1; static int hf_rtps_sequence = -1; static int hf_rtps_array = -1; static int hf_rtps_bitfield = -1; static int hf_rtps_datatype = -1; static int hf_rtps_sequence_size = -1; static int hf_rtps_guid = -1; static int hf_rtps_heartbeat_count = -1; static int hf_rtps_encapsulation_options = -1; static int hf_rtps_serialized_key = -1; static int hf_rtps_serialized_data = -1; static int hf_rtps_type_object_type_id_disc = -1; static int hf_rtps_type_object_type_id = -1; static int hf_rtps_type_object_primitive_type_id = -1; static int hf_rtps_type_object_base_type = -1; static int hf_rtps_type_object_base_primitive_type_id = -1; static int hf_rtps_type_object_element_raw = -1; static int hf_rtps_type_object_type_property_name = -1; static int hf_rtps_type_object_flags = -1; static int hf_rtps_type_object_member_id = -1; static int hf_rtps_type_object_annotation_value_d = -1; static int hf_rtps_type_object_annotation_value_16 = -1; static int hf_rtps_type_object_bound = -1; static int hf_rtps_type_object_enum_constant_name = -1; static int hf_rtps_type_object_enum_constant_value = -1; static int hf_rtps_type_object_element_shared = -1; static int hf_rtps_type_object_name = -1; static int hf_rtps_type_object_element_module_name = -1; static int hf_rtps_pl_cdr_member = -1; static int hf_rtps_pl_cdr_member_id = -1; static int hf_rtps_pl_cdr_member_length = -1; static int hf_rtps_pl_cdr_member_id_ext = -1; static int hf_rtps_pl_cdr_member_length_ext = -1; static int hf_rtps_dcps_publication_data_frame_number = -1; /* Flag bits */ static int hf_rtps_flag_reserved80 = -1; static int hf_rtps_flag_reserved40 = -1; static int hf_rtps_flag_reserved20 = -1; static int hf_rtps_flag_reserved10 = -1; static int hf_rtps_flag_reserved08 = -1; static int hf_rtps_flag_reserved04 = -1; static int hf_rtps_flag_reserved02 = -1; static int hf_rtps_flag_reserved8000 = -1; static int hf_rtps_flag_reserved4000 = -1; static int hf_rtps_flag_reserved2000 = -1; static int hf_rtps_flag_reserved1000 = -1; static int hf_rtps_flag_reserved0800 = -1; static int hf_rtps_flag_reserved0400 = -1; static int hf_rtps_flag_reserved0200 = -1; static int hf_rtps_flag_reserved0100 = -1; static int hf_rtps_flag_reserved0080 = -1; static int hf_rtps_flag_reserved0040 = -1; static int hf_rtps_flag_builtin_endpoint_set_reserved = -1; static int hf_rtps_flag_unregister = -1; static int hf_rtps_flag_inline_qos_v1 = -1; static int hf_rtps_flag_hash_key = -1; static int hf_rtps_flag_alive = -1; static int hf_rtps_flag_data_present_v1 = -1; static int hf_rtps_flag_multisubmessage = -1; static int hf_rtps_flag_endianness = -1; static int hf_rtps_flag_status_info = -1; static int hf_rtps_flag_data_present_v2 = -1; static int hf_rtps_flag_inline_qos_v2 = -1; static int hf_rtps_flag_final = -1; static int hf_rtps_flag_hash_key_rti = -1; static int hf_rtps_flag_liveliness = -1; static int hf_rtps_flag_multicast = -1; static int hf_rtps_flag_data_serialized_key = -1; static int hf_rtps_flag_data_frag_serialized_key = -1; static int hf_rtps_flag_timestamp = -1; static int hf_rtps_flag_no_virtual_guids = -1; static int hf_rtps_flag_multiple_writers = -1; static int hf_rtps_flag_multiple_virtual_guids = -1; static int hf_rtps_flag_serialize_key16 = -1; static int hf_rtps_flag_invalid_sample = -1; static int hf_rtps_flag_data_present16 = -1; static int hf_rtps_flag_offsetsn_present = -1; static int hf_rtps_flag_inline_qos16_v2 = -1; static int hf_rtps_flag_timestamp_present = -1; static int hf_rtps_flag_unregistered = -1; static int hf_rtps_flag_disposed = -1; static int hf_rtps_param_status_info_flags = -1; static int hf_rtps_flag_participant_announcer = -1; static int hf_rtps_flag_participant_detector = -1; static int hf_rtps_flag_publication_announcer = -1; static int hf_rtps_flag_publication_detector = -1; static int hf_rtps_flag_subscription_announcer = -1; static int hf_rtps_flag_subscription_detector = -1; static int hf_rtps_flag_participant_proxy_announcer = -1; static int hf_rtps_flag_participant_proxy_detector = -1; static int hf_rtps_flag_participant_state_announcer = -1; static int hf_rtps_flag_participant_state_detector = -1; static int hf_rtps_flag_participant_message_datawriter = -1; static int hf_rtps_flag_participant_message_datareader = -1; static int hf_rtps_flag_secure_publication_writer = -1; static int hf_rtps_flag_secure_publication_reader = -1; static int hf_rtps_flag_secure_subscription_writer = -1; static int hf_rtps_flag_secure_subscription_reader = -1; static int hf_rtps_flag_secure_participant_message_writer = -1; static int hf_rtps_flag_secure_participant_message_reader = -1; static int hf_rtps_flag_participant_stateless_message_writer = -1; static int hf_rtps_flag_participant_stateless_message_reader = -1; static int hf_rtps_flag_secure_participant_volatile_message_writer = -1; static int hf_rtps_flag_secure_participant_volatile_message_reader = -1; static int hf_rtps_flag_participant_secure_writer = -1; static int hf_rtps_flag_participant_secure_reader = -1; static int hf_rtps_flag_typeflag_final = -1; static int hf_rtps_flag_typeflag_mutable = -1; static int hf_rtps_flag_typeflag_nested = -1; static int hf_rtps_flag_memberflag_key = -1; static int hf_rtps_flag_memberflag_optional = -1; static int hf_rtps_flag_memberflag_shareable = -1; static int hf_rtps_flag_memberflag_union_default = -1; static int hf_rtps_flag_service_request_writer = -1; static int hf_rtps_flag_service_request_reader = -1; static int hf_rtps_flag_locator_ping_writer = -1; static int hf_rtps_flag_locator_ping_reader = -1; static int hf_rtps_flag_secure_service_request_writer = -1; static int hf_rtps_flag_secure_service_request_reader = -1; static int hf_rtps_flag_security_access_protected = -1; static int hf_rtps_flag_security_discovery_protected = -1; static int hf_rtps_flag_security_submessage_protected = -1; static int hf_rtps_flag_security_payload_protected = -1; static int hf_rtps_sm_rti_crc_number = -1; static int hf_rtps_sm_rti_crc_result = -1; /* Subtree identifiers */ static gint ett_rtps = -1; static gint ett_rtps_default_mapping = -1; static gint ett_rtps_proto_version = -1; static gint ett_rtps_submessage = -1; static gint ett_rtps_parameter_sequence = -1; static gint ett_rtps_parameter = -1; static gint ett_rtps_flags = -1; static gint ett_rtps_entity = -1; static gint ett_rtps_generic_guid = -1; static gint ett_rtps_rdentity = -1; static gint ett_rtps_wrentity = -1; static gint ett_rtps_guid_prefix = -1; static gint ett_rtps_app_id = -1; static gint ett_rtps_locator_udp_v4 = -1; static gint ett_rtps_locator = -1; static gint ett_rtps_locator_list = -1; static gint ett_rtps_timestamp = -1; static gint ett_rtps_bitmap = -1; static gint ett_rtps_seq_string = -1; static gint ett_rtps_seq_ulong = -1; static gint ett_rtps_resource_limit = -1; static gint ett_rtps_durability_service = -1; static gint ett_rtps_liveliness = -1; static gint ett_rtps_manager_key = -1; static gint ett_rtps_serialized_data = -1; static gint ett_rtps_locator_filter_channel = -1; static gint ett_rtps_part_message_data = -1; static gint ett_rtps_sample_info_list = -1; static gint ett_rtps_sample_info = -1; static gint ett_rtps_sample_batch_list = -1; static gint ett_rtps_locator_filter_locator = -1; static gint ett_rtps_writer_heartbeat_virtual_list = -1; static gint ett_rtps_writer_heartbeat_virtual = -1; static gint ett_rtps_virtual_guid_heartbeat_virtual_list = -1; static gint ett_rtps_virtual_guid_heartbeat_virtual = -1; static gint ett_rtps_app_ack_virtual_writer_interval_list = -1; static gint ett_rtps_app_ack_virtual_writer_interval = -1; static gint ett_rtps_transport_info = -1; static gint ett_rtps_app_ack_virtual_writer_list = -1; static gint ett_rtps_app_ack_virtual_writer = -1; static gint ett_rtps_product_version = -1; static gint ett_rtps_property_list = -1; static gint ett_rtps_property = -1; static gint ett_rtps_topic_info = -1; static gint ett_rtps_topic_info_dw_qos = -1; static gint ett_rtps_type_object = -1; static gint ett_rtps_type_library = -1; static gint ett_rtps_type_element = -1; static gint ett_rtps_type_annotation_usage_list = -1; static gint ett_rtps_type_enum_constant = -1; static gint ett_rtps_type_bound_list = -1; static gint ett_rtps_secure_payload_tree = -1; static gint ett_rtps_secure_dataheader_tree = -1; static gint ett_rtps_pgm_data = -1; static gint ett_rtps_message_identity = -1; static gint ett_rtps_related_message_identity = -1; static gint ett_rtps_data_holder_seq = -1; static gint ett_rtps_data_holder = -1; static gint ett_rtps_data_holder_properties = -1; static gint ett_rtps_property_tree = -1; static gint ett_rtps_param_header_tree = -1; static gint ett_rtps_service_request_tree = -1; static gint ett_rtps_locator_ping_tree = -1; static gint ett_rtps_locator_reachability_tree = -1; static gint ett_rtps_custom_dissection_info = -1; static gint ett_rtps_locator_list_tree = -1; static gint ett_rtps_topic_query_tree = -1; static gint ett_rtps_topic_query_selection_tree = -1; static gint ett_rtps_topic_query_filter_params_tree = -1; static gint ett_rtps_data_member = -1; static expert_field ei_rtps_sm_octets_to_next_header_error = EI_INIT; static expert_field ei_rtps_port_invalid = EI_INIT; static expert_field ei_rtps_ip_invalid = EI_INIT; static expert_field ei_rtps_parameter_value_invalid = EI_INIT; static expert_field ei_rtps_extra_bytes = EI_INIT; static expert_field ei_rtps_missing_bytes = EI_INIT; static expert_field ei_rtps_locator_port = EI_INIT; static expert_field ei_rtps_more_samples_available = EI_INIT; static expert_field ei_rtps_parameter_not_decoded = EI_INIT; static expert_field ei_rtps_sm_octets_to_next_header_not_zero = EI_INIT; static expert_field ei_rtps_unsupported_non_builtin_param_seq = EI_INIT; /***************************************************************************/ /* Preferences */ /***************************************************************************/ static guint rtps_max_batch_samples_dissected = 16; static gboolean enable_topic_info = FALSE; static dissector_table_t rtps_type_name_table; /***************************************************************************/ /* Value-to-String Tables */ static const value_string vendor_vals[] = { { RTPS_VENDOR_UNKNOWN, RTPS_VENDOR_UNKNOWN_STRING}, { RTPS_VENDOR_RTI_DDS, RTPS_VENDOR_RTI_DDS_STRING}, { RTPS_VENDOR_PT_DDS, RTPS_VENDOR_PT_DDS_STRING}, { RTPS_VENDOR_OCI, RTPS_VENDOR_OCI_STRING}, { RTPS_VENDOR_MILSOFT, RTPS_VENDOR_MILSOFT_STRING}, { RTPS_VENDOR_GALLIUM, RTPS_VENDOR_GALLIUM_STRING}, { RTPS_VENDOR_TOC, RTPS_VENDOR_TOC_STRING}, { RTPS_VENDOR_LAKOTA_TSI, RTPS_VENDOR_LAKOTA_TSI_STRING}, { RTPS_VENDOR_ICOUP, RTPS_VENDOR_ICOUP_STRING}, { RTPS_VENDOR_ETRI, RTPS_VENDOR_ETRI_STRING}, { RTPS_VENDOR_RTI_DDS_MICRO, RTPS_VENDOR_RTI_DDS_MICRO_STRING}, { RTPS_VENDOR_PT_MOBILE, RTPS_VENDOR_PT_MOBILE_STRING}, { RTPS_VENDOR_PT_GATEWAY, RTPS_VENDOR_PT_GATEWAY_STRING}, { RTPS_VENDOR_PT_LITE, RTPS_VENDOR_PT_LITE_STRING}, { RTPS_VENDOR_TECHNICOLOR, RTPS_VENDOR_TECHNICOLOR_STRING}, { 0, NULL } }; static const value_string entity_id_vals[] = { { ENTITYID_UNKNOWN, "ENTITYID_UNKNOWN" }, { ENTITYID_PARTICIPANT, "ENTITYID_PARTICIPANT" }, { ENTITYID_BUILTIN_TOPIC_WRITER, "ENTITYID_BUILTIN_TOPIC_WRITER" }, { ENTITYID_BUILTIN_TOPIC_READER, "ENTITYID_BUILTIN_TOPIC_READER" }, { ENTITYID_BUILTIN_PUBLICATIONS_WRITER, "ENTITYID_BUILTIN_PUBLICATIONS_WRITER" }, { ENTITYID_BUILTIN_PUBLICATIONS_READER, "ENTITYID_BUILTIN_PUBLICATIONS_READER" }, { ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER, "ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER" }, { ENTITYID_BUILTIN_SUBSCRIPTIONS_READER, "ENTITYID_BUILTIN_SUBSCRIPTIONS_READER" }, { ENTITYID_BUILTIN_SDP_PARTICIPANT_WRITER, "ENTITYID_BUILTIN_SDP_PARTICIPANT_WRITER" }, { ENTITYID_BUILTIN_SDP_PARTICIPANT_READER, "ENTITYID_BUILTIN_SDP_PARTICIPANT_READER" }, { ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER" }, { ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER" }, { ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER, "ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER" }, { ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER, "ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER" }, { ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER, "ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER" }, { ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER, "ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER" }, { ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER" }, { ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER" }, { ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER" }, { ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER" }, { ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER" }, { ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER" }, { ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER, "ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER"}, { ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER, "ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER"}, /* vendor specific - RTI */ { ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER, "ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER" }, { ENTITYID_RTI_BUILTIN_LOCATOR_PING_READER, "ENTITYID_RTI_BUILTIN_LOCATOR_PING_READER" }, { ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER, "ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER" }, { ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER, "ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER" }, /* Deprecated Items */ { ENTITYID_APPLICATIONS_WRITER, "writerApplications [DEPRECATED]" }, { ENTITYID_APPLICATIONS_READER, "readerApplications [DEPRECATED]" }, { ENTITYID_CLIENTS_WRITER, "writerClients [DEPRECATED]" }, { ENTITYID_CLIENTS_READER, "readerClients [DEPRECATED]" }, { ENTITYID_SERVICES_WRITER, "writerServices [DEPRECATED]" }, { ENTITYID_SERVICES_READER, "readerServices [DEPRECATED]" }, { ENTITYID_MANAGERS_WRITER, "writerManagers [DEPRECATED]" }, { ENTITYID_MANAGERS_READER, "readerManagers [DEPRECATED]" }, { ENTITYID_APPLICATION_SELF, "applicationSelf [DEPRECATED]" }, { ENTITYID_APPLICATION_SELF_WRITER, "writerApplicationSelf [DEPRECATED]" }, { ENTITYID_APPLICATION_SELF_READER, "readerApplicationSelf [DEPRECATED]" }, { 0, NULL } }; static const value_string entity_kind_vals [] = { { ENTITYKIND_APPDEF_UNKNOWN, "Application-defined unknown kind" }, { ENTITYKIND_APPDEF_PARTICIPANT, "Application-defined participant" }, { ENTITYKIND_APPDEF_WRITER_WITH_KEY, "Application-defined writer (with key)" }, { ENTITYKIND_APPDEF_WRITER_NO_KEY, "Application-defined writer (no key)" }, { ENTITYKIND_APPDEF_READER_WITH_KEY, "Application-defined reader (with key)" }, { ENTITYKIND_APPDEF_READER_NO_KEY, "Application-defined reader (no key)" }, { ENTITYKIND_BUILTIN_PARTICIPANT, "Built-in participant" }, { ENTITYKIND_BUILTIN_WRITER_WITH_KEY, "Built-in writer (with key)" }, { ENTITYKIND_BUILTIN_WRITER_NO_KEY, "Built-in writer (no key)" }, { ENTITYKIND_BUILTIN_READER_WITH_KEY, "Built-in reader (with key)" }, { ENTITYKIND_BUILTIN_READER_NO_KEY, "Built-in reader (no key)" }, { ENTITYKIND_RTI_BUILTIN_WRITER_WITH_KEY, "RTI Built-in writer (with key)" }, { ENTITYKIND_RTI_BUILTIN_WRITER_NO_KEY, "RTI Built-in writer (no key)" }, { ENTITYKIND_RTI_BUILTIN_READER_WITH_KEY, "RTI Built-in reader (with key)" }, { ENTITYKIND_RTI_BUILTIN_READER_NO_KEY, "RTI Built-in reader (no key)" }, { 0, NULL } }; static const value_string nature_type_vals[] = { { PORT_METATRAFFIC_UNICAST, "UNICAST_METATRAFFIC"}, { PORT_METATRAFFIC_MULTICAST, "MULTICAST_METATRAFFIC"}, { PORT_USERTRAFFIC_UNICAST, "UNICAST_USERTRAFFIC"}, { PORT_USERTRAFFIC_MULTICAST, "MULTICAST_USERTRAFFIC"}, { 0, NULL } }; static const value_string app_kind_vals[] = { { APPKIND_UNKNOWN, "APPKIND_UNKNOWN" }, { APPKIND_MANAGED_APPLICATION, "ManagedApplication" }, { APPKIND_MANAGER, "Manager" }, { 0, NULL } }; static const value_string rtps_locator_kind_vals[] = { { LOCATOR_KIND_UDPV4, "LOCATOR_KIND_UDPV4" }, { LOCATOR_KIND_UDPV6, "LOCATOR_KIND_UDPV6" }, { LOCATOR_KIND_INVALID, "LOCATOR_KIND_INVALID" }, { LOCATOR_KIND_DTLS, "LOCATOR_KIND_DTLS" }, { LOCATOR_KIND_TCPV4_LAN, "LOCATOR_KIND_TCPV4_LAN" }, { LOCATOR_KIND_TCPV4_WAN, "LOCATOR_KIND_TCPV4_WAN" }, { LOCATOR_KIND_TLSV4_LAN, "LOCATOR_KIND_TLSV4_LAN" }, { LOCATOR_KIND_TLSV4_WAN, "LOCATOR_KIND_TLSV4_WAN" }, { LOCATOR_KIND_SHMEM, "LOCATOR_KIND_SHMEM" }, { LOCATOR_KIND_TUDPV4, "LOCATOR_KIND_TUDPV4" }, { LOCATOR_KIND_RESERVED, "LOCATOR_KIND_RESERVED" }, { 0, NULL } }; static const value_string submessage_id_vals[] = { { SUBMESSAGE_PAD, "PAD" }, { SUBMESSAGE_DATA, "DATA" }, { SUBMESSAGE_NOKEY_DATA, "NOKEY_DATA" }, { SUBMESSAGE_ACKNACK, "ACKNACK" }, { SUBMESSAGE_HEARTBEAT, "HEARTBEAT" }, { SUBMESSAGE_GAP, "GAP" }, { SUBMESSAGE_INFO_TS, "INFO_TS" }, { SUBMESSAGE_INFO_SRC, "INFO_SRC" }, { SUBMESSAGE_INFO_REPLY_IP4, "INFO_REPLY_IP4" }, { SUBMESSAGE_INFO_DST, "INFO_DST" }, { SUBMESSAGE_INFO_REPLY, "INFO_REPLY" }, { 0, NULL } }; static const value_string submessage_id_valsv2[] = { { SUBMESSAGE_PAD, "PAD" }, { SUBMESSAGE_RTPS_DATA, "DATA" }, { SUBMESSAGE_RTPS_DATA_FRAG, "DATA_FRAG" }, { SUBMESSAGE_RTPS_DATA_BATCH, "DATA_BATCH" }, { SUBMESSAGE_ACKNACK, "ACKNACK" }, { SUBMESSAGE_HEARTBEAT, "HEARTBEAT" }, { SUBMESSAGE_GAP, "GAP" }, { SUBMESSAGE_INFO_TS, "INFO_TS" }, { SUBMESSAGE_INFO_SRC, "INFO_SRC" }, { SUBMESSAGE_INFO_REPLY_IP4, "INFO_REPLY_IP4" }, { SUBMESSAGE_INFO_DST, "INFO_DST" }, { SUBMESSAGE_INFO_REPLY, "INFO_REPLY" }, { SUBMESSAGE_NACK_FRAG, "NACK_FRAG" }, { SUBMESSAGE_HEARTBEAT_FRAG, "HEARTBEAT_FRAG" }, { SUBMESSAGE_ACKNACK_BATCH, "ACKNACK_BATCH" }, { SUBMESSAGE_HEARTBEAT_BATCH, "HEARTBEAT_BATCH" }, { SUBMESSAGE_ACKNACK_SESSION, "ACKNACK_SESSION" }, { SUBMESSAGE_HEARTBEAT_SESSION, "HEARTBEAT_SESSION" }, { SUBMESSAGE_RTPS_DATA_SESSION, "DATA_SESSION" }, { SUBMESSAGE_APP_ACK, "APP_ACK" }, { SUBMESSAGE_APP_ACK_CONF, "APP_ACK_CONF" }, { SUBMESSAGE_HEARTBEAT_VIRTUAL, "HEARTBEAT_VIRTUAL" }, { SUBMESSAGE_SEC_BODY, "SEC_BODY" }, { SUBMESSAGE_SEC_PREFIX, "SEC_PREFIX" }, { SUBMESSAGE_SEC_POSTFIX, "SEC_POSTFIX" }, { SUBMESSAGE_SRTPS_PREFIX, "SRTPS_PREFIX" }, { SUBMESSAGE_SRTPS_POSTFIX, "SRTPS_POSTFIX" }, /* Deprecated submessages */ { SUBMESSAGE_DATA, "DATA_deprecated" }, { SUBMESSAGE_NOKEY_DATA, "NOKEY_DATA_deprecated" }, { SUBMESSAGE_DATA_FRAG, "DATA_FRAG_deprecated" }, { SUBMESSAGE_NOKEY_DATA_FRAG, "NOKEY_DATA_FRAG_deprecated" }, { 0, NULL } }; static const value_string submessage_id_rti[] = { { SUBMESSAGE_RTI_CRC, "RTI_CRC" }, { 0, NULL } }; #if 0 static const value_string typecode_kind_vals[] = { { RTI_CDR_TK_NULL, "(unknown)" }, { RTI_CDR_TK_SHORT, "short" }, { RTI_CDR_TK_LONG, "long" }, { RTI_CDR_TK_USHORT, "unsigned short" }, { RTI_CDR_TK_ULONG, "unsigned long" }, { RTI_CDR_TK_FLOAT, "float" }, { RTI_CDR_TK_DOUBLE, "double" }, { RTI_CDR_TK_BOOLEAN, "boolean" }, { RTI_CDR_TK_CHAR, "char" }, { RTI_CDR_TK_OCTET, "octet" }, { RTI_CDR_TK_STRUCT, "struct" }, { RTI_CDR_TK_UNION, "union" }, { RTI_CDR_TK_ENUM, "enum" }, { RTI_CDR_TK_STRING, "string" }, { RTI_CDR_TK_SEQUENCE, "sequence" }, { RTI_CDR_TK_ARRAY, "array" }, { RTI_CDR_TK_ALIAS, "alias" }, { RTI_CDR_TK_LONGLONG, "long long" }, { RTI_CDR_TK_ULONGLONG, "unsigned long long" }, { RTI_CDR_TK_LONGDOUBLE, "long double" }, { RTI_CDR_TK_WCHAR, "wchar" }, { RTI_CDR_TK_WSTRING, "wstring" }, { 0, NULL } }; #endif static const value_string parameter_id_vals[] = { { PID_PAD, "PID_PAD" }, { PID_SENTINEL, "PID_SENTINEL" }, { PID_USER_DATA, "PID_USER_DATA" }, { PID_TOPIC_NAME, "PID_TOPIC_NAME" }, { PID_TYPE_NAME, "PID_TYPE_NAME" }, { PID_GROUP_DATA, "PID_GROUP_DATA" }, { PID_DEADLINE, "PID_DEADLINE" }, { PID_DEADLINE_OFFERED, "PID_DEADLINE_OFFERED [deprecated]" }, { PID_PARTICIPANT_LEASE_DURATION, "PID_PARTICIPANT_LEASE_DURATION" }, { PID_PERSISTENCE, "PID_PERSISTENCE" }, { PID_TIME_BASED_FILTER, "PID_TIME_BASED_FILTER" }, { PID_OWNERSHIP_STRENGTH, "PID_OWNERSHIP_STRENGTH" }, { PID_TYPE_CHECKSUM, "PID_TYPE_CHECKSUM [deprecated]" }, { PID_TYPE2_NAME, "PID_TYPE2_NAME [deprecated]" }, { PID_TYPE2_CHECKSUM, "PID_TYPE2_CHECKSUM [deprecated]" }, { PID_METATRAFFIC_MULTICAST_IPADDRESS,"PID_METATRAFFIC_MULTICAST_IPADDRESS"}, { PID_DEFAULT_UNICAST_IPADDRESS, "PID_DEFAULT_UNICAST_IPADDRESS" }, { PID_METATRAFFIC_UNICAST_PORT, "PID_METATRAFFIC_UNICAST_PORT" }, { PID_DEFAULT_UNICAST_PORT, "PID_DEFAULT_UNICAST_PORT" }, { PID_IS_RELIABLE, "PID_IS_RELIABLE [deprecated]" }, { PID_EXPECTS_ACK, "PID_EXPECTS_ACK" }, { PID_MULTICAST_IPADDRESS, "PID_MULTICAST_IPADDRESS" }, { PID_MANAGER_KEY, "PID_MANAGER_KEY [deprecated]" }, { PID_SEND_QUEUE_SIZE, "PID_SEND_QUEUE_SIZE" }, { PID_RELIABILITY_ENABLED, "PID_RELIABILITY_ENABLED" }, { PID_PROTOCOL_VERSION, "PID_PROTOCOL_VERSION" }, { PID_VENDOR_ID, "PID_VENDOR_ID" }, { PID_VARGAPPS_SEQUENCE_NUMBER_LAST, "PID_VARGAPPS_SEQUENCE_NUMBER_LAST [deprecated]" }, { PID_RECV_QUEUE_SIZE, "PID_RECV_QUEUE_SIZE [deprecated]" }, { PID_RELIABILITY_OFFERED, "PID_RELIABILITY_OFFERED [deprecated]" }, { PID_RELIABILITY, "PID_RELIABILITY" }, { PID_LIVELINESS, "PID_LIVELINESS" }, { PID_LIVELINESS_OFFERED, "PID_LIVELINESS_OFFERED [deprecated]" }, { PID_DURABILITY, "PID_DURABILITY" }, { PID_DURABILITY_SERVICE, "PID_DURABILITY_SERVICE" }, { PID_PRESENTATION_OFFERED, "PID_PRESENTATION_OFFERED [deprecated]" }, { PID_OWNERSHIP, "PID_OWNERSHIP" }, { PID_OWNERSHIP_OFFERED, "PID_OWNERSHIP_OFFERED [deprecated]" }, { PID_PRESENTATION, "PID_PRESENTATION" }, { PID_DESTINATION_ORDER, "PID_DESTINATION_ORDER" }, { PID_DESTINATION_ORDER_OFFERED, "PID_DESTINATION_ORDER_OFFERED [deprecated]" }, { PID_LATENCY_BUDGET, "PID_LATENCY_BUDGET" }, { PID_LATENCY_BUDGET_OFFERED, "PID_LATENCY_BUDGET_OFFERED [deprecated]" }, { PID_PARTITION, "PID_PARTITION" }, { PID_PARTITION_OFFERED, "PID_PARTITION_OFFERED [deprecated]" }, { PID_LIFESPAN, "PID_LIFESPAN" }, { PID_TOPIC_DATA, "PID_TOPIC_DATA" }, { PID_UNICAST_LOCATOR, "PID_UNICAST_LOCATOR" }, { PID_MULTICAST_LOCATOR, "PID_MULTICAST_LOCATOR" }, { PID_DEFAULT_UNICAST_LOCATOR, "PID_DEFAULT_UNICAST_LOCATOR" }, { PID_METATRAFFIC_UNICAST_LOCATOR, "PID_METATRAFFIC_UNICAST_LOCATOR" }, { PID_METATRAFFIC_MULTICAST_LOCATOR, "PID_METATRAFFIC_MULTICAST_LOCATOR" }, { PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT, "PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT" }, { PID_HISTORY, "PID_HISTORY" }, { PID_RESOURCE_LIMIT, "PID_RESOURCE_LIMIT" }, { PID_METATRAFFIC_MULTICAST_PORT, "PID_METATRAFFIC_MULTICAST_PORT" }, { PID_EXPECTS_INLINE_QOS, "PID_EXPECTS_INLINE_QOS" }, { PID_METATRAFFIC_UNICAST_IPADDRESS, "PID_METATRAFFIC_UNICAST_IPADDRESS" }, { PID_PARTICIPANT_BUILTIN_ENDPOINTS, "PID_PARTICIPANT_BUILTIN_ENDPOINTS" }, { PID_CONTENT_FILTER_PROPERTY, "PID_CONTENT_FILTER_PROPERTY" }, { PID_PROPERTY_LIST_OLD, "PID_PROPERTY_LIST" }, { PID_FILTER_SIGNATURE, "PID_FILTER_SIGNATURE" }, { PID_COHERENT_SET, "PID_COHERENT_SET" }, { PID_TYPECODE, "PID_TYPECODE" }, { PID_PARTICIPANT_GUID, "PID_PARTICIPANT_GUID" }, { PID_PARTICIPANT_ENTITY_ID, "PID_PARTICIPANT_ENTITY_ID" }, { PID_GROUP_GUID, "PID_GROUP_GUID" }, { PID_GROUP_ENTITY_ID, "PID_GROUP_ENTITY_ID" }, { 0, NULL } }; static const value_string parameter_id_inline_qos_rti[] = { { PID_RELATED_ORIGINAL_WRITER_INFO, "PID_RELATED_ORIGINAL_WRITER_INFO" }, { PID_RELATED_SOURCE_GUID, "PID_RELATED_SOURCE_GUID" }, { PID_RELATED_READER_GUID, "PID_RELATED_READER_GUID" }, { PID_SOURCE_GUID, "PID_SOURCE_GUID" }, { PID_TOPIC_QUERY_GUID, "PID_TOPIC_QUERY_GUID" }, { PID_SAMPLE_SIGNATURE, "PID_SAMPLE_SIGNATURE" }, { 0, NULL } }; static const value_string parameter_id_v2_vals[] = { { PID_PAD, "PID_PAD" }, { PID_SENTINEL, "PID_SENTINEL" }, { PID_PARTICIPANT_LEASE_DURATION, "PID_PARTICIPANT_LEASE_DURATION" }, { PID_TIME_BASED_FILTER, "PID_TIME_BASED_FILTER" }, { PID_TOPIC_NAME, "PID_TOPIC_NAME" }, { PID_OWNERSHIP_STRENGTH, "PID_OWNERSHIP_STRENGTH" }, { PID_TYPE_NAME, "PID_TYPE_NAME" }, { PID_METATRAFFIC_MULTICAST_IPADDRESS,"PID_METATRAFFIC_MULTICAST_IPADDRESS"}, { PID_DEFAULT_UNICAST_IPADDRESS, "PID_DEFAULT_UNICAST_IPADDRESS" }, { PID_METATRAFFIC_UNICAST_PORT, "PID_METATRAFFIC_UNICAST_PORT" }, { PID_DEFAULT_UNICAST_PORT, "PID_DEFAULT_UNICAST_PORT" }, { PID_MULTICAST_IPADDRESS, "PID_MULTICAST_IPADDRESS" }, { PID_PROTOCOL_VERSION, "PID_PROTOCOL_VERSION" }, { PID_VENDOR_ID, "PID_VENDOR_ID" }, { PID_RELIABILITY, "PID_RELIABILITY" }, { PID_LIVELINESS, "PID_LIVELINESS" }, { PID_DURABILITY, "PID_DURABILITY" }, { PID_DURABILITY_SERVICE, "PID_DURABILITY_SERVICE" }, { PID_OWNERSHIP, "PID_OWNERSHIP" }, { PID_PRESENTATION, "PID_PRESENTATION" }, { PID_DEADLINE, "PID_DEADLINE" }, { PID_DESTINATION_ORDER, "PID_DESTINATION_ORDER" }, { PID_LATENCY_BUDGET, "PID_LATENCY_BUDGET" }, { PID_PARTITION, "PID_PARTITION" }, { PID_LIFESPAN, "PID_LIFESPAN" }, { PID_USER_DATA, "PID_USER_DATA" }, { PID_GROUP_DATA, "PID_GROUP_DATA" }, { PID_TOPIC_DATA, "PID_TOPIC_DATA" }, { PID_UNICAST_LOCATOR, "PID_UNICAST_LOCATOR" }, { PID_MULTICAST_LOCATOR, "PID_MULTICAST_LOCATOR" }, { PID_DEFAULT_UNICAST_LOCATOR, "PID_DEFAULT_UNICAST_LOCATOR" }, { PID_METATRAFFIC_UNICAST_LOCATOR, "PID_METATRAFFIC_UNICAST_LOCATOR" }, { PID_METATRAFFIC_MULTICAST_LOCATOR, "PID_METATRAFFIC_MULTICAST_LOCATOR" }, { PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT, "PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT" }, { PID_CONTENT_FILTER_PROPERTY, "PID_CONTENT_FILTER_PROPERTY" }, { PID_PROPERTY_LIST, "PID_PROPERTY_LIST" }, { PID_HISTORY, "PID_HISTORY" }, { PID_RESOURCE_LIMIT, "PID_RESOURCE_LIMIT" }, { PID_EXPECTS_INLINE_QOS, "PID_EXPECTS_INLINE_QOS" }, { PID_PARTICIPANT_BUILTIN_ENDPOINTS, "PID_PARTICIPANT_BUILTIN_ENDPOINTS" }, { PID_METATRAFFIC_UNICAST_IPADDRESS, "PID_METATRAFFIC_UNICAST_IPADDRESS" }, { PID_METATRAFFIC_MULTICAST_PORT, "PID_METATRAFFIC_MULTICAST_PORT" }, { PID_DEFAULT_MULTICAST_LOCATOR, "PID_DEFAULT_MULTICAST_LOCATOR" }, { PID_TRANSPORT_PRIORITY, "PID_TRANSPORT_PRIORITY" }, { PID_PARTICIPANT_GUID, "PID_PARTICIPANT_GUID" }, { PID_PARTICIPANT_ENTITY_ID, "PID_PARTICIPANT_ENTITY_ID" }, { PID_GROUP_GUID, "PID_GROUP_GUID" }, { PID_GROUP_ENTITY_ID, "PID_GROUP_ENTITY_ID" }, { PID_CONTENT_FILTER_INFO, "PID_CONTENT_FILTER_INFO" }, { PID_COHERENT_SET, "PID_COHERENT_SET" }, { PID_DIRECTED_WRITE, "PID_DIRECTED_WRITE" }, { PID_BUILTIN_ENDPOINT_SET, "PID_BUILTIN_ENDPOINT_SET" }, { PID_PROPERTY_LIST_OLD, "PID_PROPERTY_LIST" }, { PID_ENDPOINT_GUID, "PID_ENDPOINT_GUID" }, { PID_TYPE_MAX_SIZE_SERIALIZED, "PID_TYPE_MAX_SIZE_SERIALIZED" }, { PID_ORIGINAL_WRITER_INFO, "PID_ORIGINAL_WRITER_INFO" }, { PID_ENTITY_NAME, "PID_ENTITY_NAME" }, { PID_KEY_HASH, "PID_KEY_HASH" }, { PID_STATUS_INFO, "PID_STATUS_INFO" }, { PID_TYPE_CONSISTENCY, "PID_TYPE_CONSISTENCY" }, { PID_ENABLE_ENCRYPTION, "PID_ENABLE_ENCRYPTION" }, { PID_ENABLE_AUTHENTICATION, "PID_ENABLE_AUTHENTICATION" }, { PID_IDENTITY_TOKEN, "PID_IDENTITY_TOKEN" }, { PID_PERMISSIONS_TOKEN, "PID_PERMISSIONS_TOKEN" }, { PID_DATA_TAGS, "PID_DATA_TAGS" }, /* The following PID are deprecated */ { PID_DEADLINE_OFFERED, "PID_DEADLINE_OFFERED [deprecated]" }, { PID_PERSISTENCE, "PID_PERSISTENCE [deprecated]" }, { PID_TYPE_CHECKSUM, "PID_TYPE_CHECKSUM [deprecated]" }, { PID_TYPE2_NAME, "PID_TYPE2_NAME [deprecated]" }, { PID_TYPE2_CHECKSUM, "PID_TYPE2_CHECKSUM [deprecated]" }, { PID_IS_RELIABLE, "PID_IS_RELIABLE [deprecated]" }, { PID_EXPECTS_ACK, "PID_EXPECTS_ACK [deprecated]" }, { PID_MANAGER_KEY, "PID_MANAGER_KEY [deprecated]" }, { PID_SEND_QUEUE_SIZE, "PID_SEND_QUEUE_SIZE [deprecated]" }, { PID_RELIABILITY_ENABLED, "PID_RELIABILITY_ENABLED [deprecated]" }, { PID_VARGAPPS_SEQUENCE_NUMBER_LAST, "PID_VARGAPPS_SEQUENCE_NUMBER_LAST [deprecated]" }, { PID_RECV_QUEUE_SIZE, "PID_RECV_QUEUE_SIZE [deprecated]" }, { PID_RELIABILITY_OFFERED, "PID_RELIABILITY_OFFERED [deprecated]" }, { PID_LIVELINESS_OFFERED, "PID_LIVELINESS_OFFERED [deprecated]" }, { PID_PRESENTATION_OFFERED, "PID_PRESENTATION_OFFERED [deprecated]" }, { PID_OWNERSHIP_OFFERED, "PID_OWNERSHIP_OFFERED [deprecated]" }, { PID_DESTINATION_ORDER_OFFERED, "PID_DESTINATION_ORDER_OFFERED [deprecated]" }, { PID_LATENCY_BUDGET_OFFERED, "PID_LATENCY_BUDGET_OFFERED [deprecated]" }, { PID_PARTITION_OFFERED, "PID_PARTITION_OFFERED [deprecated]" }, { PID_EXTENDED, "PID_EXTENDED" }, { 0, NULL } }; static const value_string parameter_id_rti_vals[] = { /* Vendor specific: RTI */ { PID_PRODUCT_VERSION, "PID_PRODUCT_VERSION" }, { PID_PLUGIN_PROMISCUITY_KIND, "PID_PLUGIN_PROMISCUITY_KIND" }, { PID_ENTITY_VIRTUAL_GUID, "PID_ENTITY_VIRTUAL_GUID" }, { PID_SERVICE_KIND, "PID_SERVICE_KIND" }, { PID_TYPECODE_RTPS2, "PID_TYPECODE" }, { PID_DISABLE_POSITIVE_ACKS, "PID_DISABLE_POSITIVE_ACKS" }, { PID_LOCATOR_FILTER_LIST, "PID_LOCATOR_FILTER_LIST" }, { PID_ROLE_NAME, "PID_ROLE_NAME"}, { PID_ACK_KIND, "PID_ACK_KIND" }, { PID_PEER_HOST_EPOCH, "PID_PEER_HOST_EPOCH" }, { PID_TRANSPORT_INFO_LIST, "PID_TRANSPORT_INFO_LIST" }, { PID_DIRECT_COMMUNICATION, "PID_DIRECT_COMMUNICATION" }, { PID_TYPE_OBJECT, "PID_TYPE_OBJECT" }, { PID_EXPECTS_VIRTUAL_HB, "PID_EXPECTS_VIRTUAL_HB" }, { PID_DOMAIN_ID, "PID_DOMAIN_ID" }, { PID_TOPIC_QUERY_PUBLICATION, "PID_TOPIC_QUERY_PUBLICATION" }, { PID_ENDPOINT_PROPERTY_CHANGE_EPOCH, "PID_ENDPOINT_PROPERTY_CHANGE_EPOCH" }, { PID_REACHABILITY_LEASE_DURATION, "PID_REACHABILITY_LEASE_DURATION" }, { PID_VENDOR_BUILTIN_ENDPOINT_SET, "PID_VENDOR_BUILTIN_ENDPOINT_SET" }, { PID_ENDPOINT_SECURITY_ATTRIBUTES, "PID_ENDPOINT_SECURITY_ATTRIBUTES" }, { 0, NULL } }; static const value_string parameter_id_toc_vals[] = { /* Vendor specific: Twin Oaks Computing */ { PID_TYPECODE_RTPS2, "PID_TYPECODE_RTPS2" }, { 0, NULL } }; static const value_string parameter_id_pt_vals[] = { /* Vendor specific: Prismtech */ { PID_PRISMTECH_WRITER_INFO, "PID_PRISMTECH_WRITER_INFO" }, { PID_PRISMTECH_READER_DATA_LIFECYCLE, "PID_PRISMTECH_READER_DATA_LIFECYCLE" }, { PID_PRISMTECH_WRITER_DATA_LIFECYCLE, "PID_PRISMTECH_WRITER_DATA_LIFECYCLE" }, { PID_PRISMTECH_ENDPOINT_GUID, "PID_PRISMTECH_ENDPOINT_GUID" }, { PID_PRISMTECH_SYNCHRONOUS_ENDPOINT, "PID_PRISMTECH_SYNCHRONOUS_ENDPOINT" }, { PID_PRISMTECH_RELAXED_QOS_MATCHING, "PID_PRISMTECH_RELAXED_QOS_MATCHING" }, { PID_PRISMTECH_PARTICIPANT_VERSION_INFO, "PID_PRISMTECH_PARTICIPANT_VERSION_INFO" }, { PID_PRISMTECH_NODE_NAME, "PID_PRISMTECH_NODE_NAME" }, { PID_PRISMTECH_EXEC_NAME, "PID_PRISMTECH_EXEC_NAME" }, { PID_PRISMTECH_PROCESS_ID, "PID_PRISMTECH_PROCESS_ID" }, { PID_PRISMTECH_SERVICE_TYPE, "PID_PRISMTECH_SERVICE_TYPE" }, { PID_PRISMTECH_ENTITY_FACTORY, "PID_PRISMTECH_ENTITY_FACTORY" }, { PID_PRISMTECH_WATCHDOG_SCHEDULING, "PID_PRISMTECH_WATCHDOG_SCHEDULING" }, { PID_PRISMTECH_LISTENER_SCHEDULING, "PID_PRISMTECH_LISTENER_SCHEDULING" }, { PID_PRISMTECH_SUBSCRIPTION_KEYS, "PID_PRISMTECH_SUBSCRIPTION_KEYS" }, { PID_PRISMTECH_READER_LIFESPAN, "PID_PRISMTECH_READER_LIFESPAN" }, { PID_PRISMTECH_SHARE, "PID_PRISMTECH_SHARE" }, { PID_PRISMTECH_TYPE_DESCRIPTION, "PID_PRISMTECH_TYPE_DESCRIPTION" }, { PID_PRISMTECH_LAN_ID, "PID_PRISMTECH_LAN_ID" }, { PID_PRISMTECH_ENDPOINT_GID, "PID_PRISMTECH_ENDPOINT_GID" }, { PID_PRISMTECH_GROUP_GID, "PID_PRISMTECH_GROUP_GID" }, { PID_PRISMTECH_EOTINFO, "PID_PRISMTECH_EOTINFO" }, { PID_PRISMTECH_PART_CERT_NAME, "PID_PRISMTECH_PART_CERT_NAME" }, { PID_PRISMTECH_LAN_CERT_NAME, "PID_PRISMTECH_LAN_CERT_NAME" }, { 0, NULL } }; static const value_string liveliness_qos_vals[] = { { LIVELINESS_AUTOMATIC, "AUTOMATIC_LIVELINESS_QOS" }, { LIVELINESS_BY_PARTICIPANT, "MANUAL_BY_PARTICIPANT_LIVELINESS_QOS" }, { LIVELINESS_BY_TOPIC, "MANUAL_BY_TOPIC_LIVELINESS_QOS" }, { 0, NULL } }; static const value_string durability_qos_vals[] = { { DURABILITY_VOLATILE, "VOLATILE_DURABILITY_QOS" }, { DURABILITY_TRANSIENT_LOCAL, "TRANSIENT_LOCAL_DURABILITY_QOS" }, { DURABILITY_TRANSIENT, "TRANSIENT_DURABILITY_QOS" }, { DURABILITY_PERSISTENT, "PERSISTENT_DURABILITY_QOS" }, { 0, NULL } }; static const value_string ownership_qos_vals[] = { { OWNERSHIP_SHARED, "SHARED_OWNERSHIP_QOS" }, { OWNERSHIP_EXCLUSIVE, "EXCLUSIVE_OWNERSHIP_QOS" }, { 0, NULL } }; static const value_string presentation_qos_vals[] = { { PRESENTATION_INSTANCE, "INSTANCE_PRESENTATION_QOS" }, { PRESENTATION_TOPIC, "TOPIC_PRESENTATION_QOS" }, { PRESENTATION_GROUP, "GROUP_PRESENTATION_QOS" }, { 0, NULL } }; static const value_string history_qos_vals[] = { { HISTORY_KIND_KEEP_LAST, "KEEP_LAST_HISTORY_QOS" }, { HISTORY_KIND_KEEP_ALL, "KEEP_ALL_HISTORY_QOS" }, { 0, NULL } }; static const value_string reliability_qos_vals[] = { { RELIABILITY_BEST_EFFORT, "BEST_EFFORT_RELIABILITY_QOS" }, { RELIABILITY_RELIABLE, "RELIABLE_RELIABILITY_QOS" }, { 0, NULL } }; static const value_string destination_order_qos_vals[] = { { BY_RECEPTION_TIMESTAMP, "BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS" }, { BY_SOURCE_TIMESTAMP, "BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS" }, { 0, NULL } }; static const value_string encapsulation_id_vals[] = { { ENCAPSULATION_CDR_BE, "CDR_BE" }, { ENCAPSULATION_CDR_LE, "CDR_LE" }, { ENCAPSULATION_PL_CDR_BE, "PL_CDR_BE" }, { ENCAPSULATION_PL_CDR_LE, "PL_CDR_LE" }, { 0, NULL } }; static const value_string plugin_promiscuity_kind_vals[] = { { 0x0001, "MATCHING_REMOTE_ENTITIES_PROMISCUITY" }, { 0xffff, "ALL_REMOTE_ENTITIES_PROMISCUITY" }, { 0, NULL } }; static const value_string service_kind_vals[] = { { 0x00000000, "NO_SERVICE_QOS" }, { 0x00000001, "PERSISTENCE_SERVICE_QOS" }, { 0, NULL } }; static const value_string secure_transformation_kind[] = { { CRYPTO_TRANSFORMATION_KIND_NONE, "NONE" }, { CRYPTO_TRANSFORMATION_KIND_AES128_GMAC, "AES128_GMAC" }, { CRYPTO_TRANSFORMATION_KIND_AES128_GCM, "AES128_GCM" }, { CRYPTO_TRANSFORMATION_KIND_AES256_GMAC, "AES256_GMAC" }, { CRYPTO_TRANSFORMATION_KIND_AES256_GCM, "AES256_GCM" }, { 0, NULL } }; static const value_string participant_message_data_kind [] = { { PARTICIPANT_MESSAGE_DATA_KIND_UNKNOWN, "PARTICIPANT_MESSAGE_DATA_KIND_UNKNOWN" }, { PARTICIPANT_MESSAGE_DATA_KIND_AUTOMATIC_LIVELINESS_UPDATE, "PARTICIPANT_MESSAGE_DATA_KIND_AUTOMATIC_LIVELINESS_UPDATE" }, { PARTICIPANT_MESSAGE_DATA_KIND_MANUAL_LIVELINESS_UPDATE, "PARTICIPANT_MESSAGE_DATA_KIND_MANUAL_LIVELINESS_UPDATE" }, { 0, NULL } }; /* Vendor specific: RTI */ static const value_string type_consistency_kind_vals[] = { { DISALLOW_TYPE_COERCION, "DISALLOW_TYPE_COERCION" }, { ALLOW_TYPE_COERCION, "ALLOW_TYPE_COERCION" }, { 0, NULL } }; static const value_string service_request_kind[] = { { RTI_SERVICE_REQUEST_ID_UNKNOWN, "RTI_SERVICE_REQUEST_ID_UNKNOWN" }, { RTI_SERVICE_REQUEST_ID_TOPIC_QUERY, "RTI_SERVICE_REQUEST_ID_TOPIC_QUERY" }, { RTI_SERVICE_REQUEST_ID_LOCATOR_REACHABILITY, "RTI_SERVICE_REQUEST_ID_LOCATOR_REACHABILITY" }, { 0, NULL } }; /* Vendor specific: RTI */ static const value_string acknowledgement_kind_vals[] = { { PROTOCOL_ACKNOWLEDGMENT, "PROTOCOL_ACKNOWLEDGMENT" }, { APPLICATION_AUTO_ACKNOWLEDGMENT, "APPLICATION_AUTO_ACKNOWLEDGMENT" }, { APPLICATION_ORDERED_ACKNOWLEDGMENT, "APPLICATION_ORDERED_ACKNOWLEDGMENT" }, { APPLICATION_EXPLICIT_ACKNOWLEDGMENT, "APPLICATION_EXPLICIT_ACKNOWLEDGMENT" }, { 0, NULL } }; static const value_string type_object_kind [] = { { RTI_CDR_TYPE_OBJECT_TYPE_KIND_NO_TYPE, "NO_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE, "BOOLEAN_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE, "BYTE_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE, "INT_16_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE, "UINT_16_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE, "INT_32_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE, "UINT_32_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE, "INT_64_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE, "UINT_64_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE, "FLOAT_32_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE, "FLOAT_64_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE, "FLOAT_128_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE, "CHAR_8_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_32_TYPE, "CHAR_32_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE, "ENUMERATION_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_BITSET_TYPE, "BITSET_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_ALIAS_TYPE, "ALIAS_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE, "ARRAY_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE, "SEQUENCE_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRING_TYPE, "STRING_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_MAP_TYPE, "MAP_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_UNION_TYPE, "UNION_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE, "STRUCTURE_TYPE" }, { RTI_CDR_TYPE_OBJECT_TYPE_KIND_ANNOTATION_TYPE, "ANNOTATION_TYPE" }, { 0, NULL } }; static const int* TYPE_FLAG_FLAGS[] = { &hf_rtps_flag_typeflag_nested, /* Bit 2 */ &hf_rtps_flag_typeflag_mutable, /* Bit 1 */ &hf_rtps_flag_typeflag_final, /* Bit 0 */ NULL }; static const int* MEMBER_FLAGS[] = { &hf_rtps_flag_memberflag_union_default, /* Bit 3 */ &hf_rtps_flag_memberflag_shareable, /* Bit 2 */ &hf_rtps_flag_memberflag_optional, /* Bit 1 */ &hf_rtps_flag_memberflag_key, /* Bit 0 */ NULL }; /* Vendor specific: RTI */ static const value_string ndds_transport_class_id_vals[] = { { NDDS_TRANSPORT_CLASSID_ANY, "ANY" }, { NDDS_TRANSPORT_CLASSID_UDPv4, "UDPv4" }, { NDDS_TRANSPORT_CLASSID_SHMEM, "SHMEM" }, { NDDS_TRANSPORT_CLASSID_INTRA, "INTRA" }, { NDDS_TRANSPORT_CLASSID_UDPv6, "UDPv6" }, { NDDS_TRANSPORT_CLASSID_DTLS, "DTLS" }, { NDDS_TRANSPORT_CLASSID_WAN, "WAN" }, { NDDS_TRANSPORT_CLASSID_TCPV4_LAN, "TCPv4_LAN" }, { NDDS_TRANSPORT_CLASSID_TCPV4_WAN, "TCPv4_WAN" }, { NDDS_TRANSPORT_CLASSID_TLSV4_LAN, "TLSv4_LAN" }, { NDDS_TRANSPORT_CLASSID_TLSV4_WAN, "TLSv4_WAN" }, { NDDS_TRANSPORT_CLASSID_PCIE, "PCIE" }, { NDDS_TRANSPORT_CLASSID_ITP, "ITP" }, { 0, NULL } }; static const int* PAD_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_reserved02, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* DATA_FLAGSv1[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_unregister, /* Bit 5 */ &hf_rtps_flag_inline_qos_v1, /* Bit 4 */ &hf_rtps_flag_hash_key, /* Bit 3 */ &hf_rtps_flag_alive, /* Bit 2 */ &hf_rtps_flag_data_present_v1, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* DATA_FLAGSv2[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_status_info, /* Bit 4 */ &hf_rtps_flag_hash_key, /* Bit 3 */ &hf_rtps_flag_data_present_v2, /* Bit 2 */ &hf_rtps_flag_inline_qos_v2, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* NOKEY_DATA_FRAG_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_inline_qos_v2, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* NOKEY_DATA_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_inline_qos_v2, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* ACKNACK_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_final, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* NACK_FRAG_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_reserved02, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* GAP_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_reserved02, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* HEARTBEAT_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_liveliness, /* Bit 2 */ &hf_rtps_flag_final, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* HEARTBEAT_BATCH_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_liveliness, /* Bit 2 */ &hf_rtps_flag_final, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* HEARTBEAT_FRAG_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_reserved02, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* RTPS_DATA_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_data_serialized_key, /* Bit 3 */ &hf_rtps_flag_data_present_v2, /* Bit 2 */ &hf_rtps_flag_inline_qos_v2, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* RTPS_DATA_FRAG_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_data_frag_serialized_key, /* Bit 2 */ &hf_rtps_flag_inline_qos_v2, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* RTPS_DATA_BATCH_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_inline_qos_v2, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* RTPS_SAMPLE_INFO_FLAGS16[] = { &hf_rtps_flag_reserved8000, /* Bit 15 */ &hf_rtps_flag_reserved4000, /* Bit 14 */ &hf_rtps_flag_reserved2000, /* Bit 13 */ &hf_rtps_flag_reserved1000, /* Bit 12 */ &hf_rtps_flag_reserved0800, /* Bit 11 */ &hf_rtps_flag_reserved0400, /* Bit 10 */ &hf_rtps_flag_reserved0200, /* Bit 9 */ &hf_rtps_flag_reserved0100, /* Bit 8 */ &hf_rtps_flag_reserved0080, /* Bit 7 */ &hf_rtps_flag_reserved0040, /* Bit 6 */ &hf_rtps_flag_serialize_key16, /* Bit 5 */ &hf_rtps_flag_invalid_sample, /* Bit 4 */ &hf_rtps_flag_data_present16, /* Bit 3 */ &hf_rtps_flag_offsetsn_present, /* Bit 2 */ &hf_rtps_flag_inline_qos16_v2, /* Bit 1 */ &hf_rtps_flag_timestamp_present, /* Bit 0 */ NULL }; static const int* INFO_TS_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_timestamp, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* INFO_SRC_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_reserved02, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* INFO_REPLY_IP4_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_multicast, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* INFO_DST_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_reserved02, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* INFO_REPLY_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_multicast, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int * RTI_CRC_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_reserved02, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; /* It is a 4 bytes field but with these 8 bits is enough */ static const int* STATUS_INFO_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_unregistered, /* Bit 1 */ &hf_rtps_flag_disposed, /* Bit 0 */ NULL }; static const int* BUILTIN_ENDPOINT_FLAGS[] = { &hf_rtps_flag_participant_secure_reader, /* Bit 27 */ &hf_rtps_flag_participant_secure_writer, /* Bit 26 */ &hf_rtps_flag_secure_participant_volatile_message_reader, /* Bit 25 */ &hf_rtps_flag_secure_participant_volatile_message_writer, /* Bit 24 */ &hf_rtps_flag_participant_stateless_message_reader, /* Bit 23 */ &hf_rtps_flag_participant_stateless_message_writer, /* Bit 22 */ &hf_rtps_flag_secure_participant_message_reader, /* Bit 21 */ &hf_rtps_flag_secure_participant_message_writer, /* Bit 20 */ &hf_rtps_flag_secure_subscription_reader, /* Bit 19 */ &hf_rtps_flag_secure_subscription_writer, /* Bit 18 */ &hf_rtps_flag_secure_publication_reader, /* Bit 17 */ &hf_rtps_flag_secure_publication_writer, /* Bit 16 */ &hf_rtps_flag_builtin_endpoint_set_reserved, /* Bit 12-15 */ &hf_rtps_flag_participant_message_datareader, /* Bit 11 */ &hf_rtps_flag_participant_message_datawriter, /* Bit 10 */ &hf_rtps_flag_participant_state_detector, /* Bit 9 */ &hf_rtps_flag_participant_state_announcer, /* Bit 8 */ &hf_rtps_flag_participant_proxy_detector, /* Bit 7 */ &hf_rtps_flag_participant_proxy_announcer, /* Bit 6 */ &hf_rtps_flag_subscription_detector, /* Bit 5 */ &hf_rtps_flag_subscription_announcer, /* Bit 4 */ &hf_rtps_flag_publication_detector, /* Bit 3 */ &hf_rtps_flag_publication_announcer, /* Bit 2 */ &hf_rtps_flag_participant_detector, /* Bit 1 */ &hf_rtps_flag_participant_announcer, /* Bit 0 */ NULL }; static const int* SECURE_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_multisubmessage, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* SECURE_PREFIX_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_reserved02, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static const int* SECURE_POSTFIX_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_reserved02, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; /* Vendor specific: RTI */ static const int* APP_ACK_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_reserved02, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; /* Vendor specific: RTI */ static const int* APP_ACK_CONF_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_reserved02, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; /* Vendor specific: RTI */ static const int* HEARTBEAT_VIRTUAL_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_no_virtual_guids, /* Bit 3 */ &hf_rtps_flag_multiple_writers, /* Bit 2 */ &hf_rtps_flag_multiple_virtual_guids, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; /* Vendor specific: RTI */ static const int* DATA_FRAG_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_hash_key_rti, /* Bit 2 */ &hf_rtps_flag_inline_qos_v2, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; #if 0 /* Vendor specific: RTI */ static const int* NACK_FLAGS[] = { &hf_rtps_flag_reserved80, /* Bit 7 */ &hf_rtps_flag_reserved40, /* Bit 6 */ &hf_rtps_flag_reserved20, /* Bit 5 */ &hf_rtps_flag_reserved10, /* Bit 4 */ &hf_rtps_flag_reserved08, /* Bit 3 */ &hf_rtps_flag_reserved04, /* Bit 2 */ &hf_rtps_flag_final, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; #endif static const int* VENDOR_BUILTIN_ENDPOINT_FLAGS[] = { &hf_rtps_flag_secure_service_request_reader, /* Bit 5 */ &hf_rtps_flag_secure_service_request_writer, /* Bit 4 */ &hf_rtps_flag_locator_ping_reader, /* Bit 3 */ &hf_rtps_flag_locator_ping_writer, /* Bit 2 */ &hf_rtps_flag_service_request_reader, /* Bit 1 */ &hf_rtps_flag_service_request_writer, /* Bit 0 */ NULL }; static const int* ENDPOINT_SECURITY_ATTRIBUTES[] = { &hf_rtps_flag_security_payload_protected, /* Bit 3 */ &hf_rtps_flag_security_submessage_protected, /* Bit 2 */ &hf_rtps_flag_security_discovery_protected, /* Bit 1 */ &hf_rtps_flag_security_access_protected, /* Bit 0 */ NULL }; typedef struct _endpoint_guid { guint32 host_id; guint32 app_id; guint32 instance_id; guint32 entity_id; } endpoint_guid; typedef struct _datawriter_qos { guint32 reliability_kind; guint32 durability_kind; guint32 ownership_kind; } datawriter_qos; #define MAX_TOPIC_AND_TYPE_LENGTH 256 typedef struct _type_mapping { endpoint_guid guid; gchar type_name[MAX_TOPIC_AND_TYPE_LENGTH]; gchar topic_name[MAX_TOPIC_AND_TYPE_LENGTH]; gint fields_visited; datawriter_qos dw_qos; guint32 dcps_publication_frame_number; } type_mapping; static wmem_map_t * registry = NULL; /* *********************************************************************** */ /* Appends extra formatting for those submessages that have a status info */ static void append_status_info(packet_info *pinfo, guint32 writer_id, guint32 status_info) { /* Defines the extra information associated to the writer involved in * this communication * * Format: [?Ptwrpm]\(u?d?\) * * First letter table: * * writerEntityId value | Letter * ----------------------------------------------------------+-------- * ENTITYID_UNKNOWN | ? * ENTITYID_PARTICIPANT | P * ENTITYID_SEDP_BUILTIN_TOPIC_WRITER | t * ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER | w * ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER | r * ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER | p * ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER | m * ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER | s * ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER | V * ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER | M * ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER | W * ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER | R * * The letter is followed by: * status_info &1 | status_info & 2 | Text * ---------------+-----------------------+-------------- * status_info not defined in inlineQos | [?] * 0 | 0 | [__] * 0 | 1 | [u_] * 1 | 0 | [_d] * 1 | 1 | [ud] */ /* 0123456 */ gchar * writerId = NULL; gchar * disposeFlag = NULL; gchar * unregisterFlag = NULL; wmem_strbuf_t *buffer = wmem_strbuf_new_label(wmem_packet_scope()); switch(writer_id) { case ENTITYID_PARTICIPANT: case ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER: writerId = "P"; break; case ENTITYID_BUILTIN_TOPIC_WRITER: writerId = "t"; break; case ENTITYID_BUILTIN_PUBLICATIONS_WRITER: writerId = "w"; break; case ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER: writerId = "r"; break; case ENTITYID_BUILTIN_SDP_PARTICIPANT_WRITER: writerId = "p"; break; case ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER: writerId = "m"; break; case ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER: writerId = "s"; break; case ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER: writerId = "V"; break; case ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER: writerId = "M"; break; case ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER: writerId = "W"; break; case ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER: writerId = "R"; break; default: /* Unknown writer ID, don't format anything */ break; } switch(status_info) { case 0: unregisterFlag = "_"; disposeFlag = "_"; break; case 1: unregisterFlag = "_"; disposeFlag = "D"; break; case 2: unregisterFlag = "U"; disposeFlag = "_"; break; case 3: unregisterFlag = "U"; disposeFlag = "D"; break; default: /* Unknown status info, omit it */ break; } if (writerId != NULL || unregisterFlag != NULL || disposeFlag != NULL ) { wmem_strbuf_append(buffer, "("); if (writerId != NULL) { wmem_strbuf_append(buffer, writerId); } if (unregisterFlag != NULL || disposeFlag != NULL) { wmem_strbuf_append(buffer, "["); wmem_strbuf_append(buffer, unregisterFlag); wmem_strbuf_append(buffer, disposeFlag); wmem_strbuf_append(buffer, "]"); } wmem_strbuf_append(buffer, ")"); col_append_str(pinfo->cinfo, COL_INFO, wmem_strbuf_get_str(buffer)); } } /* *********************************************************************** */ guint16 rtps_util_add_protocol_version(proto_tree *tree, /* Can NOT be NULL */ tvbuff_t *tvb, gint offset) { proto_item *ti; proto_tree *version_tree; guint16 version; version = tvb_get_ntohs(tvb, offset); ti = proto_tree_add_uint_format(tree, hf_rtps_protocol_version, tvb, offset, 2, version, "Protocol version: %d.%d", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1)); version_tree = proto_item_add_subtree(ti, ett_rtps_proto_version); proto_tree_add_item(version_tree, hf_rtps_protocol_version_major, tvb, offset, 1, ENC_NA); proto_tree_add_item(version_tree, hf_rtps_protocol_version_minor, tvb, offset+1, 1, ENC_NA); return version; } /* ------------------------------------------------------------------------- */ /* Interpret the next bytes as vendor ID. If proto_tree and field ID is * provided, it can also set. */ guint16 rtps_util_add_vendor_id(proto_tree *tree, tvbuff_t *tvb, gint offset) { guint8 major, minor; guint16 vendor_id; major = tvb_get_guint8(tvb, offset); minor = tvb_get_guint8(tvb, offset+1); vendor_id = tvb_get_ntohs(tvb, offset); proto_tree_add_uint_format_value(tree, hf_rtps_vendor_id, tvb, offset, 2, vendor_id, "%02d.%02d (%s)", major, minor, val_to_str_const(vendor_id, vendor_vals, "Unknown")); return vendor_id; } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 8 bytes interpreted as Locator_t * * Locator_t is a struct defined as: * struct { * long kind; // kind of locator * unsigned long port; * octet[16] address; * } Locator_t; */ void rtps_util_add_locator_t(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, const guint encoding, const guint8 *label) { proto_tree *ti; proto_tree *locator_tree; guint32 kind; gint32 port; locator_tree = proto_tree_add_subtree(tree, tvb, offset, 24, ett_rtps_locator, NULL, label); proto_tree_add_item_ret_uint(locator_tree, hf_rtps_locator_kind, tvb, offset, 4, encoding, &kind); switch (kind) { case LOCATOR_KIND_UDPV4: case LOCATOR_KIND_TUDPV4: { ti = proto_tree_add_item_ret_int(locator_tree, hf_rtps_locator_port, tvb, offset+4, 4, encoding, &port); proto_tree_add_item(locator_tree, hf_rtps_locator_ipv4, tvb, offset+20, 4, ENC_BIG_ENDIAN); if (port == 0) expert_add_info(pinfo, ti, &ei_rtps_locator_port); proto_item_append_text(tree, " (%s, %s:%d)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), tvb_ip_to_str(tvb, offset + 20), port); break; } case LOCATOR_KIND_TCPV4_LAN: case LOCATOR_KIND_TCPV4_WAN: case LOCATOR_KIND_TLSV4_LAN: case LOCATOR_KIND_TLSV4_WAN: { guint16 ip_kind; ti = proto_tree_add_item_ret_int(locator_tree, hf_rtps_locator_port, tvb, offset+4, 4, encoding, &port); if (port == 0) expert_add_info(pinfo, ti, &ei_rtps_locator_port); ip_kind = tvb_get_guint16(tvb, offset+16, encoding); if (ip_kind == 0xFFFF) { /* IPv4 format */ guint16 public_address_port = tvb_get_guint16(tvb, offset + 18, ENC_BIG_ENDIAN); proto_tree_add_item(locator_tree, hf_rtps_locator_public_address_port, tvb, offset+18, 2, ENC_BIG_ENDIAN); proto_tree_add_item(locator_tree, hf_rtps_locator_ipv4, tvb, offset+20, 4, ENC_BIG_ENDIAN); proto_item_append_text(tree, " (%s, %s:%d, Logical Port = %d)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), tvb_ip_to_str(tvb, offset + 20), public_address_port, port); } else { /* IPv6 format */ proto_tree_add_item(locator_tree, hf_rtps_locator_ipv6, tvb, offset+8, 16, ENC_NA); proto_item_append_text(tree, " (%s, %s, Logical Port = %d)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), tvb_ip6_to_str(tvb, offset + 8), port); } break; } case LOCATOR_KIND_SHMEM: { guint32 hostId; ti = proto_tree_add_item_ret_int(locator_tree, hf_rtps_locator_port, tvb, offset+4, 4, encoding, &port); proto_tree_add_item_ret_uint(locator_tree, hf_rtps_param_host_id, tvb, offset+10, 4, ENC_BIG_ENDIAN, &hostId); if (port == 0) expert_add_info(pinfo, ti, &ei_rtps_locator_port); proto_item_append_text(tree, " (%s, HostId = 0x%08x, Port = %d)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), hostId, port); break; } case LOCATOR_KIND_UDPV6: { proto_tree_add_item(locator_tree, hf_rtps_locator_ipv6, tvb, offset+8, 16, ENC_NA); proto_item_append_text(tree, " (%s, %s)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), tvb_ip6_to_str(tvb, offset + 8)); break; } case LOCATOR_KIND_DTLS: { proto_tree_add_item_ret_int(locator_tree, hf_rtps_locator_port, tvb, offset+4, 4, encoding, &port); proto_tree_add_item(locator_tree, hf_rtps_locator_ipv6, tvb, offset+8, 16, ENC_NA); proto_item_append_text(tree, " (%s, %s:%d)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), tvb_ip6_to_str(tvb, offset + 8), port); break; } /* Default case, we already have the locator kind so don't do anything */ default: break; } } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as a list of * Locators: * - unsigned long numLocators * - locator 1 * - locator 2 * - ... * - locator n * Returns the new offset after parsing the locator list */ int rtps_util_add_locator_list(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, const guint8 *label, const guint encoding) { proto_tree *locator_tree; guint32 num_locators; num_locators = tvb_get_guint32(tvb, offset, encoding); locator_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_locator_udp_v4, NULL, "%s: %d Locators", label, num_locators); offset += 4; if (num_locators > 0) { guint32 i; char temp_buff[20]; for (i = 0; i < num_locators; ++i) { g_snprintf(temp_buff, 20, "Locator[%d]", i); rtps_util_add_locator_t(locator_tree, pinfo, tvb, offset, encoding, temp_buff); offset += 24; } } return offset; } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 4 bytes interpreted as IPV4Address_t */ void rtps_util_add_ipv4_address_t(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, const guint encoding, int hf_item) { guint32 addr; proto_item *ti; ti = proto_tree_add_item_ret_uint(tree, hf_item, tvb, offset, 4, encoding, &addr); if (addr == IPADDRESS_INVALID) expert_add_info(pinfo, ti, &ei_rtps_ip_invalid); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 8 bytes interpreted as LocatorUDPv4 * * LocatorUDPv4 is a struct defined as: * struct { * unsigned long address; * unsigned long port; * } LocatorUDPv4_t; * */ void rtps_util_add_locator_udp_v4(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, const guint8 *label, const guint encoding) { proto_item *ti; proto_tree *locator_tree; guint32 port; locator_tree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_rtps_locator_udp_v4, NULL, label); rtps_util_add_ipv4_address_t(locator_tree, pinfo, tvb, offset, encoding, hf_rtps_locator_udp_v4); ti = proto_tree_add_item_ret_uint(locator_tree, hf_rtps_locator_udp_v4_port, tvb, offset, 4, encoding, &port); if (port == PORT_INVALID) expert_add_info(pinfo, ti, &ei_rtps_port_invalid); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 8 bytes interpreted as GuidPrefix * If tree is specified, it fills up the protocol tree item: * - hf_rtps_guid_prefix * - hf_rtps_host_id * - hf_rtps_app_id * - hf_rtps_app_id_instance_id * - hf_rtps_app_id_app_kind */ static void rtps_util_add_guid_prefix_v1(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_prefix, int hf_host_id, int hf_app_id, int hf_app_id_instance_id, int hf_app_id_app_kind, const guint8 *label) { guint64 prefix; guint32 host_id, app_id, instance_id; guint8 app_kind; proto_item *ti; proto_tree *guid_tree, *appid_tree; const guint8 *safe_label = (label == NULL) ? (const guint8 *)"guidPrefix" : label; /* Read values from TVB */ prefix = tvb_get_ntoh64(tvb, offset); host_id = tvb_get_ntohl(tvb, offset); app_id = tvb_get_ntohl(tvb, offset + 4); instance_id = (app_id >> 8); app_kind = (app_id & 0xff); if (tree != NULL) { ti = proto_tree_add_uint64_format(tree, hf_prefix, tvb, offset, 8, prefix, "%s=%08x %08x { hostId=%08x, appId=%08x (%s: %06x) }", safe_label, host_id, app_id, host_id, app_id, val_to_str(app_kind, app_kind_vals, "%02x"), instance_id); guid_tree = proto_item_add_subtree(ti, ett_rtps_guid_prefix); /* Host Id */ proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN); /* AppId (root of the app_id sub-tree) */ ti = proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN); appid_tree = proto_item_add_subtree(ti, ett_rtps_app_id); /* InstanceId */ proto_tree_add_item(appid_tree, hf_app_id_instance_id, tvb, offset+4, 3, ENC_BIG_ENDIAN); /* AppKind */ proto_tree_add_item(appid_tree, hf_app_id_app_kind, tvb, offset+7, 1, ENC_BIG_ENDIAN); } } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 12 bytes interpreted as GuidPrefix * If tree is specified, it fills up the protocol tree item: * - hf_rtps_guid_prefix * - hf_rtps_host_id * - hf_rtps_app_id * - hf_rtps_counter */ static void rtps_util_add_guid_prefix_v2(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_prefix, int hf_host_id, int hf_app_id, int hf_instance_id, int hf_prefix_extra) { if (tree) { proto_item *ti; proto_tree *guid_tree; /* The text node (root of the guid prefix sub-tree) */ ti = proto_tree_add_item(tree, hf_prefix, tvb, offset, 12, ENC_NA); guid_tree = proto_item_add_subtree(ti, ett_rtps_guid_prefix); /* Optional filter that can be guidPrefix.src or guidPrefix.dst */ if (hf_prefix_extra != 0) { ti = proto_tree_add_item(tree, hf_prefix_extra, tvb, offset, 12, ENC_NA); PROTO_ITEM_SET_HIDDEN(ti); } /* Host Id */ proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN); /* App Id */ proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN); /* Counter */ proto_tree_add_item(guid_tree, hf_instance_id, tvb, offset+8, 4, ENC_BIG_ENDIAN); } } /* ------------------------------------------------------------------------- */ /* Insert the entityId from the next 4 bytes. Since there are more than * one entityId, we need to specify also the IDs of the entityId (and its * sub-components), as well as the label identifying it. * Returns true if the entityKind is one of the NDDS built-in entities. */ gboolean rtps_util_add_entity_id(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_item, int hf_item_entity_key, int hf_item_entity_kind, int subtree_entity_id, const char *label, guint32 *entity_id_out) { guint32 entity_id = tvb_get_ntohl(tvb, offset); guint32 entity_key = (entity_id >> 8); guint8 entity_kind = (entity_id & 0xff); const char *str_predef = try_val_to_str(entity_id, entity_id_vals); if (entity_id_out != NULL) { *entity_id_out = entity_id; } if (tree != NULL) { proto_tree *entity_tree; proto_item *ti; if (str_predef == NULL) { /* entityId is not a predefined value, format it */ ti = proto_tree_add_uint_format(tree, hf_item, tvb, offset, 4, entity_id, "%s: 0x%08x (%s: 0x%06x)", label, entity_id, val_to_str(entity_kind, entity_kind_vals, "unknown kind (%02x)"), entity_key); } else { /* entityId is a predefined value */ ti = proto_tree_add_uint_format(tree, hf_item, tvb, offset, 4, entity_id, "%s: %s (0x%08x)", label, str_predef, entity_id); } entity_tree = proto_item_add_subtree(ti, subtree_entity_id); proto_tree_add_item(entity_tree, hf_item_entity_key, tvb, offset, 3, ENC_BIG_ENDIAN); proto_tree_add_item(entity_tree, hf_item_entity_kind, tvb, offset+3, 1, ENC_BIG_ENDIAN); } /* is a built-in entity if the bit M and R (5 and 6) of the entityKind are set */ /* return ((entity_kind & 0xc0) == 0xc0); */ return ( ((entity_kind & 0xc0) == 0xc0) || entity_id == ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER || entity_id == ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER || entity_id == ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER || entity_id == ENTITYID_RTI_BUILTIN_LOCATOR_PING_READER); } /* ------------------------------------------------------------------------- */ /* Insert the entityId from the next 4 bytes as a generic one (not connected * to any protocol field). It simply insert the content as a simple text entry * and returns in the passed buffer only the value (without the label). */ void rtps_util_add_generic_entity_id(proto_tree *tree, tvbuff_t *tvb, gint offset, const char *label, int hf_item, int hf_item_entity_key, int hf_item_entity_kind, int subtree_entity_id) { guint32 entity_id = tvb_get_ntohl(tvb, offset); guint32 entity_key = (entity_id >> 8); guint8 entity_kind = (entity_id & 0xff); const char *str_predef = try_val_to_str(entity_id, entity_id_vals); proto_item *ti; proto_tree *entity_tree; if (str_predef == NULL) { /* entityId is not a predefined value, format it */ ti = proto_tree_add_uint_format(tree, hf_item, tvb, offset, 4, entity_id, "%s: 0x%08x (%s: 0x%06x)", label, entity_id, val_to_str(entity_kind, entity_kind_vals, "unknown kind (%02x)"), entity_key); } else { /* entityId is a predefined value */ ti = proto_tree_add_uint_format_value(tree, hf_item, tvb, offset, 4, entity_id, "%s: %s (0x%08x)", label, str_predef, entity_id); } entity_tree = proto_item_add_subtree(ti, subtree_entity_id); proto_tree_add_item(entity_tree, hf_item_entity_key, tvb, offset, 3, ENC_BIG_ENDIAN); proto_tree_add_item(entity_tree, hf_item_entity_kind, tvb, offset+3, 1, ENC_BIG_ENDIAN); } /* ------------------------------------------------------------------------- */ /* Interpret the next 12 octets as a generic GUID and insert it in the protocol * tree as simple text (no reference fields are set). * It is mostly used in situation where is not required to perform search for * this kind of GUID (i.e. like in some DATA parameter lists). */ static void rtps_util_add_generic_guid_v1(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_guid, int hf_host_id, int hf_app_id, int hf_app_id_instance_id, int hf_app_id_app_kind, int hf_entity, int hf_entity_key, int hf_entity_kind) { guint64 prefix; guint32 host_id, app_id, entity_id; proto_item *ti; proto_tree *guid_tree, *appid_tree, *entity_tree; /* Read typed data */ prefix = tvb_get_ntoh64(tvb, offset); host_id = tvb_get_ntohl(tvb, offset); app_id = tvb_get_ntohl(tvb, offset + 4); entity_id = tvb_get_ntohl(tvb, offset + 8); ti = proto_tree_add_uint64_format_value(tree, hf_guid, tvb, offset, 8, prefix, "%08x %08x %08x", host_id, app_id, entity_id); guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid); /* Host Id */ proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN); /* AppId (root of the app_id sub-tree) */ ti = proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN); appid_tree = proto_item_add_subtree(ti, ett_rtps_app_id); /* InstanceId */ proto_tree_add_item(appid_tree, hf_app_id_instance_id, tvb, offset+4, 3, ENC_BIG_ENDIAN); /* AppKind */ proto_tree_add_item(appid_tree, hf_app_id_app_kind, tvb, offset+7, 1, ENC_BIG_ENDIAN); /* Entity (root of the app_id sub-tree) */ ti = proto_tree_add_item(guid_tree, hf_entity, tvb, offset+8, 4, ENC_BIG_ENDIAN); entity_tree = proto_item_add_subtree(ti, ett_rtps_entity); proto_tree_add_item(entity_tree, hf_entity_key, tvb, offset+8, 3, ENC_BIG_ENDIAN); proto_tree_add_item(entity_tree, hf_entity_kind, tvb, offset+11, 1, ENC_BIG_ENDIAN); } /* ------------------------------------------------------------------------- */ /* Interpret the next 16 octets as a generic GUID and insert it in the protocol * tree as simple text (no reference fields are set). * It is mostly used in situation where is not required to perform search for * this kind of GUID (i.e. like in some DATA parameter lists). */ static void rtps_util_add_generic_guid_v2(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_guid, int hf_host_id, int hf_app_id, int hf_instance_id, int hf_entity, int hf_entity_key, int hf_entity_kind, proto_tree *print_tree) { guint32 host_id, app_id, entity_id, instance_id; proto_item *ti; proto_tree *guid_tree, *entity_tree; /* Read typed data */ host_id = tvb_get_ntohl(tvb, offset); app_id = tvb_get_ntohl(tvb, offset + 4); instance_id = tvb_get_ntohl(tvb, offset + 8); entity_id = tvb_get_ntohl(tvb, offset + 12); ti = proto_tree_add_bytes_format_value(tree, hf_guid, tvb, offset, 16, NULL, "%08x %08x %08x %08x", host_id, app_id, instance_id, entity_id); /* If the method is called with a valid print_tree pointer, we add the info to the tree. * This improves usability a lot since the user doesn't have to click a lot to debug. */ proto_item_append_text(print_tree, "%08x %08x %08x %08x", host_id, app_id, instance_id, entity_id); guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid); /* Host Id */ proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN); /* App Id */ proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN); /* Instance Id */ proto_tree_add_item(guid_tree, hf_instance_id, tvb, offset+8, 4, ENC_BIG_ENDIAN); /* Entity (root of the app_id sub-tree) */ ti = proto_tree_add_item(guid_tree, hf_entity, tvb, offset+12, 4, ENC_BIG_ENDIAN); entity_tree = proto_item_add_subtree(ti, ett_rtps_entity); proto_tree_add_item(entity_tree, hf_entity_key, tvb, offset+12, 3, ENC_BIG_ENDIAN); proto_tree_add_item(entity_tree, hf_entity_kind, tvb, offset+15, 1, ENC_BIG_ENDIAN); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 8 bytes interpreted as sequence * number. */ guint64 rtps_util_add_seq_number(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding, const char *label) { guint64 hi = (guint64)tvb_get_guint32(tvb, offset, encoding); guint64 lo = (guint64)tvb_get_guint32(tvb, offset+4, encoding); guint64 all = (hi << 32) | lo; proto_tree_add_int64_format(tree, hf_rtps_sm_seq_number, tvb, offset, 8, all, "%s: %" G_GINT64_MODIFIER "u", label, all); return all; } /* ------------------------------------------------------------------------- */ /* Vendor specific: RTI * Insert in the protocol tree the next 8 bytes interpreted as TransportInfo */ static void rtps_util_add_transport_info(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding, int transport_index) { gint32 classId = tvb_get_guint32(tvb, offset, encoding); if (tree) { proto_tree *xport_info_tree; xport_info_tree = proto_tree_add_subtree_format(tree, tvb, offset, 8, ett_rtps_transport_info, NULL, "transportInfo %d: %s", transport_index,val_to_str(classId, ndds_transport_class_id_vals, "unknown")); proto_tree_add_item(xport_info_tree, hf_rtps_transportInfo_classId, tvb, offset, 4, encoding); proto_tree_add_item(xport_info_tree, hf_rtps_transportInfo_messageSizeMax, tvb, offset+4, 4, encoding); } } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 8 bytes interpreted as an RTPS time_t, * which is like an NTP time stamp, except that it uses the UNIX epoch, * rather than the NTP epoch, as the time base. Doesn't check for TIME_ZERO, * TIME_INVALID, or TIME_INFINITE, and doesn't show the seconds and * fraction field separately. */ static void rtps_util_add_timestamp(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding, int hf_time) { proto_tree_add_item(tree, hf_time, tvb, offset, 8, ENC_TIME_RTPS|encoding); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 8 bytes interpreted as an RTPS time_t. * Checks for special values except for TIME_INVALID, and shows the * seconds and fraction as separate fields. */ static void rtps_util_add_timestamp_sec_and_fraction(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding, int hf_time _U_) { guint8 tempBuffer[MAX_TIMESTAMP_SIZE]; gdouble absolute; gint32 sec; guint32 frac; if (tree) { proto_tree *time_tree; sec = tvb_get_guint32(tvb, offset, encoding); frac = tvb_get_guint32(tvb, offset+4, encoding); if ((sec == 0x7fffffff) && (frac == 0xffffffff)) { g_strlcpy(tempBuffer, "INFINITE", MAX_TIMESTAMP_SIZE); } else if ((sec == 0) && (frac == 0)) { g_strlcpy(tempBuffer, "0 sec", MAX_TIMESTAMP_SIZE); } else { absolute = (gdouble)sec + (gdouble)frac / ((gdouble)(0x80000000) * 2.0); g_snprintf(tempBuffer, MAX_TIMESTAMP_SIZE, "%f sec (%ds + 0x%08x)", absolute, sec, frac); } time_tree = proto_tree_add_subtree_format(tree, tvb, offset, 8, ett_rtps_timestamp, NULL, "%s: %s", "lease_duration", tempBuffer); proto_tree_add_item(time_tree, hf_rtps_param_timestamp_sec, tvb, offset, 4, encoding); proto_tree_add_item(time_tree, hf_rtps_param_timestamp_fraction, tvb, offset+4, 4, encoding); } } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next data interpreted as a String * Returns the new offset (after reading the string) */ gint rtps_util_add_string(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_item, const guint encoding) { guint8 *retVal = NULL; guint32 size = tvb_get_guint32(tvb, offset, encoding); retVal = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, size, ENC_ASCII); proto_tree_add_string(tree, hf_item, tvb, offset, size+4, retVal); /* NDDS align strings at 4-bytes word. So: * string_length: 4 -> buffer_length = 4; * string_length: 5 -> buffer_length = 8; * string_length: 6 -> buffer_length = 8; * string_length: 7 -> buffer_length = 8; * string_length: 8 -> buffer_length = 8; * ... */ return offset + 4 + ((size + 3) & 0xfffffffc); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next data interpreted as a port (unsigned * 32-bit integer) */ void rtps_util_add_port(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, const guint encoding, int hf_item) { proto_item *ti; guint32 port; ti = proto_tree_add_item_ret_uint(tree, hf_item, tvb, offset, 4, encoding, &port); if (port == PORT_INVALID) expert_add_info(pinfo, ti, &ei_rtps_port_invalid); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as * DurabilityServiceQosPolicy */ void rtps_util_add_durability_service_qos(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding) { proto_tree *subtree; subtree = proto_tree_add_subtree(tree, tvb, offset, 28, ett_rtps_durability_service, NULL, "PID_DURABILITY_SERVICE"); rtps_util_add_timestamp_sec_and_fraction(subtree, tvb, offset, encoding, hf_rtps_durability_service_cleanup_delay); proto_tree_add_item(subtree, hf_rtps_durability_service_history_kind, tvb, offset+8, 4, encoding); proto_tree_add_item(subtree, hf_rtps_durability_service_history_depth, tvb, offset+12, 4, encoding); proto_tree_add_item(subtree, hf_rtps_durability_service_max_samples, tvb, offset+16, 4, encoding); proto_tree_add_item(subtree, hf_rtps_durability_service_max_instances, tvb, offset+20, 4, encoding); proto_tree_add_item(subtree, hf_rtps_durability_service_max_samples_per_instances, tvb, offset+24, 4, encoding); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as Liveliness * QoS Policy structure. */ void rtps_util_add_liveliness_qos(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding) { proto_tree *subtree; subtree = proto_tree_add_subtree(tree, tvb, offset, 12, ett_rtps_liveliness, NULL, "PID_LIVELINESS"); proto_tree_add_item(subtree, hf_rtps_liveliness_kind, tvb, offset, 4, encoding); rtps_util_add_timestamp_sec_and_fraction(subtree, tvb, offset+4, encoding, hf_rtps_liveliness_lease_duration); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as Liveliness * QoS Policy structure. */ static void rtps_util_add_product_version(proto_tree *tree, tvbuff_t *tvb, gint offset, gint vendor_id) { proto_tree *subtree; guint8 major, minor, release, revision; major = tvb_get_guint8(tvb, offset); minor = tvb_get_guint8(tvb, offset+1); release = tvb_get_guint8(tvb, offset+2); revision = tvb_get_guint8(tvb, offset+3); if (vendor_id == RTPS_VENDOR_RTI_DDS) { if (major < 5 && revision == 0) { subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL, "Product version: %d.%d%c", major, minor, release); } else if (major < 5 && revision > 0) { subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL, "Product version: %d.%d%c rev%d", major, minor, release, revision); } else { subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL, "Product version: %d.%d.%d.%d", major, minor, release, revision); } } else if (vendor_id == RTPS_VENDOR_RTI_DDS_MICRO) { subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL, "Product version: %d.%d.%d", major, minor, revision); } else { return; } proto_tree_add_item(subtree, hf_rtps_param_product_version_major, tvb, offset, 1, ENC_NA); proto_tree_add_item(subtree, hf_rtps_param_product_version_minor, tvb, offset+1, 1, ENC_NA); if (vendor_id == RTPS_VENDOR_RTI_DDS && major < 5) { /* If major revision is smaller than 5, release interpreted as char */ proto_tree_add_item(subtree, hf_rtps_param_product_version_release_as_char, tvb, offset+2, 1, ENC_ASCII|ENC_NA); } else { proto_tree_add_item(subtree, hf_rtps_param_product_version_release, tvb, offset+2, 1, ENC_NA); } proto_tree_add_item(subtree, hf_rtps_param_product_version_revision, tvb, offset+3, 1, ENC_NA); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as Sequence of * Strings. * The formatted buffer is: "string1", "string2", "string3", ... * Returns the new updated offset */ gint rtps_util_add_seq_string(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding, int hf_numstring, int hf_string, const char *label) { guint32 size; gint32 i, num_strings; const guint8 *retVal; proto_tree *string_tree; gint start; proto_tree_add_item_ret_int(tree, hf_numstring, tvb, offset, 4, encoding, &num_strings); offset += 4; if (num_strings == 0) { return offset; } start = offset; /* Create the string node with a fake string, the replace it later */ string_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtps_seq_string, NULL, label); for (i = 0; i < num_strings; ++i) { size = tvb_get_guint32(tvb, offset, encoding); retVal = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, size, ENC_ASCII); proto_tree_add_string_format(string_tree, hf_string, tvb, offset, size+4, retVal, "%s[%d]: %s", label, i, retVal); offset += (4 + ((size + 3) & 0xfffffffc)); } proto_item_set_len(string_tree, offset - start); return offset; } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as Sequence of * longs. * The formatted buffer is: val1, val2, val3, ... * Returns the new updated offset */ gint rtps_util_add_seq_ulong(proto_tree *tree, tvbuff_t *tvb, gint offset, int hf_item, const guint encoding, int param_length _U_, const char *label) { guint32 num_elem; guint32 i; proto_tree *string_tree; num_elem = tvb_get_guint32(tvb, offset, encoding); offset += 4; /* Create the string node with an empty string, the replace it later */ string_tree = proto_tree_add_subtree_format(tree, tvb, offset, num_elem*4, ett_rtps_seq_ulong, NULL, "%s (%d elements)", label, num_elem); for (i = 0; i < num_elem; ++i) { proto_tree_add_item(string_tree, hf_item, tvb, offset, 4, encoding); offset += 4; } return offset; } #define LONG_ALIGN(x) (x = (x+3)&0xfffffffc) #define SHORT_ALIGN(x) (x = (x+1)&0xfffffffe) #define MAX_ARRAY_DIMENSION 10 #define ALIGN_ME(offset, alignment) \ offset = (((offset) + ((alignment) - 1)) & ~((alignment) - 1)) #define ALIGN_ZERO(offset, alignment, zero) (offset -= zero, ALIGN_ME(offset, alignment), offset += zero) #define KEY_COMMENT (" //@key") #define LONG_ALIGN_ZERO(x,zero) (x -= zero, LONG_ALIGN(x), x += zero) #define SHORT_ALIGN_ZERO(x,zero) (x -= zero, SHORT_ALIGN(x), x += zero) /* ------------------------------------------------------------------------- */ static const char *rtps_util_typecode_id_to_string(guint32 typecode_id) { switch(typecode_id) { case RTI_CDR_TK_ENUM: return "enum"; case RTI_CDR_TK_UNION: return "union"; case RTI_CDR_TK_STRUCT: return "struct"; case RTI_CDR_TK_LONG: return "long"; case RTI_CDR_TK_SHORT: return "short"; case RTI_CDR_TK_USHORT: return "unsigned short"; case RTI_CDR_TK_ULONG: return "unsigned long"; case RTI_CDR_TK_FLOAT: return "float"; case RTI_CDR_TK_DOUBLE: return "double"; case RTI_CDR_TK_BOOLEAN: return "boolean"; case RTI_CDR_TK_CHAR: return "char"; case RTI_CDR_TK_OCTET: return "octet"; case RTI_CDR_TK_LONGLONG: return "longlong"; case RTI_CDR_TK_ULONGLONG: return "unsigned long long"; case RTI_CDR_TK_LONGDOUBLE: return "long double"; case RTI_CDR_TK_WCHAR: return "wchar"; case RTI_CDR_TK_WSTRING: return "wstring"; case RTI_CDR_TK_STRING: return "string"; case RTI_CDR_TK_SEQUENCE: return "sequence"; case RTI_CDR_TK_ARRAY: return "array"; case RTI_CDR_TK_ALIAS: return "alias"; case RTI_CDR_TK_VALUE: return "valuetype"; case RTI_CDR_TK_NULL: default: return ""; } } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as typecode info * Returns the number of bytes parsed */ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, gint offset, const guint encoding, int indent_level, int is_pointer, guint16 bitfield, int is_key, const gint offset_begin, char *name, int seq_max_len, /* -1 = not a sequence field */ guint32 *arr_dimension, /* if !NULL: array of 10 int */ int ndds_40_hack) { const gint original_offset = offset; guint32 tk_id; guint16 tk_size; unsigned int i; char *indent_string; gint retVal; char type_name[40]; /* Structure of the typecode data: * Offset | Size | Field | Notes * ----------|-------|------------------------------|--------------------- * ? | ? | pad? | * 0 | 4 | RTI_CDR_TK_XXXXX | 4 bytes aligned * 4 | 2 | length the struct | */ /* Calc indent string */ indent_string = (char *)wmem_alloc(wmem_epan_scope(), (indent_level*2)+1); memset(indent_string, ' ', (indent_level*2)+1); indent_string[indent_level*2] = '\0'; /* Gets TK ID */ LONG_ALIGN(offset); tk_id = tvb_get_guint32(tvb, offset, encoding); offset += 4; /* Gets TK size */ tk_size = tvb_get_guint16(tvb, offset, encoding); offset += 2; retVal = tk_size + 6; /* 6 = 4 (typecode ID) + 2 (size) */ /* The first bit of typecode is set to 1, clear it */ tk_id &= 0x7fffffff; /* HACK: NDDS 4.0 and NDDS 4.1 has different typecode ID list. * The ID listed in the RTI_CDR_TK_XXXXX are the one from NDDS 4.1 * In order to correctly dissect NDDS 4.0 packets containing typecode * information, we check if the ID of the element at level zero is a * struct or union. If not, it means we are dissecting a ndds 4.0 packet * (and we can decrement the ID to match the correct values). */ if (indent_level == 0) { if (tk_id == RTI_CDR_TK_OCTET) { ndds_40_hack = 1; } } if (ndds_40_hack) { ++tk_id; } g_strlcpy(type_name, rtps_util_typecode_id_to_string(tk_id), 40); /* Structure of the typecode data: * * ::= * * * * ::= long (0=TK_NULL, 1=TK_SHORT...) * ::= unsugned short * */ switch(tk_id) { /* Structure of the typecode data: * * ::= * * * * * * + * ::= * ::= unsigned short * ::= * ::= char+ * ::= unsigned long * ::= (char)0 * * ::= * *