/* 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 * * SPDX-License-Identifier: GPL-2.0-or-later * * ------------------------------------- * * 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 * * Vendor ID listing can be found at: * https://www.dds-foundation.org/dds-rtps-vendor-and-product-ids/ */ #include "config.h" #include #include #include #include "packet-rtps.h" #include #include #include #include #include #include #include #if defined(HAVE_ZLIB) && !defined(HAVE_ZLIBNG) #define ZLIB_CONST #define ZLIB_PREFIX(x) x #include typedef z_stream zlib_stream; #endif /* HAVE_ZLIB */ #ifdef HAVE_ZLIBNG #define ZLIB_PREFIX(x) zng_ ## x #include typedef zng_stream zlib_stream; #endif /* HAVE_ZLIBNG */ #include #include #include #include #include void proto_register_rtps(void); void proto_reg_handoff_rtps(void); #define MAX_GUID_PREFIX_SIZE (128) #define MAX_GUID_SIZE (160) #define GUID_SIZE (16) #define MAX_VENDOR_ID_SIZE (128) #define MAX_PARAM_SIZE (256) #define MAX_TIMESTAMP_SIZE (128) #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) #define DISSECTION_INFO_MAX_ELEMENTS_DEFAULT_VALUE (100) #define DISSECTION_INFO_ARRAY_MAX_ELEMENTS_DEFAULT_VALUE (100) #define DISSECTION_INFO_REMAINING_ELEMENTS_STR_d "... %d items(s) remaining. The number of items shown is configurable through RTPS properties under Preferences/Protocols." #define MAX_MEMBER_NAME (256) #define HASHMAP_DISCRIMINATOR_CONSTANT (-2) #define UUID_SIZE (9) #define LONG_ADDRESS_SIZE (16) #define INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS 7 #define SEQUENCE_100_IINSTANCE_TRANSITION_DATA_BOUND 100 #define INSTANCE_TRANSITION_DATA_NUM_ELEMENTS 4 #define GUID_T_NUM_ELEMENTS 1 #define VALUE_NUM_ELEMENTS 16 #define KEY_HAS_VALUE_NUM_ELEMENTS 16 #define NTPTIME_T_NUM_ELEMENTS 2 #define SEQUENCE_NUMBER_T_NUM_ELEMENTS 2 #define SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH 16 /* bytes. */ typedef struct _union_member_mapping { uint64_t union_type_id; uint64_t member_type_id; int32_t discriminator; char member_name[MAX_MEMBER_NAME]; } union_member_mapping; typedef struct _mutable_member_mapping { int64_t key; uint64_t struct_type_id; uint64_t member_type_id; uint32_t member_id; char member_name[MAX_MEMBER_NAME]; } mutable_member_mapping; typedef struct _dissection_element { uint64_t type_id; uint16_t flags; uint32_t member_id; char member_name[MAX_MEMBER_NAME]; } dissection_element; typedef enum { EXTENSIBILITY_INVALID = 1, EXTENSIBILITY_FINAL, EXTENSIBILITY_EXTENSIBLE, EXTENSIBILITY_MUTABLE } RTICdrTypeObjectExtensibility; typedef struct _dissection_info { uint64_t type_id; int member_kind; uint64_t base_type_id; uint32_t member_length; char member_name[MAX_MEMBER_NAME]; RTICdrTypeObjectExtensibility extensibility; int32_t bound; uint32_t num_elements; dissection_element* elements; } dissection_info; typedef struct _submessage_col_info { const char* status_info; const char* topic_name; const char* data_session_kind; } submessage_col_info; typedef enum { RTI_CDR_TK_NULL = 0, RTI_CDR_TK_SHORT, RTI_CDR_TK_LONG, RTI_CDR_TK_USHORT, RTI_CDR_TK_ULONG, RTI_CDR_TK_FLOAT, RTI_CDR_TK_DOUBLE, RTI_CDR_TK_BOOLEAN, RTI_CDR_TK_CHAR, RTI_CDR_TK_OCTET, RTI_CDR_TK_STRUCT, RTI_CDR_TK_UNION, RTI_CDR_TK_ENUM, RTI_CDR_TK_STRING, RTI_CDR_TK_SEQUENCE, RTI_CDR_TK_ARRAY, RTI_CDR_TK_ALIAS, RTI_CDR_TK_LONGLONG, RTI_CDR_TK_ULONGLONG, RTI_CDR_TK_LONGDOUBLE, RTI_CDR_TK_WCHAR, RTI_CDR_TK_WSTRING, RTI_CDR_TK_VALUE, RTI_CDR_TK_VALUE_PARAM } RTICdrTCKind; typedef enum { RTI_CDR_TYPE_OBJECT_TYPE_KIND_NO_TYPE=0, RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE=1, RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE=2, RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE=3, RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE=4, RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE=5, RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE=6, RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE=7, RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE=8, RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE=9, RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE=10, RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE=11, RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE=12, RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_32_TYPE=13, RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE=14, RTI_CDR_TYPE_OBJECT_TYPE_KIND_BITSET_TYPE=15, RTI_CDR_TYPE_OBJECT_TYPE_KIND_ALIAS_TYPE=16, RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE=17, RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE=18, RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRING_TYPE=19, RTI_CDR_TYPE_OBJECT_TYPE_KIND_MAP_TYPE=20, RTI_CDR_TYPE_OBJECT_TYPE_KIND_UNION_TYPE=21, RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE=22, RTI_CDR_TYPE_OBJECT_TYPE_KIND_ANNOTATION_TYPE=23, RTI_CDR_TYPE_OBJECT_TYPE_KIND_MODULE=24 } RTICdrTypeObjectTypeKind; typedef struct _rtps_dissector_data { uint16_t encapsulation_id; /* Represents the position of a sample within a batch. Since the position can be 0, we use -1 as not valid (not a batch) */ int position_in_batch; } rtps_dissector_data; typedef struct _rtps_tvb_field { tvbuff_t *tvb; int tvb_offset; int tvb_len; } rtps_tvb_field; 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 wmem_map_t * dissection_infos; static wmem_map_t * builtin_dissection_infos; static wmem_map_t * union_member_mappings; static wmem_map_t * mutable_member_mappings; /***************************************************************************/ /* Preferences */ /***************************************************************************/ static unsigned rtps_max_batch_samples_dissected = 16; static unsigned rtps_max_data_type_elements = DISSECTION_INFO_MAX_ELEMENTS_DEFAULT_VALUE; static unsigned rtps_max_array_data_type_elements = DISSECTION_INFO_ARRAY_MAX_ELEMENTS_DEFAULT_VALUE; static bool enable_topic_info = true; static bool enable_rtps_reassembly = false; static bool enable_user_data_dissection = false; static bool enable_max_array_data_type_elements = true; static bool enable_max_data_type_elements = true; static bool enable_rtps_crc_check = false; static bool enable_rtps_psk_decryption = false; static dissector_table_t rtps_type_name_table; /***************************************************************************/ /* Variable definitions */ /***************************************************************************/ #define RTPS_MAGIC_NUMBER 0x52545053 /* RTPS */ #define RTPX_MAGIC_NUMBER 0x52545058 /* RTPX */ #define RTPS_SEQUENCENUMBER_UNKNOWN 0xffffffff00000000 /* {-1,0} as uint64 */ #define RTPS_TOPIC_QUERY_SELECTION_KIND_HISTORY_SNAPSHOT 0 #define RTPS_TOPIC_QUERY_SELECTION_KIND_CONTINUOUS 1 /* Traffic type */ #define PORT_BASE (7400) #define DOMAIN_GAIN (250) #define PORT_METATRAFFIC_UNICAST (0) #define PORT_USERTRAFFIC_MULTICAST (1) #define PORT_METATRAFFIC_MULTICAST (2) #define PORT_USERTRAFFIC_UNICAST (3) /* Flags defined in the 'flag' bitmask of a submessage */ #define FLAG_E (0x01) /* Common to all the submessages */ #define FLAG_DATA_D (0x02) #define FLAG_DATA_D_v2 (0x04) #define FLAG_DATA_A (0x04) #define FLAG_DATA_H (0x08) #define FLAG_DATA_Q (0x10) #define FLAG_DATA_Q_v2 (0x02) #define FLAG_DATA_FRAG_Q (0x02) #define FLAG_DATA_FRAG_H (0x04) #define FLAG_DATA_I (0x10) #define FLAG_DATA_U (0x20) #define FLAG_NOKEY_DATA_Q (0x02) #define FLAG_NOKEY_DATA_D (0x04) #define FLAG_ACKNACK_F (0x02) #define FLAG_HEARTBEAT_F (0x02) #define FLAG_GAP_F (0x02) #define FLAG_INFO_TS_T (0x02) #define FLAG_INFO_REPLY_IP4_M (0x02) #define FLAG_INFO_REPLY_M (0x02) #define FLAG_RTPS_DATA_Q (0x02) #define FLAG_RTPS_DATA_D (0x04) #define FLAG_RTPS_DATA_K (0x08) #define FLAG_RTPS_DATA_FRAG_Q (0x02) #define FLAG_RTPS_DATA_FRAG_K (0x04) #define FLAG_RTPS_DATA_BATCH_Q (0x02) #define FLAG_SAMPLE_INFO_T (0x01) #define FLAG_SAMPLE_INFO_Q (0x02) #define FLAG_SAMPLE_INFO_O (0x04) #define FLAG_SAMPLE_INFO_D (0x08) #define FLAG_SAMPLE_INFO_I (0x10) #define FLAG_SAMPLE_INFO_K (0x20) #define FLAG_VIRTUAL_HEARTBEAT_V (0x02) #define FLAG_VIRTUAL_HEARTBEAT_W (0x04) #define FLAG_VIRTUAL_HEARTBEAT_N (0x08) /* UDPv4 WAN Transport locator flags */ #define FLAG_UDPV4_WAN_LOCATOR_U (0x01) #define FLAG_UDPV4_WAN_LOCATOR_P (0x02) #define FLAG_UDPV4_WAN_LOCATOR_B (0x04) #define FLAG_UDPV4_WAN_LOCATOR_R (0x08) /* UDP WAN BINDING_PING submessage flags */ #define FLAG_UDPV4_WAN_BINDING_PING_FLAG_E (0x01) #define FLAG_UDPV4_WAN_BINDING_PING_FLAG_L (0x02) #define FLAG_UDPV4_WAN_BINDING_PING_FLAG_B (0x04) /* The following PIDs are defined since RTPS 1.0 */ #define PID_PAD (0x00) #define PID_SENTINEL (0x01) #define PID_PARTICIPANT_LEASE_DURATION (0x02) #define PID_TIME_BASED_FILTER (0x04) #define PID_TOPIC_NAME (0x05) #define PID_OWNERSHIP_STRENGTH (0x06) #define PID_TYPE_NAME (0x07) #define PID_METATRAFFIC_MULTICAST_IPADDRESS (0x0b) #define PID_DEFAULT_UNICAST_IPADDRESS (0x0c) #define PID_METATRAFFIC_UNICAST_PORT (0x0d) #define PID_DEFAULT_UNICAST_PORT (0x0e) #define PID_MULTICAST_IPADDRESS (0x11) #define PID_PROTOCOL_VERSION (0x15) #define PID_VENDOR_ID (0x16) #define PID_RELIABILITY (0x1a) #define PID_LIVELINESS (0x1b) #define PID_DURABILITY (0x1d) #define PID_DURABILITY_SERVICE (0x1e) #define PID_OWNERSHIP (0x1f) #define PID_PRESENTATION (0x21) #define PID_DEADLINE (0x23) #define PID_DESTINATION_ORDER (0x25) #define PID_LATENCY_BUDGET (0x27) #define PID_PARTITION (0x29) #define PID_LIFESPAN (0x2b) #define PID_USER_DATA (0x2c) #define PID_GROUP_DATA (0x2d) #define PID_TOPIC_DATA (0x2e) #define PID_UNICAST_LOCATOR (0x2f) #define PID_MULTICAST_LOCATOR (0x30) #define PID_DEFAULT_UNICAST_LOCATOR (0x31) #define PID_METATRAFFIC_UNICAST_LOCATOR (0x32) #define PID_METATRAFFIC_MULTICAST_LOCATOR (0x33) #define PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT (0x34) #define PID_CONTENT_FILTER_PROPERTY (0x35) #define PID_PROPERTY_LIST_OLD (0x36) /* For compatibility between 4.2d and 4.2e */ #define PID_HISTORY (0x40) #define PID_RESOURCE_LIMIT (0x41) #define PID_EXPECTS_INLINE_QOS (0x43) #define PID_PARTICIPANT_BUILTIN_ENDPOINTS (0x44) #define PID_METATRAFFIC_UNICAST_IPADDRESS (0x45) #define PID_METATRAFFIC_MULTICAST_PORT (0x46) #define PID_TYPECODE (0x47) #define PID_PARTICIPANT_GUID (0x50) #define PID_PARTICIPANT_ENTITY_ID (0x51) #define PID_GROUP_GUID (0x52) #define PID_GROUP_ENTITY_ID (0x53) #define PID_FILTER_SIGNATURE (0x55) #define PID_COHERENT_SET (0x56) #define PID_GROUP_COHERENT_SET (0x0063) #define PID_END_COHERENT_SET (0x8022) #define PID_END_GROUP_COHERENT_SET (0x8023) #define MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT (0x8024) /* The following QoS are deprecated */ #define PID_PERSISTENCE (0x03) #define PID_TYPE_CHECKSUM (0x08) #define PID_TYPE2_NAME (0x09) #define PID_TYPE2_CHECKSUM (0x0a) #define PID_EXPECTS_ACK (0x10) #define PID_MANAGER_KEY (0x12) #define PID_SEND_QUEUE_SIZE (0x13) #define PID_RELIABILITY_ENABLED (0x14) #define PID_RECV_QUEUE_SIZE (0x18) #define PID_VARGAPPS_SEQUENCE_NUMBER_LAST (0x17) #define PID_RELIABILITY_OFFERED (0x19) #define PID_LIVELINESS_OFFERED (0x1c) #define PID_OWNERSHIP_OFFERED (0x20) #define PID_PRESENTATION_OFFERED (0x22) #define PID_DEADLINE_OFFERED (0x24) #define PID_DESTINATION_ORDER_OFFERED (0x26) #define PID_LATENCY_BUDGET_OFFERED (0x28) #define PID_PARTITION_OFFERED (0x2a) /* The following PIDs are defined since RTPS 2.0 */ #define PID_DEFAULT_MULTICAST_LOCATOR (0x0048) #define PID_TRANSPORT_PRIORITY (0x0049) #define PID_CONTENT_FILTER_INFO (0x0055) #define PID_DIRECTED_WRITE (0x0057) #define PID_BUILTIN_ENDPOINT_SET (0x0058) #define PID_PROPERTY_LIST (0x0059) /* RTI DDS 4.2e and newer */ #define PID_ENDPOINT_GUID (0x005a) #define PID_TYPE_MAX_SIZE_SERIALIZED (0x0060) #define PID_ORIGINAL_WRITER_INFO (0x0061) #define PID_ENTITY_NAME (0x0062) #define PID_KEY_HASH (0x0070) #define PID_STATUS_INFO (0x0071) #define PID_TYPE_OBJECT (0x0072) #define PID_DATA_REPRESENTATION (0x0073) #define PID_TYPE_CONSISTENCY (0x0074) #define PID_EQUIVALENT_TYPE_NAME (0x0075) #define PID_BASE_TYPE_NAME (0x0076) #define PID_BUILTIN_ENDPOINT_QOS (0x0077) #define PID_ENABLE_AUTHENTICATION (0x0078) #define PID_RELATED_ENTITY_GUID (0x0081) #define PID_RELATED_ORIGINAL_WRITER_INFO (0x0083)/* inline QoS */ #define PID_DOMAIN_ID (0x000f) #define PID_DOMAIN_TAG (0x4014) /* Vendor-specific: RTI */ #define PID_PRODUCT_VERSION (0x8000) #define PID_PLUGIN_PROMISCUITY_KIND (0x8001) #define PID_ENTITY_VIRTUAL_GUID (0x8002) #define PID_SERVICE_KIND (0x8003) #define PID_TYPECODE_RTPS2 (0x8004) /* Was: 0x47 in RTPS 1.2 */ #define PID_DISABLE_POSITIVE_ACKS (0x8005) #define PID_LOCATOR_FILTER_LIST (0x8006) #define PID_EXPECTS_VIRTUAL_HB (0x8009) #define PID_ROLE_NAME (0x800a) #define PID_ACK_KIND (0x800b) #define PID_PEER_HOST_EPOCH (0x800e) #define PID_RELATED_ORIGINAL_WRITER_INFO_LEGACY (0x800f)/* inline QoS */ #define PID_RTI_DOMAIN_ID (0x800f) #define PID_RELATED_READER_GUID (0x8010)/* inline QoS */ #define PID_TRANSPORT_INFO_LIST (0x8010) #define PID_SOURCE_GUID (0x8011)/* inline QoS */ #define PID_DIRECT_COMMUNICATION (0x8011) #define PID_RELATED_SOURCE_GUID (0x8012)/* inline QoS */ #define PID_TOPIC_QUERY_GUID (0x8013)/* inline QoS */ #define PID_TOPIC_QUERY_PUBLICATION (0x8014) #define PID_ENDPOINT_PROPERTY_CHANGE_EPOCH (0x8015) #define PID_REACHABILITY_LEASE_DURATION (0x8016) #define PID_VENDOR_BUILTIN_ENDPOINT_SET (0x8017) #define PID_ENDPOINT_SECURITY_ATTRIBUTES (0x8018) #define PID_SAMPLE_SIGNATURE (0x8019)/* inline QoS */ #define PID_EXTENDED (0x3f01) #define PID_LIST_END (0x3f02) #define PID_UNICAST_LOCATOR_EX (0x8007) #define PID_IDENTITY_TOKEN (0x1001) #define PID_PERMISSIONS_TOKEN (0x1002) #define PID_DATA_TAGS (0x1003) #define PID_ENDPOINT_SECURITY_INFO (0x1004) #define PID_PARTICIPANT_SECURITY_INFO (0x1005) #define PID_IDENTITY_STATUS_TOKEN (0x1006) #define PID_PARTICIPANT_SECURITY_DIGITAL_SIGNATURE_ALGO (0x1010) #define PID_PARTICIPANT_SECURITY_KEY_ESTABLISHMENT_ALGO (0x1011) #define PID_PARTICIPANT_SECURITY_SYMMETRIC_CIPHER_ALGO (0x1012) #define PID_ENDPOINT_SECURITY_SYMMETRIC_CIPHER_ALGO (0x1013) #define PID_TYPE_OBJECT_LB (0x8021) /* Vendor-specific: ADLink */ #define PID_ADLINK_WRITER_INFO (0x8001) #define PID_ADLINK_READER_DATA_LIFECYCLE (0x8002) #define PID_ADLINK_WRITER_DATA_LIFECYCLE (0x8003) #define PID_ADLINK_ENDPOINT_GUID (0x8004) #define PID_ADLINK_SYNCHRONOUS_ENDPOINT (0x8005) #define PID_ADLINK_RELAXED_QOS_MATCHING (0x8006) #define PID_ADLINK_PARTICIPANT_VERSION_INFO (0x8007) #define PID_ADLINK_NODE_NAME (0x8008) #define PID_ADLINK_EXEC_NAME (0x8009) #define PID_ADLINK_PROCESS_ID (0x800a) #define PID_ADLINK_SERVICE_TYPE (0x800b) #define PID_ADLINK_ENTITY_FACTORY (0x800c) #define PID_ADLINK_WATCHDOG_SCHEDULING (0x800d) #define PID_ADLINK_LISTENER_SCHEDULING (0x800e) #define PID_ADLINK_SUBSCRIPTION_KEYS (0x800f) #define PID_ADLINK_READER_LIFESPAN (0x8010) #define PID_ADLINK_SHARE (0x8011) #define PID_ADLINK_TYPE_DESCRIPTION (0x8012) #define PID_ADLINK_LAN_ID (0x8013) #define PID_ADLINK_ENDPOINT_GID (0x8014) #define PID_ADLINK_GROUP_GID (0x8015) #define PID_ADLINK_EOTINFO (0x8016) #define PID_ADLINK_PART_CERT_NAME (0x8017) #define PID_ADLINK_LAN_CERT_NAME (0x8018) /* appId.appKind possible values */ #define APPKIND_UNKNOWN (0x00) #define APPKIND_MANAGED_APPLICATION (0x01) #define APPKIND_MANAGER (0x02) #define RTI_SERVICE_REQUEST_ID_UNKNOWN 0 #define RTI_SERVICE_REQUEST_ID_TOPIC_QUERY 1 #define RTI_SERVICE_REQUEST_ID_LOCATOR_REACHABILITY 2 #define RTI_SERVICE_REQUEST_ID_INSTANCE_STATE 3 /* Predefined EntityId */ #define ENTITYID_UNKNOWN (0x00000000) #define ENTITYID_PARTICIPANT (0x000001c1) #define ENTITYID_BUILTIN_TOPIC_WRITER (0x000002c2) #define ENTITYID_BUILTIN_TOPIC_READER (0x000002c7) #define ENTITYID_BUILTIN_PUBLICATIONS_WRITER (0x000003c2) #define ENTITYID_BUILTIN_PUBLICATIONS_READER (0x000003c7) #define ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER (0x000004c2) #define ENTITYID_BUILTIN_SUBSCRIPTIONS_READER (0x000004c7) #define ENTITYID_BUILTIN_PARTICIPANT_WRITER (0x000100c2) #define ENTITYID_BUILTIN_PARTICIPANT_READER (0x000100c7) #define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER (0x000200c2) #define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER (0x000200c7) #define ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER (0x00010082) #define ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER (0x00010087) #define ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER (0x00010182) #define ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER (0x00010187) #define ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER (0xff010182) #define ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER (0xff010187) #define ENTITYID_RESERVED_META_CST_GROUP_WRITER (0xcb) #define ENTITYID_RESERVED_META_GROUP_WRITER (0xcc) #define ENTITYID_RESERVED_META_GROUP_READER (0xcd) #define ENTITYID_RESERVED_META_CST_GROUP_READER (0xce) #define ENTITYID_OBJECT_NORMAL_META_WRITER_GROUP (0x88) #define ENTITYID_OBJECT_NORMAL_META_READER_GROUP (0x89) #define ENTITYID_OBJECT_NORMAL_META_TOPIC (0x8a) #define ENTITYID_NORMAL_META_CST_GROUP_WRITER (0x8b) #define ENTITYID_NORMAL_META_GROUP_WRITER (0x8c) #define ENTITYID_NORMAL_META_GROUP_READER (0x8d) #define ENTITYID_NORMAL_META_CST_GROUP_READER (0x8e) #define ENTITYID_RESERVED_USER_CST_GROUP_WRITER (0x4b) #define ENTITYID_RESERVED_USER_GROUP_WRITER (0x4c) #define ENTITYID_RESERVED_USER_GROUP_READER (0x4d) #define ENTITYID_RESERVED_USER_CST_GROUP_READER (0x4e) #define ENTITYID_NORMAL_USER_CST_GROUP_WRITER (0x0b) #define ENTITYID_NORMAL_USER_GROUP_WRITER (0x0c) #define ENTITYID_NORMAL_USER_GROUP_READER (0x0d) #define ENTITYID_NORMAL_USER_CST_GROUP_READER (0x0e) /* Secure DDS */ #define ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER (0x000201c3) #define ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER (0x000201c4) #define ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER (0xff0003c2) #define ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER (0xff0003c7) #define ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER (0xff0004c2) #define ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER (0xff0004c7) #define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER (0xff0200c2) #define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER (0xff0200c7) #define ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER (0xff0202c3) #define ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER (0xff0202c4) #define ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER (0xff0101c2) #define ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER (0xff0101c7) /* Vendor-specific: RTI */ #define ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER (0x00020082) #define ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER (0x00020087) #define ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER (0x00020182) #define ENTITYID_RTI_BUILTIN_LOCATOR_PING_READER (0x00020187) /* Deprecated EntityId */ #define ENTITYID_APPLICATIONS_WRITER (0x000001c2) #define ENTITYID_APPLICATIONS_READER (0x000001c7) #define ENTITYID_CLIENTS_WRITER (0x000005c2) #define ENTITYID_CLIENTS_READER (0x000005c7) #define ENTITYID_SERVICES_WRITER (0x000006c2) #define ENTITYID_SERVICES_READER (0x000006c7) #define ENTITYID_MANAGERS_WRITER (0x000007c2) #define ENTITYID_MANAGERS_READER (0x000007c7) #define ENTITYID_APPLICATION_SELF (0x000008c1) #define ENTITYID_APPLICATION_SELF_WRITER (0x000008c2) #define ENTITYID_APPLICATION_SELF_READER (0x000008c7) /* Predefined Entity Kind */ #define ENTITYKIND_APPDEF_UNKNOWN (0x00) #define ENTITYKIND_APPDEF_PARTICIPANT (0x01) #define ENTITYKIND_APPDEF_WRITER_WITH_KEY (0x02) #define ENTITYKIND_APPDEF_WRITER_NO_KEY (0x03) #define ENTITYKIND_APPDEF_READER_NO_KEY (0x04) #define ENTITYKIND_APPDEF_READER_WITH_KEY (0x07) #define ENTITYKIND_BUILTIN_PARTICIPANT (0xc1) #define ENTITYKIND_BUILTIN_WRITER_WITH_KEY (0xc2) #define ENTITYKIND_BUILTIN_WRITER_NO_KEY (0xc3) #define ENTITYKIND_BUILTIN_READER_NO_KEY (0xc4) #define ENTITYKIND_BUILTIN_READER_WITH_KEY (0xc7) /* vendor specific RTI */ #define ENTITYKIND_RTI_BUILTIN_WRITER_WITH_KEY (0x82) #define ENTITYKIND_RTI_BUILTIN_WRITER_NO_KEY (0x83) #define ENTITYKIND_RTI_BUILTIN_READER_NO_KEY (0x84) #define ENTITYKIND_RTI_BUILTIN_READER_WITH_KEY (0x87) /* Submessage Type */ #define SUBMESSAGE_HEADER_EXTENSION (0x0) #define SUBMESSAGE_PAD (0x01) #define SUBMESSAGE_DATA (0x02) #define SUBMESSAGE_NOKEY_DATA (0x03) #define SUBMESSAGE_ACKNACK (0x06) #define SUBMESSAGE_HEARTBEAT (0x07) #define SUBMESSAGE_GAP (0x08) #define SUBMESSAGE_INFO_TS (0x09) #define SUBMESSAGE_INFO_SRC (0x0c) #define SUBMESSAGE_INFO_REPLY_IP4 (0x0d) #define SUBMESSAGE_INFO_DST (0x0e) #define SUBMESSAGE_INFO_REPLY (0x0f) #define SUBMESSAGE_DATA_FRAG (0x10) /* RTPS 2.0 Only */ #define SUBMESSAGE_NOKEY_DATA_FRAG (0x11) /* RTPS 2.0 Only */ #define SUBMESSAGE_NACK_FRAG (0x12) /* RTPS 2.0 Only */ #define SUBMESSAGE_HEARTBEAT_FRAG (0x13) /* RTPS 2.0 Only */ #define SUBMESSAGE_RTPS_DATA_SESSION (0x14) /* RTPS 2.1 only */ #define SUBMESSAGE_RTPS_DATA (0x15) /* RTPS 2.1 only */ #define SUBMESSAGE_RTPS_DATA_FRAG (0x16) /* RTPS 2.1 only */ #define SUBMESSAGE_ACKNACK_BATCH (0x17) /* RTPS 2.1 only */ #define SUBMESSAGE_RTPS_DATA_BATCH (0x18) /* RTPS 2.1 Only */ #define SUBMESSAGE_HEARTBEAT_BATCH (0x19) /* RTPS 2.1 only */ #define SUBMESSAGE_ACKNACK_SESSION (0x1a) /* RTPS 2.1 only */ #define SUBMESSAGE_HEARTBEAT_SESSION (0x1b) /* RTPS 2.1 only */ #define SUBMESSAGE_APP_ACK (0x1c) #define SUBMESSAGE_APP_ACK_CONF (0x1d) #define SUBMESSAGE_HEARTBEAT_VIRTUAL (0x1e) #define SUBMESSAGE_SEC_BODY (0x30) #define SUBMESSAGE_SEC_PREFIX (0x31) #define SUBMESSAGE_SEC_POSTFIX (0x32) #define SUBMESSAGE_SRTPS_PREFIX (0x33) #define SUBMESSAGE_SRTPS_POSTFIX (0x34) #define SUBMESSAGE_RTI_CRC (0x80) #define SUBMESSAGE_RTI_DATA_FRAG_SESSION (0x81) /* Vendor Specific */ #define SUBMESSAGE_RTI_UDP_WAN_BINDING_PING (0x82) /* An invalid IP Address: * Make sure the _STRING macro is bigger than a normal IP */ #define IPADDRESS_INVALID (0) #define IPADDRESS_INVALID_STRING "ADDRESS_INVALID" /* Identifies the value of an invalid port number: * Make sure the _STRING macro is bigger than a normal port */ #define PORT_INVALID (0) #define PORT_INVALID_STRING "PORT_INVALID" /* Protocol Vendor Information (uint16_t) as per July 2020 */ #define RTPS_VENDOR_UNKNOWN (0x0000) #define RTPS_VENDOR_UNKNOWN_STRING "VENDOR_ID_UNKNOWN (0x0000)" #define RTPS_VENDOR_RTI_DDS (0x0101) #define RTPS_VENDOR_RTI_DDS_STRING "Real-Time Innovations, Inc. - Connext DDS" #define RTPS_VENDOR_ADL_DDS (0x0102) #define RTPS_VENDOR_ADL_DDS_STRING "ADLink Ltd. - OpenSplice DDS" #define RTPS_VENDOR_OCI (0x0103) #define RTPS_VENDOR_OCI_STRING "Object Computing, Inc. (OCI) - OpenDDS" #define RTPS_VENDOR_MILSOFT (0x0104) #define RTPS_VENDOR_MILSOFT_STRING "MilSoft" #define RTPS_VENDOR_KONGSBERG (0x0105) #define RTPS_VENDOR_KONGSBERG_STRING "Kongsberg - InterCOM DDS" #define RTPS_VENDOR_TOC (0x0106) #define RTPS_VENDOR_TOC_STRING "TwinOaks Computing, Inc. - CoreDX DDS" #define RTPS_VENDOR_LAKOTA_TSI (0x0107) #define RTPS_VENDOR_LAKOTA_TSI_STRING "Lakota Technical Solutions, Inc." #define RTPS_VENDOR_ICOUP (0x0108) #define RTPS_VENDOR_ICOUP_STRING "ICOUP Consulting" #define RTPS_VENDOR_ETRI (0x0109) #define RTPS_VENDOR_ETRI_STRING "Electronics and Telecommunication Research Institute (ETRI) - Diamond DDS" #define RTPS_VENDOR_RTI_DDS_MICRO (0x010A) #define RTPS_VENDOR_RTI_DDS_MICRO_STRING "Real-Time Innovations, Inc. (RTI) - Connext DDS Micro" #define RTPS_VENDOR_ADL_CAFE (0x010B) #define RTPS_VENDOR_ADL_CAFE_STRING "ADLink Ltd. - Vortex Cafe" #define RTPS_VENDOR_PT (0x010C) #define RTPS_VENDOR_PT_STRING "PrismTech" #define RTPS_VENDOR_ADL_LITE (0x010D) #define RTPS_VENDOR_ADL_LITE_STRING "ADLink Ltd. - Vortex Lite" #define RTPS_VENDOR_TECHNICOLOR (0x010E) #define RTPS_VENDOR_TECHNICOLOR_STRING "Technicolor Inc. - Qeo" #define RTPS_VENDOR_EPROSIMA (0x010F) #define RTPS_VENDOR_EPROSIMA_STRING "eProsima - Fast-RTPS" #define RTPS_VENDOR_ECLIPSE (0x0110) #define RTPS_VENDOR_ECLIPSE_STRING "Eclipse Foundation - Cyclone DDS" #define RTPS_VENDOR_GURUM (0x0111) #define RTPS_VENDOR_GURUM_STRING "GurumNetworks Ltd. - GurumDDS" #define RTPS_VENDOR_RUST (0x0112) #define RTPS_VENDOR_RUST_STRING "Atostek - RustDDS" #define RTPS_VENDOR_ZRDDS (0x0113) #define RTPS_VENDOR_ZRDDS_STRING "Nanjing Zhenrong Software Technology Co. - ZRDDS" #define RTPS_VENDOR_DUST (0x0114) #define RTPS_VENDOR_DUST_STRING "S2E Software Systems B.V. - Dust DDS" /* Data encapsulation */ #define ENCAPSULATION_CDR_BE (0x0000) #define ENCAPSULATION_CDR_LE (0x0001) #define ENCAPSULATION_PL_CDR_BE (0x0002) #define ENCAPSULATION_PL_CDR_LE (0x0003) #define ENCAPSULATION_CDR2_BE (0x0006) #define ENCAPSULATION_CDR2_LE (0x0007) #define ENCAPSULATION_D_CDR2_BE (0x0008) #define ENCAPSULATION_D_CDR2_LE (0x0009) #define ENCAPSULATION_PL_CDR2_BE (0x000a) #define ENCAPSULATION_PL_CDR2_LE (0x000b) #define ENCAPSULATION_SHMEM_REF_PLAIN (0xC000) #define ENCAPSULATION_SHMEM_REF_FLAT_DATA (0xC001) /* Data encapsulation options */ #define ENCAPSULATION_OPTIONS_COMPRESSION_BYTES_MASK (0x1C) #define GET_ENCAPSULATION_COMPRESSION_OPTIONS(encapsulation_options_in, compression_options_out) \ (compression_options_out = (((encapsulation_options_in) & (ENCAPSULATION_OPTIONS_COMPRESSION_BYTES_MASK)) >> 2)) #define ENCAPSULATION_OPTIONS_COMPRESSION_EXTENDED_HEADER_VALUE ENCAPSULATION_OPTIONS_COMPRESSION_BYTES_MASK #define ENCAPSULATION_OPTIONS_COMPRESSION_PADDING_BYTES_MASK (0x3) /* Parameter Liveliness */ #define LIVELINESS_AUTOMATIC (0) #define LIVELINESS_BY_PARTICIPANT (1) #define LIVELINESS_BY_TOPIC (2) /* Parameter Durability */ #define DURABILITY_VOLATILE (0) #define DURABILITY_TRANSIENT_LOCAL (1) #define DURABILITY_TRANSIENT (2) #define DURABILITY_PERSISTENT (3) /* Parameter Ownership */ #define OWNERSHIP_SHARED (0) #define OWNERSHIP_EXCLUSIVE (1) /* Parameter Presentation */ #define PRESENTATION_INSTANCE (0) #define PRESENTATION_TOPIC (1) #define PRESENTATION_GROUP (2) #define LOCATOR_KIND_INVALID (-1) #define LOCATOR_KIND_RESERVED (0) #define LOCATOR_KIND_UDPV4 (1) #define LOCATOR_KIND_UDPV6 (2) /* Vendor specific - rti */ #define LOCATOR_KIND_DTLS (6) #define LOCATOR_KIND_TCPV4_LAN (8) #define LOCATOR_KIND_TCPV4_WAN (9) #define LOCATOR_KIND_TLSV4_LAN (10) #define LOCATOR_KIND_TLSV4_WAN (11) #define LOCATOR_KIND_SHMEM (0x01000000) #define LOCATOR_KIND_TUDPV4 (0x01001001) #define LOCATOR_KIND_UDPV4_WAN (0x01000001) /* History Kind */ #define HISTORY_KIND_KEEP_LAST (0) #define HISTORY_KIND_KEEP_ALL (1) /* Reliability Values */ #define RELIABILITY_BEST_EFFORT (1) #define RELIABILITY_RELIABLE (2) /* Destination Order */ #define BY_RECEPTION_TIMESTAMP (0) #define BY_SOURCE_TIMESTAMP (1) /* Member flags */ #define MEMBER_IS_KEY (1) #define MEMBER_OPTIONAL (2) #define MEMBER_SHAREABLE (4) #define MEMBER_UNION_DEFAULT (8) /* Participant message data kind */ #define PARTICIPANT_MESSAGE_DATA_KIND_UNKNOWN (0x00000000) #define PARTICIPANT_MESSAGE_DATA_KIND_AUTOMATIC_LIVELINESS_UPDATE (0x00000001) #define PARTICIPANT_MESSAGE_DATA_KIND_MANUAL_LIVELINESS_UPDATE (0x00000002) /* Type Consistency Kinds */ #define DISALLOW_TYPE_COERCION (0) #define ALLOW_TYPE_COERCION (1) /* Ack kind */ #define PROTOCOL_ACKNOWLEDGMENT (0) #define APPLICATION_AUTO_ACKNOWLEDGMENT (1) #define APPLICATION_ORDERED_ACKNOWLEDGMENT (2) #define APPLICATION_EXPLICIT_ACKNOWLEDGMENT (3) #define CRYPTO_TRANSFORMATION_KIND_NONE (0) #define CRYPTO_TRANSFORMATION_KIND_AES128_GMAC (1) #define CRYPTO_TRANSFORMATION_KIND_AES128_GCM (2) #define CRYPTO_TRANSFORMATION_KIND_AES256_GMAC (3) #define CRYPTO_TRANSFORMATION_KIND_AES256_GCM (4) #define SECURITY_SYMMETRIC_CIPHER_BIT_AES128_GCM 0x00000001 #define SECURITY_SYMMETRIC_CIPHER_BIT_AES256_GCM 0x00000002 #define SECURITY_SYMMETRIC_CIPHER_BIT_CUSTOM_ALGORITHM 0x40000000 #define SECURITY_DIGITAL_SIGNATURE_BIT_RSASSAPSSMGF1SHA256_2048_SHA256 0x00000001 #define SECURITY_DIGITAL_SIGNATURE_BIT_RSASSAPKCS1V15_2048_SHA256 0x00000002 #define SECURITY_DIGITAL_SIGNATURE_BIT_ECDSA_P256_SHA256 0x00000004 #define SECURITY_DIGITAL_SIGNATURE_BIT_ECDSA_P384_SHA384 0x00000008 #define SECURITY_DIGITAL_SIGNATURE_BIT_CUSTOM_ALGORITHM 0x40000000 #define SECURITY_KEY_ESTABLISHMENT_BIT_DHE_MODP2048256 0x00000001 #define SECURITY_KEY_ESTABLISHMENT_BIT_ECDHECEUM_P256 0x00000002 #define SECURITY_KEY_ESTABLISHMENT_BIT_ECDHECEUM_P384 0x00000004 #define SECURITY_KEY_ESTABLISHMENT_BIT_CUSTOM_ALGORITHM 0x40000000 #define SECURITY_ALGORITHM_BIT_COMPATIBILITY_MODE 0x80000000 #define TOPIC_INFO_ADD_GUID (0x01) #define TOPIC_INFO_ADD_TYPE_NAME (0x02) #define TOPIC_INFO_ADD_TOPIC_NAME (0x04) #define TOPIC_INFO_ALL_SET (0x07) #define NOT_A_FRAGMENT (-1) /* */ #define RTI_OSAPI_COMPRESSION_CLASS_ID_NONE (0) #define RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB (1) #define RTI_OSAPI_COMPRESSION_CLASS_ID_BZIP2 (2) #define RTI_OSAPI_COMPRESSION_CLASS_ID_LZ4 (4) #define RTI_OSAPI_COMPRESSION_CLASS_ID_AUTO (UINT32_MAX) /* VENDOR_BUILTIN_ENDPOINT_SET FLAGS */ #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_WRITER (0x00000001U << 7) #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_READER (0x00000001U << 8) #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_SECURE_WRITER (0x00000001U << 9) #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_SECURE_READER (0x00000001U << 10) #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_PERIODIC_WRITER (0x00000001U << 11) #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_PERIODIC_READER (0x00000001U << 12) #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_EVENT_WRITER (0x00000001U << 13) #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_EVENT_READER (0x00000001U << 14) #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_LOGGING_WRITER (0x00000001U << 15) #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_LOGGING_READER (0x00000001U << 16) #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_BOOTSTRAP_WRITER (0x00000001U << 17) #define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_BOOTSTRAP_READER (0x00000001U << 18) static int hf_rtps_dissection_boolean; static int hf_rtps_dissection_byte; static int hf_rtps_dissection_int16; static int hf_rtps_dissection_uint16; static int hf_rtps_dissection_int32; static int hf_rtps_dissection_uint32; static int hf_rtps_dissection_int64; static int hf_rtps_dissection_uint64; static int hf_rtps_dissection_float; static int hf_rtps_dissection_double; static int hf_rtps_dissection_int128; static int hf_rtps_dissection_string; 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; static int hf_rtps_magic; static int hf_rtps_ping; static int hf_rtps_protocol_version; static int hf_rtps_protocol_version_major; static int hf_rtps_protocol_version_minor; static int hf_rtps_vendor_id; static int hf_rtps_domain_id; static int hf_rtps_domain_tag; static int hf_rtps_participant_idx; static int hf_rtps_nature_type; static int hf_rtps_guid_prefix_v1; static int hf_rtps_guid_prefix; static int hf_rtps_guid_prefix_src; static int hf_rtps_guid_prefix_dst; static int hf_rtps_host_id; static int hf_rtps_app_id; static int hf_rtps_app_id_instance_id; static int hf_rtps_app_id_app_kind; static int hf_rtps_sm_id; static int hf_rtps_sm_idv2; static int hf_rtps_sm_flags; static int hf_rtps_sm_flags2; static int hf_rtps_sm_octets_to_next_header; static int hf_rtps_sm_guid_prefix_v1; static int hf_rtps_sm_guid_prefix; static int hf_rtps_sm_host_id; static int hf_rtps_sm_app_id; static int hf_rtps_sm_instance_id_v1; static int hf_rtps_sm_app_kind; static int hf_rtps_sm_instance_id; static int hf_rtps_sm_entity_id; static int hf_rtps_sm_entity_id_key; static int hf_rtps_sm_entity_id_kind; static int hf_rtps_sm_rdentity_id; static int hf_rtps_sm_rdentity_id_key; static int hf_rtps_sm_rdentity_id_kind; static int hf_rtps_sm_wrentity_id; static int hf_rtps_sm_wrentity_id_key; static int hf_rtps_sm_wrentity_id_kind; static int hf_rtps_sm_seq_number; static int hf_rtps_info_src_ip; static int hf_rtps_info_src_unused; static int hf_rtps_parameter_id; static int hf_rtps_parameter_id_v2; static int hf_rtps_parameter_id_inline_rti; static int hf_rtps_parameter_id_toc; static int hf_rtps_parameter_id_rti; static int hf_rtps_parameter_id_adl; static int hf_rtps_parameter_length; static int hf_rtps_string_length; static int hf_rtps_coherent_set_start; static int hf_rtps_coherent_set_end; static int hf_rtps_param_topic_name; static int hf_rtps_param_strength; static int hf_rtps_param_type_name; static int hf_rtps_param_user_data; static int hf_rtps_param_group_data; static int hf_rtps_param_topic_data; static int hf_rtps_param_content_filter_topic_name; static int hf_rtps_param_related_topic_name; static int hf_rtps_param_filter_class_name; static int hf_rtps_issue_data; static int hf_rtps_durability_service_cleanup_delay; static int hf_rtps_liveliness_lease_duration; static int hf_rtps_participant_lease_duration; static int hf_rtps_time_based_filter_minimum_separation; static int hf_rtps_reliability_max_blocking_time; static int hf_rtps_deadline_period; static int hf_rtps_latency_budget_duration; static int hf_rtps_lifespan_duration; static int hf_rtps_persistence; static int hf_rtps_info_ts_timestamp; static int hf_rtps_timestamp; static int hf_rtps_locator_kind; static int hf_rtps_locator_port; /* static int hf_rtps_logical_port; */ static int hf_rtps_locator_public_address_port; static int hf_rtps_locator_ipv4; static int hf_rtps_locator_ipv6; static int hf_rtps_participant_builtin_endpoints; static int hf_rtps_participant_manual_liveliness_count; static int hf_rtps_history_depth; static int hf_rtps_resource_limit_max_samples; static int hf_rtps_resource_limit_max_instances; static int hf_rtps_resource_limit_max_samples_per_instances; static int hf_rtps_filter_bitmap; static int hf_rtps_type_checksum; static int hf_rtps_queue_size; static int hf_rtps_acknack_count; static int hf_rtps_durability_service_history_kind; static int hf_rtps_durability_service_history_depth; static int hf_rtps_durability_service_max_samples; static int hf_rtps_durability_service_max_instances; static int hf_rtps_durability_service_max_samples_per_instances; static int hf_rtps_liveliness_kind; static int hf_rtps_manager_key; static int hf_rtps_locator_udp_v4; static int hf_rtps_locator_udp_v4_port; static int hf_param_ip_address; static int hf_rtps_param_port; static int hf_rtps_expects_inline_qos; static int hf_rtps_presentation_coherent_access; static int hf_rtps_presentation_ordered_access; static int hf_rtps_expects_ack; static int hf_rtps_reliability_kind; static int hf_rtps_durability; static int hf_rtps_ownership; static int hf_rtps_presentation_access_scope; static int hf_rtps_destination_order; static int hf_rtps_history_kind; static int hf_rtps_data_status_info; static int hf_rtps_param_serialize_encap_kind; static int hf_rtps_param_serialize_encap_len; static int hf_rtps_param_transport_priority; static int hf_rtps_param_type_max_size_serialized; static int hf_rtps_param_entity_name; static int hf_rtps_param_role_name; static int hf_rtps_disable_positive_ack; static int hf_rtps_participant_guid_v1; static int hf_rtps_participant_guid; static int hf_rtps_group_guid_v1; static int hf_rtps_group_guid; static int hf_rtps_endpoint_guid; static int hf_rtps_param_host_id; static int hf_rtps_param_app_id; static int hf_rtps_param_instance_id; static int hf_rtps_param_instance_id_v1; static int hf_rtps_param_app_kind; static int hf_rtps_param_entity; static int hf_rtps_param_entity_key; static int hf_rtps_param_entity_kind; static int hf_rtps_data_frag_number; static int hf_rtps_data_frag_num_fragments; static int hf_rtps_data_frag_size; static int hf_rtps_data_frag_sample_size; static int hf_rtps_nokey_data_frag_number; static int hf_rtps_nokey_data_frag_num_fragments; static int hf_rtps_nokey_data_frag_size; static int hf_rtps_nack_frag_count; static int hf_rtps_heartbeat_frag_number; static int hf_rtps_heartbeat_frag_count; static int hf_rtps_heartbeat_batch_count; static int hf_rtps_data_serialize_data; static int hf_rtps_data_batch_timestamp; static int hf_rtps_data_batch_offset_to_last_sample_sn; static int hf_rtps_data_batch_sample_count; static int hf_rtps_data_batch_offset_sn; static int hf_rtps_data_batch_octets_to_sl_encap_id; static int hf_rtps_data_batch_serialized_data_length; static int hf_rtps_data_batch_octets_to_inline_qos; static int hf_rtps_fragment_number_base64; static int hf_rtps_fragment_number_base; static int hf_rtps_fragment_number_num_bits; static int hf_rtps_bitmap_num_bits; static int hf_rtps_param_partition_num; static int hf_rtps_param_partition; static int hf_rtps_param_filter_expression; static int hf_rtps_param_expression_parameters_num; static int hf_rtps_param_expression_parameters; static int hf_rtps_locator_filter_list_num_channels; static int hf_rtps_locator_filter_list_filter_name; static int hf_rtps_locator_filter_list_filter_exp; static int hf_rtps_extra_flags; static int hf_rtps_param_builtin_endpoint_set_flags; static int hf_rtps_param_vendor_builtin_endpoint_set_flags; static int hf_rtps_param_endpoint_security_attributes; static int hf_rtps_param_plugin_promiscuity_kind; static int hf_rtps_param_service_kind; static int hf_rtps_param_sample_signature_epoch; static int hf_rtps_param_sample_signature_nonce; static int hf_rtps_param_sample_signature_length; static int hf_rtps_param_sample_signature_signature; static int hf_rtps_secure_secure_data_length; static int hf_rtps_secure_secure_data; static int hf_rtps_param_enable_authentication; static int hf_rtps_param_builtin_endpoint_qos; static int hf_rtps_secure_dataheader_transformation_kind; static int hf_rtps_secure_dataheader_transformation_key_revision_id; static int hf_rtps_secure_dataheader_transformation_key_id; static int hf_rtps_secure_dataheader_passphrase_id; static int hf_rtps_secure_dataheader_passphrase_key_id; static int hf_rtps_secure_dataheader_init_vector_suffix; static int hf_rtps_secure_dataheader_session_id; static int hf_rtps_secure_datatag_plugin_sec_tag; static int hf_rtps_secure_datatag_plugin_sec_tag_key; static int hf_rtps_secure_datatag_plugin_sec_tag_common_mac; static int hf_rtps_secure_datatag_plugin_specific_macs_len; static int hf_rtps_pgm; static int hf_rtps_pgm_dst_participant_guid; static int hf_rtps_pgm_dst_endpoint_guid; static int hf_rtps_pgm_src_endpoint_guid; static int hf_rtps_source_participant_guid; static int hf_rtps_message_identity_source_guid; static int hf_rtps_pgm_message_class_id; static int hf_rtps_pgm_data_holder_class_id; static int hf_rtps_secure_session_key; /* static int hf_rtps_pgm_data_holder_stringseq_size; */ /* static int hf_rtps_pgm_data_holder_stringseq_name; */ /* static int hf_rtps_pgm_data_holder_long_long; */ static int hf_rtps_param_timestamp_sec; static int hf_rtps_param_timestamp_fraction; static int hf_rtps_transportInfo_classId; static int hf_rtps_transportInfo_messageSizeMax; static int hf_rtps_param_app_ack_count; static int hf_rtps_param_app_ack_virtual_writer_count; static int hf_rtps_param_app_ack_conf_virtual_writer_count; static int hf_rtps_param_app_ack_conf_count; static int hf_rtps_param_app_ack_interval_payload_length; static int hf_rtps_param_app_ack_interval_flags; static int hf_rtps_param_app_ack_interval_count; static int hf_rtps_param_app_ack_octets_to_next_virtual_writer; static int hf_rtps_expects_virtual_heartbeat; static int hf_rtps_direct_communication; static int hf_rtps_param_peer_host_epoch; static int hf_rtps_param_endpoint_property_change_epoch; static int hf_rtps_virtual_heartbeat_count; static int hf_rtps_virtual_heartbeat_num_virtual_guids; static int hf_rtps_virtual_heartbeat_num_writers; static int hf_rtps_param_extended_parameter; static int hf_rtps_param_extended_pid_length; static int hf_rtps_param_type_consistency_kind; static int hf_rtps_param_data_representation; static int hf_rtps_param_ignore_sequence_bounds; static int hf_rtps_param_ignore_string_bounds; static int hf_rtps_param_ignore_member_names; static int hf_rtps_param_prevent_type_widening; static int hf_rtps_param_force_type_validation; static int hf_rtps_param_ignore_enum_literal_names; static int hf_rtps_parameter_data; static int hf_rtps_param_product_version_major; static int hf_rtps_param_product_version_minor; static int hf_rtps_param_product_version_release; static int hf_rtps_param_product_version_release_as_char; static int hf_rtps_param_product_version_revision; static int hf_rtps_param_acknowledgment_kind; static int hf_rtps_param_topic_query_publication_enable; static int hf_rtps_param_topic_query_publication_sessions; static int hf_rtps_srm; static int hf_rtps_srm_service_id; static int hf_rtps_srm_request_body; static int hf_rtps_srm_instance_id; static int hf_rtps_topic_query_selection_filter_class_name; static int hf_rtps_topic_query_selection_filter_expression; static int hf_rtps_topic_query_selection_num_parameters; static int hf_rtps_topic_query_selection_filter_parameter; static int hf_rtps_topic_query_topic_name; static int hf_rtps_topic_query_original_related_reader_guid; static int hf_rtps_encapsulation_id; static int hf_rtps_encapsulation_kind; static int hf_rtps_octets_to_inline_qos; static int hf_rtps_filter_signature; static int hf_rtps_bitmap; static int hf_rtps_acknack_analysis; static int hf_rtps_property_name; static int hf_rtps_property_value; static int hf_rtps_union; static int hf_rtps_union_case; static int hf_rtps_struct; static int hf_rtps_member_name; static int hf_rtps_sequence; static int hf_rtps_array; static int hf_rtps_bitfield; static int hf_rtps_datatype; static int hf_rtps_sequence_size; static int hf_rtps_guid; static int hf_rtps_heartbeat_count; static int hf_rtps_encapsulation_options; static int hf_rtps_serialized_key; static int hf_rtps_serialized_data; static int hf_rtps_type_object_type_id_disc; static int hf_rtps_type_object_type_id; static int hf_rtps_type_object_primitive_type_id; static int hf_rtps_type_object_base_type; static int hf_rtps_type_object_base_primitive_type_id; static int hf_rtps_type_object_element_raw; static int hf_rtps_type_object_type_property_name; static int hf_rtps_type_object_flags; static int hf_rtps_type_object_member_id; static int hf_rtps_type_object_annotation_value_d; static int hf_rtps_type_object_annotation_value_16; static int hf_rtps_type_object_union_label; static int hf_rtps_type_object_bound; static int hf_rtps_type_object_enum_constant_name; static int hf_rtps_type_object_enum_constant_value; static int hf_rtps_type_object_element_shared; static int hf_rtps_type_object_name; static int hf_rtps_type_object_element_module_name; static int hf_rtps_uncompressed_serialized_length; static int hf_rtps_compression_plugin_class_id; static int hf_rtps_compressed_serialized_type_object; static int hf_rtps_pl_cdr_member; static int hf_rtps_pl_cdr_member_id; static int hf_rtps_pl_cdr_member_length; static int hf_rtps_pl_cdr_member_id_ext; static int hf_rtps_pl_cdr_member_length_ext; static int hf_rtps_dcps_publication_data_frame_number; static int hf_rtps_udpv4_wan_locator_flags; static int hf_rtps_uuid; static int hf_rtps_udpv4_wan_locator_public_ip; static int hf_rtps_udpv4_wan_locator_public_port; static int hf_rtps_udpv4_wan_locator_local_ip; static int hf_rtps_udpv4_wan_locator_local_port; static int hf_rtps_udpv4_wan_binding_ping_port; static int hf_rtps_udpv4_wan_binding_ping_flags; static int hf_rtps_long_address; static int hf_rtps_param_group_coherent_set; static int hf_rtps_param_end_group_coherent_set; static int hf_rtps_param_mig_end_coherent_set_sample_count; static int hf_rtps_encapsulation_options_compression_plugin_class_id; static int hf_rtps_padding_bytes; static int hf_rtps_topic_query_selection_kind; static int hf_rtps_data_session_intermediate; /* Flag bits */ static int hf_rtps_flag_reserved80; static int hf_rtps_flag_reserved40; static int hf_rtps_flag_reserved20; static int hf_rtps_flag_reserved10; static int hf_rtps_flag_reserved08; static int hf_rtps_flag_reserved04; static int hf_rtps_flag_reserved02; static int hf_rtps_flag_reserved8000; static int hf_rtps_flag_reserved4000; static int hf_rtps_flag_reserved2000; static int hf_rtps_flag_reserved1000; static int hf_rtps_flag_reserved0800; static int hf_rtps_flag_reserved0400; static int hf_rtps_flag_reserved0200; static int hf_rtps_flag_reserved0100; static int hf_rtps_flag_reserved0080; static int hf_rtps_flag_reserved0040; static int hf_rtps_flag_builtin_endpoint_set_reserved; static int hf_rtps_flag_unregister; static int hf_rtps_flag_inline_qos_v1; static int hf_rtps_flag_hash_key; static int hf_rtps_flag_alive; static int hf_rtps_flag_data_present_v1; static int hf_rtps_flag_multisubmessage; static int hf_rtps_flag_endianness; static int hf_rtps_flag_additional_authenticated_data; static int hf_rtps_flag_protected_with_psk; static int hf_rtps_flag_vendor_specific_content; static int hf_rtps_flag_status_info; static int hf_rtps_flag_data_present_v2; static int hf_rtps_flag_inline_qos_v2; static int hf_rtps_flag_final; static int hf_rtps_flag_hash_key_rti; static int hf_rtps_flag_liveliness; static int hf_rtps_flag_multicast; static int hf_rtps_flag_data_serialized_key; static int hf_rtps_flag_data_frag_serialized_key; static int hf_rtps_flag_timestamp; static int hf_rtps_flag_no_virtual_guids; static int hf_rtps_flag_multiple_writers; static int hf_rtps_flag_multiple_virtual_guids; static int hf_rtps_flag_serialize_key16; static int hf_rtps_flag_invalid_sample; static int hf_rtps_flag_data_present16; static int hf_rtps_flag_offsetsn_present; static int hf_rtps_flag_inline_qos16_v2; static int hf_rtps_flag_timestamp_present; static int hf_rtps_flag_unregistered; static int hf_rtps_flag_disposed; static int hf_rtps_param_status_info_flags; static int hf_rtps_flag_participant_announcer; static int hf_rtps_flag_participant_detector; static int hf_rtps_flag_publication_announcer; static int hf_rtps_flag_publication_detector; static int hf_rtps_flag_subscription_announcer; static int hf_rtps_flag_subscription_detector; static int hf_rtps_flag_participant_proxy_announcer; static int hf_rtps_flag_participant_proxy_detector; static int hf_rtps_flag_participant_state_announcer; static int hf_rtps_flag_participant_state_detector; static int hf_rtps_flag_participant_message_datawriter; static int hf_rtps_flag_participant_message_datareader; static int hf_rtps_flag_secure_publication_writer; static int hf_rtps_flag_secure_publication_reader; static int hf_rtps_flag_secure_subscription_writer; static int hf_rtps_flag_secure_subscription_reader; static int hf_rtps_flag_secure_participant_message_writer; static int hf_rtps_flag_secure_participant_message_reader; static int hf_rtps_flag_participant_stateless_message_writer; static int hf_rtps_flag_participant_stateless_message_reader; static int hf_rtps_flag_secure_participant_volatile_message_writer; static int hf_rtps_flag_secure_participant_volatile_message_reader; static int hf_rtps_flag_participant_secure_writer; static int hf_rtps_flag_participant_secure_reader; static int hf_rtps_flag_typeflag_final; static int hf_rtps_flag_typeflag_mutable; static int hf_rtps_flag_typeflag_nested; static int hf_rtps_flag_memberflag_key; static int hf_rtps_flag_memberflag_optional; static int hf_rtps_flag_memberflag_shareable; static int hf_rtps_flag_memberflag_union_default; static int hf_rtps_flag_service_request_writer; static int hf_rtps_flag_service_request_reader; static int hf_rtps_flag_locator_ping_writer; static int hf_rtps_flag_locator_ping_reader; static int hf_rtps_flag_secure_service_request_writer; static int hf_rtps_flag_cloud_discovery_service_announcer; static int hf_rtps_flag_participant_config_writer; static int hf_rtps_flag_participant_config_reader; static int hf_rtps_flag_participant_config_secure_writer; static int hf_rtps_flag_participant_config_secure_reader; static int hf_rtps_flag_participant_bootstrap_writer; static int hf_rtps_flag_participant_bootstrap_reader; static int hf_rtps_flag_monitoring_periodic_writer; static int hf_rtps_flag_monitoring_periodic_reader; static int hf_rtps_flag_monitoring_event_writer; static int hf_rtps_flag_monitoring_event_reader; static int hf_rtps_flag_monitoring_logging_writer; static int hf_rtps_flag_monitoring_logging_reader; static int hf_rtps_flag_secure_service_request_reader; static int hf_rtps_flag_security_access_protected; static int hf_rtps_flag_security_discovery_protected; static int hf_rtps_flag_security_submessage_protected; static int hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_required_mask; static int hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_key_exchange_used_bit; static int hf_rtps_param_participant_security_symmetric_cipher_algorithms_supported_mask; static int hf_rtps_flag_security_symmetric_cipher_mask_aes128_gcm; static int hf_rtps_flag_security_symmetric_cipher_mask_aes256_gcm; static int hf_rtps_flag_security_symmetric_cipher_mask_custom_algorithm; static int hf_rtps_param_compression_id_mask; static int hf_rtps_flag_compression_id_zlib; static int hf_rtps_flag_compression_id_bzip2; static int hf_rtps_flag_compression_id_lz4; static int hf_rtps_param_crypto_algorithm_requirements_trust_chain; static int hf_rtps_param_crypto_algorithm_requirements_message_auth; static int hf_rtps_flag_security_digital_signature_mask_rsassapssmgf1sha256_2048_sha256; static int hf_rtps_flag_security_digital_signature_mask_rsassapkcs1v15_2048_sha256; static int hf_rtps_flag_security_digital_signature_mask_ecdsa_p256_sha256; static int hf_rtps_flag_security_digital_signature_mask_ecdsa_p384_sha384; static int hf_rtps_flag_security_digital_signature_mask_custom_algorithm; static int hf_rtps_flag_security_key_establishment_mask_dhe_modp2048256; static int hf_rtps_flag_security_key_establishment_mask_ecdheceum_p256; static int hf_rtps_flag_security_key_establishment_mask_ecdheceum_p384; static int hf_rtps_flag_security_key_establishment_mask_custom_algorithm; static int hf_rtps_flag_security_algorithm_compatibility_mode; static int hf_rtps_flag_security_payload_protected; static int hf_rtps_flag_endpoint_security_attribute_flag_is_read_protected; static int hf_rtps_flag_endpoint_security_attribute_flag_is_write_protected; static int hf_rtps_flag_endpoint_security_attribute_flag_is_discovery_protected; static int hf_rtps_flag_endpoint_security_attribute_flag_is_submessage_protected; static int hf_rtps_flag_endpoint_security_attribute_flag_is_payload_protected; static int hf_rtps_flag_endpoint_security_attribute_flag_is_key_protected; static int hf_rtps_flag_endpoint_security_attribute_flag_is_liveliness_protected; static int hf_rtps_flag_endpoint_security_attribute_flag_is_valid; static int hf_rtps_param_endpoint_security_attributes_mask; static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_payload_encrypted; static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_key_encrypted; static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_liveliness_encrypted; static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_valid; static int hf_rtps_param_plugin_endpoint_security_attributes_mask; static int hf_rtps_flag_participant_security_attribute_flag_key_psk_protected; static int hf_rtps_flag_participant_security_attribute_flag_is_rtps_protected; static int hf_rtps_flag_participant_security_attribute_flag_is_discovery_protected; static int hf_rtps_flag_participant_security_attribute_flag_is_liveliness_protected; static int hf_rtps_flag_participant_security_attribute_flag_key_revisions_enabled; static int hf_rtps_flag_participant_security_attribute_flag_is_valid; static int hf_rtps_param_participant_security_attributes_mask; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_psk_encrypted; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_encrypted; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_encrypted; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_encrypted; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_origin_encrypted; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_origin_encrypted; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_origin_encrypted; static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_valid; static int hf_rtps_param_plugin_participant_security_attributes_mask; static int hf_rtps_sm_rti_crc_number; static int hf_rtps_sm_rti_crc_result; static int hf_rtps_data_tag_name; static int hf_rtps_data_tag_value; static int hf_rtps_flag_udpv4_wan_locator_u; static int hf_rtps_flag_udpv4_wan_locator_p; static int hf_rtps_flag_udpv4_wan_locator_b; static int hf_rtps_flag_udpv4_wan_locator_r; static int hf_rtps_flag_udpv4_wan_binding_ping_e; static int hf_rtps_flag_udpv4_wan_binding_ping_l; static int hf_rtps_flag_udpv4_wan_binding_ping_b; static int hf_rtps_header_extension_flags; static int hf_rtps_flag_header_extension_message_length; static int hf_rtps_flag_header_extension_uextension; static int hf_rtps_flag_header_extension_wextension; static int hf_rtps_flag_header_extension_checksum1; static int hf_rtps_flag_header_extension_checksum2; static int hf_rtps_flag_header_extension_parameters; static int hf_rtps_flag_header_extension_timestamp; static int hf_rtps_fragments; static int hf_rtps_fragment; static int hf_rtps_fragment_overlap; static int hf_rtps_fragment_overlap_conflict; static int hf_rtps_fragment_multiple_tails; static int hf_rtps_fragment_too_long_fragment; static int hf_rtps_fragment_error; static int hf_rtps_fragment_count; static int hf_rtps_reassembled_in; static int hf_rtps_reassembled_length; static int hf_rtps_reassembled_data; static int hf_rtps_encapsulation_extended_compression_options; static int hf_rtps_message_length; static int hf_rtps_header_extension_checksum_crc32c; static int hf_rtps_header_extension_checksum_crc64; static int hf_rtps_header_extension_checksum_md5; static int hf_rtps_uextension; static int hf_rtps_wextension; static int hf_rtps_writer_group_oid; static int hf_rtps_reader_group_oid; static int hf_rtps_writer_session_id; /* Subtree identifiers */ static int ett_rtps_dissection_tree; static int ett_rtps; static int ett_rtps_default_mapping; static int ett_rtps_proto_version; static int ett_rtps_submessage; static int ett_rtps_parameter_sequence; static int ett_rtps_parameter; static int ett_rtps_flags; static int ett_rtps_entity; static int ett_rtps_generic_guid; static int ett_rtps_rdentity; static int ett_rtps_wrentity; static int ett_rtps_guid_prefix; static int ett_rtps_app_id; static int ett_rtps_locator_udp_v4; static int ett_rtps_locator; static int ett_rtps_locator_list; static int ett_rtps_timestamp; static int ett_rtps_bitmap; static int ett_rtps_seq_string; static int ett_rtps_seq_ulong; static int ett_rtps_resource_limit; static int ett_rtps_durability_service; static int ett_rtps_liveliness; static int ett_rtps_manager_key; static int ett_rtps_serialized_data; static int ett_rtps_locator_filter_channel; static int ett_rtps_part_message_data; static int ett_rtps_sample_info_list; static int ett_rtps_sample_info; static int ett_rtps_sample_batch_list; static int ett_rtps_locator_filter_locator; static int ett_rtps_writer_heartbeat_virtual_list; static int ett_rtps_writer_heartbeat_virtual; static int ett_rtps_virtual_guid_heartbeat_virtual_list; static int ett_rtps_virtual_guid_heartbeat_virtual; static int ett_rtps_app_ack_virtual_writer_interval_list; static int ett_rtps_app_ack_virtual_writer_interval; static int ett_rtps_transport_info; static int ett_rtps_app_ack_virtual_writer_list; static int ett_rtps_app_ack_virtual_writer; static int ett_rtps_product_version; static int ett_rtps_property_list; static int ett_rtps_property; static int ett_rtps_topic_info; static int ett_rtps_topic_info_dw_qos; static int ett_rtps_type_object; static int ett_rtps_type_library; static int ett_rtps_type_element; static int ett_rtps_type_annotation_usage_list; static int ett_rtps_type_enum_constant; static int ett_rtps_type_bound_list; static int ett_rtps_secure_payload_tree; static int ett_rtps_secure_dataheader_tree; static int ett_rtps_secure_transformation_kind; static int ett_rtps_pgm_data; static int ett_rtps_message_identity; static int ett_rtps_related_message_identity; static int ett_rtps_data_holder_seq; static int ett_rtps_data_holder; static int ett_rtps_data_holder_properties; static int ett_rtps_property_tree; static int ett_rtps_param_header_tree; static int ett_rtps_service_request_tree; static int ett_rtps_locator_ping_tree; static int ett_rtps_locator_reachability_tree; static int ett_rtps_custom_dissection_info; static int ett_rtps_locator_list_tree; static int ett_rtps_topic_query_tree; static int ett_rtps_topic_query_selection_tree; static int ett_rtps_topic_query_filter_params_tree; static int ett_rtps_data_member; static int ett_rtps_data_tag_seq; static int ett_rtps_data_tag_item; static int ett_rtps_fragment; static int ett_rtps_fragments; static int ett_rtps_data_representation; static int ett_rtps_decompressed_type_object; static int ett_rtps_info_remaining_items; static int ett_rtps_data_encapsulation_options; static int ett_rtps_decompressed_serialized_data; static int ett_rtps_instance_transition_data; static int ett_rtps_crypto_algorithm_requirements; static int ett_rtps_decrypted_payload; static int ett_rtps_secure_postfix_tag_list_item; static expert_field ei_rtps_sm_octets_to_next_header_error; static expert_field ei_rtps_checksum_check_error; static expert_field ei_rtps_port_invalid; static expert_field ei_rtps_ip_invalid; static expert_field ei_rtps_parameter_value_invalid; static expert_field ei_rtps_extra_bytes; static expert_field ei_rtps_missing_bytes; static expert_field ei_rtps_locator_port; static expert_field ei_rtps_more_samples_available; static expert_field ei_rtps_parameter_not_decoded; static expert_field ei_rtps_sm_octets_to_next_header_not_zero; static expert_field ei_rtps_pid_type_csonsistency_invalid_size; static expert_field ei_rtps_uncompression_error; static expert_field ei_rtps_value_too_large; static expert_field ei_rtps_invalid_psk; /***************************************************************************/ /* 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_ADL_DDS, RTPS_VENDOR_ADL_DDS_STRING}, { RTPS_VENDOR_OCI, RTPS_VENDOR_OCI_STRING}, { RTPS_VENDOR_MILSOFT, RTPS_VENDOR_MILSOFT_STRING}, { RTPS_VENDOR_KONGSBERG, RTPS_VENDOR_KONGSBERG_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_ADL_CAFE, RTPS_VENDOR_ADL_CAFE_STRING}, { RTPS_VENDOR_PT, RTPS_VENDOR_PT_STRING}, { RTPS_VENDOR_ADL_LITE, RTPS_VENDOR_ADL_LITE_STRING}, { RTPS_VENDOR_TECHNICOLOR, RTPS_VENDOR_TECHNICOLOR_STRING}, { RTPS_VENDOR_EPROSIMA, RTPS_VENDOR_EPROSIMA_STRING}, { RTPS_VENDOR_ECLIPSE, RTPS_VENDOR_ECLIPSE_STRING}, { RTPS_VENDOR_GURUM, RTPS_VENDOR_GURUM_STRING}, { RTPS_VENDOR_RUST, RTPS_VENDOR_RUST_STRING}, { RTPS_VENDOR_ZRDDS, RTPS_VENDOR_ZRDDS_STRING}, { RTPS_VENDOR_DUST, RTPS_VENDOR_DUST_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_PARTICIPANT_WRITER, "ENTITYID_BUILTIN_PARTICIPANT_WRITER" }, { ENTITYID_BUILTIN_PARTICIPANT_READER, "ENTITYID_BUILTIN_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" }, { ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER" }, { ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER" }, { ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER" }, { ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER" }, { ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER"}, { ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_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)" }, { ENTITYID_OBJECT_NORMAL_META_WRITER_GROUP, "Object normal meta writer group" }, { ENTITYID_OBJECT_NORMAL_META_READER_GROUP, "Object normal meta reader group" }, { ENTITYID_OBJECT_NORMAL_META_TOPIC, "Object normal meta topic" }, { ENTITYID_RESERVED_META_CST_GROUP_WRITER, "Reserved meta CST group writer" }, { ENTITYID_RESERVED_META_GROUP_WRITER, "Reserved meta group writer" }, { ENTITYID_RESERVED_META_GROUP_READER, "Reserved meta group reader" }, { ENTITYID_RESERVED_META_CST_GROUP_READER, "Reserved meta CST group reader" }, { ENTITYID_NORMAL_META_CST_GROUP_WRITER, "Normal meta CST group writer" }, { ENTITYID_NORMAL_META_GROUP_WRITER, "Normal meta group writer" }, { ENTITYID_NORMAL_META_GROUP_READER, "Normal meta group reader" }, { ENTITYID_NORMAL_META_CST_GROUP_READER, "Normal meta CST group reader" }, { ENTITYID_RESERVED_USER_CST_GROUP_WRITER, "Reserved user CST group writer" }, { ENTITYID_RESERVED_USER_GROUP_WRITER, "Reserved user group writer" }, { ENTITYID_RESERVED_USER_GROUP_READER, "Reserved user group reader" }, { ENTITYID_RESERVED_USER_CST_GROUP_READER, "Reserved user CST group reader" }, { ENTITYID_NORMAL_USER_CST_GROUP_WRITER, "Normal user CST group writer" }, { ENTITYID_NORMAL_USER_GROUP_WRITER, "Normal user writer" }, { ENTITYID_NORMAL_USER_GROUP_READER, "Normal user reader" }, { ENTITYID_NORMAL_USER_CST_GROUP_READER, "Normal user CST group reader" }, { 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" }, { LOCATOR_KIND_UDPV4_WAN, "LOCATOR_KIND_UDPV4_WAN" }, { 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_HEADER_EXTENSION, "HEADER_EXTENSION" }, { SUBMESSAGE_PAD, "PAD" }, { SUBMESSAGE_RTPS_DATA, "DATA" }, { SUBMESSAGE_RTPS_DATA_FRAG, "DATA_FRAG" }, { SUBMESSAGE_RTI_DATA_FRAG_SESSION, "DATA_FRAG_SESSION" }, { 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" }, { SUBMESSAGE_RTI_UDP_WAN_BINDING_PING, "RTI_BINDING_PING" }, { SUBMESSAGE_RTI_DATA_FRAG_SESSION, "DATA_FRAG_SESSION" }, { 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_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_ORIGINAL_WRITER_INFO_LEGACY, "PID_RELATED_ORIGINAL_WRITER_INFO_LEGACY" }, { 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_DATA_REPRESENTATION, "PID_DATA_REPRESENTATION" }, { PID_TYPE_CONSISTENCY, "PID_TYPE_CONSISTENCY" }, { PID_BUILTIN_ENDPOINT_QOS, "PID_BUILTIN_ENDPOINT_QOS" }, { PID_ENABLE_AUTHENTICATION, "PID_ENABLE_AUTHENTICATION" }, { PID_RELATED_ENTITY_GUID, "PID_RELATED_ENTITY_GUID" }, { PID_IDENTITY_TOKEN, "PID_IDENTITY_TOKEN" }, { PID_PERMISSIONS_TOKEN, "PID_PERMISSIONS_TOKEN" }, { PID_DATA_TAGS, "PID_DATA_TAGS" }, { PID_ENDPOINT_SECURITY_INFO, "PID_ENDPOINT_SECURITY_INFO" }, { PID_PARTICIPANT_SECURITY_INFO, "PID_PARTICIPANT_SECURITY_INFO" }, { PID_PARTICIPANT_SECURITY_DIGITAL_SIGNATURE_ALGO, "PID_PARTICIPANT_SECURITY_DIGITAL_SIGNATURE_ALGO" }, { PID_PARTICIPANT_SECURITY_KEY_ESTABLISHMENT_ALGO, "PID_PARTICIPANT_SECURITY_KEY_ESTABLISHMENT_ALGO" }, { PID_PARTICIPANT_SECURITY_SYMMETRIC_CIPHER_ALGO, "PID_PARTICIPANT_SECURITY_SYMMETRIC_CIPHER_ALGO" }, { PID_ENDPOINT_SECURITY_SYMMETRIC_CIPHER_ALGO, "PID_ENDPOINT_SECURITY_SYMMETRIC_CIPHER_ALGO" }, { PID_IDENTITY_STATUS_TOKEN, "PID_IDENTITY_STATUS_TOKEN"}, { PID_DOMAIN_ID, "PID_DOMAIN_ID" }, { PID_DOMAIN_TAG, "PID_DOMAIN_TAG" }, { PID_GROUP_COHERENT_SET, "PID_GROUP_COHERENT_SET" }, { PID_END_COHERENT_SET, "PID_END_COHERENT_SET" }, { PID_END_GROUP_COHERENT_SET, "PID_END_GROUP_COHERENT_SET" }, { MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT, "MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT" }, /* 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_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_RTI_DOMAIN_ID, "PID_RTI_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" }, { PID_TYPE_OBJECT_LB, "PID_TYPE_OBJECT_LB" }, { PID_UNICAST_LOCATOR_EX, "PID_UNICAST_LOCATOR_EX"}, { 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_adl_vals[] = { /* Vendor specific: ADLink Ltd. */ { PID_ADLINK_WRITER_INFO, "PID_ADLINK_WRITER_INFO" }, { PID_ADLINK_READER_DATA_LIFECYCLE, "PID_ADLINK_READER_DATA_LIFECYCLE" }, { PID_ADLINK_WRITER_DATA_LIFECYCLE, "PID_ADLINK_WRITER_DATA_LIFECYCLE" }, { PID_ADLINK_ENDPOINT_GUID, "PID_ADLINK_ENDPOINT_GUID" }, { PID_ADLINK_SYNCHRONOUS_ENDPOINT, "PID_ADLINK_SYNCHRONOUS_ENDPOINT" }, { PID_ADLINK_RELAXED_QOS_MATCHING, "PID_ADLINK_RELAXED_QOS_MATCHING" }, { PID_ADLINK_PARTICIPANT_VERSION_INFO, "PID_ADLINK_PARTICIPANT_VERSION_INFO" }, { PID_ADLINK_NODE_NAME, "PID_ADLINK_NODE_NAME" }, { PID_ADLINK_EXEC_NAME, "PID_ADLINK_EXEC_NAME" }, { PID_ADLINK_PROCESS_ID, "PID_ADLINK_PROCESS_ID" }, { PID_ADLINK_SERVICE_TYPE, "PID_ADLINK_SERVICE_TYPE" }, { PID_ADLINK_ENTITY_FACTORY, "PID_ADLINK_ENTITY_FACTORY" }, { PID_ADLINK_WATCHDOG_SCHEDULING, "PID_ADLINK_WATCHDOG_SCHEDULING" }, { PID_ADLINK_LISTENER_SCHEDULING, "PID_ADLINK_LISTENER_SCHEDULING" }, { PID_ADLINK_SUBSCRIPTION_KEYS, "PID_ADLINK_SUBSCRIPTION_KEYS" }, { PID_ADLINK_READER_LIFESPAN, "PID_ADLINK_READER_LIFESPAN" }, { PID_ADLINK_SHARE, "PID_ADLINK_SHARE" }, { PID_ADLINK_TYPE_DESCRIPTION, "PID_ADLINK_TYPE_DESCRIPTION" }, { PID_ADLINK_LAN_ID, "PID_ADLINK_LAN_ID" }, { PID_ADLINK_ENDPOINT_GID, "PID_ADLINK_ENDPOINT_GID" }, { PID_ADLINK_GROUP_GID, "PID_ADLINK_GROUP_GID" }, { PID_ADLINK_EOTINFO, "PID_ADLINK_EOTINFO" }, { PID_ADLINK_PART_CERT_NAME, "PID_ADLINK_PART_CERT_NAME" }, { PID_ADLINK_LAN_CERT_NAME, "PID_ADLINK_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" }, { ENCAPSULATION_CDR2_BE, "CDR2_BE" }, { ENCAPSULATION_CDR2_LE, "CDR2_LE" }, { ENCAPSULATION_D_CDR2_BE, "D_CDR2_BE" }, { ENCAPSULATION_D_CDR2_LE, "D_CDR2_LE" }, { ENCAPSULATION_PL_CDR2_BE, "PL_CDR2_BE" }, { ENCAPSULATION_PL_CDR2_LE, "PL_CDR2_LE" }, { ENCAPSULATION_SHMEM_REF_PLAIN, "SHMEM_REF_PLAIN" }, { ENCAPSULATION_SHMEM_REF_FLAT_DATA, "SHMEM_REF_PLAIN" }, { 0, NULL } }; static const value_string data_representation_kind_vals[] = { { 0, "XCDR_DATA_REPRESENTATION" }, { 1, "XML_DATA_REPRESENTATION" }, { 2, "XCDR2_DATA_REPRESENTATION" }, { 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_INSTANCE_STATE, "RTI_SERVICE_REQUEST_ID_INSTANCE_STATE" }, { 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 int* const 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 int* const 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 }; static int* const UDPV4_WAN_LOCATOR_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_udpv4_wan_locator_r, /* Bit 3 */ &hf_rtps_flag_udpv4_wan_locator_b, /* Bit 2 */ &hf_rtps_flag_udpv4_wan_locator_p, /* Bit 1 */ &hf_rtps_flag_udpv4_wan_locator_u, /* Bit 0 */ NULL }; static int* const UDPV4_WAN_BINDING_PING_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_udpv4_wan_binding_ping_b, /* Bit 2 */ &hf_rtps_flag_udpv4_wan_binding_ping_l, /* Bit 1 */ &hf_rtps_flag_udpv4_wan_binding_ping_e, /* 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" }, { NDDS_TRANSPORT_CLASSID_UDPv4_WAN, "UDPv4_WAN" }, { 0, NULL } }; static const value_string class_id_enum_names[] = { { RTI_OSAPI_COMPRESSION_CLASS_ID_NONE, "NONE" }, { RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB, "ZLIB" }, { RTI_OSAPI_COMPRESSION_CLASS_ID_BZIP2, "BZIP2" }, { RTI_OSAPI_COMPRESSION_CLASS_ID_AUTO, "AUTO"}, { 0, NULL} }; static const value_string topic_query_selection_kind[] = { { RTPS_TOPIC_QUERY_SELECTION_KIND_HISTORY_SNAPSHOT, "HISTORY_SNAPSHOT" }, { RTPS_TOPIC_QUERY_SELECTION_KIND_CONTINUOUS, "CONTINUOUS" }, { 0, NULL} }; static int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const SECURE_PREFIX_FLAGS[] = { &hf_rtps_flag_vendor_specific_content, /* 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_protected_with_psk, /* Bit 2 */ &hf_rtps_flag_additional_authenticated_data, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; static int* const 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 }; static int* const ENDPOINT_SECURITY_INFO_FLAGS[] = { &hf_rtps_flag_endpoint_security_attribute_flag_is_valid, /* Bit 31 */ &hf_rtps_flag_endpoint_security_attribute_flag_is_liveliness_protected, /* Bit 6 */ &hf_rtps_flag_endpoint_security_attribute_flag_is_key_protected, /* Bit 5 */ &hf_rtps_flag_endpoint_security_attribute_flag_is_payload_protected, /* Bit 4 */ &hf_rtps_flag_endpoint_security_attribute_flag_is_submessage_protected, /* Bit 3 */ &hf_rtps_flag_endpoint_security_attribute_flag_is_discovery_protected, /* Bit 2 */ &hf_rtps_flag_endpoint_security_attribute_flag_is_write_protected, /* Bit 1 */ &hf_rtps_flag_endpoint_security_attribute_flag_is_read_protected, /* Bit 0 */ NULL }; static int* const PLUGIN_ENDPOINT_SECURITY_INFO_FLAGS[] = { &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_valid, /* Bit 31 */ &hf_rtps_flag_participant_security_attribute_flag_key_psk_protected, /* Bit 4 */ &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_liveliness_encrypted, /* Bit 2 */ &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_key_encrypted, /* Bit 1 */ &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_payload_encrypted, /* Bit 0 */ NULL }; static int* const PARTICIPANT_SECURITY_INFO_FLAGS[] = { &hf_rtps_flag_participant_security_attribute_flag_is_valid, /* Bit 31 */ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_psk_encrypted, /* Bit 6 */ &hf_rtps_flag_participant_security_attribute_flag_key_revisions_enabled, /* Bit 3 */ &hf_rtps_flag_participant_security_attribute_flag_is_liveliness_protected, /* Bit 2 */ &hf_rtps_flag_participant_security_attribute_flag_is_discovery_protected, /* Bit 1 */ &hf_rtps_flag_participant_security_attribute_flag_is_rtps_protected, /* Bit 0 */ NULL }; static int* const PLUGIN_PARTICIPANT_SECURITY_INFO_FLAGS[] = { &hf_rtps_flag_plugin_participant_security_attribute_flag_is_valid, /* Bit 31 */ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_origin_encrypted, /* Bit 5 */ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_origin_encrypted, /* Bit 4 */ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_origin_encrypted, /* Bit 3 */ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_encrypted, /* Bit 2 */ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_encrypted, /* Bit 1 */ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_encrypted, /* Bit 0 */ NULL }; /* Vendor specific: RTI */ static int* const 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 int* const 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 int* const 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 int* const 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 int* const 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 int* const VENDOR_BUILTIN_ENDPOINT_FLAGS[] = { &hf_rtps_flag_participant_bootstrap_reader, /* Bit 18 */ &hf_rtps_flag_participant_bootstrap_writer, /* Bit 17 */ &hf_rtps_flag_monitoring_logging_reader, /* Bit 16 */ &hf_rtps_flag_monitoring_logging_writer, /* Bit 15 */ &hf_rtps_flag_monitoring_event_reader, /* Bit 14 */ &hf_rtps_flag_monitoring_event_writer, /* Bit 13 */ &hf_rtps_flag_monitoring_periodic_reader, /* Bit 12 */ &hf_rtps_flag_monitoring_periodic_writer, /* Bit 11 */ &hf_rtps_flag_participant_config_secure_reader, /* Bit 10 */ &hf_rtps_flag_participant_config_secure_writer, /* Bit 9 */ &hf_rtps_flag_participant_config_reader, /* Bit 8 */ &hf_rtps_flag_participant_config_writer, /* Bit 7 */ &hf_rtps_flag_cloud_discovery_service_announcer, /* Bit 6 */ &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 int* const 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 }; static int* const SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS[] = { &hf_rtps_flag_security_algorithm_compatibility_mode, &hf_rtps_flag_security_symmetric_cipher_mask_custom_algorithm, &hf_rtps_flag_security_symmetric_cipher_mask_aes256_gcm, &hf_rtps_flag_security_symmetric_cipher_mask_aes128_gcm, NULL }; static int* const COMPRESSION_ID_MASK_FLAGS[] = { &hf_rtps_flag_compression_id_lz4, &hf_rtps_flag_compression_id_bzip2, &hf_rtps_flag_compression_id_zlib, NULL }; static int* const SECURITY_KEY_ESTABLISHMENT_MASK_FLAGS[] = { &hf_rtps_flag_security_algorithm_compatibility_mode, &hf_rtps_flag_security_key_establishment_mask_custom_algorithm, &hf_rtps_flag_security_key_establishment_mask_ecdheceum_p384, &hf_rtps_flag_security_key_establishment_mask_ecdheceum_p256, &hf_rtps_flag_security_key_establishment_mask_dhe_modp2048256, NULL }; static int* const SECURITY_DIGITAL_SIGNATURE_MASK_FLAGS[] = { &hf_rtps_flag_security_algorithm_compatibility_mode, &hf_rtps_flag_security_digital_signature_mask_custom_algorithm, &hf_rtps_flag_security_digital_signature_mask_ecdsa_p384_sha384, &hf_rtps_flag_security_digital_signature_mask_ecdsa_p256_sha256, &hf_rtps_flag_security_digital_signature_mask_rsassapkcs1v15_2048_sha256, &hf_rtps_flag_security_digital_signature_mask_rsassapssmgf1sha256_2048_sha256, NULL }; static int* const HEADER_EXTENSION_MASK_FLAGS[] = { &hf_rtps_flag_header_extension_parameters, /* Bit 7 */ &hf_rtps_flag_header_extension_checksum1, /* Bit 6 */ &hf_rtps_flag_header_extension_checksum2, /* Bit 5 */ &hf_rtps_flag_header_extension_wextension, /* Bit 4 */ &hf_rtps_flag_header_extension_uextension, /* Bit 3 */ &hf_rtps_flag_header_extension_timestamp, /* Bit 2 */ &hf_rtps_flag_header_extension_message_length, /* Bit 1 */ &hf_rtps_flag_endianness, /* Bit 0 */ NULL }; /**TCP get DomainId feature constants**/ #define RTPS_UNKNOWN_DOMAIN_ID_VAL -1 #define RTPS_UNKNOWN_DOMAIN_ID_STR "Unknown" #define RTPS_UNKNOWN_DOMAIN_ID_STR_LEN sizeof(RTPS_UNKNOWN_DOMAIN_ID_STR) #define RTPS_TCPMAP_DOMAIN_ID_KEY_STR "ParticipantGuid" #define RTPS_TCPMAP_DOMAIN_ID_PROTODATA_KEY 0 /* Keys for mapping stuff in pinfo */ #define RTPS_SERVICE_REQUEST_ID_PROTODATA_KEY 1 #define RTPS_DATA_SESSION_FINAL_PROTODATA_KEY 2 #define RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY 3 #define RTPS_ROOT_MESSAGE_KEY 4 #define RTPS_DECRYPTION_INFO_KEY 5 #define RTPS_CHECKSUM_MAX_LEN 16 /* End of TCP get DomainId feature constants */ typedef struct _participant_info { int domainId; } participant_info; typedef struct _datawriter_qos { uint32_t reliability_kind; uint32_t durability_kind; uint32_t ownership_kind; } datawriter_qos; #define MAX_TOPIC_AND_TYPE_LENGTH 256 typedef struct _type_mapping { endpoint_guid guid; char type_name[MAX_TOPIC_AND_TYPE_LENGTH]; char topic_name[MAX_TOPIC_AND_TYPE_LENGTH]; int fields_visited; datawriter_qos dw_qos; uint32_t dcps_publication_frame_number; uint64_t type_id; } type_mapping; /* Links a coherent set with an specific writer. Useful to detect if an empty packet is the end of a coherent set */ typedef struct _coherent_set_entity_info { endpoint_guid guid; uint64_t writer_seq_number; uint64_t coherent_set_seq_number; uint64_t expected_coherent_set_end_writers_seq_number; } coherent_set_entity_info; typedef struct _coherent_set_key { endpoint_guid guid; uint64_t coherent_set_seq_number; } coherent_set_key; /* Holds information about the coherent set */ typedef struct _coherent_set_info { coherent_set_key *key; uint64_t writer_seq_number; bool is_set; } coherent_set_info; /* Links a writer_seq_number with a coherent set. Useful when coherent set ends with parameter empty packet*/ typedef struct _coherent_set_end { uint64_t writer_seq_number; coherent_set_key coherent_set_id; } coherent_set_end; typedef struct _coherent_set_track { wmem_map_t *entities_using_map; wmem_map_t *coherent_set_registry_map; } coherent_set_track; static coherent_set_track coherent_set_tracking; static wmem_map_t * registry; static reassembly_table rtps_reassembly_table; static wmem_map_t *discovered_participants_domain_ids; typedef struct { type_mapping instance_state_data_response_type_mapping; } builtin_types_type_mappings; typedef struct { dissection_info instance_state_data_response_dissection_info; dissection_info alive_instances_dissection_info; dissection_info disposed_instances_dissection_info; dissection_info unregistered_instances_dissection_info; dissection_info guid_t_dissection_info; dissection_info value_dissection_info; dissection_info instance_transition_data_dissection_info; dissection_info key_hash_value_dissection_info; dissection_info array_16_byte_dissection_info; dissection_info ntptime_t_dissection_info; dissection_info sequence_number_t_dissection_info; dissection_info serialized_key_dissection_info; dissection_info payload_dissection_info; } builtin_types_dissection_infos; /* Dissection info of types that are sent as user data but doesn't publish discovery data */ typedef struct { builtin_types_type_mappings type_mappings; builtin_types_dissection_infos dissection_infos; } builtin_types_dissection_data_t; static builtin_types_dissection_data_t builtin_types_dissection_data; /* static type_mapping instance_state_data_response_type_mapping; static dissection_info instance_state_data_response_dissection_info; static dissection_info alive_instances_dissection_info; static dissection_info disposed_instances_dissection_info; static dissection_info unregistered_instances_dissection_info; static dissection_info writer_guid_dissection_info; static dissection_info reader_guid_dissection_info; static dissection_info value_dissection_info; */ static const fragment_items rtps_frag_items = { &ett_rtps_fragment, &ett_rtps_fragments, &hf_rtps_fragments, &hf_rtps_fragment, &hf_rtps_fragment_overlap, &hf_rtps_fragment_overlap_conflict, &hf_rtps_fragment_multiple_tails, &hf_rtps_fragment_too_long_fragment, &hf_rtps_fragment_error, &hf_rtps_fragment_count, &hf_rtps_reassembled_in, &hf_rtps_reassembled_length, &hf_rtps_reassembled_data, "RTPS fragments" }; /******************************************************************************/ /* PRE-SHARED KEY DECODING FUNCTIONALITY */ /******************************************************************************/ #define RTPS_HMAC_256_BUFFER_SIZE_BYTES 32 typedef struct { uint32_t host_id; uint32_t app_id; uint32_t instance_id; } rtps_guid_prefix_t; typedef enum { CRYPTO_ALGORITHM_NONE = CRYPTO_TRANSFORMATION_KIND_NONE, CRYPTO_ALGORITHM_AES128_GMAC = CRYPTO_TRANSFORMATION_KIND_AES128_GMAC, CRYPTO_ALGORITHM_AES128_GCM = CRYPTO_TRANSFORMATION_KIND_AES128_GCM, CRYPTO_ALGORITHM_AES256_GMAC = CRYPTO_TRANSFORMATION_KIND_AES256_GMAC, CRYPTO_ALGORITHM_AES256_GCM = CRYPTO_TRANSFORMATION_KIND_AES256_GCM } rtps_encryption_algorithm_t; #define RTPS_SECURITY_INIT_VECTOR_LEN 12 typedef struct { rtps_guid_prefix_t guid_prefix; bool try_psk_decryption; uint32_t session_id; uint32_t transformation_key; rtps_encryption_algorithm_t algorithm; uint8_t init_vector[RTPS_SECURITY_INIT_VECTOR_LEN]; uint32_t psk_index; } rtps_current_packet_decryption_info_t; typedef struct { uint32_t value; bool ignore; } rtps_psk_options_entry_uint32_string_t; typedef struct { char *passphrase_secret; char *passphrase_id_in; rtps_psk_options_entry_uint32_string_t passphrase_id; char *host_id_in; rtps_psk_options_entry_uint32_string_t host_id; char *app_id_in; rtps_psk_options_entry_uint32_string_t app_id; char *instance_id_in; rtps_psk_options_entry_uint32_string_t instance_id; } rtps_psk_options_entry_t; /* PSK table options in RTPS protocol options */ typedef struct { rtps_psk_options_entry_t *entries; unsigned size; } rtps_psk_options_t; static rtps_psk_options_t rtps_psk_options = { NULL, 0 }; /* * The table presented to the user has five columns: psk_index_str, psk, * host_id, app_id, and instance_id. Decoding of the RTPS message using the * pre-shared key will only take place if there is a match in the host_id, * app_id, instance_id, and psk_index. These fields do not require a match if * the user leaves them empty or containing only the '*' wildcard character * (note that the the psk secret passphrase must always match). Ignoring all the * previuos fields will result in an attempt to decode the RTPS message * regardless of the GUID or the PSK index. */ UAT_CSTRING_CB_DEF( rtps_psk_table_entry_field, passphrase_id_in, rtps_psk_options_entry_t) UAT_CSTRING_CB_DEF( rtps_psk_table_entry_field, passphrase_secret, rtps_psk_options_entry_t) UAT_CSTRING_CB_DEF( rtps_psk_table_entry_field, host_id_in, rtps_psk_options_entry_t) UAT_CSTRING_CB_DEF( rtps_psk_table_entry_field, app_id_in, rtps_psk_options_entry_t) UAT_CSTRING_CB_DEF( rtps_psk_table_entry_field, instance_id_in, rtps_psk_options_entry_t) static uat_field_t rtps_psk_table_field_array[] = { UAT_FLD_CSTRING( rtps_psk_table_entry_field, passphrase_id_in, "Passphrase Id", "Integer identifying the secret. " "Use the '*' character to match any Id."), UAT_FLD_CSTRING( rtps_psk_table_entry_field, passphrase_secret, "Passphrase Secret", "Seed used to derive the pre-shared secret key"), UAT_FLD_CSTRING( rtps_psk_table_entry_field, host_id_in, "Host ID (Hex)", "Limit the decoding to RTPS messages coming from the specified GUID." "Leave the field empty or use the '*' character to match any GUID."), UAT_FLD_CSTRING( rtps_psk_table_entry_field, app_id_in, "App ID (Hex)", "Limit the decoding to RTPS messages coming from the specified GUID." "Leave the field empty or use the '*' character to match any GUID."), UAT_FLD_CSTRING( rtps_psk_table_entry_field, instance_id_in, "Instance ID (Hex)", "Limit the decoding to RTPS messages coming from the specified GUID." "Leave the field empty or use the '*' character to match any GUID."), UAT_END_FIELDS }; static void *rtps_psk_options_copy_entry( void *destination, const void *source, size_t length _U_) { const rtps_psk_options_entry_t *src = source; rtps_psk_options_entry_t *dest = destination; dest->passphrase_secret = g_strdup(src->passphrase_secret); dest->passphrase_id = src->passphrase_id; dest->passphrase_id_in = g_strdup(src->passphrase_id_in); dest->host_id = src->host_id; dest->host_id_in = g_strdup(src->host_id_in); dest->app_id = src->app_id; dest->app_id_in = g_strdup(src->app_id_in); dest->instance_id = src->instance_id; dest->instance_id_in = g_strdup(src->instance_id_in); return dest; } static void rtps_psk_options_free_entry(void *record) { rtps_psk_options_entry_t *entry = record; g_free(entry->passphrase_secret); entry->passphrase_secret = NULL; g_free(entry->passphrase_id_in); entry->passphrase_id_in = NULL; g_free(entry->host_id_in); entry->host_id_in = NULL; g_free(entry->app_id_in); entry->app_id_in = NULL; g_free(entry->instance_id_in); entry->instance_id_in = NULL; return; } static bool rtps_psk_options_entry_uint32_string_validate( char **error_string, rtps_psk_options_entry_uint32_string_t *out, char *in, const char *field_name) { if (in == NULL || strlen(in) == 0 || in[0] == '*') { out->ignore = true; } else { if (!ws_strtou32(in, NULL, &out->value)) { *error_string = g_strdup_printf( "The '%s' field must be either the '*' wildcard character, or a " "valid integer.", field_name); return false; } } return true; } static bool rtps_psk_options_update_entry(void *record, char **error_string) { size_t PASSPHRASE_MAX_LENGTH = 512; /* fixed by specification. */ rtps_psk_options_entry_t *entry = record; size_t passphrase_length = 0; /* Validation of the Passphrase Id. */ if (!rtps_psk_options_entry_uint32_string_validate( error_string, &entry->passphrase_id, entry->passphrase_id_in, "Passphrase Id")) { return false; } /* Validation of the Passphrase Secret. */ if (entry->passphrase_secret == NULL) { *error_string = g_strdup("The 'Passphrase Secret' field can't be empty"); return false; } g_strstrip(entry->passphrase_secret); passphrase_length = strlen(entry->passphrase_secret); if (passphrase_length == 0) { *error_string = g_strdup("The 'Passphrase Secret' field can't be empty"); return false; } if (passphrase_length > (PASSPHRASE_MAX_LENGTH - 1)) { *error_string = g_strdup_printf( "The 'Passphrase Secret' field has %zu characters length. " "It cannot be larger than %zu characters.", passphrase_length, PASSPHRASE_MAX_LENGTH - 1); /* last byte is for null character. */ return false; } /* Validation of the Host Id. */ if (!rtps_psk_options_entry_uint32_string_validate( error_string, &entry->host_id, entry->host_id_in, "Host Id")) { return false; } /* Validation of the App Id. */ if (!rtps_psk_options_entry_uint32_string_validate( error_string, &entry->app_id, entry->app_id_in, "App Id")) { return false; } /* Validation of the Instance Id. */ if (!rtps_psk_options_entry_uint32_string_validate( error_string, &entry->instance_id, entry->instance_id_in, "Instance Id")) { return false; } return true; } /* End of PSK table options */ static void rtps_current_packet_decryption_info_reset( rtps_current_packet_decryption_info_t *info) { rtps_guid_prefix_t guid_prefix_zero = {0, 0, 0}; info->guid_prefix = guid_prefix_zero; info->try_psk_decryption = false; info->session_id = 0; info->transformation_key = 0; info->algorithm = CRYPTO_ALGORITHM_NONE; memset(info->init_vector, 0, RTPS_SECURITY_INIT_VECTOR_LEN); info->psk_index = 0; return; } /* ----------------------- PSK Session Key Generation ---------------------- */ /* * The session key is calculated as follows: * HMAC-SHA256( * master_sender_key, * "SessionKey" | master_sender_salt | session_id) * * This is implemented in rtps_psk_generate_session_key. * * Each component of the above formula can be obtained as follows: * * - master_sender_key and master_sender_salt 32 bytes element computed from: * HMAC-SHA256(prk_key, | 0x01) * * - prk_key: Implemented in rtps_psk_generate_prk_key. * HMAC-SHA256(public_salt_for_master_key, preshared_secret_key) * * - public_salt_for_master_key (256 bits): Implemented in * rtps_generate_public_salt. * concatenate( * (64 bits), * (32 bits), * RTPS header (160 bits)) * - preshared_secret_key: Secret key given by the user in the * dialog. * * Where is equal to "master sender key derivation" for * the master_sender_key and "master salt derivation" for the * master_sender_salt. * * Where is equal to "PSK-SKEY" for the master_sender_key and * "PSK-SALT" for the master_sender_salt. * * Where is sent in the transformation_key_id field of the * crypto header (only when the message is encoded using PSK). * * This is implemented in rtps_psk_generate_master_sender. * * - session_id: We can read the session_id from the crypto header of the * SRTPS_PREFIX submessage. * Note: The session_id is a counter starting at zero and increased by one * every time we have encoded a specific number of messages. */ static bool rtps_psk_generate_master_sender( uint8_t *output, bool is_salt, const char* preshared_secret_key, uint32_t sender_key_id, tvbuff_t *rtps_header_tvb, int rtps_header_tvb_offset); static gcry_error_t rtps_util_generate_hmac_sha256( void *output, const void *key, const void *data, size_t datalen); /** * @brief Generate the session key that will be used to decrypt PSK-encoded RTPS * messages. It requires the pre-shared secret key known and given by the user, * the RTPS header, and two fields (sender key id and session id) sent on the * wire. */ static bool rtps_psk_generate_session_key( packet_info *pinfo, const char *preshared_secret_key, uint32_t sender_key_id, uint32_t session_id, uint8_t *buffer) { const char *sessionKeyString = "SessionKey"; rtps_tvb_field* rtps_root = NULL; uint8_t sender_key[RTPS_HMAC_256_BUFFER_SIZE_BYTES]; /* * Must be big enough to fit the sessionKeyString, the master sender key and * the session id. */ uint8_t input[50]; size_t offset = 0; rtps_root = (rtps_tvb_field*) p_get_proto_data( pinfo->pool, pinfo, proto_rtps, RTPS_ROOT_MESSAGE_KEY); if (rtps_root == NULL || buffer == NULL) { return false; } memcpy(input, sessionKeyString, strlen(sessionKeyString)); offset += strlen(sessionKeyString); if (!rtps_psk_generate_master_sender( input + offset, true, /* is_salt. */ preshared_secret_key, sender_key_id, rtps_root->tvb, rtps_root->tvb_offset)) { return false; } offset += RTPS_HMAC_256_BUFFER_SIZE_BYTES; memcpy( input + offset, &session_id, sizeof(uint32_t)); offset += sizeof(uint32_t); if (!rtps_psk_generate_master_sender( sender_key, false, /* is_salt. */ preshared_secret_key, sender_key_id, rtps_root->tvb, rtps_root->tvb_offset)) { return false; } return rtps_util_generate_hmac_sha256( buffer, sender_key, input, offset) == GPG_ERR_NO_ERROR; } static bool rtps_psk_generate_prk_key( uint8_t *output, const char *prefix, const char *preshared_secret_key, uint32_t sender_key_id, tvbuff_t *rtps_header_tvb, int rtps_header_tvb_offset); /** * @brief Generate the master sender key or master sender salt (depending on the * is_salt parameter) that will be used to derive the session key. */ static bool rtps_psk_generate_master_sender( uint8_t *output, bool is_salt, const char* preshared_secret_key, uint32_t sender_key_id, tvbuff_t *rtps_header_tvb, int rtps_header_tvb_offset) { const char *prk_prefix = is_salt ? "PSK-SALT" : "PSK-SKEY"; const char *suffix = is_salt ? "master salt derivation" : "master sender key derivation"; uint8_t prk_key[RTPS_HMAC_256_BUFFER_SIZE_BYTES]; /* Must be big enough to fit the largest suffix and the 0x1 constant byte. */ uint8_t input[50]; if (!rtps_psk_generate_prk_key( prk_key, prk_prefix, preshared_secret_key, sender_key_id, rtps_header_tvb, rtps_header_tvb_offset)) { return false; } memcpy(input, suffix, strlen(suffix)); input[strlen(suffix)] = 0x1; /* Fixed value. */ return rtps_util_generate_hmac_sha256( output, prk_key, input, strlen(suffix) + 1) == GPG_ERR_NO_ERROR; } static void rtps_generate_public_salt( uint8_t *output, const char *prefix, uint32_t sender_key_id, tvbuff_t *rtps_header_tvb, int rtps_header_tvb_offset); /** * @brief Compute the Pseudo-Random Key; an intermediate step to get the * master sender. This function computes: * HMAC-SHA256( * concatenate(prefix, sender_key_id. rtps_header), * preshared_secret_key) */ static bool rtps_psk_generate_prk_key( uint8_t *output, const char *prefix, const char *preshared_secret_key, uint32_t sender_key_id, tvbuff_t *rtps_header_tvb, int rtps_header_tvb_offset) { gcry_error_t error = GPG_ERR_NO_ERROR; uint8_t public_salt[RTPS_HMAC_256_BUFFER_SIZE_BYTES]; rtps_generate_public_salt( public_salt, prefix, sender_key_id, rtps_header_tvb, rtps_header_tvb_offset); error = rtps_util_generate_hmac_sha256( output, public_salt, preshared_secret_key, strlen(preshared_secret_key)); return error == GPG_ERR_NO_ERROR; } /** * @brief Generates the public salt that can be used to derive the prk_key * and prk_salt Pseudo-Random Keys. * * It does the concatenation of: * concatenate( * <8-byte prefix>, * <4-byte sender's key id>, * <20-byte RTPS header>) * So output must be a 32-byte buffer (i.e. RTPS_HMAC_256_BUFFER_SIZE_BYTES). */ static void rtps_generate_public_salt( uint8_t *output, const char *prefix, uint32_t sender_key_id, tvbuff_t *rtps_header_tvb, int rtps_header_tvb_offset) { size_t offset = 0; /* Copy the 8-byte prefix. */ memcpy(output, prefix, strlen(prefix)); offset += strlen(prefix); /* Copy the 4-byte sender's key id. */ memcpy(output + offset, &sender_key_id, sizeof(uint32_t)); offset += sizeof(uint32_t); /* Copy the 20-byte RTPS header. */ tvb_memcpy( rtps_header_tvb, output + offset, rtps_header_tvb_offset, 20); /* RTPS HEADER SIZE. */ return; } /** * @brief Compute the HMAC-SHA256 of the data using the key. * This function is required to derive the PSK session key. */ static gcry_error_t rtps_util_generate_hmac_sha256( void *output, const void *key, const void *data, size_t datalen) { gcry_mac_hd_t hmac; gcry_error_t error = GPG_ERR_NO_ERROR; size_t OUTPUT_SIZE = RTPS_HMAC_256_BUFFER_SIZE_BYTES; error = gcry_mac_open(&hmac, GCRY_MAC_HMAC_SHA256, 0, NULL); if (error != GPG_ERR_NO_ERROR) { gcry_mac_close(hmac); return error; } error = gcry_mac_setkey(hmac, key, RTPS_HMAC_256_BUFFER_SIZE_BYTES); if (error != GPG_ERR_NO_ERROR) { gcry_mac_close(hmac); return error; } error = gcry_mac_write(hmac, data, datalen); if (error != GPG_ERR_NO_ERROR) { gcry_mac_close(hmac); return error; } error = gcry_mac_read(hmac, output, &OUTPUT_SIZE); if (error != GPG_ERR_NO_ERROR) { gcry_mac_close(hmac); fprintf (stderr, "Failure: %s/%s\n", gcry_strsource (error), gcry_strerror (error)); return error; } gcry_mac_close(hmac); return error; } /* ------------------------------------------------------------------------- */ /** * @brief Translate between the RTPS and gcrypt types. */ static int rtps_encryption_algorithm_to_gcry_enum( rtps_encryption_algorithm_t rtps_enum_in, int *gcry_cipher_mode_out) { if (gcry_cipher_mode_out == NULL) { return -1; } switch(rtps_enum_in) { case CRYPTO_ALGORITHM_AES128_GMAC: *gcry_cipher_mode_out = GCRY_CIPHER_MODE_CCM; return GCRY_CIPHER_AES128; case CRYPTO_ALGORITHM_AES128_GCM: *gcry_cipher_mode_out = GCRY_CIPHER_MODE_GCM; return GCRY_CIPHER_AES128; case CRYPTO_ALGORITHM_AES256_GMAC: *gcry_cipher_mode_out = GCRY_CIPHER_MODE_CCM; return GCRY_CIPHER_AES256; case CRYPTO_ALGORITHM_AES256_GCM: *gcry_cipher_mode_out = GCRY_CIPHER_MODE_GCM; return GCRY_CIPHER_AES256; case CRYPTO_ALGORITHM_NONE: default: *gcry_cipher_mode_out = GCRY_CIPHER_MODE_NONE; return GCRY_CIPHER_NONE; } } static gcry_error_t rtps_util_decrypt_data( uint8_t *encrypted_data, size_t encrypted_data_size, uint8_t *key, uint8_t *init_vector, uint8_t *tag, rtps_encryption_algorithm_t algorithm) { gcry_error_t err = GPG_ERR_NO_ERROR; gcry_cipher_hd_t cipher_hd; int encription_algo; int encription_mode = 0; encription_algo = rtps_encryption_algorithm_to_gcry_enum( algorithm, &encription_mode); err = gcry_cipher_open( &cipher_hd, encription_algo, encription_mode, 0); if (err != GPG_ERR_NO_ERROR) { ws_warning( "GCRY: cipher open %s/%s\n", gcry_strsource(err), gcry_strerror(err)); return err; } err = gcry_cipher_setkey(cipher_hd, key, RTPS_HMAC_256_BUFFER_SIZE_BYTES); if (err != GPG_ERR_NO_ERROR) { ws_warning( "GCRY: setkey %s/%s\n", gcry_strsource(err), gcry_strerror(err)); gcry_cipher_close(cipher_hd); return err; } if (init_vector != NULL) { err = gcry_cipher_setiv( cipher_hd, init_vector, RTPS_SECURITY_INIT_VECTOR_LEN); if (err != GPG_ERR_NO_ERROR) { ws_warning( "GCRY: setiv %s/%s\n", gcry_strsource(err), gcry_strerror(err)); gcry_cipher_close(cipher_hd); return err; } } err = gcry_cipher_decrypt( cipher_hd, encrypted_data, encrypted_data_size, NULL, 0); if (err != GPG_ERR_NO_ERROR) { ws_warning( "GCRY: encrypt %s/%s\n", gcry_strsource(err), gcry_strerror(err)); gcry_cipher_close(cipher_hd); return err; } if (tag != NULL) { err = gcry_cipher_checktag(cipher_hd, tag, SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH); if (err != GPG_ERR_NO_ERROR) { ws_warning( "GCRY: Decryption (checktag) failed: %s/%s\n", gcry_strsource(err), gcry_strerror(err)); } } gcry_cipher_close(cipher_hd); return err; } /** * @brief Generates the session key and uses it to decrypt the secure payload. * The decripted payload is stored in an allocated buffer using the allocator * passed as parameter. */ static uint8_t *rtps_decrypt_secure_payload( tvbuff_t *tvb, packet_info *pinfo, int offset, size_t secure_payload_len, uint8_t *preshared_secret_key, uint8_t *init_vector, rtps_encryption_algorithm_t algorithm, uint32_t transformation_key, uint32_t session_id, uint8_t *tag, uint8_t *session_key_output, gcry_error_t* error, wmem_allocator_t *allocator) { uint8_t *secure_body_ptr; if (!rtps_psk_generate_session_key( pinfo, preshared_secret_key, transformation_key, session_id, session_key_output)) { return NULL; } secure_body_ptr = wmem_alloc0(allocator, secure_payload_len); if (secure_body_ptr == NULL) { return NULL; } tvb_memcpy(tvb, secure_body_ptr, offset, secure_payload_len); *error = rtps_util_decrypt_data( secure_body_ptr, secure_payload_len, session_key_output, init_vector, tag, algorithm); /* * Free the allocated memory if the decryption goes wrong or if the content is * not healthy. */ if (*error != GPG_ERR_NO_ERROR) { wmem_free(allocator, secure_body_ptr); secure_body_ptr = NULL; } return secure_body_ptr; } /******************************************************************************/ static const true_false_string tfs_little_big_endianness = { "Little-Endian", "Big-Endian" }; /* #19359 - ensure strings we copy aren't truncated halfway through a Unicode codepoint */ static void rtps_strlcpy(char *dest, const char *src, size_t dest_size) { /* Reserving the last character in case ws_utf8_truncate overwrites it */ (void) g_strlcpy(dest, src, dest_size); ws_utf8_truncate(dest, strlen(dest)); } static int check_offset_addition(int offset, uint32_t value, proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb) { int new_offset = offset + (int)value; if (new_offset < offset) { proto_tree_add_expert_format(tree, pinfo, &ei_rtps_value_too_large, tvb, 0, 0, "Offset value too large: %u", value); THROW(ReportedBoundsError); } return new_offset; } static void rtps_util_dissect_parameter_header(tvbuff_t * tvb, int * offset, const unsigned encoding, uint32_t * member_id, uint32_t * member_length) { *member_id = tvb_get_uint16(tvb, *offset, encoding); *offset += 2; *member_length = tvb_get_uint16(tvb, *offset, encoding); *offset += 2; if ((*member_id & PID_EXTENDED) == PID_EXTENDED) { /* get extended member id and length */ *member_id = tvb_get_uint32(tvb, *offset, encoding); *offset += 4; *member_length = tvb_get_uint32(tvb, *offset, encoding); *offset += 4; } } static int dissect_crypto_algorithm_requirements(proto_tree *tree , tvbuff_t* tvb, int offset, int encoding, int* const *flags) { proto_tree_add_bitmask( tree, tvb, offset, hf_rtps_param_crypto_algorithm_requirements_trust_chain, ett_rtps_flags, flags, encoding); offset += 4; proto_tree_add_bitmask( tree, tvb, offset, hf_rtps_param_crypto_algorithm_requirements_message_auth, ett_rtps_flags, flags, encoding); offset += 4; return offset; } static int dissect_mutable_member(proto_tree *tree , tvbuff_t * tvb, packet_info *pinfo, int offset, unsigned encoding, unsigned encoding_version, dissection_info * info, bool * is_end, bool show); static int get_native_type_cdr_length(uint64_t member_kind) { unsigned length = 0; switch (member_kind) { case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE: { length = 1; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE: case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE: { length = 1; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE: { length = 2; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE: { length = 2; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE: case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE: { length = 4; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE: { length = 4; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE: { length = 8; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE: { length = 8; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE: { length = 4; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE: { length = 8; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE: { length = 16; break; } default: { /* XXX We should probably add expert info, but make sure our offset advances for now. */ length = 1; break; } } return length; } static int get_native_type_cdr_alignment(uint64_t member_kind, int encapsulation_version) { unsigned align = 0; switch (member_kind) { case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE: { align = 1; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE: case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE: { align = 1; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE: { align = 2; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE: { align = 2; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE: case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE: { align = 4; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE: { align = 4; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE: { align = (encapsulation_version == 1) ? 8 : 4; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE: { align = (encapsulation_version == 1) ? 8 : 4; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE: { align = 4; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE: { align = (encapsulation_version == 1) ? 8 : 4; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE: { align = (encapsulation_version == 1) ? 8 : 4; break; } default: { align = 1; break; } } return align; } static int get_encapsulation_endianness(int encapsulation_id) { return (encapsulation_id == ENCAPSULATION_CDR_LE || encapsulation_id == ENCAPSULATION_PL_CDR_LE || encapsulation_id == ENCAPSULATION_CDR2_LE || encapsulation_id == ENCAPSULATION_D_CDR2_LE || encapsulation_id == ENCAPSULATION_PL_CDR2_LE) ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN; } static int get_encapsulation_version(int encapsulation_id) { return (encapsulation_id == ENCAPSULATION_CDR2_LE || encapsulation_id == ENCAPSULATION_D_CDR2_LE || encapsulation_id == ENCAPSULATION_PL_CDR2_LE) ? 2 : 1; } static dissection_info* lookup_dissection_info_in_custom_and_builtin_types(uint64_t type_id) { dissection_info* info = NULL; if (dissection_infos != NULL) { info = (dissection_info*)wmem_map_lookup(dissection_infos, &(type_id)); if (info == NULL && builtin_dissection_infos != NULL) { info = (dissection_info*)wmem_map_lookup(builtin_dissection_infos, &(type_id)); } } return info; } /* this is a recursive function. _info may or may not be NULL depending on the use iteration */ // NOLINTNEXTLINE(misc-no-recursion) static int dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, packet_info *pinfo, int offset, unsigned encoding, unsigned encoding_version, dissection_info * _info, uint64_t type_id, char * name, RTICdrTypeObjectExtensibility extensibility, int offset_zero, uint16_t flags, uint32_t element_member_id, bool show) { uint64_t member_kind; dissection_info * info = NULL; uint32_t member_id; uint32_t member_length = 0; if (_info) { /* first call enters here */ info = _info; member_kind = info->member_kind; } else { info = lookup_dissection_info_in_custom_and_builtin_types(type_id); if (info != NULL) { member_kind = info->member_kind; } else { member_kind = type_id; } } if ((flags & MEMBER_OPTIONAL) != 0) { int offset_before = offset; /* Parameter header is at minimum 4 bytes */ ALIGN_ZERO( offset, get_native_type_cdr_alignment(RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE, encoding_version), offset_zero); rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); if (info && (flags & MEMBER_OPTIONAL) == MEMBER_OPTIONAL && element_member_id != 0 && member_id != element_member_id) { offset = offset_before; return offset; } if (member_length == 0) { return offset; } } if (extensibility == EXTENSIBILITY_MUTABLE) { rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); offset_zero = offset; if ((member_id & PID_LIST_END) == PID_LIST_END){ /* If this is the end of the list, don't add a tree. * If we add more logic here in the future, take into account that * offset is incremented by 4 */ offset += 0; return offset; } if (member_length == 0){ return offset; } } //proto_item_append_text(tree, "(Before Switch 0x%016" PRIx64 ")", type_id); increment_dissection_depth(pinfo); switch (member_kind) { case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE: { int length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); int16_t value = tvb_get_int8(tvb, offset); proto_tree_add_boolean_format(tree, hf_rtps_dissection_boolean, tvb, offset, length, value, "%s: %d", name, value); } offset += length; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE: case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE: { int length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); int16_t value = tvb_get_int8(tvb, offset); proto_tree_add_uint_format(tree, hf_rtps_dissection_byte, tvb, offset, length, value, "%s: %d", name, value); } offset += length; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE: { int length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); int16_t value = tvb_get_int16(tvb, offset, encoding); proto_tree_add_int_format(tree, hf_rtps_dissection_int16, tvb, offset, length, value, "%s: %d", name, value); } offset += length; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE: { int length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); uint16_t value = tvb_get_uint16(tvb, offset, encoding); proto_tree_add_uint_format(tree, hf_rtps_dissection_uint16, tvb, offset, length, value, "%s: %u", name, value); } offset += length; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE: case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE: { int length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); int value = tvb_get_int32(tvb, offset, encoding); proto_tree_add_int_format(tree, hf_rtps_dissection_int32, tvb, offset, length, value, "%s: %d", name, value); } offset += length; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE: { int length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); unsigned value = tvb_get_uint32(tvb, offset, encoding); proto_tree_add_uint_format(tree, hf_rtps_dissection_uint32, tvb, offset, length, value, "%s: %u", name, value); } offset += length; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE: { int length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); int64_t value = tvb_get_int64(tvb, offset, encoding); proto_tree_add_int64_format(tree, hf_rtps_dissection_int64, tvb, offset, length, value, "%s: %"PRId64, name, value); } offset += length; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE: { int length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); uint64_t value = tvb_get_uint64(tvb, offset, encoding); proto_tree_add_uint64_format(tree, hf_rtps_dissection_uint64, tvb, offset, length, value, "%s: %"PRIu64, name, value); } offset += length; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE: { int length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); float value = tvb_get_ieee_float(tvb, offset, encoding); proto_tree_add_float_format(tree, hf_rtps_dissection_float, tvb, offset, length, value, "%s: %.6f", name, value); } offset += length; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE: { int length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); double value = tvb_get_ieee_double(tvb, offset, encoding); proto_tree_add_double_format(tree, hf_rtps_dissection_double, tvb, offset, length, value, "%s: %.6f", name, value); } offset += length; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE: { int length = get_native_type_cdr_length(member_kind); if (show) { ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); proto_tree_add_item(tree, hf_rtps_dissection_int128, tvb, offset, length, encoding); } offset += length; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE: { unsigned i; unsigned num_elements; proto_tree * aux_tree = NULL; int base_offset = offset; bool show_current_element = true; int array_kind_length = 0; unsigned bound = 0; int first_skipped_element_offset = 0; if (info != NULL) { bound = (unsigned)info->bound; /* In case this array is not shown and is a native type. We get the sze length for calculating * the whole array length */ array_kind_length = get_native_type_cdr_length(info->base_type_id); } /* Do not add any information to the tree if it is not shown */ if (show) { aux_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtps_dissection_tree, NULL, name); } else if (array_kind_length != -1) { /* Total length of the array. Nothing else to do here. */ offset += bound * array_kind_length; break; } /* Get the maximum number of elements to be shown */ num_elements = (enable_max_array_data_type_elements) ? MIN(bound, rtps_max_array_data_type_elements) : bound; for (i = 0; i < bound; i++) { char temp_buff[MAX_MEMBER_NAME]; if (show && i < num_elements) { /* No need to copy if it will not be shown */ snprintf(temp_buff, MAX_MEMBER_NAME, "%s[%u]", name, i); show_current_element = true; } else { if (show_current_element) { show_current_element = false; /* Updated only once */ first_skipped_element_offset = offset; } /* If this array has elements that won't be shown and is an array of native type * we can calculate the total offset and break the loop */ if (array_kind_length != -1) { offset += (bound - i) * array_kind_length; break; } } offset = dissect_user_defined(aux_tree, tvb, pinfo, offset, encoding, encoding_version, NULL, info->base_type_id, temp_buff, EXTENSIBILITY_INVALID, offset_zero, 0, 0, show_current_element); } /* If reached the limit and there are remaining elements we need to show the message and * assign the length of the ramining elements to this */ if (enable_max_array_data_type_elements && show && !show_current_element) { proto_tree_add_subtree_format( aux_tree, tvb, /* Start at the first item not shown */ first_skipped_element_offset, offset - first_skipped_element_offset, ett_rtps_info_remaining_items, NULL, DISSECTION_INFO_REMAINING_ELEMENTS_STR_d, bound - num_elements); } proto_item_set_len(aux_tree, offset - base_offset); break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE: { unsigned i; unsigned num_elements; proto_tree * aux_tree = NULL; int base_offset = offset; bool show_current_element = true; int length = 4; int sequence_kind_length = 0; int first_skipped_element_offset = 0; ALIGN_ZERO(offset, length, offset_zero); unsigned seq_size = tvb_get_uint32(tvb, offset, encoding); /* In case this sequence is not shown and is a native type. We get the sze length for calculating * the whole seuqnece length */ if (info != NULL) { sequence_kind_length = get_native_type_cdr_length(info->base_type_id); } if (show) { aux_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_rtps_dissection_tree, NULL, "%s (%u elements)", name, seq_size); /* If it is a native type we can calculate the sequence length and finish. */ } else if (sequence_kind_length != -1) { /* Number of elements integer size + number of elements * size of the native type */ offset += 4 + seq_size * sequence_kind_length; break; } offset += 4; num_elements = (enable_max_array_data_type_elements) ? MIN(seq_size, rtps_max_array_data_type_elements) : seq_size; for (i = 0; i < seq_size; i++) { char temp_buff[MAX_MEMBER_NAME]; if (show && i < num_elements) { /* No need to copy if it will not be shown */ snprintf(temp_buff, MAX_MEMBER_NAME, "%s[%u]", name, i); show_current_element = true; } else { if (show_current_element) { show_current_element = false; /* Updated only once */ first_skipped_element_offset = offset; } /* If this array has elements that won't be shown and is an array of native type * we can calculate the total offset and break the loop */ if (sequence_kind_length != -1) { offset += (seq_size - i) * sequence_kind_length; break; } } if (info != NULL && info->base_type_id > 0) offset = dissect_user_defined(aux_tree, tvb, pinfo, offset, encoding, encoding_version, NULL, info->base_type_id, temp_buff, EXTENSIBILITY_INVALID, offset_zero, 0, 0, show_current_element); } /* If reached the limit and there are remaining elements we need to show the message and * assign the length of the ramining elements to this */ if (enable_max_array_data_type_elements && show && !show_current_element) { proto_tree_add_subtree_format( aux_tree, tvb, /* Start at the first item not shown */ first_skipped_element_offset, offset - first_skipped_element_offset, ett_rtps_info_remaining_items, NULL, DISSECTION_INFO_REMAINING_ELEMENTS_STR_d, seq_size - num_elements); } proto_item_set_len(aux_tree, offset - base_offset); break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRING_TYPE: { char * string_value = NULL; int length = 4; ALIGN_ZERO(offset, length, offset_zero); unsigned string_size = tvb_get_uint32(tvb, offset, encoding); offset += 4; //proto_item_append_text(tree, "(String length: %u)", string_size); if (show) { string_value = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, string_size, ENC_ASCII); proto_tree_add_string_format(tree, hf_rtps_dissection_string, tvb, offset, string_size, string_value, "%s: %s", name, string_value); } offset += string_size; break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ALIAS_TYPE: { uint64_t base_type_id = 0; if (info != NULL) { base_type_id = info->base_type_id; } offset = dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL, base_type_id, name, EXTENSIBILITY_INVALID, offset_zero, 0, 0, show); break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UNION_TYPE: { uint64_t key = type_id - 1; union_member_mapping * result = (union_member_mapping *)wmem_map_lookup(union_member_mappings, &(key)); if (result != NULL) { int value = tvb_get_int32(tvb, offset, encoding); offset += 4; key = type_id + value; result = (union_member_mapping *)wmem_map_lookup(union_member_mappings, &(key)); if (result != NULL) { if (show) { proto_item_append_text(tree, " (discriminator = %d, type_id = 0x%016" PRIx64 ")", value, result->member_type_id); } offset = dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL, result->member_type_id, result->member_name, EXTENSIBILITY_INVALID, offset, 0, 0, show); } else { /* the hashmap uses the type_id to index the objects. subtracting -2 here to lookup the discriminator related to the type_id that identifies an union */ key = type_id + HASHMAP_DISCRIMINATOR_CONSTANT; result = (union_member_mapping *)wmem_map_lookup(union_member_mappings, &(key)); if (result != NULL) { if (show) { proto_item_append_text(tree, " (discriminator = %d, type_id = 0x%016" PRIx64 ")", value, result->member_type_id); } offset = dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL, result->member_type_id, result->member_name, EXTENSIBILITY_INVALID, offset, 0, 0, show); } } } else { if (show) { proto_item_append_text(tree, "(NULL 0x%016" PRIx64 ")", type_id); } } break; } case RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE: { unsigned i; proto_tree * aux_tree = NULL; unsigned shown_elements = 0; bool show_current_element = true; unsigned num_elements = 0; int first_skipped_element_offset = 0; if (info != NULL) { if (show) { aux_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtps_dissection_tree, NULL, name); } if (info->extensibility == EXTENSIBILITY_MUTABLE) { bool is_end = false; /* Don't know beforehand the number of elements. Need to count them */ while (!is_end) { if (!(show && shown_elements < rtps_max_data_type_elements) && show_current_element) { show_current_element = false; /* Updated only once */ first_skipped_element_offset = offset; } offset = dissect_mutable_member(aux_tree, tvb, pinfo, offset, encoding, encoding_version, info, &is_end, show_current_element); ++num_elements; if (show_current_element) { ++shown_elements; } } } else { if (info->base_type_id > 0) { if (show) { proto_item_append_text(tree, "(BaseId: 0x%016" PRIx64 ")", info->base_type_id); } offset = dissect_user_defined(aux_tree, tvb, pinfo, offset, encoding, encoding_version, NULL, info->base_type_id, info->member_name, EXTENSIBILITY_INVALID, offset, 0, 0, show); } /* Get the maximum number of elements to be shown depending if enable_max_data_type_elements is enabled */ shown_elements = (enable_max_data_type_elements) ? MIN(info->num_elements, rtps_max_data_type_elements) : info->num_elements; for (i = 0; i < info->num_elements; i++) { if (info->elements[i].type_id > 0) { /* A member is shown if the parent cluster is shown and the position is in the * range of maximum number of elements shown */ if (!(show && i < shown_elements) && show_current_element) { show_current_element = false; /* Updated only once */ first_skipped_element_offset = offset; } /* If a member is not shown all it children will inherit the "show_current_element" value */ offset = dissect_user_defined(aux_tree, tvb, pinfo, offset, encoding, encoding_version, NULL, info->elements[i].type_id, info->elements[i].member_name, info->extensibility, offset_zero, info->elements[i].flags, info->elements[i].member_id, show_current_element); } } num_elements = info->num_elements; } /* If reached the limit and there are remaining elements we need to show the message and * assign the length of the ramining elements to this */ if (enable_max_array_data_type_elements && show && !show_current_element) { proto_tree_add_subtree_format( aux_tree, tvb, first_skipped_element_offset, offset - first_skipped_element_offset, ett_rtps_info_remaining_items, NULL, DISSECTION_INFO_REMAINING_ELEMENTS_STR_d, num_elements - shown_elements); } } break; } default:{ /* undefined behavior. this should not happen. the following line helps to debug if it happened */ if (show) { proto_item_append_text(tree, "(unknown 0x%016" PRIx64 ")", member_kind); } break; } } decrement_dissection_depth(pinfo); if (extensibility == EXTENSIBILITY_MUTABLE) { offset_zero += member_length; return offset_zero; } else { return offset; } } // NOLINTNEXTLINE(misc-no-recursion) static int dissect_mutable_member(proto_tree *tree , tvbuff_t * tvb, packet_info *pinfo, int offset, unsigned encoding, unsigned encoding_version, dissection_info * info, bool * is_end, bool show) { proto_tree * member; uint32_t member_id, member_length; mutable_member_mapping * mapping; int64_t key; rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length); if ((member_id & PID_LIST_END) == PID_LIST_END){ /* If this is the end of the list, don't add a tree. * If we add more logic here in the future, take into account that * offset is incremented by 4 */ offset += 0; *is_end = true; return offset; } if (member_length == 0){ return offset; } member = proto_tree_add_subtree_format(tree, tvb, offset, member_length, ett_rtps_dissection_tree, NULL, "ID: %d, Length: %d", member_id, member_length); { if (info->base_type_id > 0) { key = (info->base_type_id + info->base_type_id * member_id); mapping = (mutable_member_mapping *) wmem_map_lookup(mutable_member_mappings, &(key)); if (mapping) { /* the library knows how to dissect this */ proto_item_append_text(member, "(base found 0x%016" PRIx64 ")", key); dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL, mapping->member_type_id, mapping->member_name, EXTENSIBILITY_INVALID, offset, 0, mapping->member_id, show); proto_item_set_hidden(member); return check_offset_addition(offset, member_length, tree, NULL, tvb); } else proto_item_append_text(member, "(base not found 0x%016" PRIx64 " from 0x%016" PRIx64 ")", key, info->base_type_id); } } key = (info->type_id + info->type_id * member_id); mapping = (mutable_member_mapping *) wmem_map_lookup(mutable_member_mappings, &(key)); if (mapping) { /* the library knows how to dissect this */ proto_item_append_text(member, "(found 0x%016" PRIx64 ")", key); dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL, mapping->member_type_id, mapping->member_name, EXTENSIBILITY_INVALID, offset, 0, mapping->member_id, show); } else proto_item_append_text(member, "(not found 0x%016" PRIx64 " from 0x%016" PRIx64 ")", key, info->type_id); proto_item_set_hidden(member); return check_offset_addition(offset, member_length, tree, NULL, tvb); } /* *********************************************************************** */ /* Appends extra formatting for those submessages that have a status info */ static void generate_status_info(packet_info *pinfo, uint32_t writer_id, uint32_t 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 * ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER | Pc * ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER | Pc * ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER | Pb * ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER | Pb * ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER | sPc * ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER | sPc * 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 */ char * writerId = NULL; char * disposeFlag = NULL; char * unregisterFlag = NULL; wmem_strbuf_t *buffer = wmem_strbuf_create(wmem_packet_scope()); submessage_col_info* current_submessage_col_info = NULL; current_submessage_col_info = (submessage_col_info*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY); 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_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; case ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER: case ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER: writerId = "Pb"; break; case ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER: case ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER: writerId = "Pc"; break; case ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER: case ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER: writerId = "sPc"; break; case ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER: case ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER: { /* This is added to proto_rtps in rtps_util_add_rti_service_request* */ uint32_t* service_id = (uint32_t*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_SERVICE_REQUEST_ID_PROTODATA_KEY); if (service_id != NULL && *service_id == RTI_SERVICE_REQUEST_ID_TOPIC_QUERY) { writerId = "tq"; } 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, ")"); current_submessage_col_info->status_info = wmem_strbuf_get_str(buffer); } } /* *********************************************************************** */ /* * Coherent set starts if seqNumber == writerSeqNumber * * Coherent sets end in three different ways: * - A new coherence set starts with the consecutive writerSeqNumber of the last coherent set packet. * -seqNumber == RTPS_SEQUENCENUMBER_UNKNOWN * - A DATA packet sent with the consecutive writerSeqNumber of the last coherent set packet. * - PID_END_COHERENT_SET received. That condition is not handled here. Check PID_END_COHERENT_SET dissection. * Empty Data condition is not handled here. rtps_util_detect_coherent_set_end_empty_data_case called at the end of dissect_RTPS_DATA and dissect_RTPS_DATA_FRAG_kind */ static void rtps_util_add_coherent_set_general_cases_case( proto_tree *tree, tvbuff_t *tvb, uint64_t coherent_seq_number, coherent_set_entity_info *coherent_set_entity_info_object) { coherent_set_entity_info *register_entry; proto_tree *marked_item_tree; coherent_set_info *coherent_set_info_entry; coherent_set_key coherent_set_info_key; coherent_set_entity_info_object->coherent_set_seq_number = coherent_seq_number; register_entry = (coherent_set_entity_info*)wmem_map_lookup(coherent_set_tracking.entities_using_map, &coherent_set_entity_info_object->guid); if (!register_entry) { register_entry = (coherent_set_entity_info*)wmem_memdup(wmem_file_scope(), coherent_set_entity_info_object, sizeof(coherent_set_entity_info)); wmem_map_insert( coherent_set_tracking.entities_using_map, ®ister_entry->guid, register_entry); } /* The hash and compare functions treat the key as a sequence of bytes */ memset(&coherent_set_info_key, 0, sizeof(coherent_set_info_key)); coherent_set_info_key.guid = coherent_set_entity_info_object->guid; coherent_set_info_key.coherent_set_seq_number = coherent_seq_number; coherent_set_info_entry = (coherent_set_info*)wmem_map_lookup(coherent_set_tracking.coherent_set_registry_map, &coherent_set_info_key); if (!coherent_set_info_entry) { coherent_set_info_entry = wmem_new0(wmem_file_scope(), coherent_set_info); coherent_set_info_entry->key = (coherent_set_key*)wmem_memdup(wmem_file_scope(), &coherent_set_info_key, sizeof(coherent_set_key)); coherent_set_info_entry->is_set = false; wmem_map_insert( coherent_set_tracking.coherent_set_registry_map, coherent_set_info_entry->key, coherent_set_info_entry); } if (coherent_set_info_entry->writer_seq_number < coherent_set_entity_info_object->writer_seq_number) { coherent_set_info_entry->writer_seq_number = coherent_set_entity_info_object->writer_seq_number; } /* Start */ if (coherent_set_entity_info_object->coherent_set_seq_number == coherent_set_entity_info_object->writer_seq_number) { marked_item_tree = proto_tree_add_uint64(tree, hf_rtps_coherent_set_start, tvb, 0, 0, coherent_seq_number); proto_item_set_generated(marked_item_tree); /* End case: Start of a new coherent set */ if (coherent_set_entity_info_object->coherent_set_seq_number > register_entry->coherent_set_seq_number && coherent_set_entity_info_object->writer_seq_number - 1 == register_entry->writer_seq_number) { coherent_set_info *previous_entry; marked_item_tree = proto_tree_add_uint64(tree, hf_rtps_coherent_set_end, tvb, 0, 0, register_entry->coherent_set_seq_number); proto_item_set_generated(marked_item_tree); coherent_set_info_key.coherent_set_seq_number = register_entry->writer_seq_number; coherent_set_info_key.guid = register_entry->guid; previous_entry = (coherent_set_info*)wmem_map_lookup(coherent_set_tracking.coherent_set_registry_map, &coherent_set_info_key); if (previous_entry) { previous_entry->is_set = true; } } } if (!coherent_set_info_entry->is_set) { coherent_set_info_key.coherent_set_seq_number = coherent_seq_number - 1; /* End case: Sequence unknown received */ if (coherent_set_entity_info_object->coherent_set_seq_number == RTPS_SEQUENCENUMBER_UNKNOWN) { register_entry->coherent_set_seq_number = coherent_set_entity_info_object->coherent_set_seq_number; marked_item_tree = proto_tree_add_uint64(tree, hf_rtps_coherent_set_end, tvb, 0, 0, coherent_set_info_entry->key->coherent_set_seq_number); proto_item_set_generated(marked_item_tree); coherent_set_info_entry->is_set = true; } } else if (coherent_set_info_entry->writer_seq_number == coherent_set_entity_info_object->writer_seq_number) { proto_tree *ti; ti = proto_tree_add_uint64(tree, hf_rtps_coherent_set_end, tvb, 0, 0, coherent_set_info_entry->key->coherent_set_seq_number); proto_item_set_generated(ti); } /* Update the entity */ coherent_set_entity_info_object->expected_coherent_set_end_writers_seq_number = coherent_set_entity_info_object->writer_seq_number + 1; *register_entry = *coherent_set_entity_info_object; } /* * Handles the coherent set termination case where the coherent set finishes by sending a DATA or DATA_FRAG with no parameters. * For the other cases, check rtps_util_add_coherent_set_general_cases_case. * this function must be called at the end of dissect_RTPS_DATA and dissect_RTPS_DATA_FRAG_kind */ static void rtps_util_detect_coherent_set_end_empty_data_case( coherent_set_entity_info *coherent_set_entity_info_object) { coherent_set_entity_info *coherent_set_entry = NULL; coherent_set_entry = (coherent_set_entity_info*) wmem_map_lookup(coherent_set_tracking.entities_using_map, &coherent_set_entity_info_object->guid); if (coherent_set_entry) { coherent_set_info *coherent_set_info_entry; coherent_set_key key; /* The hash and compare functions treat the key as a sequence of bytes. */ memset(&key, 0, sizeof(key)); key.guid = coherent_set_entity_info_object->guid; key.coherent_set_seq_number = coherent_set_entry->coherent_set_seq_number; coherent_set_info_entry = (coherent_set_info*)wmem_map_lookup(coherent_set_tracking.coherent_set_registry_map, &key); if (coherent_set_info_entry && (coherent_set_entry->expected_coherent_set_end_writers_seq_number == coherent_set_entity_info_object->writer_seq_number) && !coherent_set_info_entry->is_set) { coherent_set_info_entry->is_set = true; coherent_set_info_entry->writer_seq_number = coherent_set_entry->expected_coherent_set_end_writers_seq_number - 1; } } } static uint16_t rtps_util_add_protocol_version(proto_tree *tree, /* Can NOT be NULL */ tvbuff_t *tvb, int offset) { proto_item *ti; proto_tree *version_tree; uint16_t 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_uint8(tvb, offset), tvb_get_uint8(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. */ static uint16_t rtps_util_add_vendor_id(proto_tree *tree, tvbuff_t *tvb, int offset) { uint8_t major, minor; uint16_t vendor_id; major = tvb_get_uint8(tvb, offset); minor = tvb_get_uint8(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; */ static int rtps_util_add_locator_t(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, const unsigned encoding, const char *label) { proto_tree *ti; proto_tree *locator_tree; uint32_t kind; uint32_t port; const int parameter_size = 24; locator_tree = proto_tree_add_subtree(tree, tvb, offset, parameter_size, 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_uint( locator_tree, hf_rtps_locator_port, tvb, offset + 4, 4, encoding, &port); if (port == 0) expert_add_info(pinfo, ti, &ei_rtps_locator_port); proto_item_append_text(tree, " (%s, %s:%u)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), tvb_ip_to_str(pinfo->pool, tvb, offset + 20), port); proto_tree_add_item(locator_tree, hf_rtps_locator_ipv4, tvb, offset + 20, 4, ENC_BIG_ENDIAN); break; } case LOCATOR_KIND_TCPV4_LAN: case LOCATOR_KIND_TCPV4_WAN: case LOCATOR_KIND_TLSV4_LAN: case LOCATOR_KIND_TLSV4_WAN: { uint16_t ip_kind; ti = proto_tree_add_item_ret_uint( 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_uint16(tvb, offset+16, encoding); if (ip_kind == 0xFFFF) { /* IPv4 format */ uint16_t public_address_port = tvb_get_uint16(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 = %u)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), tvb_ip_to_str(pinfo->pool, 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 = %u)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), tvb_ip6_to_str(pinfo->pool, tvb, offset + 8), port); } break; } case LOCATOR_KIND_SHMEM: { uint32_t hostId; ti = proto_tree_add_item_ret_uint( 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 = %u)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), hostId, port); break; } case LOCATOR_KIND_UDPV6: { ti = proto_tree_add_item_ret_uint( locator_tree, hf_rtps_locator_port, tvb, offset + 4, 4, encoding, &port); if (port == 0) expert_add_info(pinfo, ti, &ei_rtps_locator_port); proto_tree_add_item(locator_tree, hf_rtps_locator_ipv6, tvb, offset+8, 16, ENC_NA); proto_item_append_text(tree, " (%s, %s:%u)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), tvb_ip6_to_str(pinfo->pool, tvb, offset + 8), port); break; } case LOCATOR_KIND_DTLS: { proto_tree_add_item_ret_uint( 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:%u)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), tvb_ip6_to_str(pinfo->pool, tvb, offset + 8), port); break; } /* * +-------+-------+-------+-------+ * | Flags | | * +-------+ + * | DDS_Octet UUID[9] | * + +-------+-------+ * | | public_port | * +-------+-------+-------+-------+ * | DDS_Octet public_ip_address[4]| * +-------+-------+-------+-------+ */ case LOCATOR_KIND_UDPV4_WAN: { uint8_t flags = 0; ws_in4_addr locator_ip = 0; const uint32_t uuid_size = 9; const uint32_t locator_port_size = 4; const uint32_t locator_port_offset = offset + 4; const uint32_t flags_offset = locator_port_offset + locator_port_size; const uint32_t uuid_offset = flags_offset + 1; const uint32_t port_offset = uuid_offset + uuid_size; const uint32_t ip_offset = port_offset + 2; int hf_port = 0; int hf_ip = 0; char* ip_str = NULL; uint32_t public_port = 0; bool is_public = false; ti = proto_tree_add_item_ret_uint( locator_tree, hf_rtps_locator_port, tvb, locator_port_offset, locator_port_size, encoding, &port); flags = tvb_get_int8(tvb, flags_offset); proto_tree_add_bitmask_value( locator_tree, tvb, flags_offset, hf_rtps_udpv4_wan_locator_flags, ett_rtps_flags, UDPV4_WAN_LOCATOR_FLAGS, (uint64_t)flags); /* UUID */ proto_tree_add_item(locator_tree, hf_rtps_uuid, tvb, uuid_offset, UUID_SIZE, encoding); /* * The P flag indicates that the locator contains a globally public IP address * and public port where a transport instance can be reached. public_ip_address * contains the public IP address and public_port contains the public UDP port. * Locators with the P flag set are called PUBLIC locators. */ is_public = ((flags & FLAG_UDPV4_WAN_LOCATOR_P) != 0); if (is_public) { hf_ip = hf_rtps_udpv4_wan_locator_public_ip; hf_port = hf_rtps_udpv4_wan_locator_public_port; } else { hf_ip = hf_rtps_udpv4_wan_locator_local_ip; hf_port = hf_rtps_udpv4_wan_locator_local_port; } /* Port & IP */ ip_str = tvb_ip_to_str(pinfo->pool, tvb, ip_offset); locator_ip = tvb_get_ipv4(tvb, ip_offset); if (locator_ip != 0) { proto_tree_add_item_ret_uint( locator_tree, hf_port, tvb, port_offset, 2, ENC_NA, &public_port); proto_tree_add_ipv4( locator_tree, hf_ip, tvb, ip_offset, 4, locator_ip); } if (port == 0) expert_add_info(pinfo, ti, &ei_rtps_locator_port); if (ip_str != NULL && locator_ip != 0) { if (is_public) { proto_item_append_text(tree, " (%s, public: %s:%u, rtps port:%u)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), ip_str, public_port, port); } else { proto_item_append_text(tree, " (%s, local: %s:%u)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), ip_str, port); } } } /* Default case, we already have the locator kind so don't do anything */ default: break; } return offset + parameter_size; } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next bytes interpreted as Sequence of * unsigned shorts. * The formatted buffer is: val1, val2, val3, ... * Returns the new updated offset */ static int rtps_util_add_seq_short(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_item, const unsigned encoding, int param_length _U_, const char *label) { uint32_t num_elem; uint32_t i; proto_tree *string_tree; num_elem = tvb_get_uint32(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, 2, encoding); offset += 2; } return offset; } static int rtps_util_add_locator_ex_t(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, const unsigned encoding, int param_length) { int locator_offset = 0; locator_offset = rtps_util_add_locator_t(tree, pinfo, tvb, offset, encoding, "locator"); offset += rtps_util_add_seq_short(tree, tvb, locator_offset, hf_rtps_encapsulation_id, encoding, param_length - (locator_offset - offset), "encapsulations"); return offset; } /* ------------------------------------------------------------------------- */ /* 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 */ static int rtps_util_add_locator_list(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, const uint8_t *label, const unsigned encoding) { proto_tree *locator_tree; uint32_t num_locators; num_locators = tvb_get_uint32(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) { uint32_t i; char temp_buff[20]; for (i = 0; i < num_locators; ++i) { 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 bytes interpreted as a list of * multichannel Locators: * - unsigned long numLocators * - locator 1 * - locator 2 * - ... * - locator n * Returns the new offset after parsing the locator list */ static int rtps_util_add_multichannel_locator_list(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, const uint8_t *label, const unsigned encoding) { proto_tree *locator_tree; uint32_t num_locators; num_locators = tvb_get_uint32(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) { uint32_t i; for (i = 0; i < num_locators; ++i) { proto_tree *ti, *locator_item_tree; uint32_t kind; uint32_t port; char *channel_address; locator_item_tree = proto_tree_add_subtree(locator_tree, tvb, offset, 24, ett_rtps_locator, NULL, label); proto_tree_add_item_ret_uint(locator_item_tree, hf_rtps_locator_kind, tvb, offset, 4, encoding, &kind); switch (kind) { case LOCATOR_KIND_UDPV4: case LOCATOR_KIND_TUDPV4: { proto_tree_add_item(locator_item_tree, hf_rtps_locator_ipv4, tvb, offset + 16, 4, ENC_BIG_ENDIAN); channel_address = tvb_ip_to_str(pinfo->pool, tvb, offset + 16); break; } case LOCATOR_KIND_UDPV6: { proto_tree_add_item(locator_tree, hf_rtps_locator_ipv6, tvb, offset + 4, 16, ENC_NA); channel_address = tvb_ip6_to_str(pinfo->pool, tvb, offset + 4); proto_item_append_text(tree, " (%s, %s)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), tvb_ip6_to_str(pinfo->pool, tvb, offset + 4)); break; } /* Default case, Multichannel locators only should be present in UDPv4 and UDPv6 transports * Unknown address format. * */ default: offset += 24; continue; break; } ti = proto_tree_add_item_ret_uint(locator_item_tree, hf_rtps_locator_port, tvb, offset + 20, 4, encoding, &port); if (port == 0) expert_add_info(pinfo, ti, &ei_rtps_locator_port); proto_item_append_text(tree, " (%s, %s:%u)", val_to_str(kind, rtps_locator_kind_vals, "%02x"), channel_address, port); offset += 24; } } return offset; } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next 4 bytes interpreted as IPV4Address_t */ static void rtps_util_add_ipv4_address_t(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, const unsigned encoding, int hf_item) { proto_item *ti; ti = proto_tree_add_item(tree, hf_item, tvb, offset, 4, encoding); if (tvb_get_ntohl(tvb, offset) == 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; * */ static void rtps_util_add_locator_udp_v4(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, const uint8_t *label, const unsigned encoding) { proto_item *ti; proto_tree *locator_tree; uint32_t 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, int 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 uint8_t *label) { uint64_t prefix; uint32_t host_id, app_id, instance_id; uint8_t app_kind; proto_item *ti; proto_tree *guid_tree, *appid_tree; const uint8_t *safe_label = (label == NULL) ? (const uint8_t *)"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, int 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. */ static bool rtps_util_add_entity_id(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_item, int hf_item_entity_key, int hf_item_entity_kind, int subtree_entity_id, const char *label, uint32_t *entity_id_out) { uint32_t entity_id = tvb_get_ntohl(tvb, offset); uint32_t entity_key = (entity_id >> 8); uint8_t 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). */ static void rtps_util_add_generic_entity_id(proto_tree *tree, tvbuff_t *tvb, int offset, const char *label, int hf_item, int hf_item_entity_key, int hf_item_entity_kind, int subtree_entity_id) { uint32_t entity_id = tvb_get_ntohl(tvb, offset); uint32_t entity_key = (entity_id >> 8); uint8_t 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, int 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) { uint64_t prefix; uint32_t 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); } /* ------------------------------------------------------------------------- */ /* Insert in the protocol tree the next data interpreted as a String * Returns the new offset (after reading the string) * XXX - should check that string length field makes sense, possibly by * comparing to a passed-in container length (cf. #19359) */ static int rtps_util_add_string(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_item, const unsigned encoding) { uint32_t size; proto_tree_add_item_ret_uint(tree, hf_rtps_string_length, tvb, offset, 4, encoding, &size); proto_tree_add_item(tree, hf_item, tvb, offset+4, size, ENC_ASCII); /* 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); } static int rtps_util_add_data_tags(proto_tree *rtps_parameter_tree, tvbuff_t *tvb, int offset, const unsigned encoding, int param_length) { /* 0...2...........7...............15.............23...............31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Sequence Size | * +ITEM 0---------+---------------+---------------+---------------+ * | Name String Bytes | * +---------------+---------------+---------------+---------------+ * | Value String Bytes | * +---------------+---------------+---------------+---------------+ * .... * +ITEM N---------+---------------+---------------+---------------+ * | Name String Bytes | * +---------------+---------------+---------------+---------------+ * | Value String Bytes | * +---------------+---------------+---------------+---------------+ */ proto_tree *tags_seq_tree = NULL; proto_tree *tag_tree = NULL; uint32_t seq_sum_elements, i; seq_sum_elements = tvb_get_uint32(tvb, offset, encoding); offset += 4; tags_seq_tree = proto_tree_add_subtree_format(rtps_parameter_tree, tvb, offset - 4, param_length, ett_rtps_data_tag_seq, NULL, "Tags (size = %u)", seq_sum_elements); for (i = 0; i < seq_sum_elements; ++i) { uint32_t initial_offset = offset; tag_tree = proto_tree_add_subtree_format(tags_seq_tree, tvb, offset, -1, ett_rtps_data_tag_item, NULL, "Tag [%u]", i); offset = rtps_util_add_string(tag_tree, tvb, offset, hf_rtps_data_tag_name, encoding); offset = rtps_util_add_string(tag_tree, tvb, offset, hf_rtps_data_tag_value, encoding); proto_item_set_len(tag_tree, offset - initial_offset); } return offset; } /* ------------------------------------------------------------------------- */ /* 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, int 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) { uint32_t 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. */ static uint64_t rtps_util_add_seq_number(proto_tree *tree, tvbuff_t *tvb, int offset, const unsigned encoding, const char *label) { uint64_t hi = (uint64_t)tvb_get_uint32(tvb, offset, encoding); uint64_t lo = (uint64_t)tvb_get_uint32(tvb, offset+4, encoding); uint64_t all = (hi << 32) | lo; proto_tree_add_int64_format(tree, hf_rtps_sm_seq_number, tvb, offset, 8, all, "%s: %" PRIu64, 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, int offset, const unsigned encoding, int transport_index) { int32_t classId = tvb_get_uint32(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_const(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, int offset, const unsigned 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, int offset, const unsigned encoding, int hf_time _U_) { char tempBuffer[MAX_TIMESTAMP_SIZE]; double absolute; int32_t sec; uint32_t frac; if (tree) { proto_tree *time_tree; sec = tvb_get_uint32(tvb, offset, encoding); frac = tvb_get_uint32(tvb, offset+4, encoding); if ((sec == 0x7fffffff) && (frac == 0xffffffff)) { (void) g_strlcpy(tempBuffer, "INFINITE", MAX_TIMESTAMP_SIZE); } else if ((sec == 0) && (frac == 0)) { (void) g_strlcpy(tempBuffer, "0 sec", MAX_TIMESTAMP_SIZE); } else { absolute = (double)sec + (double)frac / ((double)(0x80000000) * 2.0); 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 port (unsigned * 32-bit integer) */ static void rtps_util_add_port(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, const unsigned encoding, int hf_item) { proto_item *ti; uint32_t 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 */ static void rtps_util_add_durability_service_qos(proto_tree *tree, tvbuff_t *tvb, int offset, const unsigned 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. */ static void rtps_util_add_liveliness_qos(proto_tree *tree, tvbuff_t *tvb, int offset, const unsigned 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, int offset, int vendor_id) { proto_tree *subtree; uint8_t major, minor, release, revision; int release_offset; int revision_offset; release_offset = 2; revision_offset = 3; major = tvb_get_uint8(tvb, offset); minor = tvb_get_uint8(tvb, offset+1); release = tvb_get_uint8(tvb, offset+2); revision = tvb_get_uint8(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%s", major, minor, format_char(wmem_packet_scope(), 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%s rev%d", major, minor, format_char(wmem_packet_scope(), 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) { /* In Micro < 3.0.0 release and revision numbers are switched */ if (major < 3) { revision = revision ^ release; release = revision ^ release; revision = revision ^ release; revision_offset = revision_offset ^ release_offset; release_offset = revision_offset ^ release_offset; revision_offset = revision_offset ^ release_offset; } if (revision != 0) { 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 { subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL, "Product version: %d.%d.%d", major, minor, release); } } 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 major revision is smaller than 5, release interpreted as char */ if (vendor_id == RTPS_VENDOR_RTI_DDS && major < 5) { proto_tree_add_item(subtree, hf_rtps_param_product_version_release_as_char, tvb, offset + release_offset, 1, ENC_ASCII); } else { proto_tree_add_item(subtree, hf_rtps_param_product_version_release, tvb, offset + release_offset, 1, ENC_NA); } proto_tree_add_item(subtree, hf_rtps_param_product_version_revision, tvb, offset + revision_offset, 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 */ static int rtps_util_add_seq_string(proto_tree *tree, tvbuff_t *tvb, int offset, const unsigned encoding, int hf_numstring, int hf_string, const char *label) { uint32_t size; int32_t i, num_strings; const char *retVal; proto_tree *string_tree; int 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_uint32(tvb, offset, encoding); retVal = (const char* )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 */ static int rtps_util_add_seq_ulong(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_item, const unsigned encoding, int param_length _U_, const char *label) { uint32_t num_elem; uint32_t i; proto_tree *string_tree; num_elem = tvb_get_uint32(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; } /* ------------------------------------------------------------------------- */ static const char *rtps_util_typecode_id_to_string(uint32_t 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 */ // NOLINTNEXTLINE(misc-no-recursion) static int rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, const unsigned encoding, int indent_level, int is_pointer, uint16_t bitfield, int is_key, const int offset_begin, char *name, int seq_max_len, /* -1 = not a sequence field */ uint32_t *arr_dimension, /* if !NULL: array of 10 int */ int ndds_40_hack) { const int original_offset = offset; uint32_t tk_id; uint16_t tk_size; unsigned int i; char *indent_string; int 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_uint32(tvb, offset, encoding); offset += 4; /* Gets TK size */ tk_size = tvb_get_uint16(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; } (void) g_strlcpy(type_name, rtps_util_typecode_id_to_string(tk_id), sizeof(type_name)); /* 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 * * ::= * *